> For the complete documentation index, see [llms.txt](https://docs.bastionwallet.io/bastion-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bastionwallet.io/bastion-sdk/account-abstraction/user-operations.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
