Mirrors and witnesses#

Version 0.4 lets anyone serve Grantstamp's data, from hosts nobody has to trust.

Who holds what Owner signs every stamp with a key only the owner holds stamp Registry puts writes in order in one public log, and signs it Witnesses cosign the log only when it extends what they saw before log head out, cosignature back Mirrors copy the log, the public records and the check map. Any plain web host will do. copy Agent, or you reads from any mirror and checks every byte data proof one, run by the project many, run by anyone A mirror can go silent. It cannot change, hide or add anything without being caught. The registry cannot show two histories. The witnesses would refuse to cosign.

The goal#

Anyone should be able to serve Grantstamp's data, so the project's own free-tier servers do as little as possible.

Availability is best effort. Integrity is guaranteed.

What runs today#

The software supports many witnesses and many mirrors. Who runs them today is on the status page. To add a witness or a mirror of your own, see Run a mirror or a witness.

What is guaranteed#

Property Guarantee How
Integrity of records Always Owners sign their claims. The log is a Merkle tree, signed by the registry and cosigned by witnesses. A record must say what the log's latest entries say.
No hidden matches Always, for a client that verifies The check map is sorted and committed to by the log, so a missing token is proven absent.
Freshness Bounded, 2 hours by default The registry's token answer names its current map. A host must serve it, or a map made in the last 2 hours. A client never accepts a log older than one it saw. With witnesses, checkpoints must also be cosigned in the last 2 hours.
Availability Best effort Many hosts, tried in random order. The registry stands in when no host answers.
Hosts learn nothing about files Yes Hosts hold keyed tokens. Only the registry's token service can make them, and it counts every feature.
Deletion inside the system Within the freshness bound A withdrawn stamp leaves the next generation. A host may serve the one before for at most 2 hours.
Deletion of copies a host kept Not possible When the token key changes, those copies stop matching anything.

The core idea is simple. Once all data is self-certifying, a host has one power left: silence. Everything else it could do is either caught with proof or limited to what it can observe about requests.

The pieces#

Role Run by Holds Trusted for
Registry (sequencer) The project All records, private data, the log key, the token key Ordering writes. Lying is caught by witnesses.
Token service The project (today on the registry) The token key Not answering more than its rate limits allow
Witnesses The project's own GitHub jobs today, then independent operators The last checkpoint they cosigned Not colluding with the registry to sign a fork
Hosts and mirrors Anyone Copies of the log, public records and the check map Nothing except availability
Clients Everyone A pinned log key and witness policy Themselves

A witness or a key holder must never also run a host. A host that is also a witness could hide its own misbehaviour.

The data, in tiers#

  1. The log. Entries hold commitments (digests), never the data itself. It is served as tiles in the C2SP format. Every host holds all of it.
  2. Public records. The records of listed stamps, as the stamp page shows them, with the owner's signed claims. Unlisted stamps are left out.
  3. The check map. Per generation: sorted (token, file references) leaves in a Merkle tree, and small JSON files.

    • files.json holds per-file sample rates and sizes.
    • stamps.json holds owners, policies, status and open cases. Titles appear only for listed stamps. Unlisted stamps appear under an alias.
    • owners.json holds the verified-domain flag and identity label.

    It holds no owner names, contacts or image hashes. Exact SHA-256 hashes are tokens too.

  4. Private data. Identity records, private contacts, case files and the raw fingerprints never leave the registry.

How a check works through hosts#

A check through a mirror Agent your machine Mirror trusted for nothing Token service at the registry 1 the log checkpoint signed by the registry, cosigned by witnesses 2 the check map's notice and lists must match what the log committed to 3 tokens for this file's features counted against a rate limit, names the current map 4 the map pieces where the tokens would be each token is proven present, or proven absent 5 Grade the evidence and apply the owner's policy with the registry's own matching code: allow, ask or deny A mirror that fails any check, or does not answer, is skipped.
  1. The client fetches the log checkpoint from a host. It must carry the pinned log key's signature. It must extend the newest checkpoint this computer accepted before. With witnesses in the policy, it must also carry a fresh quorum.
  2. It reads the newest map.generation entry in that log. The entry commits to the generation's notice.
  3. It fetches the notice and the JSON files from the same host and checks them against the entry.
  4. It asks the token service for the tokens of its file's features. Every feature counts towards the rate limit. The answer also names the registry's current map and its token key.
  5. The host's map must use that key. It must be the current map, or one made in the last 2 hours.
  6. For each token, it fetches the entry bundle where the token would be. The bundle must hash up to the notice's root, and its leaves must be sorted. A token in the bundle is a match. A token that falls inside the bundle's range without being in it is proven absent.
  7. The registry's own matching code grades the evidence on the verified rows. The client applies the owner's policy, including the rules for open cases and medium matches.

A host that fails any check, lacks a file or cannot be reached is skipped, and the client tries the next one. The registry is always last.

grantstamp check --via-hosts does all of this. It is experimental. The tests compare its answers with the registry's own for several builds and find them identical.

Why a host cannot cheat#

What a host might try What catches it
Change an entry, a record or a policy The hash no longer matches the log, or the owner's signature fails
Hide a match (drop a leaf) The bundle no longer hashes to the logged root
Add a match Same
Rewrite a bundle and its tile together Every tile must hash to its entry in the tile above it, up to the signed root
Serve an old map, for example one that still has a withdrawn stamp The token answer names the current map. An older map made more than 2 hours ago is refused.
Serve an old log with its old map A log older than one this computer saw is refused. The map rule above applies too. With witnesses, old cosignatures are refused.
Serve the map under another generation number The notice names its own generation
Serve a map made with an old token key The token answer names the key in use
Serve an old record, another stamp's record, or one signed with a key it made up See "How a record is tied to the log" below
Show different histories to different people Witnesses cosign only a history that extends what they saw
Read the data It holds tokens. Making a token needs the token service.
Test files offline against the map Same. Every test is a question to the token service, counted and rate-limited.
Refuse to answer, or answer slowly Nothing can force an answer. The client tries other hosts, then the registry.

How a record is tied to the log#

A mirror serves each listed stamp's record: what the stamp page shows, with the owner's signed claims. A record is checked against the verified log before a mirror keeps it, and again by grantstamp audit --from.

  1. The record must list exactly the log's entries for its stamp, and for its owner.
  2. The owner, title, policy, status and listing must be what the latest of those entries commit to.
  3. Every key that signed a claim must be one the log recorded for the owner, when it was created or replaced.
  4. The owner's name and identity label must be ones the log recorded.

The log holds only digests. So the registry keeps the payload behind each stamp entry, and serves it with the stamp's proof. A payload counts only when its digest is the logged one, so a host gains nothing by making one up.

For entries logged before 0.4 there is no payload. The client then recomputes the digest from what the record says now. That fails only for a stamp whose policy changed before 0.4. Its owner ties it again with grantstamp attest.

The log does not cover a stamp's description or the owner's verified domains. Checks never use them. grantstamp audit checks domains against DNS.

Deletion#

  1. The owner signs a withdrawal. The registry logs it and deletes the stamp's fingerprints.
  2. The next map generation leaves the stamp out. The registry builds it about 10 minutes after a change, while it is awake.
  3. The token answer tells clients which generation is current. A host may serve the one before for at most 2 hours after it was made. After that, it is refused.
  4. Tokens come from a key that changes every week. The key can also be rotated at any time with grantstamp admin rotate-map-key. A copy kept by a host then matches nothing a client asks about.
  5. The withdrawal record itself stays in the log, as before. For unlisted stamps, the log names them only by a hash of their id.

What we can promise: a host can show a withdrawn stamp for at most 2 hours after the next map is made. That is the default --max-age. A client that needs a tighter bound sets a smaller one, or asks the registry.

The same bound holds the other way: a host cannot hide a new stamp or a stricter policy for longer. Within a week, copies kept elsewhere are useless for new checks. We cannot make third parties erase what they copied.

Hosts joining, leaving and coming back#

Joining. A host is any static web host that serves a mirror folder (grantstamp mirror). It needs no key and no permission to be correct. It needs to be listed in the registry's GRANTSTAMP_LOG_MIRRORS before clients pick it on their own. Listing is by invitation at first.

Leaving gracefully. A host holds nothing that exists only there. Everything is a copy of data the log commits to, so there is nothing to hand over. The operator tells the project, the project removes the host from the list, and the host may stop after clients refresh the list.

Leaving abruptly. Clients move to the next host. Nothing is lost while any host or the registry still serves the data.

Witnesses. A witness saves its state before any cosignature leaves it. The GitHub job cosigns, pushes its state to a branch, and only then hands the cosignature in. So a failed save can never let it cosign a different history later.

A witness that leaves publishes its last cosigned checkpoint. The project changes the witness policy so the quorum can still be met. The policy is versioned in the package, so the change is visible.

Key holders (planned, stage 3b). When the token key is split among several holders, a holder leaves by resharing: the remaining and new holders get new shares of the same key, the leaver's share becomes useless, and the leaver destroys it (CHURP, Maram et al. 2019). Nothing is ever copied from one holder to another.

The project itself. If the project stops, hosts keep serving the log and records, and anyone can verify them. Checks through hosts stop when the token service stops. That is the price of hosts not being able to test files offline.

Coming back. A host that was offline pulls again (grantstamp mirror). It must verify a consistency proof from the last checkpoint it held, replay what is new, and copy the current map generation, before it serves anything. Clients check all of that again anyway.

Reaching hosts that are online now, and those that are offline#

Everything that changes how hosts serve data is an entry in the log: map generations and key rotations today, and in future protocol versions and host lists.

A host that is online picks the change up on its next pull. A host that was offline sees every change, in order, when it pulls again. A client never trusts a host's word about what is current. It reads the log.

Decisions#

  1. Hosts hold only exact-match tokens. Image hashes stay with the registry, because a blinded 16-bit band can be enumerated with 65,536 questions.
  2. Hosts hold no names or contacts. Owners appear by id. Policies are public by design, including the contact an owner puts in a policy for agents.
  3. A witness or key holder never runs a host.
  4. Hosts are listed by invitation first. Anyone can mirror. Being picked by clients automatically comes later, if there is demand.
  5. The token key changes weekly, with a day of grace, and can be rotated on request.
  6. Probing detection stays at the registry. The token service sees every caller's rate, as the check endpoint does today.

What is left, and how practical it is#

Risk Who could do it Impact Practical? What limits it
A host refuses or slows down Any host Slower checks Yes, easily Other hosts, then the registry
A host sees which token ranges a client fetches Any host It can tell when the same file is checked again, and may guess which stamp matched Yes Small maps are fetched whole. Larger ones leak about as much as prefix lookups. OHTTP relays are planned.
A host counts how many stamps share a token Any host Learns structure, not content Yes, low value Shared features are already discounted
A client and a host test guessed files Anyone with the files Learns whether a file is registered Only at the token service's rate Rate limits count features. This is what a check reveals anyway.
A host keeps a withdrawn stamp's tokens Any host Could tell a colluding client that its file matched a withdrawn stamp Until the key changes, at the token service's rate Weekly key change, rotation on request
A host serves a map that lags Any host Answers up to 2 hours old Yes --max-age. The registry's own answers are always current.
A host links an unlisted stamp across key changes Any host Knows two aliases are the same unlisted stamp, from its creation time, owner and policy Yes, low value Its id, title and files stay hidden
A host changes a record field the log does not cover Any host A misleading description or domain flag on a mirror's page Yes Checks never use them. grantstamp audit checks domains against DNS.
The registry forks the log The project Different people see different histories Only if the witnesses collude Independent witnesses, Bitcoin timestamps
The registry refuses to log a stamp The project An owner is shut out Visible to the owner Witnesses do not help here. The owner can publish the refusal.
The token service is down Its host Checks through hosts stop Yes, on a sleeping free tier Move it to an always-on host (next step)
The token service lies about the current map The project Hosts refused, or stale ones accepted Only the registry can It is the registry's own answer, over HTTPS
Flooding with junk stamps A spammer Bigger maps Low Identity gate, quotas
A copied registry Anyone A rival with stale data Yes, harmless Copies cannot sign as the registry
The client software is tampered with A targeted attacker Verification skipped Hard Signed releases from CI, open source

Not built yet#

Prior work#

Source of this page on GitHub. Documentation for Grantstamp 0.6, licensed CC BY 4.0.