LayerZeroFault
← Return to Hub / Passkey Recovery / Diagnostic Tools

ERC-4337 UserOp & Calldata Decoder

Debug Account Abstraction transactions before broadcast. Unpack EntryPoint v0.6 and v0.7 structs, calculate required prefund balances, decode smart wallet calldata, and isolate AA21, AA23, and AA33 revert conditions.

100% Client-Side Sandbox Decoding

All user operations and hexadecimal calldata strings are parsed locally in your browser memory. No payload details, account addresses, or signatures are transmitted over any external network.

v0.6 / v0.7 Auto-Detect

EntryPoint Diagnostic Codes

AA21: Account balance below calculated required prefund.
AA22: Expired or not yet valid signature timestamp (clock drift).
AA23: UserOp validation reverted in account contract or verificationGas exhausted.
AA33: Paymaster postOp reverted or gas limit insufficient.
Awaiting UserOperation Input

Paste a JSON struct or hex string to inspect parameters.

STANDBY
Max Prefund Required 0.0000 ETH 0 Gwei
Total Gas Overhead 0 Gas V: 0 | C: 0 | P: 0
Max Fee Per Gas 0.00 Gwei Priority: 0.00 Gwei
Field Decoded Value Decimal / Note
No operation loaded. Paste UserOp JSON on the left.

Understanding ERC-4337 Prefund & Validation Mechanics

How EntryPoint Calculates Required Prefund

Before the EntryPoint contract invokes your smart account's validateUserOp function, it demands an upfront collateral deposit known as the prefund. On EntryPoint v0.6 and v0.7, this is calculated as:

requiredPrefund = (
  verificationGasLimit * (paymaster ? 3 : 1) + 
  callGasLimit + 
  preVerificationGas
) * maxFeePerGas

If the account's EntryPoint deposit (or native balance for self-paying accounts) is less than this theoretical worst-case amount, the transaction immediately reverts with AA21 didn't pay prefund without even attempting verification.

EntryPoint v0.6 vs v0.7 Structural Differences

EntryPoint v0.7 reorganized the UserOperation struct to optimize calldata packing on Layer 2 rollups (Arbitrum, Base, Optimism):

  • accountGasLimits: Combines verificationGasLimit (high 16 bytes) and callGasLimit (low 16 bytes) into a single bytes32.
  • gasFees: Combines maxPriorityFeePerGas and maxFeePerGas into a single bytes32.
  • paymasterAndData: Replaced by dedicated paymaster, paymasterVerificationGasLimit, paymasterPostOpGasLimit, and paymasterData.

Related Smart Contract & Account Abstraction Guides

Debugging smart contract wallets, transaction reversion, or dual-transport WebAuthn setups? Review our technical teardowns:

ERC-4337 EntryPoint Error Code Reference (AA13 / AA21 / AA22 / AA23 / AA33)

Comprehensive diagnostic resolution guides for standard ERC-4337 EntryPoint reverts across account abstraction, paymaster sponsorship, and session key infrastructure:

Error Code Execution Phase Failure Mechanism Resolution Guide
AA13 Factory Deployment InitCode execution reverted or exceeded factory gas allocation AA13 InitCode Fix →
AA21 Prefund Validation Sender account balance or EntryPoint deposit below required maxCost AA21 Prefund Fix →
AA22 Timestamp Validity Clock drift or expired session key validity window AA22 Clock Drift Fix →
AA23 User Verification P-256 passkey signature or WebCrypto authentication failed AA23 Signature Fix →
AA33 Paymaster PostOp Post-execution token transfer or context reverted on-chain AA33 PostOp Fix →
Paymaster Gas Sponsorship Paymaster rejected UserOp or sponsorship signature invalid Paymaster Revert Fix →

Frequently Asked ERC-4337 Questions

What does the AA21 revert error mean in ERC-4337?

AA21 ("didn't pay prefund") occurs when the smart account's native token balance or its EntryPoint deposit is insufficient to cover the maximum theoretical gas cost (prefund = (verificationGasLimit * (paymaster ? 3 : 1) + callGasLimit + preVerificationGas) * maxFeePerGas). The EntryPoint reverts before calling validateUserOp.

What causes AA23 and AA33 revert errors in Account Abstraction?

AA23 ("reverted or out of gas in validateUserOp") means the smart account contract's validation logic threw a revert (such as an invalid ECDSA or P-256 signature) or consumed more gas than verificationGasLimit. AA33 ("reverted in postOp") indicates that a Paymaster's postOp execution failed or lacked gas.

What is the difference between EntryPoint v0.6 and v0.7 UserOperation formats?

EntryPoint v0.7 packs verificationGasLimit and callGasLimit into a single bytes32 field (accountGasLimits) and maxPriorityFeePerGas and maxFeePerGas into another bytes32 field (gasFees) to reduce Layer 2 calldata overhead. Furthermore, paymasterAndData is split into separate paymaster, gas limits, and paymasterData fields.

What is 2D noncing and how does it prevent stuck transaction queues?

EIP-4337 utilizes a two-dimensional nonce where the upper 192 bits represent a 'key' (channel) and the lower 64 bits represent a sequential counter for that key. This enables parallel execution across distinct transaction channels without blocking when a single transaction is pending or delayed.