ERC4337 flow - Explain Like I'm Five (ELI5)!
There's been a lot of buzz around account abstraction. Account Abstraction is a big deal for solving for web3 UX, and brings standardisation to smart contract wallets & how they interact with the blockchain. ERC4337 is the name of this Ethereum standard.
This post will try to explain the ERC4337 transaction flow that's super easy to understand for all audiences. We will look into four key parts of a ERC4337 flow:
- User Operations
- Mempool
- Bundlers
- Paymasters
There are lots of technical wizardly that's going on behind all this, for which we recommend our more detailed deep dive - Decoding EntryPoint and UserOperation with ERC-4337 Part 1 & Part 2. This part is more 101 basics.
ERC4337 explained with a restaurant analogy
Here's a simple analogy to understand the account abstraction (ERC4337) transaction flow
UserOperations
When a user interacts on-chain from their smart account, their intention of what they wish to do is captured in the UserOps. In a way it’s like a waiter in a restaurant taking your order & noting it down.
Mempool
All these UserOps from all the different users get pooled together in the ‘UserOperation Mempool’. Staying with the restaurant analogy, it’s that dashboard screen which shows all the live orders.
Bundler
Now, let’s come to Bundler transactions. A bundler bundles multiple userOps from the mempool & sends it for execution.Imagine two different tables ordered Alfredo Pasta. Most likely, the chef will bundle the order and cook two portions together.
Paymasters
A paymaster transaction is when a 3rd party (dApp or wallet) pays the gas on behalf of the user. Sticking with restaurant analogy, let’s say you asked them to deliver your order. And they offer ‘free delivery’.The restaurant acts like a paymaster and pays the delivery boy. They don’t charge you that fee.
So that’s the simple 101 summary:
- The user intent gets captured in a UserOp.
- Multiple UserOps get bundled into a bundle transaction.
- Some Bundle tx where gas is sponsored by 3rd party goes via Paymaster.
Read more
Now that you have a basic understanding of what's what, it's time to deep dive into a more technical piece - Decoding EntryPoint and UserOperation with ERC-4337 Part 1 & Part 2.