docs
Understanding ERC-4337
UserOperation

UserOperation

All components of ERC-4337 revolve around a pseudo-transaction object called a UserOperation which is used to execute actions through a smart contract account. This isn't to be mistaken for a regular transaction type.

FieldTypeDescription
senderaddressThe address of the smart contract account
nonceuint256Anti-replay protection; also used as the salt for first-time account creation
initCodebytesCode used to deploy the account if not yet on-chain
callDatabytesData that's passed to the sender for execution
callGasLimituint256Gas limit for execution phase
verificationGasLimituint256Gas limit for verification phase
preVerificationGasuint256Gas to compensate the bundler
maxFeePerGasuint256Maximum fee per gas (similar to EIP-1559 (opens in a new tab) max_fee_per_gas)
maxPriorityFeePerGasuint256Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas)
paymasterAndDatabytesPaymaster Contract address and any extra data required for verification and execution (empty for self-sponsored transaction)
signaturebytesUsed to validate a UserOperation along with the nonce during verification

UserOperation mempool

Instead of going to the traditional public mempool that hosts pending transactions for EOAs, UserOperations will instead be sent to the UserOperation mempool: a dedicated, higher-level mempool specifically for UserOperations.

Bundlers listen to the UserOperation mempool and bundle multiple UserOperations together into a "classic" transaction. They first verify the validity of the UserOperations using the relevant EntryPoint methods. The bundler then includes that multi-UserOperation transaction in the next block they propose to the network. To clarify, that transaction isn't sent to the regular mempool. Bundlers are either block builders themselves, or work together with block builders.


logo
logologologo

© 2023 Ethereum Foundation. All Rights Reserved.