EIP-7702
What Is EIP-7702?
EIP-7702 is a proposal designed to enhance the capabilities of Externally Owned Accounts (EOAs). EOAs are basic accounts on the
Ethereum network that can send transactions and interact with
smart contracts. However, they lack certain functionalities found in certain crypto wallets, such as transaction batching and
gas sponsorship.
EIP-7702 aims to allow EOAs to gain smart contract functionalities by pointing to a specific delegation address whose code they want to execute. This hybrid approach combines the simplicity of EOAs with the programmability of contract-based accounts, introducing features typically reserved for smart contract wallets. EIP-7702 was created in response to some limitations and criticisms of
EIP-3074.
How Does EIP-7702 Work?
EIP-7702 allows an EOA to enhance its functionality by signing an authorization that points to a specific delegation address. This delegation address contains the code that the EOA wants to execute, granting the account new capabilities such as transaction batching, gas sponsorship, and alternative authentication.
Transaction preparation
The user starts by preparing a transaction, including the usual details like destination
address, gas limit, and any data that needs to be sent. In addition to these details, they sign an authorization pointing to a specific delegation address. This delegation address contains the smart contract code that will temporarily enhance their EOA.
Authorization
The user then signs the transaction. This signature is crucial as it authenticates the transaction and includes an authorization list. This list details the delegation address and the conditions under which its code should be executed. Essentially, it verifies and authorizes the temporary assignment of the smart contract code to the EOA.
Execution
When the transaction is submitted to Ethereum, the network processes it by executing the code at the delegation address. This grants the EOA the enhanced functionalities specified in the delegation code, such as transaction batching and gas sponsorship.
Key Features of EIP-7702
Transaction batching: Multiple operations can be executed atomically within a single transaction, eliminating the need for separate transactions for actions like "approve" and "swap".
Gas sponsorship: Others can pay for transaction fees, which is useful for accounts without ETH.
Alternative authentication: Hardware security modules (HSMs) in phones can authorize operations via technologies like passkeys.
Spending controls: Limits can be set on how many tokens a specific application can spend or cap daily outflows from a wallet, which can help enhance security.
Recovery mechanisms: Various options are provided for users to safeguard their assets without needing to migrate to a new account.
Safety Checks in EIP-7702
EIP-7702 includes several safety checks to ensure security:
Chain-specific delegations: Delegations are valid only on a specific chain ID, preventing misuse on different networks.
Nonce-bound delegations: Authorizations are tied to the account's current nonce, invalidating them once the nonce increases.
Revocability: The EOA owner can create new authorizations to revoke or replace existing delegation code, preventing permanent lock-in if issues arise.
Conclusion
EIP-7702 enhances the functionality and security of EOAs by integrating smart contract capabilities while maintaining user control and safety. This proposal represents a significant step towards widespread account abstraction on the Ethereum network, potentially transforming how users interact with their accounts and manage their assets.