Skip to main content
A session is a scoped, expiring key the app mints so the user can pay within fixed limits without a root prompt per action. The session key is never the account’s root key - it carries on-chain policies (a spend limit, an allowlist) and is revocable at any time.
Sessions are a contract (C...) account feature only. On the classic model, grantSession throws BuckspayError("INVALID_CONFIG") - a classic G... key has no on-chain policy surface to scope.

Lifecycle

Full example

The native mechanism

The policies compile to policy signers evaluated on-chain in __check_auth. The contract - not the SDK - enforces them, so a stolen session blob still cannot exceed its limits or call outside its allowlist.

Error codes

Install and revoke use the gated relay

grantSession and revokeSession are ordinary root-signed operations over the same gated /relay path as any payment. They inherit its nonce and expiration replay protection. There is no separate, weaker channel for session management.

Policies

Spend limit

Cap cumulative spend of a token over a rolling period (day, week, month, or total).

Allowlist

Restrict which contracts the session key may call.