Skip to main content
A user operation can carry one call or many. Batching packs several calls into one operation that the smart account executes atomically. Parallelism uses 2D nonces to submit independent operations concurrently so a slow one doesn’t block the others. These are two independent patterns, applicable on their own or together. The examples below use the smartAccount and bundlerClient returned by Create a modular wallet.

Batch calls in a single user operation

Pass multiple calls to sendUserOperation. The user signs once and the smart account executes the entire array atomically. A common pattern is to bundle an ERC-20 approve with the call that spends the allowance, so the user never has a granted-but-unused approval sitting onchain.

Run independent operations in parallel

Externally owned accounts process transactions sequentially because each one consumes the next integer nonce. Smart accounts use 2D nonces, a nonceKey plus a nonce value. Operations with different nonceKey values are independent and can land in any order, so a slow operation doesn’t block a fast one. Use parallel execution when:
  • The user operations don’t depend on each other’s state.
  • You want to submit multiple operations without waiting for each receipt.
  • The operations are safe to land in any order.
For sequential dependencies (for example, swap A to B then swap B to C), keep the default linear nonce by omitting nonceKey or passing 0.
To submit operations in parallel, sign each with a distinct nonceKey greater than 0, then send them concurrently. Don’t await each receipt before sending the next, or you lose the benefit.