Skip to navigation

Passkeys

Open trading sessions with a passkey instead of a wallet prompt

A passkey lets a device open sessions on an account without asking the wallet each time. The owner signs once to register the passkey together with a ceiling, the most any session it opens may do. After that, the passkey alone can open sessions within the ceiling, using the device’s own unlock such as Face ID, Touch ID, Windows Hello or a security key.

A passkey is never the account’s login or owner. Sessions it opens can trade within the ceiling, but can never withdraw or transfer funds, approve a builder, change the ceiling or register another passkey.

Passkeys are rolling out gradually, so access may be limited during rollout. A request from an account that does not have access yet returns 403 PASSKEYS_DISABLED or 403 SESSIONS_DISABLED.

Passkeys are currently first party only. The challenge endpoint returns the one relying party ID (rp_id) a passkey can use, and WebAuthn ties a passkey to that domain, so apps on other domains cannot register or use passkeys.

RouteAuthentication
POST /v2/passkeys/challengeOwner’s main key session for registration; none for session
POST /v2/passkeysThe owner’s signature on the PasskeyGrant
POST /v2/passkeys/sessionsThe passkey’s WebAuthn assertion
GET /v2/passkeysOwner’s main key session, or a session the passkey opened
DELETE /v2/passkeys/{id}Owner’s main key session, or a session the passkey opened

Get a challenge

POST /v2/passkeys/challenge
Content-Type: application/json
{ "purpose": "registration" }

Every passkey ceremony starts with a single use challenge, consumed by the first request that uses it. A registration challenge expires after five minutes and a session challenge after two.

purposeUseAuthentication
registrationThe challenge for navigator.credentials.createA JWT the account obtained with its own key. Session keys, subkeys and API tokens are refused.
sessionThe nonce to put in a SessionMintNone

Response 200

FieldDescription
challengeFor registration, the WebAuthn challenge, base64url. For session, the nonce for the SessionMint, as 0x hex.
user_handleRegistration only. The WebAuthn user.id, base64url. It is random and never the account address.
rp_idThe relying party ID to register under, or to pass to navigator.credentials.get
expires_atWhen the challenge expires, in milliseconds

Register a passkey

1

Create the credential

Call navigator.credentials.create with the registration challenge, user.id set to user_handle and rp.id set to rp_id. Request a discoverable credential (residentKey: "required"), user verification, the ES256 algorithm and attestation none.

2

Build the PasskeyGrant

Fill in the fields below with the new credential’s id and public key, and the ceiling you want.

3

The owner signs it

EVM owned accounts sign it as EIP-712 and Starknet owned accounts as SNIP-12, exactly as for a session grant, with PasskeyGrant as the primary type.

4

Register it

Send the grant, the signature and the credential to POST /v2/passkeys.

PasskeyGrant

FieldTypeDescription
paradexChainstringThe Paradex chain id, starknet_chain_id from GET /v1/system/config
environmentstringmainnet or testnet
accountstringThe main account, as 0x hex
passkeyPasskeyThe credential being registered
ceilingCeilingWhat every session the passkey opens is held to
builderAccountstringAlways 0x0
noncestringA random nonzero value of at most 128 bits, as lowercase 0x hex without leading zeros
issuedAtuint64Unix seconds, within the last 24 hours
expiresAtuint64When the passkey stops working, Unix seconds, at most 180 days ahead

Passkey:

FieldTypeDescription
credentialIdstringThe WebAuthn credential id, base64url
pubkeyXstringThe P-256 public key X coordinate, as 0x and 64 lowercase hex characters
pubkeyYstringThe P-256 public key Y coordinate, as 0x and 64 lowercase hex characters
rpIdstringThe rp_id from the challenge
labelstringA name for the passkey, at most 64 printable ASCII characters, such as the device name

Ceiling:

FieldTypeDescription
scopesstring[]At least one of trade, trade:rfq and account:settings. trade:block is not allowed.
limitsLimitsAs in a session grant: every amount "none" and markets ["*"]
subaccountsstring[][]. Passkeys cover the main account only, so their sessions never cover subaccounts.
includeFutureSubaccountsboolfalse
maxSessionTtluint64The longest session the passkey may open, in seconds, at most 604800 (7 days) whatever the scopes. 86400 (24 hours) is the recommended default.
maxConcurrentSessionsuint64How many sessions the passkey may hold open at once, from 1 to 5

A registered ceiling cannot be changed. To widen it, for example to add trade:rfq, register a new passkey. A passkey session that lists trade:rfq uses RFQs under the same conditions as any other session, described in Scopes.

EIP-712 field types, in signed order. SNIP-12 uses the same names and order, with shortstring for paradexChain and environment, ContractAddress for account and builderAccount, felt for nonce, timestamp for issuedAt and expiresAt, u128 for maxSessionTtl and maxConcurrentSessions, shortstring* for scopes and markets, and ContractAddress* for subaccounts.

{
"PasskeyGrant": [
{ "name": "paradexChain", "type": "string" },
{ "name": "environment", "type": "string" },
{ "name": "account", "type": "string" },
{ "name": "passkey", "type": "Passkey" },
{ "name": "ceiling", "type": "Ceiling" },
{ "name": "builderAccount", "type": "string" },
{ "name": "nonce", "type": "string" },
{ "name": "issuedAt", "type": "uint64" },
{ "name": "expiresAt", "type": "uint64" }
],
"Passkey": [
{ "name": "credentialId", "type": "string" },
{ "name": "pubkeyX", "type": "string" },
{ "name": "pubkeyY", "type": "string" },
{ "name": "rpId", "type": "string" },
{ "name": "label", "type": "string" }
],
"Ceiling": [
{ "name": "scopes", "type": "string[]" },
{ "name": "limits", "type": "Limits" },
{ "name": "subaccounts", "type": "string[]" },
{ "name": "includeFutureSubaccounts", "type": "bool" },
{ "name": "maxSessionTtl", "type": "uint64" },
{ "name": "maxConcurrentSessions", "type": "uint64" }
],
"Limits": [
{ "name": "maxOrderNotional", "type": "string" },
{ "name": "maxOpenNotional", "type": "string" },
{ "name": "dailyNotional", "type": "string" },
{ "name": "maxLoss", "type": "string" },
{ "name": "maxLeverage", "type": "string" },
{ "name": "markets", "type": "string[]" }
]
}

Request

POST /v2/passkeys
Content-Type: application/json
FieldTypeDescription
grantobjectThe PasskeyGrant message as signed, with its camelCase field names. Send issuedAt, expiresAt, maxSessionTtl and maxConcurrentSessions as JSON integers, including for snip12.
signaturestringThe owner’s signature, in the same form as for POST /v2/sessions
signature_typestringeip712 or snip12
signature_chain_idintegerThe EIP-712 domain chainId. Required for eip712.
credentialobjectThe PublicKeyCredential JSON from navigator.credentials.create. It must be the credential the grant names.

Response 200: the passkey object.

StatusErrorMeaning
400INVALID_SIGNATUREThe signature is not the account owner’s, or does not match signature_type
400GRANT_EXPIREDexpiresAt has passed, or issuedAt is outside the accepted window
400INVALID_ENVIRONMENT, INVALID_CHAINThe grant is for another environment or chain
400SCOPE_NOT_ALLOWEDThe ceiling lists a scope a passkey cannot carry, such as trade:block
400LIMIT_INVALIDA limit is malformed or not none, or the passkey expiry is too long
400INVALID_GRANTThe grant is malformed, or its session length or session count is out of range
400ACCOUNT_NOT_ELIGIBLEThe account is not a main account, or the ceiling lists subaccounts
400ETHEREUM_ADDRESS_BLOCKEDThe account is blocked
400INVALID_PASSKEY_CREDENTIALThe WebAuthn response is invalid or is not the credential the grant names
400PASSKEY_ORIGIN_NOT_ALLOWEDThe page origin is not allowed for the rpId
400PASSKEY_RP_ID_NOT_ALLOWEDThe rpId is not allowed
400PASSKEY_CHALLENGE_INVALIDThe challenge is unknown, expired or already used
400PASSKEY_ALREADY_REGISTEREDThe credential, or the grant’s nonce, is already registered
403PASSKEYS_DISABLED, SESSIONS_DISABLEDNot available for this account yet

Open a session with a passkey

1

Get a nonce

Call POST /v2/passkeys/challenge with { "purpose": "session" }. No JWT is needed.

2

Build the SessionMint

Generate a fresh session key and fill in a SessionMint with the challenge as its nonce.

3

Sign it with the passkey

Compute the SNIP-12 revision 1 message hash of the SessionMint, using the same domain as a session grant and 0x0 as the account, since a mint names no account. Pass its 32 bytes, base64url encoded, as the challenge of navigator.credentials.get, with rpId set to the passkey’s rp_id. Leave allowCredentials empty to let the user pick any passkey they hold for the site, or set it to one credential id to require that passkey.

4

Open the session

Send the mint and the assertion to POST /v2/passkeys/sessions.

SessionMint

A SessionMint names neither the account nor the passkey. The server finds the passkey from the assertion’s credential id, and the account from that passkey’s grant.

FieldSNIP-12 typeDescription
paradexChainshortstringAs in the passkey grant
environmentshortstringAs in the passkey grant
sessionKeyfeltThe new session’s Stark public key
scopesshortstring*At least one of the ceiling’s scopes
limitsLimitsEvery amount "none" and markets ["*"], or every amount "" and markets [] to take the ceiling’s
subaccountsContractAddress*[]
noncefeltThe session challenge
expiresAttimestampUnix seconds, no more than the ceiling’s maxSessionTtl from now, or 0 for the longest session the passkey allows. A session that would outlive the passkey ends when the passkey expires.

Request

POST /v2/passkeys/sessions
Content-Type: application/json
FieldTypeDescription
mintobjectThe SessionMint as signed, with its camelCase field names. Send expiresAt as a JSON integer.
assertionobjectThe PublicKeyCredential JSON from navigator.credentials.get

Response 200: the same grant_id, expires_at and accounts as POST /v2/sessions, plus account (the account the passkey opens sessions for), credential_id, owner_signer_type (stark or eip191), owner_wallet, passkey_expires_at in milliseconds, and the session’s limits. A client that let the user pick any passkey learns the account here. The session key then signs in with POST /v1/auth/{public_key}, and the session appears in GET /v2/sessions with source set to passkey. Revoke it with DELETE /v2/sessions/{grant_id} like any other session.

StatusErrorMeaning
400INVALID_GRANTThe mint is malformed, lists no scopes, or does not match the passkey’s chain or environment
400INVALID_ENVIRONMENT, INVALID_CHAINThe mint is for another environment or chain
400GRANT_EXPIREDexpiresAt has passed
400NONCE_REUSEDThe mint’s nonce was already used
400MINT_EXCEEDS_CEILINGA scope or the expiry is outside the passkey’s ceiling
400SESSION_LIMIT_REACHEDThe passkey already holds its ceiling’s maxConcurrentSessions live sessions
400LIMIT_INVALIDA limit is malformed or only partly stated, is not none, or markets is not ["*"]
400ACCOUNT_NOT_ELIGIBLEThe mint lists subaccounts, or the account cannot hold sessions
400ETHEREUM_ADDRESS_BLOCKEDThe account is blocked
400PASSKEY_NOT_ACTIVEThe passkey is revoked or expired
400INVALID_PASSKEY_CREDENTIALThe WebAuthn response is malformed
400PASSKEY_ORIGIN_NOT_ALLOWEDThe page origin is not allowed for the passkey’s rpId
400PASSKEY_RP_ID_NOT_ALLOWEDThe assertion is for another rpId
400PASSKEY_CHALLENGE_INVALIDThe nonce is unknown, expired or already used, or the assertion is not over this mint
400PASSKEY_SIGN_COUNT_REGRESSIONThe authenticator’s counter went backwards, which can mean a cloned authenticator
400SESSION_KEY_IN_USEThe session key is already registered on the account
403PASSKEYS_DISABLED, SESSIONS_DISABLEDNot available for this account yet
404PASSKEY_NOT_FOUNDNo passkey has this credential id, or the assertion does not verify against it

List passkeys

GET /v2/passkeys
Authorization: Bearer <JWT>

Returns the account’s passkeys, revoked ones included, newest first, as { "results": [ <passkey>, ... ] }. The owner’s main key session sees every passkey; a session a passkey opened sees only that passkey.

The passkey object

FieldTypeDescription
idintegerThe passkey id used by DELETE /v2/passkeys/{id}
credential_idstringThe WebAuthn credential id, base64url
rp_idstringThe relying party ID
labelstringThe label from the grant
statestringactive, revoked or expired
ceilingobjectscopes, limits, max_session_ttl (seconds) and max_concurrent_sessions
live_sessionsintegerSessions the passkey has open now
syncedboolWhether the passkey is synced across devices
backup_eligibleboolWhether the passkey can be synced
aaguidstringThe authenticator model, for display. May be all zeros.
expires_atintegerWhen the passkey expires, in milliseconds
created_atintegerWhen it was registered, in milliseconds
last_used_atinteger or nullWhen it last opened a session, in milliseconds
revoked_atinteger or nullWhen it was revoked, in milliseconds
revoked_reasonstringowner or passkey. Only present once revoked.

Revoke a passkey

DELETE /v2/passkeys/{id}
Authorization: Bearer <JWT>

Revokes the passkey, then every session it opened. Resting orders are kept. The owner’s main key session can revoke any passkey on the account, and a session a passkey opened can revoke that passkey. Revoking a passkey that is already revoked succeeds.

Response 204 with no body. Returns 403 for a caller that is neither the owner’s main key session nor a passkey’s session, and 404 for an unknown id or a session opened by a different passkey.