Shirley XueAll work
Solo BuildHackathonAgent PaymentsAlgorand2026

ValidPay — pay only for valid responses

Problem
x402 is the open standard that lets AI agents pay per API call. Plain x402 settles the payment before anyone knows if the response is valid: bad response, money already gone.
Solution
Validate, then settle. A contract fail withholds the charge — the buyer pays $0 on chain.
Result
Solo build, settling on Algorand Mainnet. Selected for the judged mentoring round — one of 22 teams.
Context

A seller puts the gateway in front of their HTTP API and declares a response contract per route. The gateway calls the upstream, checks the payload against the contract, and settles USDC on Algorand only when it passes; otherwise the charge is withheld. Built for the Brainwave 2026 x402 track.

Buyer side, seller side, and the receipt:

  1. The buyer installs nothing — a normal x402 client against a paid URL.
  2. v1 contracts are mechanical (JSON shape, required fields, reject-on-error) — no LLM judging quality. Deterministic checks first; judgment later, if ever.
  3. Every settlement is publicly provable — the receipt links to the real Mainnet transaction.
Problem

Same payment, different outcome

The whole product is one reordering. In plain x402 the money settles before the response arrives, so a bad or empty response is already paid for. In ValidPay the gateway validates the payload against the seller's contract first, and settles only if the check passes.

Two flows side by side — plain x402: agent pays, USDC settles, bad or empty response, money already gone; ValidPay: agent pays, payload validated, settle only if valid, fail means zero dollars on chainView full size
Plain x402 and ValidPay, side by side
Console

The seller sees settled and withheld charges, live

The first version was a buyer-facing dashboard. Halfway through I asked who the screen was for: in our own story, buyers never know ValidPay exists, so it existed only to impress judges. I dropped it and rebuilt the surface for the seller, the one party who watches settlements.

The seller console reports three numbers: settled charges (USDC received after the contract passed), withheld charges (the response failed your contract; buyer not charged on chain), and upstream errors (your API was unreachable or returned non-JSON). Below them, a live feed pairs every event with its reason (contract passed, handler failed, reject-on-error) and links each settlement to its transaction.

ValidPay seller console on a dark surface — Settled 6, Withheld 4, Upstream errors 0, and a live feed pairing settlements and withheld charges with their contract-check reasons and transaction linksView full size
The seller console · settled and withheld, each with its reason
Proof

Every receipt is on the public blockchain

Each settlement in the feed opens in the Algorand Mainnet explorer. The receipt is a public record, so a buyer can check for themselves that a charge held to the seller's contract.

Algorand Mainnet block explorer showing the real settlement transaction — an asset transfer of 0.001 USDC with sender, receiver, block number and groupView full size
A settlement in the public Mainnet explorer · 0.001 USDC, sender, receiver, block number
Buyer

The buyer's view: reject costs nothing, valid settles

The demo agent buys a weather forecast through the gateway twice. Invalid coordinates: the contract's reject-on-error rule fires, status rejected, nothing settles. Valid Berlin coordinates: a real forecast comes back, the receipt reads paid · validation_passed, and the x402 settlement block carries the payer, the transaction ID and the network, the same transaction the seller's console links to.

Buyer terminal running the weather demo — an invalid-latitude call returns status rejected with reason reject_if:error and no charge, a Berlin forecast returns paid with validation_passed and an x402 settlement block naming the Mainnet transactionView full size
The buyer's terminal · one rejected call, one paid call
Status

Where it stands

A hackathon build, live on Algorand Mainnet with a public repo and a runnable judge demo. The contracts stay mechanical, with no marketplace and no LLM quality judge, because withholding money needs a check both sides can predict.