Skip to content

fix: emit EIP-4361-compliant SIWX message for EVM in Reown Cloud Auth#5683

Open
rtomas wants to merge 1 commit into
mainfrom
rtomas/siwx-evm-phantom-signmessage
Open

fix: emit EIP-4361-compliant SIWX message for EVM in Reown Cloud Auth#5683
rtomas wants to merge 1 commit into
mainfrom
rtomas/siwx-evm-phantom-signmessage

Conversation

@rtomas
Copy link
Copy Markdown
Contributor

@rtomas rtomas commented Jun 3, 2026

Description

📍 Important: Merge after https://github.com/reown-com/web-monorepo/pull/2863

Phantom (and other strict EIP-4361 wallets) rejected the Reown Cloud Auth sign-in message on EVM with "The app's signature request cannot be shown due to invalid formatting" and never showed the prompt, because the message used the CAIP-2 chain id (Chain ID: eip155:1) instead of the decimal EIP-155 id (Chain ID: 1) and emitted only one blank line after the address instead of the two EIP-4361 requires for the empty statement block. ReownAuthenticationMessenger now emits the decimal chain id and the correct blank-line structure, scoped to the EVM (eip155) namespace only — non-EVM messages (Solana, Bitcoin, ...) are byte-for-byte unchanged. The unit test expectation was updated accordingly and a changeset added. Note: the Reown Cloud Auth backend validates the message server-side, so it must accept the EIP-4361-compliant format (lands in lockstep).

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

N/A

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

🤖 Generated with Claude Code

Phantom (and other strict EIP-4361 wallets) rejected the Reown Cloud Auth
sign-in message on EVM with "invalid formatting" and never showed the prompt.
The message used the CAIP-2 chain id (`Chain ID: eip155:1`) instead of the
decimal EIP-155 id (`Chain ID: 1`), and emitted a single blank line after the
address instead of the two EIP-4361 requires for the empty statement block.

ReownAuthenticationMessenger now emits the decimal chain id and the correct
blank-line structure for the EVM (eip155) namespace only; non-EVM messages
(Solana, Bitcoin, ...) are byte-for-byte unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 3, 2026

🦋 Changeset detected

Latest commit: 44a0239

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 26 packages
Name Type
@reown/appkit-controllers Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-ton Patch
@reown/appkit-adapter-tron Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit Patch
@reown/appkit-ui Patch
@reown/appkit-core Patch
@reown/appkit-utils Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-wallet-button Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-cdn Patch
@reown/appkit-universal-connector Patch
@reown/appkit-testing Patch
@reown/appkit-common Patch
@reown/appkit-polyfills Patch
@reown/appkit-wallet Patch
@reown/appkit-cli Patch
@reown/appkit-codemod Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
appkit-demo Building Building Preview, Comment Jun 3, 2026 10:26pm
appkit-gallery Ready Ready Preview, Comment Jun 3, 2026 10:26pm
appkit-headless-sample-app Building Building Preview, Comment Jun 3, 2026 10:26pm
appkit-laboratory Building Building Preview, Comment Jun 3, 2026 10:26pm
9 Skipped Deployments
Project Deployment Actions Updated (UTC)
appkit-basic-example Ignored Ignored Jun 3, 2026 10:26pm
appkit-basic-sign-client-example Ignored Ignored Jun 3, 2026 10:26pm
appkit-basic-up-example Ignored Ignored Jun 3, 2026 10:26pm
appkit-ethers5-bera Ignored Ignored Jun 3, 2026 10:26pm
appkit-nansen-demo Ignored Ignored Jun 3, 2026 10:26pm
appkit-wagmi-cdn-example Ignored Ignored Jun 3, 2026 10:26pm
ethereum-provider-wagmi-example Ignored Ignored Jun 3, 2026 10:26pm
next-wagmi-solana-bitcoin-example Ignored Ignored Jun 3, 2026 10:26pm
vue-wagmi-example Ignored Ignored Jun 3, 2026 10:26pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Visual Regression Test Results ✅ Passed

⚠️ 15 visual change(s) detected

Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=926
Storybook Preview: https://6493191bf4b10fed8ca7353f-lhvdusgbtc.chromatic.com/

👉 Please review the visual changes in Chromatic and accept or reject them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant