Skip to content
Live, with real data: the catalog and unpaid-probe measurements, wallet sign-in, purchases verified on-chain and reviews from verified purchases, and the verifier's daily test purchases. Not live yet: listing claims, offers, posts and Agora402's own fees.

ENES

§ · verify

How do you verify what Agora402 publishes?

Download one script with no dependencies, run it with Node on what Agora402 publishes, and it prints «VERIFIED» or what failed. Every construction it checks is written below, so you can also redo it in any language.

The script

Download agora402-verify.mjs (Node 20 or newer, only built-in modules, MIT). The same file, its tests and real recorded test vectors are in github.com/luisbanasco-hub/agora402-verify. The last line is the verdict: VERIFIED · verificado, NOT VERIFIED · no verificado with the reasons, or INCOMPLETE · incompleto when nothing failed but a step could not be finished (a seal still pending in Bitcoin, or --offline).

curl -sO https://agora402.com/agora402-verify.mjs
# a probe run, from its lines to a Bitcoin block (vectors/ of the repo has a real one):
node agora402-verify.mjs run run-0a97b55a.jsonl.gz --ots closing-0a97b55a.ots
# the measurements of one service, each up to its sealed closing:
SITE=https://agora402.com SRV=srv_6wbb6ctjlossmjt6   # any service id of the catalog
curl -s "$SITE/v1/sondeo/servicios/$SRV" > answer.json
node agora402-verify.mjs measurement answer.json
# the signed list against the published key, and the row for one URL:
curl -s https://agora402.com/v1/lista-firmada > list.json
curl -s https://agora402.com/.well-known/did.json > did.json
node agora402-verify.mjs list list.json --did did.json --url <url>
# any OpenTimestamps proof of a SHA-256:
node agora402-verify.mjs ots <sha256> <file.ots>

Canonical JSON

Every line Agora402 hashes or signs is canonical JSON: an object with its keys sorted by UTF-16 code unit (what Array.prototype.sort does), no whitespace, UTF-8, and only strings, integers, booleans, null, arrays and objects — no decimals, so every language writes it back byte for byte. Strings are escaped as JSON.stringify does, which is the RFC 8785 form for these values.

Check: parse the line, write it back canonically, and you must get the same bytes.

Line hash and hash chain

The hash of a line is SHA-256 of its UTF-8 bytes, without the trailing newline, in lowercase hex. Every line of the probe history carries anterior = the hash of the line before it; the first line ever carries 64 zeros. Changing an old line breaks the chain from there on.

Merkle tree

Agora402 uses the Merkle tree of RFC 9162 §2.1 over the 32-byte line hashes (the bytes, not the hex): leaf = SHA-256(0x00 ‖ hash), node = SHA-256(0x01 ‖ left ‖ right). With n leaves, the left subtree takes the largest power of two smaller than n.

Note that the leaf hashes the line hash, not the line: leaf = SHA-256(0x00 ‖ SHA-256(line)). An inclusion proof is {indice, tamano, camino} (index, tree size, sibling hashes from the leaf up) and is checked with the algorithm of RFC 9162 §2.1.3.2.

Probe runs and closings

Four times a day the probe calls every public x402 endpoint once, without paying, and writes one line per endpoint (tipo: "medicion"). A run ends with a closing line (tipo: "cierre") whose raiz is the Merkle root of every measurement since the previous closing, in order, mediciones is how many there are, and cierre_anterior is the hash of the previous closing (64 zeros for the first one). Lines of type nota correct nothing in place: they name the hash of a line and are not leaves.

The closings are public at /v1/sondeo/cierres and /plaza/cierres.json, each with its .ots. run checks a whole run: chain, canonical JSON, count, root and seal.

The seal: OpenTimestamps up to Bitcoin

The SHA-256 of each closing line is stamped with OpenTimestamps. The .ots file starts with the stamped digest; applying its operations (append, prepend, SHA-256 and the others of the format) leads to attestations. A Bitcoin attestation names a block height, and the message it reaches must equal the Merkle root of that block's header (bytes 36 to 68 of the 80-byte header, in internal byte order: the reverse of the hex explorers show).

The script reads the header from blockstream.info and mempool.space and checks that it hashes to the block hash; with --headers it uses headers you got from your own node (bitcoin-cli getblockheader <hash> false). A proof with only calendar attestations is pending: it is confirmed in a block some hours later. The official client checks the same: ots verify -d <hash> <file>.ots.

The measurements of one service

GET /v1/sondeo/servicios/{srv_id} returns, for each published measurement, its exact linea, its hash, its cierre and its inclusion prueba, plus the closings it cites with their .ots. measurement checks each line hash, that each line is canonical, each path up to its closing's root, each closing's hash and each seal.

What is published per service is the last measurement and every one that opened or changed an offer, not every measurement: see what you cannot check yet, below.

The signed list and the published key

/v1/lista-firmada is the list of measured offers (service, URL, network, asset, amount, payTo) signed by Agora402. lista.signature is a compact JWS with header {alg: "EdDSA", kid}; its payload is the canonical JSON of contenido. Find kid in /.well-known/did.json and verify the Ed25519 signature with its publicKeyJwk.

Reject it if now is after validUntil (24 hours) or before issuedAt. Each row of filas is hashed as canonical JSON; the Merkle root above, over those hashes in the order of filas, must equal contenido.raiz, and their number contenido.filas.

Today the list is not anchored in a public log: contenido.registro and prueba are null. The signature proves Agora402 issued it; it does not prove every client got the same list.

URL normalization

Rows are matched by a normalized URL, not the literal one: https only, no user or password, host in lowercase, no fragment, no trailing slashes (/ stays /), first with the query string and then without it. So https://humanmirror.fr/api/x402/clean-json/ in the catalog is the row https://humanmirror.fr/api/x402/clean-json. node agora402-verify.mjs url <url> prints both keys.

What you cannot check from outside yet

The full daily history of the probe is not public. Per service only the last measurement and the ones that opened or changed an offer are published, so the aggregates of a service page (measurement count, availability, latency p50 and p95) cannot be recomputed from outside, and the anterior of a published measurement can point to a line you cannot download. One complete real run is in the repository's test vectors.

The signed list is not anchored in a public log (above).

The public log of purchases, reviews, scores and passports is not live yet: when it is, its proofs use the same constructions (line hash, RFC 9162 leaf on the hash, OpenTimestamps) and this page will add their steps and a recorded vector. Until then the script has no command for them.

The signed x402 measurement record (/v1/servicios/{id}/medicion, /.well-known/x402-measurement/{id}) is signed with the same key and form as the list, but the script does not check it yet.

Sources and how to check: agora402-verify.mjs · github.com/luisbanasco-hub/agora402-verify · RFC 9162 (Merkle trees) · RFC 8785 (JCS) · OpenTimestamps · did.json