See More

ERC-4337: A Complete Guide To Account Abstraction

15 mins
Updated by Artyom G.
Join our Trading Community on Telegram

Onboarding users into the crypto realm is still a challenge. We have complex concepts like smart contracts, tedious working modules involving wallets, and restrictive infrastructure between centralized and decentralized entities to thank for that. Simply put, apart from trading crypto, hardly anything feels effortless to non-developers. Ethereum, in 2023, plans to change that with EIP-4337 and ERC-4337. Termed superchargers set to increase web3 adoption, EIP and ERC-4337 have one primary goal — to bring Smart Accounts to every web3 enthusiast.

This discussion aims to make ERC-4337 more lucid via simple and illustrative means. We delve into the technicals and jargon involving terms like account abstraction, Entry Point, and more, explaining each as clearly as possible, along with a real-world example.

Best Crypto Exchanges for Trading

Best for interest rates

Best for interest rates
Explore YouHodler on YouHodler’s official website
Availability Europe & U.K.
Supported assets 54+
Deposit fees 0
Trading fees rollover fee paid every fixed period of time

Best for spot trading

Best for spot trading
Explore Bybit on Bybit’s official website
Availability U.K., E.U. & 100+
Supported assets 380+
Deposit fees 0
Trading fees 0.10%

Best for altcoins trading

Best for altcoins trading
Explore Binance on Binance’s official website
Availability U.K., E.U. & 150+
Supported assets 380+
Deposit fees 0
Trading fees 0.10%

Unpacking EIP-4337 and ERC-4337

 EIP-4337 and ERC-4337

One thing to note first is that EIP-4337 and ERC-4337 are often referred to interchangeably. But they are different. Here’s how.

Every technical change proposed to the Ethereum ecosystem initially starts as an EIP or an Ethereum Improvement Proposal. Once the on-chain governance model accepts, authorizes, and confirms the change, it becomes ERC or Ethereum Request for Comment.

EIP vs. EIP: Medium
EIP vs. EIP: Medium

So the change started as an EIP-4337 and has now turned into ERC-4337. Also, ERC is one element of the broader EIP space and primarily deals with protocol and development standards. 

Definition of ERC-4337

ERC-4337 is an Ethereum standard (not necessarily a token standard) that aims to supercharge user accounts to smart accounts. A more technical way of defining it would be a means of account abstraction.

But why abstraction?

Abstraction can be termed ideation, meaning that with EIP-4337 or the current ERC-4337, Ethereum has plans to bring new ideas to user accounts. Or it can mean extraction or removal, allowing users to get rid of the legacy handling of user accounts like MetaMask — as per the focus on seed phrases, individual transaction signing, and overreliance on private keys. 

In simple terms, with ERC-4337, the Ethereum ecosystem plans to bring the smart contract functionality to wallets. Or rather, it aims to make wallets synonymous with smart accounts — entities that can perform multiple tasks, handle multi-factor authentication, initiate and sustain crypto subscriptions, and more — all via code. 

Here is everything that can be abstracted:

ERC-4337 and account abstraction: ETHGlobal
ERC-4337 and account abstraction: ETHGlobal

ERC-4337 in super simple terms

Imagine you own a traditional pocket wallet. One section is for cash, while others can be for credit cards, coupons, and more. Every time you want to make a cash transaction, you need to reach out only to the cash section for assistance. Scavenging through the credit card or the coupon section won’t help. 

Now imagine that the pocket wallet is a smart wallet (account abstraction kind). There is only one section with a payment mechanism that gets accepted as cash, credit card, and even coupon. More like it becomes what you want it to be. If you reach out for cash, you get cash; if you reach out for a card, you get a card.

Something similar at the blockchain level is termed account abstraction. And while this is more of a blockchain-specific terminology, a more user-specific term would be smart accounts. 

Here is how Biconomy defines account abstraction with another analogy:

History of account abstraction

The utility of ERC-4337 can be illustrated by the history of proposals related to account abstraction. Let us go through the attempts.

EIP-86: Proposed in 2016-17 with a focus on empowering smart contracts to initiate and approve transactions. Do note that the current generation of wallets (hardware, mobile, etc.) require account owners to sign off transactions.

EIP-2938: Proposed in 2020 with a focus on creating a new type of top-level account using address-specific smart contract creation and implementation.

EIP-3074: Another proposal to emerge in 2020. EIP-3074 would allow more efficient execution of smart contracts courtesy of a new opcode (smart contract building block). This proposal focused on delivering self-executing smart contracts. 

Apart from these, even EIP-196 focussed on making smart contracts more efficient and even secure. However, all of these proposals focusing on some account abstraction didn’t go through. This is because they required changes to the consensus layer of Ethereum.

For the unversed, imagine the consensus layer as the backend, whereas the execution layer is like the front end of the Ethereum ecosystem. 

EIP-4337 was proposed in 2021 and was eventually authorized in 2023 because it ensured zero consensus-layer protocol changes. Ethereum Foundation security researcher Yoav Weiss broke the news.

Imagine you want to cross from one side of a busy street to another. Instead of putting traffic signals and eventually asking the vehicles to stop, you create a flyover. This is positioned on top of the street as a higher infrastructure layer without changing the state of daily road-specific operations. 

What’s better is that the Ethereum-specific flyover, EIP-4337 or now the ERC-4337, works with several Ethereum-specific streets or, rather, EVM-compatible ecosystems. 

The idea behind account abstraction: EOAs vs. Contract Accounts

Now that we know a little about ERC-4337, let’s move to the motivations behind the adoption of its “Audited’ version onto the Ethereum mainnet.

Firstly, most of the existing wallets on Ethereum are EOAs or Externally Owned Accounts powered by third parties. These include the likes of imToken and MetaMask. While these are quite popular, the entire responsibility of controlling the account is on a user’s private key. If you lose the key, you can bid goodbye to your account and the funds inside it. 

Contract accounts vs. EOAs: Jarrodwatts
Contract accounts vs. EOAs: Jarrodwatts

Even hardware wallets like Ledger Nano X and others have similar account-controlling mechanisms. ERC-4337 aims to change this, making accounts synonymous with powerful smart contracts.

And even though the likes of Argent and Gnosis already had smart account functionality, the transaction leg involving transaction fee payment was handled by centralized relays. However, with ERC-4337 and account abstraction, even that bit is now decentralized. 

Here is a look at some comparisons between CAs vs. EOAs:

/Related

More Articles
Parameters | CAs (Contract Accounts) |EOAs (Externally Owned Accounts)
Set upDepends on the wallet providerRequires a seed phrase note down
AutomationCustomizableOnly possible till a sign-off is required
PermissionsCustomizable as per level (access control is allowed)Private keys define everything
Bundled transactionApproval and actual swaps can be batched together. Other transactions can also be batched.Every act requires a sign-off
LimitsCustom spending can be set No automation in regards to limits
Account recoveryAny encoded logic can be set to recover keys. Yours can be as simple as an email with a recovery code.Only seed phrases can help you with recovery. 

Why did ERC-4337 come into existence?

In simple words, ERC-4337 might just make you ditch the “wallet” terminology forever. The only term an aspiring web3 user might use is smart accounts. And suppose you have used traditional, fiat-driven banking services and enjoyed the user experience (centralization, not so much). In that case, ERC-4337 aims to make your experience very “Bank-Like” in terms of user experience and ease of account handling.

And if you are looking for some more specific reasons why ERC-4337 came to be, here are a few:

  1. Zero reliance on seed phrases.
  2. Standard user-onboarding using mobile devices.
  3. Smart contract wallets reduce the chances of human error.
  4. Changes are easy to implement on other chains that are Ethereum Virtual Machine compatible.
  5. The flexibility of activating bank-like features like auto-pay, account recovery, and multi-factor authentication. 
  6. Compatibility with future signature schemes like BLS (Boneh-Lynn-Shacham) and Quantum resistance, making the network less prone to attacks. 

Overall, ERC-4337 would help further the concept of “Trustless Banks.”

Smart accounts trump smart contracts in account abstraction!

Smart contracts have never been very user-specific. They govern features and functionality but in an ecosystem or protocol-specific manner, courtesy of DeFi applications, NFT marketplaces, DAOs, and other entities.

The only way users could interact with the blockchain-specific smart contracts was by using their EOAs, or Externally Owned Accounts like Metamask. From sending funds to a DeFi pool to transferring NFTs to a marketplace to sell to bridging accounts with other chains, every act using EOAs still requires individual transaction signing. 

And while many crypto natives of us have made peace with this process, what about total beginners and older generations? Most wouldn’t enjoy setting up and using an EOA when they already have already experienced the ease of traditional banking.

Here is what the flow looks like to a new user:

Dated EOA flow
Dated EOA flow: Jarrodwatts


And that brings us to the concept of Smart Accounts, which make your existing wallets act as breathing and self-executing smart contracts. 

Unlike smart contracts, ERC-4337-powered Smart Accounts come with the following user-specific benefits:

  1. They make your mobile hardware as efficient as a hardware wallet, courtesy of reimagined cryptographic key storage.
  2. Multiple Account Recovery options like a standard google or even a bank account.
  3. Seed phrases, account managing code, and other developer-specific traits go under the hood, making the UX clean and accessible.
  4. The relay system used in this case is decentralized, making them more secure and censorship-resistant. 
  5. This innovation amalgamates every other aspect of Account Abstraction envisioned by other EIPs.

And these are just a handful of benefits that you can associate with smart accounts.

Breaking the tech behind ERC-4337

Unless you are an Ethereum developer, you need not lose a lot of sleep over the technical aspects of EIP-4337 or, rather, ERC-4337. But for those interested, let’s briefly dissect the technology.

Here is a quick diagrammatic representation of the process:

ERC-4337 and the basic layout: Messari
ERC-4337 and the basic layout: Messari

Notice that there are four stages to the conclusion. 

How does it work?

Here is a simple representation.

Stage 1: The user intent for a job is sent out as UserOperation — an entity corresponding to the users or even applications that want to ride the account abstraction bandwagon. 

The UserOperation part is like unconfirmed transactions.

Stage 2: This involves bundling the UserOperation bits into an alternate mempool.

Note: An alternate mempool is like a waiting room for the ERC-4337 powered transactions handled by Bundlers (validators who earn incentives and move the transactions forward towards conclusion). 

User Operations mempool can coexist with the standard mempool. Here is how:

ERC-4337 Mempool and Alternate Mempool can coexist: ETHGlobal
Mempool and Alternate Mempool can coexist: ETHGlobal

Stage 3 is when the bundled transactions are sent across to the EntryPoint contract — a uniform piece of code for the blockchain’s reference. This is where the handleOps function delegates everything to the Entry Point smart contact. This contract eventually interacts with the user’s smart contract wallet in Stage 4.

The Entry Point contract calls a validateUserOp function to recognize and identify the UserOp with the contract wallet. The smart contract account (wallet) should implement the ExecuteUserOp function to ensure that the transaction concludes. 

However, there are two things to notice here:

The “ETH Balance” element associated with the Smart Contract wallet can pay for the ExecuteUserOp fees. Any other ERC-20 token can also work. However, for a sponsored transaction, the PayMaster with ETH Balance helps validate by paying the gas fees.

Here is a simple visualization of the entire flow:

Simple ERC-4337 Flow:Jarrodwatts
Simple ERC-4337 Flow:Jarrodwatts

Also, there can be Signature Aggregators in play if it’s a multi-sign transaction.

A more technical version from Vitalik

Here is a rundown of all the important AA components.

Below is a more detailed representation of the Mempool, per Vitalik Buterin’s blog. Notice that the User Operations, as objects, keep moving in the flow, with bundlers handling everything till the Entry Point handover.

ERC-4337 flow using Mempool illustration: Medium
ERC-4337 flow using Mempool illustration: Medium

And it’s a process in reverse. Bundlers (the willing validators) pay the fees. They are compensated when the userOperation object is handled, validated, and executed by the Entry point or the singleton contract.

Also, the alternate mempool is in sync with Vitalik Buterin’s vision of a “decentralized fee market” for smart contract accounts. 

What does ERC-4337 mean for the users?

Here comes the fun part. ERC-4337 makes it possible for almost everyone with a mobile to try out web3 and crypto. Here are some more specific benefits:

Account recovery and seamless wallet setup

For smart accounts, ERC-4337 is expected to bring in something called “Group-Access” wallets. This means if you lose your seed phrase, you can reach out to previously designated guardian contracts or accounts to help retrieve access. 

Finally, there seems to be something beyond “Not your keys, not your crypto.” And this move would actually mean key abstraction, removing private key dependencies.

Also, if someone tries to set up a wallet post the ERC-4337, they won’t even have to write down the seed phrase to recover the account if needed. 

Bundled transactions

Every transaction with EOAs requires sign-offs. And it can be tedious. With account abstraction, it can be possible to bundle transactions and send them as one to save time and even gas fees. 

Preapproved transactions

Say you are minting multiple NFTs or even playing a game that requires you to use your tokens (say SLP) across sessions. With these smart contract wallets, you can preapprove transactions per the predefined wallet code and session keys. 

Sponsored transactions courtesy of Paymasters

Imagine you are minting something or initiating a demo transaction on behalf of the company. Or you are planning to set up a DApp that would allow users to go gas-free for, say first 30 days. This is possible via Paymasters, courtesy of smart contract wallets. You can simply use sponsored transaction, and the gas fees will be extracted from a different address upon confirmation.

And this brings us to another aspect of account abstraction: gas abstraction. 

Any token gas

If you are paying gas fees using your own smart contract wallet, you can pay using any ERC-20 token with the account abstraction functionality. Plus, third-party services using ERC-4337 to create their onboarding services can make it possible to pay gas in fiat, courtesy of a smart contract enhancement.

This approach will speed up DApp interaction as no native tokens will be needed. 

Subscription-based models

Accounts will become programmable. So, it will be easier to predefine and allow periodic spending as part of the wallet code to subscribe to compatible web3 services. And this will even give web3 membership plans the ability to turn to crypto-only subscription packages. 

Multi-factor authentication and custom coding

First of all, the wallet code that defines your smart account will work seamlessly with your mobile device. So, if you have Face ID on your iPhone, you can set it as a means to authenticate certain transactions or scenarios. You can place similar guardrails for other usage tiers, depending on what kind of code you want to rely on. 

Imagine this: every transaction initiated while the app is open gets preapproved. These types of customized instructions can be set with ERC-4337. 

Custom spending and usage limits

Like with a credit card, users will be able to set usage instructions and alerts by placing limits. For instance, you can instruct your account to notify you whenever any DeFi service you are subscribed to becomes more than 100 USDT per month. 

Automated DeFi and trading access

Moving to DeFi, you can instruct your smart account to push idle funds to a liquidity pool for earning yields. Or, if you plan on trading tokens or NFTs, you can program your smart account wallet to check specific marketplaces and exchanges for low-cost NFTs and coins. Plus, you can even set token tracking metrics and instruct an investment flow.

Here is a sample code that you can deploy if you are an Ethereum developer:

Sample code for AutoInvest
Sample code for AutoInvest

If you check this code, you will notice that it is an Auto Invest program that lets you invest anything in excess of 100 USDT to a yield-generating pool. 

Note: You still need to feed your EOA address and the pool address to execute the code.

And even though a boilerplate like this automates the auto-invest part, there is a problem. In the case of EOAs, you will need to sign off the transaction once you receive the auto-invest prompt. Imagine you are not in front of the device and fail to sign off the transaction, missing out on some additional yield. AA accounts help move past this bottleneck. 

In addition to the mentioned user-friendly offerings, account abstraction even makes way for the following:

  1. Fraud monitoring
  2. Replay attack protection
  3. Setting withdrawal limits (similar to banking)
  4. One-click experiences
  5. Self-custody but with more control

Are there any loopholes associated with ERC-4337?

While there are still a lot of things to learn about ERC-4337, we do know of some loopholes.

Higher costs

Ethereum network costs are still high. Despite the Paymaster-specific gas fee offloading and the option of the sponsored transaction, someone still needs to pay the fee in the end. Unless all the Ethereum Virtual Machine compatible scaling solutions and layer-2s do not start implementing ERC-4337, the cost will be an issue.

Contract verification

Even though contract accounts offer a lot more than EOAs, they do not allow key-based signatures — which is essential for first-time verifications. Even though EIP-1271 allows for signatures via smart contracts, implementation outside of the Ethereum chain can be tedious.

Massive infrastructure needs

Large-scale adoption of AA accounts would require more Bundlers, which is subject to massive infrastructure needs and technical know-how. 

Centralization worries

In case fewer Bundlers join the realm, the ability to move transactions forward will be in the hands of limited entities. This might even cause centralization concerns, albeit initially.

What does that mean for Ethereum and the associated stakeholders?

Overall, ERC-4337 could be a game-changer across verticals. For Ethereum, it might speed up the daily transaction volume and active addresses in time. Plus, with easy onboarding, the gas-fee-specific revenue generation might also start looking up.

DApps, including those focused on DeFi and NFTs, will also benefit, with user wallets able to be in sync with contracts. This means DApp developers will have to do very little. Yet, they can still choose to focus on making more chain-agnostic services, as the smart contract wallets will eventually have the ability to connect and interact across chains.

Builders looking to bring projects to web3 can make good use of ERC-4337 tooling to customize permissioned flows. This will eventually increase adoption. Do note that the Ethereum Foundation offers Wallet Contract APIs and the required SDK for third parties and builders to build using the ERC-4337 standard. 

ERC-4337 implementation API: ETHGlobal
ERC-4337 implementation API: ETHGlobal

Here is how the proposed API works:

Will it be the year of Ethereum with ERC-4337?

The ERC-4337 is huge. It is no surprise that even the Shangai update (involving token unlocking) has been pushed to April. This isn’t the first time account abstraction has been envisioned. But the actual OpenZepplin audited version of the facilitator smart contract, or Entry Point, makes the ERC-4337 an implementation-grade win for the entire ecosystem. Yet, some believe that the timing of this move is an attempt to offset unstaking drama that could soon unfold. 

In simple terms, with ERC-4337, anyone can start trading in NFTs, get crypto newsletter memberships, play web3 games easily, and create new smart account wallets. All without having to become a technical guru. Things are about to get much easier and more fun for the average user and more accessible for the crypto beginner. And yes, it might be wise to keep an eye on ETH prices in 2023!

Frequently asked questions

How are Ethereum transactions validated?

What is an Ethereum request for comment?

What are six of the standard fields of Ethereum transactions?

What is a smart contract in cryptocurrency?

Who confirms Ethereum transactions?

What are EIP and ERC?

Top crypto projects in the US | April 2024

Trusted

Disclaimer

In line with the Trust Project guidelines, the educational content on this website is offered in good faith and for general information purposes only. BeInCrypto prioritizes providing high-quality information, taking the time to research and create informative content for readers. While partners may reward the company with commissions for placements in articles, these commissions do not influence the unbiased, honest, and helpful content creation process. Any action taken by the reader based on this information is strictly at their own risk. Please note that our Terms and Conditions, Privacy Policy, and Disclaimers have been updated.

Ananda.png
Ananda Banerjee
Ananda Banerjee is a technical copy/content writer specializing in web3, crypto, Blockchain, AI, and SaaS — in a career spanning over 12 years. After completing his M.Tech in Telecommunication engineering from RCCIIT, India, Ananda was quick to pair his technical acumen with content creation in a career that saw him contributing to Towardsdatascience, Hackernoon, Dzone, Elephant Journal, Business2Community, and more. At BIC, Ananda currently contributes long-form content discussing trading,...
READ FULL BIO
Sponsored
Sponsored