Skip to main content
Session keys only work with CHIPI wallets - not READY wallets. Make sure your wallet was created with walletType: "CHIPI".

Overview

Session keys allow your application to execute transactions on behalf of a user without requiring their owner private key for every action. This enables gasless, frictionless UX for gaming, DeFi automation, social apps, and more.

createSessionKey

Generate a session keypair locally. This is a synchronous operation that doesn’t make network calls.

Parameters

Return Value

Never store session keys in your backend database. Store only in client-side secure storage (localStorage, sessionStorage, or platform-specific secure storage).

addSessionKeyToContract

Register a session key on the CHIPI wallet smart contract. This requires the owner’s signature (one-time setup per session).

Parameters

Restricting Permissions

For enhanced security, whitelist specific function selectors:

revokeSessionKey

Revoke a session key from the smart contract. After revocation, the session can no longer execute transactions.

Parameters

Always revoke sessions when a user logs out to prevent unauthorized access.

getSessionData

Query session status from the smart contract. This is a read-only operation that doesn’t require gas.

Parameters

Return Value


executeTransactionWithSession

Execute a transaction using a session key instead of the owner private key. No wallet popup required!

Parameters

Call Structure

Multi-Call Example

Execute multiple operations in a single transaction:

Complete Example: Gaming Session


Error Handling

Security Best Practices

  1. Short durations - Use 1-6 hours, not days
  2. Limit calls - Set realistic maxCalls based on expected usage
  3. Whitelist functions - Restrict allowedEntrypoints to only what your app needs
  4. Revoke on logout - Always clean up sessions when user signs out
  5. Client-side storage only - Never store session keys in your database