/Account Abstraction (ERC-4337)
🔑

Account Abstraction (ERC-4337)

Day 1 · Smart Contracts · 45 min

Core Components:

User → UserOperation (off-chain intent)
→ Bundler (collects UserOps, submits single tx)
→ EntryPoint contract (singleton, validates & executes)
→ Smart Account (executes the actual operation)
→ Paymaster (optional, sponsors gas)

UserOperation: A pseudo-transaction struct that describes what the user wants to do. Contains sender, nonce, callData, gas limits, and signature. Not a real Ethereum tx — it's submitted to a separate mempool.

Bundler: Off-chain actor that collects UserOperations from an alt mempool, validates them locally, bundles multiple UserOps into a single handleOps() transaction, and submits to the EntryPoint. Bundlers earn fees from the gas differential.

EntryPoint Contract: A singleton deployed at a canonical address. Validates each UserOp (signature, nonce, gas prepayment), calls the smart account's validateUserOp(), then executes the operation via the account. Handles gas accounting and fee distribution.

Paymaster: Optional contract that sponsors gas for users. The EntryPoint calls validatePaymasterUserOp() — if it returns success, the paymaster's deposit covers gas instead of the user's account. Enables gasless UX.

Nonce Management: ERC-4337 uses a 2D nonce scheme: a 192-bit key + 64-bit sequence. Different keys allow parallel non-conflicting operations (e.g., key 0 for transfers, key 1 for approvals).

Key Points

  • UserOps are pseudo-transactions submitted to an alt mempool
  • Bundlers aggregate UserOps into a single on-chain tx
  • EntryPoint is the singleton validator and executor
  • Paymasters enable gasless transactions for end users
  • 2D nonce scheme allows parallel non-conflicting operations

Navigate