ERC-4337 Account Abstraction: Explained and Implemented

Home Blockchain & Web3 Development Company Account Abstraction Development ERC-4337 Account Abstraction: Explained and Implemented

ERC-4337 is the standard that brings account abstraction to Ethereum and EVM chains without changing the protocol itself. Users get a smart account instead of a plain key-based account, so the rules for signing, paying gas and recovering access can be programmed: gasless onboarding, batched actions, spending limits, passkeys or social recovery.

How ERC-4337 Works

  1. UserOperation: instead of a normal transaction, the user's app creates a UserOperation describing what the smart account should do, signed with whatever method the account accepts.
  2. Alternative mempool: UserOperations go to a separate mempool, not to the normal transaction pool.
  3. Bundlers collect UserOperations, simulate them, and submit them in one transaction to the EntryPoint contract, paying the gas up front.
  4. EntryPoint: a shared, audited singleton contract that asks each smart account to validate its operation, then executes it and settles the gas.
  5. Paymasters can pay the gas on behalf of the user, or accept payment in a token such as USDC.
  6. Factories deploy the smart account on its first use, so an address can be shown and funded before the account exists on-chain.

What to Watch Out For

  • EntryPoint versions: accounts, bundlers and paymasters must target the same EntryPoint version.
  • Validation rules: validation code may not use certain opcodes or storage, or bundlers will reject the operation.
  • Gas estimation: UserOperations have separate gas fields for verification, execution and pre-verification; wrong estimates mean failed or overpriced operations.
  • EIP-7702: since the Pectra upgrade, existing key-based accounts can delegate to smart account code. It works alongside ERC-4337 rather than replacing it.

How We Implement It

We choose between an existing audited smart account and a custom one, integrate a bundler and paymaster provider or run your own, add session keys or modules where they make the product simpler, and test full flows with Foundry or Hardhat on a fork before going live. The contracts are written in Solidity; front-end integration uses TypeScript SDKs.

Frequently Asked Questions

Does ERC-4337 require a hard fork?

No. It works entirely with smart contracts and off-chain infrastructure, which is why it could be adopted on many EVM chains at once.

Can users keep their existing wallet?

They can use their existing key as the signer of a new smart account, or, with EIP-7702, upgrade their existing address.

Who pays the gas?

Either the user, from the smart account, or a paymaster: your application, or a service that accepts tokens instead of ETH. See gasless transactions.

Who owns the code?

Ownership of the source code is set out in the contract, and the code can be fully yours, including documentation and tests.

Part of our work on account abstraction and smart contract development.

Build With ERC-4337

Tell us what your users should be able to do without managing keys and gas. We will pick the account, bundler and paymaster setup that fits.

Book a free call about account abstraction