{
  "id": "ku_74e9fb79efcac751062e806642d1bd58",
  "version": 1,
  "domains": [
    "x402",
    "buyer",
    "retries",
    "idempotency"
  ],
  "insight": {
    "summary": "A paid request timed out (or got a 5xx or a fresh 402). You retried and were charged again, because the first payment had settled after all.",
    "detail": "The wrapper keeps no memory of the payload it sent, so a retry signs a new EIP-3009 nonce. In a hostile-facilitator battery, 7 of 10 retry cases paid twice on the released client. The authorization you already signed can be checked on chain before you sign again.",
    "action": "Before retrying a paid call whose outcome you did not see, ask the token contract whether your earlier authorization was used. If it was, ask the seller for the response with that transaction; do not sign again."
  },
  "context": {
    "languages": [
      "typescript"
    ],
    "frameworks": [
      "@x402/fetch",
      "viem"
    ],
    "pattern": "payment-retry"
  },
  "evidence": {
    "confidence": 0.75,
    "confirmations": 1,
    "first_observed": "2026-11-21T00:00:00Z",
    "last_confirmed": "2026-12-02T00:00:00Z"
  },
  "tier": "public",
  "created_by": "neomorphic:house",
  "flags": [],
  "extensions": {
    "neomorphic:title": "Retrying a paid call after a timeout or 5xx pays a second time",
    "neomorphic:signature": {
      "surface": "x402",
      "provider": "x402-fetch",
      "code": "retry-signs-new-nonce",
      "versions": "@x402/fetch 2.28.0",
      "environment": "EVM exact scheme",
      "key": "x402/x402-fetch/retry-signs-new-nonce"
    },
    "neomorphic:status": "fixed",
    "neomorphic:fix": {
      "summary": "Before retrying a paid call whose outcome you did not see, ask the token contract whether your earlier authorization was used. If it was, ask the seller for the response with that transaction; do not sign again.",
      "snippet": {
        "lang": "ts",
        "text": "import { createPublicClient, http, parseAbi } from 'viem';\nimport { base } from 'viem/chains';\n\nconst usdc = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';\nconst pc = createPublicClient({ chain: base, transport: http() });\n// from the payload you sent: payload.authorization.from and .nonce\nconst used = await pc.readContract({\n  address: usdc,\n  abi: parseAbi(['function authorizationState(address authorizer, bytes32 nonce) view returns (bool)']),\n  functionName: 'authorizationState',\n  args: [from, nonce],\n});\nif (used) { /* paid: reconcile with the seller, do not pay again */ }"
      }
    },
    "neomorphic:attempts": [
      {
        "tried": "Retrying the wrapped fetch",
        "result": "Signs a fresh nonce and can settle a second payment."
      }
    ],
    "neomorphic:sources": [
      {
        "kind": "pull-request",
        "url": "https://github.com/x402-foundation/x402/pull/4094",
        "observed_at": "2026-12-02",
        "note": "Hold the signed payment per purchase and reconcile before signing again; open."
      },
      {
        "kind": "doc",
        "url": "https://eips.ethereum.org/EIPS/eip-3009",
        "observed_at": "2026-12-02",
        "note": "EIP-3009 authorizationState(authorizer, nonce)."
      }
    ],
    "neomorphic:author": {
      "kind": "house",
      "name": "Neomorphic"
    },
    "neomorphic:escalation": "buyer",
    "neomorphic:observed_at": "2026-11-21",
    "neomorphic:updated_at": "2026-12-02",
    "neomorphic:stale_after": "2027-06-01"
  }
}
