Proofs
Check it without asking us.
Every item below is read live from a public source - the Hedera mirror node, the Whitechain gate, the enrolment registry - and each one links to where a stranger can read it too. Beside each is the code that produces it.
A journal nobody can rewrite
Each decision’s digest is written to a consensus topic that has a submit key and no admin key, so it can be neither edited nor deleted. The replay recomputes the digest from Whitechain’s own logs and compares.
node packages/journal/src/cli.ts replay 0.0.11339027 \ --gate 0x8ec88c90d675594ab969ed1180f8b887dfac1c71
Middleware around x402
The agent’s fetch is wrapped. Each 402 is matched against a mandate a person signed before the wallet is asked to sign anything. The mandate is an order on Whitechain, not a config file.
node --test packages/x402/test/*.test.ts
The endpoint the live scenarios call is a local stand-in for a third-party x402 API. It settles nothing and reports its settlement as simulated.
A payer the middleware cannot be skipped around
A control in the agent’s own process is one the agent can skip. So the agent’s payer account has a threshold key: the agent and a quorum of independent guardians must sign every payment. The facilitator checks that against the key on the ledger, and consensus checks it again.
Each guardian decodes the transaction itself and signs only if it pays exactly what the quote says, to the account the mandate names, within its price and call count.
Verified live against the facilitator: the agent signing alone is refused with invalid_exact_hedera_payload_signature_invalid; the agent plus a guardian quorum is accepted and settles. Run both in Metered spend.
Where the code is
The Hedera integration and the middleware, by file. The repository is private for now, so these are paths rather than links.
- 01packages/journal/src/hcs.tscreateTopic (submit key, no admin key), JournalWriter, QueueingWriter
- 02packages/journal/src/mirror.tsreads the topic from a public mirror node, no credentials
- 03packages/journal/src/replay.tsrecomputes each digest from the chain's logs and compares
- 04packages/gate-core/src/canonical.tsthe 448-byte preimage and the digest both chains carry
- 05packages/x402/src/hedera.tsthreshold-key payer, guardians that decode before they sign
- 06packages/x402/scripts/guardian-setup.tscreates the payer and proves agent-alone is refused
- 07apps/web/app/api/x402/resource/[[...rest]]/route.tsa real x402 v2 resource server using a facilitator
- 08packages/x402/src/middleware.tswithZowall: wraps fetch, never signs a refused quote
- 09packages/x402/src/guard.tsreuses the eleven reason codes unchanged on a 402 quote
- 10packages/x402/src/quote.tsmaps payTo, maxAmountRequired and resource onto an invoice
- 11packages/x402/test/middleware.test.tsthe attacks: unauthorised, payee swap, price hike, replay
- 12apps/web/app/api/x402/guarded/route.tsruns the middleware once and reports what it did
Three different humans, not three wallets
Each person verifies once. The proof is validated on the server, and the nullifier becomes their id. The contract compares those ids, so one person cannot hold two roles on one order.
Separation of duties, on-chain
An order records its creator and its receiver, and the approval records the third person. The most recent held invoice where all three are different is below. If the contract had been given the same person twice it would have reverted.
Where the code is
The proof is only ever turned into an identity on the server. The browser never sends a personId and never receives anything it could forge one from.
- 01apps/web/app/api/world/verify/route.tsthe only place an enrolment is created
- 02packages/world/src/verify.tsforwards the proof to World's verify endpoint, reads the nullifier
- 03packages/world/src/registry.tsthe enrolment registry that survives a restart
- 04packages/world/src/attest.tsquorum-signed EIP-712 attestations, bound to the action
- 05packages/contracts/src/SigLib.solecrecover on the attestation, on-chain
- 06packages/contracts/src/ZowallGate.solreverts SodViolation; checks the quorum and the action hash
- 07packages/contracts/test/Frontrun.t.solthe attacks: a copied attestation cannot be reused for other terms
- 08apps/web/lib/use-world-enroll.tsthe enrolment sequence, shared by both interfaces
The money, and the rules that move it
Orders reserve a real USDT balance, and a matched invoice pays from it in the same transaction. The gate has no withdraw function.
