Run a mirror or a witness#
Grantstamp gets stronger with every mirror and witness that the project does not run. Either one takes a few minutes and a free GitHub account.
Which one?#
| Mirror | Witness | |
|---|---|---|
| What it does | Serves a copy of the public log, the listed stamps and the check map | Cosigns the log, and only when it extends the log it saw before |
| What it protects | Availability. Checks keep working when the registry is slow or asleep. | Integrity. The registry cannot show two histories. |
| Holds a key | No | Yes, one that only you hold |
| Trusted for | Nothing. Every reader checks the copy. | Not agreeing with the registry to sign a fork |
| Time to set up | About 5 minutes | About 10 minutes |
Run one or the other, not both from the same account. A witness that is also a host could hide its own host's misbehaviour.
Run a mirror#
A mirror is a folder on any static web host. The ready-made way uses GitHub Pages.
- Create a public repository, for example
grantstamp-mirror. - Save integrations/join/mirror.yml in it as
.github/workflows/mirror.yml. - In the repository, open Settings, then Pages, and set Source to GitHub Actions.
- Open Actions, pick
grantstamp-mirror, and click Run workflow. -
Check your mirror:
pip install grantstamp grantstamp audit --from https://<you>.github.io/grantstamp-mirror -
Send the address to contact@grantstamp.io. Once it is listed, agents use it on their own.
The job runs again every 20 minutes. It fetches only what is new, and checks everything before it publishes.
Any other host works too. Run grantstamp mirror https://registry.grantstamp.io/log ./mirror on a schedule and serve the folder.
Run a witness#
A witness holds a key and a small state: the last log head it cosigned.
- Create a public repository, for example
grantstamp-witness. -
On your own computer, make the key. The name is your repository's address.
pip install grantstamp grantstamp witness keygen github.com/<you>/grantstamp-witness --out witness.keyIt prints one line that starts with that name. The line is public. Keep it. 3. In the repository, open Settings, then Secrets and variables, then Actions. Add a secret named
GRANTSTAMP_WITNESS_KEYwith the contents ofwitness.key. Then delete the file. 4. Save integrations/join/witness.yml in the repository as.github/workflows/witness.yml. 5. Open Actions, pickgrantstamp-witness, and click Run workflow. It should end with "cosigned … entries". 6. Send the public line from step 2 to contact@grantstamp.io.
Until the registry lists your witness, it does not keep your cosignatures. That is expected. Your witness still checks the log on every run.
What your witness promises is simple. It never cosigns a log that drops or changes anything it cosigned before. The job saves its state before any cosignature leaves it, so a failed run cannot be used to make it sign a different history.
If something looks wrong#
- Your witness job fails with "rewrote history". Do not delete its state. That failure is the witness doing its job. Write to security@grantstamp.io, and say so in public if you get no answer.
- Your mirror's audit fails. Run the job again. If it still fails, the registry served something that does not add up. Write to the same address.
For the registry's operator#
When someone sends you a mirror or a witness:
- A mirror. Check it with
grantstamp audit --from <address>. Then add the address toGRANTSTAMP_LOG_MIRRORS, separated from the others by commas. - A witness. Add
witness <short name> <their public line>toGRANTSTAMP_WITNESS_POLICY. Start with a quorum that any one witness can meet, for examplegroup either any github <short name>andquorum either. Then one late witness cannot block checks. - Then pin the new list. Run
curl -s https://registry.grantstamp.io/v1/log/policy > src/grantstamp/logs/registry.grantstamp.io_log.policy, commit it and release. Clients trust a new witness only from that release on.
Raise the quorum to "all" only when the witnesses have shown they run on time.
Source of this page on GitHub. Documentation for Grantstamp 0.4, licensed CC BY 4.0.