# Reading and mirroring a registry

Edition 2026-10-30.

What a registry publishes to anybody, in what shape, and how a mirror re-serves
it so that a consumer can verify every byte without trusting the mirror. Every
read here is public, unauthenticated and answered as JSON; none spends a nonce.
The signed reads a participant makes about its own business are in
[operations.md](operations.md).

## The public reads

| Read                                        | Answers                                                                                     |
| ------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `GET /gavr/:identifier`                     | The record, or the placeholder of an identifier with no record yet. 404 if never allocated. |
| `GET /gavr/:identifier/revisions`           | Every revision of a record, oldest first, paged, with the total. 404 without a record.      |
| `GET /gavr/:identifier/revisions/:n`        | One revision, by its 1-based number, and what it changed from the one before.               |
| `GET /gavr/:identifier/grants`              | Which other authorities may act on the record, and at what level.                           |
| `GET /gavr/:identifier/measures`            | Every lock and contribution limit ever placed on the record, with whether each is in force. |
| `GET /authorities`                          | Every admitted body, paged with `limit` and `cursor`; `?mint=` narrows to one mint number.  |
| `GET /authorities/:slug`                    | One body as the directory lists it.                                                         |
| `GET /authorities/:slug/standing`           | Whether a body is in good standing now: the registry's live answer.                         |
| `GET /authorities/:slug/chain`              | The body's accreditation chain, by `?key=` ([trust.md](trust.md)).                          |
| `GET /authorities/:slug/issued`             | The bodies it accredits, with the links and staples it lodged ([trust.md](trust.md)).       |
| `GET /authorities/:slug/staple`             | The body's standing staple ([trust.md](trust.md)).                                          |
| `GET /authorities/:slug/nodes`              | The nodes bound to the body, and the cluster's own last leader report.                      |
| `GET /authorities/:slug/keys/:keyId/signed` | What one of the body's keys signed: revisions and records, from `?since=` when given.       |
| `GET /authorities/:slug/notices`            | What happened to the body and its records ([protocol.md](protocol.md)).                     |
| `GET /authorities/:slug/transfers`          | The ownership offers still open for the body to answer.                                     |
| `GET /.well-known/gavr-registry-key`        | The registry's own signing key and `signer` block.                                          |
| `GET /dumps/records.ndjson`                 | Every servable record, one per line.                                                        |
| `GET /dumps/allocations.ndjson`             | Every identifier ever allocated, expired ones included, one per line.                       |

An identifier is normalised before it is looked up, so one read aloud or copied
out of print still resolves. A malformed identifier answers 404, as an unknown
one does: to a resolver, "not an identifier" and "no such identifier" are the
same answer.

Every route also takes the display form, the identifier with its check
character ([identifiers.md](identifiers.md)). A check character that agrees is
dropped before the lookup; one that disagrees answers 404, because the typo
could be in any character and the rest may name somebody else's record. A
resolver that wants to say "mistyped" checks the character itself first.

A promoted GAVPR resolves, on every route, to the record under the GAVR it
became. One never promoted answers 404 with a `provisional` member saying what
the registry knows about it:

| Field      | Meaning                                                                                 |
| ---------- | --------------------------------------------------------------------------------------- |
| `mintedBy` | The body holding its mint number, as `{ slug, displayName }`, or null when nobody does. |
| `epoch`    | The key epoch it names.                                                                 |
| `counter`  | Its counter.                                                                            |
| `lease`    | `{ from, to }`, the range leased to that body for that epoch holding the counter, or null. |

None of it says a record exists: it says whose identifier it would be.

## A record

`GET /gavr/:identifier` answers the record once a revision has been accepted:

| Field        | Meaning                                                                                     |
| ------------ | ------------------------------------------------------------------------------------------- |
| `kind`       | `record`.                                                                                   |
| `identifier` | The identifier it was resolved under. A label: no signature covers it.                      |
| `document`   | The signed document, byte for byte what the authority submitted.                            |
| `signatures` | `authority`, the owner's signature over the document, and `registry`, the countersignature. |
| `acceptance` | `revision`, `acceptedAt` and `schemaVersion`: exactly the block the countersignature covers. |
| `digest`     | The document's digest. Unsigned, a convenience for indexing; recompute it to rely on it.    |
| `authority`  | The owner, as `{ slug, displayName }`.                                                      |
| `legalHold`  | Present while a hold is in force or erasures wait: `inForce`, the registry containers holding it, and `erasuresQueued`. Unsigned. |
| `suspect`    | Present when this revision was signed by a key revoked as compromised, accepted at or after the compromise began: `keyId` and `since`. Unsigned. |

**A record under embargo is not served.** While its `embargoUntil` is ahead,
or cannot be read, the identifier resolves as its claimed placeholder and the
record dump leaves it out.

## A placeholder

Before a record exists, the identifier resolves as a placeholder:

| Field        | Meaning                                                                              |
| ------------ | ------------------------------------------------------------------------------------ |
| `kind`       | `placeholder`.                                                                       |
| `identifier` | The identifier.                                                                      |
| `state`      | `RESERVED`, `CLAIMED` or `EXPIRED`.                                                  |
| `authority`  | The body it was allocated to, as `{ slug, displayName }`.                            |
| `origin`     | Whether it was minted for something or taken from a reserved block.                  |
| `title`      | The optional placeholder title the authority gave it. Dropped once it expires.       |
| `reservedAt` | RFC 3339.                                                                            |
| `claimedAt`  | Present once the identifier was used.                                                |
| `expiredAt`  | Present once it lapsed. An expired identifier is retired, never reissued.            |

A block identifier is capacity, not a finding, so a reader must not assume a
vulnerability stands behind every reserved identifier.

## A history

Each entry of `GET /gavr/:identifier/revisions` carries `revision`,
`acceptedAt`, `state`, `submittedBy`, `custody` and `digest`, and where they
apply:

| Field        | Meaning                                                                                       |
| ------------ | --------------------------------------------------------------------------------------------- |
| `signedWith` | The key that signed, as `{ keyId, keyProtection?, hostedBy? }`, read off its signature.      |
| `cosignedBy` | The keys that cosigned the submitter's own containers, which is what a quorum counts.         |
| `suspect`    | As on the record.                                                                             |
| `excised`    | Bytes removed after acceptance: when, why, and by which revision.                             |

## The directory

A directory entry names the body, its kinds, state, scope, live restrictions
and resolver, and:

| Field        | Meaning                                                                                       |
| ------------ | --------------------------------------------------------------------------------------------- |
| `keys`       | Every key: `keyId`, `state`, `addedAt`, its `epoch`, and `compromisedSince` for a key revoked as compromised. |
| `mintNumber` | The first number of every provisional identifier the body mints.                              |
| `quorums`    | The acts for which it requires more than one of its keys: `act` (`publish`, `withdraw` or `transfer`) and `threshold`. |

## Dumps

`GET /dumps/records.ndjson` and `GET /dumps/allocations.ndjson` are
newline-delimited JSON: each line of the first is exactly what
`GET /gavr/:identifier` answers for a record, and each line of the second
exactly what it answers as a placeholder. They are a courtesy that saves
resolving identifiers one at a time, and publish nothing the single reads do
not.

- **Ordered by identifier.** The order is total and a row's place in it never
  changes. A row written while a dump streams either sorts before the point
  reached, and is missed, honestly, since it did not exist when the file began,
  or sorts after it and is included. No row is duplicated or skipped.
- **Streamed, never built.** A dump is generated on request. A failure partway
  breaks the transfer rather than ending it, so a truncated file never arrives
  looking complete: treat a broken transfer as no dump, never import a prefix.
- **Six requests an hour per address**, per file, and `Cache-Control:
  public, max-age=60`. The data changes slowly; a mirror fetching hourly is
  ample.
- **Unsigned.** A dump carries the same signed records the single reads do, and
  each line is verified on its own. The `dump` signing context is reserved for a
  signed dump; nothing signs in it yet.

## Verifying what a mirror serves

A mirror re-serves the registry's bytes, so a consumer checks the bytes, never
the mirror. For each record:

1. **The record signature**, pinned to the `record` context, as
   [signing.md](signing.md) describes. Refuse a record whose document `id`
   differs from the identifier it was served under.
2. **The countersignature**, over the document, the authority's signature and
   the `acceptance` block, against the registry's key fetched independently
   from `/.well-known/gavr-registry-key`, as [protocol.md](protocol.md)
   describes. Never against the key the countersignature names for itself.
3. **The authority's standing**, when the registry should not be trusted or
   reached: its chain and staple, as [trust.md](trust.md) describes.

Two hosts serving identical signed bytes is what lets a consumer compare
digests with no per-participant code. An accredited authority serves its own
records beside the registry as well; the registry probes that resolver and
verifies what it serves ([protocol.md](protocol.md)).

## Hosted authorities and their nodes

An authority holds its own key (`SELF` custody) or lets a registered node sign
as it (`HOSTED`), by binding the node with `authority.node.bind`
([operations.md](operations.md)). A node may be bound to several authorities at
once, which is what a hosting instance is; the action envelope names the
authority it speaks for in `authority`, inside the signature. Hosted custody
requires mutual TLS, because the client certificate is the only thing tying a
request to the node the authority bound ([signing.md](signing.md)).

An authority with several nodes runs them as a cluster: one PRIMARY, the rest
SECONDARY. `mesh.role.set` records the role each node is meant to hold and its
election priority, and `mesh.leader.observed` records which node the cluster
says won, in which term. `GET /authorities/:slug/nodes` publishes both, without
the nodes' certificate serials:

```json
{
  "authority": "acme",
  "nodes": [
    { "nodeId": "...", "name": "...", "role": "PRIMARY", "priority": 10,
      "state": "ACTIVE", "boundAt": "...", "observedLeader": true }
  ],
  "observed": { "leaderNodeId": "...", "term": 4, "at": "..." }
}
```

**The registry arbitrates nothing.** It records what the cluster reports, so a
consumer must expect the leader report to be stale and must never gate on it.
Two nodes configured PRIMARY is a legal state: a Secondary relays rather than
allocating, and the registry remains the sole allocator, so a split brain is a
liveness question and never a double issue. The relay and election protocol
itself is not specified yet.
