1. The agent pays
It funds an ephemeral wallet, deposits 1 USDC into the Gateway, then buys from four paid endpoints on a timer. Every payment is real; every hook firing is recorded to a run file the agent owns.
2. haia-trace build assembles the receipts
The agent has already exited. This step reads the evidence it left behind — one
Receipt per payment — and could just as well run on another machine.

3. The one that did not close
Across the whole run, 35 receipts. Thirty-four areFULL and one is not:

exceptions block, because no fault was ever observed —
the seller verified and settled the payment, then the connection dropped before
the answer reached the buyer. From where the agent stands, a payment that never
settled and one that settled silently look identical.
So the receipt refuses to decide. It names the milestone that stayed open and
says exactly what was and was not seen. completeness and missing are
machine-readable, which is what lets an agent stop a chain of spending on its own
evidence instead of guessing.
Real wallet, real USDC, real settlement on Arc testnet — the amounts are
fractions of a cent, but nothing here is simulated. Only the buyer is
instrumented: the seller is a separate deployed service, and its own traces are
its own. That is the normal case — you own your side of a payment and nothing
else.
Run it yourself
examples/x402-agent
is the same code path with the money taken out — no chain, no facilitator, no
wallet, so it runs offline in seconds:
@x402/core client, its hooks, the
adapter, the events on disk and the assembler are all the shipped ones.
The same adapters in full applications
Two complete apps run the shipped packages against real infrastructure, one per adapter.arc-nanopayments — x402, both sides
arc-nanopayments is gasless USDC nanopayments on Arc, with an autonomous buyer agent, a Next.js seller and a dashboard. It traces both sides of the payment, and attaches to Circle’s@circle-fin/x402-batching rather than @x402/core: the same one-line attach
against another SDK’s hooks.
The buyer
agent.mts — the agent attaches to its GatewayClient and records as
arc-nanopayments-buyer.The seller
lib/x402.ts — the paywalled routes attach to the gateway middleware and
record as arc-nanopayments-seller.arc-escrow — Circle webhooks, plus the app’s own events
arc-escrow is an escrow-backed work agreement on Arc: deposit, deliverable, evaluation, then release or refund — the operation the shippedescrow-arc template describes. It shows the case one
adapter cannot cover alone. Circle’s notifications witness the money; nothing
outside the app can witness that an agreement exists or that work was judged, so
the app records those itself into the same run directory.
The money half
app/api/webhooks/trace/route.ts — @usehaia/trace-circle verifies,
deduplicates and records Circle deliveries.The obligation half
lib/trace/escrow-events.ts — the app’s own escrow.* events, which no
external witness can produce.haia-trace build --template escrow-arc folds them into one receipt. No custom
template — the shipped one already covers both sources.
The hosted view
Everything above is local — files on disk, a CLI reading them back. The same events can also be mirrored to a Haia Control Plane project as they are recorded, so a run is readable from outside the machine that produced it. It is a copy, not a replacement: the local file stays the source of truth, and adding the sink changes nothing in the payment path. Receipts live under Operation Receipts. Each one carries the same verdict the CLI prints — stages in template order with the witness that closed each, the required milestones nothing closed, and the events the template declares as faults:
A shared demo account on a shared instance — treat anything you send it as
public. Mirroring a run is one extra sink on the
writer you already have.
Next steps
Connect x402
The one-line attach, what gets recorded, and what never does.
Connect Circle
Verify, deduplicate and record webhook v2 deliveries.
What a Receipt is
Stages, evidence, missing, exceptions — the model behind the verdict.
CLI reference
Every command, flag, and the
.trace/ layout.