Skip to content
gram.questYour guide to the crypto world

How Ethereum Bundlers Share UserOperations

How can Ethereum support smart contract accounts without changing consensus? The answer is a separate UserOperation mempool where bundlers coordinate and bundle operations into EntryPoint calls.

By 6 min read40

Most Ethereum users still think of a transaction as something signed by a private key and sent directly to the network. ERC-4337 changes that model by introducing a higher-layer object called a UserOperation. Users send these objects into a separate mempool, and bundlers package them into ordinary Ethereum transactions that call a contract named EntryPoint. The result is account abstraction without any consensus-layer protocol change.

What a UserOperation Is

A UserOperation describes an action a smart contract account wants to take. It resembles an Ethereum transaction with fields such as sender, nonce, callData, maxFeePerGas, maxPriorityFeePerGas, and signature. Unlike a standard transaction, its signature is interpreted by the smart contract account implementation rather than by the Ethereum protocol itself.

Users send UserOperations to a dedicated UserOperation mempool. To prevent replay attacks across chains or EntryPoint versions, the signature must depend on chainId and the EntryPoint address. This separation means Ethereum does not need a new bottom-layer transaction type; the protocol continues to process ordinary transactions while the account-abstraction layer operates above it.

How Bundlers Coordinate Through the Mempool

Bundlers are nodes, often block builders, that receive UserOperations from the mempool, validate them, and create a valid EntryPoint.handleOps() transaction. That transaction bundles multiple UserOperations and is added to a block while the operations remain valid. A bundler can act as a block builder itself or work with one through infrastructure such as mev-boost or another proposer-builder separation arrangement.

The canonical UserOperation mempool is a decentralized, permissionless peer-to-peer network. Bundlers exchange UserOperations that are valid and conform to the same shared set of rules applied to the validation code. Because any bundler can participate, users do not need to know the direct network addresses of specific actors, and the design avoids trust assumptions on individual bundlers.

The full specification of the shared validation rules is outside the scope of ERC-4337. This means the proposal defines the mempool concept and its purpose, but it does not mandate a single rule set that every implementation must follow. Interoperability depends on bundlers adopting compatible rules in practice.

Canonical and Alternative Mempools

ERC-4337 distinguishes between two mempool types. The canonical mempool uses the shared validation rules. An alternative UserOperation mempool is any peer-to-peer mempool where validity is determined by rules different from the shared set, applied to the validation code, in any way.

This distinction creates room for experimentation. Different mempools can test alternative fee markets, reputation systems, or validation policies without requiring changes to Ethereum consensus. However, a UserOperation accepted by one mempool is not automatically acceptable to another, and bundlers operating under different rules may not exchange operations freely.

EntryPoint and On-Chain Execution

EntryPoint is a singleton contract that executes bundles of UserOperations. Bundlers should whitelist the supported EntryPoint. Its core function, handleOps, accepts an array of packed UserOperations and a beneficiary address. The beneficiary receives all gas fees collected during execution of the bundle.

Before execution, the smart contract account must validate that the caller is a trusted EntryPoint and verify the signature against the userOpHash. On signature mismatch, the account should return SIG_VALIDATION_FAILED without reverting, allowing gas estimation to proceed. Any other error must revert. The account must also pay the EntryPoint at least the missing account funds needed to cover gas costs.

A packed UserOperation compresses several fields for on-chain use. It combines the factory address and factoryData into initCode, merges verification and call gas limits into accountGasLimits, combines priority and maximum fees into gasFees, and concatenates paymaster fields into paymasterAndData. This encoding keeps the on-chain transaction compact while preserving the information EntryPoint needs.

Nonces, Deposits, and Validity

ERC-4337 replaces Ethereum’s simple sequential nonce with a semi-abstracted mechanism. A single uint256 nonce is treated as a 192-bit key and a 64-bit sequence. For each key, the sequence is validated sequentially and monotonically. A new key can start at any arbitrary value with its sequence beginning at zero.

Bundlers may call getNonce on EntryPoint to determine a valid nonce before accepting a UserOperation. If a bundler accepts multiple operations from the same sender, it should track the key and sequence pairs already in its mempool. Failed nonce validation makes the UserOperation invalid and causes the bundle to revert.

Senders or paymasters deposit Ether, or an L2 native currency, into EntryPoint to pay for future gas costs. The deposit can exceed the minimum required for a single operation, and the sender can withdraw unused funds later using withdrawTo. The account validation function returns validation data containing validAfter and validUntil bounds, which define when the operation can be executed. Timestamps and block numbers cannot be mixed in the same validity range.

Hypothetical Worked Scenario

Assume a user wants to transfer tokens from a smart contract account without holding Ether for gas. The user creates a UserOperation with a paymaster address and sends it to the canonical mempool. A bundler receives the operation, checks that its signature depends on chainId and EntryPoint, calls getNonce to confirm the nonce is valid, and verifies that the paymaster has sufficient deposit.

The bundler combines this operation with others into one handleOps transaction and submits it to Ethereum. EntryPoint executes the bundle, the paymaster covers the gas, and the beneficiary bundler receives the fees. If the paymaster’s validation fails or the nonce is stale, the bundle reverts and the operation is not included.

This scenario assumes the bundler follows the canonical shared rules, the EntryPoint is whitelisted, and the operation remains valid until inclusion. It does not guarantee that any specific bundler will pick up the operation, nor does it describe a live deployment or measured timing.

Limitations and What the Design Does Not Guarantee

Avoiding consensus changes means ERC-4337 relies on off-chain infrastructure and on-chain contracts rather than protocol enforcement. The shared validation rules are unspecified, so bundlers may interpret validity differently. Alternative mempools can operate under incompatible rules, fragmenting the pool of available UserOperations.

Inclusion in a bundler’s mempool is not the same as on-chain execution. A bundled transaction can still fail after reaching a block if conditions change between validation and inclusion. Users must distinguish between a UserOperation accepted by a bundler and a handleOps transaction successfully confirmed on Ethereum.

The design avoids trust assumptions on individual bundlers in principle, but users still depend on at least one bundler being willing and able to include their operation. The proposal does not specify how bundlers are discovered beyond the public P2P mempool, nor does it guarantee fees, speed, or censorship resistance.

Practical Takeaway

ERC-4337 shows that account abstraction can be built as higher-layer infrastructure. Users send structured UserOperations to a mempool, bundlers coordinate through a permissionless P2P network, and EntryPoint executes bundles on-chain without Ethereum consensus changes.

Readers should treat mempool acceptance as a preliminary step, not final settlement. The unspecified shared validation rules mean behavior can vary between bundlers and mempools. Checking whether a handleOps transaction was successfully included and executed remains the only reliable confirmation that a UserOperation took effect.

Source context: Account abstraction.

Discussion

Join the discussion

Your email address will not be published. Required fields are marked *