EIP-3074 and EIP-7702: A New Era to Account Abstraction

BuildBearBuildBear
7 min read

The Ethereum Account Abstraction roadmap kicked off in 2023 and has since become a prominent subject, especially with the recent announcement of EIP-3074’s inclusion in the upcoming Ethereum Hard fork (Pectra).

This article explores how the Pectra upgrade aims to improve Ethereum wallet functionality and enhance the user experience, focusing on its major contributing EIPs: EIP-3074 and EIP-7702.

What is Pectra Upgrade?

The Ethereum Pectra upgrade, expected to be implemented in early 2025, is the next major improvement to the Ethereum Network. The main goals include increasing the maximum stake for validators, improving Ethereum Virtual Machine (EVM) efficiency, and potentially introducing user experience enhancements for wallets.

As a web3 enthusiast, you may have heard a lot about Account Abstraction. Let’s explore how this concept is set to improve wallet functionality.

Understanding Account Abstraction

Most of the time, account abstraction simply means smart contracts that can do more than traditional Externally Owned Accounts. EOAs on Ethereum are controlled by private keys and can initiate transactions by signing them.

However, as our needs evolved, we required a system to handle complex transactions, which isn’t possible with normal wallets. With problems come great solutions, right? This led to the development of Smart Contract Accounts (SCAs), which are programmatically controlled accounts within the Ethereum network that execute actions based on predefined logic.

Here is a quick comparison between Externally Owned Accounts (EOA) and Smart Contract Accounts (SCA) in Ethereum:

So, what exactly is Account Abstraction? It aims to integrate the functionalities of both EOAs and SCAs, allowing for easier interaction in web3.

What are the Benefits of Account Abstraction?

  • Simplifies the interaction process, making it more user-friendly, especially for newcomers.

  • Allows smart contracts to initiate and control transactions on behalf of EOAs without exposing or managing private keys.

  • Minimizes risks associated with key management and enables advanced transaction types and conditional logic.

There were multiple attempts to achieve Account Abstraction and a significant adoption rate as shown below. Let us analyze the EIPs related to AA and how far they have succeeded.

Future of Account Abstraction: ERC-4337 and Beyond

ERC-4337 supports a wide range of features typically unavailable to EOAs, such as paying gas fees in tokens other than ETH, complex account recovery mechanisms, and more advanced transaction batching and scheduling functionalities. This indeed had numerous user experience improvements.

However, EOAs are still the most commonly used type of account used via Metamask Wallets. Most 4337 smart contract accounts are controlled by a single EOA signer due to the lack of a way to convert EOA to a smart contract account and the lack of native support by web3 apps to connect smart contract accounts.

These issues are addressed by EIP-3074, which aims to give EOAs more power by allowing them to delegate control of their EOA to a smart contract. This is a step towards moving existing users from EOAs to smart contract accounts. Additionally, EIP-5003 proposes a method for permanently transitioning from an EOA to an SCA. This would allow EOAs to delegate transaction execution authority to SCAs permanently.

What is EIP-3074: Contributions to Account Abstraction

EIP-3074 introduces new Ethereum opcodes and functionalities that empower smart contracts to interact with EOAs securely and controlled.

It primarily solves the limitations of traditional wallets like Trust Wallet. How? Traditional wallets, which are externally owned accounts (EOAs), are integrated with smart contracts using account abstraction for a smoother user experience.

How does EIP-3074 work?

The EIP-3074 adds new opcodes to the Ethereum Virtual Machine: AUTH and AUTHCALL.

  • AUTH: This command lets users authorize a smart contract to act on their behalf. It uses a special digital signature (ECDSA) to verify that the user has given permission. Once verified, the user’s address is stored in a special variable.

  • AUTHCALL: This command allows the authorized smart contract to perform transactions on behalf of the user. It can send transactions to other addresses, specify amounts, and include data, just like a regular transaction.

Imagine you want to swap 10 DAI for ETH. Instead of signing multiple transactions, you authorize(AUTH) the Invoker with one signature. The invoker will:

  • Uses AUTHCALL to approve Uniswap to spend your DAI.

  • Immediately uses AUTHCALL again to execute the swap of DAI for ETH.

Key Benefits with EIP-3074

EOA Control Delegation

The new opcodes effectively delegate control of an EOA to a smart contract, expanding its capabilities without the need for deploying additional contracts. By delegating transaction execution to SCAs, EIP-3074 reduces the exposure of private keys. Malicious invokers are prevented from directly accessing EOAs’ funds, mitigating the risk of unauthorized transactions.

Impact on Sponsored Transactions

The third-party sponsor can provide the necessary gas fees and submit the transaction to the Ethereum network on behalf of the user. So the user only needs to sign the transaction without needing to pay the required gas fees on their end.

User Experience Improvements

Users can now interact with decentralized applications (dApps) more efficiently, with EOAs gaining capabilities of smart contract wallets. This simplifies transaction processes and reduces the complexity associated with blockchain transaction execution.

Batch Transaction

EIP-3074 allows for batching transactions by grouping all individual transactions and executing them using smart contracts with a single signing. This feature saves gas fees, time, and effort.

Challenges and Considerations

While EIP-3074 brings significant advancements to Ethereum’s Account Abstraction capabilities, it also presents challenges:

  • Malicious Invoker Risks: Delegation of EOA control to SCAs introduces risks of malicious invokers attempting unauthorized transactions.

  • Temporary Delegation: AUTH requires the nonce in the message to be equal to the signer’s current nonce, invalidating outstanding authorizations with a single EOA transaction.

  • Ether Spending Limitations: EOAs under EIP-3074’s control may have limitations on spending Ether directly.

  • Self-Sponsoring Impact: Self-sponsoring transactions by SCAs could potentially circumvent certain security measures, such as flash loan protections.

The Emergence of EIP-7702

Vitalik Buterin proposes an advanced version of EIP3074 called EIP-7702, adding a new transaction type that accepts both a contract_code and a signature field. This allows for the temporary delegation of an EOA to a smart contract during a transaction.

How EIP-7702 Works:

EIP-7702 lets an Externally Owned Account (EOA) temporarily act like a smart contract for a single transaction:

  1. contract_code: The smart contract logic to be temporarily assigned to the EOA for the transaction.

  2. signature: The ECDSA signature authorizing the use of the smart contract code.

For example, if you want to perform a token swap and stake the resulting tokens in a single transaction, EIP-7702 allows your EOA to include the smart contract logic in the contract_code field and an ECDSA signature in the transaction. Once validated, the network temporarily treats the EOA as a smart contract, executing the provided contract_code to perform the swap and stake actions in one go.

Key Benefits of EIP-7702

Trustless Execution

EIP-7702 eliminates the need for a trusted invoker, reducing the risk of malicious actions. No need for a central party to carry out transactions, reducing security risks associated with external invokers.

Simplified Complex Transactions

Users can perform complex transactions in a single step, like token swaps and staking, in one transaction, enhancing user experience by reducing complexity.

Future-Proof Compatibility

Fully compatible with ERC-4337 and future Account Abstraction proposals, ensuring smooth integration and adaptability to upcoming changes in the Ethereum ecosystem.

To wrap it up here is a brief comparison of these EIPs of AA.

Conclusion

Account Abstraction is about making the blockchain more accessible and versatile by taking away the complexity involved in transaction initiation and execution. EIP-3074, along with EIP-7702, represents significant advancements in Account Abstraction, potentially transforming how users interact with web3 applications and enhancing the overall user experience in the web3 ecosystem.

About BuildBear:

BuildBear is a platform tailored for DApp development and testing. Developers gain the freedom to construct a personalized Private Testnet sandbox across a variety of blockchain networks. The liberty to mint unlimited Native and ERC20 tokens, coupled with rapid transaction times on BuildBear (under 3 seconds!), enhances the DApp development lifecycle manifold. The platform comes equipped with tools and plugins designed for real-time testing and debugging, ensuring developers can keep tabs on intricate blockchain transactions with unparalleled ease.

Connect with us on Twitter | LinkedIn | Telegram | GitHub

Author: Sana

0
Subscribe to my newsletter

Read articles from BuildBear directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

BuildBear
BuildBear

BuildBear is a platform for testing dApps at scale, for teams. It provides users with their own private Testnet to test their smart contracts and dApps, which can be forked from any EVM chain. It also provides a Faucet, Explorer, and RPC for testing purposes.