ERC-4337¶
Overview and breakdown of the core Account Abstraction standard using the alt mempool approach.¶
ERC-4337 is the foundational standard for Account Abstraction (AA) on Ethereum. It enables programmable, secure, and flexible smart walletsβwithout requiring any changes to the Ethereum consensus layer.
π What Does It Enable?¶
- Programmable smart wallets with custom auth (e.g., multisig, passkeys)
- Gas abstraction using ERC-20 tokens or Paymasters
- Account deployment on first use via
initCode
- Bundled operations for better UX and gas efficiency
- Signature flexibility, enabling recovery, guardians, and more
π§± Key Components¶
π§Ύ UserOperation
¶
A new object type representing user intent. Think of it as a structured meta-transaction.
interface UserOperation {
sender: address;
nonce: uint256;
initCode: bytes;
callData: bytes;
callGasLimit: uint256;
verificationGasLimit: uint256;
preVerificationGas: uint256;
maxFeePerGas: uint256;
maxPriorityFeePerGas: uint256;
paymasterAndData: bytes;
signature: bytes;
}
This structure is propagated through a separate UserOp mempool, not the legacy Ethereum transaction pool.
π¦ EntryPoint Contract¶
The singleton router that:
- Calls
validateUserOp()
on the sender account - If present, calls
validatePaymasterUserOp()
on the Paymaster - Executes the
callData
if validation succeeds - Holds deposits for accounts, and deposits + stakes for paymasters
Smart accounts must explicitly trust a specific EntryPoint contract. During validation, wallets check msg.sender == EntryPoint
to ensure the operation is invoked through the correct entrypoint.
π¦ Bundlers¶
Nodes that:
- Monitor the UserOp mempool
- Select and simulate valid
UserOperation
s - Submit bundles as part of blocks they build onchain
Bundlers assume the gas cost risk and are reimbursed by user accounts or Paymasters. They may apply local policies or reputation scoring (e.g., ERC-7562).
π° Paymasters¶
Optional contracts that:
- Sponsor gas for accounts under programmable conditions
- Must stake and deposit ETH into the EntryPoint
- Can enforce rules off-chain or on-chain (e.g., API-based validation)
If validatePaymasterUserOp()
succeeds, the Paymaster covers execution costs. If the operation fails, the Paymaster still pays the network fees.
π Validation Flow¶
- User sends
UserOperation
to a bundler - Bundler simulates validation using EntryPointβs
simulateValidation()
- Checks signature, nonce, balance/stake, and paymaster logic
- If valid, the bundler includes it in a bundle
- Bundle is sent via
handleOps()
, andUserOperation
s are executed atomically
π Security & DoS Protections¶
- EntryPoint reverts with
FailedOp
if validation or execution fails - Bundlers must pre-simulate using
debug_traceCall
to avoid gas loss - ERC-7562 defines additional validation rules (e.g., no storage writes in
validateUserOp
) - Only staked entities can access shared state during validation
π Integration with Other Standards¶
- EIP-7702 β Temporary delegation of EOAs to smart logic
- ERC-6900 / 7579 β Modular account plugin standards
- ERC-6492 β Signature validation for undeployed wallets
- RIP-7560 β Native transaction type proposal for protocol-layer AA
π Related Topics¶
π Further Reading¶
π€ Example Use Cases¶
- Gasless onboarding with verifying Paymasters
- Multisig wallets using passkeys and guardian recovery
- Games batching actions and sponsoring players
- DAOs managing on-chain workflows and access control
β Summary¶
ERC-4337 is the backbone of smart wallet infrastructure on Ethereum. It introduces a new validation-execution flow via EntryPoint and enables bundlers, Paymasters, and flexible signaturesβwithout requiring changes to Ethereumβs base protocol or compromising on decentralization or censorship resistance.