What is Account Abstraction

Core Architecture

This quickstart guide helps developers understand Account Abstraction (ERC-4337) by explaining its main components and how to use them to build applications.

Introduction

This page provides an easy-to-understand summary of ERC-4337, highlighting the main components and how they can be combined to create your own applications.

Key Components

The core components, as shown in the image below, are Users, Bundlers, EntryPoint Contracts, and Accounts.

Architecture

Users start actions on Ethereum, like sending tokens or using smart contracts.

UserMemepool is where user actions (UserOps) are collected and stored until they are processed.

Bundlers take multiple user actions from the mempool, combine them into one transaction, and send it to be processed.

Entry Point Contracts check and execute the bundled transactions.

Account can do more complex things like multi-signature approvals or sponsored transactions.

Additional Components

a. Paymasters handle the gas fees needed to process transactions. They can pay these fees for users, so users don't always need to have Ether for gas.

b. Aggregator check and combine signatures for user actions, making the process more efficient and reducing the load on the network.

User Operations

User operations are crucial in our framework, used to execute actions via smart contracts. Here are the main components involved in a UserOperation:

FieldTypeDescription
userAddressaddressThe address of the smart account sending the JiffyOperation.
operationNonceuint256Prevents replay attacks by ensuring each operation is unique.
deployCodebytesCode to deploy the userAddress if it hasn't been deployed on-chain yet.
executionDatabytesData sent to the userAddress for executing the operation.
executionGasLimituint256Maximum gas allowed for executing the operation.
validationGasLimituint256Maximum gas allowed for validating the operation.
initialGasFeeuint256Gas fee to compensate bundlers for submitting the JiffyOperation.
maximumFeePerGasuint256Similar to EIP-1559 maxFeePerGas, capping the gas fee per unit.
maximumPriorityFeePerGasuint256Similar to EIP-1559 maxPriorityFeePerGas, adding a priority fee for faster processing.
feeManagerDatabytesContains the FeeManager contract address and any additional required data.
operationSignaturebytesSignature to validate the JiffyOperation during the verification phase.
preExecutionConditionsbytesConditions that must be met before executing the operation.
postExecutionChecksbytesChecks performed after execution to ensure the operation was successful.
retryCountuint256Number of times the operation can be retried in case of failure.
callbackAddressaddressAddress to call back upon completion or failure of the operation.
metadatastringAdditional metadata or notes related to the operation.
timestampuint256Timestamp indicating when the operation was created.

How we are simplifying UserOps

We use three steps to confirm a transaction is successful:

  • Validation: Checks that the operation is valid by verifying signatures, nonce, and other conditions
  • Execution: Performs the specified action using the provided gas limits and data.
  • Post-Execution: Confirms the operation was successful and manages any follow-up actions or checks.

Bundlers

Bundlers collect multiple User Operations and combine them into a single transaction. This process reduces network congestion and improves efficiency. Here's how they work:

  • Collection: The Bundler gathers User Operations waiting in the mempool.
  • Aggregation: It combines these operations into a single, more efficient transaction.
  • Submission: The bundled transaction is sent to the blockchain network for execution.

EntryPoint Contracts

The Entry Point is a singleton smart contract that receives transactions from Bundlers, verifies, and executes UserOperations.

  • Verification Process: The Entry Point contract allows the smart contract account to define its own verification and authentication methods. During verification, the Entry Point checks if the wallet has enough funds to cover the maximum possible gas usage based on the gas fields in the UserOperation. If the wallet lacks sufficient funds, the Entry Point contract rejects the transaction.
  • Execution Process: During execution, the Entry Point contract performs the user operation by calling the account using the calldata specified in the UserOperation. It also transfers funds from the Smart Contract Account to reimburse the Bundler with the appropriate amount of ETH to cover the gas costs.

Paymasters

The Paymaster is an ERC-4337 defined smart contract that manages gas payment policies. These policies offer flexibility in how gas is paid (e.g., in different currencies) and by whom, eliminating the need for users to hold native blockchain tokens to interact with the blockchain.

Key Features of Paymasters:

  • Flexible Currency Options: Users can pay for gas fees using any ERC20 token, such as USD Coin (USDC) or Tether (USDT), instead of the native blockchain tokens like ETH on Ethereum or MATIC on Polygon.
  • Sponsoring Gas Fees: Application developers can sponsor gas fees for their users, enhancing the user experience by removing the need for users to worry about gas costs.
  • Stablecoin Payments: Paymasters enable gas payments in stablecoins, providing a more stable and predictable cost structure.
  • ERC-20 Token Payments: Gas fees can be paid with other ERC-20 tokens, offering greater flexibility and convenience for users.

Aggregator

An Aggregator is a smart contract that implements a signature scheme supporting aggregation. This means it can combine multiple signatures into one, making the verification process more efficient.

How Aggregators Work:

  • Signature Aggregation: If multiple messages are signed with different keys, the Aggregator can generate a single combined signature. This combined signature verifies all the individual signatures.
  • Calldata Cost Savings: By combining multiple signatures into one, Aggregators help save on calldata costs. This means multiple bundled UserOperations can be validated in a single step, reducing the overall transaction cost.

Key Benefits of Aggregators

  • Efficiency: Aggregators make the verification process faster by handling multiple signatures at once.
  • Cost-Effective: By reducing the amount of calldata needed, Aggregators lower the costs associated with processing transactions.
  • Simplified Validation: Aggregators ensure that all constituent signatures are valid with a single combined signature, streamlining the validation process.

On this page