feat: add validation gas overhead for Shhh wallets and SNIP-163 session accounts#69
Open
haycarlitos wants to merge 1 commit into
Open
feat: add validation gas overhead for Shhh wallets and SNIP-163 session accounts#69haycarlitos wants to merge 1 commit into
haycarlitos wants to merge 1 commit into
Conversation
…on accounts Add per-account-type gas overhead for three new account types that have expensive validation logic not captured by SKIP_VALIDATE: - Shhh Ed25519 wallet (~80M L2 gas): Garaga v1.0.1 on-chain EdDSA verification for Solana/Phantom users - Shhh EVM wallet (~20M L2 gas): native secp256k1 verify_eth_signature for MetaMask/EVM users - SNIP-163 session accounts (~20M L2 gas): dual-hash SNIP-12 + session key validation (Chipi Pay reference implementation) Detection follows the existing Braavos pattern (entrypoint-based, cached per user address). Only affects gas limits, not actual gas consumed or sponsored amount.
|
@haycarlitos is attempting to deploy a commit to the 419labs Team on Vercel. A member of the Team first needs to authorize it. |
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.
Problem
starknet_estimateFeeusesSKIP_VALIDATE, so accounts with expensive validation logic get underestimated gas limits. This is the same issue solved for Braavos MFA accounts in the existingbraavos()overhead.Three new account types need overhead support:
Shhh Ed25519 wallet — uses Garaga v1.0.1 for on-chain Ed25519 signature verification (~33M L2 gas), enabling Solana (Phantom) users to operate Starknet smart accounts with their existing wallet.
Shhh EVM wallet — uses native
verify_eth_signaturesyscall for secp256k1 verification, enabling MetaMask/EVM users to operate Starknet smart accounts.SNIP-163 session accounts (Chipi Pay reference implementation) — session key validation involves dual-hash SNIP-12 computation, session data storage reads, entrypoint whitelist iteration, and call consumption writes. These add significant L2 gas beyond a standard OZ account.
Why this matters
Cross-chain wallet access: Shhh wallets let users from Solana and EVM ecosystems use Starknet without managing Starknet-native keys. All operations go through
execute_from_outside_v2(SNIP-9 V2), making paymaster gas estimation accuracy critical. Correct overhead values allow these wallets to work seamlessly with any dApp using the AVNU paymaster.Agentic smart wallets: SNIP-163 (merged into starknet-io/SNIPs, PR #163) defines the session key standard for Starknet. Session keys enable scoped, time-bounded, call-limited delegation — the primitive for AI agents, automated yield strategies, and gaming bots operating on-chain. As session-based accounts grow, accurate gas estimation ensures reliable paymaster-sponsored execution.
Supporting these account types in the paymaster helps attract liquidity to Starknet by lowering the barrier for users already holding assets on Solana or EVM chains.
Detection
Following the existing Braavos pattern (entrypoint-based detection, cached per user address):
get_owner()get_eth_address()supports_interface(0x037ab…55d)1(true)get_signers()Detection order: Shhh Ed25519 → Shhh EVM → SNIP-163 → Braavos → none.
Gas overhead values
0x04c4b400)0x01312D00)0x01312D00)0x02c7ab80)Values measured on mainnet. Only affects gas limits, not actual gas consumed or sponsored amount.
References
src/wallet_evm.cairo