7 min read
The piece of the puzzle for mainstream adoption: ERC-4337
Will this Ethereum standard allow for mainstream adoption? In this article, we take a look at the possibilities.
You’ve probably heard the term “Account Abstraction” being thrown a lot — especially since everyone has been talking about how the user interface and user experience (UI/UX) of most dApps as of now are, well, wonky. It’s almost like every single time you want to do anything related to the blockchain, you are solving the world’s greatest mystery.
Well, things might take a turn after this, as account abstraction will soon become a reality. This comes after the announcement of the fact that ERC 4337 is now live on the Ethereum mainnet after their announcement at WalletCon — which came as a surprise since this Ethereum standard is something that people were expecting would take a longer time to come to fruition.
But, what’s the deal with ERC-4337? In this article, we discuss that and more.
We’ll start off with a brief introduction of Ethereum accounts, which is a pre-requisite knowledge to understanding why ERC-4337, followed by your typical day-to-day interaction with Ethereum. Last but not least, we’ll dive into ERC-4337 and its possibilities.
Ethereum has two different accounts; an externally owned account (EOA), and a contract account that is required for your day-to-day transactions on the Ethereum network.
The regular account that you have, such as the ones that you created using Metamask or other wallet providers, are externally owned accounts (EOAs). If you recall creating these accounts, it cost you nothing, and you have a private key, which you need to store and keep safe, and a public key, which is the address that is available to the public, to identify you.
You then would use these EOAs to then sign transactions for your day-to-day interactions, such as buying an NFT (ERC-20), sending tokens (ERC-721), and interacting with smart contracts to do a myriad of things.
On the flip side, we have contract accounts (CAs), which are basically your smart contracts. These accounts don’t have a private key, and if you were to deploy on a smart contract or a contract account on Ethereum, you would have to pay a gas fee to “initiate” these accounts. Also, because these contracts are controlled by the code, no one user can control these accounts.
For example, if you code a smart contract, or a contract account to send a user 1 NFT, if a user provides 0.1 ETH, the contract account is bound to what it does.
Your day-to-day interactions with Ethereum
If you’re an experienced user or degenerate that uses many chains frequently, then transacting using an EOA like Metamask might be a breeze for you.
However, for newer users, the learning curve is a pure nightmare.
Trying to keep your seed phrase safe, while making sure that you don’t accidentally press “approve” which causes all of your funds to be withdrawn from your wallet, and learning about the ridiculous “gas fees” or transaction fees that are required for a simple transaction, to learning about how to bridge your funds from one chain to another… and that’s not all, the list goes on.
Furthermore, EOAs are also limited in terms of capabilities.
Apart from just sending transactions between wallets, or known as EOA to EOA transactions, the only other thing that you can do with EOAs is… well, EOA to Contract Account transactions, or in other words, interact with one smart contract at a time.
It sounds pretty confusing, I know, but let’s shine a light on this by outlining the steps you would take, where you might want to use smart contracts to extend the capabilities of your funds; a case where you want to set aside a maximum purchase of $1,000 USDC a month to buy a particular token through a smart contract that is focused on dollar-cost averaging (DCA).
- Open your MetaMask wallet
- Make sure you have enough funds for both gas and transaction
- Realize that you have enough funds… but it’s $750 USDC and $500 worth of ETH
- Swap $250 ETH to USDC on Uniswap
- Approve contract to allow Uniswap to use your ETH
- Approve contract to swap ETH to USDC
- Wait for transaction to come through
- Go to the DCA contract
- Approve contract to transfer your USDC to DCA contract
- DCA contract does the rest
“But can’t we just do it manually?” — to that I say, yes, you could whip out a calculator and price chart every month to calculate it, but then again, what’s the point of smart contracts?
Essentially, it took you 8 steps by using an EOA account to interact with 2 different contracts, all the while, while making sure that you have enough gas fees to cover it all.
Now, what if… we could combine EOA and Contract Accounts? This would supercharge accounts, and make interacting with the blockchain a more seamless experience, right?
Well, meet the infrastructure that will allow for this to happen, ERC 4337.
ERC-4337, what is it?
In simple terms, ERC-4337 is an implementation that allows for the abstraction of these account functions (account abstraction), without needing to meddle with the core Ethereum codes.
Without going into too much technical details, how ERC-4337 works, and allows the abstraction of account functions, is by creating an alternative mempool, or what we would call waiting room for transactions. Following which, these are the steps that these transactions would go through:
- These transactions would then be bundled up, by nodes on the Ethereum Network, or known as bundlers, who would then bundle up all of these transactions and send it as a “bundled transaction”.
- The “bundled transactions” would be sent to a single smart contract that handles, validates and executes these transactions, known as an “EntryPoint”.
- (Extra Technicality) For those who are wondering about the technical terms, once the bundled transactions have been packaged by the bundler, it is sent to the “EntryPoint” and the bundler will call these functions: “HandleOps”, “ValidateUserOp” and “Execute”.
Apart from just these functions which abstracts away the account functions, one other cool extension with the ERC-4337 implementation, is the addition of paymasters. Paymasters, as the name suggests, are people who can sponsor transaction fees for other users — which opens up a plethora of economical game theories behind incentivisation for application usage, and much more.
How will this work in real day-to-day transactions?
To make understanding why implementing ERC-4337 is going to be an important step for the future of the blockchain space, let’s implement ERC-4337 into our previous example, where a user interacts with a DCA smart contract.
Now, let’s assume that the creators of the DCA smart contract see ERC-4337, and implement it, and you, as a user, want to set aside a maximum purchase of $1,000 USDC a month to buy a particular token. As a user, here are the steps you might take:
- Choose your token to DCA into, and set minimum and maximum price
- Set maximum amount per month
- Let DCA contract do the rest
On the backend, with ERC-4337, the various transactions required, such as the fact that you only have $750 USDC and $500 worth of ETH, and would need to swap it, and more would be bundled up into one transaction, which abstracts away all the clunky functions of the current EOA implementation of a wallet.
At the end of the day, ERC-4337 makes the flow of transactions from a user perspective logical.
What other things are possible with ERC-4337?
ERC-4337 allows for a plethora of use-cases that are much more logical, which provides users a more beautiful and smooth user experience when interacting with the blockchain. It’s definitely not the end-goal of account abstraction, as this change only abstracts away the account functions.
But future applications who leverage on ERC-4337 to build their applications could make:
- Entry points to the blockchain much more logical, without the need for private keys upon wallet creation, as they will be able to do it under the hood.
- Wallets with customizable safeguard rails, such as maximum transaction amounts per week or month, and daily limits.
- Financial applications with the focus on ease-of-use, such as automatic subscriptions and/or tiered permission controls.
- With the first three, would allow for session keys to be viable as it will be secure, for other sectors of the blockchain such as gaming and/or interactions with the metaverse.
So, that’s pretty much all you need to know about ERC-4337! In this post, we’ve outlined a basic understanding of Ethereum accounts, followed by your typical day-to-day interaction with Ethereum and the basics of ERC-4337.
The possibilities are endless with ERC-4337, and we at Flagship are excited to see what developers will make out of this.
Disclaimer: Nothing on this site should be construed as a financial investment recommendation. It’s important to understand that investing is a high-risk activity. Investments expose money to potential loss.