Back to docs

ZeroDev Session Keys

ERC-4337 · Gasless Agent Funding · Account Abstraction

Enable AI agents to fund escrows without holding ETH. ZeroDev session keys give agents scoped, time-limited permissions to call approve() + fundEscrow() on Kustodia contracts — with all gas paid by Kustodia's Paymaster.

Scoped Session Keys

Session keys are restricted to approve() + fundEscrow() only. No arbitrary contract calls. 24h expiry.

Gasless Transactions

Kustodia's Paymaster sponsors all gas fees. Users and agents never need ETH.

Batch UserOperations

approve + fundEscrow combined in a single atomic transaction. No two-step approval flow.

ERC-4337 Smart Account

Kernel v3.1 account with full ERC-4337 compliance. Compatible with passkeys, social login, and existing wallets.

How It Works

1

Create Session Key

Owner

Owner calls create_session_key with their wallet key, chain, and token. Returns serialized approval + session private key.

2

Create Escrow

Owner / Agent

Call create_web3_escrow to create an on-chain escrow. The smart account is set as the payer.

3

Fund via Session Key

AI Agent

Agent calls fund_with_session_key with the session key, escrow ID, and amount. Batched UserOp: approve + fundEscrow. Gas sponsored.

4

Release Escrow

Owner / Agent

Call release_web3_escrow to release funds to the payee. Relayer signs the on-chain tx.

✅ E2E Validated

Full flow validated on Arbitrum Sepolia (March 2026). Smart account created, session key scoped, escrow funded via batched UserOp, gas sponsored by Paymaster.

MCP Tools

create_session_keyOwner

Creates a scoped session key for an AI agent. Returns serialized approval + session private key.

Params: owner_private_key, chain_id, token_address
fund_with_session_keyAgent

Funds an existing escrow using a session key. Batches approve + fundEscrow in one UserOp. Gas sponsored.

Params: serialized_approval, session_private_key, escrow_id, chain_id, token_address, amount

Quick Start

// 1. Owner creates session key
const result = await mcpCall("create_session_key", {
  owner_private_key: "0x...",
  chain_id: 421614,          // Arbitrum Sepolia
  token_address: "0x75fa..."  // USDC
});
// Returns: { serialized_approval, session_private_key,
//            smart_account_address, session_key_address }

// 2. Agent funds escrow (gasless!)
const fund = await mcpCall("fund_with_session_key", {
  serialized_approval: result.serialized_approval,
  session_private_key: result.session_private_key,
  escrow_id: 3,
  chain_id: 421614,
  token_address: "0x75fa...",
  amount: 100  // 100 USDC
});
// Returns: { user_operation_hash, transaction_hash }
// Gas: Sponsored by Kustodia Paymaster ⛽

Supported Chains

Mainnet

Arbitrum

Chain ID: 42161

USDCUSDTMXNB
Base

Chain ID: 8453

USDC
Polygon

Chain ID: 137

USDCUSDTMXNB

Testnet

ChainIDStatus
Arbitrum Sepolia421614✅ E2E Validated
Base Sepolia84532Configured

ZeroDev vs Direct Signing

FeatureZeroDevDirect (EOA)
Gas costFree (Paymaster)Agent pays
ETH requiredNoYes
Scoped permissions✅ approve+fund only❌ Full key access
Time-limited✅ 24h expiry❌ Permanent
Batch transactions✅ 1 UserOp2 separate tx
Revocable✅ Anytime❌ Key rotation needed