[GH-ISSUE #8116] SIWE is incompatible with one-step wallet authentication #19630

Open
opened 2026-04-15 18:54:27 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @chris13524 on GitHub (Feb 23, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/8116

Is this suited for github?

  • Yes, this is suited for github

The current SIWE implementation associates nonces with a specific wallet address & chain ID. This works for wallet connection scenarios where the first step is connecting the wallet, and the second step is signing a SIWE payload for a particular address.

However, with WalletConnect One-click Auth, we simplify this 2-step interaction to 1-step: connect and sign SIWE in the same step. This improves UX greatly, but unfortunately is incompatible with Better Auth since its nonce generation requires the wallet address and chain ID as parameters, which are unknown to the app prior to connection starting.

Describe the solution you'd like

The solution should be simple: removing the associated address and chain ID. Only a unique ID per-session necessary to prevent replay attacks, and doesn't need to be associated with a session or wallet address. Furthermore, there's nothing in the SIWE spec that says that nonces must be unique per-account. The current constraint simply seems unnecessary for the security that the nonce provides.

Describe alternatives you've considered

  • Disabling one-click auth for WalletConnect connections -> would worsen UX
  • Forking Better Auth to modify this behavior -> would introduce a fork unnecessarily

Additional context

No response

Originally created by @chris13524 on GitHub (Feb 23, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/8116 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. The current SIWE implementation [associates](https://github.com/better-auth/better-auth/blob/0ce6c7ed7aaefa392fb0c9e649cb0ce2c04e29aa/packages/better-auth/src/plugins/siwe/index.ts#L64) nonces with a specific wallet address & chain ID. This works for wallet connection scenarios where the first step is connecting the wallet, and the second step is signing a SIWE payload for a particular address. However, with [WalletConnect One-click Auth](https://docs.walletconnect.network/wallet-sdk/web/one-click-auth), we simplify this 2-step interaction to 1-step: connect and sign SIWE in the same step. This improves UX greatly, but unfortunately is incompatible with Better Auth since its nonce generation requires the wallet address and chain ID as parameters, which are unknown to the app prior to connection starting. ### Describe the solution you'd like The solution should be simple: removing the associated address and chain ID. Only a unique ID per-session necessary to prevent replay attacks, and doesn't need to be associated with a session or wallet address. Furthermore, there's nothing in the [SIWE spec](https://eips.ethereum.org/EIPS/eip-4361) that says that nonces must be unique per-account. The current constraint simply seems unnecessary for the security that the nonce provides. ### Describe alternatives you've considered - Disabling one-click auth for WalletConnect connections -> would worsen UX - Forking Better Auth to modify this behavior -> would introduce a fork unnecessarily ### Additional context _No response_
GiteaMirror added the credentialsoauth labels 2026-04-15 18:54:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19630