User Operations
User Operations are the core of account abstraction in ERC4337, substituting for normal transactions. While similar to standard transactions, User Operations have additional properties that enable enhanced functionality.
A User Operation is represented by a struct that contains transaction details and a user's signature authorizing the operation:
sender - The Smart Wallet address
nonce - Unique user operation number to prevent replay attacks
initCode - Any contract deployment bytecode (used if the Smart Wallet hasn’t been deployed yet)
callData - Encoded function parameters
callGasLimit - Max gas for execution
verificationGasLimit - Gas set aside for signature verification
preVerificationGas - Extra gas to provide the verifier
maxFeePerGas - Max price the user will pay for gas
maxPriorityFeePerGas - Max tip user will pay miners
paymasterAndData - Paymaster address and any extra data
signature - User's wallet signature approving this operation
User Operations are submitted to a separate mempool managed by the Entry Point contract. This keeps them isolated until they can be efficiently batched together.
Batched transactions are posted to the main Ethereum mempool for miners to include in blocks. This two-stage structure improves efficiency. Keeping User Operations in a separate mempool minimizes costs before bundling. And batching reduces the overall transaction load on the main network.
In summary, ERC4337 User Operations encapsulate transaction details and user approval off-chain. This enables gas optimizations like batching while preserving permissionless execution through Ethereum. The user experience is thus smoother and cheaper.
Last updated