Understanding ERC-4337

Prev Next

The Basics

ERC-4337 is a standard that enables smart accounts on Ethereum and similar blockchains. Think of it as the "rulebook" that defines how smart accounts should interact with each other and the blockchain.

It was created because traditional blockchain accounts are simply pairs of public and private keys. ERC-4337 changes this by allowing smart contracts to act as your account. The technical term for this is account abstraction.

The problem it solves

In traditional blockchain systems:

  1. You must pay for transactions with the blockchain's native token (like ETH)

  2. Every transaction requires a cryptographic signature

  3. There's no way to batch operations or set spending limits

  4. Lost keys mean lost funds, permanently

ERC-4337 solves these limitations without changing the underlying blockchain itself.

How does ERC-4337 work?

ERC-4337 introduces four main components that work together:

  1. UserOperation: This is like a "transaction request" but with more flexibility. Instead of a regular transaction, you create a UserOperation that contains what you want to do and how you'll prove it's really you.

  2. EntryPoint Contract: This is a smart contract that acts as the central hub. Think of it as a traffic controller for all smart account activities. It:

    • Receives your UserOperations

    • Verifies you're authorized to do what you're asking

    • Executes the actions you requested

  3. Bundlers: These are specialized services that collect UserOperations from many users and submit them to the EntryPoint. They handle the complex part of getting your operations onto the blockchain.

  4. Paymasters: These optional services can pay for your gas fees, even allowing you to pay in tokens other than the native blockchain currency.

Diagraming showing the components of ERC-4337.

Step-by-step

Here's how it all works together:

  1. You want to make a transaction from your smart account

  2. Your wallet app creates a UserOperation with your request

  3. You sign this operation using whatever method your smart account accepts (password, fingerprint, face ID, etc.)

  4. The operation gets sent to a bundler

  5. The bundler submits it to the EntryPoint contract

  6. The EntryPoint verifies your signature according to your smart account's rules

  7. If everything checks out, the EntryPoint executes your requested action

What’s the relationship of ERC-4337 and EIP-7702?

ERC-4337 and EIP-7702 have similar goals: to improve user experience on blockchains in the Ethereum ecosystem. Often they are used together.

EIP-7702 changes the blockchain itself, allowing existing private keys to delegate control to a smart contract. From a user’s point of view, their private key becomes a smart account.

ERC-4337 defines what a smart account should look like and defines a bunch of infrastructure (like paymasters) to create a great user experience without requiring changes to the blockchain.

How do paymasters work?

Paymasters are ERC-4337 smart contract accounts that can pay gas fees for others. Stackup uses a paymaster to pay for gas, so you don’t have to manage a blockchain’s gas token in your account. Specifically, Stackup uses a type of paymaster called a verifying paymaster.

A diagram showing step-by-step how ERC-4337 paymasters work.

The benefits of ERC-4337

This technical architecture enables practical benefits:

  • Flexible Authentication: Use biometrics, multiple signatures, or other methods beyond private keys

  • Transaction Sponsorship: Someone else can pay your gas fees

  • Batched Transactions: Do multiple things in one operation

  • Account Recovery: Set up social recovery or backup methods

  • Programmable Permissions: Create rules about who can spend what and when

In Simple Terms

ERC-4337 is the technology that lets blockchain wallets work more like the digital services you're already familiar with. It bridges the gap between the security of blockchain and the user experience of modern apps.

With ERC-4337, your wallet can now have all the features you expect from modern financial tools - while maintaining the core benefits of blockchain technology.