Skip to main content

Account Abstraction (ERC-4337 / ERC-7579)

ERC-4337 replaces externally-owned account (EOA) transactions with UserOperations — signed intents processed by a Bundler and executed through an on-chain EntryPoint contract. This enables smart contract wallets with features impossible with EOAs: batched calls, gas sponsorship, social recovery, session keys, and modular validation logic.

Nethereum provides a complete ERC-4337 stack: client libraries for building and sending UserOperations, an in-process bundler with mempool and reputation, typed contract services that route through AA automatically, and ERC-7579 modular account support.

Architecture

User signs UserOperation
|
v
Bundler (JSON-RPC)
|
v
EntryPoint.handleOps()
|
+--> SmartAccount.validateUserOp()
| |
| +--> (optional) Paymaster.validatePaymasterUserOp()
|
+--> SmartAccount.execute(callData)

The Bundler collects UserOperations from users, validates them, estimates gas, and submits them to the EntryPoint contract in a batch transaction. The EntryPoint verifies each operation's signature via the smart account's validation logic, optionally checks a Paymaster for gas sponsorship, then executes the call.

The Simple Path

Most developers don't need to build UserOperations manually. Nethereum's AAContractHandler lets you switch any existing typed contract service to route through Account Abstraction automatically:

using Nethereum.AccountAbstraction;

// Any existing contract service — ERC-20, ERC-721, or your own
var erc20Service = web3.Eth.ERC20.GetContractService(tokenAddress);

// One line: switch to AA. All future calls become UserOperations.
erc20Service.ChangeContractHandlerToAA(
accountAddress, privateKey, bundlerUrl, entryPointAddress);

// Use the service exactly as before — AA is transparent
var receipt = await erc20Service.TransferRequestAndWaitForReceiptAsync(
new TransferFunction { To = recipient, Value = amount });

Gas estimation, nonce management, signing, and bundler submission are all handled automatically.

Key Concepts

ConceptDescription
UserOperationA signed intent describing what a smart account should execute. Replaces traditional transactions.
Smart AccountA contract wallet that validates and executes UserOperations. Supports custom validation logic.
BundlerAn off-chain service that collects UserOperations and submits them to the EntryPoint.
EntryPointThe singleton on-chain contract that coordinates validation and execution of UserOperations.
PaymasterAn optional contract that sponsors gas for UserOperations, enabling gasless transactions.
FactoryA contract that deploys new smart accounts via CREATE2 for deterministic addresses.

EntryPoint Versions

VersionAddressNotes
V060x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789Original ERC-4337
V070x0000000071727De22E5E9d8BAf0edAc6f37da032Packed UserOperations
V080x4337084d9e255ff0702461cf8895ce9e3b5ff108
V090x433709009B8330FDa32311DF1C2AFA402eD8D009Latest

Use EntryPointAddresses.Latest (currently V09) unless you need a specific version.

Packages

PackageDescription
Nethereum.AccountAbstractionUserOperation creation, AAContractHandler, SmartAccountBuilder, ERC-7579 modules, gas estimation
Nethereum.AccountAbstraction.BundlerFull bundler with mempool, validation, reputation, and automatic bundling
Nethereum.AccountAbstraction.Bundler.RpcServerJSON-RPC server handlers for exposing bundler as an HTTP endpoint
Nethereum.AccountAbstraction.SimpleAccountSimpleAccount factory for deploying ERC-4337 compatible accounts

Guides

Getting Started

GuideWhat You'll Learn
Send a UserOperationBuild, sign, and submit your first ERC-4337 UserOperation step by step
Smart Contracts with AARoute existing typed contract services through AA with ChangeContractHandlerToAA — the simplest approach
Account DeploymentDeploy smart accounts with SmartAccountBuilder, predict addresses with CREATE2, manage EntryPoint deposits

Advanced

GuideWhat You'll Learn
Batching & PaymastersExecute multiple calls in one UserOperation and sponsor gas with paymasters
Modular Accounts (ERC-7579)Install validators (multisig, social recovery), executors, and session keys as plug-and-play modules
Run a BundlerSet up an in-process or standalone bundler with mempool, validation, and RPC server