Wallet authentication
Elysium sign-in challenges, replay protection, session cookies and ownership checks.
On this page
Challenge and verification
The Next.js server generates a gas-free Sign-In with Ethereum challenge bound to the origin, connected wallet, request ID, and Elysium chain ID. The nonce is random, stored as a digest, and expires after five minutes. The verify handler checks the message fields, verifies the signature through Viem, and consumes the challenge atomically before issuing a session. A reused, expired or mismatched challenge fails verification.
Session and access control
The app issues an HttpOnly SameSite=Lax cookie with a seven-day lifetime and uses Secure on HTTPS. The server stores a digest of the session token, expiration and revocation state. Authenticated routes check session validity and match the wallet header to the verified session. Chat and strategy queries scope records to the owner. Logout revokes the server record and removes the cookie. Mutating routes check same-origin where required.
A successful sign-in proves wallet control for the web session. It does not unlock the browser vault or authorize token spending. The legacy sign-in statement remains part of the verification contract.
See Viem, data boundaries, and internal API.

CogniTech