chore: Migrate SIWE dependency to @signinwithethereum/siwe v4#8497
Open
caveman-eth wants to merge 2 commits intoMetaMask:mainfrom
Open
chore: Migrate SIWE dependency to @signinwithethereum/siwe v4#8497caveman-eth wants to merge 2 commits intoMetaMask:mainfrom
caveman-eth wants to merge 2 commits intoMetaMask:mainfrom
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
caveman-eth
added a commit
to caveman-eth/metamask-core
that referenced
this pull request
Apr 16, 2026
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.
4 tasks
c500fd3 to
abf04a9
Compare
caveman-eth
added a commit
to caveman-eth/metamask-core
that referenced
this pull request
Apr 17, 2026
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.
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.
abf04a9 to
5dc2a17
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Primarily a dependency swap, but it changes SIWE parsing/validation semantics (notably EIP-55 checksum handling), which could affect SIWE detection and login flows.
Overview
Updates SIWE dependencies across the monorepo to use the Ethereum Identity Foundation-maintained packages.
In
@metamask/controller-utils, replaces@spruceid/siwe-parserwith@signinwithethereum/siwe-parser(and updatesParsedMessageimports insiwe.tsand tests), noting v4.2.0’s relaxed EIP-55 checksum parsing behavior in the changelog.In
@metamask/profile-sync-controller, replacessiwewith@signinwithethereum/siweand updates theSiweMessageimport used to construct login messages;yarn.lockis updated accordingly (dropping the old SIWE packages and related transitive deps).Reviewed by Cursor Bugbot for commit 5dc2a17. Bugbot is set up for automated code reviews on this repo. Configure here.