EIP-7702, proposed in May 2024 by Vitalik Buterin, Sam Wilson, Ansgar Dietrichs and lightclient and activated on mainnet with the Pectra upgrade on May 7, 2025, introduces a new account abstraction mechanism for Ethereum. Its official title is "Set Code for EOAs". It addresses a long-standing limitation of regular wallets: such an account can do only one thing, send transactions signed by its key, and cannot run any logic of its own.
Most people on Ethereum use externally owned accounts (EOAs). They have no code, so every action is a separate transaction, gas can be paid only in ETH and only by the owner, and permissions cannot be split: the key grants everything or nothing. Smart wallets solved these problems long ago but required moving to a new address. EIP-7702 lets an existing EOA set smart contract code for itself while keeping its address, history and assets.
The proposal fits Ethereum's broader account abstraction roadmap and complements ERC-4337. Where 4337 built smart-wallet infrastructure on top of the protocol, 7702 opened that infrastructure to addresses that already exist.
MECHANICS
At the heart of the standard is a new transaction type, 0x04 (the "set code transaction"), carrying an authorization list. Each authorization holds three fields plus a signature: the chain ID, the contract address and the account nonce. The EOA owner signs this data with their key. A chain ID of zero makes the authorization valid on every chain, which is why wallets usually specify a particular chain.
When the transaction is included in a block, the network processes each authorization: it recovers the signer's address, checks the chain and the nonce, and writes a short pointer into the account's code: the prefix 0xef0100 followed by the contract address. From then on, any call to the account runs that contract's code in the context of the account itself, with its balance, its storage and its address. The account nonce is incremented by one, so the same authorization cannot be applied twice.
An important detail: anyone can submit a 0x04 transaction, not just the owner. A signed authorization can travel inside a transaction sent and paid for by another account. This is what gas sponsorship is built on.
The delegation is not limited to a single transaction. The pointer stays in the account's code until the owner signs a new authorization for a different contract or for the zero address; in the latter case the code is cleared and the account becomes a plain EOA again. If the execution part of the transaction fails, the delegation that was written is not rolled back.
Gas. Each authorization in the list adds 25,000 gas to the transaction's intrinsic cost, and part of that is refunded if the account already exists on chain. After that, calls to the account cost the same as ordinary contract calls: how much gas they use depends on how efficiently the delegate contract is written.
EIP-7702 defines no permission rules. Expiry, limits, app allowlists and extra keys are implemented by the delegate contract itself, if its author built them in.
KEY COMPONENTS
Several parts are involved, and it matters which of them the protocol defines and which are left to the developer:
- Authority (the owner account): a regular EOA that signs the authorization. Its private key remains fully in force.
- Authorization: a signed tuple of chain ID, contract address and nonce. This is all the standard asks of the owner.
- 0x04 transaction: the carrier of the authorization list. Its sender and gas payer need not be the account owner.
- Delegation indicator: the 0xef0100 prefix plus the contract address written into the account's code. It tells the network whose code to run.
- Delegate contract: the code the account now runs. Batched calls, checks on extra keys, limits and expiry all live here.
- Account storage: the delegate contract writes data into the EOA's own storage, so switching to a delegate with a different storage layout can corrupt that data.
The protocol is responsible only for the first four items. Everything about the safety of day-to-day actions is determined by the quality of the delegate contract.
APPLICATIONS
The standard explicitly names three problems it was designed to solve.
Batching. A typical DEX swap today takes two transactions: approve the token, then swap. With smart code, the account performs both in one atomic transaction, and if one part fails, everything is reverted.
Gas sponsorship. Account X pays for a transaction on behalf of account Y. An app can cover a newcomer's actions for free, and a relayer service can charge in a stablecoin instead of ETH. The user no longer has to buy ether just to pay fees.
Privilege de-escalation. The owner issues an extra key with narrow powers. The standard gives examples: permission to spend ERC-20 tokens but not ETH, to spend no more than 1% of the balance per day, or to interact with only one app. This is where session keys for games and trading interfaces come from.
Here is the last scenario broken down step by step using a trading bot as the example:
- Who delegates to whom: the EOA owner signs an authorization for a vetted smart-wallet contract and then registers the bot's key through that contract.
- Scope: the contract lets the bot's key call only one DEX, with volume no greater than a set limit.
- Duration: the contract stores an expiry for the key, say, the end of the trading week.
- What the contract verifies: on each trade it checks the bot key's signature, the target app, the limit and the expiry.
- If something does not match: the call is rejected. The owner can revoke the bot's key or change the delegation at any time with their main key.
How to tell a legitimate delegation from a dangerous one: an EIP-7702 authorization always gives the contract full control of the account, so the only thing that matters is which contract it is. A safe setup delegates to a well-known, audited contract offered by the wallet itself. If a website asks you to sign an authorization for an unfamiliar address, that is a red flag: such a signature can drain the entire account in a single transaction.
TRADE-OFFS
Compared to ordinary EOAs, EIP-7702 delivers far more capability without changing the address. The cost is new points of failure. A bug in a delegate contract hits every account that delegated to it. Phishing sites gained a new way to steal funds through authorization signatures. Checks of the form "tx.origin equals msg.sender", which some contracts used to block calls from smart wallets, no longer guarantee that the caller is a plain EOA. The standard also warns about front-running initialization: if the delegate contract is set up in a separate call, someone may call it before the owner does.
EIP-7702 and ERC-4337 are built differently but share a goal. Here is a brief comparison:
| EIP-7702 | ERC-4337 |
|---|---|
| Protocol change, introduced by the Pectra hard fork | Works on top of the protocol, no hard fork |
| An existing EOA gets code and keeps its address | A separate smart wallet with a new address |
| The private key keeps full control of the account | Ownership logic is defined entirely by the wallet contract |
| The delegate can be a 4337-compatible wallet | Bundlers, paymasters and EntryPoint also serve 7702 accounts |
The main trade-off comes down to trust in the delegate contract. The protocol guarantees only that the account runs the chosen code; everything else, from limits to storage safety, depends on who wrote that code and how. So the most important rule for users is simple: delegate only to the contract your own wallet offers, and never sign authorizations from third-party websites.