...

EIP-4337: Essential Overview and Key Developments Part 1

EIP-4337

Affiliate Disclosure Program

Cryptonerdian.com is reader-supported. When you buy through links on our site, we may earn an affiliate commission. Learn more

EIP-4337, also known as Ethereum Improvement Proposal 4337, is a crucial development that aims to enhance the Ethereum ecosystem’s functionality and provide greater flexibility to users and developers. Focused on account abstraction, this proposal promises to revolutionize the way Ethereum users interact with the network. The concept of account abstraction has been in development for an extended period, and EIP-4337 aims to concretize these ideas for implementation into Ethereum.

 

One of the key features of this proposal is the ability to represent an account as a smart contract wallet with cryptographic capabilities, providing increased customization and potential for various applications within the Ethereum ecosystem. By broadening the possibilities for transactions and interactions, EIP-4337 plays a vital role in enabling enhanced privacy-preserving solutions and more composable decentralized finance (DeFi) applications on the Ethereum platform.

 

The introduction of EIP-4337 brings Ethereum closer to achieving its long-term vision of becoming an advanced and adaptable platform for building globally accessible and decentralized applications. By allowing users and developers to take advantage of the abundant opportunities offered by account abstraction, this improvement proposal will serve as a vital driving force for Ethereum’s continued evolution.

Background and Overview

Account Abstraction

Account abstraction is a concept in the Ethereum ecosystem aimed at providing a more flexible and simplified account management system. It allows users to represent their accounts as smart contracts rather than the traditional externally owned accounts (EOAs). This approach enables customization of authentication, fee payment, and transaction logic within individual smart contracts, increasing functionality and versatility within the Ethereum network.

One of the key proponents of account abstraction is Vitalik Buterin, the co-founder of Ethereum. The concept has been discussed and proposed within the Ethereum community for several years, with numerous Ethreum Improvement Proposals (EIPs) and Ethereum Request for Comment (ERC) standards addressing different aspects of the idea.

EIP-2938

EIP-2938 is an Ethereum Improvement Proposal introduced by Vitalik Buterin and Yoav Weiss. This proposal details a specific implementation of account abstraction and suggests the addition of new transaction types to support abstracted accounts. EIP-2938 aims to improve usability and composability of smart contracts, particularly for decentralized finance (DeFi) applications, by overcoming limitations of the existing account model.

The proposal introduces the following key features:

  • New transaction types: To support abstracted accounts, two new transaction types are proposed: the initiate transaction and the continue transaction. These transactions are responsible for creating and executing contracts with abstracted accounts.
  • Sponsored transactions: EIP-2938 enables sponsored transactions, where the gas fee for a transaction can be paid by a sponsor rather than the account owner. This is particularly beneficial for users with no Ether in their accounts or for simplifying onboarding processes.

 

ERC-4337

ERC-4337 is an Ethereum Request for Comment standard that builds on the ideas of EIP-2938 and previous account abstraction efforts. It proposes a method to represent Ethereum accounts as smart contract wallets through a combination of new transaction types and contract specifications.

Some of the primary proposed features in ERC-4337 include:

  • New transaction type: ERC-4337 suggests a new transaction type called the user operation, which can represent multiple calls to various contracts, with support for both nonces and chain-dependent validities.
  • Flexible fee payment: This standard allows flexibility in transaction fee payment options, including fees paid in Ether, ERC-20 tokens, or fee delegation to third parties.
  • Relayer support: Relayers act as intermediaries transmitting the user operations to the Ethereum network. In ERC-4337, relayers can also pay transaction fees on behalf of the user and receive compensation in return, enhancing the user experience.

In summary, both EIP-2938 and ERC-4337 are efforts made by the Ethereum Foundation and its contributors, such as Vitalik Buterin and Yoav Weiss, to enhance the functionality and flexibility of Ethereum accounts. These proposals aim to simplify account management, promote usability, and support the growing demands of the DeFi ecosystem.

Core Concepts

EIP-4337, also known as Ethereum Improvement Proposal 4337, proposes a new mechanism for handling transactions on the Ethereum network. This section will discuss the core concepts of EIP-4337, including Entry Points, Bundlers, and Sponsored Transactions.

Entry Points

An entry point is a designated point of execution within the Ethereum Virtual Machine (EVM). In EIP-4337, entry points represent a new way to initiate transactions. Instead of sending transactions directly to the recipient’s address, users submit them to a specific entry point, which manages the execution of transactions.

An entry point can be thought of as a smart contract that governs the transaction process. It ensures that certain requirements are met before a transaction is executed, such as verifying signatures, checking the transaction’s validity, and maintaining state changes.

Examples of entry points include:

  • Account abstraction: which simplifies identity management by abstracting away the underlying cryptography. More details can be found in this paper on Zero-Knowledge Address Abstraction.
  • User-defined smart contracts: which can implement custom logic for transactions, such as enforcing spending limits or requiring multi-signature approvals.

 

Bundlers

In EIP-4337, a new role called a bundler is introduced. A bundler is an entity responsible for aggregating individual transactions into a single bundle and submitting the bundle to the entry point for execution.

Bundlers are crucial to the EIP-4337’s design, as they handle various tasks such as:

  • Selecting transactions: choosing which transactions to include in the bundle based on factors such as gas price, user preferences, or network congestion.
  • Ordering transactions: determining the sequence in which transactions are executed within the bundle.
  • Submitting the bundle: sending the aggregated bundle of transactions to the entry point for execution, as proposed in Flexible anonymous transactions (Flax).

Bundlers receive incentives for their services in the form of fees, paid by users or sponsors, depending on the implementation.

 

Sponsored Transactions

EIP-4337 introduces the concept of sponsored transactions, where a third-party entity, known as a paymaster, covers the transaction fees on behalf of the user. Sponsored transactions enable users to interact with the Ethereum network even if they lack the necessary funds for gas fees or prefer not to pay them.

The paymaster is responsible for:

  • Covering the transaction fees: paymasters agree to pay the gas fees associated with the transaction.
  • Establishing relationships with bundlers: paymasters work with bundlers to ensure that their sponsored transactions are included in bundles and executed by the entry point.

In return for covering the costs, paymasters may charge users or other participants a predetermined fee or implement alternative revenue-generating mechanisms, such as advertisement or subscription models.

Here’s a brief comparison between traditional and EIP-4337 transaction models:

 

FeatureTraditional ModelEIP-4337
Transaction initiationDirectly to recipient’s addressVia an entry point
Transaction aggregationMined by minersHandled by bundlers
Fee paymentPaid by usersPaid by users or sponsored by paymasters

 

By introducing these core concepts, EIP-4337 aims to address various challenges in the current Ethereum transaction model, such as improving transaction flexibility, simplifying identity management, and providing better support for Layer-2 solutions.

User Operations and Transactions

UserOperation

User operations are a new way to represent transactions in Ethereum, introduced by EIP-4337. They allow users to interact with smart contracts and submit transactions while providing better flexibility and control over gas fees. User operations do not require a nonce, making it easier for users to execute multiple operations simultaneously without worrying about sequencing them.

A typical UserOperation has the following properties:

  • userOperationType: The type of user operation. There are variants like 0x00 for NoOp, 0x01 for Direct Call, and others.
  • to: The target address of the smart contract that the user wants to interact with.
  • data: The associated data, typically representing the function call and its parameters.
  • maxFeePerGas: The maximum gas price the user is willing to pay per unit of gas consumed by the operation.
  • maxPriorityFeePerGas: The maximum fee the user is willing to pay to the miner per unit of gas to prioritize their transaction.

 

Gas Fees

Gas fees in Ethereum are used to compensate miners for including transactions in a block. The gas cost consists of two parts: the base fee and the priority fee.

  • Base Fee: The base fee is the minimum amount required to include a transaction in a block. It is adjusted dynamically depending on the network congestion to target a block’s gas usage at 50%. When the gas usage is above 50%, the base fee increases, and when it is below 50%, the base fee decreases.

    A formula to calculate the base fee is as follows:

    base_fee_per_gas = max(base_fee_per_gas * gas_target / gas_used, 0)
    
  • Priority Fee: The priority fee, also known as the “tip,” is an additional fee paid by the user to incentivize miners to prioritize their transaction. Miners receive the priority fee directly for including the transaction in a block.

Combined, the total transaction fee can be calculated as follows:

total_fee = (base_fee * gas_used) + (priority_fee * gas_used)

EIP-4337 offers better fee control with the introduction of maxFeePerGas and maxPriorityFeePerGasparams in UserOperation. Users can set limits on how much they are willing to pay for gas and priority fees, reducing the likelihood of overpaying or unexpected costs.

 

Examples

Consider the following example, where the base fee is 100 Gwei and a user wants to submit a transaction with a gas limit of 50,000:

  1. Without EIP-4337:

User submits a transaction at a gas price of 110 Gwei. In this case, the total fee would be:

total_fee = gas_price * gas_limit
total_fee = 110 Gwei * 50,000
total_fee = 5,500,000 Gwei
  1. With EIP-4337:

User submits a UserOperation with maxFeePerGas set to 110 Gwei and maxPriorityFeePerGas set to 1 Gwei. Total fee:

base_fee = 100 Gwei * 50,000
priority_fee = 1 Gwei * 50,000
total_fee = base_fee + priority_fee
total_fee = 5,000,000 Gwei + 50,000 Gwei
total_fee = 5,050,000 Gwei

In this example, using EIP-4337’s UserOperation, the user saves 450,000 Gwei compared to a traditional transaction, showing the benefits of better fee control.

By Dindu

Passionate Crypto Blogger

We have made it our business to provide interested crypto beginners with the necessary background knowledge about the world of cryptonomics to get a better picture of this exciting world. Come along and dive with us into the world of cryptos!

Dindu

Top 10 Coin Picks
bitcoinBitcoin
$ 98,121.29
$ 98,121.29
1.29%
ethereumEthereum
$ 3,423.51
$ 3,423.51
3.28%
tetherTether
$ 1.00
$ 1.00
0.04%
solanaSolana
$ 255.71
$ 255.71
0.52%
bnbBNB
$ 657.25
$ 657.25
4.4%
xrpXRP
$ 1.49
$ 1.49
3.09%
dogecoinDogecoin
$ 0.436608
$ 0.436608
6.32%
usd-coinUSDC
$ 1.00
$ 1.00
0.04%
cardanoCardano
$ 1.08
$ 1.08
8.97%
staked-etherLido Staked Ether
$ 3,421.81
$ 3,421.81
3.25%
Product Picks
Favorite Posts
Explore Categories
Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.