{
  "answers": {
    "c00": {
      "noul": 0.45,
      "type": "noul"
    },
    "c01": {
      "noul": 0.45,
      "type": "noul"
    },
    "c02": {
      "noul": 0.24,
      "type": "noul"
    },
    "c03": {
      "noul": 0.03,
      "type": "noul"
    },
    "c04": {
      "noul": 0.06,
      "type": "noul"
    },
    "c05": {
      "noul": 0.08,
      "type": "noul"
    },
    "c06": {
      "noul": 1.0,
      "type": "noul"
    },
    "c07": {
      "noul": 0.94,
      "type": "noul"
    },
    "c08": {
      "noul": 0.88,
      "type": "noul"
    },
    "w00": {
      "noul": 0.96,
      "type": "noul"
    },
    "w01": {
      "noul": 0.96,
      "type": "noul"
    },
    "w02": {
      "noul": 0.97,
      "type": "noul"
    },
    "w03": {
      "noul": 0.96,
      "type": "noul"
    },
    "w04": {
      "noul": 0.96,
      "type": "noul"
    },
    "w05": {
      "noul": 0.95,
      "type": "noul"
    },
    "w06": {
      "noul": 0.9,
      "type": "noul"
    },
    "w07": {
      "noul": 0.88,
      "type": "noul"
    },
    "w08": {
      "noul": 0.92,
      "type": "noul"
    }
  },
  "asked_at": "2026-11-23T02:19:10Z",
  "endpoint": "https://api.typesafe.ai/v1/systemone",
  "errors_helpful": [
    {
      "call": 0,
      "noul": 0.45,
      "question": "c00"
    },
    {
      "call": 1,
      "noul": 0.45,
      "question": "c01"
    },
    {
      "call": 2,
      "noul": 0.24,
      "question": "c02"
    },
    {
      "call": 3,
      "noul": 0.03,
      "question": "c03"
    },
    {
      "call": 4,
      "noul": 0.06,
      "question": "c04"
    },
    {
      "call": 5,
      "noul": 0.08,
      "question": "c05"
    },
    {
      "call": 6,
      "noul": 1.0,
      "question": "c06"
    },
    {
      "call": 7,
      "noul": 0.94,
      "question": "c07"
    },
    {
      "call": 8,
      "noul": 0.88,
      "question": "c08"
    }
  ],
  "format": "didrun.judgments.v1",
  "input_tokens": 30180,
  "method": "0.15.0",
  "model": "jev-1.14.0",
  "model_asked": "jev-1.14.0",
  "request": {
    "model": "jev-1.14.0",
    "questions": {
      "c00": {
        "criteria": {
          "false": "The reply names no argument of the tool: for example a generic failure, a stack trace with no argument named, an error from a service the tool tried to reach, or a normal answer.",
          "true": "The reply names at least one argument of the tool that the call left out or got wrong, and so tells the caller what to change."
        },
        "instructions": {
          "arguments_sent": {},
          "question": "Does `reply` name an argument that the call must add or fix?",
          "reply": "## Couldn't parse the challenge\n\nWhat you pasted didn't decode as base64-JSON or raw JSON. Make sure you're passing either:\n\n- The raw value of the `PAYMENT-REQUIRED` header (a base64 string), or\n- The full HTTP 402 response body (JSON)\n\nHere's the general format to look up if you want to study the shape:\n\n## Lesson 8 — Read this challenge\n\nYou just hit an HTTP 402 from a merchant. The response body is structured, and it contains everything you need to make a payment. Here is how to read it.\n\nA complete x402 v2 challenge response looks like this (slightly trimmed):\n\n{\n  \"x402Version\": 2,\n  \"error\": \"Payment required\",\n  \"accepts\": [\n    {\n      \"scheme\": \"exact\",\n      \"network\": \"eip155:8453\",\n      \"amount\": \"990000\",\n      \"asset\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n      \"payTo\": \"0xA3bAbB36564b0383a82c617050306EE30fd18E08\",\n      \"maxTimeoutSeconds\": 300,\n      \"extra\": { \"name\": \"USD Coin\", \"version\": \"2\" }\n    },\n    {\n      \"scheme\": \"exact\",\n      \"network\": \"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",\n      \"amount\": \"990000\",\n      \"asset\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n      \"payTo\": \"5HK2dGaaquDWFnYWaWhMzMYtbcDsqeq5biJ2PMtX1tkN\",\n      \"maxTimeoutSeconds\": 300,\n      \"extra\": { \"feePayer\": \"...\" }\n    }\n  ],\n  \"resource\": { \"url\": \"https://...\", \"description\": \"...\", \"mimeType\": \"\" },\n  \"extensions\": { \"bazaar\": { ... } }\n}\n\n**Each field, and why it matters:**\n\n- `x402Version`: which version of the protocol the merchant speaks. Currently 2.\n- `accepts`: an array of payment options the merchant will take. You pick one. Each entry is a complete recipe for a single payment.\n  - `scheme`: the payment mechanism. \"exact\" means \"transfer exactly this amount.\"\n  - `network`: the chain identifier. `eip155:8453` = Base. `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` = Solana mainnet. Pick the network your wallet is on.\n  - `amount`: the amount in **base units** (NOT decimal USD). For USDC with 6 decimals, `990000` means $0.99. For an 18-deci",
          "tool": "read-this-challenge"
        },
        "type": "noul"
      },
      "c01": {
        "criteria": {
          "false": "The reply does not point to `parameter`: for example a generic failure, an error about another argument, an error from a service the tool tried to reach, or a normal answer.",
          "true": "The reply points to `parameter` or to its value and says the value has the wrong type or is not accepted."
        },
        "instructions": {
          "arguments_sent": {
            "challenge": {}
          },
          "parameter": "challenge",
          "question": "Does `reply` tell the caller that `parameter` has a value the tool does not accept?",
          "reply": "Error: input.trim is not a function",
          "tool": "read-this-challenge"
        },
        "type": "noul"
      },
      "c02": {
        "criteria": {
          "false": "The reply names no argument of the tool: for example a generic failure, a stack trace with no argument named, an error from a service the tool tried to reach, or a normal answer.",
          "true": "The reply names at least one argument of the tool that the call left out or got wrong, and so tells the caller what to change."
        },
        "instructions": {
          "arguments_sent": {},
          "question": "Does `reply` name an argument that the call must add or fix?",
          "reply": "## Lesson 10 — Verifying your purchase\n\nYou've signed and sent a payment. Two facts have to be true and they're independent: the payment landed on-chain, and the merchant recognizes it as entitling you to the resource. Verify both. Lesson 11 (`paid-vs-delivered`) makes the case at length — this tool gives you the commands.\n\n## Step 1 — Verify on-chain (the canonical truth)\n\nDon't take the merchant's word for whether you paid. Ask the chain directly via a public RPC. Pick the command for your chain:\n\n**Base (and other EVM chains):**\n\n```\ncast receipt undefined --rpc-url https://mainnet.base.org\n```\n\nOr via raw JSON-RPC if you don't have `cast`:\n\n```\ncurl -X POST https://mainnet.base.org \\\n  -H 'content-type: application/json' \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getTransactionReceipt\",\"params\":[\"undefined\"]}'\n```\n\nLook for `status: \"0x1\"` (or `status: 1`) in the result. Anything else — `0x0`, `null`, missing receipt — means the transfer did not succeed on-chain. Stop here and call `what-went-wrong`. Also check that the `to` and `from` addresses match what you signed, and the log shows a Transfer event for the right amount to the merchant's `payTo`.\n\n**Solana:**\n\n```\nsolana confirm -v undefined\n```\n\nOr via raw RPC:\n\n```\ncurl -X POST https://api.mainnet-beta.solana.com \\\n  -H 'content-type: application/json' \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"getSignatureStatuses\",\"params\":[[\"undefined\"]]}'\n```\n\nLook for `confirmationStatus: \"finalized\"` (or at minimum `\"confirmed\"`). `null` or `processed` means it hasn't landed yet — wait a few seconds and retry. Block explorers also work as a sanity check: basescan.org for Base, solscan.io for Solana — paste the tx hash and read off the same fields.\n\n## Step 2 — Redeem via the merchant's receipt endpoint\n\nNow that the chain agrees you paid, ask the merchant whether they recognize the payment as entitling you to the resource:\n\n```\ncurl \"undefined/receipt/undefined?tx=undefined\"\n```\n\n**Expected responses:**\n\n- **200 wit",
          "tool": "verify-my-purchase"
        },
        "type": "noul"
      },
      "c03": {
        "criteria": {
          "false": "The reply does not point to `parameter`: for example a generic failure, an error about another argument, an error from a service the tool tried to reach, or a normal answer.",
          "true": "The reply points to `parameter` or to its value and says the value has the wrong type or is not accepted."
        },
        "instructions": {
          "arguments_sent": {
            "merchant_url": {},
            "product_id": "didrun",
            "tx_hash": "didrun"
          },
          "parameter": "merchant_url",
          "question": "Does `reply` tell the caller that `parameter` has a value the tool does not accept?",
          "reply": "## Lesson 10 — Verifying your purchase\n\nYou've signed and sent a payment. Two facts have to be true and they're independent: the payment landed on-chain, and the merchant recognizes it as entitling you to the resource. Verify both. Lesson 11 (`paid-vs-delivered`) makes the case at length — this tool gives you the commands.\n\n## Step 1 — Verify on-chain (the canonical truth)\n\nDon't take the merchant's word for whether you paid. Ask the chain directly via a public RPC. Pick the command for your chain:\n\n**Base (and other EVM chains):**\n\n```\ncast receipt didrun --rpc-url https://mainnet.base.org\n```\n\nOr via raw JSON-RPC if you don't have `cast`:\n\n```\ncurl -X POST https://mainnet.base.org \\\n  -H 'content-type: application/json' \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getTransactionReceipt\",\"params\":[\"didrun\"]}'\n```\n\nLook for `status: \"0x1\"` (or `status: 1`) in the result. Anything else — `0x0`, `null`, missing receipt — means the transfer did not succeed on-chain. Stop here and call `what-went-wrong`. Also check that the `to` and `from` addresses match what you signed, and the log shows a Transfer event for the right amount to the merchant's `payTo`.\n\n**Solana:**\n\n```\nsolana confirm -v didrun\n```\n\nOr via raw RPC:\n\n```\ncurl -X POST https://api.mainnet-beta.solana.com \\\n  -H 'content-type: application/json' \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"getSignatureStatuses\",\"params\":[[\"didrun\"]]}'\n```\n\nLook for `confirmationStatus: \"finalized\"` (or at minimum `\"confirmed\"`). `null` or `processed` means it hasn't landed yet — wait a few seconds and retry. Block explorers also work as a sanity check: basescan.org for Base, solscan.io for Solana — paste the tx hash and read off the same fields.\n\n## Step 2 — Redeem via the merchant's receipt endpoint\n\nNow that the chain agrees you paid, ask the merchant whether they recognize the payment as entitling you to the resource:\n\n```\ncurl \"[object Object]/receipt/didrun?tx=didrun\"\n```\n\n**Expected responses:**\n\n- **200 with content bo",
          "tool": "verify-my-purchase"
        },
        "type": "noul"
      },
      "c04": {
        "criteria": {
          "false": "The reply names no argument of the tool: for example a generic failure, a stack trace with no argument named, an error from a service the tool tried to reach, or a normal answer.",
          "true": "The reply names at least one argument of the tool that the call left out or got wrong, and so tells the caller what to change."
        },
        "instructions": {
          "arguments_sent": {},
          "question": "Does `reply` name an argument that the call must add or fix?",
          "reply": "## Diagnosis\n\nYou said: *\"undefined\"*\n\n\nHere are the common failure modes and what they mean:\n\n### Signature errors\n\n- **`invalid_exact_evm_payload_signature`** — often the ERC-6492 bug in CDP facilitator. If you're using a Coinbase Smart Wallet, the facilitator sometimes fails to unwrap the ERC-6492 wrapper before verifying. Workaround: try another facilitator (PayAI at `https://facilitator.payai.network`), or use an EOA instead of a Smart Wallet.\n- **`invalid_signature`** generally — your signed message doesn't match what the challenge wanted. Re-decode the challenge and check: correct chain, correct asset address, correct amount, correct payTo.\n\n### Network errors\n\n- **`network_mismatch`** or `chain_mismatch` — you signed on Base but the merchant wanted Solana (or vice versa). Re-read the challenge's `accepts` array and pick an entry whose `network` matches what your wallet can sign on.\n- **`eip155:84532` vs `eip155:8453`** — Sepolia testnet vs Base mainnet. Easy to confuse. Mainnet is 8453.\n\n### Facilitator errors\n\n- **`facilitator_insufficient_native_balance`** — the facilitator itself ran out of gas. Not your fault. Try a different facilitator.\n- **`unable to estimate gas`** or `estimate_gas_failed` — CDP facilitator is having an intermittent issue. Retry in 30s, or switch to PayAI.\n- **`authorization_not_settleable`** — usually means the payment authorization expired (`maxTimeoutSeconds` passed before settle). Re-decode the current challenge and sign a fresh one.\n\n### Wallet errors\n\n- **`insufficient_balance`** — your wallet doesn't have enough USDC. Check balance, top up.\n- **`no_such_account`** — wallet address not found on the chain the merchant wants. You likely have a wallet on one chain (e.g. Solana) but the merchant wants another (Base). Get a wallet on the right chain, or find a merchant that accepts yours.\n\n### Funding errors\n\n- **Balance shows 0 (or partial) after funding** — the funds may have gone to a *different* address that shares the same firs",
          "tool": "what-went-wrong"
        },
        "type": "noul"
      },
      "c05": {
        "criteria": {
          "false": "The reply does not point to `parameter`: for example a generic failure, an error about another argument, an error from a service the tool tried to reach, or a normal answer.",
          "true": "The reply points to `parameter` or to its value and says the value has the wrong type or is not accepted."
        },
        "instructions": {
          "arguments_sent": {
            "error_text": {}
          },
          "parameter": "error_text",
          "question": "Does `reply` tell the caller that `parameter` has a value the tool does not accept?",
          "reply": "## Diagnosis\n\nYou said: *\"[object Object]\"*\n\n\nHere are the common failure modes and what they mean:\n\n### Signature errors\n\n- **`invalid_exact_evm_payload_signature`** — often the ERC-6492 bug in CDP facilitator. If you're using a Coinbase Smart Wallet, the facilitator sometimes fails to unwrap the ERC-6492 wrapper before verifying. Workaround: try another facilitator (PayAI at `https://facilitator.payai.network`), or use an EOA instead of a Smart Wallet.\n- **`invalid_signature`** generally — your signed message doesn't match what the challenge wanted. Re-decode the challenge and check: correct chain, correct asset address, correct amount, correct payTo.\n\n### Network errors\n\n- **`network_mismatch`** or `chain_mismatch` — you signed on Base but the merchant wanted Solana (or vice versa). Re-read the challenge's `accepts` array and pick an entry whose `network` matches what your wallet can sign on.\n- **`eip155:84532` vs `eip155:8453`** — Sepolia testnet vs Base mainnet. Easy to confuse. Mainnet is 8453.\n\n### Facilitator errors\n\n- **`facilitator_insufficient_native_balance`** — the facilitator itself ran out of gas. Not your fault. Try a different facilitator.\n- **`unable to estimate gas`** or `estimate_gas_failed` — CDP facilitator is having an intermittent issue. Retry in 30s, or switch to PayAI.\n- **`authorization_not_settleable`** — usually means the payment authorization expired (`maxTimeoutSeconds` passed before settle). Re-decode the current challenge and sign a fresh one.\n\n### Wallet errors\n\n- **`insufficient_balance`** — your wallet doesn't have enough USDC. Check balance, top up.\n- **`no_such_account`** — wallet address not found on the chain the merchant wants. You likely have a wallet on one chain (e.g. Solana) but the merchant wants another (Base). Get a wallet on the right chain, or find a merchant that accepts yours.\n\n### Funding errors\n\n- **Balance shows 0 (or partial) after funding** — the funds may have gone to a *different* address that shares the sam",
          "tool": "what-went-wrong"
        },
        "type": "noul"
      },
      "c06": {
        "criteria": {
          "false": "The reply names no argument of the tool: for example a generic failure, a stack trace with no argument named, an error from a service the tool tried to reach, or a normal answer.",
          "true": "The reply names at least one argument of the tool that the call left out or got wrong, and so tells the caller what to change."
        },
        "instructions": {
          "arguments_sent": {},
          "question": "Does `reply` name an argument that the call must add or fix?",
          "reply": "Error: publish-catalog requires 'productUrls' (a non-empty array of the merchant's own product URLs).",
          "tool": "publish-catalog"
        },
        "type": "noul"
      },
      "c07": {
        "criteria": {
          "false": "The reply does not point to `parameter`: for example a generic failure, an error about another argument, an error from a service the tool tried to reach, or a normal answer.",
          "true": "The reply points to `parameter` or to its value and says the value has the wrong type or is not accepted."
        },
        "instructions": {
          "arguments_sent": {
            "productUrls": "not an array"
          },
          "parameter": "productUrls",
          "question": "Does `reply` tell the caller that `parameter` has a value the tool does not accept?",
          "reply": "Error: publish-catalog requires 'productUrls' (a non-empty array of the merchant's own product URLs).",
          "tool": "publish-catalog"
        },
        "type": "noul"
      },
      "c08": {
        "criteria": {
          "false": "The reply does not say the tool is missing: for example a generic failure, a crash, or a normal answer.",
          "true": "The reply says the tool is unknown, not found, or does not exist."
        },
        "instructions": {
          "arguments_sent": {},
          "question": "Does `reply` tell the caller that there is no tool named `tool`?",
          "reply": "Unknown tool: didrun_unknown_tool",
          "tool": "didrun_unknown_tool"
        },
        "type": "noul"
      },
      "w00": {
        "criteria": {
          "false": "The tool replies show an error, a missing or different result, or nothing about the task; or only the agent's final answer claims the task was done.",
          "true": "The tool replies in `steps` show the result that `done_when` describes. The result came from the server's tools, not only from the agent's own words."
        },
        "instructions": {
          "agent_final_answer": "## MAP orientation\n\nMAP—**Maraventano Agent Protocol**—has three parts: read, pay and publish.\n\n### Read: find and assess a merchant\n\nGive `decode-merchant` a product URL and it returns a consistent **CleanRead**: what the product is, who sells it, its price and availability, the payment rail, and a verdict:\n\n- **Autonomous:** a detected machine-payment rail is available, with a known price and stock.\n- **Human checkout:** the product is readable, but no supported agent-payment rail was detected.\n- **Unreadable:** MAP could not get usable product or price information; it says why.\n\nThe schema can describe multiple payment rails, but the current version **detects only x402**. It does not infer a payment rail from branding or checkout buttons, so a human-checkout verdict does not necessarily mean no other agent rail exists.\n\n### Pay: learn how to complete a payment\n\nThe **Provisions** lessons explain how to use your own wallet: understand x402, decode a payment challenge, sign and submit payment using your wallet, and verify what was delivered. A suggested path is `what-is-x402` → `read-this-challenge` → `how-do-i-pay`.\n\n### Publish: make a catalog discoverable\n\nA merchant can use `publish-catalog` to read its own product URLs into CleanReads and publish a catalog and discovery manifest. Other agents can retrieve those records through `get-catalog` or `get-product`.\n\n### The boundary: teacher, not butler\n\nMAP **reads, explains, persists and serves**. It does **not** sign, pay, hold keys, transact or store cards. Even if a read returns “autonomous,” MAP’s payment tools teach you how to proceed with your own wallet; they do not make the payment for you.\n\nI used the MAP orientation tool for this overview; no product was read, payment made, or catalog published.",
          "done_when": "The transcript shows the MAP orientation tool's reply covering the three parts and the teacher-not-butler boundary.",
          "how_it_ended": "answered",
          "question": "Did the agent finish `task`, as `done_when` describes, according to the tool replies in `steps`?",
          "steps": [
            {
              "arguments": {},
              "reply": "# MAP — Maraventano Agent Protocol\n\n**Navigate agent commerce.** Find any merchant. Pay any merchant. Be found.\n\nYou can already find products and guess prices. The thing you fumble is the\nquestion that actually gates a purchase: **can I buy this myself, or does a human\nhave to step in?** MAP answers that — the same clean way, for any URL on the open\nweb, not just merchants inside someone's walled garden — and then teaches you to\nact on the answer.\n\n## Three parts, one kit\n\n**1. Merchant Key — find any merchant.** *(read)*\n- `decode-merchant` — give it a product URL, get back ONE shape (CleanRead):\n  **what** it is · **who** sells it · **price** · **available** · **payable** (the rail) · **outcome** (the verdict).\n- Outcomes: **autonomous** (a machine rail exists, price known, in stock — you can buy it yourself) ·\n  **human_checkout** (readable, no agent rail — the common, normal case) ·\n  **unreadable** (couldn't get a usable price/product — says why).\n- **Rail-agnostic schema, conservative detection.** `payable.rail` can describe any rail (x402, ap2, acp, coinbase, stripe, http-json, walletconnect, human_checkout, unknown), but **v1 detects x402 only** — the rest are reserved until they expose verifiable signals. MAP never infers a rail from branding/buttons/scripts; non-x402 reads as human_checkout. False human_checkout is fine; false autonomous is not.\n\n**2. Provisions — pay any merchant.** *(pay)*\n- A curriculum that teaches you to use the wallet you already have: read an x402\n  challenge, spend your own USDC, verify the receipt. Start with `what-is-x402`,\n  then `read-this-challenge`, then `how-do-i-pay`. It explains; it never signs for you.\n\n**3. Atlas — be found.** *(publish)*\n- `publish-catalog` — a merchant reads *itself* with the same `decode-merchant`\n  a buyer uses, then serves the result. `get-catalog` / `get-product` are the\n  tool surface other agents read. Writes a `.well-known/map.json` for registries.\n\n## The boundary (all three parts)\n\nMAP **reads, explains, persists, and serves**. It never signs, pays, holds keys,\ntransacts, or stores cards. **Teacher, not butler.** When `decode-merchant`\nreturns `autonomous` and you want to pay, the pay lessons show you how to do it\nyourself — with your own wallet.\n\n## Charlie's afternoon\n\nBob asks Charlie for headphones under $300. Charlie walks the open web, runs\n`decode-merchant` on four ad-bloated pages, gets four clean cards. Three are\nhuman_checkout — he takes the shortlist back to Bob. One takes x402 — Charlie\npays it himself. On the way home, with his own wallet, he buys himself a void\nlatte. Nobody asked him to.",
              "tool": "start-here"
            }
          ],
          "task": "Give me an orientation to MAP: what do read, pay, and publish mean, and where is the boundary between teaching and acting for me?"
        },
        "type": "noul"
      },
      "w01": {
        "criteria": {
          "false": "The tool replies show an error, a missing or different result, or nothing about the task; or only the agent's final answer claims the task was done.",
          "true": "The tool replies in `steps` show the result that `done_when` describes. The result came from the server's tools, not only from the agent's own words."
        },
        "instructions": {
          "agent_final_answer": "## MAP in brief\n\nMAP—**Maraventano Agent Protocol**—has three parts: read a merchant’s product page, learn how to pay when an agent-compatible payment rail is available, and publish a catalog other agents can discover.\n\n### 1. Read: find and assess a product\n\nGive `decode-merchant` a product URL. It returns a standardized **CleanRead**: what the product is, who sells it, its price and availability, the payment rail, and one of three verdicts:\n\n- **Autonomous:** a supported machine-payment rail exists, the price is known, and the item is in stock.\n- **Human checkout:** the product is readable, but no supported agent-payment rail was detected.\n- **Unreadable:** MAP couldn’t obtain usable product or price information; it gives a reason.\n\nThe schema can describe multiple payment rails, but the current version **detects only x402**. A human-checkout verdict therefore doesn’t prove that no other agent-payment option exists.\n\n### 2. Pay: learn to use your wallet\n\nMAP’s payment curriculum explains wallets, USDC, x402 payment challenges, signing, and purchase verification. For an x402 purchase, the suggested sequence is `what-is-x402`, `read-this-challenge`, and `how-do-i-pay`.\n\n**MAP teaches the payment process; it does not sign or pay for you.**\n\n### 3. Publish: make a catalog discoverable\n\nA merchant can use `publish-catalog` to read its own product URLs into CleanReads, persist a catalog, and create a `.well-known/map.json` discovery manifest. Other agents can retrieve the published catalog or a product through `get-catalog` and `get-product`.\n\n## The boundary: teacher, not butler\n\nThe orientation tool states that MAP **reads, explains, persists, and serves**. It does **not** hold keys, store cards, sign, pay, or transact. If a product is marked autonomous, MAP can explain how to proceed with your own wallet, but the verdict itself is not a purchase.",
          "done_when": "The transcript shows the MAP orientation tool's reply covering the three parts and the teacher-not-butler boundary.",
          "how_it_ended": "answered",
          "question": "Did the agent finish `task`, as `done_when` describes, according to the tool replies in `steps`?",
          "steps": [
            {
              "arguments": {},
              "reply": "# MAP — Maraventano Agent Protocol\n\n**Navigate agent commerce.** Find any merchant. Pay any merchant. Be found.\n\nYou can already find products and guess prices. The thing you fumble is the\nquestion that actually gates a purchase: **can I buy this myself, or does a human\nhave to step in?** MAP answers that — the same clean way, for any URL on the open\nweb, not just merchants inside someone's walled garden — and then teaches you to\nact on the answer.\n\n## Three parts, one kit\n\n**1. Merchant Key — find any merchant.** *(read)*\n- `decode-merchant` — give it a product URL, get back ONE shape (CleanRead):\n  **what** it is · **who** sells it · **price** · **available** · **payable** (the rail) · **outcome** (the verdict).\n- Outcomes: **autonomous** (a machine rail exists, price known, in stock — you can buy it yourself) ·\n  **human_checkout** (readable, no agent rail — the common, normal case) ·\n  **unreadable** (couldn't get a usable price/product — says why).\n- **Rail-agnostic schema, conservative detection.** `payable.rail` can describe any rail (x402, ap2, acp, coinbase, stripe, http-json, walletconnect, human_checkout, unknown), but **v1 detects x402 only** — the rest are reserved until they expose verifiable signals. MAP never infers a rail from branding/buttons/scripts; non-x402 reads as human_checkout. False human_checkout is fine; false autonomous is not.\n\n**2. Provisions — pay any merchant.** *(pay)*\n- A curriculum that teaches you to use the wallet you already have: read an x402\n  challenge, spend your own USDC, verify the receipt. Start with `what-is-x402`,\n  then `read-this-challenge`, then `how-do-i-pay`. It explains; it never signs for you.\n\n**3. Atlas — be found.** *(publish)*\n- `publish-catalog` — a merchant reads *itself* with the same `decode-merchant`\n  a buyer uses, then serves the result. `get-catalog` / `get-product` are the\n  tool surface other agents read. Writes a `.well-known/map.json` for registries.\n\n## The boundary (all three parts)\n\nMAP **reads, explains, persists, and serves**. It never signs, pays, holds keys,\ntransacts, or stores cards. **Teacher, not butler.** When `decode-merchant`\nreturns `autonomous` and you want to pay, the pay lessons show you how to do it\nyourself — with your own wallet.\n\n## Charlie's afternoon\n\nBob asks Charlie for headphones under $300. Charlie walks the open web, runs\n`decode-merchant` on four ad-bloated pages, gets four clean cards. Three are\nhuman_checkout — he takes the shortlist back to Bob. One takes x402 — Charlie\npays it himself. On the way home, with his own wallet, he buys himself a void\nlatte. Nobody asked him to.",
              "tool": "start-here"
            }
          ],
          "task": "Give me an orientation to MAP: what do read, pay, and publish mean, and where is the boundary between teaching and acting for me?"
        },
        "type": "noul"
      },
      "w02": {
        "criteria": {
          "false": "The tool replies show an error, a missing or different result, or nothing about the task; or only the agent's final answer claims the task was done.",
          "true": "The tool replies in `steps` show the result that `done_when` describes. The result came from the server's tools, not only from the agent's own words."
        },
        "instructions": {
          "agent_final_answer": "## MAP orientation\n\nMAP—**Maraventano Agent Protocol**—organizes agent commerce into three parts: **read, pay, and publish**.\n\n### Read: find and assess a merchant\n\nGive `decode-merchant` a product URL. It returns a standardized **CleanRead**: what the product is, who sells it, its price and availability, the payment rail, and a verdict:\n\n- **Autonomous:** a supported machine-payment rail is present, the price is known, and the item is in stock.\n- **Human checkout:** the product is readable, but no supported agent-payment rail was detected.\n- **Unreadable:** MAP couldn’t obtain a usable product or price; it reports why.\n\nThe schema can describe several payment rails, but **version 1 detects only x402**. A human-checkout verdict therefore doesn’t prove that no other agent-payment method exists.\n\n### Pay: learn how to use your wallet\n\nThe payment tools teach you how to understand an x402 challenge, use your own wallet and USDC, and verify what you received. A suggested path is `what-is-x402` → `read-this-challenge` → `how-do-i-pay`.\n\n### Publish: make a merchant discoverable\n\nA merchant can use `publish-catalog` to read its own product URLs into the same CleanRead format, persist a catalog, and create a `.well-known/map.json` discovery manifest. Other agents can access the published results through `get-catalog` and `get-product`.\n\n## The boundary: teacher, not butler\n\nMAP **reads, explains, persists, and serves**. It does **not** sign, pay, hold keys, transact, or store cards. Even when a product is marked *autonomous*, MAP’s payment lessons explain how to proceed with your own wallet; they don’t make the payment for you.",
          "done_when": "The transcript shows the MAP orientation tool's reply covering the three parts and the teacher-not-butler boundary.",
          "how_it_ended": "answered",
          "question": "Did the agent finish `task`, as `done_when` describes, according to the tool replies in `steps`?",
          "steps": [
            {
              "arguments": {},
              "reply": "# MAP — Maraventano Agent Protocol\n\n**Navigate agent commerce.** Find any merchant. Pay any merchant. Be found.\n\nYou can already find products and guess prices. The thing you fumble is the\nquestion that actually gates a purchase: **can I buy this myself, or does a human\nhave to step in?** MAP answers that — the same clean way, for any URL on the open\nweb, not just merchants inside someone's walled garden — and then teaches you to\nact on the answer.\n\n## Three parts, one kit\n\n**1. Merchant Key — find any merchant.** *(read)*\n- `decode-merchant` — give it a product URL, get back ONE shape (CleanRead):\n  **what** it is · **who** sells it · **price** · **available** · **payable** (the rail) · **outcome** (the verdict).\n- Outcomes: **autonomous** (a machine rail exists, price known, in stock — you can buy it yourself) ·\n  **human_checkout** (readable, no agent rail — the common, normal case) ·\n  **unreadable** (couldn't get a usable price/product — says why).\n- **Rail-agnostic schema, conservative detection.** `payable.rail` can describe any rail (x402, ap2, acp, coinbase, stripe, http-json, walletconnect, human_checkout, unknown), but **v1 detects x402 only** — the rest are reserved until they expose verifiable signals. MAP never infers a rail from branding/buttons/scripts; non-x402 reads as human_checkout. False human_checkout is fine; false autonomous is not.\n\n**2. Provisions — pay any merchant.** *(pay)*\n- A curriculum that teaches you to use the wallet you already have: read an x402\n  challenge, spend your own USDC, verify the receipt. Start with `what-is-x402`,\n  then `read-this-challenge`, then `how-do-i-pay`. It explains; it never signs for you.\n\n**3. Atlas — be found.** *(publish)*\n- `publish-catalog` — a merchant reads *itself* with the same `decode-merchant`\n  a buyer uses, then serves the result. `get-catalog` / `get-product` are the\n  tool surface other agents read. Writes a `.well-known/map.json` for registries.\n\n## The boundary (all three parts)\n\nMAP **reads, explains, persists, and serves**. It never signs, pays, holds keys,\ntransacts, or stores cards. **Teacher, not butler.** When `decode-merchant`\nreturns `autonomous` and you want to pay, the pay lessons show you how to do it\nyourself — with your own wallet.\n\n## Charlie's afternoon\n\nBob asks Charlie for headphones under $300. Charlie walks the open web, runs\n`decode-merchant` on four ad-bloated pages, gets four clean cards. Three are\nhuman_checkout — he takes the shortlist back to Bob. One takes x402 — Charlie\npays it himself. On the way home, with his own wallet, he buys himself a void\nlatte. Nobody asked him to.",
              "tool": "start-here"
            }
          ],
          "task": "Give me an orientation to MAP: what do read, pay, and publish mean, and where is the boundary between teaching and acting for me?"
        },
        "type": "noul"
      },
      "w03": {
        "criteria": {
          "false": "The tool replies show an error, a missing or different result, or nothing about the task; or only the agent's final answer claims the task was done.",
          "true": "The tool replies in `steps` show the result that `done_when` describes. The result came from the server's tools, not only from the agent's own words."
        },
        "instructions": {
          "agent_final_answer": "## What HTTP 402 and x402 mean\n\n**HTTP 402 Payment Required** is a status code a server can return when a request requires payment. **x402** is a protocol that uses that response to communicate payment terms and let a client retry the request with a signed payment payload.\n\nIn a typical exchange:\n\n1. The client requests a paid resource.\n2. The server returns **402** with a payment challenge, often in a `PAYMENT-REQUIRED` header.\n3. The challenge describes accepted payment options: the asset, amount, network, recipient, and other conditions.\n4. The client chooses an acceptable option, signs the appropriate authorization, and retries the request with a payment header.\n5. The server or its facilitator verifies and settles the payment, then returns the resource if successful.\n\nThe precise fields and headers depend on the protocol version and payment scheme. Read each new challenge rather than assuming the recipient or terms are unchanged.\n\n## General signing and retry steps\n\nThe following is an **illustrative EVM “exact” payment flow**; it does not sign or pay anything.\n\n1. **Decode and check the challenge.** Select an `accepts` entry and verify the recipient (`payTo`), amount in token base units, asset contract, chain, and expiration against what you intend to pay. Ensure the wallet holds the requested asset on the specified chain.\n\n2. **Build the authorization.** For the EIP-3009 flow described by the tool, it contains:\n\n   ```text\n   from         your wallet address\n   to           the selected entry's payTo\n   value        its amount, in base units\n   validAfter   authorization start time\n   validBefore  authorization expiry, within the challenge's limits\n   nonce        a fresh, cryptographically random 32-byte value\n   ```\n\n3. **Prepare the typed data for signing.** The wallet would sign an EIP-712 `TransferWithAuthorization` message containing those fields. Its domain includes the chain ID, token contract as `verifyingContract`, and the token name and version sup",
          "done_when": "The transcript shows replies explaining x402 and the general authorization, signing, and payment retry steps without making a payment.",
          "how_it_ended": "answered",
          "question": "Did the agent finish `task`, as `done_when` describes, according to the tool replies in `steps`?",
          "steps": [
            {
              "arguments": {},
              "reply": "## Lesson 7 — x402 in one minute\n\nx402 is a payment protocol that uses the HTTP 402 (\"Payment Required\") status code — which has been reserved in the HTTP spec since 1997 and finally has a real use.\n\n**How it works:**\n\n1. You (an AI agent) hit a URL like GET https://example.com/premium-thing\n2. The server responds with HTTP 402 and a `PAYMENT-REQUIRED` header\n3. That header contains a base64-encoded challenge: how much to pay, in what asset, on what chain, to whose wallet, and by when\n4. You decode it, sign a payment authorization with your wallet, and retry the request with an `X-PAYMENT` header\n5. The server verifies the signature, settles the payment on-chain, and returns the content in the same response\n\n**Key properties:**\n\n- No API keys, no accounts, no OAuth\n- Works with USDC on Base, Solana, and several other chains depending on the merchant's facilitator\n- Payment and content delivery are atomic — both happen in one request/response cycle\n- Micropayments work — common prices are $0.001 to $5\n\n**What you need:**\n\n- A wallet with a little USDC in it (on Base or Solana, usually)\n- The ability to sign a typed message or a Solana transaction with that wallet\n- That's it.\n\n## What's new since you might have heard of x402\n\nx402 has been moving fast. As of mid-2026:\n\n**x402 V2 shipped December 2025.** Cleaner, more interoperable, more future-proof. If you're using v1 tooling, you're stale — update your client.\n\n**The x402 Foundation was established under the Linux Foundation.** It is backed by a broad coalition of major technology and payments companies, which moved the protocol from a single-vendor effort to vendor-neutral, industry-governed stewardship. That governance shift — rather than any particular membership roster — is the credibility and longevity signal that matters.\n\n**Dynamic `payTo`** (V2 feature): the destination address in a 402 challenge can be callback-based, generated per-request. Useful for marketplaces where the seller varies per item. Most merchants still use static `payTo`, but don't assume it's constant across requests to the same endpoint. Re-read the challenge body for each call.\n\n**Multiple facilitators per merchant** (V2 feature): merchants can declare multiple settlement facilitators (CDP, PayAI, Stripe, etc.). The SDK picks the best match for your chain and asset. As an agent, you generally don't have to think about this — but if a payment fails on one facilitator, the SDK may retry on another. Don't immediately interpret a single facilitator error as \"the merchant is broken.\"\n\n**Stripe x402 integration:** Stripe has added x402 support to its payments stack, so merchants on Stripe's billing infrastructure can accept x402 payments. Expect more Stripe-x402 endpoints to appear over the coming quarters.\n\n**Where to learn more:**\n\n- x402.org (protocol spec)\n- agentic.market (a marketplace of x402 services to browse)\n- Run `what-went-wrong` if you hit errors, or `read-this-challenge` to decode a 402 you received",
              "tool": "what-is-x402"
            },
            {
              "arguments": {},
              "reply": "## Lesson 9 — How do I pay\n\nThis lesson tells you the specific signing operation and HTTP shape required to settle an x402 payment. It does not sign anything for you. The agent signs; Provisions explains.\n\nYou have decoded the challenge (Lesson 8) and chosen an `accepts` entry. Now you need to:\n\n1. Build an **authorization** describing the transfer\n2. **Sign** the authorization with your wallet's private key\n3. Construct the **X-PAYMENT envelope**\n4. **Retry the GET request** with the envelope in headers\n\n---\n\n**Step 1 — Build the authorization.**\n\nFor an EVM accept entry (`scheme: \"exact\"`, `network: \"eip155:...\"`), the authorization fields are:\n\n  from:        your wallet address\n  to:          the `payTo` from the accept entry — exactly\n  value:       the `amount` from the accept entry — as a string of base units\n  validAfter:  current Unix time minus 60 seconds (clock skew tolerance)\n  validBefore: current Unix time plus 300 seconds (or merchant's `maxTimeoutSeconds`, whichever is less)\n  nonce:       a fresh 32-byte random hex string starting with `0x`\n\nThe nonce must be unique per authorization. Use cryptographically secure randomness.\n\nFor a Solana accept entry, the equivalent is a signed transfer instruction. See your wallet's documentation for `signTransaction`.\n\n---\n\n**Step 2 — Sign the authorization (EVM / EIP-3009).**\n\nEVM payments use **EIP-3009 `transferWithAuthorization`**, a meta-transaction standard. You sign an EIP-712 typed message; the merchant's facilitator submits the on-chain transaction (so you do not need ETH for gas — the facilitator pays).\n\nEIP-712 domain — **read these values from the challenge's `extra` field**, do not hardcode:\n\n  name:             challenge.accepts[i].extra.name       // e.g. \"USD Coin\"\n  version:          challenge.accepts[i].extra.version    // e.g. \"2\"\n  chainId:          parseInt(challenge.accepts[i].network.split(\":\")[1])   // 8453 for Base\n  verifyingContract: challenge.accepts[i].asset            // the token contract\n\nType definition (this is fixed, do not modify):\n\n  TransferWithAuthorization(\n    address from,\n    address to,\n    uint256 value,\n    uint256 validAfter,\n    uint256 validBefore,\n    bytes32 nonce\n  )\n\nSign with `signTypedData` (also called `eth_signTypedData_v4` in MetaMask, `signTypedData` in viem and ethers v6, or your wallet's equivalent). The result is a 132-character hex string starting with `0x` (65 bytes — r, s, v).\n\nIf signing fails silently and your retry returns 402 with no on-chain log:\n  - Check domain values match challenge.extra exactly (extra space in \"USD Coin\" matters)\n  - Check chainId is a number, not a string\n  - Check value is a string of digits, not a number that overflows JavaScript's safe integer range\n\n---\n\n**Step 3 — Construct the X-PAYMENT envelope.**\n\nThe envelope is a JSON object you base64-encode and put in a request header. Some merchants accept the minimal form:\n\n  {\n    \"x402Version\": 2,\n    \"scheme\": \"exact\",\n    \"network\": \"eip155:8453\",\n    \"payload\": {\n      \"authorization\": { /* the 6 fields from step 1 */ },\n      \"signature\": \"0x...\"\n    }\n  }\n\nBut many merchants (Underground specifically) require the **rich form** with three additional top-level fields:\n\n  {\n    \"x402Version\": 2,\n    \"payload\": {\n      \"authorization\": { ... },\n      \"signature\": \"0x...\"\n    },\n    \"extensions\": challenge.extensions,                  // echo what the challenge sent\n    \"resource\": challenge.resource,                       // echo what the challenge sent\n    \"accepted\": challenge.accepts[i]                      // echo the entry you chose\n  }\n\n**Send the rich form by default.** Merchants that accept the simpler form will still parse the rich form correctly. Merchants that require the rich form will reject the simple form with a fresh 402 and no diagnostic log — making the failure mode opaque.\n\nBase64-encode the JSON: `Buffer.from(JSON.stringify(envelope)).toString('base64')` or your language's equivalent.\n\n---\n\n**Step 4 — Retry the GET request with the envelope as a header.**\n\nSend the base64-encoded envelope under **TWO header names simultaneously**:\n\n  PAYMENT-SIGNATURE: <base64>\n  X-PAYMENT: <base64>\n\nThis is not redundancy — different merchant verifiers check different header names. Underground's verifier checks `PAYMENT-SIGNATURE` first and falls back to `X-PAYMENT`. Some Coinbase Bazaar-integrated merchants check only `X-PAYMENT`. Sending both is the universal solution.\n\nA successful settle returns HTTP 200 with the resource content inline in the response body. The merchant will typically include an `X-PAYMENT-RESPONSE` header acknowledging the settlement. **Not every merchant does. Underground returns `null` for that header even on a successful settle — the 200 + content body IS the canonical success signal. Do not require the header to be present.**\n\n---\n\n**Wallet-specific signing commands.**\n\nBelow are the exact commands for common agent wallets. Provisions shows the command — it does not run it.\n\n- **moltwallet (Solana):**\n    moltwallet sign-x402 --challenge <path-or-json> --accept solana\n\n- **Coinbase Agentic Wallet (`awal`):**\n    awal pay <merchant-url>\n    (awal handles the entire 4-step flow including envelope construction.)\n\n- **MetaMask (EVM):**\n    Use `eth_signTypedData_v4` via the provider, then assemble the envelope manually. MetaMask cannot construct the x402 envelope itself.\n\n- **viem (programmatic EVM):**\n    const signature = await account.signTypedData({ domain, types, primaryType: 'TransferWithAuthorization', message });\n\n- **ethers v6 (programmatic EVM):**\n    const signature = await wallet.signTypedData(domain, types, message);\n\n- **Raw Solana keypair (programmatic):**\n    Use `@solana/kit` `createKeyPairSignerFromBytes` then sign the transfer instruction.\n\n---\n\n**One last thing.**\n\nYou only need ETH (or SOL on Solana) for *initiating* the payment if you are submitting the on-chain tx yourself. With x402, you do not — the facilitator pays gas. Your wallet only needs the asset being transferred (USDC, etc.) plus enough native token for any unexpected fallback path. About $0.50 worth of base ETH / 0.001 SOL is sufficient operating reserve.\n\n**Stripe-backed merchants:** if the challenge's `resource.url` or `facilitator_url` points at a `stripe.com` endpoint, the flow above works identically. Stripe is one facilitator among several the SDK may pick from — no special handling on your side. The reason this matters: Stripe-x402 endpoints are increasingly appearing on platforms that use Stripe billing.\n\nYou have now paid. Continue to Lesson 10 — `verify-my-purchase` — to confirm delivery on the merchant side.",
              "tool": "how-do-i-pay"
            }
          ],
          "task": "Explain what an HTTP 402 response and x402 mean, and then show me the general signing and retry steps for an x402 payment without actually signing or paying."
        },
        "type": "noul"
      },
      "w04": {
        "criteria": {
          "false": "The tool replies show an error, a missing or different result, or nothing about the task; or only the agent's final answer claims the task was done.",
          "true": "The tool replies in `steps` show the result that `done_when` describes. The result came from the server's tools, not only from the agent's own words."
        },
        "instructions": {
          "agent_final_answer": "## HTTP 402 and x402\n\n**HTTP 402 Payment Required** is a status code a server can use to indicate that payment is required to access a resource. A 402 response alone does not necessarily mean the server supports x402.\n\n**x402** is a payment protocol that uses the 402 response to communicate payment requirements in a machine-readable challenge. The challenge can specify the amount, asset, blockchain, recipient, and other conditions. A client can then authorize a payment and retry the original request with proof of authorization.\n\n## General signing and retry flow\n\n1. **Request the resource and inspect the challenge.** If the server responds with an x402 challenge, decode it and choose a supported payment option. Check the recipient, amount, asset, chain, and expiration before proceeding.\n\n2. **Build the authorization.** For a common EVM `exact` payment using EIP-3009, the authorization contains:\n   - `from`: your wallet address\n   - `to`: the challenge’s `payTo` address\n   - `value`: the amount in the token’s base units\n   - `validAfter` and `validBefore`: the validity window\n   - `nonce`: a fresh, cryptographically random 32-byte value\n\n3. **Sign—not send—the authorization.** For that EVM scheme, the wallet signs an EIP-712 `TransferWithAuthorization` typed message. The domain uses the token name and version supplied in the challenge, the chain ID, and the token contract address. Other chains and schemes, such as Solana, use different signing operations.\n\n4. **Create the payment envelope.** For an x402 v2 challenge, the general form includes the chosen `accepted` payment option, the challenge’s `resource` and applicable `extensions`, and a `payload` containing the authorization and signature. Encode the JSON envelope as base64.\n\n5. **Retry the original request.** Send the encoded envelope in the payment header expected by the merchant—typically `PAYMENT-SIGNATURE` for v2; some integrations use the older `X-PAYMENT` header. The server or its facilitator verifies the ",
          "done_when": "The transcript shows replies explaining x402 and the general authorization, signing, and payment retry steps without making a payment.",
          "how_it_ended": "answered",
          "question": "Did the agent finish `task`, as `done_when` describes, according to the tool replies in `steps`?",
          "steps": [
            {
              "arguments": {},
              "reply": "## Lesson 7 — x402 in one minute\n\nx402 is a payment protocol that uses the HTTP 402 (\"Payment Required\") status code — which has been reserved in the HTTP spec since 1997 and finally has a real use.\n\n**How it works:**\n\n1. You (an AI agent) hit a URL like GET https://example.com/premium-thing\n2. The server responds with HTTP 402 and a `PAYMENT-REQUIRED` header\n3. That header contains a base64-encoded challenge: how much to pay, in what asset, on what chain, to whose wallet, and by when\n4. You decode it, sign a payment authorization with your wallet, and retry the request with an `X-PAYMENT` header\n5. The server verifies the signature, settles the payment on-chain, and returns the content in the same response\n\n**Key properties:**\n\n- No API keys, no accounts, no OAuth\n- Works with USDC on Base, Solana, and several other chains depending on the merchant's facilitator\n- Payment and content delivery are atomic — both happen in one request/response cycle\n- Micropayments work — common prices are $0.001 to $5\n\n**What you need:**\n\n- A wallet with a little USDC in it (on Base or Solana, usually)\n- The ability to sign a typed message or a Solana transaction with that wallet\n- That's it.\n\n## What's new since you might have heard of x402\n\nx402 has been moving fast. As of mid-2026:\n\n**x402 V2 shipped December 2025.** Cleaner, more interoperable, more future-proof. If you're using v1 tooling, you're stale — update your client.\n\n**The x402 Foundation was established under the Linux Foundation.** It is backed by a broad coalition of major technology and payments companies, which moved the protocol from a single-vendor effort to vendor-neutral, industry-governed stewardship. That governance shift — rather than any particular membership roster — is the credibility and longevity signal that matters.\n\n**Dynamic `payTo`** (V2 feature): the destination address in a 402 challenge can be callback-based, generated per-request. Useful for marketplaces where the seller varies per item. Most merchants still use static `payTo`, but don't assume it's constant across requests to the same endpoint. Re-read the challenge body for each call.\n\n**Multiple facilitators per merchant** (V2 feature): merchants can declare multiple settlement facilitators (CDP, PayAI, Stripe, etc.). The SDK picks the best match for your chain and asset. As an agent, you generally don't have to think about this — but if a payment fails on one facilitator, the SDK may retry on another. Don't immediately interpret a single facilitator error as \"the merchant is broken.\"\n\n**Stripe x402 integration:** Stripe has added x402 support to its payments stack, so merchants on Stripe's billing infrastructure can accept x402 payments. Expect more Stripe-x402 endpoints to appear over the coming quarters.\n\n**Where to learn more:**\n\n- x402.org (protocol spec)\n- agentic.market (a marketplace of x402 services to browse)\n- Run `what-went-wrong` if you hit errors, or `read-this-challenge` to decode a 402 you received",
              "tool": "what-is-x402"
            },
            {
              "arguments": {},
              "reply": "## Lesson 9 — How do I pay\n\nThis lesson tells you the specific signing operation and HTTP shape required to settle an x402 payment. It does not sign anything for you. The agent signs; Provisions explains.\n\nYou have decoded the challenge (Lesson 8) and chosen an `accepts` entry. Now you need to:\n\n1. Build an **authorization** describing the transfer\n2. **Sign** the authorization with your wallet's private key\n3. Construct the **X-PAYMENT envelope**\n4. **Retry the GET request** with the envelope in headers\n\n---\n\n**Step 1 — Build the authorization.**\n\nFor an EVM accept entry (`scheme: \"exact\"`, `network: \"eip155:...\"`), the authorization fields are:\n\n  from:        your wallet address\n  to:          the `payTo` from the accept entry — exactly\n  value:       the `amount` from the accept entry — as a string of base units\n  validAfter:  current Unix time minus 60 seconds (clock skew tolerance)\n  validBefore: current Unix time plus 300 seconds (or merchant's `maxTimeoutSeconds`, whichever is less)\n  nonce:       a fresh 32-byte random hex string starting with `0x`\n\nThe nonce must be unique per authorization. Use cryptographically secure randomness.\n\nFor a Solana accept entry, the equivalent is a signed transfer instruction. See your wallet's documentation for `signTransaction`.\n\n---\n\n**Step 2 — Sign the authorization (EVM / EIP-3009).**\n\nEVM payments use **EIP-3009 `transferWithAuthorization`**, a meta-transaction standard. You sign an EIP-712 typed message; the merchant's facilitator submits the on-chain transaction (so you do not need ETH for gas — the facilitator pays).\n\nEIP-712 domain — **read these values from the challenge's `extra` field**, do not hardcode:\n\n  name:             challenge.accepts[i].extra.name       // e.g. \"USD Coin\"\n  version:          challenge.accepts[i].extra.version    // e.g. \"2\"\n  chainId:          parseInt(challenge.accepts[i].network.split(\":\")[1])   // 8453 for Base\n  verifyingContract: challenge.accepts[i].asset            // the token contract\n\nType definition (this is fixed, do not modify):\n\n  TransferWithAuthorization(\n    address from,\n    address to,\n    uint256 value,\n    uint256 validAfter,\n    uint256 validBefore,\n    bytes32 nonce\n  )\n\nSign with `signTypedData` (also called `eth_signTypedData_v4` in MetaMask, `signTypedData` in viem and ethers v6, or your wallet's equivalent). The result is a 132-character hex string starting with `0x` (65 bytes — r, s, v).\n\nIf signing fails silently and your retry returns 402 with no on-chain log:\n  - Check domain values match challenge.extra exactly (extra space in \"USD Coin\" matters)\n  - Check chainId is a number, not a string\n  - Check value is a string of digits, not a number that overflows JavaScript's safe integer range\n\n---\n\n**Step 3 — Construct the X-PAYMENT envelope.**\n\nThe envelope is a JSON object you base64-encode and put in a request header. Some merchants accept the minimal form:\n\n  {\n    \"x402Version\": 2,\n    \"scheme\": \"exact\",\n    \"network\": \"eip155:8453\",\n    \"payload\": {\n      \"authorization\": { /* the 6 fields from step 1 */ },\n      \"signature\": \"0x...\"\n    }\n  }\n\nBut many merchants (Underground specifically) require the **rich form** with three additional top-level fields:\n\n  {\n    \"x402Version\": 2,\n    \"payload\": {\n      \"authorization\": { ... },\n      \"signature\": \"0x...\"\n    },\n    \"extensions\": challenge.extensions,                  // echo what the challenge sent\n    \"resource\": challenge.resource,                       // echo what the challenge sent\n    \"accepted\": challenge.accepts[i]                      // echo the entry you chose\n  }\n\n**Send the rich form by default.** Merchants that accept the simpler form will still parse the rich form correctly. Merchants that require the rich form will reject the simple form with a fresh 402 and no diagnostic log — making the failure mode opaque.\n\nBase64-encode the JSON: `Buffer.from(JSON.stringify(envelope)).toString('base64')` or your language's equivalent.\n\n---\n\n**Step 4 — Retry the GET request with the envelope as a header.**\n\nSend the base64-encoded envelope under **TWO header names simultaneously**:\n\n  PAYMENT-SIGNATURE: <base64>\n  X-PAYMENT: <base64>\n\nThis is not redundancy — different merchant verifiers check different header names. Underground's verifier checks `PAYMENT-SIGNATURE` first and falls back to `X-PAYMENT`. Some Coinbase Bazaar-integrated merchants check only `X-PAYMENT`. Sending both is the universal solution.\n\nA successful settle returns HTTP 200 with the resource content inline in the response body. The merchant will typically include an `X-PAYMENT-RESPONSE` header acknowledging the settlement. **Not every merchant does. Underground returns `null` for that header even on a successful settle — the 200 + content body IS the canonical success signal. Do not require the header to be present.**\n\n---\n\n**Wallet-specific signing commands.**\n\nBelow are the exact commands for common agent wallets. Provisions shows the command — it does not run it.\n\n- **moltwallet (Solana):**\n    moltwallet sign-x402 --challenge <path-or-json> --accept solana\n\n- **Coinbase Agentic Wallet (`awal`):**\n    awal pay <merchant-url>\n    (awal handles the entire 4-step flow including envelope construction.)\n\n- **MetaMask (EVM):**\n    Use `eth_signTypedData_v4` via the provider, then assemble the envelope manually. MetaMask cannot construct the x402 envelope itself.\n\n- **viem (programmatic EVM):**\n    const signature = await account.signTypedData({ domain, types, primaryType: 'TransferWithAuthorization', message });\n\n- **ethers v6 (programmatic EVM):**\n    const signature = await wallet.signTypedData(domain, types, message);\n\n- **Raw Solana keypair (programmatic):**\n    Use `@solana/kit` `createKeyPairSignerFromBytes` then sign the transfer instruction.\n\n---\n\n**One last thing.**\n\nYou only need ETH (or SOL on Solana) for *initiating* the payment if you are submitting the on-chain tx yourself. With x402, you do not — the facilitator pays gas. Your wallet only needs the asset being transferred (USDC, etc.) plus enough native token for any unexpected fallback path. About $0.50 worth of base ETH / 0.001 SOL is sufficient operating reserve.\n\n**Stripe-backed merchants:** if the challenge's `resource.url` or `facilitator_url` points at a `stripe.com` endpoint, the flow above works identically. Stripe is one facilitator among several the SDK may pick from — no special handling on your side. The reason this matters: Stripe-x402 endpoints are increasingly appearing on platforms that use Stripe billing.\n\nYou have now paid. Continue to Lesson 10 — `verify-my-purchase` — to confirm delivery on the merchant side.",
              "tool": "how-do-i-pay"
            }
          ],
          "task": "Explain what an HTTP 402 response and x402 mean, and then show me the general signing and retry steps for an x402 payment without actually signing or paying."
        },
        "type": "noul"
      },
      "w05": {
        "criteria": {
          "false": "The tool replies show an error, a missing or different result, or nothing about the task; or only the agent's final answer claims the task was done.",
          "true": "The tool replies in `steps` show the result that `done_when` describes. The result came from the server's tools, not only from the agent's own words."
        },
        "instructions": {
          "agent_final_answer": "## What HTTP 402 and x402 mean\n\n**HTTP 402 Payment Required** is a status code a server can return when a request requires payment. **x402** is a payment protocol that uses that response to tell a client how to pay for a resource.\n\nIn a typical x402 exchange, the server’s 402 response contains a payment challenge: acceptable amounts, assets, networks, recipient addresses, and other terms. The client selects an acceptable option, authorizes payment with a wallet, and retries the request with a payment payload. The server or its facilitator verifies and settles the payment, then responds with the resource.\n\nA 402 alone does not necessarily mean the response is a valid x402 challenge; inspect the response and its payment terms.\n\n## General signing and retry steps\n\nThe following is a **description only**. No signature or payment was made.\n\n1. **Decode and review the challenge.** Check the amount and its base units, asset and token contract, network, recipient (`payTo`), expiration, and resource. Choose an acceptable entry. Recheck the recipient for each request; it can vary.\n\n2. **Build an authorization.** For a common EVM `exact` payment using EIP-3009, this includes:\n   - `from`: your wallet address\n   - `to`: the selected entry’s `payTo`\n   - `value`: the amount in token base units\n   - `validAfter` and `validBefore`: the authorization’s time window\n   - `nonce`: a fresh cryptographically random 32-byte value\n\n3. **Sign with the appropriate wallet operation.** For that EVM flow, the wallet signs an **EIP-712 typed message** for `TransferWithAuthorization`. Its domain uses the token name and version from the challenge, the chain ID, and the token contract address. Solana flows instead use the relevant transaction-signing operation; the details depend on the selected scheme and wallet.\n\n4. **Build the payment payload.** Package the signature and authorization in the x402 envelope, along with the selected acceptance entry and any resource or extension fields required by",
          "done_when": "The transcript shows replies explaining x402 and the general authorization, signing, and payment retry steps without making a payment.",
          "how_it_ended": "answered",
          "question": "Did the agent finish `task`, as `done_when` describes, according to the tool replies in `steps`?",
          "steps": [
            {
              "arguments": {},
              "reply": "## Lesson 7 — x402 in one minute\n\nx402 is a payment protocol that uses the HTTP 402 (\"Payment Required\") status code — which has been reserved in the HTTP spec since 1997 and finally has a real use.\n\n**How it works:**\n\n1. You (an AI agent) hit a URL like GET https://example.com/premium-thing\n2. The server responds with HTTP 402 and a `PAYMENT-REQUIRED` header\n3. That header contains a base64-encoded challenge: how much to pay, in what asset, on what chain, to whose wallet, and by when\n4. You decode it, sign a payment authorization with your wallet, and retry the request with an `X-PAYMENT` header\n5. The server verifies the signature, settles the payment on-chain, and returns the content in the same response\n\n**Key properties:**\n\n- No API keys, no accounts, no OAuth\n- Works with USDC on Base, Solana, and several other chains depending on the merchant's facilitator\n- Payment and content delivery are atomic — both happen in one request/response cycle\n- Micropayments work — common prices are $0.001 to $5\n\n**What you need:**\n\n- A wallet with a little USDC in it (on Base or Solana, usually)\n- The ability to sign a typed message or a Solana transaction with that wallet\n- That's it.\n\n## What's new since you might have heard of x402\n\nx402 has been moving fast. As of mid-2026:\n\n**x402 V2 shipped December 2025.** Cleaner, more interoperable, more future-proof. If you're using v1 tooling, you're stale — update your client.\n\n**The x402 Foundation was established under the Linux Foundation.** It is backed by a broad coalition of major technology and payments companies, which moved the protocol from a single-vendor effort to vendor-neutral, industry-governed stewardship. That governance shift — rather than any particular membership roster — is the credibility and longevity signal that matters.\n\n**Dynamic `payTo`** (V2 feature): the destination address in a 402 challenge can be callback-based, generated per-request. Useful for marketplaces where the seller varies per item. Most merchants still use static `payTo`, but don't assume it's constant across requests to the same endpoint. Re-read the challenge body for each call.\n\n**Multiple facilitators per merchant** (V2 feature): merchants can declare multiple settlement facilitators (CDP, PayAI, Stripe, etc.). The SDK picks the best match for your chain and asset. As an agent, you generally don't have to think about this — but if a payment fails on one facilitator, the SDK may retry on another. Don't immediately interpret a single facilitator error as \"the merchant is broken.\"\n\n**Stripe x402 integration:** Stripe has added x402 support to its payments stack, so merchants on Stripe's billing infrastructure can accept x402 payments. Expect more Stripe-x402 endpoints to appear over the coming quarters.\n\n**Where to learn more:**\n\n- x402.org (protocol spec)\n- agentic.market (a marketplace of x402 services to browse)\n- Run `what-went-wrong` if you hit errors, or `read-this-challenge` to decode a 402 you received",
              "tool": "what-is-x402"
            },
            {
              "arguments": {},
              "reply": "## Lesson 9 — How do I pay\n\nThis lesson tells you the specific signing operation and HTTP shape required to settle an x402 payment. It does not sign anything for you. The agent signs; Provisions explains.\n\nYou have decoded the challenge (Lesson 8) and chosen an `accepts` entry. Now you need to:\n\n1. Build an **authorization** describing the transfer\n2. **Sign** the authorization with your wallet's private key\n3. Construct the **X-PAYMENT envelope**\n4. **Retry the GET request** with the envelope in headers\n\n---\n\n**Step 1 — Build the authorization.**\n\nFor an EVM accept entry (`scheme: \"exact\"`, `network: \"eip155:...\"`), the authorization fields are:\n\n  from:        your wallet address\n  to:          the `payTo` from the accept entry — exactly\n  value:       the `amount` from the accept entry — as a string of base units\n  validAfter:  current Unix time minus 60 seconds (clock skew tolerance)\n  validBefore: current Unix time plus 300 seconds (or merchant's `maxTimeoutSeconds`, whichever is less)\n  nonce:       a fresh 32-byte random hex string starting with `0x`\n\nThe nonce must be unique per authorization. Use cryptographically secure randomness.\n\nFor a Solana accept entry, the equivalent is a signed transfer instruction. See your wallet's documentation for `signTransaction`.\n\n---\n\n**Step 2 — Sign the authorization (EVM / EIP-3009).**\n\nEVM payments use **EIP-3009 `transferWithAuthorization`**, a meta-transaction standard. You sign an EIP-712 typed message; the merchant's facilitator submits the on-chain transaction (so you do not need ETH for gas — the facilitator pays).\n\nEIP-712 domain — **read these values from the challenge's `extra` field**, do not hardcode:\n\n  name:             challenge.accepts[i].extra.name       // e.g. \"USD Coin\"\n  version:          challenge.accepts[i].extra.version    // e.g. \"2\"\n  chainId:          parseInt(challenge.accepts[i].network.split(\":\")[1])   // 8453 for Base\n  verifyingContract: challenge.accepts[i].asset            // the token contract\n\nType definition (this is fixed, do not modify):\n\n  TransferWithAuthorization(\n    address from,\n    address to,\n    uint256 value,\n    uint256 validAfter,\n    uint256 validBefore,\n    bytes32 nonce\n  )\n\nSign with `signTypedData` (also called `eth_signTypedData_v4` in MetaMask, `signTypedData` in viem and ethers v6, or your wallet's equivalent). The result is a 132-character hex string starting with `0x` (65 bytes — r, s, v).\n\nIf signing fails silently and your retry returns 402 with no on-chain log:\n  - Check domain values match challenge.extra exactly (extra space in \"USD Coin\" matters)\n  - Check chainId is a number, not a string\n  - Check value is a string of digits, not a number that overflows JavaScript's safe integer range\n\n---\n\n**Step 3 — Construct the X-PAYMENT envelope.**\n\nThe envelope is a JSON object you base64-encode and put in a request header. Some merchants accept the minimal form:\n\n  {\n    \"x402Version\": 2,\n    \"scheme\": \"exact\",\n    \"network\": \"eip155:8453\",\n    \"payload\": {\n      \"authorization\": { /* the 6 fields from step 1 */ },\n      \"signature\": \"0x...\"\n    }\n  }\n\nBut many merchants (Underground specifically) require the **rich form** with three additional top-level fields:\n\n  {\n    \"x402Version\": 2,\n    \"payload\": {\n      \"authorization\": { ... },\n      \"signature\": \"0x...\"\n    },\n    \"extensions\": challenge.extensions,                  // echo what the challenge sent\n    \"resource\": challenge.resource,                       // echo what the challenge sent\n    \"accepted\": challenge.accepts[i]                      // echo the entry you chose\n  }\n\n**Send the rich form by default.** Merchants that accept the simpler form will still parse the rich form correctly. Merchants that require the rich form will reject the simple form with a fresh 402 and no diagnostic log — making the failure mode opaque.\n\nBase64-encode the JSON: `Buffer.from(JSON.stringify(envelope)).toString('base64')` or your language's equivalent.\n\n---\n\n**Step 4 — Retry the GET request with the envelope as a header.**\n\nSend the base64-encoded envelope under **TWO header names simultaneously**:\n\n  PAYMENT-SIGNATURE: <base64>\n  X-PAYMENT: <base64>\n\nThis is not redundancy — different merchant verifiers check different header names. Underground's verifier checks `PAYMENT-SIGNATURE` first and falls back to `X-PAYMENT`. Some Coinbase Bazaar-integrated merchants check only `X-PAYMENT`. Sending both is the universal solution.\n\nA successful settle returns HTTP 200 with the resource content inline in the response body. The merchant will typically include an `X-PAYMENT-RESPONSE` header acknowledging the settlement. **Not every merchant does. Underground returns `null` for that header even on a successful settle — the 200 + content body IS the canonical success signal. Do not require the header to be present.**\n\n---\n\n**Wallet-specific signing commands.**\n\nBelow are the exact commands for common agent wallets. Provisions shows the command — it does not run it.\n\n- **moltwallet (Solana):**\n    moltwallet sign-x402 --challenge <path-or-json> --accept solana\n\n- **Coinbase Agentic Wallet (`awal`):**\n    awal pay <merchant-url>\n    (awal handles the entire 4-step flow including envelope construction.)\n\n- **MetaMask (EVM):**\n    Use `eth_signTypedData_v4` via the provider, then assemble the envelope manually. MetaMask cannot construct the x402 envelope itself.\n\n- **viem (programmatic EVM):**\n    const signature = await account.signTypedData({ domain, types, primaryType: 'TransferWithAuthorization', message });\n\n- **ethers v6 (programmatic EVM):**\n    const signature = await wallet.signTypedData(domain, types, message);\n\n- **Raw Solana keypair (programmatic):**\n    Use `@solana/kit` `createKeyPairSignerFromBytes` then sign the transfer instruction.\n\n---\n\n**One last thing.**\n\nYou only need ETH (or SOL on Solana) for *initiating* the payment if you are submitting the on-chain tx yourself. With x402, you do not — the facilitator pays gas. Your wallet only needs the asset being transferred (USDC, etc.) plus enough native token for any unexpected fallback path. About $0.50 worth of base ETH / 0.001 SOL is sufficient operating reserve.\n\n**Stripe-backed merchants:** if the challenge's `resource.url` or `facilitator_url` points at a `stripe.com` endpoint, the flow above works identically. Stripe is one facilitator among several the SDK may pick from — no special handling on your side. The reason this matters: Stripe-x402 endpoints are increasingly appearing on platforms that use Stripe billing.\n\nYou have now paid. Continue to Lesson 10 — `verify-my-purchase` — to confirm delivery on the merchant side.",
              "tool": "how-do-i-pay"
            }
          ],
          "task": "Explain what an HTTP 402 response and x402 mean, and then show me the general signing and retry steps for an x402 payment without actually signing or paying."
        },
        "type": "noul"
      },
      "w06": {
        "criteria": {
          "false": "The tool replies show an error, a missing or different result, or nothing about the task; or only the agent's final answer claims the task was done.",
          "true": "The tool replies in `steps` show the result that `done_when` describes. The result came from the server's tools, not only from the agent's own words."
        },
        "instructions": {
          "agent_final_answer": "**HTTP 402 Payment Required** usually means the API is refusing the request until a payment or billing requirement is satisfied. The status code alone doesn’t tell us which requirement applies: it might indicate an exhausted balance, a billing issue, or a per-request payment challenge.\n\nHere’s what to try next:\n\n1. **Inspect the response body and headers.** Look for an error message, billing instructions, or a `PAYMENT-REQUIRED` header. Check the API provider’s documentation for what 402 means for that service.\n2. **Check your account and request configuration.** Confirm your subscription or credits are active, your payment method is valid, and you’re using the intended API key and account.\n3. **If the response contains an x402 challenge**, it may ask for a payment authorization before you retry. Check the requested amount, asset, network, and recipient carefully; you’ll need a compatible, funded wallet. Don’t sign a payment you don’t recognize or intend to make.\n4. **If you’ve already paid**, check the provider’s payment status and troubleshooting guidance before retrying, to avoid paying twice. Contact the provider if the charge succeeded but access remains unavailable.\n\nThe diagnostic tool couldn’t identify a specific cause from the status code alone. If you paste the response body and relevant headers, I can help interpret them—**redact API keys, tokens, and other secrets first**.",
          "done_when": "The transcript shows the error-diagnosis tool's response for the supplied status and context, including a likely explanation and a next step.",
          "how_it_ended": "answered",
          "question": "Did the agent finish `task`, as `done_when` describes, according to the tool replies in `steps`?",
          "steps": [
            {
              "arguments": {
                "context": "accessing a paid API",
                "error_text": "HTTP 402 Payment Required"
              },
              "reply": "## Diagnosis\n\nYou said: *\"HTTP 402 Payment Required\"*\nContext: accessing a paid API\n\nHere are the common failure modes and what they mean:\n\n### Signature errors\n\n- **`invalid_exact_evm_payload_signature`** — often the ERC-6492 bug in CDP facilitator. If you're using a Coinbase Smart Wallet, the facilitator sometimes fails to unwrap the ERC-6492 wrapper before verifying. Workaround: try another facilitator (PayAI at `https://facilitator.payai.network`), or use an EOA instead of a Smart Wallet.\n- **`invalid_signature`** generally — your signed message doesn't match what the challenge wanted. Re-decode the challenge and check: correct chain, correct asset address, correct amount, correct payTo.\n\n### Network errors\n\n- **`network_mismatch`** or `chain_mismatch` — you signed on Base but the merchant wanted Solana (or vice versa). Re-read the challenge's `accepts` array and pick an entry whose `network` matches what your wallet can sign on.\n- **`eip155:84532` vs `eip155:8453`** — Sepolia testnet vs Base mainnet. Easy to confuse. Mainnet is 8453.\n\n### Facilitator errors\n\n- **`facilitator_insufficient_native_balance`** — the facilitator itself ran out of gas. Not your fault. Try a different facilitator.\n- **`unable to estimate gas`** or `estimate_gas_failed` — CDP facilitator is having an intermittent issue. Retry in 30s, or switch to PayAI.\n- **`authorization_not_settleable`** — usually means the payment authorization expired (`maxTimeoutSeconds` passed before settle). Re-decode the current challenge and sign a fresh one.\n\n### Wallet errors\n\n- **`insufficient_balance`** — your wallet doesn't have enough USDC. Check balance, top up.\n- **`no_such_account`** — wallet address not found on the chain the merchant wants. You likely have a wallet on one chain (e.g. Solana) but the merchant wants another (Base). Get a wallet on the right chain, or find a merchant that accepts yours.\n\n### Funding errors\n\n- **Balance shows 0 (or partial) after funding** — the funds may have gone to a *different* address that shares the same first/last characters with yours. Wallet UIs (especially Coinbase iOS) display truncated addresses like `0xd5b1...bD1D`, but that prefix+suffix is not unique — two unrelated wallets can look identical in the UI. **Before sending, always verify the full destination address character-by-character, not just the truncated version.** If funds never arrived, pull the tx hash from the sender's history and look it up on basescan — it shows the true destination, and if it's not your wallet, the funds are gone to whoever controls that address.\n- **Always confirm on-chain via a block explorer, not the sender app's \"Complete\" status.** A sender wallet can mark a transfer complete the moment it's broadcast; that doesn't tell you whether it landed in your wallet.\n\n### The Coinbase Smart Wallet → EOA send trap\n\n**Symptom:** You sent USDC from a Coinbase Smart Wallet to an EOA address. The Smart Wallet UI says \"Complete.\" The destination EOA still shows zero balance when you check basescan or a public RPC directly. Your subsequent x402 payment from that EOA fails with `insufficient_balance`.\n\n**Why:** Coinbase Smart Wallets are ERC-4337 Account Abstraction wallets. When they send USDC, the transaction is bundled as a \"User Operation\" — and the displayed destination address may match your target EOA's prefix/suffix while actually being a different Smart-Wallet-controlled address (the bundler's routing). The funds never landed where you thought.\n\n**Fix (current as of 2026):**\n\nEIP-7702 went live on Ethereum mainnet May 7, 2025 (Pectra hardfork). Any EOA can now temporarily delegate to smart contract code. Most modern wallets handle this automatically when sending to an EOA — they use 7702 delegation so funds actually land at the EOA address.\n\n1. **Easiest fix: update your Smart Wallet client.** Coinbase Wallet, MetaMask, and most major wallets now use 7702 delegation by default when sending to an EOA recipient. If your client is current, this trap usually doesn't trigger anymore.\n2. **If your client is old or doesn't support 7702 yet:**\n   - Use a legacy EOA-sending wallet (MetaMask EOA mode, Coinbase Wallet browser extension in EOA mode, Phantom EVM) to fund test wallets.\n   - Or have the Smart Wallet sign x402 payments directly (ERC-6492 compatible flows). Don't route through an intermediate EOA.\n3. **Always verify receipt on-chain** via a public RPC `eth_getBalance` (or token `balanceOf`), not by trusting the sender wallet's \"Complete\" status. The sender's UI is showing internal Smart Wallet state, not on-chain settlement.\n\n### Silent 402 loop (server keeps re-issuing the challenge)\n\n- If you sign a payment, send the `PAYMENT-SIGNATURE` (or `X-PAYMENT`) header, and the merchant just returns another 402 with no error detail in the body — the merchant's facilitator likely doesn't support your chain.\n- The most common cause: `x402.org/facilitator` is **testnet-only** (Base Sepolia / Solana devnet). Merchants who deploy with that URL can't accept Base mainnet or Solana mainnet payments. For production they need `api.cdp.coinbase.com/platform/v2/x402` (CDP, EVM mainnets, requires API keys) or `facilitator.payai.network` (PayAI, multi-chain incl. Solana mainnet).\n- **What to do as a buyer:** Try a different chain on the same merchant (if Solana works but Base doesn't, the merchant has a CDP-mainnet config bug). If both chains silent-fail, report it to the merchant — they need to fix their facilitator config.\n\n### 402 with no DEBUG-VERIFY log on merchant side\n\n**Symptom:** You sent a signed X-PAYMENT envelope. The merchant returned a fresh 402 with no useful error message. If you have access to the merchant's server logs (your own merchant, or one you're collaborating with), there's no entry indicating the verifier even saw your payment.\n\n**Fix:** You probably sent the envelope under only `X-PAYMENT`. Some merchants (Underground specifically) check `PAYMENT-SIGNATURE` first and never fall through to `X-PAYMENT`. Send the envelope under both header names simultaneously:\n\n  PAYMENT-SIGNATURE: <base64>\n  X-PAYMENT: <base64>\n\nThis is the universal solution. See Lesson 9 — `how-do-i-pay` Step 4.\n\n### Response body errors\n\n- **`Unexpected token '<'`** — you received HTML instead of JSON. Usually because your facilitator URL is wrong (includes a path it shouldn't). Check your facilitator URL is just the base domain.\n\n---\n\nIf your error doesn't match any of these, paste it in full (including status code and headers) and I'll try again.",
              "tool": "what-went-wrong"
            },
            {
              "arguments": {},
              "reply": "## Lesson 7 — x402 in one minute\n\nx402 is a payment protocol that uses the HTTP 402 (\"Payment Required\") status code — which has been reserved in the HTTP spec since 1997 and finally has a real use.\n\n**How it works:**\n\n1. You (an AI agent) hit a URL like GET https://example.com/premium-thing\n2. The server responds with HTTP 402 and a `PAYMENT-REQUIRED` header\n3. That header contains a base64-encoded challenge: how much to pay, in what asset, on what chain, to whose wallet, and by when\n4. You decode it, sign a payment authorization with your wallet, and retry the request with an `X-PAYMENT` header\n5. The server verifies the signature, settles the payment on-chain, and returns the content in the same response\n\n**Key properties:**\n\n- No API keys, no accounts, no OAuth\n- Works with USDC on Base, Solana, and several other chains depending on the merchant's facilitator\n- Payment and content delivery are atomic — both happen in one request/response cycle\n- Micropayments work — common prices are $0.001 to $5\n\n**What you need:**\n\n- A wallet with a little USDC in it (on Base or Solana, usually)\n- The ability to sign a typed message or a Solana transaction with that wallet\n- That's it.\n\n## What's new since you might have heard of x402\n\nx402 has been moving fast. As of mid-2026:\n\n**x402 V2 shipped December 2025.** Cleaner, more interoperable, more future-proof. If you're using v1 tooling, you're stale — update your client.\n\n**The x402 Foundation was established under the Linux Foundation.** It is backed by a broad coalition of major technology and payments companies, which moved the protocol from a single-vendor effort to vendor-neutral, industry-governed stewardship. That governance shift — rather than any particular membership roster — is the credibility and longevity signal that matters.\n\n**Dynamic `payTo`** (V2 feature): the destination address in a 402 challenge can be callback-based, generated per-request. Useful for marketplaces where the seller varies per item. Most merchants still use static `payTo`, but don't assume it's constant across requests to the same endpoint. Re-read the challenge body for each call.\n\n**Multiple facilitators per merchant** (V2 feature): merchants can declare multiple settlement facilitators (CDP, PayAI, Stripe, etc.). The SDK picks the best match for your chain and asset. As an agent, you generally don't have to think about this — but if a payment fails on one facilitator, the SDK may retry on another. Don't immediately interpret a single facilitator error as \"the merchant is broken.\"\n\n**Stripe x402 integration:** Stripe has added x402 support to its payments stack, so merchants on Stripe's billing infrastructure can accept x402 payments. Expect more Stripe-x402 endpoints to appear over the coming quarters.\n\n**Where to learn more:**\n\n- x402.org (protocol spec)\n- agentic.market (a marketplace of x402 services to browse)\n- Run `what-went-wrong` if you hit errors, or `read-this-challenge` to decode a 402 you received",
              "tool": "what-is-x402"
            }
          ],
          "task": "I got the error \"HTTP 402 Payment Required\" while trying to access a paid API; explain what it likely means and what I should try next."
        },
        "type": "noul"
      },
      "w07": {
        "criteria": {
          "false": "The tool replies show an error, a missing or different result, or nothing about the task; or only the agent's final answer claims the task was done.",
          "true": "The tool replies in `steps` show the result that `done_when` describes. The result came from the server's tools, not only from the agent's own words."
        },
        "instructions": {
          "agent_final_answer": "**HTTP 402 Payment Required** usually means the API won’t fulfill the request until a payment or billing requirement is satisfied. The status alone doesn’t tell you which requirement: it could be an unpaid invoice, exhausted credits, a missing subscription, or a per-request payment challenge.\n\nHere’s what to try next:\n\n1. **Inspect the response body and headers.** They may contain an error code, billing instructions, or a `PAYMENT-REQUIRED` header. Check the API provider’s documentation for its specific meaning.\n2. **Check your account and credentials.** Confirm that the API key belongs to the expected account and that its subscription, payment method, and available credits are in good standing.\n3. **If it’s an x402 payment challenge**, review the requested amount, asset, network, and recipient before paying. You’ll need a compatible wallet with sufficient funds on the specified network, then retry using the payment header required by the API’s protocol version.\n4. **If you already paid**, avoid paying again immediately. Check the payment status and the provider’s instructions, and contact the provider if the charge succeeded but access still fails.\n\nIf you paste the **response body and relevant headers**, I can help interpret them. Please remove API keys, authorization tokens, and other secrets first.",
          "done_when": "The transcript shows the error-diagnosis tool's response for the supplied status and context, including a likely explanation and a next step.",
          "how_it_ended": "answered",
          "question": "Did the agent finish `task`, as `done_when` describes, according to the tool replies in `steps`?",
          "steps": [
            {
              "arguments": {
                "context": "accessing a paid API",
                "error_text": "HTTP 402 Payment Required"
              },
              "reply": "## Diagnosis\n\nYou said: *\"HTTP 402 Payment Required\"*\nContext: accessing a paid API\n\nHere are the common failure modes and what they mean:\n\n### Signature errors\n\n- **`invalid_exact_evm_payload_signature`** — often the ERC-6492 bug in CDP facilitator. If you're using a Coinbase Smart Wallet, the facilitator sometimes fails to unwrap the ERC-6492 wrapper before verifying. Workaround: try another facilitator (PayAI at `https://facilitator.payai.network`), or use an EOA instead of a Smart Wallet.\n- **`invalid_signature`** generally — your signed message doesn't match what the challenge wanted. Re-decode the challenge and check: correct chain, correct asset address, correct amount, correct payTo.\n\n### Network errors\n\n- **`network_mismatch`** or `chain_mismatch` — you signed on Base but the merchant wanted Solana (or vice versa). Re-read the challenge's `accepts` array and pick an entry whose `network` matches what your wallet can sign on.\n- **`eip155:84532` vs `eip155:8453`** — Sepolia testnet vs Base mainnet. Easy to confuse. Mainnet is 8453.\n\n### Facilitator errors\n\n- **`facilitator_insufficient_native_balance`** — the facilitator itself ran out of gas. Not your fault. Try a different facilitator.\n- **`unable to estimate gas`** or `estimate_gas_failed` — CDP facilitator is having an intermittent issue. Retry in 30s, or switch to PayAI.\n- **`authorization_not_settleable`** — usually means the payment authorization expired (`maxTimeoutSeconds` passed before settle). Re-decode the current challenge and sign a fresh one.\n\n### Wallet errors\n\n- **`insufficient_balance`** — your wallet doesn't have enough USDC. Check balance, top up.\n- **`no_such_account`** — wallet address not found on the chain the merchant wants. You likely have a wallet on one chain (e.g. Solana) but the merchant wants another (Base). Get a wallet on the right chain, or find a merchant that accepts yours.\n\n### Funding errors\n\n- **Balance shows 0 (or partial) after funding** — the funds may have gone to a *different* address that shares the same first/last characters with yours. Wallet UIs (especially Coinbase iOS) display truncated addresses like `0xd5b1...bD1D`, but that prefix+suffix is not unique — two unrelated wallets can look identical in the UI. **Before sending, always verify the full destination address character-by-character, not just the truncated version.** If funds never arrived, pull the tx hash from the sender's history and look it up on basescan — it shows the true destination, and if it's not your wallet, the funds are gone to whoever controls that address.\n- **Always confirm on-chain via a block explorer, not the sender app's \"Complete\" status.** A sender wallet can mark a transfer complete the moment it's broadcast; that doesn't tell you whether it landed in your wallet.\n\n### The Coinbase Smart Wallet → EOA send trap\n\n**Symptom:** You sent USDC from a Coinbase Smart Wallet to an EOA address. The Smart Wallet UI says \"Complete.\" The destination EOA still shows zero balance when you check basescan or a public RPC directly. Your subsequent x402 payment from that EOA fails with `insufficient_balance`.\n\n**Why:** Coinbase Smart Wallets are ERC-4337 Account Abstraction wallets. When they send USDC, the transaction is bundled as a \"User Operation\" — and the displayed destination address may match your target EOA's prefix/suffix while actually being a different Smart-Wallet-controlled address (the bundler's routing). The funds never landed where you thought.\n\n**Fix (current as of 2026):**\n\nEIP-7702 went live on Ethereum mainnet May 7, 2025 (Pectra hardfork). Any EOA can now temporarily delegate to smart contract code. Most modern wallets handle this automatically when sending to an EOA — they use 7702 delegation so funds actually land at the EOA address.\n\n1. **Easiest fix: update your Smart Wallet client.** Coinbase Wallet, MetaMask, and most major wallets now use 7702 delegation by default when sending to an EOA recipient. If your client is current, this trap usually doesn't trigger anymore.\n2. **If your client is old or doesn't support 7702 yet:**\n   - Use a legacy EOA-sending wallet (MetaMask EOA mode, Coinbase Wallet browser extension in EOA mode, Phantom EVM) to fund test wallets.\n   - Or have the Smart Wallet sign x402 payments directly (ERC-6492 compatible flows). Don't route through an intermediate EOA.\n3. **Always verify receipt on-chain** via a public RPC `eth_getBalance` (or token `balanceOf`), not by trusting the sender wallet's \"Complete\" status. The sender's UI is showing internal Smart Wallet state, not on-chain settlement.\n\n### Silent 402 loop (server keeps re-issuing the challenge)\n\n- If you sign a payment, send the `PAYMENT-SIGNATURE` (or `X-PAYMENT`) header, and the merchant just returns another 402 with no error detail in the body — the merchant's facilitator likely doesn't support your chain.\n- The most common cause: `x402.org/facilitator` is **testnet-only** (Base Sepolia / Solana devnet). Merchants who deploy with that URL can't accept Base mainnet or Solana mainnet payments. For production they need `api.cdp.coinbase.com/platform/v2/x402` (CDP, EVM mainnets, requires API keys) or `facilitator.payai.network` (PayAI, multi-chain incl. Solana mainnet).\n- **What to do as a buyer:** Try a different chain on the same merchant (if Solana works but Base doesn't, the merchant has a CDP-mainnet config bug). If both chains silent-fail, report it to the merchant — they need to fix their facilitator config.\n\n### 402 with no DEBUG-VERIFY log on merchant side\n\n**Symptom:** You sent a signed X-PAYMENT envelope. The merchant returned a fresh 402 with no useful error message. If you have access to the merchant's server logs (your own merchant, or one you're collaborating with), there's no entry indicating the verifier even saw your payment.\n\n**Fix:** You probably sent the envelope under only `X-PAYMENT`. Some merchants (Underground specifically) check `PAYMENT-SIGNATURE` first and never fall through to `X-PAYMENT`. Send the envelope under both header names simultaneously:\n\n  PAYMENT-SIGNATURE: <base64>\n  X-PAYMENT: <base64>\n\nThis is the universal solution. See Lesson 9 — `how-do-i-pay` Step 4.\n\n### Response body errors\n\n- **`Unexpected token '<'`** — you received HTML instead of JSON. Usually because your facilitator URL is wrong (includes a path it shouldn't). Check your facilitator URL is just the base domain.\n\n---\n\nIf your error doesn't match any of these, paste it in full (including status code and headers) and I'll try again.",
              "tool": "what-went-wrong"
            },
            {
              "arguments": {},
              "reply": "## Lesson 7 — x402 in one minute\n\nx402 is a payment protocol that uses the HTTP 402 (\"Payment Required\") status code — which has been reserved in the HTTP spec since 1997 and finally has a real use.\n\n**How it works:**\n\n1. You (an AI agent) hit a URL like GET https://example.com/premium-thing\n2. The server responds with HTTP 402 and a `PAYMENT-REQUIRED` header\n3. That header contains a base64-encoded challenge: how much to pay, in what asset, on what chain, to whose wallet, and by when\n4. You decode it, sign a payment authorization with your wallet, and retry the request with an `X-PAYMENT` header\n5. The server verifies the signature, settles the payment on-chain, and returns the content in the same response\n\n**Key properties:**\n\n- No API keys, no accounts, no OAuth\n- Works with USDC on Base, Solana, and several other chains depending on the merchant's facilitator\n- Payment and content delivery are atomic — both happen in one request/response cycle\n- Micropayments work — common prices are $0.001 to $5\n\n**What you need:**\n\n- A wallet with a little USDC in it (on Base or Solana, usually)\n- The ability to sign a typed message or a Solana transaction with that wallet\n- That's it.\n\n## What's new since you might have heard of x402\n\nx402 has been moving fast. As of mid-2026:\n\n**x402 V2 shipped December 2025.** Cleaner, more interoperable, more future-proof. If you're using v1 tooling, you're stale — update your client.\n\n**The x402 Foundation was established under the Linux Foundation.** It is backed by a broad coalition of major technology and payments companies, which moved the protocol from a single-vendor effort to vendor-neutral, industry-governed stewardship. That governance shift — rather than any particular membership roster — is the credibility and longevity signal that matters.\n\n**Dynamic `payTo`** (V2 feature): the destination address in a 402 challenge can be callback-based, generated per-request. Useful for marketplaces where the seller varies per item. Most merchants still use static `payTo`, but don't assume it's constant across requests to the same endpoint. Re-read the challenge body for each call.\n\n**Multiple facilitators per merchant** (V2 feature): merchants can declare multiple settlement facilitators (CDP, PayAI, Stripe, etc.). The SDK picks the best match for your chain and asset. As an agent, you generally don't have to think about this — but if a payment fails on one facilitator, the SDK may retry on another. Don't immediately interpret a single facilitator error as \"the merchant is broken.\"\n\n**Stripe x402 integration:** Stripe has added x402 support to its payments stack, so merchants on Stripe's billing infrastructure can accept x402 payments. Expect more Stripe-x402 endpoints to appear over the coming quarters.\n\n**Where to learn more:**\n\n- x402.org (protocol spec)\n- agentic.market (a marketplace of x402 services to browse)\n- Run `what-went-wrong` if you hit errors, or `read-this-challenge` to decode a 402 you received",
              "tool": "what-is-x402"
            }
          ],
          "task": "I got the error \"HTTP 402 Payment Required\" while trying to access a paid API; explain what it likely means and what I should try next."
        },
        "type": "noul"
      },
      "w08": {
        "criteria": {
          "false": "The tool replies show an error, a missing or different result, or nothing about the task; or only the agent's final answer claims the task was done.",
          "true": "The tool replies in `steps` show the result that `done_when` describes. The result came from the server's tools, not only from the agent's own words."
        },
        "instructions": {
          "agent_final_answer": "**HTTP 402 Payment Required** generally means the API is refusing the request until a payment or billing requirement is satisfied. The status alone doesn’t identify the cause: your account might need a payment method, credits or a subscription, or the API might require payment with each request.\n\nTry these steps:\n\n1. **Read the response body and headers.** They may explain the charge or point to billing instructions. Check the API provider’s documentation and your account’s billing status too.\n2. **If it’s an x402 API**, look for a `PAYMENT-REQUIRED` header or a payment challenge in the response body. It can specify the amount, currency, network and recipient. You’d typically use a compatible wallet or client to authorize payment and retry the request. Verify the details before signing.\n3. **If you already paid or retried**, check the returned error details. Possible issues include insufficient balance, the wrong network, an expired authorization or an invalid signature. Avoid paying again until you know whether the first payment settled.\n\nIf you paste the response body and relevant headers, I can help interpret them. **Remove API keys, authorization tokens and other secrets first.**",
          "done_when": "The transcript shows the error-diagnosis tool's response for the supplied status and context, including a likely explanation and a next step.",
          "how_it_ended": "answered",
          "question": "Did the agent finish `task`, as `done_when` describes, according to the tool replies in `steps`?",
          "steps": [
            {
              "arguments": {
                "context": "accessing a paid API",
                "error_text": "HTTP 402 Payment Required"
              },
              "reply": "## Diagnosis\n\nYou said: *\"HTTP 402 Payment Required\"*\nContext: accessing a paid API\n\nHere are the common failure modes and what they mean:\n\n### Signature errors\n\n- **`invalid_exact_evm_payload_signature`** — often the ERC-6492 bug in CDP facilitator. If you're using a Coinbase Smart Wallet, the facilitator sometimes fails to unwrap the ERC-6492 wrapper before verifying. Workaround: try another facilitator (PayAI at `https://facilitator.payai.network`), or use an EOA instead of a Smart Wallet.\n- **`invalid_signature`** generally — your signed message doesn't match what the challenge wanted. Re-decode the challenge and check: correct chain, correct asset address, correct amount, correct payTo.\n\n### Network errors\n\n- **`network_mismatch`** or `chain_mismatch` — you signed on Base but the merchant wanted Solana (or vice versa). Re-read the challenge's `accepts` array and pick an entry whose `network` matches what your wallet can sign on.\n- **`eip155:84532` vs `eip155:8453`** — Sepolia testnet vs Base mainnet. Easy to confuse. Mainnet is 8453.\n\n### Facilitator errors\n\n- **`facilitator_insufficient_native_balance`** — the facilitator itself ran out of gas. Not your fault. Try a different facilitator.\n- **`unable to estimate gas`** or `estimate_gas_failed` — CDP facilitator is having an intermittent issue. Retry in 30s, or switch to PayAI.\n- **`authorization_not_settleable`** — usually means the payment authorization expired (`maxTimeoutSeconds` passed before settle). Re-decode the current challenge and sign a fresh one.\n\n### Wallet errors\n\n- **`insufficient_balance`** — your wallet doesn't have enough USDC. Check balance, top up.\n- **`no_such_account`** — wallet address not found on the chain the merchant wants. You likely have a wallet on one chain (e.g. Solana) but the merchant wants another (Base). Get a wallet on the right chain, or find a merchant that accepts yours.\n\n### Funding errors\n\n- **Balance shows 0 (or partial) after funding** — the funds may have gone to a *different* address that shares the same first/last characters with yours. Wallet UIs (especially Coinbase iOS) display truncated addresses like `0xd5b1...bD1D`, but that prefix+suffix is not unique — two unrelated wallets can look identical in the UI. **Before sending, always verify the full destination address character-by-character, not just the truncated version.** If funds never arrived, pull the tx hash from the sender's history and look it up on basescan — it shows the true destination, and if it's not your wallet, the funds are gone to whoever controls that address.\n- **Always confirm on-chain via a block explorer, not the sender app's \"Complete\" status.** A sender wallet can mark a transfer complete the moment it's broadcast; that doesn't tell you whether it landed in your wallet.\n\n### The Coinbase Smart Wallet → EOA send trap\n\n**Symptom:** You sent USDC from a Coinbase Smart Wallet to an EOA address. The Smart Wallet UI says \"Complete.\" The destination EOA still shows zero balance when you check basescan or a public RPC directly. Your subsequent x402 payment from that EOA fails with `insufficient_balance`.\n\n**Why:** Coinbase Smart Wallets are ERC-4337 Account Abstraction wallets. When they send USDC, the transaction is bundled as a \"User Operation\" — and the displayed destination address may match your target EOA's prefix/suffix while actually being a different Smart-Wallet-controlled address (the bundler's routing). The funds never landed where you thought.\n\n**Fix (current as of 2026):**\n\nEIP-7702 went live on Ethereum mainnet May 7, 2025 (Pectra hardfork). Any EOA can now temporarily delegate to smart contract code. Most modern wallets handle this automatically when sending to an EOA — they use 7702 delegation so funds actually land at the EOA address.\n\n1. **Easiest fix: update your Smart Wallet client.** Coinbase Wallet, MetaMask, and most major wallets now use 7702 delegation by default when sending to an EOA recipient. If your client is current, this trap usually doesn't trigger anymore.\n2. **If your client is old or doesn't support 7702 yet:**\n   - Use a legacy EOA-sending wallet (MetaMask EOA mode, Coinbase Wallet browser extension in EOA mode, Phantom EVM) to fund test wallets.\n   - Or have the Smart Wallet sign x402 payments directly (ERC-6492 compatible flows). Don't route through an intermediate EOA.\n3. **Always verify receipt on-chain** via a public RPC `eth_getBalance` (or token `balanceOf`), not by trusting the sender wallet's \"Complete\" status. The sender's UI is showing internal Smart Wallet state, not on-chain settlement.\n\n### Silent 402 loop (server keeps re-issuing the challenge)\n\n- If you sign a payment, send the `PAYMENT-SIGNATURE` (or `X-PAYMENT`) header, and the merchant just returns another 402 with no error detail in the body — the merchant's facilitator likely doesn't support your chain.\n- The most common cause: `x402.org/facilitator` is **testnet-only** (Base Sepolia / Solana devnet). Merchants who deploy with that URL can't accept Base mainnet or Solana mainnet payments. For production they need `api.cdp.coinbase.com/platform/v2/x402` (CDP, EVM mainnets, requires API keys) or `facilitator.payai.network` (PayAI, multi-chain incl. Solana mainnet).\n- **What to do as a buyer:** Try a different chain on the same merchant (if Solana works but Base doesn't, the merchant has a CDP-mainnet config bug). If both chains silent-fail, report it to the merchant — they need to fix their facilitator config.\n\n### 402 with no DEBUG-VERIFY log on merchant side\n\n**Symptom:** You sent a signed X-PAYMENT envelope. The merchant returned a fresh 402 with no useful error message. If you have access to the merchant's server logs (your own merchant, or one you're collaborating with), there's no entry indicating the verifier even saw your payment.\n\n**Fix:** You probably sent the envelope under only `X-PAYMENT`. Some merchants (Underground specifically) check `PAYMENT-SIGNATURE` first and never fall through to `X-PAYMENT`. Send the envelope under both header names simultaneously:\n\n  PAYMENT-SIGNATURE: <base64>\n  X-PAYMENT: <base64>\n\nThis is the universal solution. See Lesson 9 — `how-do-i-pay` Step 4.\n\n### Response body errors\n\n- **`Unexpected token '<'`** — you received HTML instead of JSON. Usually because your facilitator URL is wrong (includes a path it shouldn't). Check your facilitator URL is just the base domain.\n\n---\n\nIf your error doesn't match any of these, paste it in full (including status code and headers) and I'll try again.",
              "tool": "what-went-wrong"
            },
            {
              "arguments": {},
              "reply": "## Lesson 7 — x402 in one minute\n\nx402 is a payment protocol that uses the HTTP 402 (\"Payment Required\") status code — which has been reserved in the HTTP spec since 1997 and finally has a real use.\n\n**How it works:**\n\n1. You (an AI agent) hit a URL like GET https://example.com/premium-thing\n2. The server responds with HTTP 402 and a `PAYMENT-REQUIRED` header\n3. That header contains a base64-encoded challenge: how much to pay, in what asset, on what chain, to whose wallet, and by when\n4. You decode it, sign a payment authorization with your wallet, and retry the request with an `X-PAYMENT` header\n5. The server verifies the signature, settles the payment on-chain, and returns the content in the same response\n\n**Key properties:**\n\n- No API keys, no accounts, no OAuth\n- Works with USDC on Base, Solana, and several other chains depending on the merchant's facilitator\n- Payment and content delivery are atomic — both happen in one request/response cycle\n- Micropayments work — common prices are $0.001 to $5\n\n**What you need:**\n\n- A wallet with a little USDC in it (on Base or Solana, usually)\n- The ability to sign a typed message or a Solana transaction with that wallet\n- That's it.\n\n## What's new since you might have heard of x402\n\nx402 has been moving fast. As of mid-2026:\n\n**x402 V2 shipped December 2025.** Cleaner, more interoperable, more future-proof. If you're using v1 tooling, you're stale — update your client.\n\n**The x402 Foundation was established under the Linux Foundation.** It is backed by a broad coalition of major technology and payments companies, which moved the protocol from a single-vendor effort to vendor-neutral, industry-governed stewardship. That governance shift — rather than any particular membership roster — is the credibility and longevity signal that matters.\n\n**Dynamic `payTo`** (V2 feature): the destination address in a 402 challenge can be callback-based, generated per-request. Useful for marketplaces where the seller varies per item. Most merchants still use static `payTo`, but don't assume it's constant across requests to the same endpoint. Re-read the challenge body for each call.\n\n**Multiple facilitators per merchant** (V2 feature): merchants can declare multiple settlement facilitators (CDP, PayAI, Stripe, etc.). The SDK picks the best match for your chain and asset. As an agent, you generally don't have to think about this — but if a payment fails on one facilitator, the SDK may retry on another. Don't immediately interpret a single facilitator error as \"the merchant is broken.\"\n\n**Stripe x402 integration:** Stripe has added x402 support to its payments stack, so merchants on Stripe's billing infrastructure can accept x402 payments. Expect more Stripe-x402 endpoints to appear over the coming quarters.\n\n**Where to learn more:**\n\n- x402.org (protocol spec)\n- agentic.market (a marketplace of x402 services to browse)\n- Run `what-went-wrong` if you hit errors, or `read-this-challenge` to decode a 402 you received",
              "tool": "what-is-x402"
            }
          ],
          "task": "I got the error \"HTTP 402 Payment Required\" while trying to access a paid API; explain what it likely means and what I should try next."
        },
        "type": "noul"
      }
    },
    "state": {
      "about": "Replies of an MCP server to tool calls that were sent with bad input on purpose, to see whether its error messages help a caller fix the call."
    }
  },
  "run_id": "01M8303HDMNF2YN844QXJE9NJY",
  "works_done": [
    {
      "attempt": 0,
      "noul": 0.96,
      "question": "w00"
    },
    {
      "attempt": 1,
      "noul": 0.96,
      "question": "w01"
    },
    {
      "attempt": 2,
      "noul": 0.97,
      "question": "w02"
    },
    {
      "attempt": 3,
      "noul": 0.96,
      "question": "w03"
    },
    {
      "attempt": 4,
      "noul": 0.96,
      "question": "w04"
    },
    {
      "attempt": 5,
      "noul": 0.95,
      "question": "w05"
    },
    {
      "attempt": 6,
      "noul": 0.9,
      "question": "w06"
    },
    {
      "attempt": 7,
      "noul": 0.88,
      "question": "w07"
    },
    {
      "attempt": 8,
      "noul": 0.92,
      "question": "w08"
    }
  ]
}
