Wiki/EIP-7702: Set-Code Transactions for EOAs Explained
EIP-7702: Set-Code Transactions for EOAs Explained - Biturai Wiki Knowledge
ADVANCED | BITURAI KNOWLEDGE

EIP-7702: Set-Code Transactions for EOAs Explained

EIP-7702 is an Ethereum upgrade that allows standard Externally Owned Accounts (EOAs) to temporarily or persistently delegate their execution to a smart contract. This transforms EOAs into "smart EOAs," enabling advanced features like

Biturai Knowledge
Biturai Knowledge
Research library
Updated: 6/26/2026
Technically checked

Structure, readability, internal linking, and SEO metadata were automatically checked. This article is continuously updated and is educational content, not financial advice.

Definition

EIP-7702, an Ethereum Improvement Proposal, introduces a fundamental change to how Externally Owned Accounts (EOAs) operate on the Ethereum blockchain. At its core, EIP-7702 enables an EOA to temporarily or persistently set its own code, effectively allowing it to delegate its execution logic to a smart contract. This upgrade transforms a traditional EOA, typically controlled solely by a private key, into a "smart EOA" that can leverage the sophisticated capabilities of smart contracts. This means that while the address and private key remain the same, the account gains the ability to execute complex, programable logic previously exclusive to smart contract accounts.

EIP-7702: An Ethereum Improvement Proposal that allows Externally Owned Accounts (EOAs) to temporarily or persistently delegate their execution logic to a specified smart contract, effectively upgrading them to "smart EOAs" with enhanced functionalities.

Key Takeaway

The primary benefit of EIP-7702 is its ability to bring account abstraction features directly to existing EOAs without requiring users to migrate their funds or change their private keys. This allows for a seamless transition to a more flexible and powerful account model, offering functionalities such as batched transactions, gas sponsorship, session keys, and granular permissions. It significantly enhances user experience and security by enabling programable control over an EOA's assets and interactions, making it a pivotal step towards a more user-friendly and adaptable Ethereum ecosystem.

Mechanics

EIP-7702 introduces a new EIP-2718 transaction type, specifically designated as 0x04, known as the "set code transaction." This new transaction type allows an EOA to specify a smart contract address whose code will be executed in the context of the EOA. When an EOA initiates a 0x04 transaction, it includes an authorization_list. This list comprises tuples, each formatted as [chain_id, address, nonce, y_parity, r, s], which collectively indicate the desired delegation. For each tuple, a specific delegation indicator, (0xef0100 || address), is written to the authorizing account’s code. This mechanism effectively modifies the EOA's state to point to the delegate smart contract.

Once this delegation is established, any subsequent operation involving the EOA will load and execute the code pointed to by the delegation. This means that the delegate contract's logic will govern how the EOA behaves, allowing for complex operations to be performed on its behalf. The delegation can be temporary, lasting only for the duration of a single transaction, or persistent, remaining active across multiple transactions until explicitly revoked or changed. To revoke a delegation, a user can sign a new EIP-7702 authorization pointing to the zero address, effectively clearing the delegated code and reverting the EOA to its traditional state. The contract_code field within the transaction payload specifies the code to be set, or the address of the contract to delegate to. This innovative approach allows for dynamic modification of an EOA's execution environment without altering its fundamental identity.

Trading Relevance

The implications of EIP-7702 for trading and decentralized finance (DeFi) are profound, primarily by enhancing the flexibility and security of user interactions. With smart EOA capabilities, traders can execute batched transactions, combining multiple operations like approving a token, swapping it on a decentralized exchange, and then staking the resulting asset into a single atomic transaction. This not only streamlines complex trading strategies but also reduces the number of individual signatures required, improving efficiency and potentially lowering transaction costs by optimizing gas usage.

Furthermore, EIP-7702 facilitates gas sponsorship, where a third party, such as a dApp or a service provider, can cover the transaction fees for a user. This removes a significant barrier for new users and can enable innovative business models in DeFi, where users might pay for services in tokens other than ETH or enjoy gas-free transactions for specific actions. Session keys also become possible, allowing users to grant limited, time-bound, or action-specific permissions to dApps without exposing their main private key. For instance, a trader could issue a session key that permits only specific token swaps up to a certain volume for a defined period, significantly enhancing security and risk management in active trading scenarios. This level of programable control transforms the trading experience, making it more secure, efficient, and accessible.

Risks

While EIP-7702 offers significant advancements, it also introduces new vectors for potential risks that users and developers must carefully consider. The primary concern revolves around the security of the delegate smart contract. If an EOA delegates its execution to a poorly audited, vulnerable, or malicious smart contract, the EOA's assets could be compromised. The delegate contract effectively gains control over the EOA's actions, meaning any flaw in its code could lead to unauthorized transactions, asset theft, or other detrimental outcomes. Users must exercise extreme caution and due diligence when selecting which contracts to delegate to, ensuring they are reputable, thoroughly audited, and have a strong security track record.

Another risk lies in the potential for social engineering attacks. Malicious actors could trick users into signing EIP-7702 transactions that delegate to attacker-controlled contracts, masquerading as legitimate services. The complexity of understanding what a delegation truly entails might be challenging for less technical users, making them susceptible to such scams. Furthermore, the persistent nature of some delegations means that a compromised delegate contract could maintain control over an EOA for an extended period, even after the initial interaction. Developers integrating EIP-7702 must implement robust user interfaces that clearly communicate the implications of delegation, and users should always verify the contract addresses and permissions they are granting. The enhanced flexibility comes with an increased responsibility for security awareness and careful decision-making.

History and Examples

EIP-7702 represents a significant evolution in Ethereum's account model, building upon previous efforts to enhance account functionality. It was formally proposed as an Ethereum Improvement Proposal and is slated for activation on the Ethereum mainnet as part of the Pectra hard fork, anticipated around May 2025. This timeline positions EIP-7702 as a forward-looking upgrade, designed to be a cornerstone of future Ethereum user experiences. It complements existing initiatives like ERC-4337, which standardizes how smart accounts interact with bundlers and paymasters, but does not replace it. While ERC-4337 focuses on the infrastructure for smart account interactions, EIP-7702 directly upgrades the capabilities of the EOA itself.

A practical example of EIP-7702's utility can be seen in a gas-sponsored NFT purchase. Imagine a user wants to buy an NFT from a marketplace, but they don't have ETH for gas. With EIP-7702, the user could have previously delegated their EOA to a smart contract wallet implementation (e.g., from Safe or Biconomy) that supports gas sponsorship. When the user initiates the NFT purchase, the delegate contract's code executes, allowing a paymaster service to cover the gas fees on the user's behalf. The user simply signs the transaction, and the delegate contract handles the gas payment logic. Another example involves EIP-5792, which provides a standard for dApps to detect and integrate with smart account features, including those unlocked by EIP-7702. This allows dApps to offer a richer, more integrated experience for users leveraging these advanced EOA capabilities, similar to how EIP-5003 and EIP-7377 explored account migration and code setting.

Common Misunderstandings

One common misunderstanding about EIP-7702 is that it replaces ERC-4337. This is incorrect; EIP-7702 and ERC-4337 are complementary. ERC-4337 provides a standardized framework for account abstraction that allows smart contract wallets to interact with the network via bundlers and paymasters, abstracting away gas payments and signature schemes. EIP-7702, on the other hand, upgrades existing EOAs to become smart accounts, enabling them to utilize such frameworks. EIP-7702 focuses on the account's internal capabilities, while ERC-4337 focuses on the external infrastructure for smart account interactions. They work in tandem to deliver a comprehensive account abstraction experience.

Another misconception is that EIP-7702 permanently changes the EOA's private key or address. This is also false. The EOA's address and the private key controlling it remain unchanged. EIP-7702 merely allows the EOA to temporarily or persistently delegate its execution logic to a smart contract. The underlying ownership structure remains intact. Users can revoke the delegation at any time by signing a new EIP-7702 transaction that points to the zero address, effectively reverting their EOA to its original state. The delegation is a configurable state of the EOA, not a permanent alteration of its core identity. It's about adding a layer of programable functionality, not fundamentally altering the account's cryptographic foundation.

Summary

EIP-7702 marks a pivotal advancement for the Ethereum ecosystem, fundamentally transforming the capabilities of Externally Owned Accounts. By introducing a new transaction type that allows EOAs to delegate their execution to smart contracts, it unlocks a suite of powerful features such as batched transactions, gas sponsorship, and session keys. This upgrade brings the benefits of account abstraction directly to existing wallets, enhancing user experience, security, and flexibility without requiring a change in private keys or addresses. While offering immense potential for innovation in DeFi and dApps, users must remain vigilant regarding the security of delegated contracts and potential social engineering risks. EIP-7702, alongside initiatives like ERC-4337, paves the way for a more adaptable, user-friendly, and secure future for Ethereum users.

OKX · Official Biturai Partner

OKX

Explore the current OKX offering through the official Biturai partner link. Products and availability may vary by country.

Explore OKX

Partner link · Biturai may receive compensation when it is used · not investment advice

OKX

Disclaimer

This article is for informational purposes only. The content does not constitute financial advice, investment recommendation, or solicitation to buy or sell securities or cryptocurrencies. Biturai assumes no liability for the accuracy, completeness, or timeliness of the information. Investment decisions should always be made based on your own research and considering your personal financial situation.

Transparency

Biturai may use AI-assisted tools to research, structure, or update Wiki articles. Editorially reviewed articles are marked separately; all content remains educational and does not replace your own review.