Gate Square “Creator Certification Incentive Program” — Recruiting Outstanding Creators!
Join now, share quality content, and compete for over $10,000 in monthly rewards.
How to Apply:
1️⃣ Open the App → Tap [Square] at the bottom → Click your [avatar] in the top right.
2️⃣ Tap [Get Certified], submit your application, and wait for approval.
Apply Now: https://www.gate.com/questionnaire/7159
Token rewards, exclusive Gate merch, and traffic exposure await you!
Details: https://www.gate.com/announcements/article/47889
How does understanding account abstraction ERC4337 lead to the evolution of Ethereum accounts?
Author: Rui
As many have said, account abstraction (AA) technology, especially ERC-4337, promises to revolutionize the user experience of self-custody Wallet and allow it to scale for mass adoption. However, as May 2023 draws closer, we must recognize that the standard is still in its early stages, with both opportunities and risks.
Please note that the content of this article may quickly become outdated as upgrades evolve rapidly, and this article is based solely on my personal opinion.
TL; DR
ERC4337:
The AA standard is still in its early stages, but many innovation builders are working to develop it further. With the support of the ecosystem and the popularity of large products such as MetaMask, we can expect AA to accelerate its development process and produce exciting results.
L2:
The adoption of AA varies in L2 solutions. Larger L2s (e.g. Optimism and Arbitrum) do not natively support AA, while ZKSync and Starknet do.
Bundler Service:
Paymaster Service:
AA Wallet and SDK:
Learn about crypto Wallet
Classification
There are two types of accounts on the Ethereum network: Externally Owned Account (EOA) Wallet, such as MetaMask, and Contract Account (CA), such as Safe.
The main difference between an EOA Wallet and a Contract Wallet is how it is controlled. EOA Wallets are controlled by individual users through Private Keys, while Contract Wallets are controlled by Smart Contracts. While EOA Wallets are simpler and are used to manage personal Crypto Assets holdings, contract Wallets can have more complex rules and can be used for specific purposes.
FromBitcoin Insider
Pain points
EOA Wallet users need to pay attention to protecting Private Keys. Any mistakes or omissions made on the Private Key can result in the loss of funds, so the use of EOA Wallet is more expensive and risky. Even experienced Crypto Assets users can lose control of their accounts due to a single mistake or careless move. The complexity of the operation, the inability to skip the gas fee or make gas fee payment, and the limited functionality of the Wallet are all problems that plague users.
Smart ContractWallet provides a solution to some of these problems, but Ethereum currently requires all operations to be packaged in transactions from ECDSA-protected EOAs. This incurs additional transaction fees and an additional 21,000 gas fees, and with it potential centralization risks and complications: users need to manage two accounts and deposit ETH in separate EOAs to pay for gas fees, or rely on a centralized relay system to pay.
These pain points gave birth to a new AA standard, ERC-4337.
ERC4337 proposals:
CA’s problem
Nowadays, these things can all be solved with contract Wallet, but Ethereum itself requires everything to be packaged in transactions derived from ECDSA-protected EOA, which will result:
Additional Transaction Fee: Each user action must be initiated by EOA, resulting in an additional 21,000 gas fee. Complexity and centralization: Users need to deposit ETH in separate EOAs to pay gas fees and manage balances in both accounts, or rely on Relay systems to pay, Relay which are often centralized.
Over the years, there have been several attempts to implement account abstraction on Ethereum-based Blockchain such as EIP-86 and EIP-2938. However, none of these approaches work, as they all require changes to the Consensus layer, which is difficult to implement.
4337 mechanism
ERC-4337 implements account abstraction by introducing a higher-level pseudo-transaction object called UserOperation, which is similar to rollups in terms of bundling concepts. Fortunately, this standard allows us to build account abstractions without changing the Consensus layer.
The modular design of EIP 4337 divides the Smart ContractWallet account abstraction into multiple ports:
Bundler :
Entry Point:
Token that need to deposit Smart ContractWallet pay gas fees to the Bundler: When the Bundler triggers a handleOp using EOA, a gas fee is incurred. Smart ContractWallet can pay the gas fee with their own balance, or ask Pymaster to pay it. Possible Failure: The gas fee is insufficient, the validation step fails, and even if the gas fee is sufficient, the UserOperation execution step may fail, such as a runtime error. Regardless of whether the execution is successful or not, the entry point contract will pay a gas fee to the Bundler to trigger the handleOp function. The entry point contract provides Smart ContractWallet with the ability to add or withdraw Token as a Collateral.
Smart Wallet:
Smart ContractWallet main contract separates the validation and execution steps of the UserOperation. By decoupling it, the Bundler can validate the UserOperation off-chain, filtering out malicious transactions without having to pay gas fees.
The validation steps are defined in the validateOp function: the first call to validateOp, the Bundler simulates off-chain validation, verifies the signature in the UserOperation, and ensures that the Smart ContractWallet has sufficient gas balance, and the second call to validateOp is the entry point contract, which performs on-chain verification before executing the UserOperation.
Paymaster :
Wallet Factory :
Signature aggregators:
Advantages of AA
Gas Abstraction:
The gas abstraction contains no gas fee transactions and pays gas fees with any ERC20 Token. The logic can be executed in the Paymaster contract or through a relay. For AA, many Smart ContractWallet themselves can implement EIP 4337-compliant Paymaster contracts and stake Token on the entry point contract to help users pay gas fees.
Social Recovery:
In the event that the Private Key is lost or compromised, the user can authorize the new Secret Key as the legitimate Wallet owner. The logic of social login and social recovery is generally defined in the main contract of the Wallet. It can be done in a variety of ways, such as email, Multisig, MPC, or SWIE (login with Ethereum).
Transaction Batch:
Transaction batching is a feature unique to Smart ContractWallet that allows Wallet users to execute multiple transactions in a single on-chain transaction.
Cross-Chain Interaction and Connection Bridge Integration:
Currently, many wallets are working with third-party vendors to integrate Fiat Currency deposit and withdrawal channels and Cross-Chain Interaction bridges into wallets. These deposit and withdrawal channels and cross-chain interaction bridges can be further integrated with the payment contract (Paymaster) in the gas abstraction.
Modular Design:
Perhaps one of AA’s biggest strengths is its modular service, where Bundler, Paymaster, and other parts can be flexibly combined.
Defects in AA
From stackup
Relatively high processing fee:
Using ERC-4337 to make a simple transfer is much more expensive than using a traditional Wallet (often referred to as EOA) because the former requires a call to the contract.
However, on the Rollup network, a simple transfer using ERC-4337 may be cheaper than EOA because it aggregates signatures together to reduce the amount of data on Mainnet.
Criteria not yet finalized:
Challenges such as increased Attack Vector due to expanded transaction scalability, the potential for unknown bugs or security risks when migrating to new standards, the need for a robust and secure global entry point contract to ensure that all transactions are properly signed and verified, and so on.
Layer 2
Optimism: ❌
Optimism version 1 has three OVM Operation Code to achieve Smart ContractWallet account abstraction. However, for consistency and security reasons, version 2 removes these Operation Codes, and there is no official statement about supporting account abstraction.
Arbitrum: ❌
While there are currently some Smart ContractWallet built on top of Arbitrum, there is no official statement about supporting account abstraction.
Starknet: ✅
Starknet only has Smart Contract accounts with verification and execution functions, and all accounts must implement these features to verify signatures and ensure gas fees. Starknet prohibits the verification function from calling the external contract state to prevent unexecuted transactions. However, there are some differences between Starknet and Ethereum, such as the lack of UserOperations, a transaction fee abstraction protocol similar to Paymaster, and the need for an account with a Token balance to create new contracts. Also, Starknet’s sequencer can’t charge gas fees if a verified transaction fails, while Ethereum can.
zkSync: ✅
zkSync does not distinguish between EOA and contract accounts. Its account model is similar to EIP 4337 and includes separate validateTransactiom and uteTransaction functions. The Paymaster interface also includes the validateAndPayForPaymasterTransaction and postOp functions. However, there are some differences, such as the ability to call deployed external contracts and external storage during the validation process. Paymaster can also invoke external storage during transaction validation.
AA Infrastructure:
Currently, some excellent projects such as Stackup, Etherspot, Candide, Infinistism, and Pimlico are trying to build infrastructure.
Bundler Service:
Builder:
Some Consensus:
Public Service
The Open Source nature of the vast majority of Bundlers makes them non-exclusive and non-competitive. Any RPC endpoint can run Bundler by copying Open Source code.
Even if the RPC endpoint running Bundler charges service usage fees through API secret keys, Bundler services are more difficult to monetize than other infrastructures such as Paymaster, a payment contract, because Paymaster can easily earn the difference in fees by partnering with third-party deposit and withdrawal providers or Decentralized Finance protocol aggregator providers.
Critical Infrastructure
Validating and executing UserOperations requires as many Bundlers as possible for better Decentralization. Since the only third-party Bundler service providers currently are Stackup and eth-infinitism, we do need more such Bundler service providers.
*Mechanism
Bundlers deliver messages and propagate user actions on their own, similar to shared memory pools, without having to agree on specific matters. Bundler has an important feature for filtering spam, and for its own financial reasons, Bundler wants to monitor as much as possible to ensure the safety of the mempool.
Differences between Bundler services:
Paymaster service
AA Wallet and SDK:
Product Evaluation
Business