ByAUJay
Beyond ERC-4337: Shipping Smart Accounts with EIP-7702 Delegation
EIP-7702 is live on Ethereum mainnet (Pectra, May 7, 2025), giving every EOA a native, low-friction path to “become” a smart account without changing addresses. This post explains what actually shipped, how 7702 and 4337 fit together, and a concrete playbook to roll out production-grade smart accounts on L1 and major L2s. (blog.ethereum.org)
TL;DR (for decision‑makers)
- EIP-7702 adds a new transaction type (type 0x04) that lets an EOA delegate its execution to audited smart-account code, persistently, by writing a special “delegation indicator” into the EOA’s code. You can revoke or change the delegation later. (eips.ethereum.org)
- 7702 complements, not replaces, ERC‑4337: point 7702 to a 4337-compatible implementation to keep using bundlers, paymasters, and the ecosystem you already rely on. (docs.cdp.coinbase.com)
What actually shipped in Pectra
- Mainnet activation: May 7, 2025 (epoch 364032). (blog.ethereum.org)
- EIP‑7702 (Set EOA account code) is part of Pectra’s final scope (Meta-EIP 7600). (eips.ethereum.org)
- Transaction Type: 0x04 (“set-code” tx). New field: authorizationList = tuples signed by the EOA: [chain_id, address, nonce, y_parity, r, s]. (eips.ethereum.org)
- Delegation indicator: client writes code bytes 0xef0100 || address to the EOA. All CALL-like ops execute code at that address in the EOA’s context. (eips.ethereum.org)
- Persistence and revocation: delegation persists until changed; reset by delegating to the null address. (ethereum.org)
Why this matters: you can add batching, sponsorship, alt-auth, and recovery to any existing EOA without migrating funds, addresses, or approvals—dramatically removing UX and ops friction. (blog.ethereum.org)
7702 vs. 4337 today (and why you’ll likely use both)
- ERC‑4337 status: production-proven infra with singleton EntryPoint (v0.7 widely deployed at 0x000000007172…; v0.8 bundlers emerging). Bundlers must simulate ops; paymasters sponsor gas; alt mempool handles user operations. (github.com)
- 7702 status: protocol-level delegation live on L1, rolling out on L2s (e.g., Arbitrum ArbOS 40 “Callisto”). (forum.arbitrum.foundation)
- Fit: 7702 upgrades any EOA to run a 4337-compatible implementation at the same address. Keep using bundlers and paymasters while eliminating fresh-account deployment and many proxy hops. (docs.cdp.coinbase.com)
Bottom line: for greenfield and brownfield wallets alike, 7702 + 4337 yields the best UX and infra compatibility in 2025.
The 7702 transaction—precise mechanics you’ll actually use
- Type: 0x04
- Fields: same as EIP‑4844-style tx, plus authorizationList. The outer tx is signed as usual; each authorization tuple is ECDSA-signed by the EOA whose code will be set. (eips.ethereum.org)
- Gas constants: PER_AUTH_BASE_COST = 12,500; PER_EMPTY_ACCOUNT_COST = 25,000. Intrinsic cost inherits EIP‑2930 rules; additional “delegated code resolution” may incur cold/warm access costs. (eips.ethereum.org)
- Mempool nuances: clients should avoid accepting multiple pending txs for a delegated EOA; nonce may increase more than once per tx via internal creates. Plan your transaction queuing accordingly. (eips.ethereum.org)
Security-critical detail: wallets must verify initialization data is signed by the EOA (ecrecover) to prevent front‑running during first‑time delegation. (eips.ethereum.org)
Practical patterns that work now
Pattern 1 — “One‑click swap” (batch approve + swap) from an existing EOA
- Delegate your EOA to a minimal, audited smart-account implementation that exposes a multicall and ERC‑1271. Execute approve + swap atomically in one tx. (etherspot.io)
- Why 7702: skip a dedicated smart‑account deployment (often >500k gas) and avoid extra proxies, while keeping your existing address. (docs.biconomy.io)
- Why 4337 on top: keep using paymasters to sponsor gas in stablecoins; keep your bundler pipeline. (github.com)
Code (Viem) – authorize and initialize in one step:
import { createWalletClient, http, privateKeyToAccount } from 'viem'; import { mainnet } from 'viem/chains'; import { signAuthorization } from 'viem/experimental'; const account = privateKeyToAccount(process.env.PRIVKEY!); const client = createWalletClient({ account, chain: mainnet, transport: http() }); const implementation = '0x...YourSmartAccountImpl'; // audited, 4337-compatible // IMPORTANT: executor: 'self' when the same EOA both signs the authorization and sends the tx const authorization = await signAuthorization(client, { contractAddress: implementation, executor: 'self', }); const hash = await client.writeContract({ abi: yourAbi, address: account.address, // your EOA address (now delegated) functionName: 'initialize', // e.g., set validators/owners authorizationList: [authorization] // EIP-7702 field }); console.log('Delegated init tx:', hash);
Viem abstracts tuple construction and the executor: 'self' nonce nuance required by 7702. (viem.sh)
Pattern 2 — Gasless checkout with paymasters
Two options:
- 7702-only: A relayer submits your 0x04 tx and pays gas. Good for simple, app-run pipelines. (eips.ethereum.org)
- 7702+4337: Delegate to a 4337 implementation and use your existing paymaster on L1/L2 for token‑gas sponsorship, rate limits, and observability. Works with EntryPoint v0.7; early v0.8 bundlers exist. (docs.erc4337.io)
Pattern 3 — Session keys and spend limits (without scary popups)
For MetaMask users, pair 7702 smart accounts with ERC‑7715 permissions so apps request constrained, human‑readable permissions (e.g., “spend up to 10 USDC/day”). This avoids apps asking users to sign raw delegations. (support.metamask.io)
Implementation guide: choosing and deploying your delegate
-
Pick an implementation
- Minimal Simple7702Account (audited, ERC‑165/721/1155/1271 compatible) or a production wallet implementation (e.g., Coinbase Smart Wallet). (etherspot.io)
- Coinbase’s EIP‑7702 Proxy gives a secure ERC‑1967 wrapper to initialize and upgrade safely; includes external nonce tracking and validator hooks. (github.com)
-
Make it immutable and replay‑safe
- Only delegate to immutable code deployed via CREATE2 (no proxies), or use a vetted proxy pattern with explicit validator and signed init payloads to prevent front‑running and replay. (ethereum.org)
-
Namespaced storage
- Avoid storage collisions between successive delegate implementations by rooting state with ERC‑7201; this is the recommended pattern across modern toolchains (OZ 5.x). (eips.ethereum.org)
-
Tooling and client support
- Execution clients added 7702 support (e.g., Geth added authorizationList handling). Libraries (Viem) added first‑class helpers; ethers.js v6 support landed in 2025. (github.com)
-
Wallet UX
- End‑user wallets already shipping: MetaMask Smart Accounts (with 7702 quickstart), Ambire (extension with Pectra/7702 support). Design your UX assuming wallets won’t let dapps “silently install code”—surface the delegate address clearly. (metamask.io)
-
Networks
- L1 mainnet is live; L2s are enabling Pectra features (e.g., Arbitrum ArbOS 40). Verify your target L2’s 7702 activation before rollout. (forum.arbitrum.foundation)
Security and risk management (what to mandate in design reviews)
- Initialization signatures: require the first call into the delegate to be signed by the EOA (ecrecover), preventing malicious pre‑init writes. (eips.ethereum.org)
- Phishing guardrails:
- Never delegate to a proxy you don’t control; prefer immutable code or vetted proxy + validator.
- Bind authorization by chain (chain_id) and (optionally) by current EOA nonce; never default to chain_id=0 across all chains. Display the delegate address prominently. (ethereum.org)
- Mempool behavior: after delegation, anyone can call the account; clients may accept only one pending tx per delegated EOA. Build your tx queueing and monitoring accordingly. (eips.ethereum.org)
- Storage layout: use ERC‑7201 namespaces to prevent collisions between versions and modules. Document namespaces in NatSpec. (eips.ethereum.org)
- Observability and revocation: add a “panic” path to redelegate to 0x0 and a runbook for incident response. (ethereum.org)
Cost and performance notes (with hard numbers)
- 7702 authorization processing baseline: ~12,500 gas per authorization (PER_AUTH_BASE_COST), plus up to 25,000 gas for accounts that were previously empty; intrinsic gas follows EIP‑2930 logic. (eips.ethereum.org)
- Compared to deploying a fresh smart account (>500k gas typical), 7702 lets you “upgrade” an EOA at a fraction of the cost and with no address migration. (docs.biconomy.io)
- 4337 overhead: EntryPoint validation and execution add measurable overhead (tens of k gas per UserOperation). 7702 reduces cross‑contract hops for the same flow, especially for batched calls. (buildbear.io)
- 4337 v0.7 adds a 10% penalty for unused execution gas (to discourage bloated limits); v0.8 relaxes minor edge cases and introduces quality‑of‑life improvements—plan gas estimates accordingly. (github.com)
How 7702 + 4337 lands in enterprise stacks (reference architecture)
- Wallet layer: user EOAs in MetaMask or enterprise custodians; one-time 7702 delegation to your audited account implementation. (support.metamask.io)
- Orchestration: 4337 bundlers (v0.7 now; track v0.8), paymasters for tokenized gas, ERC‑7715 for permissions/automation. (docs.erc4337.io)
- Policy: enforce daily spend caps and allowlists in the implementation; store policy state in ERC‑7201 namespaces for upgrade safety. (eips.ethereum.org)
- Networks: target mainnet + L2s with confirmed Pectra activations. Validate 7702 on staging chains first. (forum.arbitrum.foundation)
Example: production-ready “upgrade my EOA” flow
- User signs 7702 Authorization pointing to your audited implementation; bind to chain_id and current nonce. (eips.ethereum.org)
- Submit type‑0x04 tx with authorizationList and initialize() calldata; your validator checks EOA signature and init parameters. (github.com)
- Flip on 4337 route: subsequent interactions go through UserOps + paymaster; address stays the same. (github.com)
- Provide a one-click “Revoke/Reset” to 0x0 if necessary. (ethereum.org)
Testing and ops checklists
- Test vectors
- Authorization tuple encoding (y_parity, r, s) and the executor: 'self' nonce rule. (viem.sh)
- Delegation loops: ensure code only follows the first delegation (no chains/loops). (eips.ethereum.org)
- Replay: include nonce-bound checks inside your delegate; add external NonceTracker if using a proxy pattern. (github.com)
- Monitoring
- Detect code changes at EOAs (look for 0xef0100 prefix) and alert on unauthorized redelegations. (eips.ethereum.org)
- Wallet compatibility
- Verify MetaMask Smart Accounts + Delegation Toolkit and Ambire flows end-to-end in QA. (metamask.io)
Roadmap watch: native AA on L2s (RIP‑7560)
RIP‑7560 proposes a native AA transaction type for rollups (canonical mempool, lower overhead), designed to be compatible with 4337 concepts. It’s draft-stage, but relevant for 2026 roadmaps and “write once, run across L2s” architectures. (docs.erc4337.io)
Decision guide: when to choose what
- You have many EOAs and cannot migrate addresses: use 7702 to upgrade in place; pair with 4337 for paymasters and ecosystem support. (blog.ethereum.org)
- You already run 4337 infra: add 7702 to cut cold-start costs and simplify UX; keep your bundlers and paymasters. (github.com)
- You need autonomous, permissioned automation (subscriptions, background trades): add ERC‑7715 permissions on top of your 7702 smart accounts to make permissions explicit and human‑readable. (docs.metamask.io)
The 7Block Labs playbook (concise)
- Pick an audited 7702 implementation (or Coinbase’s 7702 Proxy wrapper) and lock down initialization with signed payloads. (github.com)
- Namespace all storage with ERC‑7201. (eips.ethereum.org)
- Ship a revocation path and incident runbook (redelegate to 0x0). (ethereum.org)
- Keep 4337 v0.7 infra; test v0.8 in canaries. Track L2 Pectra rollouts before switching default routes. (github.com)
- Use ERC‑7715 for delegated, permissioned UX; never ask users to sign raw, unconstrained delegations in-app. (docs.metamask.io)
Appendix: concrete specs reference
- EIP‑7702 spec (type 0x04; authorizationList; gas constants; delegation indicator). (eips.ethereum.org)
- Pectra activation (EF blog) and meta‑EIP (EIP‑7600). (blog.ethereum.org)
- Viem 7702 dev docs and examples (signAuthorization, executor: 'self'). (viem.sh)
- ERC‑4337 EntryPoint v0.7 (address, changes) and bundler requirements. (github.com)
- Coinbase Smart Wallet 7702 FAQ and implementation address/proxy. (docs.cdp.coinbase.com)
- ERC‑7201 namespaced storage (avoid collisions across delegates). (eips.ethereum.org)
Brief description: EIP‑7702 (live since May 7, 2025) lets any EOA run audited smart‑account code at the same address. Pair it with ERC‑4337 to keep paymasters/bundlers, cut deployment costs, and ship safer, more capable wallets across L1 and L2. (blog.ethereum.org)
Like what you're reading? Let's build together.
Get a free 30‑minute consultation with our engineering team.

