Blockchain Mass Adoption with Account Abstraction ERC 4337 [1]

Khang Vu Tien
5 min readJul 31, 2023

Account Abstraction (ERC 4337) can ease Ethereum blockchain mass-adoption by removing the need for every user to keep a private cryptographic key. Machu Picchu uses it to make easier how a person-in-need, with the help of a field sponsor, can take advantage of the blockchain without even knowing it.

How does ERC-4337 work?

  1. Today, to send a transaction to be registered in the blockchain, transaction must be signed. To do so, the sender must generate and use a private key of 256 bits.
  2. To avoid this complication, we may want to use a service provider who does the signing for us. In compliance with the blockchain protocol, this provider needs to have custody of our coins and tokens, so if this provider goes bankrupt, we lose our money.
  3. Else, to do it ourselves and keep custody of our belongings, we must generate and keep our own private key. Now what happens if we lose our private key? — We lose our cryptos.
  4. ERC-4337 separates “owning coins and tokens” from “signing a transaction”: it defines candidate transactions that need no Ethereum signature. They are sent to a “memory pool” of pending transactions. From there, anonymous “bundlers” verify candidate transactions and sign (“approve”) them with their Ethereum private key. Then it lets the user’s smart contract perform the rest of the logic and send the transaction. Bundlers do it against a small fee. That’s simple, isn’t it? 😜
  5. Cherry over the cake, the users of ERC-4337 can use any independent logic to establish their relationship with their smart contract and are not obliged to use Ethereum signature algorithm. This opens widely the field of applications and protects against losing one’s private key.

You may stop reading here, you know the essentials of ERC-4337. Or continue reading for more details.

What is the pain?

Here is how a human does blockchain transactions before Account Abstraction exists.

  • In Ethereum, you need to pay to register a transaction in the blockchain (a.k.a. to “send” it, to “execute” it).
  • To pay, you need a virtual “coin” called ETH.
  • To keep your ETH, you need one or several virtual “accounts” that maintain the count of ETH in each of them.
  • An account has a secret key of 256 bits (private key to be memorized) that proves account ownership and that is used to pay to send a transaction from an account. The account has also a public address of 160 bits –that is used to receive the outcome of a transaction.
  • To send a transaction from your account, you need an on-line “wallet” that is characterized by a sentence of 12 English words (“seed phrase” to be memorized) and that holds your account.
  • Losing your seed phrase means losing the private keys that are in the wallet, and losing a private key means losing the cryptos that are in stored it.

How would you expect a casual mortal to understand and manage this?

The cryptographic process is so complicated that even experienced blockchain programmers don’t do this every day and rely instead on their development tool to generate test accounts and test ETH for their tests. The laypersons rely on centralized exchanges, like Coinbase, Binance or alike.

The complicated proces to keep custody of blockchain coins

What is the solution?

How does ERC-4337 (Account Abstraction) eliminates this hassle for a layperson to still benefit of the blockchain services? — It defines the following actors (see diagram below):

  • a “user”, a layperson who needs not know anything about blockchain. This person broadcasts desired transactions (“User Operation”) to a virtual decentralized memory pool (“mempool”).
  • a “bundler”, a blockchain-aware person who has a private key. This person picks any transaction in the mempool, validates it against blockchain rules, signs and sends out the transaction if validation is successful. The bundler acts as an anonymous non-trusted blockchain “executor”, acting on behalf of the user and receiving a fee for that service.
  • a smart contract named a “wallet”. It is called by the “bundler” to execute its business logic as agreed with the user, including sending out the blockchain transaction that was previously “signed” by the “bundler”.

Note: The ERC-4337 standard assumes that a “wallet” acts on demand of a single “user”, like a mobile phone representing its owner and only this person. It acts as an avatar of this layperson in the blockchain.

ERC-4337 separates “owning coins“ from “signing a transaction on them“

How does it work?

Simplified sequence diagram of ERC-4337 on-boarding and routine operation

Whenever a layperson is on-boarded to use any blockchain service (a Mobile Phone Provider, an Internet Access Provider, a Financial Service Provider, a blockchain friend or relative etc.) they are assigned an avatar on the blockchain (a smart contract called “wallet”) that handles the identification logic of this service. This part is left free to the applications by ERC-4337.

From there on, all the user needs to do is to post by a request ‘user operation” (for example using a mobile app) and store it on a pool of requests. There any bundler may pick it, validate and sign a blockchain transaction before calling the avatar smart contract specified in the request to send it out. The bundler will receive a fee for the signing work. The blockchain signing complexity is hidden away.

In short, no need any more for a central custodian like Coinbase, Binance etc. ERC-4337 separates the transaction signature from the transaction payment.

Discussion and improvements on this simple scheme

If you are interested to know further about onboarding a layperson and about paymasters, click here: https://medium.com/@kvutien-yes/blockchain-mass-adoption-with-account-abstraction-erc-4337-2-ccd08fca01ee

--

--