icon

Treat wallet sign-in as a scoped authentication ceremony

Security editorial team
Treat wallet sign-in as a scoped authentication ceremony
  • Author:
  • Sunny Security Labs

    Security editorial team

A wallet signature can show that a user controls a particular address for a particular request. The application still has to decide what that proves and what session to create. Start by separating sign-in from approvals and transactions in the user interface. A person connecting a wallet should be able to tell which site requested the message and what may happen after approval.

Bind the challenge to the request

Use a structured standard such as Sign-In with Ethereum where it fits. Generate a fresh, single-purpose nonce at the server and bind it to a short-lived login attempt. Validate the signed domain, URI, network context, nonce and relevant times against your application policy. Use the signature verification method suitable for the account type, including contract wallets if your product supports them. Consume a successful nonce atomically so concurrent attempts cannot reuse it.

Design the account lifecycle

Choose how a wallet address relates to the application account and which actions require additional verification. Linking a wallet to an existing account or replacing a wallet is an account change with a different risk from signing in. Give users a clear way to end the app session and consider when sessions should expire or be revoked after a wallet is unlinked.

Check the messages people see

Review the wallet prompt on the clients your audience uses, and check a normal sign-in, an expired request and a request for an unexpected origin in a controlled environment. Make sure errors explain the next action without exposing sign-in secrets. Keep records of successful link changes and the policy used to authorize them.

Sources

Request a quote
Book a consultation