LayerZeroFault
ERC-4337 & Safe CODE: AA24 Reviewed & Verified:

ERC-4337 Error AA24: Signature Error UserOp Validation Fix

Verified by Victor Vance • Lead Technical Analyst & Systems Researcher
Quick Diagnostic Answer (Executive Summary) GSC Snippet Verified

ERC-4337 error AA24 "signature error" indicates that the smart account contract rejected the cryptographic signature during the validateUserOp execution phase. This error occurs when the recovered signer does not match an authorized owner, when userOpHash was computed using mismatched EntryPoint or chainId values, or when WebAuthn P-256 clientDataJSON hashing had unexpected padding. Verify EIP-712 hashing parameters and gas limits to ensure the signed hash matches on-chain execution.

# Root Cause & Technical Architecture

Inside the EntryPoint validation loop, the contract calls `sender.validateUserOp(userOp, userOpHash, missingAccountFunds)`. The account contract computes the cryptographic hash of `userOpHash` and verifies the signature using ECDSA, ERC-1271, or WebAuthn P-256. If the signature is mathematically invalid or from an unauthorized key, `validateUserOp` returns authorizer status `1` (SIG_VALIDATION_FAILED), causing EntryPoint to revert with `AA24 signature error`.

# 4-Step Actionable Diagnostic Protocol

Step-by-Step Resolution
01

Verify EntryPoint Address and Chain ID in userOpHash

Confirm that userOpHash was calculated using the exact EntryPoint address (e.g., 0x0000000071727De22E5E9d8BAf0edAc6f37da032 for v0.7) and numeric chainId.

02

Audit WebAuthn P-256 ClientDataJSON and AuthenticatorData

For passkey smart accounts, ensure the clientDataJSON challenge matches userOpHash and that authenticatorData flags (User Presence / Verification) are valid.

03

Check Pre-Op Gas Estimation Tampering

If gas limits (callGasLimit, verificationGasLimit) were adjusted after signing, userOpHash changes, invalidating any previously collected signature.

04

Inspect ERC-1271 Nested Smart Account Signatures

If the owner is a Safe or another smart contract, verify that the owner contract returns magic value 0x1626ba7e for isValidSignature.

# Diagnostic Verification Code / Command

typescript
verify-userophash.ts
// Compute exact userOpHash per ERC-4337 EntryPoint v0.7
import { keccak256, encodeAbiParameters, parseAbiParameters } from 'viem';

function computeUserOpHash(userOp: any, entryPoint: string, chainId: number) {
  const packedUserOp = keccak256(encodeUserOp(userOp));
  return keccak256(
    encodeAbiParameters(
      parseAbiParameters('bytes32, address, uint256'),
      [packedUserOp, entryPoint as `0x${string}`, BigInt(chainId)]
    )
  );
}
// Any difference in chainId or gas fields invalidates the signature!
Zero-Secrets Client Sandbox

Launch ERC-4337 UserOp Decoder

Execute client-side cryptographic simulation and parameter checks safely in your browser via native WebCrypto without sending private keys or mnemonics over the wire.

Open Sandbox →
Comprehensive In-Depth Guide

Read Full Investigation & Recovery Workflow

Explore complete architectural diagrams, edge-case failure trees, and detailed post-mortem analysis in our verified deep guide.

Read Guide →

# Related Diagnostic Codes in ERC-4337 & Safe

Related Hex Statuses

# Frequently Asked Questions

FAQ Schema

Why does modifying gas limits trigger AA24 signature error?

Gas limits are signed fields inside the UserOperation struct. Modifying any gas value alters the userOpHash, making the existing signature invalid.

What is the difference between AA23 and AA24 in ERC-4337?

AA23 indicates validateUserOp reverted during execution (e.g. out of gas), whereas AA24 indicates validateUserOp returned validation failure status 1.

Can AA24 happen with Safe multi-signature accounts?

Yes. If the threshold of owner signatures is not met, or if owner signatures are not concatenated in ascending order of address, AA24 will trigger.