SNIP: Session Keys for Smart Accounts#163
Open
haycarlitos wants to merge 1 commit intostarknet-io:mainfrom
Open
SNIP: Session Keys for Smart Accounts#163haycarlitos wants to merge 1 commit intostarknet-io:mainfrom
haycarlitos wants to merge 1 commit intostarknet-io:mainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ISessionKeyManagertrait andSessionDatastruct for on-chain session key management[session_pubkey, r, s, valid_until]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
SessionKeyComponentany 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.