Skip to main content

ERC-4337 Account Abstraction

Design better experiences for your users, such as instant non-custodial wallets, gas-free airdrop claims for users, easy account recovery.

Smart Wallets/Contact Accounts: Allows users to use smart contract wallets containing arbitrary verification logic instead of EOAs (Externally Owned Accounts) as their primary account.

Related EIPs:

Benefits

Smart Contract Wallets (SCWs): Enable people to use SCWs as their primary accounts, improving user experience.

  • Gas Payment Flexibility: Users can pay gas fees with any ERC20 token, not just the native blockchain tokens like ETH or MATIC.
  • Developer Opportunities: Developers can sponsor gas fees for their users and enable gas payments in stablecoins or other ERC-20 tokens.
  • Innovation: ERC-4337 is built upon previous Ethereum Improvement Proposals (EIPs), combining various ideas for a more efficient and flexible transaction process.

Problems

EOAs are limited in terms of features and flexibility. They can only perform two actions:

  1. Transfer tokens to other EOAs
  2. Initiate transactions that trigger another smart contract transaction.

Creating the the following limitations

  1. Poor security: An EOA's entire security is linked to one seed phrase. If you lose your private key and seed phrase, you may lose all your assets. And there are no social recovery options. Besides, you can’t set spend limits, 2FAs, etc. for security.
  2. Lack of customization: Transactions from EOAs cannot be customized or automated. Owners must manually sign every transaction.
  3. Gas payment: EOA owners must own ETH at all times to pay gas for transactions. They can not use any other token.
  4. Poor overall UX: All of the above make for a poor user experience which is not suited for most new users.

Functionality

ERC-4337: Allows users to use smart contract wallets with arbitrary verification logic as their primary accounts.

Instead of sending regular transactions as EOAs do, contract accounts use objects called UserOperations, which perform operations on behalf of the user.

Operational Flow: UserOperations are bundled and sent to the entry point contract, then executed on behalf of user's Smart Contract Wallets.

Every time a smart account sends a UserOperation, it goes into the common waiting area for all UserOperations called the alt mempool.

These requests are then bundled by bundlers, who are similar to nodes verifying regular transactions. They even use the same logic as mining or validator nodes to prioritize transactions where they can extract the most value.

Authentication: In UserOperations, authentication is programmable, unlike traditional transactions where authentication is done via a single unchangeable private key.

tip

UserOperations can include any type of logic

Engineering

User Operation: A pseudo-transaction object representing a user's transaction intent, allowing multiple instructions and additional data to execute smart contract calls.

  • Bundler: Monitors an alternative mempool specifically built for user operations, bundling multiple user operations into a single transaction.
  • Entry Point: A singleton smart contract that receives transactions from Bundlers, then verifies and executes UserOperations.
  • Paymaster: Handles the implementation of gas payment policies, allowing flexibility in how and by whom gas is paid.
  • Aggregator: Implements a signature scheme that supports aggregation, helping save on calldata costs.

Use Cases

What use cases can account abstraction unlock?

Adoption

Not as good as hoped for...

Automated Decisions

When using an EOA, you have to manually initiate or sign every transaction on a dapp. There’s no way to automate this process for transactions that you trust.

Developers can define a range of parameters such as

  • access to specific tokens
  • spend limits
  • duration
  • gas limit

To define specific actions based on pre-defined triggers

Wallet Recovery

Unlike EOAs, a smart account's security does not rely on a seed phrase or private key.

A smart account owner can assign multiple devices, people, or third-party services as wallet guardians. In case they lose their credentials, the guardians can sign a transaction to assign new credentials to access the smart account.

This does not compromise the user's control or ownership of the assets.

Batch Transactions

Making a simple swap from one token to another on a decentralized exchange requires two separate transactions. Firstly, the user needs to sign with their private keys to approve the dapp to use the token they want to swap. Then, they need to sign the transaction to execute the swap.

There are other more complex web3 transactions that need three or more approvals from the signer.

Shared Accounts

Account abstraction lets you share different levels of access to your wallet with multiple users.

So, say, you can create a multi-signature where two or more users must sign a transaction to execute it. Further, you may add users that can only pay limited amounts to a specific set of wallets within specific durations.

Define Custom Security Policies

  • daily spend limits

Cost free onboarding.

Gas Payment Flexibility

Use any token to pay for gas.

FAQ