/ Stream
build 2026.12.03 · --:--:-- UTC · RSS

BabbTools for the frontier.

mascot mascot
All materials

04 — Trusted root: a simple command-line solution

2026-11-29-prep-04-trusted-root-cli.md View the source file

Morgen's direction: "For trusted root let's devise a simple solution like giving a name or supplying a key using normal dev practices from command line, help me out here."

The principle (from the sources, not invented)

  • "Root trust is a declared convention at the seed boundary, not a theorem of the distinction algebra." (note 12 §3.3)
  • "A root's assertion that it is root authenticates itself — False without an external trust/signature premise." (seed-boundary process log)
  • "The root is passed to the toy reader out of band. This is deliberate: it tests the honest boundary around authority rather than letting genesis invent its own trust." (toy-reader probe)
  • C0 is "an admitted starting authority. It is not derived from a later principal predicate." (note 16b §3)

So: the root is supplied out of band, named in genesis, and never derived. The CLI just makes that supply explicit and checkable.

The CLI shape (draft — for the Lab, not for v1)

# A named root — the simplest form, for a personal or demo log.
# The name is an actor address, exactly as v1 already uses: actor:root.
stream init my-log --root-name actor:root

# A keyed root — the serious form. The operator supplies an ed25519 public key.
# The private key never leaves the operator's machine; only the public key is recorded.
stream init my-log --root-key ./root.pub

# Both: a human-readable name bound to a key.
stream init my-log --root-name actor:morgen --root-key ./morgen.pub

# A threshold root set (for later; the GENESIS constructor already allows
# "stated single-root or threshold policy" — note 12 §3.3).
stream init my-log --root-name actor:morgen --root-key ./morgen.pub \
                   --root-name actor:deb --root-key ./deb.pub \
                   --root-threshold 1

# Verifying a log against the root it was created with:
stream verify my-log --root-key ./morgen.pub
# or, if the log's genesis names a key, the reader checks the genesis
# signature against the supplied public key and refuses on mismatch.

Normal dev practices used, deliberately: a public-key file on disk (like ~/.ssh/id_ed25519.pub); a --root-key flag (like --identity / -i); a human name as an address (like a git author); nothing new invented. Key generation is the operator's job, with their own tooling:

# Generate a root keypair (operator's machine, once):
ssh-keygen -t ed25519 -f ./root -C "stream root for my-log"
# ./root.pub is supplied to `stream init`; ./root stays private, never in the log.

What the reader does with it:

  • At init, the root name(s) and/or public key(s) are written into the GENESIS entry (see below) and into the log's preamble record. The private key is never recorded, never hashed into the log, never transmitted.
  • At open, the reader reads the root from genesis (not from a later entry, not from a config file it found lying around). If a --root-key is supplied at open/verify time, the reader checks it matches the genesis record and refuses on mismatch.
  • If no key was supplied at init (name only), the log is explicitly a named-trust log: the trust is the name, and the record says so. That is honest, and it is the right default for a personal log — but it must be labelled as such, not mistaken for cryptographic trust.

The genesis entry it produces

GENESIS as an atomic constructor (note 12 §3.3): GENESIS(log_id, roots, clock, timezone, seed_hash, policy_hashes), accepted only as the first entry. In v1's canonical JSON spelling, extended with the root record:

{"clock":"ntp","kind":"genesis","log":"c1","rec":"actor:morgen","root":["actor:morgen"],"root_key":["ed25519:SHA256:…"],"seed":"sha256:<seed hash>","tz":"UTC"}
  • root: the named root actor(s), as in v1 ("root":["actor:root"]).
  • root_key: the ed25519 public key(s), in ed25519:SHA256:<base64> form (the same form ssh-keygen -l prints). Optional — absent for a named-trust log.
  • seed: the seed hash (the seed text + test vectors, both hashed — OVERVIEW Arc IV). The kernel identity is the seed's hash for the new kernel.
  • clock / tz: clock provenance and timezone, as in v1.

Lowering (note 12 §3.3): GENESIS lowers deterministically into ordinary in, is, may projections — the root becomes an is fact (this principal exists), a may fact (this principal may administer this log), and an in fact (this log is inside the root's boundary). The lowering is recorded, not invented at read time.

What the reader enforces (with file 05)

  • First entry must be GENESIS (genesis-first/only — see file 05).
  • The first recorder must be one of the stated roots.
  • No later GENESIS may replace them.
  • A proposed authority cannot approve itself; a grant created by an action cannot satisfy that action's own check; activation is evaluated under prefix-effective knowledge.
  • A log whose genesis names a key, opened without that key, is readable but unverified as to root — the reader says so, rather than silently trusting it.

What this does NOT do

  • It does not derive trust from distinctions. It declares it, records it, and checks later entries against it.
  • It does not invent a PKI, a certificate authority, or a key-rotation protocol. Rotation is a later decision (note 17 #11, definition migration) — for now, a root is fixed at genesis, and changing it means a new log (or an explicit, owner-approved migration, recorded as such).
  • It does not put the private key anywhere near the log, the repo, or Syncthing. (Standing rule: no secrets in Syncthing.)