What is ERC-4337? Account Abstraction

Bitindi Chain
12 min readMar 24, 2023

--

In recent years, the blockchain has been a significant player in the world of smart contracts and decentralized applications (DApps). One of the main challenges faced by developers and users has been the lack of flexibility in the way transactions are handled on the blockchain. This lack of flexibility has led to the development of a new standard, the ‘4337’ standard, which introduces account abstraction to the Ethereum network.

This article will explore what EIP-4337 is and why it is crucial to the future of blockchain technology, including our beloved play-to-earn crypto games. We will also provide a brief history of smart contracts and their evolution on the Ethereum blockchain.

Finally, we will discuss the potential benefits of account abstraction and what it means for the future of Ethereum and the broader blockchain ecosystem.

Let’s understand account abstraction

Account abstraction is a concept that has been introduced to the Ethereum network through the ERC-4337 standard. It refers to the ability of smart contracts to interact with both externally owned accounts and contract accounts without the need for the user to differentiate between them.

Before introducing account abstraction, the Ethereum network treated externally owned accounts and contract accounts as separate entities. Externally owned accounts are controlled by private keys and are owned by individuals, while contract accounts are managed by smart contracts and are owned by the Ethereum network.

This distinction made it difficult for smart contracts to interact with externally owned accounts, as they required users to manage their private keys and initiate transactions manually.

How account abstraction works

Account abstraction works by introducing a new type of smart contract called a “smart contract wallet.” Smart contract wallets act as an interface between users and the Ethereum network, allowing users to interact seamlessly with both externally owned and contract accounts.

When a user sends a transaction to a smart contract wallet, the wallet is responsible for validating the user’s signature and executing the requested operation. The smart contract wallet then decides whether to forward the process to an externally owned account or a contract account, depending on the nature of the procedure.

The smart contract wallet uses a new entry point contract called an “account contract.” This contract acts as a mediator between the smart contract wallet and the Ethereum network, allowing the wallet to interact with both types of accounts.

When a user sends a transaction to a smart contract wallet, it creates a user operation object and passes it to the account contract. The contract then uses the validateuserop function to determine whether the operation is valid and should be executed.

What are the benefits of account abstraction?

It offers several benefits for users and application developers on the Ethereum network. Account abstraction makes it easier for users to interact with smart contracts and execute transactions without managing private keys. It reduces the risk of losing access to funds or making errors when initiating transactions.

For developers, account abstraction offers new possibilities for creating more flexible and user-friendly smart contracts. Smart contract wallets can be designed to include arbitrary verification logic, allowing developers to create customized validation rules for user operations. It opens up new use cases for smart contracts, such as social recovery mechanisms and more sophisticated transaction bundles.

Overall, account abstraction represents a significant step forward for the Ethereum network and has the potential to be a game changer for the large-scale adoption of blockchain technology. With the introduction of account abstraction, the Ethereum ecosystem is better equipped to meet the evolving needs of users and developers and to deliver on the promise of a more decentralized and trustless future.

Ethereum accounts and transactions

An Ethereum account is similar to a bank account in the traditional financial system. They are used to store Ether (ETH), the cryptocurrency that powers the Ethereum network, and other tokens and smart contract data. A unique address, a 20-byte hexadecimal string, identifies every Ethereum account.

Ethereum transactions are used to transfer Ether or execute smart contract code. They include the sender’s address, the recipient’s address (if it is a transfer), the amount of Ether being sent, and an optional data field for executing the contract code.

To initiate a transaction, the sender must sign it with their private key and broadcast it to the network. Miners then validate the transaction and add it to the next block on the blockchain. Transactions on the Ethereum network require a gas fee to be paid, which is used to compensate miners for their work.

The Status Quo: externally owned accounts and contract accounts

The current Ethereum ecosystem has two types of accounts: externally owned accounts (EOAs) and contract accounts. The first type are held and controlled by individuals with private keys to access them. On the other hand, contract accounts are owned and governed by smart contracts that have their own set of rules and code.

EOAs definition

EOAs are Ethereum accounts that are owned and controlled by individuals. They are identified by their public address derived from the account owner’s public key. EOAs can be used to receive and send ether or other ERC-20 tokens. EOAs require the account owner’s private key to access and control them, making them an essential aspect of self-custody and decentralized finance.

Contract accounts explained

They are an Ethereum account owned and controlled by a smart contract. They are identified by a contract address created when the smart contract is deployed on the Ethereum blockchain. Contract accounts can hold Ether and other ERC-20 tokens; their behavior is defined by the smart contract code that controls them. Contract accounts can interact with other contracts, create new ones, and execute complex functions based on their programming.

Why is ERC-4337 a game-changer?

ERC-4337 is a proposed Ethereum Improvement Proposal (EIP) that aims to introduce account abstraction to the Ethereum ecosystem. As discussed earlier, account abstraction is a new concept that allows smart contracts to act as wallets and perform user operations without requiring users to own or manage private keys.

With the introduction of account abstraction, these wallets can perform user operations on behalf of users, which can be a game changer for the Ethereum network.

One of the most significant benefits of ERC-4337 is that it can significantly simplify the user experience for interacting with smart contracts. With ERC-4337, users will no longer need to manage their private keys, making it more accessible to a broader audience. It can lead to the universal adoption of smart contracts, which can be hugely beneficial for Ethereum.

Furthermore, ERC-4337 can also reduce gas fees for transactions. Under the current conditions, users must pay gas fees for each transaction, which can become quite expensive, especially when interacting with multiple smart contracts. With ERC-4337, smart contract wallets can bundle multiple transactions into a single transaction, reducing the overall gas fees.

Entry point contracts and user operations

In Ethereum, an entry point contract is a smart contract that acts as a gateway to other contracts on the network. They typically have a single function that serves as the entry point to the contract, allowing other contracts and users to interact with it.

User operations are specific actions that can be performed on the Ethereum network, such as sending Ether or interacting with a smart contract. A user typically initiates these operations through an application like a wallet that interfaces with the Ethereum network.

How entry point contracts and user operations work together

In the context of ERC-4337, the two concepts work together to enable account abstraction. With an entry point contract, a user can interact with a smart contract wallet through a single function call rather than interacting with multiple contracts separately. This simplifies the user experience and reduces gas costs.

The operations users make, such as depositing or withdrawing funds, are initiated by the user and then validated by the smart contract wallet through the entry point contract. Once the operation is validated, the contract wallet can generate and sign a bundle transaction that includes all the necessary transactions to complete the user operation. This bundle transaction can then be broadcast to the Ethereum network to be included in a block.

Private key — not your keys, not your coins

As you know, the smart contract account and the private key are at the basis of the Ethereum foundation, playing an essential role in the security and functionality of the network.

A private key is a piece of information that is used to authenticate ownership of an Ethereum account. It is a randomly generated sequence of letters and numbers unique to each account. The private key must be kept confidential by the account owner, as anyone who has access to the private key can gain control of the associated account.

The smart wallets are Ethereum accounts controlled by smart contracts, which automatically execute user-defined rules and instructions. They allow new users to perform complex transactions without the need for manual intervention.

A private key is used to access and control EOAs on the Ethereum network. However, smart wallets are managed differently. Instead of using a single private key to control the wallet, smart wallets are governed by a set of rules defined in a smart contract. These rules dictate the conditions under which somebody can transfer funds from the wallet.

To interact with such a wallet, the user typically signs a message with his private key, indicating the intent to perform a transaction. The message is then sent to the smart contract wallet’s entry point contract, which verifies the user’s signature and initiates the requested operation.

Smart wallets offer several benefits over traditional EOAs. They are more flexible and secure, as the smart contract’s rules can be customized to fit the user’s specific needs. Additionally, smart wallets can interact with other smart contracts on the Ethereum network, opening up new possibilities for decentralized applications.

Consensus layer protocol changes and paying gas fees

Consensus layer protocol changes refer to modifications made to the core layer of the Ethereum blockchain. These changes can be implemented to enhance the network’s security, scalability, or efficiency.

The gas fee is the transaction fee required to execute operations on the Ethereum blockchain. When changes are made to the consensus protocol, they can have a significant impact on these fees.

For example, ERC-4337 introduces the validateuserop function, which verifies the validity of an operation before executing it. This function reduces the risk of invalid or malicious operations being conducted on the blockchain, which can lead to lower transaction fees.

These protocol changes can offer numerous benefits to the Ethereum network. For one, they can increase the overall security and reliability of the network. They can also improve scalability and efficiency, enabling it to handle more Ethereum transactions and users.

With account abstraction, it will be possible to bundle transactions and send them as one to save time and transaction fees.

Additionally, changes to the consensus layer can lead to a lower gas fee for traders. This is particularly important for the widespread adoption of Ethereum, as high transaction fees can be a barrier to entry for many people.

Validation logic and verification logic

Validation logic refers to the set of rules and procedures that are used to verify the authenticity and integrity of data and transactions on a blockchain. In the context of Ethereum and ERC-4337, validation logic is used to ensure that operations are valid and meet the necessary requirements before they are executed.

When a new user initiates a transaction on the Ethereum network, the transaction is broadcasted to the network and is picked up by a node. The node then performs a series of checks on the transaction to determine its validity. These checks include verifying that the transaction has a valid signature and that the sender has sufficient funds to complete the transaction.

Once these checks have been completed, the node then executes the transaction and updates the state of the Ethereum network accordingly. The validation logic is implemented at both the consensus layer and execution layer of the Ethereum network, ensuring that transactions are validated and executed securely and efficiently.

Validation logic advantages

Validation logic is a crucial component of the Ethereum blockchain, ensuring that transactions are executed securely and efficiently. By verifying the authenticity and integrity of transactions, validation logic helps to prevent fraud and other malicious activities on the network.

What’s more, validation logic helps to reduce the risk of errors and mistakes in transactions, which can result in lost funds or other negative consequences. By ensuring that operations made by users are valid and meet the necessary requirements before they are executed, validation logic helps to maintain the integrity and reliability of the Ethereum network.

Bundle transactions and relay systems

These Ethereum transactions are a collection of individual transactions bundled into a single transaction. This can be useful for reducing the number of transactions required for a particular operation, which in turn can help reduce the overall fees.

A relay system allows users to submit a bundle transaction without holding any Ether. Instead, the user signs the transaction offline and sends it to a third-party service, which then broadcasts the transaction to the Ethereum network on behalf of the user. The third-party service is responsible for paying any gas fee associated with the transaction.

The use of bundled transactions and relay systems can significantly improve the efficiency of Ethereum by reducing the number of individual transactions that need to be processed. This can help reduce network congestion and lower overall fees.

What is an audited version and a seed phrase?

In the world of blockchain technology, security is of utmost importance. One way to ensure that the code powering the blockchain is secure is by conducting audits. Audits involve thoroughly examining the code for any vulnerabilities or weaknesses attackers could exploit.

An audited version of a smart contract or blockchain protocol is one that has undergone this scrutiny and has been found to be secure.

Seed phrases are a way of securing a private key used to access cryptocurrency wallets. They are a series of words that are used to generate a private key. The seed phrase can regenerate the private key at any time, so it is vital to keep it secure. Seed phrases are usually 12–24 words long and are randomly generated.

ERC-4337 makes self-custody possible, eliminating the need for seed phrases or relying solely on centralized exchanges.

Frequently Asked Questions

What is ERC-4337 account abstraction using alt mempool?

ERC-4337 is a standard proposal for account abstraction using an alternative memory pool (alt-mempool) in the Ethereum blockchain. It aims to improve the efficiency and flexibility of smart contracts by separating transaction validation from transaction execution, which allows for more complex and diverse transaction types.

It is achieved by introducing a new kind of contract called an “entry point contract” that serves as an intermediary between the user and the final contract, enabling the user to interact with the contract without requiring the contract to hold any ETH.

What is account abstraction?

Account abstraction is a term used in blockchain technology to describe the separation of the logic that executes smart contracts from the underlying blockchain accounts that hold cryptocurrency.

It allows for the creation of smart contracts that can perform operations without needing to hold cryptocurrency in the same account, which can lead to a more efficient and flexible execution layer.

What do contract accounts offer more than EOAs?

Contract accounts offer more functionalities than EOAs. Unlike EOAs controlled by private keys, contract accounts can execute complex logic and store and manage data.

They can also receive and send transactions and interact with other contracts on the Ethereum network. Contract accounts also have an Ethereum address, similar to EOAs, that can receive ETH and other tokens.

To sum things up, ERC-4337 introduces account abstraction, which allows for more efficient and flexible smart contracts by separating the execution logic from the address that holds the funds.

Entry point contracts and user operations make it easier to interact with smart contracts, while a private key and smart contract wallets enhance security.

Consensus layer changes reduce gas fees, and validation logic ensures the correctness of the contract execution. Bundled transactions and relay systems enable batched transactions, improving efficiency. Finally, audited versions and seed phrases provide additional security measures.

The future of ERC-4337 in the Ethereum ecosystem is promising, as it enables more complex and flexible smart contract functionality while improving security and efficiency. More developers will likely adopt ERC-4337 and build on top of its features in the coming years.

It’s safe to say that ERC-4337 represents a significant advancement in the capabilities of the Ethereum blockchain. By introducing account abstraction, it enables more efficient and secure smart contracts, which will undoubtedly lead to exciting new use cases and innovations in the blockchain space.

As the ecosystem continues to evolve, it will be fascinating to see how ERC-4337 and other similar standards shape the future of decentralized finance and beyond.

Let’s stay in touch:

🐤 Twitter: https://twitter.com/bitindichain
🦄 Telegram: https://t.me/bitindi

--

--

Bitindi Chain
Bitindi Chain

Written by Bitindi Chain

An innovative blockchain that aims to bring a shift in the blockchain ecosystem by introducing a next generation user-friendly development tools.