chore: Migrate SIWE dependency to @signinwithethereum/siwe v4 - #8497
chore: Migrate SIWE dependency to @signinwithethereum/siwe v4#8497caveman-eth wants to merge 3 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
c500fd3 to
abf04a9
Compare
abf04a9 to
5dc2a17
Compare
5dc2a17 to
0889956
Compare
Swap SpruceID-maintained SIWE packages for the @signinwithethereum scoped packages and update usages. Update package.json dependencies and imports (controller-utils: siwe.ts, siwe.test.ts; profile-sync-controller: flow-siwe.ts) and add changelog notes describing the migration. Uses @signinwithethereum/siwe-parser and @signinwithethereum/siwe ^4.2.0 — maintained by the Ethereum Identity Foundation and backward-compatible (parser v4.2.0 relaxes EIP-55 checksum enforcement and surfaces non-fatal warnings).
Replace placeholder PR links [#XXXX] with the actual PR number [MetaMask#8497] in CHANGELOG.md for packages/controller-utils and packages/profile-sync-controller. These entries document the replacement of the old siwe packages with the @signinwithethereum scoped packages.
0889956 to
6b91d4d
Compare
|
Let me know if you guys have any questions around this. |
|
bumping this up |
|
Thanks for the PR @caveman-eth PR looks good to me and hopefully be ready after fixing conflicts 🙏 |
Hey great - I've resolved the conflicts and merged in main |
|
Hey @caveman-eth I think we have two issues here:
Important: the package's runtime behavior is fine (dual CJS/ESM exports are correctly set up, and our Jest tests - which bypass ts-bridge - pass). This is purely a type-declaration packaging gap upstream, not a real incompatibility. Can we publish conditional type declarations (
This PR is from a fork ( When we have fix for the first issue, I can update the version and give another try? |
|
@OGPoyraz, thanks for digging into this.
import → .d.mts + .mjs https://www.npmjs.com/package/@signinwithethereum/siwe/v/4.2.1 Age gate: Core’s Yarn config waits 3 days after publish (npmMinimalAgeGate: 4320). 4.2.1 went up at 2026-09-01 16:50 UTC, so yarn install should accept it around 2026-09-04 16:50 UTC. Happy to bump this PR (or #10049) as soon as that window opens.
|
|
Hey @caveman-eth, thanks for the quick turnaround on The only remaining blocker is the Once that clears I'll bump both Thanks again for staying on top of this 🙏 |
|
@OGPoyraz great, sounds good. I'll ping you here after 2026-09-04 16:50 UTC :) |
Superseeds #8419 (couldn't reopen due to force-push).
Explanation
Current state
The monorepo depends on two SIWE (Sign-In With Ethereum / EIP-4361) packages originally maintained by Spruce:
@spruceid/siwe-parserv2.1.0 — used by@metamask/controller-utilsto detect and parse SIWE messages viadetectSIWE()siwev2.3.2 — used by@metamask/profile-sync-controllerto construct SIWE login messages vianew SiweMessage({...}).prepareMessage()The Spruce
siwepackage is no longer actively maintained.Stewardship of the SIWE standard has moved to the Ethereum Identity Foundation (GitHub).
@signinwithethereum/siweis the official successor TypeScript implementation.Similar migrations:
x402-foundation/x402 x402-foundation/x402#1917,
magiclabs/magic-js magiclabs/magic-js#1074
What this PR does
Swaps the abandoned packages for the actively maintained successors. The
ParsedMessageandSiweMessageclass APIs are identical - same constructors, same fields, same methods. This is purely a dependency swap with import path updates.Files changed:
controller-utilspackage.jsoncontroller-utilssrc/siwe.tscontroller-utilssrc/siwe.test.tsprofile-sync-controllerpackage.jsonprofile-sync-controllersrc/sdk/authentication-jwt-bearer/flow-siwe.tsEIP-55 patches in client repos become obsolete
The old version strictly rejected non checksummed Ethereum addresses in SIWE messages. Because many dApps produce lowercase addresses, both MetaMask client repos maintain patches to disable the check — otherwise
detectSIWEreturns{ isSIWEMessage: false }and users don't see the specialized SIWE approval screen.@signinwithethereum/siwe-parserv4.2.0 (release notes) relaxes this:warnings: string[]field ofParsedMessageSiweMessageinstances are normalized to EIP-55If the client repos upgrade to this version of
controller-utils, they can delete these patches and any relatedpackage.jsonresolutions:metamask-extension/.yarn/patches/@spruceid-siwe-parser-npm-2.1.0-060b7ede7a.patchmetamask-mobile/patches/@spruceid+siwe-parser+2.1.0.patchReferences
@signinwithethereum/siwe-parseron npm@signinwithethereum/siweon npmChecklist
Note
Medium Risk
Changes SIWE parsing and login message construction on auth-related paths; APIs are intended to be compatible, but v4.2.0 address-checksum behavior differs from the old strict parser.
Overview
Replaces unmaintained Spruce SIWE packages with @signinwithethereum successors (^4.2.0) in
@metamask/controller-utilsand@metamask/profile-sync-controller.controller-utilsswaps@spruceid/siwe-parserfor@signinwithethereum/siwe-parserand updates imports insiwe.ts/ tests.detectSIWEstill usesParsedMessagethe same way.profile-sync-controllerdrops thesiwepackage for@signinwithethereum/siweand updatesflow-siwe.tsso JWT SIWE login still builds messages vianew SiweMessage({...}).prepareMessage().Changelogs note that v4.2.0 relaxes EIP-55 parsing: all-lowercase or all-uppercase addresses parse (with optional
warnings); only bad mixed-case checksums fail. That may let extension/mobile remove local parser patches once they pick up this core release.Reviewed by Cursor Bugbot for commit 0ae4c09. Bugbot is set up for automated code reviews on this repo. Configure here.