Subscribe to wiki

Share wiki

ERC-4337

Social Profiles:
Blockchains:

Price

$3,386.31

7.83%

Market Cap

$407,946,526,642.00

7.70%

Diluted Market Cap

$407,660,689,314.67

7.70%

Volume
24h

$52,109,357,419.93

0.06%

Ethereum

ETH

USD

USD

ERC-4337

ERC-4337 is an standard that aims to revolutionize the way user accounts are handled in the Ethereum ecosystem, as part of the Shanghai of the Shapella Upgrade. It is a means of account abstraction that allows for the creation of smart accounts. These accounts are entities that can perform multiple tasks, handle multi-factor authentication, initiate and sustain crypto subscriptions, and more, all through code. [1]

Overview

On March 1, 2023, during WalletCon in Denver, , a security fellow from the Ethereum Foundation, announced that the primary contracts for ERC-4337, commonly referred to as "account abstraction" by blockchain developers, had undergone an audit by  and were approved for use on all Ethereum Virtual Machine (EVM) compatible networks, including , , , , , and Chain. [2]

The primary goal of ERC-4337 is to bring the functionality of to wallets. Traditionally, wallets have been limited to managing private keys and signing transactions. However, with ERC-4337, wallets become synonymous with smart accounts, allowing for more complex functionality. ERC-4337 aims to increase the adoption of technology by simplifying the user experience and making it easier for non-developers to interact with the Ethereum ecosystem. [3]

Account Abstraction

With ERC-4337, Ethereum plans to bring new ideas to user accounts and make them more user-friendly.
Account abstraction is a -specific term that refers to the ability to abstract away the details of an account's implementation from the contract code that interacts with it. This means that developers can write contract code that can interact with different types of accounts without knowing the specific implementation details of each account type. [3]

The term "abstraction" refers to the removal or extraction of legacy handling of user accounts, such as the reliance on private keys and the need for seed phrases. Account abstraction enables platforms to offer services without the need for users to create a conventional wallet and manually save their seed phrase or private key. This is possible as cryptographic keys can be saved locally in the hardware security module (HSM), allowing the creation of secure self-custodied cryptocurrency wallets. [4]

Functions and Mechanisms

ERC-4337 has multiple functions and mechanisms for creating and executing user-operated , whilst maintaining security on the network. [5]

It provides rules and mechanisms for validating UserOperations before they are added to the mempool and bundled into transactions. The validation process checks for forbidden opcodes, limited storage access, and limitations on CALL opcodes. The UserOperation is not allowed to access any data related to other UserOperations or contracts, and three special contracts interact with the account: the factory, the paymaster, and the signature aggregator. [5]

The code is also built to ensure the safety of the platform by implementing a set of entry point methods that handle user operations and aggregated operations. These methods perform various checks and validations to ensure that only valid operations are executed, and that they are executed in a secure and efficient manner. [5]

For example, the handleOps function makes two loops, the verification loop and the execution loop, to validate and execute each user operation. In the verification loop, the function creates the account if it does not yet exist, and calls validateUserOp on the account to verify the operation's signature, pay the required fee, and validate the account's deposit. In the execution loop, the function calls the account with the user operation's calldata, and it's up to the account to choose how to parse the calldata and execute the operation. To prevent malicious actors from disrupting the platform, the code implements a reputation system for paymasters, who can sponsor transactions for other users. The paymaster interface includes functions for validating user operations and managing their deposit, as well as adding and withdrawing stakes. [5]

image
The code also includes checks to prevent DoS attacks by paymasters and ensure that they have enough ETH deposited with the entry point to pay for the operation. If the paymaster's validatePaymasterUserOp function returns a "context", the handleOps function must call postOp on the paymaster after making the main execution call, and guarantee the execution of postOp by making the main execution inside an inner call context. [5]

The protocol also includes several functions to make account abstraction not just secure but also efficient. Some of the main functions includes eth_sendUserOperation for submitting UserOperation objects, eth_estimateUserOperationGas for estimating gas values, eth_getUserOperationByHash for returning a UserOperation based on a hash, eth_getUserOperationReceipt for returning a UserOperation receipt based on a hash, and eth_supportedEntryPoints for returning an array of supported entryPoint addresses. [5]

Authors

[5]

See something wrong?

Edited By

Profile picture of Anonymous uservzbrv

Edited On

April 18, 2023

REFERENCES

[1]

Beincrypto on ERC-4337

Mar 14, 2023

[2]

Cointelegraph on ERC-4337

Mar 14, 2023

[3]

Coindesk on Account Abstraction

Mar 14, 2023

[4]

Cryptoslate on ERC-4337

Mar 14, 2023

[5]

EIP-4337 on EIPS

Mar 16, 2023