Overview
Sign In With Ethereum (SIWE, EIP-4361) lets users authenticate using an Ethereum wallet they already own. Instead of a password or OTP, the user signs a structured message with their private key, proving ownership of an address. This approach is ideal when:- Your users already have Ethereum wallets (MetaMask, Coinbase Wallet, hardware wallets, etc.)
- You want a crypto-native sign-in experience without email or phone number requirements
- You need to tie the user wallet identity to an on-chain address
How it works
SIWE authentication is a two-step flow:Step 1: Initiate — request a challenge message
Step 1: Initiate — request a challenge message
Your app calls
signInWithSiwe with the user’s Ethereum address and context about your application. CDP returns a standards-compliant EIP-4361 message containing a cryptographic nonce, expiration time, and the parameters you provided. Present this message to the user’s wallet for signing.Step 2: Verify — submit the signature
Step 2: Verify — submit the signature
After the user signs the message with their wallet, call
verifySiweSignature with the flowId from step 1 and the resulting signature. CDP verifies the signature on-chain, and on success, returns an authenticated user with a user wallet.Security features
Security features
- Cryptographic proof: Authentication requires a valid signature from the private key controlling the address — no credential sharing
- Replay protection: Each challenge contains a unique nonce and an expiration time
- Domain binding: The
domainfield ties the signed message to your application, preventing cross-site replay attacks - Rate limiting: Protection against brute force attempts
SDK integration
React
Use theuseSignInWithSiwe and useVerifySiweSignature hooks from @coinbase/cdp-hooks:
Non-React
For vanilla JavaScript/TypeScript or other frameworks, import directly from@coinbase/cdp-core:
Parameters
signInWithSiwe options
signInWithSiwe result
verifySiweSignature options
verifySiweSignature result
Optional message fields
You can include astatement to display a human-readable action the user is approving, and resources to enumerate URIs the user acknowledges:
What to read next
- Authentication Methods: Overview of all authentication options
- Auth Method Linking: Link SIWE to email, SMS, or OAuth on the same wallet
- Session Management: Understand session lifecycle and token management
- Implementation Guide: Step-by-step integration patterns