EIP-5806 Delegation transaction for EOAs (Delegate transaction)
No call decision · Account abstraction · EIP status Stagnant · created 2022-10-20
Adds a new transaction type that lets an EOA (a regular wallet account) execute contract code via a delegatecall with a single signature.
Why it is needed
Until now, an EOA could do little beyond deploying a contract or sending a simple call transaction. With no way to execute arbitrary code, the scope of user interaction with the blockchain is severely limited. Account abstraction approaches like ERC-4337 aim to improve the usability of smart wallets, but the problem that apps must support smart wallets remains. In addition, the cost of switching to a smart contract wallet and the fact that many EOAs already hold non-transferable assets make it difficult for all users to migrate immediately. In this situation, splitting multiple operations into several separate transactions duplicates gas costs and leaves the system vulnerable to attacks that exploit the time gap between a token approval and a transferFrom.
What changes
Today
- An EOA can only send contract deployment and simple call transactions.
- Performing multiple operations requires sending multiple separate transactions, duplicating gas costs.
- This exposes users to attacks that exploit the time gap between a token approval and a transfer.
- An EOA cannot emit events or execute arbitrary code on its own.
After EIP-5806
- A new transaction type lets an EOA perform a delegatecall into contract code.
- Delegating to a multicall contract bundles multiple operations into a single transaction.
- Bundling approval and transfer into a single transaction reduces the window of exposure to attack.
- The EOA performs new behaviors, such as emitting events in its own context.
Who is affected
- Users: Bundling multiple transactions into one can save on gas costs and reduce exposure to approval-transfer attacks.
- Wallet & app developers: Building delegation logic such as a multicall contract lets EOAs use new functionality.
- Client teams: The new transaction type and the logic prohibiting SSTORE, CREATE, CREATE2, and SELFDESTRUCT must be implemented.
- Validators/nodes: Since the gas cost structure is similar to existing types, mempool and inclusion logic do not need major changes.
In depth
New transaction type and payload structure
Both FORK_BLKNUM and TX_TYPE remain TBD, and TX_TYPE must be greater than EIP-4844's 0x03. The transaction payload has the form rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, data, access_list, signature_y_parity, signature_r, signature_s]). Each field has the same meaning as in EIP-1559, except there is no amount (transfer value) field. The destination (to) field cannot be nil and must always point to a 20-byte address, so this transaction type cannot be used to create a new contract. The intrinsic cost is inherited directly from EIP-2930 and is calculated as 21000 + 16 per non-zero calldata byte + 4 per zero calldata byte + 1900 per access list storage key + 2400 per address.
Signing target and receipt format
The signature (signature_y_parity, signature_r, signature_s) is a secp256k1 signature over keccak256(TX_TYPE || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, data, access_list])). The receipt (ReceiptPayload) has the form rlp([status, cumulative_transaction_gas_used, logs_bloom, logs]), following the same structure as other EIP-2718 transactions.
Execution method: delegatecall from an EOA
The execution of this transaction is equivalent to the delegatecall mechanism introduced for contracts in EIP-7, except that the caller is an EOA (the transaction sender). If destination has code, that code executes within the sender's context. As a result, this transaction lets the EOA emit events under its own name or use CREATE2 with the EOA address as the creator.
Forbidden opcodes: SSTORE, CREATE, CREATE2, SELFDESTRUCT
For security, an EOA cannot execute SSTORE (0x55) within a delegation transaction context. Writing storage under an EOA would break many assumptions and could cause problems when later 'migrating' an account via something like EIP-7377, or cause conflicts when one EOA delegates calls to multiple code bases using different storage layouts. For the same reason, CREATE (0xF0), CREATE2 (0xF5), and SELFDESTRUCT (0xFF) are also forbidden, since they could break the assumption that the sender's nonce increases consecutively across transactions. Any attempt to execute these four opcodes throws an exception. However, if a CALL is performed within a delegation transaction, the called contract can write storage or create contracts as usual.
Backward compatibility and mempool inclusion
Since this uses the EIP-2718 transaction envelope, there are no known backward compatibility issues. Because the inclusion logic and gas cost resemble type 2 transactions, this new transaction type is expected to be includable in the same mempool.
Security considerations
As with other transaction types, the nonce mechanism prevents replay attacks and allows cancellation by replacing with a dummy transaction paying a higher fee. Unlike EIP-3074, the signing target here is the transaction itself rather than a general-purpose signature that could be processed in multiple ways, which reduces the risk of signature misuse. Wallets can simulate the execution of this delegation transaction in advance to guarantee that what the user is signing has not been tampered with. However, since the contract invoked through this mechanism can perform any action on behalf of the signer, the signer must exercise great caution when signing a delegation transaction.
Current status
This EIP's status is Stagnant, and since both FORK_BLKNUM and TX_TYPE remain TBD (undetermined), the actual inclusion timing and transaction type number have not been set. The provided call records contain no decision to include this EIP in a fork.