UserOperation

The key data structure of account abstraction.

Overview

A UserOperation is the key data structure of account abstraction. It represents a new type of transaction that is generated by the user and processed by the EntryPoint contract and verified by the Account contract.

Similar to a regular transaction it contains a sender, nonce, callData and a signature among other fields. It's important to note that a UserOperation is not stored on chain. A UserOperation represents the intention of a User to perform a transaction, from this intention an actual transaction is derived. A UserOperation is sent to a Bundler who listens for UserOperations, bundles them, using signature aggregation if possible, and passes them to the EntryPoint for execution.

Unlike an VeChain transaction, the signature in a UserOperation can be arbitrary thus unlocking more functionality than a traditional transaction. For example a signature can use a different algorithm, it can incorporate threshold signatures for multi-signature functionality or can even incorporate social recovery mechanisms allowing the user to recover their account if their main key-pair is lost or stolen.

UserOperation Fields

A table describing each UserOperation field can be found below.

FieldTypeDescription

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