What is a UserOperation?

1 min read Updated

A UserOperation (UserOp) is the transaction format in ERC-4337 account abstraction — a pseudo-transaction submitted to the alt mempool that encodes the sender, target, calldata, gas parameters, and signature for a smart account operation.

WHY IT MATTERS

Smart accounts can't send regular Ethereum transactions (those require EOA signatures). Instead, they create UserOperations — structured data that describes the intended action. Bundlers collect UserOps, validate them, and submit them to the EntryPoint contract for on-chain execution.

A UserOp includes: sender (smart account address), nonce, callData (what to execute), gas limits, paymaster data (if using gas sponsorship), and signature (validated by the smart account's custom logic). This structure enables features impossible with regular transactions.

For agents, UserOps enable batched operations (swap + transfer in one UserOp), sponsored gas (paymaster field), and custom validation (spending policy checks during the signature verification step).

HOW POLICYLAYER USES THIS

PolicyLayer evaluates UserOperations against spending policies during the validation phase. Before a UserOp is submitted to the bundler, PolicyLayer checks the calldata, amounts, and recipients — rejecting UserOps that violate policies.

FREQUENTLY ASKED QUESTIONS

How is a UserOperation different from a regular transaction?
Regular transactions are signed by EOAs and submitted directly to miners/validators. UserOperations are created by smart accounts, validated by custom logic, bundled by bundlers, and executed through the EntryPoint contract. UserOps support batching, gas sponsorship, and programmable validation.
What is a Bundler?
A bundler collects UserOperations from the alt mempool, validates them, bundles multiple UserOps into a single transaction, and submits it to the blockchain. Bundlers are to UserOps what miners are to regular transactions.
Can you simulate a UserOperation?
Yes. The EntryPoint contract provides a simulateValidation function that tests whether a UserOp will succeed without actually executing it. This is useful for verifying agent transactions before committing.

FURTHER READING

Enforce policies on every tool call

Intercept is the open-source MCP proxy that enforces YAML policies on AI agent tool calls. No code changes needed.

npx -y @policylayer/intercept
github.com/policylayer/intercept →
// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.