Skip to navigation

Open a session with a passkey

Opens a trading session with a passkey. No token is needed: the passkey’s WebAuthn assertion is the authentication.

mint is the SessionMint message exactly as signed, with its camelCase field names; its nonce is a session challenge. It names neither the account nor the passkey, so a client can call navigator.credentials.get with an empty allowCredentials and let the user pick any of their passkeys. assertion is the navigator.credentials.get response whose challenge is the SNIP-12 hash of the SessionMint, base64url-encoded. Its credential id finds the passkey, the stored public key verifies it, and the passkey’s grant names the account. Nothing about the account is checked or answered until the assertion verifies; after that the nonce is spent, so a refused mint needs a new challenge.

The session gets exactly the limits the mint states, each a positive number or none. A mint stating no limits (every amount "" and markets []) gets the ceiling’s: its value for each limit the server enforces, and none (markets ["*"]) for the rest. A number is accepted only for the limits the server enforces; every other limit must be none, and markets ["*"], and is not compared with the ceiling. An enforced limit must fit the ceiling the owner granted the passkey: a number at or below a numeric ceiling or anything under a none one, markets within the ceiling’s. The mint must also stay within the ceiling’s scopes and have an expiry no longer than the ceiling’s session length. A session that would outlive the passkey ends when the passkey expires, and expires_at says so. The passkey can hold at most its ceiling’s number of live sessions. An expiresAt of 0 asks for the longest session the passkey allows: until the passkey expires or for the ceiling’s session length, whichever is sooner. The session key can then sign in with POST /v1/auth, and the session is revoked with DELETE /v2/sessions/{grant_id}. The response names the account, the passkey, who signed its grant (owner_signer_type, stark or eip191), the wallet the account was opened from (owner_wallet, Ethereum or Starknet, empty for none) and the session’s limits, which a client that did not know the account can remember for its next sign-in.

ErrorMeaning
MINT_EXCEEDS_CEILINGA scope, limit or the expiry is outside the passkey’s ceiling.
SESSION_LIMIT_REACHEDThe passkey has its maximum number of live sessions.
LIMIT_INVALIDA limit is empty or malformed, not none where the server does not enforce it, or markets is empty.
ACCOUNT_NOT_ELIGIBLEThe mint lists subaccounts, or the account cannot hold sessions.
ETHEREUM_ADDRESS_BLOCKEDThe account is blocked.
PASSKEY_NOT_FOUNDNo passkey with this credential id, or the assertion does not verify against it.
PASSKEY_NOT_ACTIVEThe passkey is revoked or expired.
INVALID_PASSKEY_CREDENTIALThe WebAuthn response is invalid.
PASSKEY_ORIGIN_NOT_ALLOWEDThe page origin is not allowed for the passkey’s rpId.
PASSKEY_RP_ID_NOT_ALLOWEDThe assertion is for another rpId.
PASSKEY_CHALLENGE_INVALIDThe nonce is unknown, expired or already used, or the assertion is not over this mint.
PASSKEY_SIGN_COUNT_REGRESSIONThe authenticator’s counter went backwards, which can mean a cloned authenticator.
SESSION_KEY_IN_USEThe session key is already registered on the account.
PASSKEYS_DISABLEDPasskeys are not enabled for this account.
SESSIONS_DISABLEDSessions are not enabled for this account.

Request

The SessionMint and the WebAuthn assertion over it
assertionobjectRequired

The PublicKeyCredential JSON from navigator.credentials.get, whose challenge is the SessionMint’s SNIP-12 hash.

mintobjectRequired

The SessionMint exactly as signed, with its camelCase field names. Its nonce is a session challenge from POST /v2/passkeys/challenge. It names no account or passkey: the assertion’s credential id finds the passkey.

Response

OK
accountstringOptional
The account the passkey opens sessions for, as stored.
accountslist of stringsOptional

Every account the session can trade: the granting account, then its listed subaccounts.

credential_idstringOptional
The passkey's WebAuthn credential id, base64url.
expires_atintegerOptional
When the session expires, in milliseconds.
grant_idstringOptional

The grant id: the grant’s hash, 0x and 64 hex characters.

limitsobjectOptional

The session’s limits: the mint’s, or the ceiling’s when the mint stated none.

owner_signer_typeenumOptional

Who signed the passkey’s grant: the account’s main Stark key or its EVM wallet.

Allowed values:
owner_walletstringOptional

The wallet the account was opened from, Ethereum or Starknet: an EVM owner signs with it, and a Stark account’s key is derived from its signature. Empty for an account with no parent wallet.

passkey_expires_atintegerOptional
When the passkey itself expires, in milliseconds.

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
503
Service Unavailable Error