moth docs
Reference Sign in with a wallet

Sign in with a wallet

Signs in with a wallet on Robinhood Chain and returns a session for the account endpoints. Moth Console does this for you.

POSThttps://api.runmoth.si/v1/auth/verify
  1. Get a nonceGET/auth/nonce gives a nonce for ten minutes, the domain and chain 4663
  2. SignThe wallet signs a Sign-In with Ethereum message. No transaction, no gas
  3. VerifyPOST/auth/verify takes the message and its signature
  4. Session24 hA ses_ token, sent as Bearer to the account endpoints
The message is a Sign-In with Ethereum message (EIP-4361) carrying the nonce, domain, uri and chain. A nonce works once, and a new wallet gets a new account.

Body

messagerequired

The signed message, as signed.

signaturerequired

The wallet's signature, as 0x hex.

Send the ses_ token as Authorization: Bearer to the account endpoints. A session lasts 24 hours, or less when the message says so, and POST /auth/logout ends it early.

Errors

400invalid_request_errorThe message or the signature is missing
401authentication_errorThe signature, nonce, domain or chain didn't check out, so get a new nonce and sign again
429rate_limit_errorToo many sign-in attempts from this address
curl https://api.runmoth.si/v1/auth/verify \
  -H "Content-Type: application/json" \
  -d '{ "message": "runmoth.si wants you to sign in with your Ethereum account:\n0x5aE1…", "signature": "0x8b2f…" }'
Response
{
  "token": "ses_…",
  "expires_at": "2026-10-31T09:00:00.000Z",
  "address": "0x5aE1…c09B",
  "account_id": "acct_…"
}