Skip to content

Comments

SNIP: Session Keys for Smart Accounts#163

Open
haycarlitos wants to merge 1 commit intostarknet-io:mainfrom
haycarlitos:feat/session-keys-snip
Open

SNIP: Session Keys for Smart Accounts#163
haycarlitos wants to merge 1 commit intostarknet-io:mainfrom
haycarlitos:feat/session-keys-snip

Conversation

@haycarlitos
Copy link

Session keys are the missing piece between smart accounts and real usage. Without them, every on-chain action requires a wallet popup, a manual signature, and gas awareness. That kills gaming, DeFi automation, subscriptions, and especially AI agents that need to act autonomously within defined boundaries.

This SNIP proposes the interface that makes all of that work across wallets and paymasters with zero custom integration.

What this SNIP defines

  1. ISessionKeyManager trait and SessionData struct for on-chain session key management
  2. A 4-element session signature format: [session_pubkey, r, s, valid_until]
  3. An 8-step validation algorithm for session-signed transactions
  4. A 9-selector admin blocklist that session keys must not bypass
  5. A paymaster-account interaction protocol covering discovery, OutsideExecution construction, and signature passthrough
  6. A canonical SNIP-12 typed data format for session-aware OutsideExecution hashing
  7. An optional spending policy extension for per-token spending limits

What this unlocks

For AI agents: scoped, time-bounded, call-limited on-chain authority. An agent can trade, rebalance, or execute strategies using only the selectors and tokens you allow, with spending caps and automatic expiry. No custody, no owner key exposure, instant revocation.

For dApps: build session key support once and it works with every compliant wallet and every compliant paymaster. No more integrating separately with each wallet team.

For paymasters: sponsor session transactions from any compliant account using the same signature format and discovery protocol.

For Starknet: the account abstraction advantage only matters if applications can actually delegate execution safely. This is the coordination layer that turns smart accounts into a platform.

Reference implementation

Deployed on Starknet mainnet with a reusable SessionKeyComponent any wallet framework can embed:
https://github.com/chipi-pay/sessions-smart-contract

65 Cairo tests + 28 mainnet integration tests. Four Nethermind AuditAgent scans (final: 0 findings).

Discussion thread

https://community.starknet.io/t/snip-session-keys-for-smart-accounts/116131

Feedback welcome from wallet teams, paymaster operators, dApp developers, and AI agent builders.

Session key management and paymaster interaction protocol for
Starknet smart accounts. Defines ISessionKeyManager interface,
session signature format, validation algorithm, admin selector
blocklist, paymaster interaction protocol, and optional spending
policy extension.

Discussion: https://community.starknet.io/t/snip-session-keys-for-smart-accounts/116131
Reference implementation: https://github.com/chipi-pay/sessions-smart-contract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant