Skip to content

chore(extensions): migrate to @signinwithethereum/siwe#1917

Open
caveman-eth wants to merge 1 commit intox402-foundation:mainfrom
caveman-eth:main
Open

chore(extensions): migrate to @signinwithethereum/siwe#1917
caveman-eth wants to merge 1 commit intox402-foundation:mainfrom
caveman-eth:main

Conversation

@caveman-eth
Copy link
Copy Markdown

Migrates @x402/extensions from the old Spruce siwe package (v2.3.2) to @signinwithethereum/siwe (Ethereum Identity Foundation, v4.1.0).

The Spruce siwe package is no longer actively maintained.

Stewardship of the SIWE standard has moved to the Ethereum Identity Foundation (GitHub). @signinwithethereum/siwe is the official successor TypeScript implementation. The new package:

  • Supports viem natively as a peer dependency (alongside optional ethers)
  • Has first-class EIP-1271 and EIP-6492 smart wallet verification
  • Maintains the same SiweMessage API — constructor and prepareMessage() are identical

Changes:

File Change
typescript/packages/extensions/package.json "siwe": "^2.3.2""@signinwithethereum/siwe": "^4.1.0"
typescript/packages/extensions/src/sign-in-with-x/evm.ts Updated import path
typescript/.changeset/migrate-siwe-to-eif.md Changeset fragment

The legacy example at examples/typescript/legacy/fullstack/auth_based_pricing/ also depends on siwe directly — intentionally left untouched as it's in the legacy directory.

Tests

All 384 extension tests pass, including all 79 sign-in-with-x tests. No behavioral changes.

pnpm --filter @x402/extensions test

 ✓ test/eip2612-gas-sponsoring.test.ts (9 tests)
 ✓ test/facilitatorClient.test.ts (10 tests)
 ✓ test/erc20-approval-gas-sponsoring.test.ts (15 tests)
 ✓ test/payment-identifier.test.ts (77 tests)
 ✓ test/bazaar.test.ts (82 tests)
 ✓ test/offer-receipt.test.ts (112 tests)
 ✓ test/sign-in-with-x.test.ts (79 tests)

 Test Files  7 passed (7)
      Tests  384 passed (384)

Format and lint pass clean:

pnpm format  # All matched files use Prettier code style!
pnpm lint    # 0 errors

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge) -- you may need to rebase if you initially pushed unsigned commits
  • I added a changelog fragment for user-facing changes (docs-only changes can skip)

Migrate the SIWE dependency to the Ethereum Identity Foundation package. package.json now depends on @signinwithethereum/siwe; evm.ts import was updated to import SiweMessage from the new package. Added a changeset describing the migration. (pnpm lock updated to reflect the dependency change.)
@github-actions github-actions bot added typescript sdk Changes to core v2 packages labels Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk Changes to core v2 packages typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant