Understand what account abstraction is in 5 minutes

This article is machine translated
Show original
Here is the English translation of the text, with the specified terms preserved and not translated:

Source: Jinse Community

Understand how account abstraction can make cryptocurrencies more secure and user-friendly. It adds security features and eliminates the technical barriers to blockchain adoption.

Introduction

Blockchain technology promises financial innovation, but it is too complex. Users must manage private keys, understand gas fees, and hold ETH to pay fees. Transaction signing is complicated, and a single mistake can lead to permanent loss of funds.

These technical barriers hinder the widespread adoption of cryptocurrencies. Currently, Ethereum has approximately 290 million unique addresses. However, less than one-tenth of the addresses are active. Why is this the case? Is there a solution?

Vitalik calls account abstraction (AA) the "culmination of a 10-year journey." It makes the use of cryptocurrencies as simple as PayPal, but with the decentralized properties of the blockchain. Account abstraction allows users to manage their blockchain accounts through customizable smart contracts, while enhancing security and flexibility. Although the concept of account abstraction applies to most blockchain ecosystems, this article will primarily focus on Ethereum.

To understand its importance, let's first explore the current limitations and the need for change.

Understanding Ethereum Accounts

Ethereum has two types of accounts:

Externally Owned Accounts (EOA)

Most users interact with the main blockchain through Externally Owned Accounts (EOAs). MetaMask, Trust Wallet, and Coinbase Wallet are good examples.

EOAs are accounts composed of a pair of cryptographic keys: a public key and a private key. The public key is used to verify that an EOA transaction is signed by the sender, and the private key is used to sign transactions. Accessing the private key means being able to access and control the account, and therefore the funds and assets associated with that account.

To make a blockchain transaction, users must:

  1. Have enough native tokens to pay the gas fees

  2. Sign the transaction with the private key

  3. Wait for blockchain confirmation

However, EOAs have limited functionality and are prone to losing private keys. Additionally, they cannot batch process transactions, customize security rules, or delegate gas fee payments to others. This is why alternative solutions have emerged.

Smart Contract Accounts (CA)

Smart Contract Accounts, also known as smart contract wallets, are programmable accounts deployed on the blockchain. They act as smart contracts. Popular examples include Safe and Argent.

Smart Contract Accounts execute functions when receiving transactions. Their execution and recovery mechanisms are controlled by the logic of the smart contract code.

These wallets can:

  • Automate staking

  • Schedule payments

  • Set daily spending limits

  • Split funds among a group

  • Require multiple signatures for large transfers

However, smart contract wallets still rely on EOAs to initiate transactions. This means users face the same challenges, but with higher technical complexity. Therefore, despite the progress, there are still several issues.

Limitations of EOAs and CAs

The main problems with the above accounts can be divided into three categories:

  • Complicated key management: For EOAs, losing a private key or seed phrase can mean the complete loss of funds. Once stolen, the account cannot be recovered, and the risk of user error is high.

  • Transaction restrictions: In most cases, users must pay gas fees with native tokens, meaning they must always hold some tokens. Additionally, EOAs do not allow users to batch process multiple transactions, and each interaction with a dApp requires a separate approval transaction.

  • Poor user experience: The technical barriers faced by new users hinder regular use and widespread adoption. Even simple operations require multiple steps, with no clear documentation explaining the process or the meaning of different terms. Users often face interfaces filled with confusing terminology and transaction details without explanation. Limited recovery options make most errors irreversible.

Cyfrin Updraft's course lists the problems that account abstraction aims to solve and clearly identifies the need for a more elegant solution.

What is Account Abstraction?

Ethereum account abstraction is described in Ethereum Improvement Proposal EIP-4337, making smart contracts the primary account type. This enhances security and flexibility, with features like multi-signature approvals and social recovery mechanisms. The result is the ability to create user-friendly accounts with advanced functionalities.

ERC-4337 Account Abstraction

ERC-4337 is an account abstraction proposal that works without changing the Ethereum core protocol. Instead, ERC-4337 creates an additional infrastructure layer centered around a centralized alternative mempool. This layer allows smart contracts to validate, execute, and interact with UserOperations. These special transaction-like objects enable smart contracts to become the primary accounts. Meanwhile, Bundlers handle their collection, aggregation, and submission to the blockchain.

Let's explore the five components of this solution in detail:

  • UserOperation is a structure representing a transaction initiated on behalf of a user. To avoid confusion, it is not called a "transaction." It includes familiar fields such as the sender, target address, data payload, gas fee parameters, signature, and nonce. However, it also introduces additional fields specific to its functionality, as shown below. The use of the signature field is determined by the implementation of each account, not by the protocol. These operations enter an "alt-mempool," separate from regular Ethereum transactions.

UserOperation Fields (Source: ERC-4337)

  • Bundlers are specialized Ethereum nodes. They monitor a separate mempool called the alt-mempool and bundle multiple UserOperations into a single transaction. They then submit it to the blockchain and pay the transaction fees. In return, they earn fees for processing these tasks.

  • EntryPoint is a singleton smart contract that verifies and forwards instructions to smart accounts to execute UserOperations. It checks if each CA has sufficient funds to pay the gas fees. After verification, it executes the transaction and deducts the funds from the user account. It then reimburses the Bundler to pay the gas fees. However, the EntryPoint contract logic also supports Paymasters.

  • Paymaster contracts are responsible for paying the gas fees for the transactions, instead of the initiator. This design allows for flexible payment policy interactions without the need for gas fees. It also supports using ERC-20 tokens for payment and third-party sponsored transactions. Thus, the Paymaster eliminates the requirement for users to hold native blockchain tokens to use the network.

Here is the English translation:
  • The optional Aggregator will combine all user signatures into one. This allows the verification of a set of UserOperations to be performed more efficiently as a whole, rather than verifying them individually. Using an Aggregator helps reduce transaction costs and improve processing speed.

  • How does account abstraction work?

    The following workflow shows how these five components interact:

    1. The user creates a UserOperations object.

    2. Bundlers combine multiple UserOperations into a single transaction and send it to the EntryPoint contract.

    3. The EntryPoint initiates the verification, which is implemented on the CA. It then processes the transaction by calling the `execute()` function implemented on the CA.

    4. The UserOperations are executed, triggering state changes.

    5. Optionally, the Aggregator aggregates the signature verification, and the Paymaster handles the transaction fees.

    Account Abstraction Workflow

    After explaining account abstraction, let's look at why it is so important.

    Key Benefits of Account Abstraction

    Blockchain account abstraction has brought significant improvements in three main areas.

    Stronger Security

    Account abstraction improves security in the following ways:

    Multi-signature support: Users can create rules that require multiple parties to approve a transaction before it is executed. Each signer has different permissions, and the account owner controls spending limits and conditions. This prevents unauthorized spending and protects against hacking.

    Social recovery: Account holders choose trusted individuals (called "guardians") who can collectively approve account recovery if access is lost. For example, 3 out of 5 designated guardians may be required to approve a recovery. Time locks provide additional protection by delaying large transfers, eliminating the risk of permanent loss due to forgotten passwords or lost keys.

    Better key management: Users can access their accounts through hardware keys or biometric authentication. With multi-factor authentication, the account remains secure even if one method is compromised. This enhances security without increasing complexity.

    Improved User Experience

    Web3 account abstraction changes the way users interact with cryptocurrencies in three ways:

    Easier onboarding: New users can start with basic email or social login, and the system handles the complex wallet creation in the background. This makes using cryptocurrencies as simple as any mobile app. No one needs to understand private keys or seed phrases.

    Flexible payments: Users no longer need to hold ETH to pay gas fees, and can use any ERC-20 token to cover gas costs. Applications can sponsor transactions for their users.

    Smart transactions: Users can combine multiple operations into a single batch transaction. One approval covers the entire operation set, and the system finds the optimal gas price. This saves time and money for each interaction.

    Advanced Capabilities

    Account abstraction enables cutting-edge features through two key upgrades:

    Programmable rules: Users can set daily spending limits, schedule future payments, and configure rules for different transaction types. For example, small payments may only require one signature, while large transfers need multiple approvals.

    Automated operations: Smart contract functionality can handle recurring payments and execute complex transactions in precise order without user input. Users can also create their own rules for special cases.

    So, let's see how these theoretical advantages manifest in the real world.

    Account Abstraction Use Cases in the Real World

    Significant areas where account abstraction adds value include:

    • Smart contract wallets: Argent has social recovery, gas abstraction, and other smart features. Safe provides multi-signature support, transaction batching, and advanced controls.

    • Enterprises: Visa is using account abstraction to improve crypto payments on Ethereum. Paymaster contracts cover fees, making transactions free for users, similar to how some debit cards work.

    • Web3 games: Account abstraction eliminates crypto complexity, enabling in-game purchases while managing players' gas costs.

    • Decentralized Finance (DeFi): Platforms use account abstraction to enable one-click trading and batch approvals, while optimizing transaction costs.

    So, how can you learn more?

    Getting Started with Account Abstraction

    Developer Resources

    A good starting point is the EIP-4337 entry on the Ethereum website. It covers the motivation, specification, and rationale for using an alternative mempool for account abstraction. There, you can also find reference implementations and security considerations.

    Next, explore Cyfrin's comprehensive Account Abstraction library on GitHub. It includes a quick-start guide, sample deployments, and FAQs. Additionally, dive deeper into account abstraction through our in-depth course section on Cyfrin Updraft.

    But you might still want to know how to build and deploy programmable account capabilities.

    Implementation Considerations

    There are two main approaches to implementing account abstraction:

    1. Using external bundlers and an entry contract on Ethereum

    2. Integrating account abstraction directly into the chain, as in ZKsync

    As mentioned earlier, on Ethereum, users send operations to a bundler, which then forwards them to an entry contract. The entry contract verifies and executes the transactions. On ZKsync, users directly send transactions to the chain, and the system contracts handle the verification and execution.

    Both approaches allow wallets to define custom rules for approving transactions, such as requiring multiple signatures or using social logins.

    Conclusion

    Account abstraction is changing the way users interact with blockchains. It adds modern financial management features to crypto wallets, allowing users to recover lost accounts, set spending limits, and pay fees with any token.

    Major companies like Visa are using account abstraction today. Games use it to simplify complexity. DeFi applications make transactions easier.

    The tools are available. The standards are in place. Now, developers can build better crypto applications for everyone. Realize the vision of web3 by learning how to incorporate account abstraction into your projects.

    Source
    Disclaimer: The content above is only the author's opinion which does not represent any position of Followin, and is not intended as, and shall not be understood or construed as, investment advice from Followin.
    Like
    Add to Favorites
    1
    Comments