Compiled By: Coinlive
Author: 白泽研究院
NFTs and Web3 have been making waves, but the process of buying and storing them still needs to be simplified for newcomers to crypto.
I remember my first time trading on Uniswap, I had no idea what I was doing. Creating a crypto wallet and connecting it to a DeFi protocol was a nightmare.
Currently, the only way users can interact with blockchain-specific smart contracts is by using their EOA (Externally Owned Account). From sending funds to a DeFi liquidity pool to transferring NFTs to a marketplace to sell to other accounts, each action still requires a separate transaction signature.
While many of us crypto veterans have accepted this process, what about beginners? When most people have experienced the convenience of traditional banking, they won't enjoy creating and using EOAs.
These are still challenges for getting new users into the Web3 space.
This is where ERC-4337 comes in.
This article will delve into ERC-4337, its features, and its impact on the crypto industry and Web3.
What is an Ethereum account?
There are two different types of "accounts" in Ethereum:
You can think of a contract account (CA) as code (smart contract) on the blockchain and an externally owned account (EOA) as a person (although a person can have multiple EOAs).
Your MetaMask wallet is an EOA. EOAs consist of a pair of cryptographic keys: a public key that controls account activity and a private key that is kept secret.
However, contract accounts do not have private keys. They are smart contracts controlled by their code logic, not by users. Smart contracts are capable of doing anything you can code, while EOAs can essentially only sign transactions.
The key point is that the code defines what a contract account does, while users control what an EOA does.
What is an Ethereum transaction?
Every time you want to write information to the blockchain, such as transferring tokens or minting NFTs, you need to make a transaction. Transactions require an EOA signature and the EOA also needs to pay gas fees associated with the transaction.
Transactions are initiated by EOAs and can be sent to:
Another EOA, for example, an EOA transfers ETH to another EOA.
A CA, for example, to mint an NFT.
Web3 Today: EOAs + Poor User Experience
Performing actions on the blockchain is typically slow and tedious. Every time you want to write new information to the blockchain, you need to sign a transaction from your EOA to do so.
Because you are familiar with this process, it has become a standard experience.
However, for new users, it can be a nightmare.
The following diagram shows how a new user performs their first action on a decentralized application (dApp) using a new EOA:
These steps are cruel for any new user, whether they understand the technology of blockchain or not.
But the problems faced by new users go beyond this.
EOA poses a great risk
You may have friends who have lost access to their EOAs due to accidental leaks or loss of private keys.
Even the crypto industry has a saying: "Not your keys, Not your crypto". This means that if someone else (e.g., a hacker) has your private key, they can control your funds. This has been proven countless times in the past.
This is the cruel reality: private keys are easily lost and cannot be retrieved.
EOA has limited capabilities
As we mentioned earlier, EOAs have very limited capabilities.
In an EOA, you typically perform the following two typical operations:
Submit transactions to transfer tokens to another EOA
Submit transactions to execute some functionality on a contract account
EOA will never be widely adopted
In the real world, losing your bank card does not mean game over.
There are rules that allow you to transfer funds to a new account, set payment limits, freeze your bank card, and only allow the transfer of funds under certain conditions.
However, in Web3, if you make a mistake, your entire account is compromised and cannot be recovered.
So, compared to centralized currency storage, EOAs are even worse.
So, is there a solution?
Account Abstraction
Account abstraction is a proposal that allows users to use Contract Accounts (CA).
But why? What can CAs do that EOAs cannot?
CAs are much more flexible in functionality than EOAs. (Because smart contracts can define different rules and configurations in their code)
Here are some example use cases:
These are just some of the functionalities that CA can provide that are superior to EOA. The key is that the contract account is code. This means that you can write anything in code and implement it in a CA.
Translation: History of Account Abstraction
It sounds great, but why didn't we do it right away? Before answering this question, let's quickly review the history of proposals for account abstraction in the Ethereum ecosystem since 2016. Every technical upgrade proposed for the Ethereum ecosystem begins with an EIP (Ethereum Improvement Proposal).
In 2016: EIP-86 proposed allowing users to create "account contracts" that execute any required signature/randomness checks, instead of using the current mechanism hardcoded into transaction processing.
In 2020: EIP-2938 proposed creating a new transaction standard with the type AA_TX_TYPE. This type of transaction is called an "AA transaction."
In 2020: EIP-3074 proposed allowing users to delegate control of their EOA to a smart contract. This allows any EOA to act as a wallet without deploying a contract.
None of these proposals have been implemented in Ethereum, and they are all currently classified as "stalled." This means that they have been in a suspended state for six months or more.
One reason why these proposals have not been implemented is that they require changes to the consensus layer protocol of the Ethereum network. (The "consensus layer" can be understood simply as the backend of the Ethereum system.)
In 2021, EIP-4337 was proposed: to implement account abstraction in Ethereum without changing the consensus layer!
On March 1, 2023, at WalletCon in Denver, Ethereum Foundation developers announced that the core contract of ERC-4337 had passed the OpenZeppelin audit and all tests. The audited contract has been successfully deployed on the Ethereum mainnet and several testnets and can operate on various EVM-compatible chains, including Polygon, Optimism, Arbitrum, BNB Smart Chain, Avalanche, and Gnosis Chain.
What are EIP and ERC-4337?
Once an EIP (Ethereum Improvement Proposal) is accepted, authorized, and confirmed by on-chain governance, it becomes an ERC (Ethereum Request for Comment, primarily dealing with protocols and development standards).
Therefore, EIP-4337 came first, and then ERC-4337 followed.
ERC-4337 aims to upgrade user EOA to "smart accounts" (similar to CA), enabling accounts to run as smart contracts. This means that every cryptocurrency wallet can have customizable authorization logic to meet the needs of individual users or applications. Some use cases for account abstraction can be achieved, such as recovering lost private keys, protecting wallets without mnemonics, executing automatic payments, and gasless transactions.
ERC-4337 adds a new UserOperation memory pool, which is intended to fully replace the current transaction memory pool and enable account abstraction. Users send UserOperation objects to Ethereum nodes instead of transactions, and they pack a set of these objects into a transaction included in the Ethereum chain. This packed transaction is called an "entry point" smart contract, which processes UserOperation objects and deploys a smart contract wallet for them.
One of the most obvious benefits of ERC-4337 is that it can make it easier for ordinary users outside the crypto industry to access Ethereum, solving some key problems that users currently face from creating wallets to using them, and making wallets simpler and more user-friendly.
This is also the understanding of the term "abstraction." You can understand it as ideation, as Ethereum plans to bring new ideas to users' accounts through ERC-4337. Or, you can understand it as separation, allowing users to break free from the traditional way of handling user accounts, like MetaMask's over-reliance on mnemonic phrases, personal transaction signatures, and private keys.
The Characteristics of ERC-4337
In simple terms, one of the main features of smart accounts based on ERC-4337 is the introduction of a "social recovery mechanism." If you lose your mnemonic phrase, you can contact a previously designated "guardian" contract or account to help regain access. You can also enable 2FA (two-factor authentication) and biometric technology to protect your wallet, potentially eliminating the need for a mnemonic phrase.
In addition, you can set up automatic payments and time-based spending limits within the wallet to more effectively manage your funds.
Finally, ERC-4337 allows decentralized applications (dApps) to sponsor gas fees, making transactions cheaper and easier for users.
Let's take a closer look:
Smart Accounts: Smart accounts, also known as account abstractions, are becoming an important theme in the cryptocurrency industry. Visa has even developed a smart account-based automatic cryptocurrency bill payment system. With the implementation of ERC-4337, smart accounts can offer more advanced functionality and use cases.
Lost Private Key Recovery: ERC-4337 enables a "social recovery mechanism" where if you lose your private key, you can contact a previously designated user to help recover access to your account. This solves one of the biggest risks in the cryptocurrency industry - losing the private key to your wallet.
Secure Wallet without Mnemonic Phrases: With this upgrade, users can use 2FA and biometric technology to protect their accounts, making them more secure and user-friendly.
Automated Trading: ERC-4337 allows for automated trading, including monthly spending limits, AI trading, and adjusting staking positions. These features make it easier for users to trade.
Gasless Transactions: ERC-4337 supports gasless transactions, which allows dApps such as DeFi, blockchain games, and DAOs to sponsor gas fees for users, making transactions cheaper for them. This feature also allows users to pay gas fees with dApp tokens, which can significantly reduce the cost of using dApps.
Batch Transactions: Every transaction requires a signature. By abstracting accounts, transactions can be batched, sending multiple transactions as one to save time and even gas fees. Similar to a shopping cart, it can complete a transaction package even when faced with ten markets.
Pre-Approved Transactions: Suppose you are minting multiple NFTs or playing a game. With a smart account, you can pre-approve transactions based on pre-set custom wallet codes and session keys.
Advantages and Disadvantages of ERC-4337
Currently, ERC-4337 has several potential benefits and drawbacks.
Advantages:
Enhanced security, added functionality, and improved user experience.
Introduces built-in access control, permissions, and a more flexible token supply model, making it more secure than existing token standards.
The flexible token supply model enables developers to create tokens with variable supplies, which is useful for dApps and their tokens that require more dynamic supply.
The built-in access control and permissions in ERC-4337 make it easier for users to understand how to use their tokens and control their interactions with dApps, leading to a more seamless and user-friendly experience.
Disadvantages:
One of the most significant disadvantages is that it has not yet been widely adopted by the Ethereum community. Therefore, developers may hesitate to use it until it gains more attention and support.
Another drawback of ERC-4337 is its limited compatibility with other token standards. This means that developers may need to make significant changes to their existing dApps to implement it, which could be both time-consuming and costly.
Additionally, the new features in ERC-4337 may increase the complexity of dApp development, which could present a greater challenge for developers who are unfamiliar with the new standard.
ERC-4337 has the potential to increase the functionality and security of dApps on the Ethereum network. However, its success depends on whether the Ethereum community is willing to adopt it and whether developers are willing to invest the necessary time and resources to implement it in their dApps.
Summary
I believe that ERC-4337 is a solution to the long-standing usability issues in the crypto industry and Web3. While there are already amazing projects with incredible use cases, the use of wallets remains a significant issue for new users.
The usability and immediacy introduced by ERC-4337 will change the game. By merging crypto wallets with smart contracts, making transactions more secure and efficient, and ultimately making the Web3 experience more user-friendly. It is a catalyst for making Web3 a "normal" way of life that can rival internet users, and platforms like Coinbase's L2 Base are already using ERC-4337.
While the future of ERC-4337 is uncertain, its launch has sparked optimism within the crypto community. As cryptocurrency and Web3 continue to evolve, ERC-4337 may pave the way for further progress and innovation.