Index attestation
An indexer is a convenience, not a trust root. Its attestation proves which indexer served exactly this answer to exactly this question at this time. Everything inside (listings, capacity, observations) still carries its own signature and is verified separately.
The pin
Clients pin the indexer's attestation public key in configuration (A15): the SDK with indexer: { url, key } (or keys: [old, new] during a rotation), the UI in its data-source configuration, the prober with discoveryKey or discoveryKeys. Responses under any other key are rejected.
GET /.well-known/im-indexer.json returns a signed {"attestation_key": "..."}. It is informational, never a trust bootstrap: get the key from the operator through a channel you trust.
What is signed
Every response produced by discovery code, success or error, REST or MCP (A27, A30), is an envelope whose document includes:
| Field | Value |
|---|---|
query |
REST: the exact pathname plus the query string sorted with URLSearchParams.sort(). MCP tools: {tool, args}. |
issued_at |
Unix seconds. |
| the payload | Routes, a route, an acknowledgment, or {error: {code, message}}. |
How to verify a response
- Parse strictly (protocol JSON: integers only, no duplicate keys, at most 1 MiB).
- Check the signature under the pinned key.
- Check
queryequals your own request's binding. A response for a different query is rejected, even if validly signed. - Check
|issued_at − now| ≤ 300seconds. - Only then read data or errors. A signed error is handled like any other signed answer; an unsigned failure is a transport failure, never guidance.
verifyAttestation(value, key, query, now) in services/discovery/src/attest.ts implements steps 2–4; the SDK's DiscoveryClient does all of it.
Edge cases the protocol pins down
- HEAD returns the GET status with an empty body and a compact signed
X-IM-Attestationheader (base64url) carrying{query, issued_at, status, body_sha256}, wherebody_sha256is the SHA-256 of the exact GET body (A32). - MCP: tool results carry the attestation in
structuredContent, protocol errors inerror.data, control results in_meta["im/attestation"], and bodyless responses inX-IM-Attestation./mcpaccepts POST only; GET/SSE, DELETE and HEAD get a signed 405 withAllow: POST. - Caching: a cached signed response is never more than 60 s old, and expires earlier when the evidence inside it does. Freshness is checked after signing; if evidence expired while the page was being signed, the answer is a signed, retryable 503, not a stale page.
- Transport limits: failures the HTTP server or reverse proxy produce before routing (malformed framing, oversized headers, hard size limits) are unsigned and out of scope; application limits are signed 413s.
- Retries: after a verified signed 503
service_unavailable, honourRetry-After: 1within your deadline. After a connection error before headers, only idempotent operations may be replayed: REST reads, MCPlist_routes/get_route, or resending the exact same signed observation.
Lists and listing digests (A33)
A /v1/routes page is {listings, routes, next_cursor}. listings maps each lowercase hex listing_digest (SHA-256 of the canonical JSON of the full {doc, key, sig} listing envelope) to the listing, once per page. Each route entry carries listing_digest, route_id, capacity, observations and score_inputs. Verify each listing once, recompute its digest, then find each entry's route_id inside it and compare it with score_inputs.route_id. Route detail still carries its full listing.
What an attestation does not prove
- Completeness: an indexer lists only the sellers and operators it pinned. An empty answer does not mean no seller exists.
- Freshness of the evidence inside: a fresh attestation does not make stale capacity fresh.
- Honesty about what it omitted: an indexer can withhold sellers or observations. Use more than one indexer, or a seller's listing directly (
DiscoveryClient.direct({url, key})), when that matters.