Anchoring lets someone check a ledger against history kept outside its database. See The ledger and anchors for the idea.
Prerequisites
Section titled “Prerequisites”- A team with at least one run in its ledger, for example after the Quickstart.
- Git, and a clone of a repository you own that is used only for anchors. Its remote must be an SSH address.
- A deploy key (SSH) for that repository if you want the export to push. Without
--pushthe anchors are committed in the clone only. - A place outside every repository for the two key files.
Two keys with two jobs
Section titled “Two keys with two jobs”| Key | Job | Where it lives |
|---|---|---|
| Signing key (Ed25519) | Signs each anchor. Verifiers hold the public half. | A file outside Git and the database, mode 0600 |
| Deploy key (SSH) | Lets the exporter push to the anchor repository. It signs nothing. | A file outside every repository; its path comes from NURAMESH_ANCHOR_SSH_KEY |
Never put either key in the repository, a flag value or a log.
# 1. Create the signing key pair. The private key is written with mode 0600.nuramesh anchor keygen --private /path/to/signing-key --public /path/to/signing.pub
# 2. Export the current heads to an anchor repository (a clone you own)export NURAMESH_ANCHOR_SSH_KEY=/path/to/deploy-keynuramesh anchor export --team my-team --repo ../anchors-clone --key /path/to/signing-key --push
# 3. Or export at the end of a runnuramesh try my-team --fake --anchor-repo ../anchors-clone --anchor-key /path/to/signing-key --anchor-push
# 4. Verify against the anchorsnuramesh ledger verify --team my-team --anchors ../anchors-clone --pubkey /path/to/signing.pub --require-anchorsCheck the exact options in the CLI reference.
What the push does
Section titled “What the push does”- It makes
ledger-anchorsthe checked-out branch on first use, commits the new anchors and pushes exactlyrefs/heads/ledger-anchors. - It never pushes
main, never forces and never sends tags. If the remote branch moved on, the push is refused and the anchors stay committed locally. - The remote must be an SSH address. SSH runs with that key only, no ssh config file, a host key that is already known and no prompts.
- A run with nothing new commits nothing. Running the export hourly from cron is fine.
Limits
Section titled “Limits”Deploy keys on GitHub are per repository, not per branch, so “only ledger-anchors” is enforced by
this code. Someone who holds the deploy key can force-push the branch and erase anchors. A rule on the
anchor repository that blocks force-push, and a verifier that keeps its own clone and fetches with
--ff-only, close that gap. Both are listed in the security overview.
Check it worked
Section titled “Check it worked”Run the fourth command of the steps:
nuramesh ledger verify --team my-team --anchors ../anchors-clone --pubkey /path/to/signing.pub --require-anchorsIt exits 0 when every stream’s chain is intact and matches its signed anchor. With --require-anchors a
stream that has no anchor is a failure, not a pass. In the clone, git log ledger-anchors shows one commit
for each export that had something new.
Troubleshooting
Section titled “Troubleshooting”| You see | Do this |
|---|---|
| The push is refused | The remote branch moved on. The anchors stay committed in your clone: fetch, look at what changed on ledger-anchors, then export again. The exporter never forces |
| SSH fails without asking anything | SSH runs with the deploy key only, no ssh config file and no prompts. The host key must already be known on this machine, and NURAMESH_ANCHOR_SSH_KEY must point at the key file |
| The export commits nothing | Nothing is new since the last export. That is normal |
Verification fails with --require-anchors |
A stream has no anchor yet. Export first, then verify |
Next steps
Section titled “Next steps”- The ledger and anchors: what an anchor proves and what it does not.
- Auditor guide: check a ledger export without trusting the system that wrote it.
- Back up and restore: compare the anchors with a restored ledger.
Was this page helpful?