Authentication

Register a signer key

Changed on

Register a signer (session) key for an account. The account authorises the signer and the signer proves consent, so this requires two EIP-712 signatures.

Prerequisites:

  1. GET /v1/auth/eip712-domain — EIP-712 domain (name, version, chainId, verifyingContract = Authorization contract). Both signatures use this same domain.
  2. GET /v1/nonce-state/{account} — nonce_anchor and current_bitmap_index. Send them back as nonce_anchor / nonce_bitmap_index and sign the exact same values.

1. Account signs RegisterSigner:

RegisterSigner(address account,address signer,string message,uint32 expiration,uint48 nonceAnchor,uint8 nonceBitmap)

Struct hash: keccak256(abi.encode(TYPEHASH, account, signer, keccak256(bytes(message)), expiration, nonceAnchor, nonceBitmap))

2. Signer signs VerifySigner:

VerifySigner(address account,uint48 nonceAnchor,uint8 nonceBitmap)

Struct hash: keccak256(abi.encode(TYPEHASH, account, nonceAnchor, nonceBitmap))

Signature encoding: account_signature and signer_signature are 0x-prefixed hex strings. This differs from permit.signature on the trading endpoints, which is a protobuf bytes field and is therefore base64 in JSON.

Idempotent: if the signer is already active, the call is a no-op and returns success: true with an empty transaction_hash.

Failure modes: a wrong struct or field order fails signature recovery. A nonceAnchor other than the current anchor or the current anchor + 1 reverts with InvalidNonceAnchor, which looks like a nonce bug but is usually a mismatch between the signed and submitted values.

post/v1/auth/register-signer

Request

Request body

accountstring

Account address in hex format (0x...)

signerstring

Signer address in hex format (0x...)

messagestring

Arbitrary message to be included in the signature

nonce_anchorstring

Bitmap nonce anchor (uint48) from GetNonceState

expirationstring uint64

Unix timestamp when the signer registration expires

account_signaturestring

EIP712 signature from account (65 bytes hex)

signer_signaturestring

EIP712 signature from signer (65 bytes hex)

nonce_bitmap_indexinteger

Bitmap index within the nonce anchor epoch (0-207)

labelstring

Optional label to identify this signer key

Example request

{
  "account": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
  "signer": "0x1234567890123456789012345678901234567890",
  "message": "Register signer for market making",
  "nonce_anchor": "0",
  "expiration": "1735689600",
  "account_signature": "0x1234...",
  "signer_signature": "0x5678...",
  "label": "My Trading Bot"
}

Response

A successful response.

transaction_hashstring

Transaction hash of the signer registration

successboolean

Whether the signer registration succeeded

statusinteger

Status after registration: 0=NotExist, 1=Active, 2=Revoked

block_numberstring uint64

Block number where the registration was confirmed

Example response

{
  "transaction_hash": "0xabcd1234...",
  "block_number": "12345678"
}

Changes