Skip to main content

Smart wallet user operations

Estimate, send, replace, and track ERC-4337 user operations for a smart wallet through the Platform API or the bundler JSON-RPC endpoint.

A user operation is a signed ERC-4337 instruction for a smart wallet. Most integrations never call these endpoints because standard Platform API writes build and bundle user operations automatically (see User operations). Use these routes when your client constructs and signs user operations itself, letting DALP's bundler submit and pay for bundles from the organisation's bundler wallet.

Two interfaces reach the same bundler: REST under /api/v2/bundler/{chainId} and ERC-4337 JSON-RPC at /bundler/{chainId} (where {chainId} is the decimal chain ID). Reads are scoped to your organisation and {chainId}, returning null for operations outside that scope.

Read the EntryPoint

Read the shared ERC-4337 EntryPoint contract for {chainId} before building or signing an operation:

curl "$DALP_API_URL/api/v2/bundler/$CHAIN_ID/supported-entry-points" \
  -H "X-Api-Key: $DALP_API_KEY"
["0x2222222222222222222222222222222222222222"]

send accepts only the returned EntryPoint address. Gas estimation and paymaster routes also accept the network's configured Directory contract address and reject all others.

Estimate gas before signing

POST /api/v2/bundler/{chainId}/estimate simulates the unsigned operation and returns gas limits to embed before signing:

curl -X POST "$DALP_API_URL/api/v2/bundler/$CHAIN_ID/estimate" \
  -H "X-Api-Key: $DALP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "entryPoint": "0x2222222222222222222222222222222222222222",
    "userOperation": {
      "sender": "0x1111111111111111111111111111111111111111",
      "nonce": "0x0",
      "callData": "0x{encodedCall}"
    }
  }'
{
  "preVerificationGas": "0x1d4c0",
  "verificationGasLimit": "0x30d40",
  "callGasLimit": "0x186a0"
}

Sponsored operations also return paymasterVerificationGasLimit and paymasterPostOpGasLimit. On a network that charges state creation as state gas, such as Sepolia, paymasterPostOpGasLimit includes 97,920 gas for the storage slot the paymaster writes the first time it sponsors an organisation. Calls exceeding one transaction's gas limit on the network are refused.

Sign at least the returned preVerificationGas, using a stub signature of the exact final signature length during estimation because longer signatures raise preVerificationGas. Pricing counts the signature, paymaster data, and fixed-width nonce, gas, and fee fields at the non-zero byte rate, so later fee or gas-limit changes do not alter the required preVerificationGas. On a chain that charges state creation as state gas, the price also includes the gas of every storage slot, account and byte of contract code the operation creates, measured against the chain's current state. The first use of a nonce key writes a new storage slot, so a nonce key that has not been used adds the gas of one slot (97,920) to the price, and nonce changes can move the price.

Quantity fields accept decimal strings, hex quantities, or non-negative integers. The upper 192 bits of nonce form the nonce key and the lower 64 bits form the sequence number.

Sign the operation

Compute and sign the ERC-4337 EIP-712 hash of the packed operation under domain name ERC4337, version 1, the network's chainId, and the EntryPoint address, using the signature format expected by the smart wallet's validator. See Smart Wallet.

Send a signed operation

POST /api/v2/bundler/{chainId}/send requires callGasLimit, verificationGasLimit, preVerificationGas, maxFeePerGas, maxPriorityFeePerGas, and signature, and returns the user operation hash before bundling:

curl -X POST "$DALP_API_URL/api/v2/bundler/$CHAIN_ID/send" \
  -H "X-Api-Key: $DALP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "entryPoint": "0x2222222222222222222222222222222222222222",
    "userOperation": {
      "sender": "0x1111111111111111111111111111111111111111",
      "nonce": "0x0",
      "callData": "0x{encodedCall}",
      "callGasLimit": "0x186a0",
      "verificationGasLimit": "0x30d40",
      "preVerificationGas": "0x1d4c0",
      "maxFeePerGas": "0x3b9aca00",
      "maxPriorityFeePerGas": "0x5f5e100",
      "signature": "0x4f2a..."
    }
  }'
"0x8c1f0b7a3e5d4c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b"

Admission checks

Before storing an operation (and before sponsoring on paymaster routes), DALP rejects ERC-7579 execute calls using the delegatecall call type (0xff) at the top level or inside self-calls (ERC7579UnsupportedCallType, DALP-9056 on chain). It then runs six checks:

  1. Priority fee: Must meet the deployment minimum (skipped on zero-fee networks).
  2. maxFeePerGas floor: Must reach 1.5 * latestBaseFee + maxPriorityFeePerGas (zero base fee on networks without base fees). Zero-fee operations on zero-fee networks skip checks 2 to 4 while the latest block has no base fee, but are refused if the block charges a base fee.
  3. preVerificationGas price: Must reach 21,000 plus the larger of standard calldata gas (85,800 plus 4/16 gas per zero/non-zero byte and 10 gas per 32-byte word) or the network's calldata floor (EIP-7623 10/40 gas on Prague, EIP-7976 64 gas per byte on Amsterdam) over the encoded operation plus 132 handleOps wrapper bytes. On Amsterdam it also adds the operation's state creation gas (EIP-8037): 97,920 gas per new storage slot, 183,600 per new account and 1,530 per byte of deployed contract code, measured against current chain state at estimate and again at send.
  4. Encoded size: At most 8,192 bytes ABI-encoded by default (ERC-7562) on networks charging a calldata floor.
  5. Validation simulation: Simulated with the operation's paymaster fields. Must succeed and remain valid (validUntil) for at least 60 seconds.
  6. Prefund: Payer funds (sender balance + EntryPoint deposit for self-paid, or paymaster EntryPoint deposit for sponsored) must cover this operation plus all in-flight operations from the same payer, otherwise AA21 (sender) or AA31 (paymaster). Skipped on zero-gas networks or zero-prefund operations.

Rate limits and sender penalties

Two throttles return 429 BUNDLER_ADMISSION_THROTTLED (DALP-14439) or JSON-RPC -32504 (both safe to retry later):

limit
When
Retry
sender-penalty
A bundle reverted on chain due to this sender's account validation (AA21, AA23, AA24), reused nonce (AA25), or external paymaster (AA31, AA33, AA34). Fails the sender's other waiting operations without penalising other senders or platform-paymaster reverts.
After retryAfterSeconds (24 hours by default).
pending-operations
Organisation reached its pending operation cap on {chainId} (256 by default). Replacements are exempt.
Once pending operations are bundled.

Re-checks at bundle time and idempotency

At bundle build time, the bundler re-runs fee and preVerificationGas checks against the current block. Operations below the maxFeePerGas floor stay PENDING (blocking later nonces on the same nonce key) and become FAILED (PRE_FLIGHT_REJECTED) if still underpriced one hour after last storage. Operations with insufficient preVerificationGas (the carry price at that block plus the state creation gas measured when the operation was sent), maxFeePerGas below maxPriorityFeePerGas, or zero fees on a base-fee chain fail immediately as PRE_FLIGHT_REJECTED.

Resending the exact signed operation returns the same hash without duplicating storage. While PENDING, a resend re-submits it to the bundler. Resending does not revive a FAILED operation: sign and send a new one.

Replace a pending operation

Send a new signed operation from the same sender and nonce with both maxFeePerGas and maxPriorityFeePerGas raised by at least 10% (floor(original * 1.1)). The replacement swaps out the stored operation (the old hash then reads null) and ignores the replaced operation's prefund during balance checks.

Case
JSON-RPC message
Original already in a bundle
A UserOperation for this sender and nonce is already included in a bundle, so it can no longer be replaced
Fee below 1.1x original
A replacement UserOperation must raise both maxFeePerGas and maxPriorityFeePerGas by at least 10%
Original not submitted via these routes, or BLOCKED
A UserOperation is already pending for this sender and nonce and cannot be replaced

Read the status

curl "$DALP_API_URL/api/v2/bundler/$CHAIN_ID/user-operations/$USER_OPERATION_HASH" \
  -H "X-Api-Key: $DALP_API_KEY"
{
  "id": "0192f6c0-7b4d-7f2a-9c6e-3f1a2b3c4d5e",
  "userOpHash": "0x8c1f0b7a3e5d4c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b",
  "sender": "0x1111111111111111111111111111111111111111",
  "nonce": "0x0",
  "nonceKey": "0x0",
  "callData": "0x{encodedCall}",
  "status": "BUNDLED",
  "createdAt": 1794000000000,
  "updatedAt": 1794000004000,
  "idempotencyKey": "0192f6c0-7b4d-7f2a-9c6e-3f1a2b3c4d5e",
  "transactionHash": "0x3a9e7c1d5b2f4a6e8c0d2b4f6a8e0c2d4b6f8a0e2c4d6b8f0a2e4c6d8b0f2a4e"
}

transactionHash, blockNumber (JSON number here, hex quantity in the receipt), and error appear once recorded.

Status
Meaning
PENDING
Stored and waiting for a bundle.
BLOCKED
Waiting on approval or funds.
BUNDLED
Included in a bundle being submitted to the network.
MINED
On chain (check receipt success or error for revert data).
FAILED
Terminal failure before execution (error carries the reason).

Stop polling at MINED or FAILED (the schema's PREPARING, SUBMITTING, CONFIRMED, and EXPIRED values are not returned here). Reverted MINED operations are not auto-retried. DALP fills skipped bundler-wallet nonces automatically, so resending a BUNDLED operation does not accelerate mining. See what happens to a nonce the bundler skipped.

Read the receipt

GET /api/v2/bundler/{chainId}/user-operations/{userOperationHash}/receipt returns null until settled on chain (or when outside organisation/network scope):

curl "$DALP_API_URL/api/v2/bundler/$CHAIN_ID/user-operations/$USER_OPERATION_HASH/receipt" \
  -H "X-Api-Key: $DALP_API_KEY"
{
  "userOpHash": "0x8c1f0b7a3e5d4c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b",
  "sender": "0x1111111111111111111111111111111111111111",
  "nonce": "0x0",
  "success": true,
  "transactionHash": "0x3a9e7c1d5b2f4a6e8c0d2b4f6a8e0c2d4b6f8a0e2c4d6b8f0a2e4c6d8b0f2a4e",
  "blockHash": "0x5d7f9b1e3c5a7d9f1b3e5c7a9d1f3b5e7c9a1d3f5b7e9c1a3d5f7b9e1c3a5d7f",
  "blockNumber": "0x1a2b3c"
}

When success is false, reason carries the revert data.

Use the ERC-4337 JSON-RPC endpoint

POST /bundler/{chainId} accepts X-Api-Key (requiring a read-write key for every method, returning 403 DALP-0036 for read keys), supports batches of 1 to 100 calls (204 for notification-only requests, 405 for GET), and exposes:

  • eth_chainId, eth_supportedEntryPoints
  • eth_estimateUserOperationGas, eth_sendUserOperation (params: [userOperation, entryPoint])
  • eth_getUserOperationByHash, eth_getUserOperationReceipt (returns the compact REST shapes without gas-used, gas-cost, or log fields, so map them in standard ERC-4337 clients)
  • pm_getPaymasterStubData, pm_getPaymasterData (params: [userOperation, entryPoint, chainId, context], enabled only when the organisation sponsors gas through a paymaster)
curl -X POST "$DALP_API_URL/bundler/$CHAIN_ID" \
  -H "X-Api-Key: $DALP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getUserOperationReceipt",
    "params": ["0x8c1f0b7a3e5d4c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b"]
  }'

Estimate gas with pm_getPaymasterStubData first (stub signatures fail validation if submitted), then request a signed ticket from pm_getPaymasterData or POST /api/v2/bundler/{chainId}/paymaster-data with all five gas and fee fields populated. Signed tickets bind nonce, call data, and all gas/fee fields, so repricing or changing nonce requires a new ticket.

Refusals

REST routes return standard DALP error envelopes (status and code), while JSON-RPC returns specific reasons in error.message (and error.data.aaCode for ERC-4337 codes). To inspect an exact ERC-4337 code not shown by REST, submit the operation via eth_sendUserOperation.

Refusal
REST response
JSON-RPC response
Missing field, fee below floor, insufficient preVerificationGas, invalid EntryPoint/sender/network, invalid replacement, unsponsored paymaster call, or delegatecall execute
400 TRANSACTION_QUEUE_INPUT_INVALID
Specific reason in error.message
Simulation revert that is not an EntryPoint FailedOp naming an ERC-4337 code
400 TRANSACTION_QUEUE_INPUT_INVALID
error.message “UserOperation simulation failed”, without the revert data
Simulation or prefund failure with ERC-4337 code (such as AA21), read from the EntryPoint's FailedOp revert data
422 AA_VALIDATION_FAILED
error.message (“Failed op” or “Failed op with revert”) and error.data.aaCode
Sponsorship policy denial, missing gas/fee fields to bind, or expired ticket
403 PAYMASTER_SPONSORSHIP_DENIED
error.code: -32501 and reason in error.message

Most refusals are caller errors. Two clear without changing the operation: prefund shortfalls clear once funds arrive or in-flight operations settle, and inactive network deployments (400 TRANSACTION_QUEUE_INPUT_INVALID on REST, 409 retryable: false on JSON-RPC) clear once the deployment activates.

Next steps