Skip to content

Latest commit

 

History

History
21 lines (12 loc) · 3.26 KB

useroperation.md

File metadata and controls

21 lines (12 loc) · 3.26 KB
description
The key data structure of account abstraction.

UserOperation

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
senderaddressThe account making the operation
nonceuint256Anti-replay parameter; also used as the salt for first-time account creation
initCodebytesThe initCode of the account (needed if and only if the account is not yet on-chain and needs to be created)
callDatabytesThe data to pass to the sender during the main execution call
callGasLimituint256The amount of gas to allocate the main execution call
verificationGasLimituint256The amount of gas to allocate for the verification step
preVerificationGasuint256The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata
maxFeePerGasuint256Maximum fee per gas (similar to EIP-1559 max_fee_per_gas)
maxPriorityFeePerGasuint256Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas)
paymasterAndDatabytesAddress of paymaster sponsoring the transaction, followed by extra data to send to the paymaster (empty for self-sponsored transaction)
signaturebytesData passed into the account along with the nonce during the verification step

More detailed information about UserOperations and its fields can be found here.