Account Abstraction and ERC 4337: Exploring the Future of Ethereum

Jong Hyuck Won
9 min readDec 8, 2023

--

Introduction to Account Abstraction

Account abstraction is a concept in blockchain technology that allows for the use of smart contract accounts, also known as contract wallets, instead of traditional externally owned accounts. With account abstraction, a contract wallet can be controlled by a key or multiple keys, or even by a complex mechanism encoded within the contract itself. This opens up a range of possibilities and benefits for Ethereum and other blockchain networks.

Here are some key talking points about account abstraction:

  • Benefits of using contract wallets: Contract wallets offer advantages such as social recovery and complex access control. In the case of social recovery, if a user loses access to their wallet, their friends can sign a special message with their keys to help them recover it. Complex access control, such as multi-signature functionality, can also be implemented in contract wallets.
  • Switching to different signature schemes: Account abstraction allows for flexibility in signature schemes. In the future, Ethereum can switch to alternative schemes such as BLS or quantum-resistant signatures, enhancing security and staying up-to-date with cryptographic advancements.
  • Batching multiple operations: With account abstraction, multiple operations can be bundled together in a single call, reducing transaction costs and improving efficiency. For example, when trading an ERC20 token on Uniswap, the approval and transfer actions can be combined in one call.
  • Gas abstraction for decentralized applications: Gas abstraction enables decentralized applications (DApps) to pay for their users’ gas fees. This is particularly useful for onboarding new users who may not have cryptocurrency by allowing a centralized service provider to sponsor the gas fees.
  • Paying for gas with tokens: In the context of account abstraction, users can pay for gas fees using tokens instead of ether. The contract wallet can handle the conversion from tokens to ether behind the scenes, making it seamless for users.
  • Private withdrawals from zero-knowledge mixers: Account abstraction enables private withdrawals from zero-knowledge mixers, such as Tornado Cash. Previously, users needed to associate their withdrawal address with an address holding ether, compromising privacy. With account abstraction, the withdrawal operation can pay for itself, maintaining anonymity.
  • Cross-chain operations without holding native currencies: With account abstraction, it is possible to perform cross-chain trades or operations without holding the native currencies of both chains. This opens up opportunities for interoperability and simplifies the user experience.

Account abstraction, implemented through the ERC 4337 proposal, brings new possibilities to Ethereum and blockchain technology. It offers increased flexibility, security, and efficiency for smart contract accounts, paving the way for innovative applications and improved user experiences.

The Importance of ERC 4337

ERC 4337, also known as Account Abstraction, is a significant development in the Ethereum blockchain. It introduces the concept of contract wallets, which can be controlled by keys or complex mechanisms encoded within the contract itself. This innovation brings several benefits and opportunities for experimentation and iteration within the Ethereum ecosystem.

  • No need for protocol changes: Unlike previous attempts at account abstraction, ERC 4337 does not require any changes to the Ethereum protocol. This means it can be immediately used on any EVM chain, allowing developers to start experimenting with account abstraction without waiting for a hard fork.
  • Immediate use on any EVM chain: With ERC 4337, developers can explore immediate use cases on any Ethereum Virtual Machine (EVM) chain, including mainnet and testnets. This provides a wide range of opportunities for developers to test and iterate on their ideas.
  • Opportunity for experimentation and iteration: The implementation of ERC 4337 opens up possibilities for experimentation and iteration. Developers can start building ERC 4337 wallets and paymasters, and explore different gas abstraction models. This allows for innovation and the development of new and improved applications.
  • Goal of replacing externally owned accounts (EOA): The ultimate goal of ERC 4337 is to replace externally owned accounts (EOA) with contract wallets. This shift will provide increased flexibility, security, and efficiency for smart contract accounts, paving the way for a new era of account abstraction.
  • First step towards a new era of account abstraction: ERC 4337 serves as the first step towards a new era of account abstraction in the Ethereum ecosystem. It introduces the concept and provides a foundation for further advancements in this field.

With its ability to enable immediate use on any EVM chain, its potential for experimentation and iteration, and its goal of replacing EOAs, ERC 4337 is a significant development in the Ethereum blockchain. It sets the stage for a new era of account abstraction and opens up opportunities for innovative applications and improved user experiences.

How Account Abstraction Works

Account abstraction is a key concept in blockchain technology, enabling the use of contract wallets instead of traditional externally owned accounts. To understand how account abstraction works, let’s explore the different components and processes involved:

Introduction to User Operations and the Alternative Mempool

With account abstraction, user operations are created and submitted to the alternative mempool instead of the traditional transaction pool. This allows for greater flexibility and customization in how operations are bundled and processed.

Role of Bundlers in Validating and Bundling User Operations

Bundlers play a crucial role in the account abstraction process. They validate user operations by checking for proper signature and authorization. Once validated, bundlers bundle multiple user operations into a single transaction, reducing transaction costs and improving efficiency.

Process of Sending Bundled Operations to the Contract Wallet

After bundling the user operations, the bundlers send the bundled operations to the contract wallet through a global contract called the entry point. The contract wallet receives the bundled operations and prepares to execute them.

Permissionless Nature of Becoming a Bundler

One of the key advantages of account abstraction is that anyone can become a bundler, including miners or validators. This permissionless nature encourages participation and decentralization within the network.

Involvement of Miners and Validators in the Mempool

Miners and validators play a crucial role in the alternative mempool. They participate in mining bundled user operations and validating their authenticity. Their involvement helps maintain the security and integrity of the account abstraction process.

Simulation and Validation of User Operations

Before executing the bundled operations, the contract wallet performs a simulation and validation of each user operation. This ensures that the operations will be successful and prevents potential errors or conflicts.

Payment and Execution of Operations by the Contract Wallet

Once the bundled operations are validated, the contract wallet executes them according to the user’s instructions. The contract wallet also handles the payment for the operations, either in Ether or through token conversions.

Optional Involvement of Paymasters for Gas Abstraction

Gas abstraction is a key feature of account abstraction, allowing decentralized applications to pay for their users’ gas fees. Paymasters can be involved in this process, sponsoring the gas fees for users and enabling a smooth onboarding experience.

Verification and Payment Process for Paymasters

Paymasters have the responsibility of verifying and approving user operations. They ensure that the operations are valid and authorized before paying for the gas fees. Paymasters may also perform additional actions, such as charging the user for token transfers or conducting bookkeeping.

Role of Entry Point Contract in the Overall Process

The entry point contract serves as a central component in the account abstraction process. It handles the validation of user operations, communication with the contract wallet, and coordination with bundlers and paymasters. The entry point contract ensures the smooth flow of operations and maintains the integrity of the system.

By understanding how account abstraction works, developers and users can explore the possibilities and benefits it offers. Account abstraction opens up new avenues for innovation, flexibility, and efficiency in smart contract accounts, paving the way for a brighter future in blockchain technology.

Security Considerations

When implementing account abstraction and utilizing ERC 4337, it is crucial to consider various security requirements to ensure the integrity and robustness of the system. Below are some key security considerations:

  • Overview of Security Requirements: Account abstraction introduces new security requirements that need to be met to protect against potential vulnerabilities and attacks. It is important to carefully analyze and implement these requirements to maintain a secure environment.
  • Recent Security Audit by OpenZeppelin: The ERC 4337 proposal has undergone a comprehensive security audit by OpenZeppelin. The audit ensures that the contract is secure and free from potential vulnerabilities. It is recommended to review the audit report and address any identified issues.
  • Denial of Service Risk and Mitigations: There is a risk of denial of service (DoS) attacks against bundlers. To mitigate this risk, it is important to implement appropriate measures such as limiting validation gas and monitoring the workload on bundlers to prevent unpaid work.
  • Limiting Validation Gas for Bundlers: By setting limits on the validation gas for each user operation, bundlers can avoid accepting operations that require excessive gas and mitigate the risk of unpaid work.
  • Ensuring Consistency in the Environment: To maintain a consistent environment, it is important to prevent operations that rely on dynamic factors such as block numbers during validation. Restrictions should be placed on certain environmental operations to ensure consistency and avoid potential conflicts.
  • Restricting Certain Operations and Op Codes: Certain operations and op codes should be restricted during validation to prevent misuse and potential security vulnerabilities. For example, restrictions can be placed on gas left calls to prevent unauthorized access and decision-making based on gas values.
  • Protection Against Storage Changes: To prevent a single storage change from invalidating multiple operations, wallets are limited to accessing only their own storage. This helps mitigate the risk of malicious actions that could invalidate a large number of operations.
  • Reputation System for Paymasters: A reputation system can be implemented to track the behavior of paymasters. Bundlers can maintain reputations for paymasters and throttle or ban paymasters that cause excessive unpaid work. This helps ensure fair and reliable payment handling.
  • Stake Requirement for Preventing Attacks: To deter attackers from creating multiple paymasters that misbehave, a stake requirement can be imposed. Paymasters are required to lock a stake, and if they misbehave, they risk losing their stake, making it economically unfeasible for attackers to conduct such attacks.

By considering these security considerations and implementing the necessary measures, account abstraction and ERC 4337 can be implemented in a secure and reliable manner. It is important to stay vigilant and continue to monitor and address any potential security risks that may arise.

Getting Started and Building with ERC 4337

Now that you have a good understanding of account abstraction and ERC 4337, it’s time to get started and build with this exciting new development in the Ethereum blockchain. Here are some key points to help you get started:

  • Timeline and progress of ERC 4337 development: ERC 4337 has been in development for the past eight months. It has undergone iterations and improvements with the involvement of the Ethereum Foundation, the Netherlands team, and the OpenGSN team. The contract has also undergone a comprehensive security audit by OpenZeppelin.
  • Availability on Ethereum mainnet and testnets: ERC 4337 is now available on the Ethereum mainnet. This means you can start building and experimenting with account abstraction on the main Ethereum network. It is also available on various testnets, allowing you to test and iterate your ideas before deploying them on the mainnet.
  • Integration with other layer 1 and layer 2 networks: While ERC 4337 is currently available on Ethereum mainnet, there are plans to integrate it with other layer 1 and layer 2 networks. This opens up opportunities for developers to build and experiment with account abstraction on a variety of blockchain networks.
  • Encouragement for community experimentation: The Ethereum community encourages developers to start experimenting with ERC 4337 and account abstraction. This technology provides new possibilities and benefits for smart contract accounts, and the community is excited to see innovative applications and use cases being developed.
  • Support and assistance from the OpenGSN team: The OpenGSN team is actively involved in the development and implementation of ERC 4337. They are available to provide support and assistance to developers who are building with account abstraction. You can reach out to them on their Discord channel for help and guidance.
  • Opportunities for grants from the Ethereum Foundation: If you are building a project that utilizes ERC 4337, you may be eligible for a grant from the Ethereum Foundation. The Foundation is interested in supporting developers who are exploring the potential of account abstraction and creating innovative applications. Be sure to check out the grant opportunities and apply if applicable.
  • Links and resources for further information: To learn more about ERC 4337 and account abstraction, you can refer to the official ERC 4337 proposal and associated resources. These provide in-depth information and technical details about the implementation and usage of account abstraction. The OpenGSN team also provides additional documentation and examples to help you get started.

With the availability of ERC 4337 on Ethereum mainnet and testnets, the support from the OpenGSN team, and the encouragement for community experimentation, now is the perfect time to start building with account abstraction. Take advantage of the opportunities and resources available to you, and unleash the potential of ERC 4337 in your projects.

--

--

Jong Hyuck Won

Building web3 #AA @alchemyplatform, investing and writing @l2iterative, ex protocol builder @harmonyprotocol @klaytn_official, ex @meta, cs @stanford