EIP-7702: when a plain account runs contract code

2 min read· Updated

Short answer

EIP-7702 adds a transaction type, 0x04, that carries signed authorizations. Each one lets a regular account (an EOA) point its code at a contract, so calls to the account run that contract's code. An authorization names the chain, the contract address and the account's nonce; chain id 0 makes it valid on every chain, and the zero address clears the delegation.

On this page
EIP-7702: the agent's account signs an authorization with chain_id, address and nonce, anyone sends it in a type 4 transaction, and the account then runs the delegated contract's code; hashspan records the authorization count, addresses and chain ids on the send span.EIP-7702: the agent's account signs an authorization with chain_id, address and nonce, anyone sends it in a type 4 transaction, and the account then runs the delegated contract's code; hashspan records the authorization count, addresses and chain ids on the send span.

What changed in Pectra?

Until EIP-7702, an account was either a key (an EOA) or a contract. EIP-7702 adds a transaction type that lets an EOA set code on itself (EIP-7702). It went live on Ethereum mainnet with the Pectra upgrade on 7 May 2025 (ethereum.org).

The account doesn’t copy code. It stores a pointer, a delegation, to a contract. Calls to the account then run that contract’s code, with the account’s own storage and balance.

What is in an authorization?

A type 4 transaction carries a list of authorizations. Each is signed by the account that delegates:

Field Meaning
chain_id The chain it’s valid on, or 0 for every chain
address The contract to delegate to; the zero address clears the delegation
nonce The account’s nonce, so the authorization can be used once
y_parity, r, s The signature

The transaction itself can be sent by anyone. So the account that delegates and the account that pays don’t have to be the same.

Why should an agent care?

An agent’s wallet that delegates hands its behaviour to someone else’s code. After that, every call to the account runs that code. Three questions matter later:

  • Which contract? The delegated address decides what the account can do.
  • On which chains? A chain id of 0 sets the same delegation on any chain where the nonce matches.
  • When? The transaction that set the delegation is where to look when the account starts acting differently.

FAQ

Does the account become a smart contract?

Its code becomes a delegation indicator pointing at a contract, and calls to it run that contract's code. It keeps its address and its key, and can still sign transactions.

What does chain id 0 in an authorization mean?

The authorization is valid on any chain. That's convenient, and riskier: the same signature can set the delegation wherever the nonce matches.

How do I remove a delegation?

Sign an authorization for the zero address. The account's code is reset to empty.

Go further

Type to search the docs, Learn topics and the blog.