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.
Request
The PublicKeyCredential JSON from navigator.credentials.get, whose challenge is the SessionMint’s SNIP-12 hash.
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
Every account the session can trade: the granting account, then its listed subaccounts.
The grant id: the grant’s hash, 0x and 64 hex characters.
The session’s limits: the mint’s, or the ceiling’s when the mint stated none.
Who signed the passkey’s grant: the account’s main Stark key or its EVM wallet.
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.