UserOperation
The key data structure of account abstraction.
A UserOperation is the key data structure of account abstraction. It represents a new type of transaction that is generated by the user, checked and simulated by the Bundler, and subsequently sent to the EntryPoint contract for validation and execution. The EntryPoint contract verifies the transaction and processes it on-chain through the respective Account contract.
Overview
Similar to a regular transaction UserOperation contains fields such as sender
, nonce
, callData
, and signature
. However, a UserOperation is not stored on-chain. Instead, it represents a user's intent to perform a transaction, which is later converted into an actual blockchain transaction. The UserOperation is sent to a Bundler, which listens for these operations, aggregates them (including signature aggregation when possible), and submits them to the EntryPoint contract for execution.
Unlike a traditional blockchain transaction, the signature in a UserOperation can use custom algorithms, unlocking additional functionalities. For instance, the signature can:
Support threshold signatures for multi-signature wallets.
Incorporate social recovery mechanisms to restore access in case of lost key pairs.
Use alternative cryptographic algorithms for specialized security needs.
UserOperation Fields
The fields of a UserOperation are detailed in the table below:
sender
address
The account making the operation
nonce
uint256
Anti-replay parameter; also used as the salt for first-time account creation
initCode
bytes
The initCode of the account (needed if and only if the account is not yet on-chain and needs to be created)
callData
bytes
The data to pass to the sender
during the main execution call
callGasLimit
uint256
The amount of gas to allocate the main execution call
verificationGasLimit
uint256
The amount of gas to allocate for the verification step
preVerificationGas
uint256
The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata
maxFeePerGas
uint256
Maximum fee per gas (similar to EIP-1559 max_fee_per_gas
)
maxPriorityFeePerGas
uint256
Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas
)
paymasterAndData
bytes
Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster (empty for self-sponsored transaction)
signature
bytes
Data passed into the account along with the nonce during the verification step
More detailed information about UserOperations and its fields can be found here.
Last updated
Was this helpful?