UserOperation: The transaction object enabling Account Abstraction

Learn about the transaction object that facilitates Account Abstraction and how to locate it on the Blockscout Explorer.

UserOperation: The transaction object enabling Account Abstraction

Account Abstraction is greatly improving user adoption of decentralized applications on Ethereum. By implementing the ERC4337 standard, accounts have become more flexible and programmable, enabling features that prioritize user-friendliness and provide greater control. 

The Account Abstraction implemented with ERC4337 includes several key components that make it functional, one of which is User Operations (UserOps). In this post, you will learn what UserOps are and how to locate them on the Blockscout Explorer.

What is Account Abstraction?

The typical wallet used to interact with Ethereum is an Externally Owned Account (EOA), secured by a private key and a seed phrase. In their basic function, EOAs are straightforward; they store your digital assets and allow interaction with decentralized applications.

However, EOAs have significant limitations. From a security perspective, losing your private key or seed phrase leads to an irreversible loss of access to your funds, as there are no built-in recovery mechanisms. The user experience can be challenging; users must consistently hold the network's native token to cover transaction gas fees, irrespective of the asset they plan to transact with. 

Smart Contract Accounts, conversely, are governed by their underlying code rather than a private key, granting them immense flexibility. They can be programmed to include sophisticated logic, such as complex access controls or recovery mechanisms. However, they cannot initiate transactions independently; they can only execute code or transfer assets when triggered by an incoming transaction originating from an EOA.

Account Abstraction blurs the lines between the simplicity of EOAs and the flexibility of Smart Contract Accounts with smart contract wallets. The core objective of Account Abstraction is to enable user accounts to operate as smart contracts, empowering them with programmable, custom logic while granting them the essential ability to initiate transactions on the network.

How Does Account Abstraction work?

ERC4337 introduces new components to Ethereum without changing core consensus rules, as previous proposals tried to do. In this new infrastructure, users sign "UserOperations" instead of standard transactions using smart contract wallets.

  1. UserOperation -  This is a data structure representing a user's intended transaction. It's packaged specifically for processing within the ERC-4337 flow, residing in an alternative mempool monitored by Bundlers. It contains details that a regular Ethereum transaction would and additional details to account for account abstraction.
  2. Bundlers - This is an off-chain actor (a node/service) that monitors the alternative mempool for UserOperations. Its primary role is to select multiple UserOps, verify their validity, package them into a standard transaction targeting the EntryPoint contract, and pay the L1 gas fee for that bundle transaction.
  3. Entrypoint - This smart contract acts as the central trusted orchestrator for executing bundles of UserOperations submitted by Bundlers. It contains key functions that are called by bundlers.
  4. Paymaster - This optional smart contract enables flexible gas payment policies. It allows third parties (like Dapps) to sponsor gas fees for users or allows users to pay gas fees using ERC-20 tokens instead of ETH
  5. Aggregator - This is an optional smart contract that makes signature checking efficient. For unique signatures (such as BLS) utilized by multiple user requests in a bundle, it permits their simultaneous verification, saving gas compared to individual checks.

UserOps: A Closer Look

According to the EIP proposal, “UserOperation is a structure that describes a transaction intended to be sent on behalf of the user. " While it includes fields that are present in a standard Ethereum transaction, it is not referred to as a transaction to prevent confusion.

A UserOp introduces several new fields, including:

  • initCode - Used to deploy a smart contract wallet on the fly if it doesn't already exist.
  • callData  -  Specifies the actual function call the wallet should execute, similar to the data field in regular transactions.
  • callGasLimit -  Defines the gas allocated for executing that function call.
  • verificationGasLimit - Sets the gas budget for validating the UserOp (e.g., checking the signature or custom logic in the wallet).
  • preVerificationGas -  Accounts for the pre-processing gas cost, including the UserOp size and other overhead.
  • Paymaster - This is an optional field that allows a third party to sponsor the gas fees, while paymasterData carries any extra data the paymaster needs to validate or authorize sponsorship.
  • maxFeePerGas and maxPriorityFeePerGas mirror EIP-1559 fee mechanics, ensuring compatibility with Ethereum's current fee model.
  • Signature - Secures the operation, but unlike standard transactions, this can support custom schemes and wallet-defined validation logic.

To learn more about UserOps and get a detailed description of the ERC4337 standard, check out the official specification.

Find UserOp Transactions on Blockscout.

Blockscout offers a UserOps Indexer designed to index and decode user operations efficiently in accordance with the ERC4337 standard, enhancing the accessibility and understanding of user operations on the Ethereum Blockchain.

To view userOp transactions, click on the Blockchain tab on the explorer.

userOps tab

On the user operations page, you can search for transactions using the search bar by address, transaction hash, or token name.

Click on a specific transaction to see its details.

On the User Operation Details page, you can see some of the components of a UserOp transaction.

Click on the view details button to see more.

From the details, we can see the additional fields in a userOp transaction that are not present in a standard transaction, including the bundler, verification gas limit, and more.

Conclusion

UserOps are extremely important for Account Abstraction because they allow smart contract wallets to function like real user accounts. Instead of sticking with traditional transactions, these customizable UserOps help developers create safer, easier, and more flexible user experiences. This means users can enjoy features like sponsored gas fees, seamless wallet setups, and intuitive validation rules. 

As adoption increases, tools like Blockscout’s UserOps Indexer become critical for debugging, monitoring, and fully utilizing the power of Account Abstraction.