Urgent.News

What's breaking now, across hundreds of outlets.

Tech

My x402 API got its first real payment. Here is the receipt, and the three things that were actually wrong.

I run a small pay-per-call API on Base. For weeks it had zero paying callers. Hundreds of agents found it, read the docs, got the 402 challenge, and left. I know that because I counted: 2,399 requests in one day, 254 distinct IPs, 783 402 responses, 0 payment headers. Then one payment landed. This is the receipt and the three real defects it exposed. The receipt tx:…

One of the smallest pay-per-call APIs on Base made its first real payment. The receipt is provided, along with three significant issues discovered. The API is hosted on Base mainnet, and the transaction status is 0x1. The asset used for the payment was USDC at the atomic value of 20000, equivalent to $0.02. The payer's address and the recipient's address are also provided. The transaction can be verified directly on the Base mainnet website rather than trusting an email.

Defect 1: The payer paid but received a 400 error response. The payment was confirmed on the chain, but the server returned a 400 Bad Request error. The code_explain task attempted to parse the received text using ast.parse(text). The caller sent a normal sentence, "explain print(sum(range(10)))", which resulted in an invalid syntax error (line 1).

The issue is that the money was taken, but no service was delivered. The solution is to accept both raw source and prose, extract the Python expression from the sentence, explain it, and provide a helpful structured response with a copy-paste example if no parseable code is found. Additionally, a concrete example should be included in the 402 body and schema, as agents often read the example rather than the prose.

Defect 2: All routes had the same description. Despite having 28 catalog rows, all endpoints shared a single generic description, listing summarize, sentiment, translation, code tools, and web_search. However, the bazaar schema declared {"task":"web_search"} while the description mentioned something else. Buyers reading the 402 were misled, thinking the endpoint performed a different job.

This issue is more significant than it appears, as an independent audit of 10,000 public catalog rows found a 14.7% misdescription of products. To address this, each task should have a unique description, a 402 resource, discovery documents, and an OpenAPI schema.

Defect 3: The settlement process bypassed the facilitator. The 402 declared the CDP facilitator, but the first payer settled directly, bypassing the facilitator. The transaction input selector was 0xe3ee160e, which is a direct EIP-3009 call to the USDC contract, bypassing the facilitator. There was no call to the facilitator in the transaction.

While the money arrived, the CDP Bazaar merchant endpoint still reported a total of 0, as a row is written only when a payment settles through the facilitator. It is essential to note that declaring a facilitator in the challenge does not force the payer to use it. This bug caused the most time spent on debugging. When verifying the signed authorization manually, EIP-3009 v normalization can cause issues.

The library may recover address(0) and return an "invalid signature" error without clear explanation. To resolve this, normalize 27/28 in some clients and 0/1 in others before recovery. The single most time-consuming bug was the EIP-3009 v normalization issue. To increase the likelihood of a paid API, fix the issue that charges and fails, provide a precise 402 description of the route, verify how payments actually settle, and publish the receipt when someone pays.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Three spreadsheet errors you can't see by looking at the row

I wrote a checker because I kept missing the same three things. None of them are visible if you read a row on its own. 1. The overwritten formula A row says 300 x 4.80 = 1,500.00.

  • Formula overwritten, altering calculation from 3004.80 to 1,500.00
  • Duplicate item with same document number and quantity, 30 rows apart
  • Unit price error, price entered as 8.50 instead of 0.85

Designing an encrypted USB vault format without inventing any crypto

We needed a way to keep an encrypted copy of a password vault on a USB stick: something you can pull out of the computer at any moment without corrupting it, that reveals as little as possible to…

  • GKDF format uses Argon2id, XChaCha20-Poly1305, HKDF-SHA256, and BLAKE3 for encryption and hashing
  • Format avoids in-place writes using two slot tables and superblocks to prevent data corruption

What Is the Difference Between val and var in Kotlin, and Is val Immutable?

In short: var can be given a new value. val can't. But val only locks the name, not the object behind it. A val list can still grow, and a val property can return a new value each time you read it.

  • Var allows variable reassignment, val does not
  • val locks object reference, not object itself
  • In Android, val misuse can cause view update issues

More from Saturday, 28 November 2026 →