As is well known, Web3 wallets are crucial for blockchain users, but currently, the user experience of most wallets is not very good, which is one of the biggest obstacles to their widespread adoption. New users must be familiar with the following operations to interact on the blockchain: creating a wallet, securely storing private keys, purchasing and transferring funds, paying gas fees, and performing tedious operations on various DApps. Therefore, reducing the entry barriers for new users and improving the user experience are prerequisites for the widespread adoption of cryptocurrencies.
ERC-4337 is a new "Account Abstraction (AA)" standard that can unlock the functionality of smart contract wallets on the Ethereum blockchain and EVM-compatible networks. ERC-4337 is one of the most crucial upgrades to the way Web3 wallets work, and it can create a smooth user experience through smart accounts for users.
This article will introduce what AA smart contract accounts (account abstraction) are, how they work, why ERC-4337 is an important upgrade for the user experience of Web3 wallets, and how to implement "smart accounts" in Web3 applications.
Introduction to AA Smart Contract Accounts
AA smart contract accounts (account abstraction) combine the advantages of the current contract accounts and externally owned accounts (EOA) into one, making the account itself "programmable." While ensuring that assets are held only by smart contracts, it can have more custom and extended functions such as batch transactions, gas subsidies, private key recovery, and more. It simplifies the process of on-chain interactions and can automate gas subsidies.
Account abstraction (ERC-4337) will be an Ethereum update that allows users to create non-custodial wallets as programmable smart contracts. It can unlock many possibilities, such as wallet recovery, anonymous transactions, and team wallets, making the Web3 experience more secure, convenient, and flexible. AA smart contract wallets (account abstraction) are also known as "smart accounts," "smart wallets," and "account abstraction wallets."
Ethereum Account Types
Ethereum accounts are unique digital addresses on the Ethereum blockchain that store ETH and can initiate and execute transactions. Ethereum accounts can be divided into two types: externally owned accounts (EOA) and contract accounts.
Externally Owned Accounts (EOA):
EOAs are wallets owned by users and operated manually from outside the blockchain ecosystem. They are managed using public and private key pairs, and as long as the private key is possessed, the assets stored in the EOA can be accessed. The most crucial part of EOAs is the mnemonic phrase, which is a set of 12 random words generated when setting up the wallet (usually 12, sometimes a different number).
EOAs use the mnemonic phrase to generate the private key, which is then used to sign transactions. Therefore, the account owner must store the mnemonic phrase offline to protect against hacking and theft. If the user loses the private key, the mnemonic phrase is the only way to recover the private key and retrieve the assets.
Most popular cryptocurrency wallets are EOAs, such as Coinbase Wallet and Metamask. EOAs are a crucial part of the Ethereum ecosystem, but they are limited in functionality and flexibility, usually only able to perform two actions: transfer tokens to other EOAs or initiate transactions that trigger another smart contract.
These design limitations pose several challenges:
1. Weak Security: The security of EOAs is directly related to the mnemonic phrase. If a user loses the private key and mnemonic phrase, they may lose all their assets. Additionally, there are no social recovery options. Furthermore, users cannot implement security settings such as spending limits or two-factor authentication.
2. Lack of Customization: Transactions initiated by EOAs cannot be customized or automated. Users must manually sign each transaction.
3. Gas Payments: Users must have ETH to pay for transactions, but new users often do not have ETH.
Therefore, despite playing an important role in the Web3 journey, EOAs provide a poor user experience, especially for most new users, and are not an ideal way for widespread adoption of blockchain. Attracting a large number of new users requires a simpler user interface, better security, and greater flexibility.
Contract Accounts:
Contract accounts use smart contracts as cryptocurrency wallets. Various logic can be encoded into smart contracts to customize transactions and add additional functionality to the contract account. However, contract accounts do not have private keys or mnemonic phrases and cannot initiate transactions actively. When transactions from EOAs trigger smart contract code, they can only execute a specific operation. This means that users need to maintain an EOA with an ETH balance to operate contract accounts. This makes operating contract accounts more inconvenient than operating independent EOAs, but account abstraction can change that.
Working Principle of Account Abstraction
The most important innovation of account abstraction and ERC-4337 is not based on contract wallets, but the ability to abstract (separate) individual EOAs or contract accounts. Account abstraction can create standalone smart contract accounts that can execute transactions without the need for EOAs. Any custom operation defined in the form of smart contract code can be implemented in smart accounts.
The operation of smart accounts is simple; it does not require sending regular transactions like EOAs, but uses "User Operation" to represent user operations. The user operation object has multiple data elements that describe the transaction type, token, gas prices for each step of the transaction, verification of the transaction's signature, and other data.
Based on "account abstraction," when a user operation is sent, the transaction first enters a general waiting area called the "mempool." Then, these requests are bundled together by a bundler, similar to how regular transactions are verified, using the same logic as the validating nodes to determine the transactions that can extract the maximum value. The bundled user operations are sent through a single whitelist entry, where each individual user operation is verified and executed by calling different functions.
In simple terms, this is not actually a wallet, but a smart contract. However, you can use it as a wallet, so it's called an "abstract" account. The benefit of this approach is that it can implement some new and better user experience features. So, what are these features?
Features of Ethereum Smart Accounts
Since user operations can contain any type of logic, it allows users to implement various custom operations on how to manage their accounts and funds. Here are 5 use cases of account abstraction:
1. Wallet Recovery
Unlike EOAs, the security of smart accounts does not depend on mnemonic phrases or private keys. Smart account owners can set up multiple devices, individuals, or third-party services as wallet guardians. If the account owner loses the account credentials, a guardian can sign a transaction to allocate new credentials to access the smart account. This process does not compromise the account owner's control or ownership of the assets.
2. Batch Transactions
Exchanging one token for another in a DEX requires two separate transactions. First, the user needs to sign an approval for the DApp to use the token they want to exchange. Then, they need to sign a transaction to execute the exchange. More complex Web3 transactions may require three or more signature approvals. Smart accounts can consolidate multiple transactions and approve all transactions at once, making DeFi transactions as simple as traditional financial transactions.
3. Shared Accounts and Team Wallets
EOA account owners can control full access to the EOA with a mnemonic phrase. If they want to share permissions with others, they can only give full access or keep all permissions themselves, with no middle ground. Account abstraction allows account owners to share different levels of wallet permissions with multiple users. For example, an account owner can create a multi-signature wallet that requires two or more users to sign a transaction for it to be executed. Additionally, they can add users who can only spend a limited amount of funds for a specific wallet within a specific time frame.
4. Automated Transactions
When using EOAs, users must manually initiate or sign transactions on DApps. This process cannot be automated for trusted transactions. In smart accounts, users can define a series of parameters, such as accessing specific tokens, spending limits, duration, gas limits, specific operations based on preset trigger conditions, and more.
5. Using Tokens as Fee Tokens
With abstract accounts, even if your account does not have ETH, when necessary, third-party service providers support other tokens, such as USDT, you can use USDT as a fee token to complete account operations.
In summary, the features of AA smart accounts include multi-factor authentication and account recovery; consolidating interactions that previously required multiple steps (such as exchanging tokens in a DEX) into a single action; removing the dependency on the main chain coin for gas, allowing the use of any token, including stablecoins, to pay for gas, and enabling third-party gas subsidies; and more possibilities, as the wallet of the smart account itself is a contract, with the same security as non-custodial wallets, and can implement more custom functions.
Challenges and Prospects of AA Smart Accounts
Currently, ERC-4337 still faces compatibility issues, as not all DApps can verify the validity of contract account signatures. However, this issue will be resolved after the implementation of EIP-1217. Additionally, due to the high cost of using the Ethereum blockchain, AA smart accounts also face gas cost issues. In the short term, it is foreseeable that ERC-4337 will be more widely adopted in L2.
Overall, AA smart accounts bring various new possibilities to Web3 applications and wallets. With smart accounts, users can not only manage wallets more easily but also optimize the flexibility of wallet operations. Smart accounts will be the future of Web3 interactions, setting new standards for the possibilities of Web3.
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。