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.
EntryPoint Diagnostic Codes
| 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) andcallGasLimit(low 16 bytes) into a single bytes32. - gasFees: Combines
maxPriorityFeePerGasandmaxFeePerGasinto a single bytes32. - paymasterAndData: Replaced by dedicated
paymaster,paymasterVerificationGasLimit,paymasterPostOpGasLimit, andpaymasterData.
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.