Use message signing for authentication, verification, or any scenario where you need proof of wallet ownership without a transaction.
The flow
- User generates code at actioncode.app
- User shares code with your app
- Your app creates a message and attaches it
- User signs in their wallet
- Your app gets the signed message
Authentication example
Simple verification
For simpler cases where you just need proof of ownership:
Best practices for auth messages
- Include a nonce — Prevents replay attacks
- Include a timestamp — Allow time-based expiry
- Include the wallet address — Confirms which wallet is signing
- Use a recognizable format — Users should understand what they’re signing
Signature verification
The signed message format depends on the wallet. For Solana, you’ll typically verify using ed25519:
Different wallets may encode signatures differently. Test with your target wallets (Phantom, Solflare, etc.) to ensure compatibility.