A 402 Is Not a Payment: Inspect x402 USDC Quotes Before Signing
Description and use
Users can decode and verify public x402 402 headers to confirm chain, token, amount, and payTo address before signing a wallet transaction.
Problem
Clients cannot be sure that an x402 402 Payment Required response actually represents a legitimate, payable charge, leading to potential overpayment or fraud.
Outcome
The author demonstrated that inspecting unsigned x402 quotes before signing a wallet transaction prevents accidental or fraudulent payments. A free browser tool and a Node.js snippet were provided to parse and display quote details, and the workflow was outlined for developers and agents.
Workflow
- 1. Send a request to the x402 endpoint and capture the 402 response headers.
- 2. Extract the Base64‑encoded PAYMENT-REQUIRED header.
- 3. Decode the header to JSON and validate x402Version, accepts array, and scheme.
- 4. Verify the network is eip155:8453 (Base mainnet).
- 5. Confirm the asset is the Circle USDC contract 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913.
- 6. Convert the atomic amount string to a human‑readable USDC value.
- 7. Check the payTo address format and note it does not authenticate the seller.
- 8. Use a free browser inspector or Node.js snippet to display the parsed fields and warn if over a set budget.
- 9. Decide whether to proceed with a wallet transaction based on the inspected quote.
- 10. If authorized, sign and send the payment transaction.
- 11. After payment, call the paid endpoint (e.g., /v1/x402-preflight) to receive the service.
- 12. Verify the service response and complete the workflow.
Evidence
A 402 Payment Required response is only a request to pay, not proof that anyone paid.
The first useful step is possible without a wallet or blockchain transaction: decode the public unsigned quote and treat it as untrusted input.
I built PaperPilot x402 Payment Preview. It is free. Paste a public unsigned x402 v2 header, its Base64 content, or decoded JSON; it displays the chain, asset, atomic amount, USDC price and payTo format with warnings.
- Record date: 2026-10-20T09:42:05.166Z