Introduction
ERC-4337 has been heralded across crypto Twitter as the arrival of Account Abstraction on Ethereum. Technically speaking, it’s not. Account abstraction unifies EOAs and contract accounts, whereas ERC-4337 is an opt-in standard that can help decentralize the operations of smart contract accounts on Ethereum.
This note focuses exclusively on providing the reader with a high-level understanding of ERC-4337. To learn more about account abstraction, check out Nansen’s report here.
What is it?
ERC-4337 can be described as a transaction relayer infrastructure for smart contract accounts. It can enable the creation of a decentralized fee market for these transactions where previously smart contract wallets needed their own transaction relayer. Therefore, existing smart contract wallets such as Argent and Gnosis Safe will no longer require their own relayer, and building smart contract wallets will become much easier. Transactions initiated by smart contract accounts (called UserOperations) are sent to a mempool and bundlers package these into a transaction to be sent to miners. The verification and execution of transactions is determined by a standardised contract called the EntryPoint
Here is a very simplified diagram of how it works:
It is permissionless to operate as a Bundler (akin to block builders for smart contract transactions) which can enable a decentralized marketplace where bundlers create transactions.
Projects that provide bundler services include Alchemy, Biconomy, Blocknative and Etherspot - however, it is currently relatively centralized. It will be very important that it becomes decentralized to ensure that ERC-4337 transactions are satisfactorily secure and censorship-resistant.
How it Works
As stated above, users send UserOperations to the mempool which are packaged into transactions by the bundler. This requires a mempool node to determine whether the user is able to pay sufficient fees for the transaction before rebroadcasting it. To do this, the UserOperation must not depend on state (as this is continually changing). To get around this issue the validation and execution of the transaction are split. For the validation component, it ensures the account will be able to pay for the transaction and that it does not access state outside the account. If these conditions are satisfied, the transaction can be executed.
Use Cases
While not specific to ERC-4337, it facilitates smart contract accounts and thus their associated use cases.
These include:
Batched transactions
Actions with multiple steps (and requiring multiple transactions) such as LPing can be done within a single transaction. This simplifies the user experience.
Social Logins and Account Recovery
Note that ERC-4337 does not enable social recovery with other smart wallets but can have recovery through EOAs.
Session Keys
Session keys enable users to automate transactions by setting conditions on whitelisted apps. This is primarily applicable to gaming and very important for the gaming UX where constantly having to approve transactions makes the UX uncompetitive.
Auto-recurring Payments
Similar to typical bank accounts, users will be able to create auto-recurring payments.
Fees and Adoption?
Smart contract wallets are second-class citizens on Ethereum - and while ERC-4337 improves the state of affairs, it does not change this. Bundlers will need to be paid for creating the transactions, and these fees are expected to be higher than operating an EOA. This is a challenge to the widespread adoption of contract accounts. Ethereum is already too expensive for most users.
Notable adoption may be seen if bundlers are sufficiently decentralized for high-value applications to leverage the objective benefits of a contract account compared to an EOA. It remains to be seen whether or not the market has sufficient incentives for a wide range of bundlers to participate.
Note that operating as a bundler is akin to that of a block builder, so incentives exist through potential MEV.
Key Issues
Centralization
There are few projects offering services to run bundlers making ERC-4337 currently centralized. There will need to be an influx of bundlers in order for it to become satisfactorily decentralized. These bundlers must be adequately compensated for providing such services. Pimlico received a grant in March 2023 from the Ethereum Foundation to develop an open source bundler in Typescript. This is a step in the right direction, and progress on this front is required.
dApps must support ERC-1271
However, contract accounts remain second-class citizens, and dApps must allow for signatures from smart contract wallets. Applications need to implement ERC-1271 in order for smart contract wallets to interact with them. CowSwap, for example, has implemented ERC-1271, which enables users able to make TWAP smart orders.
Ultimately, there are two key dependencies - dApps implementing ERC-1271, and the fee market for bundling transactions becoming satisfactorily decentralized. After this, strong use cases for using smart contract wallets will be required as they will be more expensive than EOAs on Ethereum for the foreseeable future.
It seems that ERC-4337 is in itself an exciting development as the Ethereum ecosystem and blockchains in general move towards account abstraction. Its most exciting application will be on L2s where fees are much cheaper and native account abstraction can be implemented. StarkNet and zkSync are taking an ERC-4337 approach to account abstraction, albeit with certain modifications.