# User Operations

User Operations are the core of account abstraction in ERC4337, substituting for normal transactions. While similar to standard transactions, User Operations have additional properties that enable enhanced functionality.

A User Operation is represented by a struct that contains transaction details and a user's signature authorizing the operation:

* sender - The Smart Wallet address
* nonce - Unique user operation number to prevent replay attacks
* initCode - Any contract deployment bytecode (used if the Smart Wallet hasn’t been deployed yet)
* callData - Encoded function parameters
* callGasLimit - Max gas for execution
* verificationGasLimit - Gas set aside for signature verification
* preVerificationGas - Extra gas to provide the verifier
* maxFeePerGas - Max price the user will pay for gas
* maxPriorityFeePerGas - Max tip user will pay miners
* paymasterAndData - Paymaster address and any extra data
* signature - User's wallet signature approving this operation

User Operations are submitted to a separate mempool managed by the Entry Point contract. This keeps them isolated until they can be efficiently batched together.

Batched transactions are posted to the main Ethereum mempool for miners to include in blocks. This two-stage structure improves efficiency. Keeping User Operations in a separate mempool minimizes costs before bundling. And batching reduces the overall transaction load on the main network.

In summary, ERC4337 User Operations encapsulate transaction details and user approval off-chain. This enables gas optimizations like batching while preserving permissionless execution through Ethereum. The user experience is thus smoother and cheaper.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bastionwallet.io/bastion-sdk/account-abstraction/user-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
