Verifying a Sign-In Server-Side
Verifying the signature is how your server establishes a trusted player identity: proof that the user actually controls the wallet they claim, rather than just supplying a name or address. You need this anywhere your server attributes something to a player — for example, bookmarks tied to a player, chat messages shown as coming from a particular character, or leaderboards built from parsed logs. Without this check, a client can claim to be any wallet.
Verifying a sign-in works by having the user sign a personal message with EVE Vault (via the wallet's signPersonalMessage) and verifying that signature on your server. This page shows the flow end to end: issue a nonce, have the wallet sign a message built from it, and verify the personal message signature server-side.
Prerequisites
@mysten/suiinstalled on your server.A
SuiClientfor the network your users are on.Somewhere to store a pending nonce per session (cache, DB, signed cookie).
EVE Vault addresses are zkLogin addresses, so the verifier needs a client to check the zkLogin proof against the current epoch. An offline verify will not work.
Steps
Issue a nonce. Generate a random, single-use, short-lived nonce. Store it against the session and send it to the client.
Have the client sign it as a personal message. The dApp builds the agreed message from the nonce and signs it with the wallet's
signPersonalMessage, then posts back the resultingsignatureand theaddressit claims to be.Rebuild the message from the nonce you stored — do not use any message bytes from the request.
signPersonalMessagereturns{ bytes, signature }; verifying against those returnedbyteslets any message the wallet has ever signed be replayed with a fresh nonce.Verify the signature against the rebuilt message, passing the claimed
addressso the check also confirms who signed it.Consume the nonce once verification succeeds, so the same challenge cannot be used twice.
Full example
The address option makes the verifier reject a signature that is valid but was produced by a different wallet, so a signature over your challenge from one account cannot be claimed by another.
Summary
The nonce is random, single-use, and expires.
The message is rebuilt on the server from the stored nonce.
Client-supplied message bytes are never passed to the verifier.
A
clientis passed so the zkLogin proof is verified against the current epoch.The signer is bound to the claimed address (via the
addressoption or an explicit compare).The nonce is consumed once verification succeeds.
Last updated

