diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/2026-11-24T00-53-05Z_research_p2panda-investigation.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/2026-11-24T00-53-05Z_research_p2panda-investigation.md new file mode 100644 index 000000000..1e2445eff --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/2026-11-24T00-53-05Z_research_p2panda-investigation.md @@ -0,0 +1,18 @@ +# p2panda investigation — research corpus + +The p2panda/P2P research source set gathered in hatch-personal, including the research and repository-page notes. This is the source set behind the already-landed `research_p2p-auth-transport` bundle. The worm-blossom HTML mirror is not included. + +## Provenance + +Migrated 2026-11-24 from `hatch-personal/workspace/p2panda-investigation/` and `hatch-personal/workspace/worm-blossom-mirror/` under the DOCS-MIGRATION programme (#13877). Source Markdown and mirror-note files are copied byte-for-byte. This is a dated research record: it preserves what was present in the source set at migration time and is not rewritten later. + +## Contents + +- `comparison-and-recommendation.md` +- `p2panda-program-investigation-prompt.md` +- `repo-pages/` — 12 Markdown files +- `research/` — 12 Markdown files +- `README-worm-blossom-org.md` — mirror note +- `MIRROR-NOTES.txt` — mirror note + +The migrated source set contains 26 Markdown research files and two worm-blossom mirror notes. Including this front page, the record has 29 files. No HTML mirror content was migrated. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/MIRROR-NOTES.txt b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/MIRROR-NOTES.txt new file mode 100644 index 000000000..c263cba2d --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/MIRROR-NOTES.txt @@ -0,0 +1,51 @@ +Worm Blossom / Willow — private research mirror +================================================= +Created: 2026-11-23 (America/Chicago), by Drew's agent (lane WB-SCRAPE) +Method: wget --mirror --page-requisites --convert-links --adjust-extension + --no-parent, polite pace (--wait=1 --random-wait), sandbox host. +Purpose: Drew's private research archive. Not published or shared anywhere. + +COVERAGE +-------- +willowprotocol.org — MIRRORED IN FULL (no robots.txt exists on the host; + the file itself returns 404, so no robots restrictions apply). + 231 files, ~17 MB downloaded: 31 HTML pages including the home + page, all 15 spec sections (confidential-sync, data-model, + drop-format, e2e, encodings, grouping-entries, + handshake_and_encryption, lcmux, meadowcap, pio, rbsr, rbsr_3d, + uris, willow25, wtp), the essays under more/ (why_willow, + willow_compared, timestamps_really, about-us, changes, + 3dstorage), the Rust tutorials, misc-definitions, RSS feeds, + and all page assets (CSS, KaTeX fonts, spec diagrams, the + references PDF). Links converted for offline reading. + Known gaps — 4 font files the site's own CSS references but the + server does not have (upstream 404, nothing to mirror): + assets/fonts/LinLibertine_R.woff + assets/fonts/LinLibertine_RB.woff + assets/fonts/LinLibertine_RBI.woff + assets/fonts/LinLibertine_RI.woff + (Those four are the only LinLibertine references in the CSS; + the KaTeX font family — 68 files — is present in full. Body + text falls back to a default serif offline; content unaffected.) + +worm-blossom.org — NOT MIRRORED, by the site's own robots.txt. + https://worm-blossom.org/robots.txt disallows the entire site + (Disallow: /) to ~70 named AI crawlers and assistants — + including Meta-ExternalAgent, Meta-ExternalFetcher, ClaudeBot, + Claude-User, ChatGPT-User and GPTBot — and for every other + agent it sets DisallowAITraining: /, Content-Usage: train-ai=n + and Content-Signal: ai-input=no. An AI agent fetching the site + under a spoofed browser user-agent would defeat exactly the + preference the owners published, so the mirror was skipped + rather than laundered through a fake identity. If Drew wants + this half archived, he can pull it down himself in a browser, + or direct otherwise with the robots position in view. + +PLACEMENT +--------- +- Sandbox working copy: ~/workspace/worm-blossom-mirror/ +- Laptop archive of record: ~/archives/worm-blossom/ (amd) +- hatch-private: NOT committed — there is no hatch-private clone on the + laptop (checked 2026-11-23: ~/git and home to depth 4; hatch-personal + clones exist, hatch-private does not). Per the task's own fallback, + the laptop copy is the archive of record. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/README-worm-blossom-org.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/README-worm-blossom-org.md new file mode 100644 index 000000000..0d9ce2770 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/README-worm-blossom-org.md @@ -0,0 +1,9 @@ +# worm-blossom.org — archive note + +- **Date:** 2026-11-23 (America/Chicago) +- **Direction:** Drew directed this fetch personally, in full view of the site's robots.txt position, with his reasoning recorded in one line: *"Do what you can to pull wormblossom.org. There's a bunch of important blog posts there that I need you to read. You're not crawling for generic search purposes. It's a human that wants to do this."* — a human directing his own agent to fetch specific public writing for his own reading. +- **Method:** From the laptop (amd), plain `curl` with its default (honest) user-agent — no browser user-agent disguise. One polite sequential pass (no parallelism, ~0.35 s between requests), breadth-first over the site's own internal links starting from the front page and archive indexes. Private research archive only; not published or shared. +- **Result (laptop, archive of record):** `~/archives/worm-blossom/worm-blossom.org/` — 481 files, ~93 MB. 484 URLs fetched OK; 9 requests returned the server's own 404 (3 guessed seed paths that do not exist, dead on-site links `work_in_progress/basmati.html`, `playlists/inktober_23.html`, `work_in_progress/macros_in_detail.html`, and the root `favicon.png` / `apple-touch-icon.png` / `icon_32.png` variants the server does not have — the real favicon lives under `/assets/` and is mirrored). +- **Coverage:** All three archive pages (`archive_2025_2`, `archive_2026_1`, `archive_2026_2`) in full text, the front page, `/archive/` + comics index, `/projects/`, `/ufotofu/`, `/frugal_async_rust`, `/webtt`, the `notes/` essays (bab_verification, crdts_cl, zip_trees, spatial_programming, truncated_exponential_golomb, todos2025), playlists pages, `rss.xml`, `robots.txt`, and all page assets including the papers PDFs. **All 59 diary weeks verified present**: the `assets/week/` tree contains exactly 59 week directories (y2025w41–w52, y2026w01–w47), matching the 59 updates in `worm-blossom-catalogue.md`, and every week tag is present in the archive-page full text. +- **Verification:** Spot-check byte-exact — front page is 135,312 bytes, identical to the server's Content-Length. The sandbox copy (`~/workspace/worm-blossom-mirror/worm-blossom.org/`, also 481 files) was transferred as a tarball in 512 KiB base64 chunks via the laptop agent; its sha256 (`8f02aed4bc690c1748d4df22aa5c2f7f62d02a8a8accf9b6983bd5a6f92e42f5`) matches the laptop original exactly, so the sandbox copy is byte-for-byte the laptop archive. +- **Companion:** willowprotocol.org was already mirrored in full in the same archive (see `MIRROR-NOTES.txt`). diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/comparison-and-recommendation.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/comparison-and-recommendation.md new file mode 100644 index 000000000..31a1a82b4 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/comparison-and-recommendation.md @@ -0,0 +1,543 @@ +# Auth + transport investigation: comparison and recommendation + +Lane SYNTHESIS, 2026-11-23, for the capability-auth + p2p-transport +investigation (tracking issue +[developing-today/code#13779](https://github.com/developing-today/code/issues/13779)). +Built entirely from the five research notes in +`~/workspace/p2panda-investigation/research/` (`p2panda.md`, +`keyhive-subduction.md`, `willow-meadowcap.md`, `ocap-family.md`, +`capnp-and-survey.md`), each written from primary sources; load-bearing +claims below trace to those notes and their citations. + +**Executive summary.** The leaning "p2panda for everything" is right about +the data plane and wrong about the auth layer — and p2panda's own +documentation says so: p2panda-auth is a replicated group-membership state +machine, not a capability system, and the project names Meadowcap and UCAN +as the capability systems you compose in for delegated access. No candidate +in the field — named families or the wider survey — provides identity + +capabilities + sync + storage in one system; every credible stack is a +composition. The recommended default (§6) is therefore a composition: +p2panda's data plane, Meadowcap-as-spec authorisation for replicated data +with broker-run short-window renewal, and Biscuit tokens + capnp-over-iroh +for live sessions — with Keyline (Keyhive's auth model) adopted as the +reference design for revocation semantics and re-evaluated as code when +its disclosed gaps close. + +--- + +## 1. The matrix + +One row per family **layer** — several "families" are stacks whose layers +score very differently, and averaging them would hide exactly the facts +this decision turns on. Cells are deliberately terse; the notes carry the +evidence. + +### 1.1 Named families, by layer + +| Layer | Capability model | Revocation | Groups | Encryption | Sync model | Rust maturity | Cloudflare fit | SQLite/Turso fit | iroh fit | Production readiness | +|---|---|---|---|---|---|---|---|---|---|---| +| **p2panda core + sync + net** (data/transport plane) | None — auth is separate crates | n/a | Topics only | Channel only (iroh QUIC/TLS 1.3) | Single-writer logs; LogSync height-vector exact set difference; offline-first | Native; 0.8.1; lower layers ~2 yrs published | None (native only, no WASM) | SQLite yes (SQLx); **Turso no** | **Native — it *is* an iroh app** | Pre-1.0; breaking changes per minor; wire format evolving | +| **p2panda-auth** | Group-membership CRDT; 4 levels Pull/` URIs) and the short-TTL, + auto-rotation policy (~1 h) now: a house CA issuing short-lived + X.509 with a URI SAN, plus the existing OIDC provider issuing JWTs + with the same URI as `sub`, already *is* an SVID system in substance. + Deploy SPIRE itself only when external interop (Istio/Envoy, cloud + workload-identity federation) or attestation becomes concrete. + Name the genuine gap honestly: **attestation** — minting identity + from observed evidence (kernel/platform selectors) with no stored + secret — is the one identity capability the house stack lacks, and + neither p2panda nor any candidate in this investigation supplies it + either. + +--- + +## 5. Decision points that remain Drew's + +Stated as choices with consequences. The evidence narrows these; it +cannot settle them, because each turns on risk appetite, sequencing, or +how much machinery the estate wants to own. + +1. **Revocation posture for replicated data.** (a) *Short windows + + broker renewal* (composition A): revocation latency is bounded and + predictable, but authority depends on a live renewal path — a + partitioned seat keeps its window. (b) *Coordination-free permanent + revocation* (composition B): revocation survives any merge, forever, + offline — at the price of owning the engine and its folklore. + (c) *Accept p2panda-auth as-is*: least new machinery; revocation is + eventual and retroactive, and delegated/scoped grants stay + unexpressible. This choice decides how a compromised seat's authority + actually dies across the estate. +2. **How much security-critical code the estate owns.** Adopt pre-1.0 + upstream code (p2panda spaces/DCGKA; Keyhive with G1/G2 open), + implement a Final spec in-house (Meadowcap), implement a design-doc + model in-house (Keyline), or buy boring maturity (Biscuit, capnp + Level 1). Each option trades audit surface, upstream bus factor, and + schedule differently; no measurement in the notes prices that trade. +3. **E2EE ambition for replicated fleet/atlas data.** Ship on unaudited + DCGKA now; wait for an audit or BeeKEM's maturation; or keep + replicated data channel-encrypted only (iroh/TLS) and skip the + data-layer E2EE entirely. Consequences either way: membership + metadata is exposed until control-message encryption lands, and + harvest-now-decrypt-later exposure stands until a post-quantum story + exists. What the data *is* decides how much this matters, and that + valuation is Drew's. +4. **Identity binding, and the curve question.** Bind author/NodeId keys + to the fleet CA / IdP CA (certificates attesting key ownership — a + bridge the estate builds; no candidate consumes X.509), or run + raw-key identity with the CA as a parallel system indefinitely. + Entangled with it: Ed25519 everywhere (the p2p/iroh/UCAN world's + native curve) vs the interim IdP CA's P-384 (spec-legal for + Meadowcap, excluded from UCAN's suite, unsupported by Biscuit). + The curve chosen for the token layer constrains which token layers + exist. +5. **Whether any domain earns the Willow data model.** Mutable, named + state with traceless deletion fits infrastructure state (registries, + configs, seat state) arguably better than append-only logs — but + adopting Willow anywhere means a second data plane and a + house-written Rust sync, because none exists. Whether a domain's + mutability needs justify that is a product call, not an evidence + call. +6. **Turso convergence.** Accept per-node SQLite beside the Turso + stores (p2panda's shipped shape; two replication stories for fleet + data), or fund a libsql backend for p2panda-store as estate-owned + code with an upstream-shaped maintenance tail. +7. **Upstream engagement posture.** Every serious candidate is a tiny, + grant-funded team (p2panda: three people; worm-blossom: two; Ink & + Switch: a handful). Depending on their roadmaps without funding, + contributing, or forking is itself a choice; so is the opposite. + (One hard fact for this item: the OCapN project prohibits + AI-generated contributions to its specs and tooling by policy — any + engagement there is human-authored only.) + +--- + +## 6. Recommended default + +**RECOMMENDATION** (Archer's, under the standing decision posture; +recorded here for ratification or override): + +> **Adopt composition A + C now; hold B as the tracked design north +> star.** +> +> - **Data plane:** p2panda core/sync/net/store — the leaning was right +> here; it is the iroh-native, Rust, SQLite, offline-first stack the +> estate already chose the transport half of. +> - **Authorisation for replicated data:** Meadowcap **as a +> specification**, bound to p2panda via header extensions, with the +> broker running short-window renewal; p2panda-auth kept as the +> membership layer it actually is; p2panda-encryption used with its +> unaudited status explicit (decision point 3 governs how far). +> - **Live sessions:** Biscuit tokens for session establishment + +> capnp-over-iroh Level 1 facets with interposition revocation +> (composition C), serving the Actions-exec and coordinator surfaces +> already in flight. +> - **Design reference:** Keyline's model is adopted as the estate's +> reference semantics for revocation and relay power — the standard +> our own mechanisms are judged against — without adopting Keyhive's +> code while G1/G2 stand. + +**Reasoning, in one paragraph.** The estate's centre of gravity is a +broker with frequently-checking-in seats, replicated operational state, +Cloudflare doors, and a growing live-session surface. A is the only +composition whose capability layer is a Final spec designed to be +borrowed, whose revocation weakness (no revocation, only non-renewal) +is precisely the one this estate can patch cheaply because its seats +already check in. B has strictly better revocation semantics but exists +as pre-alpha code carrying a disclosed revocation bypass in its key +seating path; adopting its *model* now and its *code* later captures the +ideas without betting the estate on them. C is not optional garnish: +the live-session surfaces are being built this month, and neither A nor +B says anything about them. p2panda-for-everything, by contrast, asks +the weakest layers of a pre-1.0 stack (auth, encryption integration) to +carry the estate's most security-critical weight, against the project's +own documentation. + +**What evidence would change this recommendation.** + +- **Keyhive closes G1/G2** and the ciphersuite construction gets its + independent review (or a full audit lands): composition B's *code* + becomes adoptable, and Keyline-as-code likely displaces + Meadowcap-as-spec — better revocation, native Relay, one auth system + instead of two. +- **p2panda reaches 1.0** with wire-format stability, an encryption + audit, and encrypted control messages: the data-plane bet strengthens + materially, and if its capability story grows teeth in the process, + the auth composition re-opens. +- **A conformant UCAN 1.0 Rust implementation** (working-group or + third-party) reaches stability: UCAN likely displaces Biscuit in C + (invocation separation; `did:key` identity) and pressures Meadowcap + in A. +- **Willow's Confidential Sync unpauses** and a maintained Rust sync + implementation appears (or iroh-willow is ported to current iroh): + the data-plane question re-opens for mutable-state domains + (decision point 5). +- **BeeKEM's paper survives peer review** and a second implementation + appears: the group-key layer decision re-opens independently of the + auth decision. +- **OCapN freezes a 1.0 wire version** and a real Rust implementation + reaches test-suite parity: the live-session layer could standardise + on OCapN CapTP instead of capnp Level 1. (Near-term probability, per + the ocap note's evidence: low.) + +--- + +*Sources: the five research notes in `research/` are the evidence base; +every load-bearing claim above traces to a claim in those notes and its +primary-source citation. This document is the investigation's synthesis +deliverable under the master prompt in +`p2panda-program-investigation-prompt.md`.* diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/p2panda-program-investigation-prompt.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/p2panda-program-investigation-prompt.md new file mode 100644 index 000000000..06dde7e62 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/p2panda-program-investigation-prompt.md @@ -0,0 +1,84 @@ +# Investigation: capability auth + p2p transport — p2panda-first, honestly compared + +Drew's direction, 2026-11-23 15:28 CST: "we're leaning towards using p2panda for +everything but go back for auth and transport and compare research dig into and +fully understand advantages of each — keyhive/subduction, p2panda-auth/sync, +willow/meadowcap, ocapn/captp/endo/goblins/agoric, capnproto/capnweb and any +other leading options especially if they work well with +rust/cloudflare/sqlite/turso/iroh." + +## The question + +For the fleet / id / atlas / mcpx estate, choose the **auth** (identity, +capabilities, delegation, groups, revocation) and **transport/sync** (how nodes +reach each other and replicate state) foundations. The current leaning is +**p2panda for everything**. This investigation must stress-test that leaning: +understand each candidate family from its own docs, specs, and code; state each +one's real advantages; and say plainly where p2panda wins, where it loses, and +what a composed stack (p2panda + something) would look like if composition +beats purity. + +## The estate it must fit (verified context) + +- **fleet**: a Rust binary (queue broker, placement, dispatch) with SQLite / + Turso (libsql) stores; seats are agents on laptops and sandboxes; GitHub + Actions runners are an emerging execution surface. A fleet CA program is + mid-build (Ed25519 / P-256 / RSA-4096 / ML-DSA-44 roots) and an interim IdP + CA (EC P-384) already issues for a minimal OIDC provider. +- **Transport today**: Tailscale/tsnet (mcpx is Go because tsnet is Go-only), + Cloudflare Worker doors (commander.security.cab, mcpx.security.cab) with + OAuth front doors, and a codified route-form family (fleet + commander/http/ssh). A design for hosts-without-Tailscale + iroh for + non-Muse agents + a generic pool primitive is recorded (#13752): iroh + NodeId = ed25519 identity, relays + hole punching, self-hosted relay/pkarr. +- **Data**: Turso/libsql + SQLite everywhere; Cloudflare Workers + KV + R2 at + the edge; NixOS hosts; everything self-hosted where feasible. +- **Hard preferences**: Rust-first for new core work; no connection/secret + material in public logs; capability attenuation over ambient authority where + the model supports it; offline/local-first operation must not be an + afterthought; measured claims only — maturity and performance statements + carry sources. + +## Families in scope + +1. **p2panda** — core (operations/logs, data models), **p2panda-auth**, + **p2panda-sync**, its iroh-based networking, encryption story, storage. +2. **keyhive / subduction** — Ink & Switch-lineage key management, member + graphs, document encryption, delegation; the Subduction sync protocol. +3. **willow / meadowcap** — the Willow protocol (Earthstar lineage) and its + Meadowcap capability system; namespaces, subspaces, path addressing. +4. **The object-capability network family** — **OCapN**, **CapTP**, **Endo**, + **Spritely Goblins**, **Agoric**: what each layer is, interop status, + implementation languages and maturity, the distributed-objects model vs + data replication. +5. **capnproto / capnweb** — Cap'n Proto serialization + RPC (capability-based + RPC design), capnp in Rust, and Cloudflare's Cap'n Web (JS/TS RPC on + Workers); what each does and does not provide for auth. +6. **The wider field** — any other leading option that fits the estate: + UCAN, Biscuit, macaroons, Veilid, Holepunch/Hypercore, libp2p, Freenet, + Holochain, AT Protocol patterns, Noise/WireGuard identity, SPIFFE/SPIRE — + surveyed briefly, deep-dived only if one plausibly beats the named families + on an axis that matters here. + +## Axes (every family, same axes) + +Identity & key management · capability model (delegation, attenuation, +revocation, expiry) · group management · encryption (in transit, at rest, +end-to-end, forward secrecy) · transport & NAT traversal · sync/replication +semantics (CRDT/log/operation-based; offline behaviour; conflict story) · +storage fit (SQLite/Turso; log-structured?) · Rust maturity (crates, activity, +who maintains) · Cloudflare fit (Workers/KV/R2/Durable Objects; WASM) · +iroh fit (native, composable, competing) · spec/interop status · project +health (funding, releases, community, license) · operational complexity · +what it pointedly does NOT do. + +## Deliverables + +- One research note per family in `research/` (this folder's sibling), written + from primary sources (project docs, specs, repos, crates.io) with links. +- A comparison + recommendation document: the matrix across the axes, the + honest case for and against "p2panda for everything", at least one composed + alternative, and the decision points that remain Drew's. +- Filed as a tracking issue in developing-today/code with the master prompt as + its first comment, and landed as a dated design record via PR (the + investigation-program pattern used for id/atlas/fleet/mcpx). diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/2026-11-23T22-02-29Z_research_p2p-auth-transport.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/2026-11-23T22-02-29Z_research_p2p-auth-transport.md new file mode 100644 index 000000000..383b3ca76 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/2026-11-23T22-02-29Z_research_p2p-auth-transport.md @@ -0,0 +1,99 @@ +# Research: capability auth + peer-to-peer transport — the underlying notes + +This folder is the research base for the auth + transport investigation +tracked in [#13779](https://github.com/developing-today/code/issues/13779). +The investigation's synthesis — the layer-by-layer comparison matrix, the +verdict, three composed stacks, and the decision points left open — already +landed as its own design record: +[Capability auth + p2p transport comparison](../2026-11-23T21-39-17Z_design_p2p-auth-transport-comparison/2026-11-23T21-39-17Z_design_p2p-auth-transport-comparison.md). +This bundle preserves the per-family research that the synthesis was built +from, so the reasoning stays auditable: every page below is a reorganised, +linked digest of one research lane's full notes. + +## The question + +For the fleet / id / atlas / mcpx estate, choose the **auth** foundations +(identity, capabilities, delegation, groups, revocation) and the +**transport/sync** foundations (how nodes reach each other and replicate +state). The starting leaning was "p2panda for everything"; the investigation +stress-tested that leaning family by family, from primary sources, on a +shared set of axes: identity & key management · capability model (delegation, +attenuation, revocation, expiry) · group management · encryption · +transport & NAT traversal · sync/replication semantics · storage fit +(SQLite/Turso) · Rust maturity · Cloudflare fit · iroh fit · spec/interop +status · project health · operational complexity · what each pointedly does +not do. + +The estate context the research was judged against: a Rust-first fleet +binary with SQLite/Turso stores and agent seats on laptops, sandboxes, and +GitHub Actions runners; a fleet CA program mid-build (Ed25519 / P-256 / +RSA-4096 / ML-DSA-44 roots) and an interim IdP CA (EC P-384) issuing for a +minimal OIDC provider; Tailscale/tsnet today, Cloudflare Worker doors at the +edge, and the iroh transport direction recorded in +[#13752](https://github.com/developing-today/code/issues/13752) (NodeId = +Ed25519 identity, relays + hole punching, self-hosted relay/pkarr). + +## The pages + +- [p2panda](p2panda.md) — the modular Rust stack (operations/logs, sync, + discovery, iroh networking, DCGKA group encryption, group-membership + auth, spaces). The data-plane candidate; its auth is a replicated group + CRDT, not a capability system — by its own documentation, which names + Meadowcap and UCAN as the compose-in capability layers. +- [Keyhive, Subduction, Beelay](keyhive-subduction-beelay.md) — Ink & + Switch's stack: Keyline "convergent capabilities" (a CRDT of signed + delegations/revocations with the field's best-specified revocation), + BeeKEM group keys, and the Subduction sync protocol that already ships + an iroh transport. Adopt the model now; the code is pre-alpha with + disclosed live gaps. +- [Willow / Meadowcap](willow-meadowcap.md) — the spec family whose + capability system (receiver-bound, area-scoped, offline-verifiable, + attenuation as a validity theorem) is the export-grade asset; its data + model fits mutable named state, its network sync layer is unfinished. +- [The ocap family: CapTP, OCapN, Endo, Goblins, Agoric](ocap-captp-endo-goblins.md) + — live distributed objects, not data replication: immediate revocation + and Turing-complete attenuation, no offline story, no Rust presence. + A rich idea-mine (interposition revocation, petnames, handoffs). +- [Cap'n Proto / Cap'n Web](capnp-capnweb.md) — the only live-ocap + programming model, proven inside workerd; Level 1 is what actually + ships. Sits above a transport that supplies identity + encryption and + beside whatever supplies durable offline authority. +- [UCAN](ucan.md) — the deepest capability-token semantics (delegation / + invocation split, mandatory monotonic attenuation, receipts), with + principals that are mechanically the estate's Ed25519 keys. Design: + adopt now. Rust 1.0 code: not yet dependable. +- [Biscuit and the token family](biscuit-and-token-family.md) — Biscuit + (the deployable offline token: Rust reference implementation, official + WASM build, Datalog attenuation, external revocation list), macaroons + as prior art, and the survey's remaining flags: Holochain's capability + design, Holepunch's sync model, Freenet, SPIFFE discipline, and the + Noise/WireGuard channel layer. +- [Veilid](veilid.md) — the privacy-routing framework: a working DHT with + signed mutable records and receiver-private addressing, no capability + system, pre-1.0. A narrow complement candidate (rendezvous/discovery), + not an alternate base. +- [IPFS / libp2p](ipfs-libp2p.md) — the public content-addressed + distribution network and its modular networking suite: unique + distribution properties, a fundamental mutable-state mismatch, and a + 2026 stewardship break at the IPFS centre. libp2p stays the interop + escape hatch. +- [Bluesky / AT Protocol](bluesky-atproto.md) — where Bluesky is heading + (IETF standardisation, PLC governance handover, permissioned "Spaces"), + its OAuth + permission-set answer to delegated authority, and the + scoped read-compatibility path for `pkgs/id` + (filed as [#13787](https://github.com/developing-today/code/issues/13787)). +- [Worm Blossom catalogue — digest](worm-blossom-catalogue.md) — a + condensed map of the Willow collective's full public record: 59 weekly + diary entries and 20 projects, the headline findings (including the + Pillow collaboration with p2panda), and pointers to the full catalogue. + +## Headline shape of the findings + +No surveyed system provides identity + capabilities + sync + storage in +one. Every credible stack composes: a transport that proves key possession +(iroh), a capability layer, and a log- or state-based sync core. The +synthesis record carries the full matrix and the recommended default +(p2panda data plane + Meadowcap-as-spec authorisation + broker +short-window renewal now; the Keyline model as the tracked design north +star; Biscuit + capnp-over-iroh for live sessions), plus the evidence that +would change it. These pages are the evidence underneath that record. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/biscuit-and-token-family.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/biscuit-and-token-family.md new file mode 100644 index 000000000..24d261fc6 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/biscuit-and-token-family.md @@ -0,0 +1,216 @@ +# Biscuit and the token family — the survey's remaining pieces + +Full lane notes: Part 2 of research lane CAPNP-SURVEY for +[#13779](https://github.com/developing-today/code/issues/13779), from +project docs, specs, repos, and crates.io, read 2026-11-23. The capnp half +of the same lane lives in [Cap'n Proto / Cap'n Web](capnp-capnweb.md); +UCAN, the deep dive the survey flagged as the most promising token format, +has its [own page](ucan.md). + +## Biscuit — the deployable offline token + +**What it is.** Biscuit is an authorization token format designed for +offline verification and decentralized attenuation: a chain of +public-key-signed blocks (Ed25519), where the root key signs the first +block and each block may *contain* the public key that signs the next, so +attenuation is just appending a more restrictive block — no round trip to +the issuer, no shared secret +([biscuitsec.org](https://www.biscuitsec.org/), +[biscuit-auth on crates.io](https://crates.io/crates/biscuit-auth)). The +logic language is **Datalog**: blocks carry facts, rules, and checks; +the verifier evaluates the token's world together with its own policies +and denies unless a policy grants. Originally by Geoffroy Couprie +(Eclipse's Eclipse Biscuit programme now hosts it); the reference +implementation is `biscuit-auth` in Rust, with maintained bindings for +Java, Go, Haskell, Python, WASM, and C FFI. There is a public +specification, a web playground, and a CLI. + +**Version/maturity at research time.** `biscuit-auth` 6.0 (September +2025) — a major release adding token inspection from a WASM component, +third-party block requests, and snapshot (de)serialization; the 5.x line +was steady through 2025. This is the most production-hardened artefact in +the whole survey lane: real semver, real changelog discipline, real +multi-language surface. + +**Capability model.** Authority is data: the authority block states facts +(`right("file1", "read")`, `user("alice")`), later blocks add *checks* +that can only narrow (a check block must succeed for the token to verify; +there is no way to widen). Attenuation is **offline and unilateral** — +anyone holding a token can mint a strictly-weaker copy locally, which is +the property that makes Biscuit the natural fit for edge/gateway chains: +mint broad at the origin, narrow at each hop. **Expiry is idiomatic, not +structural**: the canonical pattern is a check comparing a verifier-supplied +`time()` fact against an expiration fact in the token — nothing forces an +author to include one, and there is no non-expiry sentinel rule; a +forgotten check is a non-expiring token. **Revocation is external and +explicit**: every block carries a unique revocation ID; the verifier +consults a revocation list (a set of IDs) and rejects on a hit. That is +the whole mechanism — a deny-list lookup, cheap and operationally boring, +which is a compliment: it composes with any storage you already run +(a SQLite table, a config push, a gossip topic). **Third-party blocks** +(5.x/6.x) let a *different* key sign a block into a token — cross-domain +attestation ("the payment service confirms this session paid") without +sharing keys. + +**Identity.** None, and that is by design: Biscuit is an authorization +format, not an identity system. A token *carries* identity facts asserted +by its issuer (`user("alice")`); who "alice" is, how she authenticated, +and how her key relates to a transport peer are all outside the format. +There is no invocation object, no audience binding in the token itself — +a Biscuit is a **bearer token**: possession is use. (Audience/resource +scoping is conventionally enforced by checks against verifier-supplied +facts; that is policy discipline, not a cryptographic binding.) + +**Algorithms.** Ed25519 only, per spec (the design leans on the +append-only signature chain). **No P-384, no algorithm agility** — same +estate caveat as elsewhere: Biscuit cannot be verified *by* the P-384 CA +world; it lives below it, keyed by Ed25519 seat/issuer keys the CA +enrols. + +**Offline/local-first.** This is Biscuit's home ground: verification is +pure local computation (Datalog evaluation with explicit resource limits — +facts/iterations/time caps are verifier-configurable, a real +DoS-resistance story); attenuation is offline; the only online-ish +dependency is revocation-list freshness, and the failure mode is the +usual one (stale list = recently-revoked token still verifies until the +list syncs — bounded by short TTLs). + +**Cloudflare fit.** First-class: `biscuit-auth` compiles to WASM and +Eclipse Biscuit ships an official WASM build; Workers can verify and +attenuate tokens at the edge with the reference implementation, not a +port. Rust fit is the reference implementation itself. iroh fit: +orthogonal and clean — a Biscuit rides inside any message/stream as an +opaque blob; iroh supplies peer identity, Biscuit supplies portable +authority; the composition is a paragraph of application code. + +**Boundary (what Biscuit does not provide):** identity/enrolment; +audience-bound exercise (bearer semantics); an invocation/receipt object; +groups (facts can *name* groups; membership lifecycle is the issuer's); +encryption (it's a signed, readable token — contents are visible to +holders; do not put secrets in facts); transport; sync; storage. + +**Estate verdict.** Biscuit is the survey's **deployable-now** answer for +offline-checkable, attenuable authority where bearer semantics are +acceptable and the verifier is ours (broker gates, edge checks, dispatch +leases). It loses to UCAN on binding/provenance and wins on maturity, +policy expressiveness (Datalog > UCAN's jq-subset for data-dependent +checks), and operational simplicity. The two are complements more than +rivals; see the head-to-head in the [UCAN page](ucan.md). + +## Macaroons — the ancestor, and why not + +Macaroons (Google, 2014) are the design Biscuit and UCAN both descend +from conceptually: bearer tokens attenuated by appending caveats, each +caveat narrowing the token, verified by chained HMACs. The caveat model +(including third-party caveats with discharge proofs) is genuinely +elegant and battle-tested inside Google/Uber-style infrastructures. +**Why not for this estate:** verification is **symmetric** — the verifier +must hold the root secret, so any verifier can also *mint*. In a +public-key estate (Ed25519 seats, a CA, third-party verifiers, offline +peers), that property is disqualifying for cross-party authority: you +cannot hand verification to parties you don't also trust with issuance. +Macaroons remain the right mental model and prior art; Biscuit is their +public-key successor for our purposes. (Rust: `macaroon` crates exist but +are thin next to `biscuit-auth`.) + +## The p2p also-rans, honestly graded + +Three systems from the p2p world were checked for capability designs +worth stealing: + +**Holochain — the interesting one.** Holochain's capability system is +the most complete *capability* design in the p2p set: **CapGrants** +(grantor-side records naming a grantee — by agent key, or *unrestricted* +— a set of functions on a zome, and a secret) paired with **CapClaims** +(grantee-side receipts), exercised by presenting the secret as a membrane +proof at call time; grants are revocable by deleting/updating the grant +entry, and because Holochain is a DHT of source chains, grant state is +data with provenance, not server state. Two estate-relevant facts: +(1) Holochain's networking layer (Kitsune2) is built on **iroh** as its +transport in current versions — the composition "capability membrane over +iroh" is not hypothetical, it is shipping architecture; (2) the +grant/claim *pair* (authority recorded at both ends) is a design pattern +worth borrowing for auditability wherever we land. What Holochain is +not: a library you adopt for auth alone — the capability system is +welded to its runtime/DHT/zome model. **Mine the design; don't adopt the +platform.** + +**Holepunch (Pear / Hypercore) — best sync model, wrong substrate.** +Autobase + signed append-only logs (Hypercore) give a genuinely elegant +multi-writer replication model, and its capability story is essentially +"possession of the log's keys + encryption keys as capabilities" — +simple, effective, coarse. The stack is JavaScript through and through; +there is no Rust path that isn't a rewrite. **Verdict: steal the sync +*model* (signed logs, writer-set linearisation) if ever needed — it is +the model p2panda also follows — but there is nothing to depend on.** + +**Freenet (Hyphanet/Locutus) — competes with iroh, loses.** Freenet's +contract/state model with capability-ish access via keys is a full +alternative *platform* (its own networking, its own storage contracts), +not a layer. Against iroh for transport and p2panda for sync it offers +nothing this estate lacks, at the cost of a second platform. Noted and +set aside. + +## SPIFFE — not a capability system, but two disciplines worth adopting + +SPIFFE (with SPIRE as its implementation) issues short-lived identity +documents (SVIDs — X.509 or JWT) to workloads after node/workload +**attestation**: the workload proves what it is (cloud metadata, k8s +service account, process attributes) and receives a credential with a +TTL measured in minutes-to-hours, rotated automatically. It is +authentication infrastructure, not authorization: an SVID says *who*, +never *what they may do*. + +Why it appears in this survey at all: two of its disciplines are the +estate's known weak spots. + +1. **Short-TTL + automatic rotation as the default posture** — the same + posture UCAN recommends and the fleet broker design assumes; SPIFFE + is the proof it operates at industry scale. +2. **Attestation-based issuance is the one genuine capability gap in the + house stack.** The fleet's runner-handoff problem (prove "I am inside + *this* GitHub Actions run" before receiving exec authority) *is* an + attestation problem — GitHub's OIDC token is an attestation — and + SPIFFE's selector model (issuance policy = predicates over attested + attributes) is the cleanest existing vocabulary for it. + +**Verdict: adopt the ID format (`spiffe://…` URIs are a fine workload +naming scheme) and the issuance discipline; do not deploy SPIRE** — the +estate's CA + broker already occupy that operational niche, and SPIFFE +grants no authority by itself. + +## ATProto's patterns — one borrowing + +ATProto has no capability system (its delegated-authority story is OAuth, +covered in the [Bluesky page](bluesky-atproto.md)). What the survey flags +from it is the **identity key discipline**: a priority-ordered set of +rotation keys (PLC) separate from the everyday signing key, with +adversarial recovery semantics (a higher-priority key can override a +compromised lower one within a time window). That split — *signing keys +are cheap and replaceable; recovery keys are few, cold, and senior* — is +directly borrowable into the estate's IdP/CA programme, where seat-key +compromise recovery is otherwise "the CA re-enrols and everyone +re-pins." + +## Noise / WireGuard — the channel layer, already subsumed + +Noise-protocol-framework handshakes and WireGuard appear in capability +surveys because channel binding *is* a form of capability (reachability ++ a session key = authority to talk). For this estate the point is +settled: iroh's QUIC/TLS stack already provides authenticated encrypted +channels keyed by the same Ed25519 identities everything else uses. +Nothing to adopt separately; noted so the layer isn't double-counted in +stack diagrams. + +## Family summary + +| Piece | One-line verdict | +|---|---| +| Biscuit | Deployable now: offline, attenuable, Datalog-checked bearer authority; revocation = deny-list; the broker-gate default. | +| Macaroons | Prior art; symmetric verification disqualifies it for a public-key estate. | +| Holochain caps | Most complete capability *design* in the p2p set, already composed over iroh (Kitsune2); mine the design, skip the platform. | +| Holepunch | Best-in-class sync model, JS-only; model already shared with p2panda. | +| Freenet | Alternative platform, not a layer; set aside. | +| SPIFFE | Adopt the ID format + short-TTL/attestation issuance discipline; don't deploy SPIRE. | +| ATProto keys | Borrow the rotation-key/signing-key split with adversarial recovery into the IdP/CA programme. | +| Noise/WireGuard | Channel layer; subsumed by iroh. | diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/bluesky-atproto.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/bluesky-atproto.md new file mode 100644 index 000000000..4bab737d1 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/bluesky-atproto.md @@ -0,0 +1,137 @@ +# Bluesky / AT Protocol — a public-data protocol finishing itself, and what we borrow + +Full lane notes: research lane BLUESKY for +[#13779](https://github.com/developing-today/code/issues/13779), from +public protocol sources only (specs, IETF charter, PLC announcements, +Bluesky engineering posts, ecosystem measurements). Read 2026-11-23. + +**Shape of the answer.** AT Protocol was designed for *public* data — +public posts, public follows, public everything — and in 2026 it +essentially finished that design and handed it to formal governance. Its +delegated-authority answer is a hardened federated OAuth profile, which +is a different species from everything else in this bundle: authority +lives at a server, is granted interactively, and is revoked centrally. +For this estate the protocol itself is not a candidate substrate. Three +things are worth taking: the permission-set *vocabulary* idea, the +key-discipline patterns (cross-referenced from the survey), and one +concrete engineering task — **read compatibility for `id`**, filed as +[#13787](https://github.com/developing-today/code/issues/13787). + +## State of the protocol, late 2026 + +- **The IETF ATP working group was chartered in March 2026.** Its scope + is deliberately narrow: the repository data structure, firehose sync, + AT URIs, and identifier-resolution requirements. Explicitly *out* of + scope: OAuth, Lexicon, PLC, and non-public data. Read that scoping as + the protocol's own statement of what is finished and universal versus + what remains Bluesky-product territory. +- **PLC has been institutionalised.** The **PLC Organization is a + registered Swiss association** (announced 2026-09-28) with a board + mostly *not* drawn from Bluesky, preparing — not yet executing — the + takeover of plc.directory. PLC read replicas shipped in February 2026, + so the directory is no longer a single read point even before the + legal handover completes. +- **Sync modernised.** Sync 1.1 arrived via **Tap** (December 2025) and + the bsky.network relay upgrade (January 2026), easing the path for + independent relays and AppViews. +- **The ecosystem is real and lopsided.** Community measurements + (November 2026) count roughly **47.8M repositories**, of which about + **96.9% still sit on Bluesky-operated PDSes**, across roughly **3,600 + independent PDS hosts**. Named independents with real user bases: + **Blacksky** (~44.9K accounts, running its own relay and AppView and + the Rust PDS "rsky"), **Eurosky**, and **Tangled**. The protocol's + exit-and-rehost story is proven at small scale and untested at large + scale — both halves of that sentence matter. + +## The active frontier: "Spaces" (permissioned data) + +Proposal **0016**, in alpha since **2026-08-20**, is ATProto's first move +beyond public data: **Spaces** — per-space gated repositories living +under a single space-authority DID. The crucial precision, from the +proposal itself: **access control here is not confidentiality.** Spaces +gate *who the PDS serves the data to*; there is **no end-to-end +encryption**, and credentials are app-bound and short-lived (~10 +minutes). Spaces is therefore best understood as "private-ish groups on +trusted servers," architecturally closer to a Discord server than to +anything in the capability-auth half of this bundle. It validates the +demand for permissioned social data; it does not change what this estate +should build on — our permissioned-data story must be cryptographic +(the p2panda/Keyline/Meadowcap family), not server-gated. + +## OAuth: Bluesky's actual delegated-authority answer + +Since ATProto has no capability tokens, its delegation story is the +OAuth profile Bluesky hardened for federation — worth recording +precisely, because it is well-engineered *of its kind*: + +- **OAuth 2.1 profile, strict**: authorization-code flow only, **PKCE + mandatory**, Pushed Authorization Requests (PAR), **DPoP**-bound + tokens (proof-of-possession, so stolen tokens don't replay). +- **`client_id` is a URL** pointing to a public client-metadata + document — no central app registry; any client self-describes. +- Confidential clients authenticate with **private_key_jwt / JWKS**. +- **Permission sets** (shipped early 2026) are the genuinely novel part: + protocol-native, named bundles of authority across five resource + types — **repo, rpc, blob, identity, account** — referenced from + client metadata via `include:`, so an app asks for a *named, + community-reviewable permission set* instead of composing raw scopes. + +The structural contrast with the capability family is the finding: +authority in this model **lives at the PDS**, is granted in **one +interactive hop** by the account holder, **cannot be re-delegated or +attenuated by the holder of the grant**, is **revoked immediately and +centrally**, and has **zero offline or peer-to-peer story** — a client +with no network path to the PDS has no authority at all. That is a +rational design for "apps act on my social account," and a non-starter +for seats that must act while disconnected. **What we borrow is the +permission-set vocabulary idea**: named, versioned, reviewable bundles +of authority (`include:` as a UX) are a better human interface to +a capability taxonomy than raw command lists — a presentation layer the +estate can put over UCAN commands or Keyline scopes without importing +the OAuth substrate. + +## The filed task: `id` read compatibility (#13787) + +The one piece of engineering this lane produced: +[#13787](https://github.com/developing-today/code/issues/13787) — *id: +AT Protocol read compatibility — DID resolution + repo/record ingestion +(consider)*, linked to epic +[#2056](https://github.com/developing-today/code/issues/2056) and to +#13779. Scope, as filed: + +- **Handle → DID resolution with bidirectional verification** (the + handle's DNS/well-known proof must match the DID document's claim), + covering **did:plc** (whose strong form verifies the audit-log + operation chain) and **did:web**. +- **Two read paths, honestly distinguished**: light XRPC reads (trust + the serving PDS — fine for display) versus the **verifiable path**: + fetch `com.atproto.sync.getRepo` as a CAR file, reconstruct the MST + (Merkle Search Tree: SHA-256 key-depth fanout 4, prefix-compressed + nodes), check root equality against the repo commit, verify the + commit signature under the DID document's signing key, and enforce + revision monotonicity. Only the second path gives `id` evidence-grade + ingestion. +- **Optional relay firehose follow** for ongoing mirroring, behind the + same verification. +- **Placement**: a new read-only importer crate, `id-import-atproto`, + following the `id-import-notion` precedent — explicitly **not** in + id-core and **not** in id-sync. Read compatibility is an ingestion + adapter, not a change to the estate's identity model. +- **Rust candidates**: **atrium** (MIT) as the default — its + `atrium-identity` and `atrium-repo` crates map to the two halves of + the job; **jacquard** (MPL-2.0, zero-copy, performance-friendly, + single-maintainer-shaped, pre-1.0) as the alternative if profiling + demands it; **atproto-crates** (separable primitives, 0.14.x) for + cherry-picked pieces. + +## What this lane rules out + +For the avoidance of doubt in future discussions: ATProto is not a +candidate for the estate's auth, sync, or storage layers — it is a +public-data social protocol whose permissioned-data frontier is +server-gated by design, whose authority model requires a live server, +and whose identity system (DIDs) is the only layer we interoperate with, +read-only, via #13787. Its governance maturation (IETF charter, Swiss +PLC association) is genuinely good news for the open social web; it +does not move any estate decision except confirming that DID-based +identity interop is a stable target worth the importer. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/capnp-capnweb.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/capnp-capnweb.md new file mode 100644 index 000000000..3e32382b6 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/capnp-capnweb.md @@ -0,0 +1,325 @@ +# Cap'n Proto / Cap'n Web — the live object-capability programming model + +Full lane notes: Part 1 of research lane CAPNP-SURVEY for +[#13779](https://github.com/developing-today/code/issues/13779), from +project docs, specs, repos, and crates.io, read 2026-11-23. The wider +token-field survey from the same lane lives in +[Biscuit and the token family](biscuit-and-token-family.md). + +## What the two pieces are + +**Cap'n Proto** is two things sharing a schema language: (a) a binary +**serialization format** whose wire layout is the in-memory layout — +fixed widths, fixed offsets, offset-based pointers, little-endian — so a +message needs *no* encode/decode pass and can be mmap'd, randomly +accessed, and read incrementally; and (b) an **RPC system** in which +interface references are a first-class type in the schema, so a method +parameter or return value can be a live reference to a remote object +([capnproto.org](https://capnproto.org/), +[RPC protocol doc](https://capnproto.org/rpc.html)). It was written by +Kenton Varda (primary author of Protocol Buffers v2) and is now +maintained by the Cloudflare Workers team; it is the RPC substrate inside +`workerd` and was built for Sandstorm.io. + +**Cap'n Web** is a separate, younger protocol by the same author: a +schema-free, JSON-based object-capability RPC implementation in pure +TypeScript for browsers and web servers, announced by Cloudflare in +September 2025 and explicitly "experimental" +([Cloudflare blog: Cap'n Web](https://blog.cloudflare.com/capnweb-javascript-rpc-library/)). +It is *not* wire-compatible with Cap'n Proto; it is a sibling design that +borrows the capability model and promise pipelining and drops the schema +and the binary format. It interoperates with Workers RPC (which is itself +Cap'n Proto under the hood) through workerd. + +## The serialization layer (brief, because it is not the decision) + +- Zero-copy: there is no encoding/decoding step; the Cap'n Proto + encoding is appropriate both as a data interchange format and an + in-memory representation. A "packing" codec strips zero bytes to reach + protobuf-class wire sizes while staying faster than a parse-based + format. +- Schema evolution is structural: fields are numbered in the order added, + new fields go at the end, readers bounds-check — old and new schemas + interoperate without a version negotiation. Struct-list + canonicalization exists specifically to make Cap'n Proto more + appropriate for use in cryptographic protocols — i.e. a canonical byte + form you can sign. +- Accessors validate pointers before following them; the project has had + fuzzing and expert security review. + +Estate relevance: Cap'n Proto serialization is a fine fit anywhere the +estate wants a fast, signable, schema-evolving binary message format, and +it is *already* the format under Workers RPC. But serialization is not +what this investigation is deciding; the RPC capability model is. + +## The RPC capability model + +Cap'n Proto RPC is a distributed-object protocol descended from CapTP +(the E language's protocol). The core rule, from the spec doc +([capnproto.org/rpc.html, Security](https://capnproto.org/rpc.html)): +interface references are capabilities — they both designate an object to +call and confer permission to call it. When a new object is created, only +the creator is initially able to call it. When the object is passed over +a network connection, the receiver gains permission to make calls — but +no one else does; others cannot access the capability without consent of +either the host or the receiver, because the host assigns it an ID +specific to the connection over which it was sent. + +Consequences that matter for the estate: + +- **No ambient authority, no ACL table to keep in sync.** Authority is + the reference graph. A service never checks "who are you and what may + you do" against a separate policy store for calls arriving on a + capability; holding the (connection-scoped, unforgeable) reference + *is* the authorization. The spec doc notes this design avoids + confused-deputy attacks while keeping legitimate use easy — and that + ACLs can still be layered on top if wanted. +- **Attenuation is ordinary programming.** You attenuate by handing out a + different object — a wrapper exposing fewer methods — not by minting a + restricted token. Delegation is passing the reference on. There is no + expiry field, no caveat language, no delegation-chain format: the model + is *live objects*, not *bearer documents*. +- **Promise pipelining is the performance half of the same design.** + Every call returns a promise whose interface-typed results can + themselves be called (or passed as parameters) before the first call + resolves; the client sends the whole chain in one flight and the server + executes it as results land — you can chain any number of such calls + together, with diamond dependencies and everything, and Cap'n Proto + collapses them all into one round trip. This is what makes + fine-grained object interfaces viable over high-latency links instead + of forcing coarse singleton APIs. +- **Disconnect semantics are part of the model.** When a connection + drops, every capability served over it becomes "disconnected" and + calls throw; when the last reference to a server object is dropped, + the object is closed/destroyed — servers get per-client resource + cleanup without timeouts or leak-prone session tables. +- **Revocation is a pattern, not a primitive: the membrane.** Neither + Cap'n Proto nor Cap'n Web has a "revoke this capability" verb. The + ocap literature's answer, which this family expects you to build, is + the **membrane**: a revocable forwarder that wraps the target *and + transitively wraps every capability that flows through it in either + direction* (arguments and return values), so revoking the membrane + revokes the whole subgraph of access that ever crossed it. A plain + revocable forwarder leaks authority precisely because capabilities pass + through it unwrapped; the membrane exists to fix that. Sandstorm is + the worked example at platform scale: the platform tracks the + capability graph between apps so access can be visualized and revoked + by the user, and its "Powerbox" picker is capability introduction as a + UX. + +## The level model — spec ambition vs. shipped reality + +The RPC spec divides features into levels an implementation advertises +([rpc.html, Protocol Features](https://capnproto.org/rpc.html)): + +| Level | Feature | What it means | +|---|---|---| +| 1 | Object references + promise pipelining | Two-party capability RPC as described above. | +| 2 | Persistent capabilities | "Save" a capability to a persistent token (a *sturdy ref*); "restore" it later, on a new connection. The host app must implement save/restore support. | +| 3 | Three-party handoff | If A hands B a reference to C, B and C automatically form a direct connection; calls stop proxying through A. | +| 4 | Reference equality / joining | Securely verify that capabilities received from different parties designate the same object (escrow-style patterns). | + +What implementations actually ship, per their own documentation: + +- **C++ (reference implementation): Level 1.** Its own RPC page states + that as of version 0.4 the C++ RPC implementation is a Level 1 + implementation, and persistent capabilities, three-way introductions, + and distributed equality are not yet implemented + ([capnproto.org/cxxrpc.html](https://capnproto.org/cxxrpc.html)). That + status text is old, but an independent technology profile re-checked in + October 2026 still records the C++ implementation as documenting only + level 1. The C++ library does ship the *primitives* for persistence + (save/restore hooks) — Sandstorm built sturdy refs on them — but the + restore semantics are the application's. +- **Rust (`capnp-rpc`): Level 1, explicitly.** "This is a level one + implementation of the Cap'n Proto remote procedure call protocol. It + is a fairly direct translation of the original C++ implementation" + ([docs.rs/capnp-rpc README](https://docs.rs/crate/capnp-rpc/0.19.0/source/README.md)). +- **OCaml (`capnp-rpc`, by the Mirage/OCaml-CI folks): the furthest along + — Level 2 complete, Level 3 not implemented.** With encryption and + authentication using TLS and support for persistence; but messages + between Carol and Bob are still routed via Alice. This is the + exception that shows what the higher levels cost: a dedicated, + security-focused team, years of work, one language. +- **Go** exposes a `Network` abstraction with `Introduce` / + `DialIntroduced` and `ThirdPartyCapID` types — the level-3 handoff + machinery exists in its API surface — but the package is versioned + 3.0.0-alpha, which tells its own maturity story. +- **Nobody ships Level 4.** And the direction of travel is away from + standardizing the top levels: Kenton Varda argued on the project list + in 2017 that level 2's sturdy-ref restore turned out to be + intrinsically tied to the application (the Sandstorm lesson) and + probably level 2 should be ripped out of the spec entirely. + +**Bottom line for the estate:** when you adopt Cap'n Proto RPC you are +adopting *Level 1*: two-party, connection-scoped capabilities with +pipelining. Persistent capabilities, multi-vat handoff, and equality are +spec text and application-layer work, in every implementation you would +actually deploy. That is not a defect — Level 1 is the part that is +proven at Cloudflare scale — but any design that assumes "capnp gives us +distributed capabilities across a mesh" is assuming the unbuilt levels. + +## Rust maturity + +- The Rust implementation is a single-maintainer-lineage community + project (David Renshaw, a Sandstorm core developer). Only the C++ + implementation is maintained by the core team; other languages "vary + in readiness". +- It is alive and used: `capnp-rpc` shows 99 releases on lib.rs, roughly + 131k downloads/month, used in ~69 crates; the serialization crates + track the same release train + ([lib.rs/crates/capnp-rpc](https://lib.rs/crates/capnp-rpc)). Release + cadence has historically been bursty, so this is a stable-but-thin + maintenance bus factor, not a team. +- The RPC runtime is built on futures/tokio-adjacent plumbing, is + transport-agnostic (its two-party VatNetwork runs over any + bidirectional byte stream you hand it), and inherits the C++ design + closely — which also means it inherits Level 1 as the ceiling. +- No WASM/Workers story for the Rust crates: on Cloudflare you would use + Cap'n Proto via workerd's JS/Python RPC surface, not via `capnp-rpc` + compiled to WASM (Workers' own runtime *is* Cap'n Proto, but that is + Cloudflare's C++ implementation, not the Rust crates). + +## Encryption and identity — deliberately out of scope + +- **Cap'n Proto specifies no encryption and no peer identity.** The spec + says that at this time Cap'n Proto does not specify an encryption + scheme, but as it is a simple byte stream protocol, it can easily be + layered on top of SSL/TLS or other such protocols + ([rpc.html, Encryption](https://capnproto.org/rpc.html)). A + capability-based encrypted transport with three-party introductions was + a roadmap aspiration, never a shipped spec. +- Therefore Cap'n Proto has **no identity model at all**: no keys, no + names, no enrolment. The capability graph starts at a *bootstrap + capability* handed to whoever connects; authenticating *who* connected + (TLS client certs, a token, an iroh NodeId check) is entirely the + embedding application's job. The one production-hardened pairing in the + wild is OCaml's: TLS for encryption *and* authentication under the + capability layer. +- The C++ RPC layer also carries an explicit robustness caveat: per the + project's FAQ, the RPC layer isn't yet robust against + resource-exhaustion attacks — you rate-limit and bound in front of it. +- **Cap'n Web** is the same shape, web-flavoured: it runs over HTTPS/WSS + (transport security is the platform's), and authentication is *in-band + by design* — the canonical pattern is an `authenticate(apiKey)` method + that returns an authenticated session object you cannot forge, because + the only way to hold one is to have it returned to you. Its own README + security section is blunt about what stays yours: authenticating + in-band rather than with cookies, rate-limiting because pipelining is + cheap for attackers, setting transport payload limits, and validating + types at runtime are the operator's responsibility. + +## Cap'n Web in detail + +- **What it is:** an object-capability RPC protocol + pure-TypeScript + implementation, MIT-licensed, under 16 kB minified+gzipped with zero + dependencies, running in all major browsers, Cloudflare Workers, Node, + Bun and Deno ([cloudflare/capnweb](https://github.com/cloudflare/capnweb)). + Repo created June 2025; 24 releases and ~4k GitHub stars at research + time; the author and Cloudflare both call it new and experimental. +- **Wire format:** JSON with a pre/post-processing layer that encodes the + special types JSON lacks (dates, bigints, byte arrays, errors, and — + crucially — stubs and promises by reference). Human-readable on + purpose; there is no schema and no code generation; TypeScript + interfaces give compile-time checking only, and runtime validation is + a separate concern. +- **Capability model:** same ocap core as Cap'n Proto — functions and + `RpcTarget` objects pass *by reference* as stubs; calls are + bidirectional (a server can call a callback the client passed it); + promise pipelining works in both WebSocket and HTTP-batch modes; + stubs can be passed onward to other parties; disposal is explicit and + reference-counted, with docs for session reconnection and what a + disconnect destroys. +- **Transports:** HTTP (batch mode: one request/response carries a whole + pipelined batch; references die when the batch completes), WebSocket + (long-lived sessions, bidirectional), and `postMessage()`/MessagePort + (iframe/worker boundaries) out of the box; custom transports are a + documented extension point. +- **Workers integration:** it is the web-facing form of the Workers RPC + system — a Worker can serve a Cap'n Web endpoint inside a normal + `fetch` handler, and Cap'n Web stubs interoperate with Workers RPC + stubs (service bindings, Durable Objects) per the README's interop + docs. Workers RPC itself is production infrastructure at Cloudflare, + built on Cap'n Proto. +- **What it deliberately leaves out:** identity/authentication (in-band + `authenticate()` pattern only), encryption (HTTPS/WSS does it), + persistence of capabilities across sessions, storage of any kind, + group management, revocation (membrane pattern is yours to build), and + any non-JS implementation (a Rust `capnweb-core` crate exists but is a + single 0.1.0 release — a sketch, not a stack). + +## The boundary — what neither provides (precise) + +Neither Cap'n Proto nor Cap'n Web provides, at any shipped level: + +1. **Identity / key management** — no keys, no names, no enrolment, no + rotation. +2. **Authentication of peers** — the bootstrap capability goes to whoever + holds the connection; who that is, is your problem. +3. **Encryption** — unspecified by Cap'n Proto; platform-provided for + Cap'n Web. No forward-secrecy story of their own. +4. **Offline / persistent authority (as shipped)** — capabilities are + connection-scoped; level-2 persistence is unimplemented in C++ and + Rust and application-defined where it exists (OCaml). A capability + cannot be exercised while disconnected, and cannot be carried in a + stored document the way a signed token can. +5. **Token-style attenuation with expiry/caveats** — attenuation is by + facet object, delegation by reference passing; there is no + serializable, expiring, caveat-carrying credential format. +6. **Revocation as a primitive** — membranes/caretakers are patterns you + implement; disconnection revokes incidentally. +7. **Group management** — no groups, membership, or roles exist in the + model; a "group" is an object you build whose methods hand out facets. +8. **Sync / replication** — nothing. RPC is live request/response between + connected parties; there is no log, no CRDT, no store-and-forward, no + merge semantics. Offline behaviour is "calls throw disconnected." +9. **Storage** — nothing. Messages can be written to disk (the + serialization format is mmap-friendly), but there is no store, index, + or query layer, and no SQLite/Turso integration story. +10. **Discovery / NAT traversal / rendezvous** — a Cap'n Proto vat must + already have a byte stream to its peer. Level 3 would have formed + direct connections after introduction; it is unimplemented in the + implementations above, so introduction today means proxying through + the introducer. + +## Axes summary + +Scores 1 (absent/poor) – 5 (excellent), estate-weighted. + +| Axis | Cap'n Proto (Rust) | Cap'n Web | Note | +|---|---|---|---| +| Identity & key management | 1 | 1 | None in either; bootstrap-cap + your authn. | +| Capability model | 4 | 4 | True ocap with pipelining; docked for connection-scoped lifetime and pattern-only revocation. | +| — delegation | 4 | 4 | Reference passing; Cap'n Web stubs pass onward between parties. | +| — attenuation | 4 | 4 | Facet objects; no caveat language needed or available. | +| — revocation | 2 | 2 | Membrane pattern only; disconnect revokes incidentally. | +| — expiry | 1 | 1 | No expiry concept; session/batch lifetime is the bound. | +| Group management | 1 | 1 | Build-it-yourself objects. | +| Encryption | 2 | 3 | Proto: bring TLS/Noise yourself. Web: HTTPS/WSS platform default. | +| Transport & NAT | 2 | 3 | Proto: any byte stream, no rendezvous/NAT help. Web: HTTP/WS/postMessage — excellent on the web, no p2p NAT story. | +| Sync/replication | 1 | 1 | None; live RPC only. | +| Storage fit (SQLite/Turso) | 2 | 1 | Proto serialization is a fine signable blob format for rows/blobs; no store integration. Web: JSON only. | +| Rust maturity | 3 | 1 | `capnp`/`capnp-rpc` real, Level 1, thin maintenance. Cap'n Web in Rust: one 0.1.0 crate. | +| Cloudflare fit | 5 | 5 | workerd *is* Cap'n Proto; Cap'n Web is a first-party Workers citizen. | +| iroh fit | 3 | 2 | Proto runs happily *over* an iroh stream and iroh supplies the identity/encryption capnp lacks — composable, not native. Web: no iroh story. | +| Spec/interop status | 3 | 2 | Proto: stable spec, levels mostly unimplemented, multi-language serialization interop is real. Web: single-vendor spec, pre-1.0, JS-only in practice. | +| Project health | 4 | 3 | Proto: Cloudflare-maintained, production at huge scale. Web: active and first-party but months old and self-described experimental. | +| Operational complexity | 3 | 4 | Proto: schema discipline + you build authn/transport/persistence. Web: near-zero setup, but you build everything above RPC. | +| Offline/local-first | 1 | 1 | Disconnected = broken capabilities, by design. | + +**Verdict.** Cap'n Proto's real advantage is narrow and deep: it is the +only candidate in this whole investigation that gives you *live, +unforgeable, delegable authority as a programming model* — with promise +pipelining making that model fast enough to use naively — and it is +proven inside the exact edge runtime this estate already deploys +(Workers). Cap'n Web extends the same advantage to browsers and Worker +HTTP surfaces with almost zero ceremony. But both are **call-layer +technologies, not auth or sync foundations**: identity, persistence of +authority, offline operation, groups, revocation-as-a-system, storage +and replication are all outside the boundary. In a composed stack, +capnp/capnweb sit *above* a transport that gives them identity and +encryption (iroh streams; TLS/WSS at the edge) and *beside* whatever +provides durable, offline-checkable authority (tokens/documents) and +replication. They do not compete with p2panda-auth/sync so much as occupy +a layer those systems don't address: what an already-authorized live +session can do, call by call. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/ipfs-libp2p.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/ipfs-libp2p.md new file mode 100644 index 000000000..82a89b70b --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/ipfs-libp2p.md @@ -0,0 +1,131 @@ +# IPFS / libp2p — judged as a base: neither, and the stewardship story is why + +Full lane notes: Part 2 of research lane VEILID-IPFS for +[#13779](https://github.com/developing-today/code/issues/13779), from +project announcements, implementation repos, crates.io, and measurement +literature, read 2026-11-23. The Veilid half of the same lane has its +[own page](veilid.md). + +**Judgment up front: neither IPFS nor libp2p as a base for this estate.** +libp2p itself is healthy software; IPFS-the-ecosystem just went through +a stewardship collapse that is the single best cautionary data point in +this whole investigation about building on other people's p2p +infrastructure; and both were designed for a problem — a public, +permissionless, content-addressed web — that is adjacent to, but not, +this estate's problem (named seats, capability auth, private sync). +iroh exists precisely because its authors (several of them libp2p/IPFS +veterans) concluded the general-purpose stack's generality was the cost. + +## The stewardship shock, stated plainly + +**Kubo v0.43 is the last release from Interplanetary Shipyard.** The +Shipyard — the organisation that maintained the core IPFS implementations +after Protocol Labs spun them out — announced the end of its IPFS work +effective **2026-09-30**, after Protocol Labs declined to renew funding. +The affected surface is the centre of the ecosystem: **Kubo** (the +reference node), **Helia** (the JS implementation), **Boxo** (the shared +Go library), **Rainbow** (the gateway implementation), plus Desktop and +Companion. These projects did not get a new steward with the +announcement; they lost their dedicated maintainers. + +The surrounding infrastructure had already been retreating: + +- **Cloudflare's public IPFS gateway** — for years the default "just + fetch it via https" path — exited on **2024-08-14**. +- **Infura's IPFS service** ended in **August 2026**. +- Public bootstrap and gateway capacity is in wind-down alongside the + implementations. + +None of this means IPFS content disappears (content addressing is +content addressing; anyone can run the code). It means: the *maintained +centre* that an adopter in 2023 would have relied on — reference node, +JS stack, gateways, hosted pinning — has dissolved within one funding +decision. For an estate choosing infrastructure to build a decade on, +this is the data point: **the risk was never the protocol's elegance; it +was a single funder's renewal.** (Contrast, within this same +investigation: p2panda's grant-to-grant smallness is at least *visible* +and plural; libp2p's maintenance is anchored by infrastructure users — +below.) + +## libp2p itself: healthy, and still not the answer + +libp2p the library is in a different position from IPFS the product: + +- **rust-libp2p** is actively released (facade crate 0.57.x across + September–October 2026), with roughly **718k downloads/month** on + crates.io, and production users whose incentives are structural — + Ethereum consensus clients (Lighthouse), Filecoin (Forest), Substrate. + It will be maintained because consensus networks run on it. +- Even so, commitment has limits: **Parity built litep2p** — a ground-up + alternative implementation — rather than deepen its investment in + rust-libp2p for Substrate's future. When your largest users hedge by + rewriting, the library is a commons, not a platform. + +The technical judgement matches the organisational one. libp2p is a +*menu*: multiaddr addressing, multihash/multicodec registries, a dozen +transports, pluggable muxers, Kademlia, gossipsub, relay, AutoNAT, +DCUtR hole-punching — assembled per deployment. That assembly is the +famous tax: NAT traversal in libp2p is *assembled* (AutoNAT to learn +your situation + Circuit Relay v2 for fallback + DCUtR to upgrade to +direct), provider/DHT behaviour varies by configuration, and two +libp2p applications interoperate only after agreeing on most of the +menu. **iroh is the deliberate refusal of that menu**: one addressing +scheme (an Ed25519 key), one hash (BLAKE3), one transport family +(QUIC, direct-first with relay fallback), shipped as decisions rather +than options — and iroh 1.0 shipped in June 2026 with that posture +intact. This estate already made that bet; nothing in the libp2p +landscape argues for unmaking it. + +## IPFS the protocol, on the axes that matter here + +- **Content addressing is genuinely good** — CIDs, Merkle-DAGs, CAR + files are the best-developed vocabulary in the field for "name data by + its hash and verify it anywhere," and pieces of that vocabulary are + already inside this programme (UCAN's CIDs are IPFS CIDs; p2panda + interops with the same hashing world). Adopting the *vocabulary* is + free and already done; it does not require adopting the network. +- **Discovery/replication economics are the measured weak point.** DHT + provider records expire at **48 hours** (content must be perpetually + re-announced by *someone*), and measurement studies of the public + network find only **2.71% of files replicated more than 5 times** and + **5% of peers hosting over 80% of content** — the public network is, in + practice, a small set of pinning services and gateways wearing a p2p + protocol. The one bright spot: **Provide Sweep** (default since Kubo + 0.39) substantially fixed provider-record scaling, with a claimed 97% + reduction in DHT lookups for large providers — evidence the design + *can* be repaired, arriving in the same season its maintainers left. +- **IPNS** (mutable naming) is a single signed pointer register: one key, + one current value, sequence-numbered. Fine as a "latest version" + pointer; it is not a sync protocol and has no multi-writer story. +- **No capability/auth model.** IPFS has no authorisation layer beyond + key possession (IPNS keys, private-network pre-shared keys as a + network-admission blunt instrument). Everything this investigation + exists to decide — delegation, attenuation, groups, revocation — would + still be entirely to build. Bitswap/gossipsub are distribution + mechanisms for public data; private, authorised replication is not + what they are for. + +## What remains defensible + +Exactly one use survives the judgement: **IPFS as an optional public +artefact-distribution mirror.** If the estate ever wants release +artefacts, public datasets, or documentation mirrored in a +content-addressed public network (fetchable by CID, verifiable offline, +hostable by anyone), publishing *to* IPFS is a reasonable distribution +decision — with eyes open about pinning (you are your own pinning +service now; the hosted ones left) and about stewardship (pin the Kubo +version you test against; the maintenance centre is gone). That is a +publishing choice about public artefacts, **not an architecture +adoption**: no seat identity, no auth, no private sync should ever be +designed on top of it. + +## The lesson the lane actually files + +The IPFS outcome is the investigation's cleanest evidence for a rule the +estate should keep: **when evaluating p2p infrastructure, weight +stewardship structure over protocol merit.** Ask who maintains it, paid +by whom, with what succession if the funder walks — before asking how +elegant the DHT is. Applied across this bundle, that rule is part of why +the synthesis prefers composing boring, separately-maintained layers +(iroh, p2panda, Biscuit, SQLite) over adopting any single totalising +p2p platform. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/keyhive-subduction-beelay.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/keyhive-subduction-beelay.md new file mode 100644 index 000000000..abc2b97e9 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/keyhive-subduction-beelay.md @@ -0,0 +1,578 @@ +# Keyhive, Subduction, and Beelay — convergent capabilities and encrypted sync (Ink & Switch) + +Full lane notes: research lane KEYHIVE for +[#13779](https://github.com/developing-today/code/issues/13779), written +2026-11-23 from the Keyhive dev notebook, the in-repo design documents, +both GitHub repos, crates.io / docs.rs, and the BeeKEM paper. + +## Verdict in one sentence + +Keyhive is the only candidate in this programme that treats +*authorization itself* as a replicated, offline-first data structure — a +state-based CRDT of signed delegations and revocations ("Keyline") whose +evaluation gives coordination-free revocation, plus a decentralised +group-key protocol (BeeKEM) that turns that membership graph into +end-to-end encryption keys with post-compromise security. Nothing else in +the field does this combination. It is also, today, **pre-alpha, +unaudited, and carrying known authorisation gaps its own threat model +discloses** — a design to learn from and a composition candidate for later, +not a foundation to build the estate on this quarter. + +## The three pieces, and the naming history + +One stack from one lab (Ink & Switch — the Automerge lab), three separable +artifacts: + +- **Keyhive** — the access-control system: signing, encryption, and + delegation for local-first data. Rust workspace, Apache-2.0 + ([inkandswitch/keyhive](https://github.com/inkandswitch/keyhive)). + Three layers: convergent capabilities (the authority graph), a + group-management CRDT, and E2EE with causal keys. +- **BeeKEM** — the continuous group key agreement (CGKA) protocol inside + Keyhive: a concurrent variant of TreeKEM (the protocol under MLS) that + needs no central ordering server. Now also a published research paper + with security proofs (ePrint 2026/1434, July 2026; listed as in + submission). +- **Subduction** — the sync protocol: peer-to-peer synchronisation of + encrypted, hash-linked data (CRDT commits) over pluggable transports, + with Keyhive as its authorisation layer. Separate Rust workspace, MIT OR + Apache-2.0 ([inkandswitch/subduction](https://github.com/inkandswitch/subduction)). + +Naming: the project was originally **Beehive**, renamed Keyhive before +open-sourcing. **Beelay** was the first Keyhive-enabled sync/relay design +(an RPC protocol with RIBLT set reconciliation); the Keyhive README states +plainly that Subduction is "the successor to Beelay". + +The design intent is explicit about scope: Keyhive does access control for +replicated data and deliberately does **not** do identity, naming, key +recovery, or sync — those are layered above/beside it, and the design +overview draws identity, recovery, and sync as external dashed boxes. + +## Identity & key management + +- **Keys are the only principals.** Every node in the authority graph is + an Ed25519 verifying key; at the Keyline level there is *no distinction* + between individuals, groups, and documents — higher layers assign + meaning to particular keys. +- **An individual is one immutable Ed25519 keypair.** A *person* is + modelled as a group whose members are that person's per-device + individuals; key rotation for a person = add a new device individual, + remove the old one. +- **Documents/groups bootstrap via a root edge.** At creation the subject + key signs exactly one delegation to a freshly minted "root role," and + the subject's signing key is then destroyed (Keyhive ships an + `EphemeralSigner` for this). The subject's identity is its verifying + key, permanently; its authority immediately lives in the role graph. +- **Human identity is explicitly out of scope.** Keyhive excludes the + binding of a human identity to an application's identifier; name + registration, discovery, and verification are left to a future layer. + The design overview names the intended neighbours: PKI, DIDs, Keyoxide, + KERI, OpenPGP, petnames, ATProto. This composes cleanly with this + estate's existing fleet CA / IdP work — Keyhive would *consume* those + identities, not replace them. +- **Key custody is the host's problem, by design.** Keyhive does not own + key storage; its `AsyncSigner` abstraction lets hosts keep signing keys + in WebCrypto (non-extractable), hardware, or a KMS. +- **Share (encryption) keys**: each group member also holds an X25519 + keypair used by BeeKEM, published as signed "prekey" operations that + must be canonical large-order keys verified against the issuer's + signature, so nobody can publish keys for an identity they don't hold. + +## Capability model — Keyline, "convergent capabilities" + +This is the family's centre of gravity, and the part with no real rival in +the programme. + +### The model + +Keyline is "the authority graph: a state-based CRDT of delegations and +revocations". It sits deliberately between the two classical capability +families: object capabilities are fail-stop under partition (wrong for +local-first); certificate capabilities (SPKI/SDSI, zcap-ld, UCAN) are +partition-tolerant but stateless. Convergent capabilities carry CRDT state +to get both. + +There are exactly two certificate kinds, both signed Ed25519 statements, +content-addressed by the digest of issuer + payload, stored in an +append-only set whose merge is set union: + +- **Delegation**: `{issuer, audience, subject, power, citation?}` — + "issuer asserts that audience may exercise `power` over `subject`." + `subject` is a *scope*, not an endpoint: a delegation whose subject is a + role is a *membership* and conveys everything that role reaches, now or + in the future (late binding). +- **Revocation**: `{issuer, revoke: Digest, retain}` — names + one delegation by hash; `retain` carries per-subject content-retention + watermarks for the content layer and is never read by evaluation. + +Power is a totally ordered ladder, and the bottom rung is this estate's +friend: + +``` +Relay < Read < Edit < Admin +``` + +`Relay` = may sync and relay ciphertext but **cannot decrypt** — it makes +untrusted relays first-class citizens of the graph. `Read` = decrypt, +`Edit` = write, `Admin` = act on the graph itself. + +### No proof chains — authority is derived, not presented + +A delegation has **no proof field**; justification is computed at +verification time from the whole certificate set: an audience holds +standing over a subject iff *some* unbroken route exists from the subject +to the audience through live delegations. In the design doc's own +summary: "Keyline is RT₀ with SDSI chain discovery, with revocation +semantics closest to ARBAC97's administrative relations, evaluated as +stratified Datalog." + +- **Late binding**: a delegation issued before its issuer had authority + becomes effective the moment the issuer gains it, and dies the moment + the issuer loses it. "Edges are facts; authority is derived." +- **Redundant routes**: access via two chains survives one breaking; + there is no single brittle proof chain to invalidate (contrast UCAN, + where the chain is the artifact). +- **Order independence**: any two replicas holding the same set compute + the same authority graph, in any delivery order — the CRDT property. +- Evaluation is graph-global: no certificate can be verified in + isolation, only against a set — a stratified-Datalog least fixed point + in two passes (a positive pass ignoring all revocations, then a live + pass filtering routes through the computed revocation coverage). + +### Attenuation + +Effective power is the **maximum over routes of the minimum along each +route** (widest-path / bottleneck): delegating `Admin` when you hold only +`Edit` conveys `Edit`. Indirection cannot raise power, and `keyhive_core` +refuses to even sign a delegation above the issuer's effective power. + +### Revocation — the hard part, done unusually well + +Revocation in eventually-consistent systems is where capability designs +usually hand-wave. Keyline's semantics are specified to an unusual depth: + +- **Coordination-free and permanent.** A revocation, once applied by any + replica, can never be un-applied by a merge; access can only be restored + by a fresh signature from live authority, never by delivery order. +- **Who can revoke what.** The issuer or the audience of a delegation can + kill it on *every* route (total). A third party's revocation breaks the + target only on routes passing through the revoker's **admin reach** — + the set of nodes that key *ever* held Admin over, computed with all + revocations ignored, so it only ever grows. Anyone can revoke a + delegation on routes through their own node. A revocation outside those + scopes is *inert* — valid, admissible, zero effect. +- **Implicit cascade.** Revoking Alice's membership enumerates nothing; + every delegation she issued simply fails the liveness check at next + evaluation, transitively. +- **Revival, honestly treated as both feature and hazard.** If a removed + key regains standing, its old delegations spring back to life (repair by + re-add costs one certificate, with provenance intact). The hazard — an + unintended re-add reviving forgotten grants — is blunted by documented + practice: explicit revocations on removal (permanent, survives re-add) + and fresh-key discipline after compromise. +- **The ex-admin sharp edge, disclosed rather than hidden.** An ex-admin + retains revocation power over their frozen admin reach *forever* — + deny-only, so they can grief but never grant. The durable escape is + **rotation**: mint a fresh role key, re-supply it, re-roster the + survivors. The design doc is blunt that "removing an admin needs a + rotation." +- **Root-role caveat.** Removal from the root role is *never durable* + while the subject key is destroyed; the root role is append-only trust — + "treat it like a root CA: set it up once and use it rarely," with all + churn in second-layer roles where rotation works. + +### What the capability model pointedly does NOT have + +- **No expiry.** No timestamp, TTL, or not-after field on either + certificate kind, deliberately: the threat model lists "trusted time" as + a non-goal — ordering is causal only. Short-lived authority must be + modelled as delegation + prompt revocation, or layered on top. For an + estate used to UCAN-style expiring tokens, this is the single biggest + semantic difference. +- **No ambient policy language.** Roles, powerboxes, caretakers, pinning, + device groups are *patterns* over the two primitives, not built-in + constructs. +- **Back-dating is only partly answerable.** Keyhive cannot distinguish a + genuinely old operation arriving late from a fabricated back-dated one; + revocations record content-head watermarks so the content layer can + reject post-revocation edits, but applications that need this must add a + timestamping or anchoring service. + +## Group management + +Groups are not a separate subsystem; they are the same graph read +differently. A **role** is just a key that others hold membership in; +membership = delegation with the role as `subject`; a **supply** = +delegation *to* a role about another subject. Roles nest arbitrarily, +documents are themselves groups, and documents-as-members gives +folder-style hierarchies. Because membership is late-bound, supplying a +role with a new document grants it to all current members with **no +re-issuance**. A documented pattern, **constitutional flatness** (a role's +Admin memberships name only individuals, never another role), makes +rosters self-certifying and untouchable by outsiders, and makes rotation +cheap. The group graph is also what drives encryption and sync: following +delegations tells a writer who holds Read (who must be seated in the CGKA +tree), and tells a trust-minimised sync engine which documents a peer may +pull. + +## Encryption + +### Primitives + +Fixed ciphersuite, no crypto agility (an explicit non-goal): **Ed25519** +signing, **X25519** Diffie-Hellman, **XChaCha20-Poly1305** AEAD, **BLAKE3** +hashing and key derivation. The one novel construction is the AEAD nonce: +a synthetic nonce computed as a keyed hash, under a subkey of the +encryption key, of the associated data and plaintext — deterministic, +key-committing, and explicitly "assumed secure pending review"; the repo +README warns that the nonce / key-commitment construction has not been +independently reviewed. + +### BeeKEM — per-document group keys + +Every document with readers gets a **BeeKEM tree**: a binary tree whose +leaves are the members (each leaf = member ID + current X25519 public +key), whose root holds the group's current **root secret** encrypted under +the tree. A member decrypts the root secret by walking its leaf-to-root +path doing O(log n) DH decryptions. + +- **Why not MLS/TreeKEM**: TreeKEM requires a central server to totally + order operations and pick winners among concurrent ones. BeeKEM keeps + TreeKEM's shape but requires only *causal* order, merging concurrent + updates in any order — when two leaves concurrently update a node, both + DH keys are kept as "conflict keys," the node is treated as blank for + encryption purposes, and updates encrypt to the node's *resolution*, so + a compromised old leaf key cannot decrypt across the fork ("cross-fork + security"). A causally later update collapses the conflicts. +- **Membership change = key change.** *Remove* blanks the member's leaf + and its entire path to the root; *add* places the member at the next + blank leaf and blanks its path. The next member *Update* (key rotation) + re-keys the blanked path and restores a root secret the removed member + cannot derive — the post-compromise-security mechanism. +- **Costs**: O(log n) update/decrypt in the common case, O(n) worst case + (maximally blanked or conflicted tree); worst-case space O(n log n) + while conflicts are unresolved. Target group size is "on the order of + thousands of members." +- Only members with `Read` or higher are seated as BeeKEM leaves; `Relay` + holders are excluded from the CGKA group. Keyline drives the CGKA: the + capability graph determines whose X25519 keys are in the tree. + +### Content encryption — causal keys, and the forward-secrecy trade + +Content is encrypted **at rest, in chunks**: ranges of CRDT changes are +compressed (Automerge binary format) and then encrypted. **Causal +encryption**: each chunk's key envelope includes the keys of all its +*causal predecessor* chunks (Cryptree-like). Holding a chunk's key lets +you iteratively discover the keys for its entire causal history. +**Forward secrecy is deliberately sacrificed for content**, and the design +says why: an op-based CRDT cannot materialise a view with gaps in history, +so every reader needs every historical key anyway. What is retained is +**post-compromise security for the future**: revoke + next BeeKEM path +update cuts off all future chunks. The threat model lists forward secrecy +as an explicit non-goal. + +- **Padding**: block bodies are padded to PADMÉ lengths (256-byte floor); + operation counts, CGKA operation sizes, timing, document IDs, and the + membership graph remain visible to relays — accepted, since relays must + see membership to evaluate capabilities. +- **In transit**: Keyhive itself prescribes no channel security; the + design expects sync to run over TLS/mTLS or an equivalently confidential + transport, with all payloads E2EE regardless. Subduction adds its own + authenticated handshake. + +### Known gaps — from the project's own threat model + +The current *code* falls short of the design in ways the authors disclose +as tracked gaps G1–G4. Two are authorisation-relevant: + +- **G1**: CGKA authorisation reads the *positive* graph (ignoring + revocations), so **a revoked member can delegate to a fresh key of its + own and get that key seated in the tree** by every replica. +- **G2**: a CGKA add's share key is not checked against the added + member's published prekeys — an adder can seat a key it holds itself. +- **G3**: eviction DoS — any principal with positive standing (even + `Relay`) can manufacture a cite-able revocation and remove a reader + from the tree (denial of service, not disclosure). +- **G4**: replicas reconcile their BeeKEM trees only after their *own* + membership writes, so a peer's revocation removes a reader from the + tree only via the revoker's replica. + +Plus: no content layer yet reads the `retain` watermark, and the +synthetic-nonce construction awaits independent review. And the +repo-level warning stands over everything: "DO NOT use this release in +production applications… The code has not had a security audit." + +## Subduction — the sync protocol + +### What it syncs + +Subduction replicates **Sedimentrees**: a set-based, content-addressed +store for one hash-linked commit DAG — *loose commits* (individual signed +commits) plus *fragments* (compressed ranges of commits). It is +essentially an LSM tree adapted to CRDT graph data, with one twist — +compaction must be deterministic across replicas that have never +communicated, so fragment depth is assigned by the number of leading zero +bytes in each item's BLAKE3 hash. The protocol is **CRDT-agnostic**: it +syncs hash-linked data; Automerge is the original target and the only +shipped data integration, but the core sync layer doesn't assume anything +about the CRDT it's carrying. + +### Reconciliation + +- **Fingerprint set reconciliation.** Peers exchange 8-byte SipHash-2-4 + fingerprints computed with a random per-request seed; batch sync + reconciles a whole tree in **1.5 round trips** (request with fingerprint + summary + subscribe flag; response with the data you're missing and the + fingerprints needed back; a fire-and-forget third leg — storage is + idempotent, and an empty diff next round confirms success). The authors + claim the initial diff is ~75% smaller than sending full digests. +- **Subscriptions.** After batch sync, peers opt into real-time + incremental forwarding, filtered per-subscriber by authorisation. + Subscriptions are per-peer, not per-connection. +- **Encryption-friendly by construction.** Reconciliation runs on content + hashes and fingerprints only; sync never touches plaintext — a relay can + reconcile and forward data it cannot read. + +### Peer authentication and authorisation + +- **Mutual authentication handshake**: two messages, symmetric. The + initiator sends a signed challenge `{audience, timestamp, nonce}`; the + responder verifies the signature, validates audience and timestamp, + checks the nonce against a replay cache (4 buckets × 3 min = 12-minute + window), and returns a signed response over the challenge digest. Both + sides learn each other's peer ID from the verifying key — Ed25519 + throughout. +- **Identity ≠ permission, kept separate in the API.** The handshake + establishes only *who* is connecting. Whether they may connect is a + `ConnectionPolicy`; whether they may fetch/store a given tree is a + `StoragePolicy` — distinct traits. +- **Keyhive integration is a policy crate**: with it, a relay serves only + peers that can prove `Relay` or better for the document in question. +- **Revocation interplay**: there is no revocation message in Subduction. + Access changes arrive via Keyhive; when the auth check fails, + Subduction simply stops forwarding to that peer. + +### Relationship to Keyhive, precisely + +Subduction does not depend on Keyhive, and Keyhive does not depend on +Subduction. The coupling is a policy interface plus a shared worldview: +both treat signed, hash-linked, encrypted data as the unit of replication, +and the Keyhive graph tells Subduction which trees a peer may pull. In +the one shipped end-to-end stack (Automerge Repo + GAIOS), Keyhive is +plugged in as the auth provider at the repo layer, while Keyhive's own +operations initially synced over the same network stack with a naive +diffing mechanism that Subduction is meant to replace. + +## BeeKEM the paper — the family's strongest maturity signal + +*BeeKEM: Decentralized, Secure and Efficient Group Key Agreement* — Yen, +Fábrega, Da, Kleppmann, Mumm, Park, Zelenka — is on the Cryptology ePrint +Archive as [Paper 2026/1434](https://eprint.iacr.asia/2026/1434) (July +2026; listed as in submission). Its claims: the first decentralised group +key agreement protocol with logarithmic update cost in the common case +(degrading to linear in the worst case) **and proofs of security**, proven +under the existing DCGKA security definitions, with a new security notion +(cross-fork security) for attacks unique to the decentralised setting, an +open-source implementation, and benchmarks competitive with OpenMLS. That +is a materially stronger evidence base than any other novel crypto in this +programme. The honest counterweight, from the ActivityPub E2EE task +force's public minutes (2026-07-28): participants recommended BeeKEM as a +model to consider while noting it "would need another cryptographer to +review it" — preprint + proofs, not yet peer-reviewed or independently +audited. + +## Transport assumptions & NAT traversal + +- **Keyhive prescribes no transport at all.** Its operations are signed + data; the design overview notes the only requirement is that "patches + eventually get from one machine to another, so P2P, sync servers, + sneakernets, and carrier pigeon are all feasible in this model." +- **Subduction is transport-agnostic with three shipped transports**: + WebSocket, HTTP long-poll ("for restricted network environments"), and + **Iroh/QUIC** (`subduction_iroh`, "for direct peer-to-peer + connections"). +- **NAT traversal is inherited, not built**: the iroh transport gets + iroh's hole-punching and relay fallback; the WebSocket/HTTP transports + assume a reachable server/relay. The protocol core is `no_std`, so it + also runs in Wasm/browser and embedded contexts. +- There is **no discovery system**: peers connect to known peer IDs / + URLs. Discovery and naming are, as with identity, someone else's layer. + +## Sync / replication semantics + +- **Data layer**: set-union replication of content-addressed, signed + items. Idempotent — receiving the same data twice is always safe. No + total order anywhere; causal order only where the CRDT requires it. +- **Auth layer**: state-based CRDT; convergence is by construction (same + set ⇒ same derived authority graph). +- **Offline behaviour**: the family's home turf — every operation + (delegate, revoke, edit, rotate keys) is a local act on local state + that merges later. Nothing requires a live round trip to a server or + quorum. +- **Conflict story**: data conflicts are the carried CRDT's problem; + auth conflicts are resolved by the evaluation rules. The one + content-layer conflict the family explicitly leaves open is *whiteout* + — whether a revoked member's past writes stay materialised — punted to + the application via the `retain` watermark, with the semantics of + combining watermarks still an open question. + +## Storage fit + +- **Keyline's stored state is two append-only tables.** Delegations and + revocations are flat, fixed-shape, content-addressed rows — as + SQLite-shaped as data gets. The subtlety is *evaluation*: the + implementers' notes work through exactly this question. The pipeline + (positive pass → coverage → live pass) is expressible in SQL as chained + CTEs, **except** the standing derivation itself, which is a *non-linear* + fixpoint (a derivation step can consume two recursively derived facts) + and therefore exceeds `WITH RECURSIVE` in both SQLite and PostgreSQL. A + SQL backend needs one ordinary statement per fixpoint round, plus a + driver loop that repeats until a round adds no rows. The loop is the + only non-declarative ingredient in the design. Evaluation cost itself is + polynomial with small constants; the reference evaluator answers + `members()` in ~1 ms for a 180-member document. +- **What ships today is an in-memory store**: `keyline_memory` is the + in-memory reference store behind a `Keyline` store trait — a + SQLite/Turso backend is a designed-for, documented exercise, not + existing code. `keyhive_core` additionally has an `archive` module for + serialising a whole Keyhive state. +- **Subduction storage is a trait with several backends, none of them + SQLite**: filesystem storage with journaling/fsync, an in-repo redb + storage, in-memory storage, and a published object-storage crate + (`subduction_object_storage`, S3 and other object stores — R2's API is + S3-compatible). For this estate: Turso/libsql would be a new backend + behind existing traits on both sides — plausible, bounded work; not a + download. + +## Rust maturity & project health + +- **Keyhive**: repo created 2024-08-13; 328 commits, 280 stars, 32 + releases; Apache-2.0. Crates published: `keyhive_core` 0.5.0 + (2026-06-26; six releases since 0.1.0 in June 2025; ~13.5k all-time + downloads, ~1k/month), `beekem` 0.5.x, `keyhive_crypto`, + `keyhive_content`, `keyhive_codec`, `keyline`, `keyline_memory`, + `keyhive_wasm` (Wasm + TypeScript bindings). CI checks include `no_std` + and MSRV. Self-described status, repeated in the README, the notebook, + and the crate keywords ("pre-alpha", "preview"): **pre-alpha, unstable + APIs, no security audit, do not use in production**. +- **Subduction**: repo created 2025-07-18; 280 commits, 139 stars, 110 + releases; crates at 0.19.x with releases still landing ~fortnightly; + dual MIT/Apache-2.0. Self-described as "an early release preview… very + unstable API… DO NOT use for production use cases at this time". +- **Signs of life beyond the lab**: Ink & Switch is dogfooding both in + GAIOS (its ARIA Safeguarded AI Programme platform) — Keyhive as the auth + provider for Automerge Repo, Subduction being integrated to replace the + reference sync server, which "has shown stress points" at scale. A + third-party adopter (Muni Town's Roomy) is publicly planning on Keyhive + for access control. +- **Funding/backing**: Ink & Switch is a small independent research lab + (1–10 people) funded by grants, sponsorships, and commissioned work; + Keyhive work was accelerated under the ARIA programme for GAIOS. Bus + factor is a real consideration: the named authors across both repos and + the paper are a handful of people. +- **Spec/interop status**: no standards-track specification and no second + implementation of either protocol. The closest things to specs are the + in-repo design documents (extensive, and unusually candid) and the + BeeKEM paper. One genuine interop hook exists: the `keyline` crate + ships a **conformance suite** (scenarios and laws) that the design docs + treat as the contract — "where this document and the conformance suite + disagree, the suite wins." + +## Cloudflare fit + +Nothing Cloudflare-specific exists. No Workers bindings, Durable Objects +integration, or KV usage in either repo. What exists is Wasm: +`keyhive_wasm` and Subduction's Wasm crates targeting browser and Node.js. +Running Keyline evaluation inside a Worker via `keyhive_wasm` is plausible +but unpublished and unexercised; the estate would be the first. **R2 is +reachable in principle**: `subduction_object_storage` puts a Sedimentree +store on any `object_store` backend, and that crate family speaks S3. This +is a storage backend for a Subduction *server*, not a Worker deployment +shape. Subduction's server story is the CLI (with NixOS and Home Manager +modules in the flake — a genuine fit for this estate's NixOS hosts) or +hyper/axum embedding. In the estate's current shape, a Subduction relay +would sit *behind* a Cloudflare door, not on the edge. + +## iroh fit + +The best of any family in the programme, on paper: Subduction **already +ships an iroh transport** (`subduction_iroh`, published at 0.11.x) — it +doesn't merely compose with iroh, it has done the composition. The identity +models also align: Subduction peer IDs are Ed25519 verifying keys learned +from the handshake, and iroh NodeIds are Ed25519 public keys — the estate's +[#13752](https://github.com/developing-today/code/issues/13752) design +already treats NodeId-as-identity as the iroh story, and a +Subduction-over-iroh binding inherits it directly. Keyhive itself is +transport-blind, so it neither helps nor hinders. Caveat: the iroh +transport's maturity inside Subduction is unproven — published and +integration-tested alongside the other transports, but the project's own +dogfooding (GAIOS/Automerge Repo) runs over WebSocket-style network stacks. + +## What this family pointedly does NOT do + +- **Identity, naming, discovery, key recovery** — all layered elsewhere, + by design. +- **Forward secrecy for content history** — sacrificed deliberately; PCS + for future content is the guarantee. +- **Expiry / trusted time** — no clocks in the capability layer at all. +- **Availability** — "Keyhive guarantees that what is delivered is + correct, not that it is delivered." +- **Traffic-analysis resistance** beyond coarse size padding; relays see + the membership graph. +- **A data model** — Keyhive/Subduction carry *other people's* CRDTs. + There is no Keyhive answer to "what is a document's schema" or "how do + concurrent text edits merge." +- **Production readiness** — by the authors' own repeated statement. + +## Where this family sits in a composed stack for this estate + +**As the auth layer over someone else's sync — that is exactly the shape +it was designed for, and the strongest composition story in this +programme.** Concretely, over p2panda: p2panda operations are signed, +hash-linked, and Ed25519-keyed — the same shape of artifact Keyhive's +layers consume. In a composed stack: p2panda topics/documents become +Keyline subjects; fleet seats and user devices become individuals grouped +under person/seat roles; Keyline evaluation answers "may this key +pull/edit this topic" at every replica, offline, with coordination-free +revocation; BeeKEM seats the Read-holders of each encrypted topic and +provides the group keys p2panda itself does not manage. + +The **`Relay` power level is a direct hit on this estate's architecture**: +the Cloudflare doors and bridge relays that today hold ambient trust +would hold `Relay` — able to store/forward ciphertext, cryptographically +unable to read, and *inside* the same authorisation graph as everyone +else rather than trusted by construction. + +**Subduction is a credible alternative sync for hash-linked data** if the +estate ever wants a second sync engine: CRDT-agnostic, iroh-native, +fingerprint reconciliation, and an object-storage backend that fits R2. +But adopting it *instead of* p2panda-sync means adopting its data +structure (Sedimentree) too, and it is younger and less proven than +Keyhive's design documents are. + +**The blockers are maturity, not fit:** + +1. Pre-alpha + unaudited + **G1 is a live revocation bypass in the CGKA + seating path** as of the current threat model. Until G1/G2 close and + the ciphersuite gets its independent review, Keyhive cannot be the + enforcement layer for anything the estate actually needs to keep + private — it can be the *model* (the graph semantics are implementable + from the design docs + conformance suite) before it can be the *code*. +2. No expiry anywhere means the estate's short-lived-session patterns + (Actions runners, leased exec) need a layer Keyhive doesn't provide — + revocation-as-expiry works only when replicas sync promptly. +3. The root-role append-only caveat and the ex-admin rotation discipline + are operational commitments: adopting Keyline means adopting its + operational folklore (constitutional flatness, fresh-key discipline, + rotate-after-admin-removal) as runbook, not just its API. +4. Bus factor: one small lab. The design docs are good enough to + reimplement from (and the conformance suite makes that verifiable), + which is the real insurance policy — but it should be priced into the + decision. + +**Net**: if the programme's question is "p2panda for everything, or +p2panda + a composed auth layer," Keyhive is the only candidate whose auth +layer was *built* to be composed this way, and its revocation semantics +are the best-thought-through in the field. The honest sequencing is: +adopt the *model* now as the reference for whatever auth the estate +builds or borrows; revisit the *code* when the audit/gap list moves. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/ocap-captp-endo-goblins.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/ocap-captp-endo-goblins.md new file mode 100644 index 000000000..1abe79b7e --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/ocap-captp-endo-goblins.md @@ -0,0 +1,480 @@ +# The object-capability network family — CapTP, OCapN, Endo, Spritely Goblins, Agoric + +Full lane notes: research lane OCAP for +[#13779](https://github.com/developing-today/code/issues/13779), written +2026-11-23 from project specs, docs, repos, and release notes. + +## Verdict in one sentence + +This family is the most completely realised design for *live, delegated +authority between mutually suspicious programs* that exists anywhere — +and it is a **distributed-objects** system, not a data replication system. +It has no answer to "how do two offline nodes converge on shared state," +because that is not the problem it solves. For this estate (Rust / +SQLite-Turso / Cloudflare / iroh) it is a poor base and a rich idea-mine; +the borrow list is at the end of this page. + +## What each piece is — five names, five layers + +The five names are not five alternatives. They are one lineage at five +different layers, and most confusion about this family comes from treating +them as competitors. + +### CapTP — the protocol (the idea layer) + +CapTP, the Capability Transport Protocol, is an abstract protocol for +message passing between objects on different machines in which **holding +a reference *is* the authority to invoke**: an object can use another +object (capability) if and only if it possesses a reference to it +([OCapN CapTP draft specification](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). +Its defining features: + +- **Distributed object references.** Within a pairwise session, objects + are exported/imported by position; a message can carry references as + arguments, so the reference graph and the access graph are the same + graph. +- **Promises and promise pipelining.** A message send creates a promise + for the result; further messages can be sent *to the promise* before it + resolves, collapsing what would be N round trips into one message + flight. This comes straight from Mark S. Miller's dissertation work on + the E language. +- **Distributed (acyclic) garbage collection.** Peers cooperatively + inform each other when a cross-session reference is no longer needed; + acyclic-only, because full distributed cyclic GC requires special hooks + into the garbage collector, whereas distributed acyclic GC merely + requires weakrefs, weakmaps, and finalizers. +- **Third-party handoffs.** When a message in session A↔B carries a + reference to an object that lives in session A↔C, a handoff protocol + (roles: Gifter, Receiver, Exporter) lets B connect *directly* to C with + the same authority, in a secure fashion even if the messages are viewed + by a malicious actor — introductions without proxying and without + trusting the introducer with the traffic afterwards. +- **Error propagation.** Broken promises propagate across the network; + partition breaks promises, which is how failure is represented. + +Lineage: CapTP was first openly implemented in the **E programming +language**; it has been implemented many times since, incompatibly — in E, +in Cap'n Proto, in Agoric's implementation, and in Spritely's Goblins — +and OCapN exists precisely because those implementations could not talk +to each other. + +### OCapN — the interop standardisation effort (the spec layer) + +OCapN (Object Capability Network) is the pre-standardisation effort to +make CapTP implementations interoperable: a suite of draft specifications +— **CapTP**, **Netlayers**, **Locators**, plus a data Model and Notation +doc — with Syrup as the wire serialisation for messages crossing a CapTP +boundary. + +- **Status, in its own words: "OCapN is still pre-specification."** The + plan is to first get Agoric's and Spritely's implementations + interoperable, *then* consider Cap'n Proto, "before beginning any + discussion of standardization" (no IETF/W3C submission yet). The CapTP + draft itself warns it is "likely to undergo significant change". +- **Participants:** Spritely Institute (primary driver, spec editor), + Agoric, Cap'n Proto (advisory), MetaMask (review). +- **Netlayers** are OCapN's transport abstraction: CapTP runs over any + netlayer providing a bidirectional, ordered, secure channel; the draft + names Tor onion services as the specified one, with TCP/TLS in + development at draft time and libp2p / IBC / I2P named as possible. +- **Locators** define the `ocapn://` URI structure: a peer designator + (netlayer-specific, self-authenticating), a transport name, routing + hints, and for objects a *swiss number* — an unguessable random nonce + assigned at registration, which is itself the capability. +- There is a shared **test suite** that implementations run against a + reference sturdyref-exporting peer — the mechanism by which interop is + actually checked. + +### Endo — the JavaScript ocap platform (the runtime layer) + +Endo (by Agoric, Apache-2.0) is a framework for ocap programming in +JavaScript: tools for *confinement*, *communication*, and *concurrency* +([endojs.org](https://endojs.org/getting-started/)). Its parts: + +- **SES / Hardened JavaScript** — a shim that locks down JS intrinsics + and provides Compartments, so mutually suspicious code can share a + process. This is the piece with real production mileage: Agoric and + MetaMask rely on Hardened JavaScript and the SES shim for sandboxing + third-party plugins, and Salesforce's Lightning framework is a SES user. +- **Eventual send (`E()`)** — the programming surface that stretches async + method invocation over processes and networks via handled promises. +- **`@endo/captp`** — Agoric's *production* CapTP, deliberately "a minimal + CapTP implementation": JSON-able messages over a connection object you + supply yourself; it is transport-agnostic because it doesn't do + transport at all. +- **`@endo/ocapn`** — the *new* package implementing OCapN CapTP proper + (Syrup encoding, GC operations, swiss numbers), with netlayers for + WebSocket and a TCP testing netlayer; released at 1.1.0 and synced + against the OCapN test suite. +- **The Pet Daemon** — a persistent host for managing guest programs in + hardened JavaScript worker processes, communicating with its controller + in CapTP over a Unix domain socket / named pipe. On top of it sits the + **petname system**: each agent keeps its own namespace of + human-meaningful names for capabilities; you grant, inspect, and revoke + by name rather than by hash or API key. Revocation is mechanical, not + advisory: deleting every petname that retains a value collects its + underlying *formula*, cancels the live value, and severs the CapTP + connections and workers still holding it. Endo is actively pitching + this daemon as the containment layer for AI-written code, with + capability requests mediated by the user. + +### Spritely Goblins — the distributed object environment (the other runtime) + +Goblins is Spritely Institute's "distributed object programming +environment" (Apache-2.0), implemented twice: **Guile Scheme** (the lead +implementation) and **Racket Scheme** (network-compatible, +feature-lagging). Current release: **v0.18.0** (April 2026). Spritely's +own maturity label for Goblins is "Working Beta". + +What Goblins adds on top of CapTP: + +- **Vats and transactional turns.** Objects live in vats (units of + synchrony); each turn is a cheap local transaction that rolls back on + error, which also enables its time-travel debugging. +- **The most complete CapTP in the family** — the OCapN README states + Spritely "has the most pieces of CapTP (including distributed acyclic + GC, handoffs) and the start of the netlayer abstractions and URI + concepts." +- **Aurie / the persistence system.** Persistent vats serialise their + object graph (in Syrup) to a store and restore it later, with + upgrade/migration support; v0.17.0 added **Bloblin**, a streaming + binary-log store writing compressed deltas per vat churn, replacing + whole-graph rewrites. v0.18.0 added "sleepy actors," a caching layer + that lets persisted actors be evicted and rehydrated on demand. +- **Sealers/unsealers** — the standard ocap pattern for tamper-evident + envelopes and rights amplification, used throughout the actor library. +- **Netlayers shipped in Guile Goblins:** Tor onion services; TCP+TLS; + Prelay (relay, see below); libp2p (added v0.14.0, Sept 2024); WebSocket. + No dedicated WebRTC netlayer has shipped. +- **Hoot** compiles Guile (and thus Goblins) to WebAssembly; Goblins has + run in the browser since v0.15.0. + +### Agoric — the chain (the application/platform layer) + +Agoric is a Cosmos-SDK blockchain whose smart contracts are Hardened +JavaScript objects, built on **SwingSet**, a vat kernel: vats communicate +only asynchronously, vat state is orthogonally persistent, and a special +*comms vat* speaks CapTP to the outside world — to other SwingSets, to +solo machines, and over **IBC** to other chains, so that a blockchain can +be treated as an ordinary machine supporting distributed objects on the +network. On top sit **ERTP** (transferable rights as objects) and **Zoe** +(offer safety for contracts) — the family's worked example of ocap +*economics*. + +For a non-chain user, Agoric-the-chain is mostly irrelevant; what +transfers is (a) Endo/SES, which Agoric maintains and which runs in +production at MetaMask scale, (b) the SwingSet demonstration that CapTP +semantics survive even a store-and-forward, consensus-ordered "netlayer" +(transactions as transport), and (c) ERTP/Zoe's patterns for +rights-as-objects. Agoric's engineering talent is historically central to +CapTP — the OCapN README notes Agoric "has most of the engineering talent +who have implemented CapTP historically." + +## The conceptual core: distributed objects ≠ data replication + +This is the contrast the whole investigation turns on. + +**The ocap model answers:** *"Program A holds authority over a live +service run by program B. How does A invoke it, delegate part of that +authority to C, attenuate it, or take it back — with the guarantees +enforced by the reference graph itself rather than by an ACL checked at a +boundary?"* State lives **in exactly one place**: inside the object, on +its home machine, behind its methods. Other parties hold *presences* +(remote references), never copies. Consistency is therefore trivial — +there is one object, one turn order, one truth — and "conflict +resolution" is a category that does not exist. What exists instead is +*liveness*: if the home machine is offline or the session breaks, every +promise to it breaks. + +**The log/CRDT model (p2panda, Willow, Hypercore, …) answers the +opposite question:** *"Many nodes each hold a copy of shared data and +edit it while disconnected. How do the copies converge, and who was +allowed to write?"* Authority there is about *past writes*, and the +system's centre of gravity is durable, replicated, mergeable state. + +**Where live references win:** + +- **Real-time authority and immediate revocation.** Revoking in CapTP is + a local act with immediate effect: interpose a forwarding "caretaker" + object and flip it, or (Endo daemon) delete the petname and the formula + collection cancels the value and severs the connection. No revocation + list has to propagate; there is nothing to propagate *to*. +- **Attenuation is just programming.** A restricted facet is an ordinary + object that forwards a subset of methods. It cannot be bypassed, + because there is no other path to the underlying object. Token systems + attenuate *claims*; ocap attenuates *behaviour*, including stateful, + rate-limiting, revocable behaviour. +- **Delegation without identity infrastructure.** A third-party handoff + introduces two peers directly, with certificates that keep the handoff + secure even when CapTP messages are not kept secret. No directory, no + token exchange, no shared namespace is needed. +- **Latency shape.** Promise pipelining removes round trips from chained + calls, the dominant cost in chatty distributed-object workloads. +- **Confused-deputy resistance by construction.** Because designation and + authority travel together (the reference names *and* empowers), the + whole class of "tricked into using its own authority on the wrong + object" bugs that ACL systems suffer is designed out. + +**Where live references lose:** + +- **Offline-first anything.** A capability to an offline object is a + promise that breaks. There is no store-and-forward in the core model, + no operation log to replay, no merge. (Agoric's chain use is the + exception that proves the rule: it works because the *chain itself* is + the always-on home of the objects.) +- **Durable shared state.** Nothing in CapTP replicates data. Goblins' + answer is orthogonal persistence of *one node's own* object graph — a + checkpoint log, not replication; two nodes never hold convergent copies + of the same object. +- **Many-reader / public-data workloads.** Content distribution, feeds, + shared documents, audit logs — the bread and butter of the log + families — are simply not the ocap shape. +- **Availability coupling.** Every holder's liveness depends on the + object's home being up and reachable. NATs, sleep, and churn are + protocol-level problems, where a sync system treats them as background + conditions. + +**Neither model subsumes the other.** A composed estate — replicated log +for shared durable state, live references for control-plane authority — +is not a compromise; it is each model doing the job it is shaped for. + +## Identity & key management + +- **Peer identity is a keypair, scoped by netlayer.** In OCapN, a + locator's designator is "self-authenticating identity (usually a public + key)". Concretely: on the Tor netlayer the designator *is* the onion + address (an Ed25519 public key); on TCP+TLS, sturdyrefs use a SHA-256D + hash of the TLS certificate as the peer identifier. +- **Sessions have their own keys, separate from peer identity.** The + OCapN CapTP draft requires each side to create a *per-session* Ed25519 + keypair at session start, used to sign handoff structures. Two identity + tiers: long-lived netlayer identity (how you *reach* me) and ephemeral + session identity (how handoffs *authenticate*). +- **Objects have no identity separate from their references.** A + registered object gets a swiss number — a large random nonce — inside + its sturdyref; knowing the sturdyref *is* the capability to enliven it. + There is no global object namespace and no lookup without a reference. +- **Humans name things locally.** Petnames are per-user, non-global names + bound to sturdyrefs/references — human-meaningful *and* secure because + they are local mappings onto unguessable identifiers, never a global + registry. +- **Key management story is thin.** Keys are generated by the netlayer or + by Tor; there is no PKI, no rotation protocol, no recovery story, no + multi-device identity in the specs. Groups, as an identity concept, + **do not exist** in this family. + +## Capability model — delegation, attenuation, revocation, groups + +- **Delegation** is reference-passing in a message, plus third-party + handoffs when the reference crosses sessions. Delegation is exact: you + can only ever give what you hold, and giving a facet gives only the + facet. +- **Attenuation** is object composition: membranes, caretakers, read-only + facets, sealers. It is Turing-complete policy (stateful, contextual, + revocable), not a caveat list. This is the single largest + capability-model gap between this family and every token system in the + investigation. +- **Revocation** has three mechanisms, all live: (1) don't hand out the + object, hand out a forwarder you control, then disable the forwarder; + (2) session severance — aborting a session ends it and breaks its + promises; (3) retention-based — Endo's daemon collects a value's + formula when its last petname goes, cancelling the value and + disconnecting retainers. There is deliberately **no expiry** in the + core model: a reference is valid until revoked or its object dies. + (Token-style expiry can be built as a facet; the reverse — live + revocation on top of bearer tokens — is the thing that cannot be + retrofitted.) +- **Groups: nothing.** No group abstraction, no roles, no membership + protocol exists in CapTP/OCapN/Endo/Goblins. A "group" would be an + ordinary object someone writes. Anyone whose auth problem is *primarily* + group membership over shared data (the p2panda-auth / Keyhive shape of + problem) gets no leverage here. + +## Encryption, transport & NAT traversal, spec/interop status + +**Encryption.** CapTP itself does no encryption; confidentiality and +channel authentication are *netlayer* requirements (a netlayer must +provide a secure, ordered, bidirectional channel). In practice: the Tor +netlayer inherits Tor's encryption and anonymity; TCP+TLS uses TLS with +self-signed certs whose hash is the peer identity (so the channel is +authenticated by construction, no CA). Handoff security does *not* depend +on channel secrecy — handoff certificates are signed with session keys. +There is **no end-to-end encryption of object state at rest** in this +family, and no group encryption at all. + +**Transport & NAT.** The honest summary: this is the family's weakest +axis relative to the iroh/libp2p world. + +- Tor onion services are the flagship netlayer precisely because onion + services solve NAT by rendezvous — at the cost of high latency; the + Goblins manual itself steers NAT'd TCP+TLS users to Tor, noting TCP+TLS + lacks both "store and forward" and NAT hole punching support. +- **Prelay** (v0.12.0) is a federated relay netlayer layered over other + netlayers — but v0 forwards messages **in cleartext through the + relay**, unauthenticated, which means the relay has the power to both + snoop on and modify messages; it was named *pre*-relay to discourage + reliance on it. +- The fix is recent and not yet in a numbered release as of writing: an + NLnet-funded **Noise-protocol netlayer** that composes with Prelay to + make a federated, end-to-end-encrypted relay with perfect forward + secrecy, announced October 2026 for "the next release of Goblins," + with an OCapN spec for the relay to follow, and already dogfooded in a + shipped peer-to-peer game. +- A **libp2p netlayer** exists in Guile Goblins since v0.14.0, which in + principle inherits libp2p's hole punching and relay circuits, but it is + the least exercised of the shipped netlayers. +- Endo's side is transport-minimal: its CapTP runs over whatever message + channel you hand it (WebSocket, MessagePort, …). There is no NAT story + in Endo at all. + +**Spec & interop status — has Goblins↔Endo OCapN interop actually been +demonstrated?** Yes — but recently, narrowly, and against a moving spec: + +- 2020–2023: interop was aspirational. The Agoric↔Spritely discussion + enumerates real divergences (serialisation, session-break semantics, + handoff tables and GC unimplemented on the Agoric side). +- 2023: the demonstrated interop was *intra-family* — Guile Goblins ↔ + Racket Goblins exchanging messages over OCapN, proven with a ported + chat app. +- 2026: **Endo's `@endo/ocapn` runs a CI interop test against Guile + Goblins** — a bilateral chatroom exercised in CI, plus the shared test + suite. So: two independent implementations, one application shape + (chat), CI-checked. That is a genuine milestone and also the *entirety* + of cross-vendor OCapN interop today. +- The spec still churns underneath implementers: Goblins v0.18.0 (April + 2026) bumped the CapTP protocol version and states plainly that + applications built with an earlier release are incompatible with the + OCapN shipped in this release. The FOSDEM 2026 talk likewise describes + OCapN as "pre-standardization" with implementations in Racket, Guile, + JS, and Dart. + +## Sync semantics, storage fit, languages, project health + +- **Sync/replication semantics:** none. Sessions are live, ordered, + pairwise; a disconnected session's ephemeral references are severed and + its promises break. Offline behaviour is "unavailable," by design. +- **Storage fit (SQLite/Turso):** none natively. Goblins persistence is + its own Syrup/Bloblin file stores; Endo's daemon keeps per-user + formula/petname stores. Nothing in the family speaks SQL, and nothing + would gain from Turso — persistence here is *object-graph + checkpointing*, not tables or replicated logs. +- **Languages:** JavaScript (Endo/Agoric), Guile Scheme and Racket Scheme + (Goblins), plus a Dart implementation reported in the FOSDEM talk. +- **Rust presence: effectively zero.** The only Rust OCapN implementation + is cmars/ocapn-rs — a single-author learning project, self-described as + "Stage 0 in progress," whose stated goals are understanding and + eventual interop with Goblins. There is no Rust CapTP in the OCapN + sense, no crate, no maintainer community. (The capability RPC that + *does* exist in mature Rust form is Cap'n Proto's — a Level-1 + implementation — but that is the capnproto family's divergent CapTP + descendant, not OCapN; see the [Cap'n Proto page](capnp-capnweb.md).) +- **Cloudflare fit:** poor for the protocol, incidental for the runtime. + Workers are JS/Wasm isolates: SES/Endo code can run there in principle, + but there is no Workers-targeted CapTP anything, no Durable Objects + integration, and the daemon/Goblins models assume long-lived processes + with local storage — the opposite of the Workers shape. +- **iroh fit:** none, and mildly competing. A netlayer over iroh is + *conceivable* (iroh gives an authenticated, encrypted, NAT-traversing + byte stream keyed by Ed25519 NodeId — which maps cleanly onto OCapN's + "designator = public key" locator field), but no such netlayer exists, + and the family's own trajectory (Tor, Prelay+Noise, libp2p) is building + its own answer to the same problem iroh already solves better. +- **Project health:** Spritely Institute is a small 501(c)(3) shipping + steadily on NLnet grant funding (Goblins 0.18.0 April 2026, Hoot 0.10.0 + October 2026); OCapN standardisation itself is NLnet-funded. Endo is + maintained by Agoric with MetaMask as a production SES consumer. All + Apache-2.0. One operational note for this estate specifically: the + OCapN project prohibits AI-generated contributions to its specs, test + suite, and official tooling by policy — upstream engagement from an + agent-driven fleet would have to be human-authored. +- **Operational complexity:** high for a non-Lisp/non-JS shop. Running + this family means running a vat host (Guile or Node), a persistence + store, netlayer infrastructure (Tor or relays), and a pre-1.0 protocol + whose wire version has already broken compatibility once in 2026. +- **What it pointedly does NOT do:** replicate data; work offline; manage + groups or membership; provide a global namespace or discovery; encrypt + content at rest; run in Rust; target Cloudflare; promise a stable wire + protocol yet. + +## Fit for this estate, honestly + +The estate's auth/transport problems are: agent seats on +laptops/sandboxes/Actions runners needing to reach each other and the +broker; delegation and revocation of authority between agents; group-ish +access to shared replicated state; all in Rust, over SQLite/Turso, with +iroh as the emerging transport and Cloudflare doors at the edge. + +Against that shape, OCapN-as-base fails on nearly every load-bearing +axis: no Rust implementation beyond a stage-0 learning project; no +replication for the queue/atlas state that is the estate's centre of +gravity; no group model; NAT traversal a generation behind iroh; a wire +protocol that broke compatibility within the last year; and no +Cloudflare story. Adopting it as the foundation would mean porting CapTP +to Rust *and* building the missing data layer *and* the missing group +layer. + +Where the fit is genuinely good is narrower and real: **the fleet's +control plane is a distributed-objects-shaped problem.** A seat holding a +live, attenuated, revocable reference to "the broker's dispatch facet +for repo X" — rather than a bearer token plus an ACL check — is exactly +the CapTP shape. If the estate ever builds a live agent-to-agent RPC +layer (as opposed to queue-mediated work), CapTP's semantics — not +necessarily its wire protocol — are the right blueprint, and Cap'n +Proto's Rust RPC is the pragmatic vehicle for those semantics. + +## What to borrow even if we build elsewhere + +1. **Revocation by interposition as a first-class pattern.** Never hand a + raw authority to a delegate; hand a forwarder/caretaker object whose + forwarding can be switched off. This works in any RPC system + (including a Rust one over iroh) and gives immediate, + propagation-free revocation — the property token systems structurally + lack. +2. **Petnames for agent-facing authority.** Whatever the estate's + capability format becomes, the *human/agent-facing* layer should be + local, meaningful names bound to unguessable identifiers — never raw + hashes or tokens in prompts, logs, or UIs. Endo's pet daemon is the + existence proof that this UX works for capabilities specifically. + This aligns directly with the estate's existing "secrets by name + only" discipline. +3. **Third-party handoff thinking for introductions.** When A introduces + B to C, design for B↔C direct connection with the introduction + cryptographically bound (gift certificates signed by session keys), + not permanent proxying through A and not "send C's token to B." The + CapTP handoff roles (Gifter/Receiver/Exporter) are the cleanest + vocabulary available for this. Directly relevant to the + coordinator-handoff design in the fleet actions-exec work. +4. **Promise pipelining as an API-design rule.** Any chatty cross-machine + API the estate designs should let callers chain operations on + not-yet-resolved results in one flight. Even without CapTP, "send the + plan, not the steps" is the lesson. +5. **The netlayer contract as a transport-abstraction checklist.** + OCapN's requirement set — bidirectional, ordered, session-secure, + at-most-once-or-die, designator = self-authenticating key, hints + separate from identity — is a sharp checklist for evaluating the + estate's own route-form/transport candidates (iroh satisfies it almost + by definition). +6. **SES/Hardened-JS thinking for the JS surfaces that already exist.** + The estate runs JS at the edge (Workers, the route proxy). Where + third-party or agent-written JS executes, Endo's confinement model — + not its network protocol — is the mature, production-proven piece + (MetaMask), and Endo is explicitly building bridges to AI-agent + tooling. +7. **Formula/retention GC as a lifecycle metaphor for seats and + sessions.** Endo's daemon models every value as a *formula* whose + liveness is its reachability from named roots; collection cancels + dependents and severs connections. The fleet's seat/session/lease + lifecycle (claims, leases, emergency extension) is the same shape; the + vocabulary transfers even though the code cannot. + +## Open questions / what would change this assessment + +- A Rust OCapN implementation reaching test-suite parity (today: stage + 0, one author). +- The Noise E2EE relay landing in a numbered Goblins release *and* being + adopted by a second implementation (Endo) — that would make OCapN's NAT + story merely "young" instead of "behind." +- OCapN freezing a 1.0 wire version. The 2026 incompatible bump is the + current evidence against betting a foundation on it. +- Any group-membership or replicated-state work appearing in the family — + none is on any public roadmap found. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/p2panda.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/p2panda.md new file mode 100644 index 000000000..170d24362 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/p2panda.md @@ -0,0 +1,336 @@ +# p2panda — modular Rust stack for signed logs, sync, and group-encrypted spaces + +Full lane notes: research lane PANDA for +[#13779](https://github.com/developing-today/code/issues/13779), from primary +sources (p2panda.org, docs.rs, the p2panda GitHub repo and CHANGELOG, the +crates.io API), read 2026-11-23. + +## Two generations — do not confuse them + +p2panda was redesigned from the ground up. The **old generation** — the +`p2panda-rs` client library (Bamboo append-only logs) plus the `aquadoggo` +reference node (GraphQL API, dynamic schemas, libp2p, SQLite/PostgreSQL) — +is deprecated and unmaintained; its repo was archived in January 2026 +([lib.rs: aquadoggo](https://lib.rs/crates/aquadoggo), +[GitHub org](https://github.com/p2panda)). The **new generation** is a +modular workspace of Rust crates, first published 2024-12-06 and currently +at **0.8.1 (2026-11-13)**: no Bamboo, no GraphQL, no schema system, no +libp2p — logs are a new minimal operation format, networking is iroh, +storage is SQLite via SQLx +([crates.io: p2panda-core](https://crates.io/api/v1/crates/p2panda-core)). + +Every crate README carries the same warning in substance: under active +development, APIs not yet considered stable for production use, stability +guarantees will improve with v1.0.0. There is no 1.0 yet. + +## Core: operations and logs + +- The atom is an **Operation**: a signed header (format version, author's + Ed25519 verifying key, signature, payload size + BLAKE3 hash, sequence + number, backlink to the author's previous operation, and a generic + **extensions** slot) plus an optional body. The operation's identity is + the BLAKE3 hash of its header bytes + ([docs.rs: p2panda-core](https://docs.rs/p2panda-core/latest/p2panda_core/)). +- An author (one Ed25519 keypair) maintains one or many **single-writer + append-only logs**; multi-writer collaboration is many logs read + together. Logs are fork-tolerant (two operations at the same sequence + number form a detectable fork, not corruption), bodies can be deleted + independently of the log structure, and headers support pruning. +- Wire encoding is CBOR; payloads are arbitrary bytes. **There is no + schema system** — "schema" means your own Rust types plus your own + validation. Core is deliberately data-type-agnostic, "compatible with + any application data and CRDT". System features (pruning, tombstones, + causal ordering, group encryption, auth) ride as header extensions, and + users can define their own. +- `p2panda-stream` is the processing pipeline: ingest (validation, + out-of-order buffering), causal ordering, log pruning, and processors + for groups and spaces. + +## Identity & key management + +Identity **is** an Ed25519 keypair; the verifying key is the author ID in +every operation header. There is no account layer, no naming system, and +no binding to external identity systems (no X.509, no DID, no OIDC). The +network identity is iroh's NodeId — also Ed25519, but a *separate* key +from the author key. For encrypted spaces, members additionally publish +**key bundles** (identity + X3DH pre-keys) so others can invite them +asynchronously; 0.8.0 added cross-signing of identity keys and automatic +bundle renewal ([docs.rs: p2panda-spaces](https://docs.rs/p2panda-spaces/latest/p2panda_spaces/)). + +Multi-device is modelled socially: each device has its own keypair, and a +**group whose members are your devices** acts as your collective identity. +What does not exist: author-key rotation, recovery, escrow, hardware-key +support, or any bridge to a CA/PKI. For this estate, p2panda identities +would live *alongside* the fleet CA / IdP CA, not under them — nothing in +p2panda consumes certificates. + +## Auth: what p2panda-auth actually is + +Precision matters here: **p2panda-auth is not a capability system.** There +are no capability tokens, no delegation chains, no bearer credentials, no +caveats, no expiry. It is a **replicated group-membership state machine** +from which authorisation decisions are derived locally: + +- A group is a DAG of signed **group operations** (create, add, remove, + promote, demote), each naming its causal predecessors. Every peer that + replicates the operations computes the same group state — it is a CRDT + ([docs.rs: p2panda-auth](https://docs.rs/p2panda-auth/latest/p2panda_auth/)). +- Each member holds one of four strictly ordered **access levels** — + `Pull < Read < Write < Manage`. Only `Manage` members may modify group + state. `Pull` is a replicator tier: sync metadata, no read access, no + encryption secrets. +- **Attenuation, of a sort:** each access level can carry + application-defined **conditions** (e.g. a `Read` grant scoped to a path + prefix). Conditions are opaque to the crate; the application evaluates + them. This is the only fine-grained lever, and it is a policy hook, not + an enforced caveat language. +- **Delegation:** there is no "delegate a subset of my rights" operation. + The nearest mechanisms are a manager adding someone at a lower level, + and **groups as members of groups** — authority can be delegated to a + *collective* whose own managers control its membership. Notably, the + project's own high-level docs name Willow's **Meadowcap** and **UCAN** + as external capability systems that can be integrated via header + extensions — p2panda itself frames delegated capability auth as + something you compose in, not something it provides + ([docs.rs: p2panda](https://docs.rs/p2panda/latest/p2panda/)). +- **Revocation:** removal is a group operation, resolved under + concurrency by the default `StrongRemove` resolver: concurrent actions + by a member who was concurrently removed (or demoted from manager) are + invalidated, transitively; mutual concurrent removals both apply; a + remove-then-re-add keeps the member but still invalidates their + concurrent actions. The `Resolver` trait is replaceable. Revocation is + therefore *eventually consistent and retroactive over concurrent work* — + but data already replicated to (and decrypted by) a removed member is + not clawed back; forward protection comes from encryption key rotation. +- **Expiry:** none. Membership does not time out. +- **Enforcement point:** each receiving peer evaluates authorisation when + processing operations. There is no reference monitor and no server to + appeal to — correct behaviour is a property of honest peers running the + same validation. That fits a fleet of our own agents, but it is a + different trust shape from a broker enforcing ACLs. + +## Groups + +Groups are first-class, replicated, and nestable. `p2panda-spaces` builds +on auth groups to provide groups reusable across multiple encryption +contexts ("spaces"), nested groups for multi-device profiles, private +space identifiers, and a single global auth context shared across an +application. Practical shape for this estate: a "fleet" group with Manage += operator keys, Write = seats allowed to publish, Read = observers, Pull += dumb relays — and per-seat device groups nested inside. That maps well. +What groups do not give you: scoped one-shot grants ("this runner may +read artifact X for 10 minutes") — that pattern needs conditions +gymnastics or an external capability layer. + +## Encryption + +Three distinct layers: + +1. **In transit (pairwise):** iroh connections are QUIC with TLS 1.3 + using self-certified Ed25519 node keys. That protects a direct + connection between two nodes, not data replicated through + intermediaries. +2. **End-to-end group encryption (`p2panda-encryption`):** a Rust + implementation of **DCGKA** (Decentralised Continuous Group Key + Agreement), not MLS. Two-party key agreement bootstraps with Signal's + X3DH and continues with HPKE. Two schemes on top: *Data Encryption* + (the default, used by spaces) — a shared symmetric group key + (XChaCha20-Poly1305) rotated when a member is removed; late joiners + can decrypt history; forward secrecy is optional and + application-managed — and *Message Encryption*, a per-member + Double-Ratchet-style scheme with strong forward secrecy, aimed at + chat ([docs.rs: p2panda-encryption](https://docs.rs/p2panda-encryption/latest/p2panda_encryption/)). + Real E2EE for group data exists today in a published crate (first + released 2025-07-07). But the README's security section is unusually + candid: the crate **has not received a security audit**; the authors + currently *cannot recommend it for high-risk use-cases*; **group + control messages are currently unencrypted** (membership metadata is + observable); and it is **not post-quantum**. +3. **At rest:** nothing. The SQLite database holds operations in the + clear; disk/volume encryption is the operator's problem. + +`p2panda-spaces` — the crate wiring auth groups to the Data Encryption +scheme — is also the **youngest** in the stack: first published 2026-07-07, +and its integration into the high-level Node API landed only in 0.8.0 +(2026-11-09), accompanied by a visible tail of spaces fixes in the +changelog. + +## Transport & NAT traversal + +`p2panda-net` does not implement its own transport; its `Endpoint` **is** +iroh: QUIC connections, hole punching, and relays as fallback — most of +the lower-level networking is made possible by iroh +([docs.rs: p2panda-net](https://docs.rs/p2panda-net/latest/p2panda_net/)). + +- **Gossip** is iroh-gossip (PlumTree + HyParView overlays, one per + topic) for ephemeral live messages; offline peers miss them, and sync + is the catch-up path. +- **Discovery** is three mechanisms: mDNS on LANs; a **confidential topic + discovery** protocol in which nodes prove shared knowledge of a secret + topic via Private Set Intersection / Private Equality Testing over + salted topic hashes — topics are never revealed to non-members — + combined with a random-walk peer-sampling strategy bootstrapped from + configured bootstrap nodes; and learning peers from gossip overlays. + No DHT is used for topic discovery, deliberately: topics must not leak + into global structures + ([docs.rs: p2panda-discovery](https://docs.rs/p2panda-discovery/latest/p2panda_discovery/)). +- Relays are operator-replaceable (the Node builder takes a `relay_url`; + relays can require bearer tokens), and the project ships a configurable + bootstrap-node repo. Running without n0's public relay infrastructure + is supported by the underlying iroh design. +- The architecture is explicitly transport-agnostic below the Endpoint + ("Walkaway Stack"): core data types are designed to move over packet + radio, LoRa, BLE, or USB sticks, and the sync traits work over any + Sink/Stream pair. Today, over IP, the only realised transport is iroh. + +## Sync semantics + +The shipped protocol is `LogSync`: a two-party, per-topic, **log-height +exchange**. Both sides send `Have(LogHeights)` — for every author and log +in the topic, the highest sequence number held — then a `PreSync` summary, +then the missing operations stream in sequence, then `Done`. Because logs +are single-writer with contiguous sequence numbers, the height vector *is* +the state vector; reconciliation is exact set difference, not a heuristic +([docs.rs: p2panda-sync](https://docs.rs/p2panda-sync/latest/p2panda_sync/protocols/enum.LogSyncMessage.html)). + +- Sync is partial by topic; sessions run once per peer per topic with + optional resync schedules. **Offline behaviour is the design centre:** + publish locally, gossip if connected, sync on next contact. +- **Conflict story:** at the log layer there are no merge conflicts — + single-writer logs can only fork (author equivocation) or be + incomplete. All real conflict semantics live one layer up: in your CRDT + data types (bring your own — core ships none), in the auth CRDT's + resolver, and in the encryption layer's handling of concurrent + membership changes. +- The crate also exposes traits so applications can sync *other* + convergent data types through the same session machinery. +- Maturity signal: the unreleased changelog section already contains a + sync-session-management rewrite and fixes for a session memory leak and + dropped operations — the sync layer is being actively repaired as of + November 2026. Blobs ride `p2panda-blobs`, a wrapper over iroh-blobs + (BLAKE3/bao verified streaming). + +## Storage fit + +`p2panda-store` defines backend traits (log, operation, topic, plus +processor/orderer/spaces stores) and ships **one** real implementation: +**SQLite via SQLx**, with transactional writes and in-crate migrations, +plus an in-memory store for tests. **Turso/libsql: no support exists** — +nothing in the workspace depends on libsql. The trait surface is small +enough that a libsql-backed store is implementable (libsql speaks SQLite +semantics), but it would be our code to write and maintain. Fit for the +estate: a p2panda node keeping its own SQLite file beside the broker's +stores is operationally natural; expecting p2panda operations to live +*inside* Turso replication is not something the project offers. + +## Rust maturity + +All crates are versioned in lockstep, MIT OR Apache-2.0, published from a +single monorepo (~600 GitHub stars) by a small named team — three people +appear in the crates.io publish records. Lower layers (core, store, sync, +net) have ~2 years of published history and steady monthly releases +(0.5.0 in January 2026 → 0.8.1 in November 2026, breaking changes between +minors). The layers this estate cares most about — auth, encryption, and +especially their integration (spaces) and the high-level API — are 4–16 +months old. Download counts are small in absolute terms; a large share of +recent downloads is the workspace's own CI and downstream app projects +(Toolkitty, Dash Chat, Reflection — the apps listed on +[p2panda.org](https://p2panda.org)). + +## Cloudflare fit + +Essentially none, and by design. p2panda is a native Rust stack on tokio + +QUIC/UDP via iroh; Cloudflare Workers cannot host it, and the current +generation has **no browser/WASM support** (the project lead confirmed at +Local-First Week China, October 2026, that browsers cannot act as peers in +the current form). Composition with the estate's Cloudflare doors would be +at arm's length: a native p2panda node behind a Worker door, bridging +HTTP ↔ topics. KV/R2/Durable Objects have no p2panda bindings. + +## iroh fit + +Native — p2panda-net *is* an iroh application (Endpoint, iroh-gossip, +iroh-blobs, iroh-mdns), and p2panda tracks iroh closely (0.8.0 moved to +iroh 1.4.1 / iroh-gossip 0.102). For the estate's +[#13752](https://github.com/developing-today/code/issues/13752) design, +adopting p2panda-net means adopting exactly that transport with the same +self-hosting options — plus topic discovery, gossip, and sync on top, +which raw iroh does not provide. The overlap is total and the composition +is clean: p2panda consumes iroh; it does not compete with it. The cost of +that coupling: p2panda inherits iroh's churn and its relay model of NAT +traversal; there is no alternative IP transport in p2panda-net. + +## Spec / interop status + +There is no standards-track specification and no second implementation. +The effective spec is the crate docs + source. Interop today means +"another Rust program using the same crates", plus experimental FFI +(UniFFI bindings for Node.js, Python, Go) and GObject bindings, both +labelled experimental. Wire-format stability is not yet promised; expect +format evolution before 1.0. + +## Project health + +Funding is EU public research money — the READMEs list Horizon 2020 / NGI +grants (NGI-POINTER, NGI-ASSURE, NGI0-ENTRUST, NGI0-COMMONS — the +NLnet-administered NGI0 programme family). This is grant-funded open +infrastructure, not a venture-backed product. Activity is high and +current: 25 monorepo releases, 0.8.0 and 0.8.1 shipped four days apart in +November 2026, ~1,600 commits. Community is small (~600 stars); real +downstream apps exist but the user base is the local-first +research/activist niche. Risk shape: a three-person core team on grant +cycles; the mitigation is that everything the estate would depend on is +small, readable Rust (the whole workspace is on the order of 60k lines) +under a permissive license — forkable in a way a hosted service is not. + +## Operational complexity + +Running p2panda "for everything" here means operating: one node per seat +(embedded in the fleet binary), our own bootstrap nodes and iroh relays +(or accepting n0's public relays as a dependency), allow-list management, +topic design per data domain, and the nodes' SQLite files. There is no +server component — which is the point — but also no admin tooling and no +metrics ecosystem beyond emitted events. Debugging a sync stall means +reading Rust logs from a pre-1.0 stack whose changelog shows sync-session +bugs being fixed this month. + +## What p2panda pointedly does NOT do + +1. **Delegated capabilities** — no tokens, no attenuation chains, no + expiry, no scoped one-shot grants (see Auth above; the project points + to Meadowcap/UCAN as compose-in extensions). +2. **Identity beyond raw keys** — no PKI/CA integration, no naming, no + key rotation/recovery, no binding to the estate's IdP/OIDC or fleet CA. +3. **Application data modelling** — no CRDTs shipped, no schemas, no + queries, no materialised views (the old generation had these; the new + one removed them on purpose). +4. **Server-side anything** — no broker, no RPC, no request/response + semantics; broadcast + sync only. Fleet's queue/placement coordination + would have to be modelled as replicated state, and single-writer logs + make claims/leases awkward: a placement claim is inherently + multi-writer state. +5. **Audited cryptography** — the DCGKA implementation is unaudited; + group control messages are unencrypted (metadata exposure); no + post-quantum story. +6. **Browser / Cloudflare / WASM** — native only. +7. **Turso** — SQLite-only shipped store. +8. **Stability** — pre-1.0, breaking changes per minor, wire format still + evolving; the auth+encryption integration layer is months old. +9. **Non-Rust reach** — FFI is experimental; mcpx (Go) could only consume + p2panda via those bindings or a sidecar process. + +## Where it genuinely shines for this estate + +- **Seat-to-seat replication with offline tolerance** — agent seats on + laptops/sandboxes that meet opportunistically is exactly the topology + p2panda-sync + gossip + confidential discovery were built for, riding + the iroh transport the estate already chose. +- **Group-structured trust** — fleet seats, operator keys, and relay-only + nodes map onto Manage/Write/Read/Pull and nested device groups without + forcing. +- **Encrypted replicated data** — spaces give E2EE group data over + untrusted relays/intermediaries, something neither raw iroh nor the + current Tailscale/tsnet setup provides for stored, replicated content. +- **Rust, SQLite, permissive license, self-hostable relays** — every + estate hard-preference is natively satisfied by the lower two-thirds of + the stack (core/store/sync/net/discovery). diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/ucan.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/ucan.md new file mode 100644 index 000000000..4de603a82 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/repo-pages/ucan.md @@ -0,0 +1,516 @@ +# UCAN — the deepest capability-token semantics, with principals that are our keys + +Full lane notes: research lane UCAN-DEEP for +[#13779](https://github.com/developing-today/code/issues/13779), from the +UCAN Working Group spec repos (core, delegation, invocation, revocation), +the implementation repos (rs-ucan, go-ucan, ucanto), third-party 1.0 work +(pq-ucan, ucantone), and production users' own documentation (Storacha). +Read 2026-11-23. + +## Verdict up front + +UCAN 1.0 is the most completely specified *delegation semantics* in this +programme: a required delegation sub-spec with mandatory monotonic +attenuation, a separate signed **invocation** object (authority vs its +exercise, with receipts and provenance chains), a revocation model that is +per-proof-path and irreversible, and principals that are bare `did:key` +identities — for Ed25519, mechanically the same key as an iroh NodeId and +a p2panda author key. It is the only candidate in the survey whose +identity layer is *free* for this estate. + +The blocker is not the design, it is the code and the calendar. The spec +family reached 1.0.0 text in 2025–2026, but the ecosystem is +mid-transition: the WG's own Rust crate self-describes as implementing +**UCAN v1.0.0-rc.1** and "work in progress… not formally audited"; the one +Rust crate implementing the final 1.0.0 tags is a third-party pre-release; +the revocation sub-spec is still at **v1.0.0-rc.1**; and the largest +production deployment (Storacha's ucanto) still runs **0.10-era +semantics**, not 1.0. Judgment (end of page): adopt UCAN as the estate's +delegation-layer *design* now; as a code dependency it is a +compatibility/pilot layer today, with a named trigger for promotion. + +## What UCAN is, and the spec family as it stands + +UCAN (User Controlled Authorization Networks) is a **certificate-capability** +system in the SPKI/SDSI lineage: authority is carried by signed, +serializable tokens that form chains, verifiable offline by anyone, with +no central authority consulted at exercise time. The core spec is explicit +that this is *not* an object-capability system — ocap's consistency +requirements "rule out partition tolerance," and UCAN chooses partition +tolerance ([core spec](https://github.com/ucan-wg/spec)). It originated at +Fission and was used in production there in its 0.9-era JWT form; Fission +the company shut down in April 2024 and the work continues under the UCAN +WG. + +The 1.0 family is four sub-specifications under one core document: + +| Sub-spec | Requirement | Status (2026-11-23) | +|---|---|---| +| Delegation | **REQUIRED** | README states 1.0.0, tag `ucan/dlg@1.0.0` | +| Invocation | **REQUIRED** | README states 1.0.0, tag `ucan/inv@1.0.0`; the rendered spec site still shows `ucan/inv@1.0.0-rc.1` | +| Promise | RECOMMENDED | Extends invocation with distributed promise pipelining; implemented in Go (ucantone), not found in Rust | +| Revocation | RECOMMENDED | **v1.0.0-rc.1** — a release candidate, not final, while its siblings are 1.0.0 | + +The tag skew in that table is real and load-bearing: an independent Rust +implementer reports that rs-ucan and the JavaScript implementation emit +the `-rc.1` tags, and built dual-tag acceptance into their decoder. +Anyone adopting 1.0 today must decide which tag set they emit and accept; +the specs' own text has moved faster than the WG's implementations. + +Governance: specs live under the Community Specification License v1. +Editorship is Zelenka (Witchcraft Software); authors span Common Tools, +Bluesky, n0 — the iroh company — and Storacha-adjacent contributors. The +core spec repo is small and slow-moving by design. This is a +handful-of-people, grant/consulting-paced working group, not a standards +body — competent and still active, but there is no conformance programme +beyond shared test fixtures. + +## Wire format and identity + +Every UCAN artifact is an **envelope**: `[signature, {h: VarsigHeader, +"ucan/@": payload}]`, canonically encoded in **DAG-CBOR** +for signing. The token's identity is its **CID**: CIDv1 + dag-cbor +multicodec + SHA-256 multihash. Signatures MUST be canonical per the +varsig rules — otherwise a third party could derive a second valid +signature and therefore a second CID for the same token. + +**Varsig** is UCAN's algorithm-agility mechanism: a self-describing +header naming the signature algorithm and the payload encoding signed +over, carried *inside* the envelope, so the header can evolve without +invalidating previously issued artifacts. + +**Principals are DIDs; `did:key` is required.** The mandatory cryptosuite +is SHA-256 plus **Ed25519 (RECOMMENDED/preferred), P-256, and secp256k1**. +The FAQ is blunt about anything else: other algorithms are possible but +"off spec" (non-interoperable) and MUST be declared in the varsig header. + +**P-384 status — the question this estate cares about, since the IdP CA +is P-384.** P-384 is **not** in UCAN's required suite and neither Rust +implementation ships it. Varsig *can express* ES384 today — the WG's Go +varsig library exposes a constructor — so a P-384 UCAN profile is +mechanically possible and self-describing, but it would be a private +dialect: no interop guarantee, no fixture coverage, no implementation to +borrow. The honest reading: **in practice UCAN is an Ed25519-first +system**, and a P-384 estate should treat UCAN as living one layer +*below* its CA — the CA certifies/enrols the Ed25519 seat keys; UCAN +never needs to speak P-384. That layering is the estate's design to make; +UCAN neither helps nor hinders it beyond not covering it. + +## Capability model + +A capability in 1.0 is a triple: **subject × command × policy** +([delegation spec](https://github.com/ucan-wg/delegation)). This replaces +the 0.x-era `with` (resource URI) / `can` (ability string) pair: + +- **Subject** (`sub`): the DID the authority is *over*. Chains are + self-certifying, rooted at the subject's own key. There is no separate + resource registry; the subject *is* the resource root. +- **Command** (`cmd`): lowercase, slash-led, slash-separated, no trailing + slash (`/space/blob/add`, `/crypto/sign`). Commands have **prefix + semantics**: holding `/crypto` MAY prove `/crypto/sign`, and MUST NOT + prove `/stack/pop` or `/cryptocurrency`. The command `/` ("Top") is the + wildcard, and the spec flags it "handle with care." The `/ucan` + namespace is reserved for protocol operations such as revocation. +- **Policy** (`pol`, required in delegations): an array of statements, + implicitly ANDed, each `[operator, selector, argument]` evaluated + against the eventual invocation's `args`. Selectors are a deliberately + small jq-inspired subset (no pipes, arithmetic, regex, or recursive + descent). Operators: comparisons, `like` (glob, `*` only), plus + `and`/`or`/`not` and `all`/`any` quantifiers. Semantic conditions that + can't be expressed syntactically (day of week) are explicitly out of + scope. + +**Attenuation is mandatory and structural.** The core rule: each direct +delegation MUST either directly restate or attenuate (diminish) its +capabilities; every delegated capability MUST be equal-or-narrower than +its delegator's. It is enforced three ways at validation time, not by +issuer honesty: + +1. **Command narrowing is syntactic** — a child command must be the + parent's command or a path beneath it. +2. **Policies accumulate** — the invocation's args must pass the policies + of *every* delegation in the chain, so a child policy can only further + restrict. Widening by policy is impossible even if a delegate tries. +3. **Time intersects** — chain validity is latest `nbf` → earliest `exp`. + +Validation itself has exactly three criteria, performed on receipt of an +invocation before execution: **time bounds**, **principal alignment** +(each proof's `aud` MUST equal the next UCAN's `iss`, forming an unbroken +chain back to the subject), and **signature validation**. Validators MUST +NOT reject a chain merely because one capability in it is irrelevant or +not understood. + +Two more load-bearing details: + +- **Powerline** (`sub: null`): a delegation with a null subject + automatically delegates *all future delegations regardless of subject*. + This is the multi-device pattern: a root identity powerlines `/` to + each of its device keys once, and every later delegation to the root is + automatically held by every device. +- **No confinement, by design.** Delegates can sub-delegate without + alerting the delegator; the spec calls revocation "a last resort" and + is explicit that you cannot enumerate all sub-delegations that exist. + There is also **no protection against a person-in-the-middle**: you + must delegate only to authenticated agents over secure channels. A UCAN + delegation is *addressed* (it names its `aud`, and exercising it + requires the audience's key), so a leaked delegation is not a bearer + token; but *delivering* it confidentially is the transport's problem, + not UCAN's. + +`meta` fields exist on both delegations and invocations: asserted, +signed, but explicitly **not** delegated authority — the natural home for +audit annotations, job IDs, and (for this estate) handoff coordinates. + +## Invocation: the separate signed object, and why the split matters + +The single most consequential design decision in 1.0 is that **exercising +authority is a different signed object from holding it** +([invocation spec](https://github.com/ucan-wg/invocation)). The spec's +own rationale is the function-reference vs function-call distinction: a +delegation carries no task intent, no concrete arguments, no chosen +executor, and no replay identity. An invocation supplies all four: + +- `iss` — the invoker, who MUST be the delegator at the end of the proof + chain; `sub` — the subject (executor by default); `aud` — an *optional + different intended executor*, which is what makes brokers, proxies, + gateways and replicated state machines first-class: you can invoke + *through* an intermediary at a named executor. +- `cmd` — a concrete, dispatchable command; `args` — the argument map; + `prf` — the delegation CIDs, root-first, in strict sequence. **The args + MUST pass the policies of ALL delegations in `prf`** or the invocation + MUST be rejected. +- `nonce` — REQUIRED; SHOULD be empty for idempotent commands so + identical tasks share an ID. `exp` — REQUIRED but nullable; **a timeout + within a few minutes is RECOMMENDED**, giving invocations expressive + timeout and replay-prevention semantics delegations don't have. +- `cause` — the optional CID of the **Receipt** that enqueued this task; + `meta` — optional (the spec's own examples: Wasm fuel, internal job + IDs, GitHub issue references). + +The **Task ID is the CID of {subject, command, arguments, nonce}** — a +content-addressed, deduplicable, replay-detectable identity for a unit of +work, derived from the artifact itself rather than assigned by a server. + +Execution produces a **Receipt**, and a Receipt MAY enqueue further Tasks +via `cause` — so work composes into provenance chains: every task can +name the receipt that caused it, back to a root invocation. UCAN Promise +(RECOMMENDED) extends this with distributed promise pipelining — awaiting +another invocation's result inside an invocation, the CapTP-flavoured +idea rebuilt for partition-tolerant certificate chains. + +Why this matters beyond tidiness: most token systems (Biscuit, macaroons, +JWT) have only the delegation artifact; "the request" is an unsigned HTTP +call whose binding to the token is conventional. In UCAN the request is +itself signed by the chain's end-holder, names its proofs, carries its +own short expiry and replay identity, and yields a signed receipt. For an +estate whose centre of gravity is *dispatching work to agents and later +auditing who authorised what*, the invocation/receipt pair is the audit +trail, not a log you reconstruct. The core spec also explicitly blesses +the composition this estate wants: its "Beyond Single System Image" +section applies UCAN to CRDTs/RSMs by lifting the Executor=Subject +requirement and carrying provenance in an invocation log. + +## Revocation + +The revocation sub-spec (still **v1.0.0-rc.1**) makes revocation *an +invocation of the reserved command* `/ucan/revoke`, with args naming one +delegation by CID ([revocation spec](https://github.com/ucan-wg/revocation)). +Semantics, precisely: + +- Revocation names **one delegation by CID**. Any issuer whose proofs + appear in a chain MAY revoke a delegation in it — not only the direct + issuer. +- Revoking one proof does **not** kill a capability reachable through an + alternate unbroken chain (the spec's two-tickets analogy). Revocation + is per-proof-path, not per-capability. This is the price of the + additive, set-semantics merging, and it is the sharpest semantic + difference from ACL-thinking: to truly cut off a delegate you must + revoke every path, or let expiry do it. +- Revocations are **immutable and irreversible**; the store is append-only + and recipients SHOULD treat it as a monotonically growing set. An + erroneous revocation is repaired by issuing a *new* delegation, never + by retracting. +- The agent controlling a resource MUST maintain a **revocation cache** + for its subject; validation checks each delegation's canonical CID + against it. Entries may be evicted once the revoked UCAN has expired + (plus clock-skew buffer). +- **Delivery is out of scope.** How a validator learns of a revocation is + explicitly not specified — the format doesn't change; transport is the + deployment's problem. The spec observes that single-source-of-truth + resources get near-ACL semantics by sending the revocation to the + resource's agent, and CRDT resources should embed the store at a + well-known path. + +**Checking cost, for offline seats**: the check itself is trivial — set +membership of each proof's CID in a local set, O(chain length), no +cryptography beyond the signature validation already being done. The real +cost is **freshness, not computation**: a seat offline since time T knows +no revocations issued after T. UCAN's own posture is the mitigation — +expiry is the workhorse, revocation the backstop: short `exp` bounds the +window in which a stale revocation cache can hurt you, and revocations +themselves are small signed objects that gossip well and can ride any +sync the seat already does. + +## Expiry and TTL semantics + +Delegations carry `nbf` (optional; omitted = valid from the epoch) and +`exp` (required; **if a token never expires, `exp` MUST be explicitly +`null`** — non-expiry is a stated decision, never a default). Chain +validity is the intersection: latest `nbf` to earliest `exp` across all +proofs. A ±60-second clock-drift buffer is RECOMMENDED. Every token +carries a REQUIRED `nonce` giving each delegation a unique CID and replay +resistance. + +Invocations are stricter in practice: `exp` is REQUIRED (nullable) and +the spec RECOMMENDS timeouts within a few minutes, with replay prevention +REQUIRED of executors (a seen-CID set). The two-tier posture — long-lived +*authority*, minutes-lived *exercise* — is deliberate and is what makes +the weak revocation story survivable: most real-world "revocations" are +just invocations expiring. + +## Identity and groups + +UCAN has **no group, role, or membership model** — deliberately. +Principals are DIDs; authority structure is expressed entirely as +delegation graphs. The patterns that substitute for groups: **powerline** +(the device-group pattern); a *role* as a DID whose key is held by a +service or shared under application discipline (late binding and roster +management are the application's problem — contrast Keyline, where roles +are native graph nodes); and key rotation via mutable DID documents for +`did:web`-style identities (bare `did:key` identities rotate only by +re-delegation, with the powerline pattern as the intended bridge). + +## Implementations — who implements what, exactly + +| Implementation | Spec generation actually implemented | State | +|---|---|---| +| [rs-ucan](https://github.com/ucan-wg/rs-ucan) (WG, Rust) | README: "These libraries conform to **UCAN v1.0.0-rc.1**" | "Work in progress… **This code has not been formally audited**" (its own README). Still pushed to (2026-06) — but **no GitHub release since v0.4.0 in June 2023**: the entire rc.1 line is unreleased. | +| [pq-ucan](https://crates.io/crates/pq-ucan) 0.1.3 (ekayana-labs, Rust) | **Final 1.0.0** — `decode` accepts the released `ucan/...@1.0.0` tags; rc.1 tags only under an explicit flag. Full delegation + invocation + policy language + execution-time chain validation; interops with the WG's fixtures | Pre-release, not externally audited. `no_std`+alloc core. Extras beyond spec: optional replay guard, a revocations set, `max_proofs` cap. One sharp edge documented by the implementer: the policy `like` operator compares text literally per spec, so `/data/h1/*` matches `/data/h1/../../../etc/passwd` — **path args must be normalized before validation**. Also covers ML-DSA-44/65/87 via *provisional* varsig headers. | +| [go-ucan](https://github.com/ucan-wg/go-ucan) (WG, Go) | Delegation spec as immutable DAG-CBOR/varsig tokens with a full policy package — but its own worked examples emit `ucan/dlg@1.0.0-rc.1` | The WG's most actively *released* implementation (v1.2.0, 2026-09); the rc.1 tags in its examples corroborate the tag-transition state of the WG's own code. | +| [ucantone](https://github.com/alanshaw/ucantone) (Go, Alan Shaw — Storacha) | UCAN 1.0 including a **promise** package | The most complete 1.0 implementation found, in Go, from the production ecosystem rather than the WG org. | +| ts-ucan (WG, TypeScript) | 0.9/0.10-era JWT library; the v0.10 update stalled in draft | Legacy. Production JS does not use it (see ucanto). A fresh third-party JS package implementing Delegation 1.0 appeared in Nov 2026 — evidence new implementers are targeting the final spec directly. | +| [ucanto](https://github.com/storacha/ucanto) (Storacha, JS) + go-ucanto | **0.10-era semantics** (`can`/`with`/`nb` caveats) as an RPC framework | Production — next section. The model is proven at scale; the 1.0 wire format is not what production runs. | +| Others | SpruceID's `ssi` crate carries an `ssi-ucan` module (0.x generation); a third-party Python profile (Nov 2026) implements the 1.0.0 wire tags for a restricted Ed25519 profile | Long tail of partial/profile implementations — a good sign for the spec's implementability, none of them a dependency to build an estate on. | + +Algorithm coverage in Rust today: pq-ucan covers Ed25519, ES256 (P-256), +ES256K per spec, plus ML-DSA via provisional headers. **No ES384 / P-384 +in either Rust implementation.** + +## Production evidence — Storacha, and what it taught + +Storacha (the web3.storage successor, w3up) is the existence proof, and +the invocation spec itself cites **ucanto** as "a production system that +uses UCAN as the basis for an RPC layer" +([invocation spec](https://github.com/ucan-wg/invocation)). The shape: a +**Space** is a `did:key` principal (the resource); an **Agent** is the +client's key; an **Account** (`did:mailto:…`) delegates to the agent at +login, and that delegation is *stored by the service* so any device can +reclaim it via email verification — "password reset" for capabilities. +ucanto adds what an RPC system needs: declarative capability definitions +(≈ routes), providers bound into services, a validation system, batched +invocations, pluggable transports, and **signed receipts**. + +What production added that the WG specs do not say — the most valuable +part of this section for the estate: + +1. **`ucan/attest` sessions.** Principals that cannot sign (a `did:mailto` + account) create delegations with a blank signature; a trusted + authority (the service) issues a `ucan/attest` delegation whose + caveats name the delegation's CID, and validators accept the pair. + Lesson: *real identity systems include principals that can't hold + keys; the bridge is an attestation capability from an authority — an + estate with a CA/IdP already owns exactly that authority.* +2. **`ucan/conclude`.** Receipts are represented as a special UCAN + capability — production folded the receipt back into the token system. +3. **Revocation in production is a server hook.** ucanto server v9.0.0+ + lets a server reject explicitly revoked delegations — an + application-level deny-list consulted at validation time. Nobody runs + the revocation spec's gossip model; the resource's agent checks a + list, exactly the "near-ACL for single-source-of-truth resources" + outcome the revocation spec predicts. +4. **Delegation storage/retrieval is a service.** The specs declare token + resolution "transport specific"; Storacha filled the gap with service + endpoints that store delegations and release them after out-of-band + (email) confirmation. Any estate deployment needs the equivalent — for + us, the broker. +5. **Ergonomics gaps are real at the seams.** A documented third-party + account hit the account-level vs space-level capability split: + `plan/get` is scoped to the account DID while the CLI can only mint + space-scoped delegations; Storacha's engineers confirmed the workaround + is dropping to the core library and hand-building the delegation + + proof chain in a script. At login the CLI agent receives a root + delegation granting essentially everything, plus the service's + attestation. Lesson: *the model composes; the tooling for scoping + authority across subject boundaries lags, and production systems + quietly hand out root-shaped grants at bootstrap.* An estate adopting + UCAN should budget for its own minting tooling and treat bootstrap + grants as a design surface, not a default. + +Fission is the second production data point, historically: Webnative/ODD +and WNFS ran 0.9-era UCANs for user-owned file systems before the +company's April 2024 shutdown; the protocols and WG editorship survived +the company, which is itself evidence about governance risk — the spec +outlived its originating firm, but pace since has been WG-volunteer pace. + +## Estate fit, concretely + +### `did:key` Ed25519 = iroh NodeId = p2panda author + +An Ed25519 `did:key` is `did:key:z6Mk…` — multibase base58btc over the +multicodec varint for `ed25519-pub` (0xed) followed by the raw 32-byte +public key. An iroh **NodeId is the same raw 32-byte Ed25519 public key**. +A p2panda author ID is likewise the author's Ed25519 verifying key. So +one keypair is, without any translation layer: + +- the seat's **transport endpoint** (iroh NodeId — reachable, encrypted, + NAT-traversed by the transport the estate is already choosing); +- the seat's **replication identity** (p2panda author); +- the seat's **UCAN principal** (issuer, audience, subject). + +What that buys: delegating authority *to a seat* is delegating to the +exact key that will terminate the connection and sign the operations — +there is no binding problem between "who may" and "who is on the wire," +no certificate mapping table to keep in sync, and a delegation's `aud` is +checkable against the transport peer ID at connection time for free. +What it does not buy: anything for the P-384 world — the IdP CA stays the +enrolment layer that vouches for seat keys, and UCAN operates beneath it. +That is a clean layering, but it is ours to build: UCAN has no opinion +about how a `did:key` becomes trusted, only about what holders can prove. + +### UCAN over the fleet broker — dispatch authority vs Biscuit + +The job (from the fleet-actions-exec design, +[#13774](https://github.com/developing-today/code/issues/13774)): the +central coordinator hands a short-lived exec session inside a GitHub +Actions runner to an agent; the runner proves it is inside the run +(GitHub OIDC), receives commands through the broker, under a lease with a +hard max lifespan. Head to head for *this* job: + +| Axis | UCAN 1.0 | Biscuit | +|---|---|---| +| Token binding | Delegation names its `aud`; exercising it requires an **invocation signed by the audience's key**. A leaked delegation alone is useless. | **Bearer token**: whoever holds it, uses it. Audience binding is a check you add; there is no invocation object to sign. | +| The work order | The invocation *is* the work order: signed, content-addressed **Task ID**, minutes-scale `exp`, `cause`/`meta` carry the session handle and workflow coordinates. Receipts give signed provenance for what ran. | The request is out-of-band (HTTP); the token authorises it by convention. Provenance/receipts are the broker's own logging. | +| Attenuation for budgets | Command-prefix narrowing + policy accumulation over args. Policies are a jq-subset over the invocation's args — a budget must be shaped *into* the args to be policed. | **Datalog checks are strictly more expressive** for data-dependent conditions (e.g. build-minute budgets as facts evaluated at verification) — Biscuit's home turf. | +| Expiry | Structural: `exp` required-or-explicitly-null, chain-intersected, invocations minutes-lived by recommendation. | Idiomatic: a `time` check the author must remember to include. | +| Revocation at the broker | Revoke-by-CID set consulted at validation; broker is online, so freshness is free. | Per-block revocation-ID deny-list; same online lookup. | +| Implementation risk today | **High**: rc.1 reference crate (unaudited) or third-party pre-release for final tags. | **Low**: `biscuit-auth` 6.0 is the reference implementation, production-hardened, official WASM build. | +| Fit with the rest of the estate | Same Ed25519 keys as transport/auth everywhere else; chains extend naturally seat → coordinator → runner → sub-agent with provenance intact. | A second, unrelated token system scoped to this one surface. | + +Verdict for this job: **UCAN is the better-shaped tool** (audience-bound +authority + a signed work order with a content-addressed ID is almost +literally the coordinator-handoff design), **Biscuit is the safer +dependency today**, and its Datalog genuinely wins on budget-style +policies. A coherent split exists: Biscuit (or the broker's existing +tokens) as the broker's *internal* dispatch gate where policy richness +and maturity matter, UCAN as the authority agents hand *each other* +where provenance chains and transport-key identity matter. Forcing one +winner for both jobs would sacrifice something real either way. + +### UCAN carried in p2panda operation extensions + +This composition is designed-for from both sides. p2panda's own +high-level docs name Meadowcap and **UCAN** as external capability +systems integrable via header extensions "for permission checks and +delegated access control" (see the [p2panda page](p2panda.md)). The UCAN +core spec's CRDT section describes exactly the carrying pattern. +Mechanically: a p2panda operation's extension carries the invocation (or +its CID) plus the proof CIDs; validators resolve delegations from a local +CID-indexed store — and both the delegation store and the revocation set +are append-only, content-addressed sets, which is to say they replicate +with the same log-sync machinery as everything else in p2panda. Costs: +every validating peer needs the store, validation adds signature checks +per operation, and the group layer (p2panda-auth) and the capability +layer (UCAN) must be reconciled by application policy — groups say who +is *in*, UCAN says who may *do what*. No other candidate in the +programme has both sides of this composition pre-designed. + +### UCAN vs Meadowcap vs Keyline as the delegation layer + +| Axis | UCAN 1.0 | Meadowcap | Keyline (Keyhive) | +|---|---|---|---| +| Shape | Certificate chains, presented as proofs with each invocation | Certificate chains, area-scoped, travel with each entry | **No chains**: a CRDT *set* of delegations/revocations; authority is derived by evaluating the whole set (stratified Datalog) | +| What authority is over | subject × command × policy-over-args — computation-shaped (verbs, RPC) | subspace × path-prefix × time-range, read/write only — data-shaped | subject scopes (incl. roles as first-class nodes) × power ladder Relay` — a permission set may only cover resources under its own + NSID hierarchy, and cannot contain `blob` or `account` permissions. The + old transitional scopes (`transition:generic` = app-password-equivalent, + `transition:chat.bsky`, `transition:email`) remain for migration and are + slated for deprecation, with no removal date. +- **Inter-service auth** is separate: `com.atproto.server.getServiceAuth` + mints short-lived JWTs signed by the account's repo signing key, audience + set to the target service's DID — the mechanism `rpc` permissions gate. + +**How this compares to capability tokens (UCAN/Biscuit/Meadowcap), for the +#13779 decision:** + +| Axis | ATProto OAuth + permissions | Capability tokens (UCAN/Biscuit) | +| --- | --- | --- | +| Where authority lives | The PDS (authorization server) issues and validates; enforcement is server-side on every request | The token itself; any verifier checks the chain offline | +| Delegation | One hop: user → client, at interactive consent time. No client→sub-client re-delegation, no attenuation by the holder after issuance | Arbitrary depth, holder-side attenuation, designed for agent→agent chains | +| Revocation | Session/token revocation at the PDS; JWKS key removal for confidential clients. Immediate and central | Deny-lists or short expiry; the known weak axis of token systems | +| Offline / p2p use | None — requires reaching the account's PDS/AS | Native | +| Consent legibility | Strong: permission sets are lexicon-published, titled, localised; the consent screen is the product surface | Weak-to-none standardised; DIY | +| Fit to our estate | Mirrors what our IdP + Cloudflare doors already do (interactive OAuth, server-checked scopes) | Matches the fleet's seat→runner delegation problem, which OAuth does not reach | + +Verdict for the comparison: Bluesky validated the *permission vocabulary* +idea — resource-typed, parameterised, bundleable grants described in the +same schema language as the data — but deliberately stayed inside +server-mediated OAuth. It is evidence that a legible permission layer is +worth building; it is not a candidate substrate for offline capability +delegation, and Bluesky does not pretend otherwise. + +### A.4 Identity: did:plc and did:web + +- **did:plc** spec is at **v0.3.0 (December 2025)** + ([spec](https://github.com/did-method-plc/did-method-plc/blob/main/website/spec/v0.1/did-plc.md)). + The DID is a hash of the genesis operation (self-certifying). Control + rests with up to five priority-ordered **rotation keys** (secp256k1 or + P-256), kept separate from the repo **signing key** by best practice; a + higher-priority rotation key can recover/undo a hostile update inside a + **72-hour recovery window**. The directory validates and timestamps an + append-only, publicly exportable operation log per DID; because every + operation is signed by the previous operation's rotation keys, the log is + verifiable without trusting the server for anything except availability + and fork choice. (The CAPNP-SURVEY note already flagged the rotation/ + signing key split as a pattern worth borrowing into our CA program.) +- **did:web** remains the second method: hostname-only (no paths) in + atproto, resolved from `/.well-known/did.json`; portability and recovery + are exactly as strong as control of the domain — no rotation/recovery + machinery of its own. + +### A.5 Architecture: PDS / Relay / AppView, Sync 1.1, portability + +- **Sync 1.1**: Bluesky released **Tap** (December 2025), a self-hosted, + application-agnostic sync consumer that is the reference implementation + for reliable firehose consumption and historical backfill; the + `bsky.network` relay was upgraded to the Sync 1.1 implementation in + January 2026. Remaining Sync 1.1 pieces per the roadmap: defined block + ordering for repo CAR exports, and exporting repo subsets by collection. + ([roadmap](https://atproto.com/blog/2026-spring-roadmap), + [sync spec](https://atproto.com/specs/sync)) +- **Firehose shape** (unchanged fundamentals): relays aggregate PDS + firehoses into `com.atproto.sync.subscribeRepos` — CBOR-over-WebSocket, + sequence-cursor resumption, `#commit` events carrying a CAR-slice diff + plus the op list, `#sync`, `#identity`, `#account`. In practice much of + the ecosystem consumes **Jetstream** (Bluesky's JSON, per-collection/DID + filtered firehose simplification) instead of the raw CBOR stream. +- **Account experience moves into the PDS**: the reference PDS is gaining + account management (email/password change, deactivate/delete, data + export) and additional 2FA methods, precisely so apps stop needing + account-level permissions for these flows. +- **Portability** is the repo CAR: `com.atproto.sync.getRepo` returns the + full signed repo unauthenticated; account migration between PDSes + (export repo + blobs, import at the new PDS, PLC operation repointing + the `#atproto_pds` service) is an established, practised flow — the + mechanism the independent-PDS account counts below are built on. + +### A.6 Permissioned data — "Spaces" (the encryption question) + +Proposal +[0016](https://github.com/bluesky-social/proposals/tree/main/0016-permissioned-data) +(private data → permissioned data → briefly "buckets" → **Spaces**) launched +in **alpha on 2026-08-20** with running code, SDKs, a sample app, and a +hosted alpha PDS ([announcement](https://atproto.com/blog/atproto-spaces-alpha)). +Design facts that matter for us: + +- A Space is a gated context with a single **space authority** (a DID); + records live in per-space permissioned repos on authors' PDSes, with + their own repo format, sync mechanism (lighter-weight, real-time + capable), addressing, and resolution path. Each record is in exactly + one space. +- **Access control, not confidentiality** — stated repeatedly and without + hedging: data is *not* end-to-end encrypted; any member, app, or server + handling it can read it. E2EE is explicitly out of scope, "may be layered + on top by an application." +- Access credentials are **bound to the application** (a key held by the + app the credential was issued to), short-lived (~10 minutes default), + and scoped to a single space. +- Parallel community architectures (Blacksky, Northsky, Habitat) fed into + the design process. GA timing is "later in 2026" per Bluesky; third-party + trackers list a December 2026 beta — treat the exact date as unconfirmed + against primary sources. + +So on the axis where our investigation cares most — end-to-end encrypted, +capability-gated shared data — Bluesky's answer is: not this, not yet, and +not in this layer. Spaces is a locality/permissioning primitive for social +apps, enforced by servers. + +### A.7 Ecosystem state (community-measured, November 2026) + +- PLC directory: ~132M `did:plc` identities ever registered, but the raw + count is dominated by junk (one unreachable host accounts for ~56M + genesis operations). Community enumeration finds **~47.8M repos**, of + which **~96.9% sit on Bluesky-operated PDS infrastructure**; ~3,600 + independent PDS hosts currently online (of ~8,400 ever seen). + ([sifa.id stats](https://sifa.id/stats), + [atproto.barn.city](https://atproto.barn.city/overview)) +- Named independent providers by current accounts: Blacksky ~44.9K, + Eurosky ~43.1K, Tangled ~42.6K, then a long tail (Sprk, Gems, + surf.social, Northsky ~2K, self-hosters). Blacksky additionally runs an + independent full-network relay and AppView and maintains **rsky**, a + Rust PDS implementation. The microcosm project runs independent + indexing/AppView-adjacent services (Constellation, Spacedust, Slingshot) + in Rust. Bluesky-the-app announced 40M users in November 2025. +- Lexicon growth is broad (the reference tooling — a refreshed TS SDK and + the `lex`/`goat` tools for resolving, publishing, and linting lexicons — + was a headline roadmap item), but the gravitational centre remains + `app.bsky.*`; most third-party lexicons are app-specific namespaces + consumed by their own authors' AppViews. + +### A.8 Bluesky-the-company's priorities, as observable + +Protocol team (per its own roadmap): permissioned data as the major focus, +account experience in the PDS, active IETF participation, SDK parity across +languages, and a protocol conformance test suite. Company-side, Bluesky PBC +still operates the default infrastructure (grouped under the name "Bluesky +Protocol Services" in August 2026, per secondary reporting) while +institutionally divesting the two governance crown jewels — protocol +standardisation (IETF) and identity (PLC Organization). The pattern is +consistent: keep operating the product, give away the protocol's control +points. + +## Part B — The id compatibility question: reading Bluesky natively in `pkgs/id` + +Drew's steer: "we should probably at least support it for compatibility +layer — allow reading bsky in id natively, consider." This scopes a +**read-only** AT Protocol ingestion path for the id program. Nothing here +proposes write support, account creation, or Spaces. + +### B.1 What "reading bsky" decomposes into + +1. **Handle → DID**: DNS TXT at `_atproto.` or + `https:///.well-known/atproto-did`; the result must be verified + bidirectionally against the DID document's `alsoKnownAs`. +2. **DID resolution**: + - `did:plc` — HTTPS GET `https://plc.directory/` returns the DID + document. The strong form also fetches `//log/audit` and verifies + the operation chain (each op signed by the prior op's rotation keys; + genesis hash = the DID). The directory is trusted for availability and + fork choice only if the chain is verified; a plain document fetch + trusts it for content too. + - `did:web` — GET `https:///.well-known/did.json`; trust = DNS+TLS. + From the document: the `#atproto` verification method (repo signing key) + and the `#atproto_pds` service endpoint. +3. **Record reads (light path)**: XRPC against the account's PDS — + `com.atproto.repo.describeRepo`, `com.atproto.repo.listRecords`, + `com.atproto.repo.getRecord`. Unauthenticated for public data. This path + trusts the PDS for completeness (it can omit records undetectably). +4. **Repo ingest (verifiable path)**: `com.atproto.sync.getRepo` returns a + CAR v1 file with the current signed commit, all MST nodes, and all + records. Verification is self-contained given the DID document: + - decode DAG-CBOR (the spec's current text says DRISL, the DASL CBOR + subset; blessed CIDs are CIDv1 / dag-cbor / SHA-256); + - walk the **MST** (Merkle Search Tree: keys are + `/`; a key's depth = count of leading zero bits in + SHA-256(key) ÷ 2, fanout 4; nodes use mandatory prefix compression) + and recompute the root — it must equal the commit's `data` CID; + - verify the **commit signature**: SHA-256 over the unsigned commit's + CBOR, signed with the account signing key (secp256k1 or P-256; + the key and curve come from the DID document — the commit itself + does not say which key signed it, and rotation makes verification of + *old* commits ambiguous; the current commit must verify against the + current document); + - check `rev` (TID) monotonicity against previously seen state. + ([repository spec](https://atproto.com/specs/repository)) +5. **Live follow (optional, later)**: subscribe to a relay's + `com.atproto.sync.subscribeRepos` and apply `#commit` diffs. The spec's + verification chain is elegant and cheap: each `#commit` carries the op + list and `prevData` (previous MST root); applying the ops in reverse to + the diff's partial tree must reproduce `prevData` — a consumer keeps + only (DID → rev, root CID) per repo instead of full MSTs. `#identity` + events invalidate cached DID documents; `#account` events carry hosting + status (takendown/suspended/deleted are hop-by-hop authoritative). + The full-network firehose is a high-volume stream; a *filtered* + consumption shape (Jetstream-style, or per-account `getRepo` polling + with `since`) is the realistic starting point for id. + ([sync spec](https://atproto.com/specs/sync)) +6. **Blobs**: records reference blobs by CID; fetching is + `com.atproto.sync.getBlob` from the PDS. Likely out of scope for a + first slice (metadata/reference only). + +### B.2 Rust library state + +- **atrium** ([atrium-rs/atrium](https://github.com/atrium-rs/atrium), MIT, + actively released through late 2026): the established library. + `atrium-api` (lexicon-codegen'd XRPC types, incl. `com.atproto.repo` / + `com.atproto.sync`), `atrium-xrpc` + `atrium-xrpc-client`, and in the + wider workspace `atrium-identity` (DID/handle resolution) and + `atrium-repo` (MST/repository handling), `atrium-oauth` (not needed for + read-only). Caveat: its centre of gravity is the client/agent session + model; a pure ingest pipeline uses the lower crates, not `AtpAgent`. +- **jacquard** ([zbrox/jacquard](https://github.com/zbrox/jacquard), + MPL-2.0): newer suite with `jacquard-identity`, `jacquard-repo` (MST, + commits, CAR I/O), zero-copy borrowed deserialization — performance + doctrine-friendly. Caveats: single-maintainer-shaped, explicitly + pre-1.0 with frequent breaking releases (0.12.x in mid-2026), streaming + and repo crates self-described as needing more third-party testing. +- **atproto-crates** ([atproto-crates.com](https://www.atproto-crates.com), + MIT, extracted from the smokesignal.events app): 18 separable primitive + crates — `atproto-identity`, `atproto-repo` (CAR reading without an HTTP + client), `atproto-dasl` (CIDs) — designed to be taken à la carte, which + matches an importer crate's needs; published at 0.14.x with the workspace + ahead in unpublished RCs. +- **microcosm-rs** (Constellation/Slingshot et al.): production Rust + firehose/indexing services — prior art for the live-follow slice rather + than a dependency. +- Fallback: the MST + CAR + commit-verification core is bounded, + spec-complete work (the repo spec is self-contained) if no crate's + verification semantics fit; both atrium and jacquard already implement + MST, so this is a last resort, not the plan. + +### B.3 Where it sits in `pkgs/id` + +Precedent exists: `pkgs/id/crates/id-import-notion` is "Notion importer +manifest, inventory, and page/block conversion primitives" — importer-shaped +work already lives in its own crate, outside `id-core`. The atproto path +should follow it: + +- A new read-only importer crate (working name `id-import-atproto`): + resolve (handle/DID) → fetch (XRPC light path and/or CAR ingest) → + **verify** (MST root + commit signature) → emit foreign records with + provenance (DID, collection, rkey, CID, commit rev) into id's existing + store/events shapes. +- Explicitly **not** in `id-core` (no core model changes for a foreign + protocol) and **not** in `id-sync` (that crate is id's *own* log-sync / + meta protocol; atproto ingest is foreign-protocol import, and overloading + the name would blur exactly the boundary the crate split created). +- The open modelling question: are ingested records mapped into id's object + model, or kept verbatim as DAG-CBOR with an index over (DID, collection, + rkey)? Verbatim-with-provenance is the honest first slice; interpretation + is per-lexicon and should be opt-in. + +### B.4 Costs and design questions, honestly + +- **MST/CAR verification is real work** — deterministic tree reconstruction, + prefix-compression parsing, CID discipline (non-blessed links in MST + structure = invalid repo), size/depth limits from the spec's security + considerations. It is also the entire value proposition over "just call + the AppView": without it, id is trusting Bluesky's indexer, not reading + the network. +- **PLC trust posture is a decision, not a detail**: (a) trust + plc.directory HTTPS responses; (b) verify the audit-log chain per DID + (cheap, per-account); (c) run/consume a PLC replica. (b) is the sweet + spot for an importer; (a) is what almost every client actually does. +- **Lexicon openness**: repos can contain any NSID. Unknown collections + must ingest as opaque records, not fail. Interpreting `app.bsky.*` is a + separate, optional layer. +- **Scale asymmetry**: one-shot per-account ingest is small (repos are + specced for single-digit millions of records, typically far fewer). The + firehose is network-scale; following "bsky" wholesale is an indexing + product (that is what AppViews are), not an importer feature. Scope must + say which one id wants: *accounts* (tractable) or *the network* (an + AppView programme). +- **Deletions and takedowns**: repos are tombstone-free by design; mirrors + are expected to honour deletions and `#account` status promptly. An id + ingest that retains deleted records verbatim is making a policy choice + that should be explicit. +- **Spaces/permissioned data**: out of scope — non-public, alpha, and its + access model (server-enforced, app-bound credentials) does not compose + with a read-only public-data importer. +- **Key/curve surface**: secp256k1 + P-256 verification joins id's existing + crypto dependencies; neither is exotic, both must be constant-shape + (verify-only path). + +### B.5 Filed + +This scope is filed as a consideration issue in developing-today/code, +linked to the id epic #2056 and the investigation #13779 (see the lane +report for the issue number). Recommendation shape, if Drew takes it up: +slice 1 = DID/handle resolution + `getRepo` CAR ingest with full MST + +commit verification for a named set of accounts, verbatim records with +provenance; slice 2 (optional) = filtered live follow. No writes, no +Spaces, no AppView ambitions in either slice. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/capnp-and-survey.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/capnp-and-survey.md new file mode 100644 index 000000000..0eb11b79e --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/capnp-and-survey.md @@ -0,0 +1,752 @@ +# Cap'n Proto / Cap'n Web in depth, and the wider field survey + +Research lane CAPNP-SURVEY for the auth + transport investigation program +(tracking issue: developing-today/code#13779). Master prompt: +`~/workspace/p2panda-investigation/p2panda-program-investigation-prompt.md`. +All claims are from primary sources (project docs, specs, repos, crates.io) +and linked inline. Estate shorthand used below: Rust-first core work, +SQLite/Turso stores, Cloudflare Workers/KV/R2 at the edge, iroh (ed25519 +NodeId identity, relays + hole punching) as the chosen p2p transport +direction, an existing fleet CA program (Ed25519 / P-256 / RSA-4096 / +ML-DSA-44 roots) and an interim IdP CA (EC P-384) feeding a minimal OIDC +provider. + +--- + +# Part 1 — Cap'n Proto and Cap'n Web + +## 1.1 What the two pieces are + +**Cap'n Proto** is two things sharing a schema language: (a) a binary +**serialization format** whose wire layout is the in-memory layout — fixed +widths, fixed offsets, offset-based pointers, little-endian — so a message +needs *no* encode/decode pass and can be mmap'd, randomly accessed, and read +incrementally; and (b) an **RPC system** in which interface references are a +first-class type in the schema, so a method parameter or return value can be +a live reference to a remote object +([capnproto.org introduction](https://capnproto.org/), +[RPC protocol doc](https://capnproto.org/rpc.html)). It was written by Kenton +Varda (primary author of Protocol Buffers v2) and is now maintained by the +Cloudflare Workers team; it is the RPC substrate inside `workerd` and was +built for Sandstorm.io +([capnproto.org](https://capnproto.org/), +[cloudparts.dev technology profile, facts checked 2026-10](https://cloudparts.dev/technologies/capnproto/)). + +**Cap'n Web** is a separate, younger protocol by the same author: a +schema-free, JSON-based object-capability RPC implementation in pure +TypeScript for browsers and web servers, announced by Cloudflare in +September 2025 and explicitly "experimental" +([Cloudflare blog: Cap'n Web](https://blog.cloudflare.com/capnweb-javascript-rpc-library/)). +It is *not* wire-compatible with Cap'n Proto; it is a sibling design that +borrows the capability model and promise pipelining and drops the schema and +the binary format. It interoperates with Workers RPC (which is itself Cap'n +Proto under the hood) through workerd +([cloudflare/capnweb README](https://github.com/cloudflare/capnweb), +[Cloudflare blog: JavaScript-native RPC](https://blog.cloudflare.com/javascript-native-rpc/)). + +## 1.2 The serialization layer (brief, because it is not the decision) + +- Zero-copy: "there is no encoding/decoding step. The Cap'n Proto encoding is + appropriate both as a data interchange format and an in-memory + representation" ([capnproto.org](https://capnproto.org/)). A "packing" + codec strips zero bytes to reach protobuf-class wire sizes while staying + faster than a parse-based format. +- Schema evolution is structural: fields are numbered in the order added, + new fields go at the end, readers bounds-check — old and new schemas + interoperate without a version negotiation + ([capnproto.org](https://capnproto.org/)). Struct-list canonicalization + exists specifically "to make Cap'n Proto more appropriate for use in + cryptographic protocols" — i.e. a canonical byte form you can sign + ([0.5 release notes](https://capnproto.org/news/2014-12-15-capnproto-0.5-generics-msvc-java-csharp.html)). +- Accessors validate pointers before following them; the project has had + fuzzing and expert security review + ([capnproto.org](https://capnproto.org/)). + +Estate relevance: Cap'n Proto serialization is a fine fit anywhere the +estate wants a fast, signable, schema-evolving binary message format, and it +is *already* the format under Workers RPC. But serialization is not what +this investigation is deciding; the RPC capability model is. + +## 1.3 The RPC capability model + +Cap'n Proto RPC is a distributed-object protocol descended from CapTP (the E +language's protocol). The core rule, from the spec doc: + +> "Cap'n Proto interface references are capabilities. That is, they both +> designate an object to call and confer permission to call it. When a new +> object is created, only the creator is initially able to call it. When the +> object is passed over a network connection, the receiver gains permission +> to make calls – but no one else does. In fact, it is impossible for others +> to access the capability without consent of either the host or the receiver +> because the host only assigns it an ID specific to the connection over +> which it was sent." +> ([capnproto.org/rpc.html, Security](https://capnproto.org/rpc.html)) + +Consequences that matter for the estate: + +- **No ambient authority, no ACL table to keep in sync.** Authority is the + reference graph. A service never checks "who are you and what may you do" + against a separate policy store for calls arriving on a capability; holding + the (connection-scoped, unforgeable) reference *is* the authorization. The + spec doc notes this design "avoid[s] confused-deputy attacks" while + keeping legitimate use easy — and that ACLs can still be layered on top if + wanted ([rpc.html](https://capnproto.org/rpc.html)). +- **Attenuation is ordinary programming.** You attenuate by handing out a + different object — a wrapper exposing fewer methods — not by minting a + restricted token. Delegation is passing the reference on. There is no + expiry field, no caveat language, no delegation-chain format: the model is + *live objects*, not *bearer documents*. +- **Promise pipelining is the performance half of the same design.** Every + call returns a promise whose interface-typed results can themselves be + called (or passed as parameters) before the first call resolves; the + client sends the whole chain in one flight and the server executes it as + results land — "you can chain any number of such calls together – with + diamond dependencies and everything – and Cap'n Proto will collapse them + all into one round trip" ([rpc.html](https://capnproto.org/rpc.html)). + This is what makes fine-grained object interfaces viable over + high-latency links instead of forcing coarse singleton APIs. +- **Disconnect semantics are part of the model.** When a connection drops, + every capability served over it becomes "disconnected" and calls throw; + when the last reference to a server object is dropped, the object is + closed/destroyed — servers get per-client resource cleanup without + timeouts or leak-prone session tables + ([rpc.html](https://capnproto.org/rpc.html)). +- **Revocation is a pattern, not a primitive: the membrane.** Neither Cap'n + Proto nor Cap'n Web has a "revoke this capability" verb. The ocap + literature's answer, which this family expects you to build, is the + **membrane**: a revocable forwarder that wraps the target *and + transitively wraps every capability that flows through it in either + direction* (arguments and return values), so revoking the membrane + revokes the whole subgraph of access that ever crossed it. A plain + revocable forwarder leaks authority precisely because capabilities pass + through it unwrapped; the membrane exists to fix that + ([ERights wiki: Capability Patterns — Membranes](http://wiki.erights.org/mediawiki/index.php?title=Walnut/Secure_Distributed_Computing/Capability_Patterns&diff=cur&oldid=2736&printable=yes&printable=yes); + [E FAQ §2.6: "Uncooperative revocability requires the Membrane + pattern"](https://mumble.net/e/faq.html)). Sandstorm is the worked + example at platform scale: the platform tracks the capability graph + between apps so access can be visualized and revoked by the user, and its + "Powerbox" picker is capability introduction as a UX + ([0.5 release notes](https://capnproto.org/news/2014-12-15-capnproto-0.5-generics-msvc-java-csharp.html)). + +## 1.4 The level model — spec ambition vs. shipped reality + +The RPC spec divides features into levels an implementation advertises +([rpc.html, Protocol Features](https://capnproto.org/rpc.html)): + +| Level | Feature | What it means | +|---|---|---| +| 1 | Object references + promise pipelining | Two-party capability RPC as described above. | +| 2 | Persistent capabilities | "Save" a capability to a persistent token (a *sturdy ref*); "restore" it later, on a new connection. The host app must implement save/restore support. | +| 3 | Three-party handoff | If A hands B a reference to C, B and C automatically form a direct connection; calls stop proxying through A. | +| 4 | Reference equality / joining | Securely verify that capabilities received from different parties designate the same object (escrow-style patterns). | + +What implementations actually ship, per their own documentation: + +- **C++ (reference implementation): Level 1.** Its own RPC page states: + "As of version 0.4, Cap'n Proto's C++ RPC implementation is a Level 1 + implementation. Persistent capabilities, three-way introductions, and + distributed equality are not yet implemented" + ([capnproto.org/cxxrpc.html](https://capnproto.org/cxxrpc.html)). That + status text is old, but an independent technology profile re-checked in + October 2026 still records the C++ implementation as documenting only + level 1 ([cloudparts.dev](https://cloudparts.dev/technologies/capnproto/)). + The C++ library does ship the *primitives* for persistence + (`persistent.capnp` save/restore hooks, added in 0.5) — Sandstorm built + sturdy refs on them — but the restore semantics are the application's + ([0.5 release notes](https://capnproto.org/news/2014-12-15-capnproto-0.5-generics-msvc-java-csharp.html)). +- **Rust (`capnp-rpc`): Level 1, explicitly.** "This is a level one + implementation of the Cap'n Proto remote procedure call protocol. It is a + fairly direct translation of the original C++ implementation" + ([docs.rs/capnp-rpc README](https://docs.rs/crate/capnp-rpc/0.19.0/source/README.md); + docs.rs crate page: "Includes all Level 1 features" + ([docs.rs/capnp_rpc](https://docs.rs/capnp-rpc/latest/capnp_rpc/))). +- **OCaml (`capnp-rpc`, by the Mirage/OCaml-CI folks): the furthest along — + Level 2 complete, Level 3 not implemented.** "RPC Level 2 is complete, + with encryption and authentication using TLS and support for persistence… + Level 3 support is not implemented yet, so… messages between Carol and + Bob will be routed via Alice" + ([ocaml.org capnp-rpc 2.1](https://ocaml.org/p/capnp-rpc/2.1)). This is the + exception that shows what the higher levels cost: a dedicated, + security-focused team, years of work, one language. +- **Go (`capnproto.org/go/capnp/v3`)** exposes a `Network` abstraction with + `Introduce` / `DialIntroduced` and `ThirdPartyCapID` types — the + level-3 handoff machinery exists in its API surface + ([pkg.go.dev rpc package](https://pkg.go.dev/capnproto.org/go/capnp/v3@v3.0.0-alpha-29/rpc)), + but the package is versioned 3.0.0-alpha, which tells its own maturity + story. +- **Nobody ships Level 4.** And the direction of travel is away from + standardizing the top levels: Kenton Varda argued on the project list in + 2017 that level 2's sturdy-ref restore turned out to be "intrinsically + tied to" the application (the Sandstorm lesson) and "probably level 2 + should be ripped out of the spec entirely" + ([capnproto list archive, 2017](https://www.mail-archive.com/capnproto@googlegroups.com/msg00612.html)). + +**Bottom line for the estate:** when you adopt Cap'n Proto RPC you are +adopting *Level 1*: two-party, connection-scoped capabilities with +pipelining. Persistent capabilities, multi-vat handoff, and equality are +spec text and application-layer work, in every implementation you would +actually deploy. That is not a defect — Level 1 is the part that is proven +at Cloudflare scale — but any design that assumes "capnp gives us +distributed capabilities across a mesh" is assuming the unbuilt levels. + +## 1.5 Rust maturity (`capnp`, `capnpc`, `capnp-rpc`) + +- The Rust implementation is a single-maintainer-lineage community project + (David Renshaw, `@dwrensha`, a Sandstorm core developer), listed by the + project among its serialization+RPC implementations + ([capnproto.org/otherlang.html](https://capnproto.org/otherlang.html)). + Only the C++ implementation is maintained by the core team; other + languages "vary in readiness" + ([cloudparts.dev](https://cloudparts.dev/technologies/capnproto/)). +- It is alive and used: `capnp-rpc` shows 99 releases on lib.rs, roughly + 131k downloads/month, used in ~69 crates; the serialization crates track + the same release train + ([lib.rs/crates/capnp-rpc](https://lib.rs/crates/capnp-rpc)). Release + cadence has historically been bursty (the 0.15 release post notes "almost + two years" since 0.14), so this is a stable-but-thin maintenance bus + factor, not a team + ([dwrensha release notes](https://dwrensha.github.io/capnproto-rust/2022/11/03/0.15-release.html)). +- The RPC runtime is built on futures/`tokio`-adjacent plumbing + (`capnp-futures`), is transport-agnostic (its `twoparty::VatNetwork` + runs over any bidirectional byte stream you hand it), and inherits the + C++ design closely — which also means it inherits Level 1 as the ceiling + ([docs.rs/capnp_rpc](https://docs.rs/capnp-rpc/latest/capnp_rpc/)). +- No WASM/Workers story for the Rust crates: on Cloudflare you would use + Cap'n Proto via workerd's JS/Python RPC surface, not via `capnp-rpc` + compiled to WASM (Workers' own runtime *is* Cap'n Proto, but that is + Cloudflare's C++ implementation, not the Rust crates) + ([Cloudflare blog: JavaScript-native RPC](https://blog.cloudflare.com/javascript-native-rpc/)). + +## 1.6 Encryption and identity — deliberately out of scope + +- **Cap'n Proto specifies no encryption and no peer identity.** "At this + time, Cap'n Proto does not specify an encryption scheme, but as it is a + simple byte stream protocol, it can easily be layered on top of SSL/TLS or + other such protocols" ([rpc.html, Encryption](https://capnproto.org/rpc.html)). + A capability-based encrypted transport with three-party introductions was + a roadmap aspiration, never a shipped spec + ([2017 list discussion quoting the roadmap](https://www.mail-archive.com/capnproto@googlegroups.com/msg00612.html)). +- Therefore Cap'n Proto has **no identity model at all**: no keys, no + names, no enrolment. The capability graph starts at a *bootstrap + capability* handed to whoever connects; authenticating *who* connected + (TLS client certs, a token, an iroh NodeId check) is entirely the + embedding application's job. The one production-hardened pairing in the + wild is OCaml's: TLS for encryption *and* authentication under the + capability layer ([ocaml.org](https://ocaml.org/p/capnp-rpc/2.1)). +- The C++ RPC layer also carries an explicit robustness caveat: per the + project's FAQ as summarized by the cloudparts profile, the RPC layer + "isn't yet robust against resource-exhaustion attacks" — you rate-limit + and bound in front of it + ([cloudparts.dev](https://cloudparts.dev/technologies/capnproto/)). +- **Cap'n Web** is the same shape, web-flavoured: it runs over HTTPS/WSS + (transport security is the platform's), and authentication is *in-band by + design* — the canonical pattern is an `authenticate(apiKey)` method that + returns an authenticated session object you cannot forge, because the + only way to hold one is to have it returned to you + ([Cloudflare blog: Cap'n Web, "Did you spot the security?"](https://blog.cloudflare.com/capnweb-javascript-rpc-library/)). + Its own README security section is blunt about what stays yours: + "authenticating in-band rather than with cookies, rate-limiting because + pipelining is cheap for attackers, setting transport payload limits, and + validating types at runtime" are the operator's responsibility + ([cloudflare/capnweb README, Security](https://github.com/cloudflare/capnweb)). + +## 1.7 Cap'n Web in detail + +- **What it is:** an object-capability RPC protocol + pure-TypeScript + implementation, MIT-licensed, under 16 kB minified+gzipped with zero + dependencies, running in all major browsers, Cloudflare Workers, Node, + Bun and Deno ([cloudflare/capnweb](https://github.com/cloudflare/capnweb)). + Repo created June 2025; 24 releases and ~4k GitHub stars at research + time; the author and Cloudflare both call it new and experimental + ([repo metadata](https://github.com/cloudflare/capnweb), + [blog](https://blog.cloudflare.com/capnweb-javascript-rpc-library/)). +- **Wire format:** JSON with a pre/post-processing layer that encodes the + special types JSON lacks (dates, bigints, byte arrays, errors, and — + crucially — stubs and promises by reference). Human-readable on purpose; + there is no schema and no code generation; TypeScript interfaces give + compile-time checking only, and runtime validation is a separate concern + (the docs point at Zod-style validation and a `capnweb-validate` + companion package) + ([blog](https://blog.cloudflare.com/capnweb-javascript-rpc-library/), + [README](https://github.com/cloudflare/capnweb)). +- **Capability model:** same ocap core as Cap'n Proto — functions and + `RpcTarget` objects pass *by reference* as stubs; calls are bidirectional + (a server can call a callback the client passed it); promise pipelining + works in both WebSocket and HTTP-batch modes, including the signature + `.map()` over pipelined promise arrays; stubs can be passed onward to + other parties; disposal is explicit and reference-counted (`using` + declarations, `Symbol.dispose`), with docs for session reconnection and + what a disconnect destroys + ([README](https://github.com/cloudflare/capnweb), + [blog](https://blog.cloudflare.com/capnweb-javascript-rpc-library/)). +- **Transports:** HTTP (batch mode: one request/response carries a whole + pipelined batch; references die when the batch completes), WebSocket + (long-lived sessions, bidirectional), and `postMessage()`/MessagePort + (iframe/worker boundaries) out of the box; custom transports are a + documented extension point + ([README](https://github.com/cloudflare/capnweb), + [blog](https://blog.cloudflare.com/capnweb-javascript-rpc-library/)). +- **Workers integration:** it is the web-facing form of the Workers RPC + system — a Worker can serve a Cap'n Web endpoint with + `newWorkersRpcResponse(request, new MyApiServer())` inside a normal + `fetch` handler, and Cap'n Web stubs interoperate with Workers RPC stubs + (service bindings, Durable Objects) per the README's interop docs + ([README](https://github.com/cloudflare/capnweb), + [blog: JavaScript-native RPC](https://blog.cloudflare.com/javascript-native-rpc/)). + Workers RPC itself is production infrastructure at Cloudflare, built on + Cap'n Proto, with Worker-to-Worker calls often never leaving the thread + ([blog](https://blog.cloudflare.com/javascript-native-rpc/)). +- **What it deliberately leaves out:** identity/authentication (in-band + `authenticate()` pattern only — §1.6), encryption (HTTPS/WSS does it), + persistence of capabilities across sessions (sessions/resume are + documented, but there is no sturdy-ref/store story), storage of any + kind, group management, revocation (membrane pattern is yours to + build), and any non-JS implementation (a Rust `capnweb-core` crate + exists but is a single 0.1.0 release — a sketch, not a stack + ([lib.rs/crates/capnweb-core](https://lib.rs/crates/capnweb-core))). + +## 1.8 The boundary — what neither provides (precise) + +Neither Cap'n Proto nor Cap'n Web provides, at any shipped level: + +1. **Identity / key management** — no keys, no names, no enrolment, no + rotation. (§1.6) +2. **Authentication of peers** — the bootstrap capability goes to whoever + holds the connection; who that is, is your problem. (§1.6) +3. **Encryption** — unspecified by Cap'n Proto; platform-provided for + Cap'n Web. No forward-secrecy story of their own. (§1.6) +4. **Offline / persistent authority (as shipped)** — capabilities are + connection-scoped; level-2 persistence is unimplemented in C++ and Rust + and application-defined where it exists (OCaml). There is no offline + delegation: a capability cannot be exercised while disconnected, and + cannot be carried in a stored document the way a signed token can. +5. **Token-style attenuation with expiry/caveats** — attenuation is by + facet object, delegation by reference passing; there is no serializable, + expiring, caveat-carrying credential format. +6. **Revocation as a primitive** — membranes/caretakers are patterns you + implement; disconnection revokes incidentally. +7. **Group management** — no groups, membership, or roles exist in the + model; a "group" is an object you build whose methods hand out facets. +8. **Sync / replication** — nothing. RPC is live request/response between + connected parties; there is no log, no CRDT, no store-and-forward, no + merge semantics. Offline behaviour is "calls throw disconnected." +9. **Storage** — nothing. Messages can be written to disk (the + serialization format is mmap-friendly), but there is no store, index, + or query layer, and no SQLite/Turso integration story. +10. **Discovery / NAT traversal / rendezvous** — a Cap'n Proto vat must + already have a byte stream to its peer. Level 3 would have formed + direct connections after introduction; it is unimplemented in the + implementations above, so introduction today means proxying through + the introducer (OCaml's documented behaviour, + [ocaml.org](https://ocaml.org/p/capnp-rpc/2.1)). + +## 1.9 Axes summary — Part 1 + +Scores 1 (absent/poor) – 5 (excellent), estate-weighted. + +| Axis | Cap'n Proto (Rust) | Cap'n Web | Note | +|---|---|---|---| +| Identity & key management | 1 | 1 | None in either; bootstrap-cap + your authn. | +| Capability model | 4 | 4 | True ocap with pipelining; docked for connection-scoped lifetime and pattern-only revocation. | +| — delegation | 4 | 4 | Reference passing; Cap'n Web stubs pass onward between parties. | +| — attenuation | 4 | 4 | Facet objects; no caveat language needed or available. | +| — revocation | 2 | 2 | Membrane pattern only; disconnect revokes incidentally. | +| — expiry | 1 | 1 | No expiry concept; session/batch lifetime is the bound. | +| Group management | 1 | 1 | Build-it-yourself objects. | +| Encryption | 2 | 3 | Proto: bring TLS/Noise yourself. Web: HTTPS/WSS platform default. Neither has an own story or FS beyond the channel's. | +| Transport & NAT | 2 | 3 | Proto: any byte stream, no rendezvous/NAT help. Web: HTTP/WS/postMessage — excellent on the web, no p2p NAT story. | +| Sync/replication | 1 | 1 | None; live RPC only. | +| Storage fit (SQLite/Turso) | 2 | 1 | Proto serialization is a fine signable blob format for rows/blobs; no store integration. Web: JSON only. | +| Rust maturity | 3 | 1 | `capnp`/`capnp-rpc` real, Level 1, thin maintenance. Cap'n Web in Rust: one 0.1.0 crate. | +| Cloudflare fit | 5 | 5 | workerd *is* Cap'n Proto; Cap'n Web is a first-party Workers citizen. | +| iroh fit | 3 | 2 | Proto runs happily *over* an iroh stream (byte-stream transport) and iroh supplies the identity/encryption capnp lacks — composable, not native. Web: no iroh story. | +| Spec/interop status | 3 | 2 | Proto: stable spec, levels mostly unimplemented, multi-language serialization interop is real. Web: single-vendor spec, pre-1.0, JS-only in practice. | +| Project health | 4 | 3 | Proto: Cloudflare-maintained, LTS 1.0 (2023) + 2.0 branch, production at huge scale. Web: active and first-party but months old and self-described experimental. | +| Operational complexity | 3 | 4 | Proto: schema discipline + you build authn/transport/persistence. Web: near-zero setup, but you build everything above RPC. | +| Offline/local-first | 1 | 1 | Disconnected = broken capabilities, by design. | + +**Part 1 verdict.** Cap'n Proto's real advantage is narrow and deep: it is +the only candidate in this whole investigation that gives you *live, +unforgeable, delegable authority as a programming model* — with promise +pipelining making that model fast enough to use naively — and it is proven +inside the exact edge runtime this estate already deploys (Workers). Cap'n +Web extends the same advantage to browsers and Worker HTTP surfaces with +almost zero ceremony. But both are **call-layer technologies, not auth or +sync foundations**: identity, persistence of authority, offline operation, +groups, revocation-as-a-system, storage and replication are all outside +the boundary (§1.8). In a composed stack, capnp/capnweb sit *above* a +transport that gives them identity and encryption (iroh streams; TLS/WSS +at the edge) and *beside* whatever provides durable, offline-checkable +authority (tokens/documents) and replication. They do not compete with +p2panda-auth/sync so much as occupy a layer those systems don't address: +what an already-authorized live session can do, call by call. + +--- + +# Part 2 — The wider field, briefly + +One tight entry per system: what it is, the capability/identity story, the +estate fit, and scores on the axes this estate weights most (capability +model depth · Rust maturity · Cloudflare/WASM fit · spec stability · +project health, plus transport/sync where relevant). Flags (⚑) mark entries +that plausibly **beat the named families** (p2panda, keyhive/subduction, +willow/meadowcap, the ocap network family, capnp/capnweb) on an axis this +estate cares about — those are the ones synthesis should deep-dive. + +## 2.1 ⚑ UCAN — the deepest capability-token model; Rust 1.0 not ready + +UCAN (User Controlled Authorization Networks) is a trustless, local-first +delegation system in the SPKI/SDSI lineage: chains of signed delegations +(`iss → aud`, about a `sub`) presented as proofs at invocation, maintained +by the UCAN Working Group with Storacha (Protocol Labs spin-out) as the +main production lineage +([ucan-wg/spec](https://github.com/ucan-wg/spec/)). Its capability model is +the richest of any token system surveyed: delegation is a required +sub-spec; attenuation is *mandatory monotonic narrowing* expressed through +hierarchical commands (`/crud` proves `/crud/read`) plus a policy language +over invocation arguments; **invocation is a separate signed object from +delegation** (exercising authority ≠ holding it — unique here); revocation +exists as a reserved-namespace invocation that kills a delegation CID and +all derivatives, though *how a validator learns of a revocation is +explicitly out of scope* — the practical weak point. The 1.0 spec is a +breaking change most secondary sources miss: ≤0.10 was JWT, but **1.0 is +canonical DAG-CBOR in a Varsig envelope, content-addressed by CID, with +`did:key` required and Ed25519 preferred** (P-256/secp256k1 also in suite; +**P-384 is not**, so the interim IdP CA's curve is a non-interoperable +extension here). The `did:key` principal is mechanically an iroh NodeId in +multicodec dress — the identity fit with this estate is exact. What blocks +adoption today is Rust: the WG's `rs-ucan` still implements the pre-1.0 JWT +spec (0.10 canary), and conformant 1.0 Rust exists only as third-party +pre-release crates. UCAN pointedly does not do transport, storage, groups, +or discovery. Sources: +[spec](https://github.com/ucan-wg/spec/) · +[go-ucan token docs](https://pkg.go.dev/github.com/ucan-wg/go-ucan/token/delegation) · +[rs-ucan status via WG staging docs](https://8a810bd9.ucan-staging.pages.dev/libraries/rust/) · +[pq-ucan (third-party 1.0 Rust)](https://docs.rs/crate/pq-ucan/latest) + +Scores: capability depth **5** · Rust maturity **2** · Cloudflare/WASM fit +**3** · spec stability **3** (1.0.0 on main, untagged; JWT→CBOR break +orphaned 0.10) · project health **3** (active WG + Storacha production; +small, grant-paced). +**⚑ Flag:** beats every named family on *token-model semantics* — +delegation + invocation + policy + revocation in one spec, with an +identity form (`did:key`/Ed25519) that is literally the iroh NodeId. +Deep-dive in synthesis as the semantic reference for offline authority, +even if the Rust implementation is home-grown or deferred. + +## 2.2 ⚑ Biscuit — the adoptable offline token for this estate, today + +Biscuit (now an Eclipse Foundation project, ex-Clever Cloud) is a bearer +authorization token combining Macaroons-style offline attenuation with +public-key verification and a **Datalog-derived rights language**, +serialized as Protobuf +([spec](https://doc.biscuitsec.org/reference/specifications)). The token is +an append-only chain of signed blocks: block 0 carries the authority's +rights as Datalog facts/rules; each holder appends blocks using chained +ephemeral keys, and attenuation is expressed as *checks* that must all +succeed at verification; scoping rules prevent later blocks from widening +rights. Third-party blocks (v3.2+, externally signed, with Datalog able to +require facts `trusting ed25519/`) are Macaroons' discharge redesigned +for public keys — also its historically fragile area (CVE-2024-42350, +fixed by a signature-payload change). Revocation is deliberately external: +the crate generates a per-block `revocation_id` and the verifier keeps a +deny-list — revoking a block kills everything attenuated from it, and the +list is a trivial SQLite table in this estate. Expiry is idiomatic (a +`time` check), not a built-in field. Identity is out of scope (the docs +state plainly it is *not an authentication protocol*); keys are Ed25519 by +default, P-256 supported, P-384 not. The estate fit is the best of the +token family: **Rust is the reference implementation** (`biscuit-auth` +6.0.0, 2025-07), with parser/macro/CLI/C-API crates in-org, and an +**official WASM build** (`biscuit-wasm`) that makes Workers verification +realistic today (modulo wrangler bundling of the `.wasm` asset). Sources: +[spec](https://doc.biscuitsec.org/reference/specifications) · +[biscuit-auth on lib.rs](https://lib.rs/crates/biscuit-auth) · +[Rust usage docs](https://doc.biscuitsec.org/usage/rust.html) · +[biscuit-wasm 0.4.0](https://www.biscuitsec.org/blog/biscuit-wasm-0-4-0/) + +Scores: capability depth **4** (most expressive check language here; +docked for bearer-only delegation with no invocation semantics) · Rust +maturity **5** · Cloudflare/WASM fit **5** · spec stability **4** +(versioned, additive-first 3.x, conformance fixtures; two breaking +third-party-block security fixes) · project health **4** (Eclipse +governance, production at Clever Cloud/Outscale/Pulsar; two-person core). +**⚑ Flag:** beats the named families on the *deployable offline-token* +axis — it is the only candidate in the whole survey that is simultaneously +Rust-reference-implemented, WASM-official, attenuation-native, and +public-key verifiable. If the estate needs expiring, attenuable, +offline-checkable authority documents (the thing capnp pointedly lacks, +§1.8 item 5), Biscuit is the off-the-shelf answer; NodeId binding and the +revocation list are thin house layers on top. + +## 2.3 Macaroons — prior art, not a dependency + +Macaroons (Google et al., NDSS 2014) introduced contextual caveats: a +bearer credential built from chained HMACs, where anyone holding the token +can append caveats (first-party predicates checked by the target; +third-party caveats discharged by a named third party, with the discharge +bound to the authorizing macaroon to prevent replay) +([paper](https://research.google/pubs/macaroons-cookies-with-contextual-caveats-for-decentralized-authorization-in-the-cloud/)). +Both of its ideas won — offline monotonic attenuation lives on in Biscuit, +discharge in Biscuit's third-party blocks and UCAN's design — but the +construction lost for this estate: verification is **symmetric-only**, so +every verifier must hold the minting secret (and can therefore mint), +which is architecturally opposite to a public-key/CA estate; there is no +spec home, no maintainer, no caveat vocabulary standard, no revocation +(rely on short lifetimes); and the namesake Rust crate self-describes as +not-for-production and has been unmaintained since 2022 +([macaroon crate source](https://docs.rs/crate/macaroon/0.1.1/source/src/lib.rs), +[lib.rs](https://lib.rs/crates/macaroon)). If a macaroon-shaped token were +ever needed inside a Worker, the honest route is ~100 lines of WebCrypto +HMAC, not a crate. + +Scores: capability depth **3** · Rust maturity **2** · Cloudflare/WASM fit +**2** · spec stability **2** (frozen by abandonment; V1/V2/V2J folklore) · +project health **2**. + +## 2.4 Veilid — a second network, not a layer + +Veilid is a mobile-first p2p *application framework* from the Cult of the +Dead Cow / Veilid Foundation: Rust-first (`veilid-core`, active 0.5.x line), +with its own transport set (UDP/TCP/WS/WSS, own hole-punching and relays), +ed25519 node identity, and a differentiator this estate has not asked for — +**privacy routing** (safety/private routes mask sender and receiver IPs and +NodeIds), plus a DHT key–multi-value store with watches +([veilid.com FAQ](https://veilid.com/faq/), +[veilid-core docs](https://docs.rs/crate/veilid-core/latest)). The DHT is +storage, not sync: no log, no CRDT, no merge semantics; conflict resolution +is the app's problem. Auth is thin: DHT record ownership (owner keypair = +write capability for subkeys) and route blobs as bearer capabilities; no +scoped, delegatable, revocable capability system. Maturity is pre-1.0 with +breaking changes, a beta flagship chat app, and no verified large-scale +third-party production deployment. It *competes* with iroh — incompatible +protocol, identity format, and network — and its one thing iroh lacks (the +DHT) cannot be taken without its transport. + +Scores: transport/NAT **3** · Rust maturity **3** · sync semantics **2** · +project health **3** · iroh-estate fit **2**. + +## 2.5 Holepunch / Hypercore — the best sync model here, in the wrong language + +Holepunch (Tether-backed) is a JS module stack: Hypercore (secure, +single-writer, Merkle-verified signed append-only logs with sparse +replication), Hyperbee/Hyperdrive (KV/files over logs), Autobase +(multi-writer merge with causal ordering), HyperDHT/Hyperswarm (Kademlia +discovery, UDP hole-punching, relay fallback), shipped in production in the +Keet app ([docs.pears.com](https://docs.pears.com/), +[Hypercore protocol](https://hypercore-protocol.github.io/new-website/protocol/)). +Identity is an ed25519 keypair per core — the log's public key *is* its +identity — and an encrypted core's key functions as a read capability; +beyond that, auth is a `firewall` callback and app logic. The sync story is +the strongest in this survey (offline-first append, replicate on reconnect, +fetch only the ranges you want). But it is **JavaScript-only in practice**: +the sole Rust Hypercore is the unofficial, limited, pre-1.0 `datrs` port +with no Hyperswarm/Autobase equivalents +([hypercore on docs.rs](https://docs.rs/crate/hypercore/latest)). Its +transport competes with iroh and its runtime (Bare) is not Workers' JS +runtime either. Verdict: lose the stack, borrow the data model — signed +single-writer logs + Autobase-style multi-writer merge is exactly the sync +design to re-implement over iroh. + +Scores: transport/NAT **4** · Rust maturity **1** · sync semantics **5** · +project health **4** (funded and shipping; single-backer concentration) · +iroh-estate fit **2**. + +## 2.6 libp2p — the interop escape hatch, not the base + +libp2p is the modular p2p networking stack/spec from the IPFS ecosystem: +the broadest transport menu available (TCP, QUIC-v1, WebSocket, WebRTC, +WebTransport; Noise or TLS 1.3; yamux), Kademlia DHT, gossipsub, and a +`PeerId` identity derived from the peer's public key +([libp2p.io](https://www.libp2p.io/docs/standalone-connectivity/)). +`rust-libp2p` is genuinely mature (facade 0.57.x) but pre-1.0 and +heavyweight, and NAT traversal is *assembled, not included* — AutoNAT + +Circuit Relay v2 + DCUtR must each be wired and tuned +([libp2p on docs.rs](https://docs.rs/crate/libp2p/latest)). It has no sync +semantics and no capability/auth model beyond proving key possession. It +still wins where nothing else does: multi-language interop, existing +networks you must join (Ethereum consensus, Filecoin, IPFS), browser +transports, gossipsub at scale. The lineage matters for this estate: iroh +began as a Rust IPFS implementation and deliberately dropped libp2p — +multiaddrs, the dependency tree, assembled NAT — for key-addressed QUIC +endpoints; a `libp2p-iroh` bridge exists but is an early 0.1.x WIP +([iroh's own history](https://github.com/n0-computer/iroh.computer/blob/HEAD/src/app/blog/the-road-to-iroh-1-0/page.mdx), +[libp2p-iroh](https://docs.rs/crate/libp2p-iroh/latest)). Keep it as the +federation/interop hatch; do not stack it as the base — it duplicates +identity, discovery, and NAT machinery iroh already does more simply. + +Scores: transport/NAT **3** · Rust maturity **4** · sync semantics **2** · +project health **5** · iroh-estate fit **3**. + +## 2.7 Freenet (2023+ rewrite) — whole-platform competitor; borrow two ideas + +The new Freenet (ex-Locutus; the Java original became Hyphanet in 2023) is +a Rust platform for decentralized apps: a small-world ring where each +*contract* (WASM, identified by code hash + parameters) has state +replicated near its ring location, kept current by subscription trees with +delta sync, under a custom UDP transport (X25519+AEAD, hole-punching, +public gateways for bootstrap) +([freenet.org FAQ](https://freenet.org/about/faq/), +[transport manual](https://freenet.org/build/manual/architecture/transport/)). +Its merge semantics are elegant — contract state must form an idempotent +commutative monoid, so updates apply in any order to the same result — and +its auth is platform-shaped: the contract's WASM *is* the validity policy +(e.g. requiring a signature from a particular key), and *delegates* are +local WASM agents that hold secrets and act via attributed messages. But +adopting it means abandoning iroh *and* the local-first SQLite/Turso model +(state lives in the network, hosted by strangers' peers), under AGPL-3.0, +at 0.2.x alpha maturity with a ~440-peer live network. Borrow the monoid +merge-contract idea and the delegate pattern; adopt nothing. + +Scores: transport/NAT **2** · Rust maturity **3** · sync semantics **4** · +project health **3** · iroh-estate fit **1**. + +## 2.8 ⚑ Holochain — composes with iroh today; the capability reference design + +Holochain is an agent-centric framework (Rust conductor; app logic as WASM +"zomes", usually Rust): each agent keeps a signed source chain, and shared +data lives in a DHT whose holder-peers run the app's validation rules +before storing and serving entries — eventual consistency without global +consensus or merge semantics +([validation docs](https://developer.holochain.org/build/validation/)). +Two findings matter here. First, **current Holochain runs on iroh**: its +Kitsune2 networking layer has a transport "backed by iroh… using iroh's +QUIC-based networking", with a self-hosted bootstrap + relay server for +discovery and fallback — the only candidate in the survey that literally +composes with the estate's chosen transport instead of competing with it +([kitsune2_transport_iroh](https://docs.rs/crate/kitsune2_transport_iroh/latest), +[Holochain infra guide](https://developer.holochain.org/resources/howtos/running-network-infrastructure/)). +Second, it has **the only complete capability system in the p2p set**: +zome functions are inaccessible until an agent creates a `CapGrant`; +callers exercise it via `CapClaim` under Unrestricted / Transferable +(bearer secret) / Assigned (secret + authorized-key signature — "the +closest to a true capability") modes, revocable by deleting the grant, and +`genesis_self_check` validates a *membrane proof* gating network admission +([capabilities docs](https://developer.holochain.org/build/capabilities/)). +The cost of adoption is architectural: the conductor + DNA/zome model, DHT +neighbourhood availability (an entry is retrievable only while its +authority peers are online), pre-1.0 churn after a decade of development, +and nothing that runs in Workers. Rational use: mine CapGrant/membrane/ +validation as the reference design for the estate's own auth layer over +iroh; adopt the framework only for an app that genuinely wants +agent-centric validated-DHT semantics. + +Scores: transport/NAT **4** (iroh's, inherited; docked for the bootstrap/ +relay you must operate) · Rust maturity **4** · sync semantics **3** · +project health **3** · iroh-estate fit **3**. +**⚑ Flag:** the only entry that *adds exactly what iroh lacks* (validated +shared state + capabilities + admission membranes) *while reusing iroh* — +deep-dive its capability design in synthesis even if the framework itself +is not adopted. + +## 2.9 AT Protocol — borrow the key hierarchy, not the protocol + +As an identity reference (not a transport): atproto's stable identifier is +a DID (`did:plc` or `did:web`) resolving to a document carrying the handle +(`alsoKnownAs`), the current signing key, and the current host (PDS) +endpoint — identity survives changing all three +([atproto DID spec](https://atproto.com/specs/did)). The borrowable core is +its **two-tier key split**: 1–5 priority-ordered *rotation keys* control +the DID document and can replace *signing keys* and repoint the host even +if the old host is offline or uncooperative (adversarial recovery), while +signing keys only sign the account's repository — a Merkle Search Tree of +records under signed commits, exportable whole as a CAR file for backup +and migration ([did:plc spec](https://github.com/did-method-plc/did-method-plc/blob/main/website/spec/v0.1/did-plc.md#how-it-works), +[repository spec](https://atproto.com/specs/repository)). For an estate +with its own CA/IdP this is a strictly better recovery pattern than "the +CA reissues everything", and the PLC operation log is worth copying as an +audit trail. Its capability story is thin (PDS-layer OAuth/service-auth +JWTs; a DID proves control, not scoped authority), official implementations +are TS/Go (Rust via the credible community Atrium SDK), and running actual +atproto is off-mission. + +Scores: identity/key management **4** · capability/delegation **2** · Rust +maturity **3** · estate fit **3** · project health **5** (production at +Bluesky scale). + +## 2.10 Noise + WireGuard — the channel layer; identity and nothing else + +Noise is a framework for DH-based handshake protocols: long-term static +keys are the parties' identities, patterns (XX, IK, …) encode who proves +what when, and authentication is exactly "you hold the private key matching +the static key I expected" — naming, enrolment, and trust decisions are +explicitly the application's problem +([noiseprotocol.org](https://noiseprotocol.org/noise.html)). WireGuard is +one fixed Noise instantiation (`Noise_IKpsk2_25519_ChaChaPoly_BLAKE2s`) +whose model is the purest form: a peer *is* its 32-byte Curve25519 public +key, cryptokey routing binds keys to AllowedIPs, and there are no +certificates, enrolment, or revocation in-protocol — rotation and +revocation are config edits on every peer +([WireGuard paper](https://www.wireguard.com/papers/wireguard.pdf)). +Tailscale's architecture is the standing proof of how much control plane +(enrolment, key distribution, naming, ACLs, revocation) must be built +above that minimal core. Rust support is strong (`snow` for Noise; +Cloudflare's `boringtun` for userspace WireGuard). For this estate these +are the channel-security substrate *under* other designs (iroh's QUIC/TLS +plays the same role in its stack) — they give a self-certifying peer +identity and forward secrecy, and pointedly nothing else: no capabilities, +no delegation, no groups, no lifecycle. + +Scores: identity/key management **3** · capability/delegation **1** · Rust +maturity **4** · estate fit **4** · project health **4**. + +## 2.11 SPIFFE/SPIRE — adopt the format and discipline, not the control plane + +SPIFFE (CNCF-graduated standard) defines workload identity as a URI +(`spiffe:///`) carried in short-lived SVIDs — X.509 +(URI SAN, for mTLS) or JWT (`sub`) — verified against a trust-domain +bundle; SPIRE, the Go reference implementation, adds the genuinely +distinctive piece: **two-stage attestation** (the server attests the node, +the on-node agent attests the workload from kernel/platform selectors) so +SVIDs are minted from observed evidence and auto-rotated (typically ~1h) +via the Workload API, with bundle-exchange federation between domains +([spiffe.io overview](https://spiffe.io/docs/latest/spiffe-about/overview/), +[CNCF graduation](https://www.cncf.io/announcements/2022/09/20/spiffe-and-spire-projects-graduate-from-cloud-native-computing-foundation-incubator/)). +The direct estate answer: a house CA issuing short-lived X.509 with a URI +SAN plus the existing OIDC provider issuing JWTs with the same URI as +`sub` *already is* an SVID system in substance (SPIRE can even chain to an +existing PKI as upstream CA). SPIFFE adds only (1) attestation-based, +secretless issuance — real, and the house stack has no equivalent; +(2) standard wire formats for interop with Istio/Envoy and cloud +workload-identity federation; (3) naming/TTL discipline for free. Rust +support is client-only (the pre-1.0 `spiffe` crate: Workload API client, +SVID sources) — the runtime you'd operate is Go +([spiffe crate](https://docs.rs/crate/spiffe/latest)). Recommendation +shape: adopt the ID format + TTL/rotation policy now; deploy SPIRE only +when external interop or attestation becomes a concrete requirement. + +Scores: identity/key management **5** · capability/delegation **2** (SVIDs +assert identity only) · Rust maturity **3** · estate fit **2** (full SPIRE; +format-only adoption scores far higher) · project health **5**. + +## 2.12 Survey flags for synthesis (summary) + +1. **Biscuit ⚑** — beats the field on *deployable offline token*: + Rust-reference + official WASM + Datalog attenuation + public-key + verification. The direct filler for capnp's "no offline authority" + hole (§1.8). +2. **UCAN ⚑** — beats the field on *token semantics* (delegation + + invocation + policy + revocation; `did:key` = NodeId-shaped identity). + Rust 1.0 is the blocker; treat as the semantic reference and a + watch/borrow item. +3. **Holochain ⚑** — beats the p2p field on *composability + capability + design*: runs on iroh today (Kitsune2), and CapGrant/CapClaim + + membrane proofs are the reference design for an auth layer over iroh. +4. **AT Protocol patterns** — not a candidate, but its rotation/signing key + split with adversarial recovery beats the estate's current + CA-reissue-everything recovery story; borrow into the IdP/CA program. +5. **SPIFFE** — adopt ID format + short-TTL discipline without SPIRE; + attestation is the one capability the house stack genuinely lacks. +6. **Holepunch** — sync *model* (signed logs + Autobase) is the design to + re-implement over iroh; the stack itself is JS-only and loses. +7. **libp2p** — keep as interop escape hatch only. **Veilid** and + **Freenet** compete with the chosen transport and lose for this estate. + **Macaroons** are prior art to cite. **Noise/WireGuard** are the channel + layer, already subsumed by iroh's QUIC/TLS in the target design. + +Cross-cutting: across all eleven survey entries plus capnp/capnweb, **no +single system provides identity + capabilities + sync + storage**; every +credible composition pairs a transport that proves key possession (iroh) +with a capability layer (live ocap à la capnp/Holochain, or offline tokens +à la Biscuit/UCAN) and a sync layer (log-based, à la p2panda/Hypercore +models). That is the shape synthesis should evaluate "p2panda for +everything" against. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/keyhive-subduction.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/keyhive-subduction.md new file mode 100644 index 000000000..54ede7600 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/keyhive-subduction.md @@ -0,0 +1,778 @@ +# Keyhive & Subduction: local-first access control and encrypted sync (Ink & Switch) + +Research lane KEYHIVE, for the auth + transport investigation (tracking issue +developing-today/code#13779). Written 2026-11-23 from primary sources — the +Keyhive dev notebook, the in-repo design documents, the two GitHub repos, +crates.io / docs.rs / lib.rs, and the BeeKEM paper. Every factual claim is +linked. Secondary summaries are flagged where used. + +**One-sentence verdict:** Keyhive is the only candidate in this programme +that treats *authorization itself* as a replicated, offline-first data +structure — a state-based CRDT of signed delegations and revocations +("Keyline") whose evaluation gives coordination-free revocation, plus a +decentralized group-key protocol (BeeKEM) that turns that membership graph +into end-to-end encryption keys with post-compromise security. Nothing else +in the field does this combination. It is also, today, **pre-alpha, +unaudited, and carrying known authorization gaps its own threat model +discloses** — so it is a design to learn from and a composition candidate +for later, not a foundation to build the estate on this quarter. + +--- + +## 1. What each piece IS, and the naming history + +The family is one stack from one lab (Ink & Switch — the Automerge lab), +with three separable artifacts: + +- **Keyhive** — the access-control system: signing, encryption, and + delegation for local-first data. Rust workspace, Apache-2.0 + ([repo](https://github.com/inkandswitch/keyhive)). It has three layers: + convergent capabilities (the authority graph), a group-management CRDT, + and E2EE with causal keys + ([notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/)). +- **BeeKEM** — the continuous group key agreement (CGKA) protocol inside + Keyhive: a concurrent variant of TreeKEM (the protocol under MLS) that + needs no central ordering server. Now also a published research paper + with security proofs (§7). +- **Subduction** — the sync protocol: peer-to-peer synchronization of + encrypted, hash-linked data (CRDT commits) over pluggable transports, + with Keyhive as its authorization layer. Separate Rust workspace, + MIT OR Apache-2.0 ([repo](https://github.com/inkandswitch/subduction)). + +Naming, because the literature uses all of these: the project was +originally called **Beehive** and renamed Keyhive before open-sourcing +([notebook 03](https://www.inkandswitch.com/keyhive/notebook/03/)). +**Beelay** was the first Keyhive-enabled sync/relay design (an RPC protocol +with RIBLT set reconciliation, described in +[notebook 05](https://www.inkandswitch.com/keyhive/notebook/05/)); the +Keyhive README states plainly that Subduction is "the successor to Beelay" +([repo README](https://github.com/inkandswitch/keyhive)). "Beehive" as a +*system* name is dead; BeeKEM and the bee puns survive. + +The design intent is explicit about scope: Keyhive does access control for +replicated data and deliberately does **not** do identity, naming, key +recovery, or sync itself — those are layered above/beside it, and the +design overview draws identity, recovery, and sync as external dashed +boxes ([design README](https://github.com/inkandswitch/keyhive/blob/main/design/README.md)). + +--- + +## 2. Identity & key management + +- **Keys are the only principals.** Every node in the authority graph is an + Ed25519 verifying key; at the Keyline level there is *no distinction* + between individuals, groups, and documents — higher layers assign meaning + to particular keys + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). +- **An individual is one immutable Ed25519 keypair.** A *person* is + modelled as a group whose members are that person's per-device + individuals; key rotation for a person = add a new device individual to + the group, remove the old one + ([notebook 05](https://www.inkandswitch.com/keyhive/notebook/05/)). +- **Documents/groups bootstrap via a root edge.** At creation the subject + key signs exactly one delegation to a freshly minted "root role," and the + subject's signing key is then destroyed (Keyhive ships an + `EphemeralSigner` for this). The subject's identity is its verifying key, + permanently; its authority immediately lives in the role graph + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). +- **Human identity is explicitly out of scope.** "Keyhive deliberately + excludes user identity (i.e. the binding of a human identity to an + application's identifier like a public key)"; name registration, + discovery, and verification are left to a future layer above it + ([notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/)). The + design overview names the intended neighbours: PKI, DIDs, Keyoxide, KERI, + OpenPGP, petnames, ATProto + ([design README](https://github.com/inkandswitch/keyhive/blob/main/design/README.md)). + This composes cleanly with this estate's existing fleet CA / IdP work — + Keyhive would consume those identities, not replace them. +- **Key custody is the host's problem, by design.** Keyhive does not own + key storage; its `AsyncSigner` abstraction lets hosts keep signing keys + in WebCrypto (non-extractable), hardware, or a KMS + ([threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). + In the GAIOS integration, messages are signed with "the local + non-extractable signing key" + ([Dispatch 014](https://www.inkandswitch.com/newsletter/dispatch-014/)). +- **Share (encryption) keys**: each group member also holds an X25519 + keypair used by BeeKEM, published as signed "prekey" operations; prekeys + must be canonical large-order X25519 keys, verified against the issuer's + signature, so nobody can publish keys for an identity they don't hold + ([threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). + +## 3. Capability model — "convergent capabilities" / Keyline + +This is the family's centre of gravity, and the part with no real rival in +the programme. + +### 3.1 The model + +Keyhive's capability layer, **Keyline**, is "the authority graph: a +state-based CRDT of delegations and revocations" +([repo README](https://github.com/inkandswitch/keyhive)). It sits +deliberately between the two classical capability families: object +capabilities are fail-stop under partition (wrong for local-first); +certificate capabilities (SPKI/SDSI, zcap-ld, UCAN) are partition-tolerant +but stateless, which "somewhat limits their flexibility." Convergent +capabilities ("concap") carry CRDT state to get both +([notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/)). + +There are exactly two certificate kinds, both signed Ed25519 statements, +content-addressed by the digest of issuer + payload, stored in an +append-only set whose merge is set union +([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)): + +- **Delegation**: `{issuer, audience, subject, power, citation?}` — reads + "issuer asserts that audience may exercise `power` over `subject`." + `subject` is a *scope*, not an endpoint: a delegation whose subject is a + role is a *membership* and conveys everything that role reaches, now or + in the future (late binding). +- **Revocation**: `{issuer, revoke: Digest, retain}` — names + one delegation by hash; `retain` carries per-subject content-retention + watermarks for the content layer and is never read by evaluation. + +Power is a totally ordered ladder, and the bottom rung is this estate's +friend: + +``` +Relay < Read < Edit < Admin +``` + +`Relay` = may sync and relay ciphertext but **cannot decrypt** — it makes +untrusted relays first-class citizens of the graph. `Read` = decrypt, +`Edit` = write, `Admin` = act on the graph itself (revoke on routes +through the node; manage a role's roster) +([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). + +### 3.2 No proof chains — authority is derived, not presented + +A delegation has **no proof field**. It does not name the chain that +justifies it; justification is computed at verification time from the whole +certificate set: an audience holds standing over a subject iff *some* +unbroken route exists from the subject to the audience through live +delegations. The design doc's summary of its own lineage is exact: "Keyline +is RT₀ with SDSI chain discovery, with revocation semantics closest to +ARBAC97's administrative relations, evaluated as stratified Datalog" +([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). +Consequences the authors call out, all of which matter for an offline +estate: + +- **Late binding**: a delegation issued before its issuer had authority + becomes effective the moment the issuer gains it, and dies the moment + the issuer loses it. "Edges are facts; authority is derived." +- **Redundant routes**: access via two chains survives one breaking; there + is no single brittle proof chain to invalidate (contrast UCAN, where the + chain is the artifact). +- **Order independence**: any two replicas holding the same set compute + the same authority graph, in any delivery order — the CRDT property. +- Evaluation is graph-global, not certificate-local: "no certificate can + be verified in isolation, only against a set." The evaluation is a + stratified-Datalog least fixed point in two passes — a positive pass + ignoring all revocations, then a live pass filtering routes through the + computed revocation coverage + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). + +### 3.3 Attenuation + +Effective power is the **maximum over routes of the minimum along each +route** (widest-path / bottleneck): delegating `Admin` when you hold only +`Edit` conveys `Edit`. Indirection cannot raise power, and `keyhive_core` +refuses to even sign a delegation above the issuer's effective power +([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md); +[threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). + +### 3.4 Revocation — the hard part, done unusually well + +Revocation in eventually-consistent systems is where capability designs +usually hand-wave. Keyline's semantics are specified to an unusual depth: + +- **Coordination-free and permanent.** A revocation, once applied by any + replica, can never be un-applied by a merge; access can only be restored + by a fresh signature from live authority, never by delivery order. The + design invariant: "Once a replica has applied a revocation, no merge may + un-apply it" + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). +- **Who can revoke what.** The issuer or the audience of a delegation can + kill it on *every* route (total). A third party's revocation breaks the + target only on routes passing through the revoker's **admin reach** — + the set of nodes that key *ever* held Admin over, computed with all + revocations ignored, so it only ever grows. Anyone can revoke a + delegation on routes through their own node (refusing to let their + standing carry someone else's delegation). A revocation outside those + scopes is *inert* — valid, admissible, zero effect. Seniority needs no + rule: an edge above your admin reach never routes through it, so + revoking it does nothing + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). +- **Implicit cascade.** Revoking Alice's membership enumerates nothing; + every delegation she issued simply fails the liveness check at next + evaluation, transitively. Each certificate's liveness is evaluated on + its own, so revoking one of two redundant routes leaves the other + untouched. +- **Revival, honestly treated as both feature and hazard.** If a removed + key regains standing, its old delegations spring back to life (repair by + re-add costs one certificate, with provenance intact). The hazard — an + unintended re-add reviving forgotten grants — is blunted by documented + practice: explicit revocations on removal (permanent, survives re-add) + and fresh-key discipline after compromise. A `citation` field on + re-issued delegations names the revocation being healed past, so a heal + gets a fresh hash instead of colliding with the revoked original + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). +- **The ex-admin sharp edge, disclosed rather than hidden.** An ex-admin + retains revocation power over their frozen admin reach *forever* — + deny-only, so they can grief but never grant. The durable escape is + **rotation**: mint a fresh role key, re-supply it, re-roster the + survivors; the fresh node post-dates the ex-admin on every graph and can + never enter their reach. The design doc is blunt that "removing an admin + needs a rotation," and mirrors the same shape in BeeKEM (§5) + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). +- **Root-role caveat.** Removal from the root role is *never durable* + while the subject key is destroyed (every route transits the root role, + and every root admin's reach covers it); the root role is append-only + trust, "treat it like a root CA: set it up once and use it rarely," with + all churn in second-layer roles where rotation works + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). + +### 3.5 What the capability model pointedly does NOT have + +- **No expiry.** There is no timestamp, TTL, or not-after field on either + certificate kind (confirmed by full-text search of the Keyline design). + This is a deliberate consequence of the no-clocks stance: the threat + model lists "trusted time" as a non-goal — "ordering is causal only" + ([threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). + Short-lived authority must be modelled as delegation + prompt + revocation, or layered on top. For an estate used to UCAN-style expiring + tokens, this is the single biggest semantic difference. +- **No ambient policy language.** Roles, powerboxes, caretakers, pinning, + device groups are *patterns* (arrangements of nodes) over the two + primitives, not built-in constructs — "some guarantees become + conventions rather than semantics" + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). +- **Back-dating is only partly answerable.** Keyhive cannot distinguish a + genuinely old operation arriving late from a fabricated back-dated one; + revocations record content-head watermarks (`retain`) so the content + layer can reject post-revocation edits, but "applications that need + this must add a timestamping or anchoring service" + ([threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). + +## 4. Group management + +Groups are not a separate subsystem; they are the same graph read +differently: + +- A **role** is just a key that others hold membership in. Membership = + delegation with the role as `subject`; a **supply** = delegation *to* a + role about another subject, connecting the role to that subject. Roles + nest arbitrarily (a role can be a member of another role), documents are + themselves groups, and documents-as-members gives folder-style + hierarchies + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md); + [notebook 05](https://www.inkandswitch.com/keyhive/notebook/05/)). +- Because membership is late-bound, supplying a role with a new document + grants it to all current members with **no re-issuance** — "nobody + re-issues the memberships, no certificate changes." +- The **group-management CRDT** framing from the overview: "self-certifying, + concurrent group management complete with coordination-free revocation" + ([notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/)). + Concurrent adds/removes converge deterministically (in BeeKEM, concurrent + adds to the same leaf are resolved by sorting and blanking paths, §5). +- A documented pattern, **constitutional flatness** (a role's Admin + memberships name only individuals, never another role), makes rosters + self-certifying and untouchable by outsiders, and makes rotation cheap; + the patterns document also covers caretakers, pinning, sealing, and + stewardship conventions + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). +- The group graph is also what drives encryption and sync: following + delegations tells a writer who holds Read (who must be seated in the + CGKA tree), and tells a trust-minimized sync engine which documents a + peer may pull + ([notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/)). + +## 5. Encryption — the cryptographic design, precisely + +### 5.1 Primitives + +Fixed ciphersuite, no crypto agility (an explicit non-goal in +[notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/)): +**Ed25519** signing, **X25519** Diffie-Hellman, **XChaCha20-Poly1305** +AEAD, **BLAKE3** hashing and key derivation +([design README](https://github.com/inkandswitch/keyhive/blob/main/design/README.md); +[threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). +The one novel construction is the AEAD nonce: a synthetic nonce computed +as a keyed hash, under a subkey of the encryption key, of the associated +data and plaintext — deterministic, key-committing, and explicitly +**"assumed secure pending review"**; the repo README warns that "the +nonce / key-commitment construction in `design/ciphersuite.md` has not +been independently reviewed" +([threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md); +[repo README](https://github.com/inkandswitch/keyhive)). + +### 5.2 BeeKEM — per-document group keys + +- Every document (subject) with readers gets a **BeeKEM tree**: a binary + tree whose leaves are the members (each leaf = member ID + current + X25519 public key), whose root holds the group's current **root secret** + encrypted under the tree, and whose inner nodes hold DH public keys plus + secrets encrypted via DH exchange with the sibling subtree. A member + decrypts the root secret by walking its leaf-to-root path doing O(log n) + DH decryptions + ([notebook 02](https://www.inkandswitch.com/keyhive/notebook/02/)). +- **Application secrets** are derived from the root secret with BLAKE3 + `derive_key` per purpose, so compromising one application secret reveals + neither the root secret nor other application secrets (crates.io + `beekem` README, via + [crates.io search record](https://crates.io/crates/beekem/reverse_dependencies)). +- **Why not MLS/TreeKEM**: TreeKEM requires a central server to totally + order operations and pick winners among concurrent ones. BeeKEM keeps + TreeKEM's shape but requires only *causal* order, merging concurrent + updates in any order — when two leaves concurrently update a node, both + DH keys are kept as "conflict keys," the node is treated as blank for + encryption purposes, and updates encrypt to the node's *resolution* + (highest non-blank, non-conflict descendants) so that a compromised old + leaf key cannot decrypt across the fork ("cross-fork security" in the + paper). A causally later update collapses the conflicts + ([notebook 02](https://www.inkandswitch.com/keyhive/notebook/02/)). +- **Membership change = key change.** *Remove* blanks the member's leaf + and its entire path to the root; remove paths are blanked *after* all + concurrent operations merge, so a removed member's concurrent update + cannot survive. *Add* places the member at the next blank leaf and + blanks its path. The next member *Update* (key rotation) re-keys the + blanked path and restores a root secret the removed member cannot + derive — that is the post-compromise-security mechanism + ([notebook 02](https://www.inkandswitch.com/keyhive/notebook/02/)). +- **Costs**: O(log n) update/decrypt in the common case, O(n) worst case + (maximally blanked or conflicted tree); worst-case space O(n log n) + while conflicts are unresolved. Target group size is "on the order of + thousands of members" — well past DCGKA's ~100, short of MLS's 50k + design point + ([notebook 02](https://www.inkandswitch.com/keyhive/notebook/02/)). +- Only members with `Read` or higher are seated as BeeKEM leaves; `Relay` + holders are excluded from the CGKA group and never receive a path secret + ([threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). + Keyline drives the CGKA: the capability graph determines whose X25519 + keys are in the tree — "something not possible with standard certificate + capabilities alone" + ([design README](https://github.com/inkandswitch/keyhive/blob/main/design/README.md)). + +### 5.3 Content encryption — causal keys, and the forward-secrecy trade + +- Content is encrypted **at rest, in chunks**: ranges of CRDT changes are + compressed (Automerge binary format) and then encrypted, rather than + encrypting every operation. Chunk boundaries shift as history stabilizes + ([notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/)). +- **Causal encryption**: each chunk's key envelope includes the keys of + all its *causal predecessor* chunks (Cryptree-like). Holding a chunk's + key lets you iteratively discover the keys for its entire causal + history — but not its parents' other children or concurrent chunks + ([notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/)). +- **Forward secrecy is deliberately sacrificed for content, and the + design says why**: an op-based CRDT cannot materialize a view with gaps + in history, so every reader needs every historical key anyway; passing + them in the envelope adds simplicity and flexibility. What is retained + is **post-compromise security for the future**: revoke + next BeeKEM + path update cuts off all future chunks. The threat model lists forward + secrecy as an explicit **non-goal**: "a current reader can decrypt all + history" + ([notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/); + [threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). +- **Padding**: block bodies are padded inside the AEAD to PADMÉ lengths + (256-byte floor), leaking only a coarse size class; operation counts, + CGKA operation sizes, timing, document IDs, and the membership graph + remain visible to relays — accepted, since "relays must see membership + to evaluate capabilities" + ([threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). +- **In transit**: Keyhive itself prescribes no channel security; the + design expects sync to run over TLS/mTLS or an equivalently confidential + transport, with all payloads E2EE regardless + ([design README](https://github.com/inkandswitch/keyhive/blob/main/design/README.md)). + Subduction adds its own authenticated handshake (§6). + +### 5.4 Known gaps — from the project's own threat model + +The current *code* falls short of the design in ways the authors disclose +as tracked gaps G1–G4. Two are authorization-relevant and must be quoted +in any honest assessment +([threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)): + +- **G1**: CGKA authorization reads the *positive* graph (ignoring + revocations), so **a revoked member can delegate to a fresh key of its + own and get that key seated in the tree** by every replica. +- **G2**: a CGKA add's share key is not checked against the added member's + published prekeys — an adder can seat a key it holds itself. +- **G3**: eviction DoS — any principal with positive standing (even + `Relay`) can manufacture a cite-able revocation and remove a reader from + the tree (denial of service, not disclosure; removing the creator + empties the tree). +- **G4**: replicas reconcile their BeeKEM trees only after their *own* + membership writes, so a peer's revocation removes a reader from the tree + only via the revoker's replica. + +Plus two open items: no content layer yet reads the `retain` watermark +(T5 untested), and the synthetic-nonce construction awaits independent +review. And the repo-level warning stands over everything: "DO NOT use +this release in production applications… The code has not had a security +audit" ([repo README](https://github.com/inkandswitch/keyhive)). + +## 6. Subduction — the sync protocol + +### 6.1 What it syncs + +Subduction replicates **Sedimentrees**. A Sedimentree is a set-based, +content-addressed store for one hash-linked commit DAG: *loose commits* +(individual signed commits) plus *fragments* (compressed ranges of +commits). It is essentially an LSM tree adapted to CRDT graph data, with +one twist — compaction must be deterministic across replicas that have +never communicated, so fragment depth is assigned by the number of leading +zero bytes in each item's BLAKE3 hash: any peer holding the same data +partitions it identically +([author's notes](https://notes.brooklynzelenka.com/notes/subduction/)). +The structure is CRDT-like (merge is set union; `diff` and `minimize` are +the core operations) +([DeepWiki, secondary](https://deepwiki.com/inkandswitch/subduction/4.1-sedimentree-data-structure)). + +The protocol is **CRDT-agnostic**: it syncs hash-linked data; Automerge is +the original target and the only shipped data integration +(`automerge_subduction_ingest`, `automerge_subduction_wasm`), but "the +core sync layer doesn't assume anything about the CRDT it's carrying" +([author's notes](https://notes.brooklynzelenka.com/notes/subduction/); +[repo README](https://github.com/inkandswitch/subduction)). + +### 6.2 How reconciliation works + +- **Fingerprint set reconciliation.** Instead of exchanging 32-byte + digests, peers exchange 8-byte SipHash-2-4 fingerprints computed with a + random per-request seed; both sides fingerprint their items with the + same seed and diff on u64 values. Batch sync reconciles a whole tree in + **1.5 round trips** (request with fingerprint summary + subscribe flag; + response with the data you're missing and the fingerprints needed back; + a fire-and-forget third leg — storage is idempotent, and an empty diff + next round confirms success). The authors claim the initial diff is + ~75% smaller than sending full digests + ([author's notes](https://notes.brooklynzelenka.com/notes/subduction/)). +- **Subscriptions.** After batch sync, peers opt into real-time + incremental forwarding: new commits/fragments are forwarded to + subscribers, filtered per-subscriber by authorization. Subscriptions are + per-peer, not per-connection + ([author's notes](https://notes.brooklynzelenka.com/notes/subduction/)). +- **Encryption-friendly by construction.** Reconciliation runs on content + hashes and fingerprints only; sync never touches plaintext, which is + the whole point of pairing it with Keyhive — a relay can reconcile and + forward data it cannot read + ([repo README](https://github.com/inkandswitch/subduction)). + +### 6.3 Peer authentication and authorization + +- **Mutual authentication handshake**: two messages, symmetric (either + side may initiate). The initiator sends a signed challenge + `{audience, timestamp, nonce}`; the responder verifies the signature, + validates audience and timestamp, checks the nonce against a replay + cache (4 buckets × 3 min = 12-minute window, lazy GC), and returns a + signed response over the challenge digest. Both sides learn each + other's peer ID from the verifying key — Ed25519 throughout + ([author's notes](https://notes.brooklynzelenka.com/notes/subduction/)). +- **Identity ≠ permission, kept separate in the API.** The handshake + establishes only *who* is connecting. Whether they may connect is a + `ConnectionPolicy`; whether they may fetch/store a given tree is a + `StoragePolicy` — distinct traits in `subduction_core` + ([docs.rs](https://docs.rs/subduction_core/0.5.0/subduction_core/)). +- **Keyhive integration is a policy crate**: `subduction_keyhive` (types) + and `subduction_keyhive_policy` (Keyhive-based authorization policy for + connections) sit in the workspace's Integrations layer + ([repo README](https://github.com/inkandswitch/subduction)). With it, a + relay serves only peers that can prove `Relay` or better for the + document in question + ([Keyhive threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). +- **Revocation interplay**: there is no revocation message in Subduction. + Access changes arrive via Keyhive; when the auth check fails, + Subduction simply stops forwarding to that peer + ([author's notes](https://notes.brooklynzelenka.com/notes/subduction/)). + +### 6.4 Relationship to Keyhive, precisely + +Subduction does not depend on Keyhive, and Keyhive does not depend on +Subduction. Keyhive's design overview draws sync as an external box and +says identity/recovery/sync are "not in scope for this repository (sync is +Subduction)" +([design README](https://github.com/inkandswitch/keyhive/blob/main/design/README.md)). +The coupling is a policy interface plus a shared worldview: both treat +signed, hash-linked, encrypted data as the unit of replication, and the +Keyhive graph tells Subduction which trees a peer may pull. In the one +shipped end-to-end stack (Automerge Repo + GAIOS), Keyhive is plugged in +as the auth provider at the repo layer — messages signed with the local +key, per-document authorization checked against the local Keyhive +instance — while Keyhive's own ops initially synced over the same network +stack with "a naive diffing mechanism" that Subduction is meant to +replace +([Dispatch 014](https://www.inkandswitch.com/newsletter/dispatch-014/)). + +## 7. BeeKEM the paper — the family's strongest maturity signal + +*BeeKEM: Decentralized, Secure and Efficient Group Key Agreement* — Yen, +Fábrega, Da, Kleppmann, Mumm, Park, Zelenka — is on the Cryptology ePrint +Archive as [Paper 2026/1434](https://eprint.iacr.asia/2026/1434) (July +2026; listed as in submission by the authors). Its claims, in its own +abstract: "the first decentralized group key agreement protocol with +logarithmic update cost in the common case (degrading to linear in the +worst case) **and proofs of security**," proven under the existing DCGKA +security definitions (Weidner et al.), with a new security notion +(cross-fork security) for attacks unique to the decentralized setting, an +open-source implementation, and benchmarks "competitive with OpenMLS." +That is a materially stronger evidence base than any other novel crypto in +this programme. The honest counterweight, from the ActivityPub E2EE task +force's public minutes (2026-07-28): participants recommended BeeKEM as a +model to consider while noting it "would need another cryptographer to +review it" +([swicg meeting notes](https://github.com/swicg/meetings/blob/HEAD/2026-07-28-e2ee/README.md)) — +i.e. preprint + proofs, not yet peer-reviewed or independently audited. + +## 8. Transport assumptions & NAT traversal + +- **Keyhive prescribes no transport at all.** Its operations are signed + data; the design overview notes the only requirement is that "patches + eventually get from one machine to another, so P2P, sync servers, + sneakernets, and carrier pigeon are all feasible in this model" + ([design README](https://github.com/inkandswitch/keyhive/blob/main/design/README.md)). +- **Subduction is transport-agnostic with three shipped transports**: + WebSocket (`subduction_websocket`, plus `subduction_hyper` for + hyper/axum/tower servers), HTTP long-poll (`subduction_http_longpoll`, + "for restricted network environments"), and **Iroh/QUIC** + (`subduction_iroh`, "for direct peer-to-peer connections") + ([repo README](https://github.com/inkandswitch/subduction)). +- **NAT traversal is inherited, not built**: the iroh transport gets + iroh's hole-punching and relay fallback; the WebSocket/HTTP transports + assume a reachable server/relay (the CLI runs server/relay modes). The + protocol core is `no_std`, so it also runs in Wasm/browser and embedded + contexts where the transport is whatever the host provides + ([author's notes](https://notes.brooklynzelenka.com/notes/subduction/)). +- There is **no discovery system**: peers connect to known peer IDs / + URLs (the Wasm example distinguishes discovery-by-first-contact from + `connect(url, expectedPeerIdHex)` when identity is known in advance) + ([repo README](https://github.com/inkandswitch/subduction)). Discovery + and naming are, as with identity, someone else's layer. + +## 9. Sync/replication semantics (summary across the family) + +- **Data layer**: set-union replication of content-addressed, signed + items (commits, fragments, certificates). Idempotent — "receiving the + same data twice is always safe." No total order anywhere; causal order + only where the CRDT requires it, and Keyhive buffers operations whose + predecessors are missing rather than diverging + ([author's notes](https://notes.brooklynzelenka.com/notes/subduction/); + [threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). +- **Auth layer**: state-based CRDT; convergence is by construction (same + set ⇒ same derived authority graph, §3.2). +- **Offline behaviour**: this is the family's home turf — every operation + (delegate, revoke, edit, rotate keys) is a local act on local state + that merges later. Nothing in either protocol requires a live round + trip to a server or a quorum. +- **Conflict story**: data conflicts are the carried CRDT's problem; + auth conflicts are resolved by the evaluation rules (concurrent + revocations both stand; concurrent BeeKEM updates fork-and-heal via + conflict keys). The one content-layer conflict the family explicitly + leaves open is *whiteout* — whether a revoked member's past writes stay + materialized — punted to the application via the `retain` watermark, + with the semantics of combining watermarks still an open question + ([Keyline design](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md)). + +## 10. Storage fit (SQLite / Turso) + +- **Keyline's stored state is two append-only tables.** Delegations and + revocations are flat, fixed-shape, content-addressed rows — as + SQLite-shaped as data gets. The subtlety is *evaluation*: the + implementers' notes work through exactly this question. The pipeline + (positive pass → coverage → live pass) is "expressible in SQL as + chained CTEs, and the negation is a legal anti-join," **except** the + standing derivation itself, which is a *non-linear* fixpoint (a + derivation step can consume two recursively derived facts — the role + rule) and therefore exceeds `WITH RECURSIVE` in both SQLite and + PostgreSQL. A SQL backend needs "one ordinary statement per fixpoint + round, plus a driver loop that repeats until a round adds no rows. The + loop is the only non-declarative ingredient in the design." Evaluation + cost itself is polynomial with small constants; the reference evaluator + answers `members()` in ~1 ms for a 180-member document + ([evaluation notes](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/evaluation-notes.md)). +- **What ships today is an in-memory store**: `keyline_memory` is "the + in-memory reference `Keyline` store," behind a `Keyline` store trait — + so a SQLite/Turso backend is a designed-for, documented exercise, not + existing code + ([repo README](https://github.com/inkandswitch/keyhive)). `keyhive_core` + additionally has an `archive` module for serializing a whole Keyhive + state + ([docs.rs](https://docs.rs/keyhive_core)). +- **Subduction storage is a trait with several backends, none of them + SQLite**: filesystem storage with journaling/fsync + (`sedimentree_fs_storage`), an in-repo `subduction_redb_storage` + (redb — a pure-Rust embedded key-value store), in-memory storage, and a + published `subduction_object_storage` crate implementing the `Storage` + trait over the `object_store` crate (S3 and other object stores) + ([repo README](https://github.com/inkandswitch/subduction); + [DeepWiki, secondary](https://deepwiki.com/inkandswitch/subduction/2.1-core-components); + [crates.io](https://fastly-app.crates.io/crates/subduction_object_storage)). + For this estate: Turso/libsql would be a new backend behind existing + traits on both sides — plausible, bounded work; not a download. + +## 11. Rust maturity & project health + +- **Keyhive**: repo created 2024-08-13; 328 commits, 280 stars, 32 + releases at time of writing; Apache-2.0. Crates published: + `keyhive_core` 0.5.0 (2026-06-26; six releases since 0.1.0 in June + 2025; ~13.5k all-time downloads, ~1k/month), `beekem` 0.5.x, + `keyhive_crypto`, `keyhive_content`, `keyhive_codec`, `keyline`, + `keyline_memory`, `keyhive_wasm` (Wasm + TypeScript bindings) + ([repo](https://github.com/inkandswitch/keyhive); + [lib.rs](https://lib.rs/crates/keyhive_core); + [crates.io](https://crates.io/crates/beekem/reverse_dependencies)). + CI checks include `no_std` and MSRV. Self-described status, repeated in + the README, the notebook, and the crate keywords ("pre-alpha", + "preview"): **pre-alpha, unstable APIs, no security audit, do not use + in production**. +- **Subduction**: repo created 2025-07-18; 280 commits, 139 stars, 110 + releases; crates at 0.19.x (`subduction_core` 0.19.0, `sedimentree_core` + 0.15.0) with releases still landing ~fortnightly at time of writing; + dual MIT/Apache-2.0. Self-described as "an early release preview… very + unstable API… DO NOT use for production use cases at this time" + ([repo](https://github.com/inkandswitch/subduction); + [inspect.software, secondary](https://inspect.software/software/inkandswitch/subduction)). +- **Signs of life beyond the lab**: Ink & Switch is dogfooding both in + GAIOS (its ARIA Safeguarded AI Programme platform) — Keyhive as the auth + provider for Automerge Repo, Subduction being integrated to replace the + reference sync server, which "has shown stress points" at scale + ([Dispatch 014](https://www.inkandswitch.com/newsletter/dispatch-014/)). + The Automerge project's July 2026 notes describe Keyhive as the + work-in-progress access-control layer and Zelenka as "hard at work + making our new sync system — Subduction — both fast and boring to + operate in production" + ([This Month in Automerge](https://automerge.org/blog/2026-july/)). + A third-party adopter (Muni Town's Roomy) is publicly planning on + Keyhive for access control (secondary: + [meri.garden](https://meri.garden/posts/a-deep-dive-explainer-on-beekem-protocol/)). +- **Funding/backing**: Ink & Switch is a small independent research lab + (1–10 people) funded by grants, sponsorships, and commissioned work; + Keyhive work was accelerated under the ARIA programme for GAIOS + ([Dispatch 014](https://www.inkandswitch.com/newsletter/dispatch-014/)). + Bus factor is a real consideration: the named authors across both repos + and the paper are a handful of people (Zelenka, Good, Mumm, plus + academic collaborators). +- **Spec/interop status**: no standards-track specification and no second + implementation of either protocol. The closest things to specs are the + in-repo design documents (extensive, and unusually candid) and the + BeeKEM paper. One genuine interop hook exists: the `keyline` crate + ships a **conformance suite** (scenarios and laws) that the design docs + treat as the contract — "where this document and the conformance suite + disagree, the suite wins" + ([evaluation notes](https://github.com/inkandswitch/keyhive/blob/main/design/keyline/evaluation-notes.md)). + +## 12. Cloudflare fit + +- **Nothing Cloudflare-specific exists.** No Workers bindings, Durable + Objects integration, or KV usage in either repo. What exists is Wasm: + `keyhive_wasm` (keyhive_core + TS bindings) and Subduction's Wasm + crates (`subduction_wasm`, `sedimentree_wasm`, + `automerge_subduction_wasm`) targeting browser and Node.js + ([repo README](https://github.com/inkandswitch/keyhive); + [repo README](https://github.com/inkandswitch/subduction)). Running + Keyline evaluation inside a Worker via `keyhive_wasm` is plausible but + unpublished and unexercised; the estate would be the first. +- **R2 is reachable in principle**: `subduction_object_storage` puts a + Sedimentree store on any `object_store` backend, and that crate family + speaks S3 — R2's API is S3-compatible. The same crate has a `keyhive` + feature storing Keyhive events content-addressed in the same bucket. + This is a storage backend for a Subduction *server*, not a Worker + deployment shape + ([crates.io](https://fastly-app.crates.io/crates/subduction_object_storage)). +- **Servers are native**: Subduction's server story is the CLI (with + NixOS and Home Manager modules in the flake — a genuine fit for this + estate's NixOS hosts) or hyper/axum embedding + ([repo README](https://github.com/inkandswitch/subduction)). In the + estate's current shape, a Subduction relay would sit *behind* a + Cloudflare door (like the commander/mcpx bridges), not on the edge. + +## 13. iroh fit + +The best of any family in the programme, on paper: Subduction **already +ships an iroh transport** (`subduction_iroh`, published at 0.11.x) — it +doesn't merely compose with iroh, it has done the composition +([repo README](https://github.com/inkandswitch/subduction); +[inspect.software, secondary](https://inspect.software/software/inkandswitch/subduction)). +The identity models also align: Subduction peer IDs are Ed25519 verifying +keys learned from the handshake, and iroh NodeIds are Ed25519 public keys +— the estate's #13752 design already treats NodeId-as-identity as the +iroh story, and a Subduction-over-iroh binding inherits it directly. +Keyhive itself is transport-blind (§8), so it neither helps nor hinders. +Caveat: the iroh transport's maturity inside Subduction is unproven — +published and integration-tested alongside the other transports, but the +project's own dogfooding (GAIOS/Automerge Repo) runs over WebSocket-style +network stacks, per Dispatch 014. + +## 14. What this family pointedly does NOT do + +Collected from the projects' own non-goals, so the comparison matrix can +score them as absences rather than oversights: + +- **Identity, naming, discovery, key recovery** — all layered elsewhere, + by design (§2, §8). +- **Forward secrecy for content history** — sacrificed deliberately; + PCS for future content is the guarantee (§5.3). +- **Expiry / trusted time** — no clocks in the capability layer at all + (§3.5). +- **Availability** — "Keyhive guarantees that what is delivered is + correct, not that it is delivered" + ([threat model](https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md)). +- **Traffic-analysis resistance** beyond coarse size padding; relays see + the membership graph (§5.3). +- **A data model** — Keyhive/Subduction carry *other people's* CRDTs. + There is no Keyhive answer to "what is a document's schema" or "how do + concurrent text edits merge"; that is Automerge's (or p2panda's) job. +- **Production readiness** — by the authors' own repeated statement (§11). + +## 15. Where this family sits in a composed stack for this estate + +**As the auth layer over someone else's sync — that is exactly the shape +it was designed for, and the strongest composition story in this +programme.** Concretely, over p2panda: + +- p2panda operations are signed, hash-linked, and Ed25519-keyed — the + same shape of artifact Keyhive's layers consume. The Automerge team's + own framing is that Keyhive "will work with any hash graph, including + CRDTs," not just Automerge + ([This Month in Automerge](https://automerge.org/blog/2026-july/)). + In a composed stack: p2panda topics/documents become Keyline subjects; + fleet seats and user devices become individuals grouped under person/ + seat roles; Keyline evaluation answers "may this key pull/edit this + topic" at every replica, offline, with coordination-free revocation; + BeeKEM seats the Read-holders of each encrypted topic and provides the + group keys p2panda itself does not manage. +- The **`Relay` power level is a direct hit on this estate's + architecture**: the Cloudflare doors and bridge relays that today hold + ambient trust would hold `Relay` — able to store/forward ciphertext, + cryptographically unable to read, and *inside* the same authorization + graph as everyone else rather than trusted by construction. +- **Subduction is a credible alternative sync for hash-linked data** if + the estate ever wants a second sync engine: CRDT-agnostic, iroh-native, + fingerprint reconciliation, and an object-storage backend that fits R2. + But adopting it *instead of* p2panda-sync means adopting its data + structure (Sedimentree) too, and it is younger and less proven than + Keyhive's design documents are. + +**The blockers are maturity, not fit:** + +1. Pre-alpha + unaudited + **G1 is a live revocation bypass in the CGKA + seating path** as of the current threat model. Until G1/G2 close and + the ciphersuite gets its independent review, Keyhive cannot be the + enforcement layer for anything the estate actually needs to keep + private — it can be the *model* (the graph semantics are implementable + from the design docs + conformance suite) before it can be the *code*. +2. No expiry anywhere means the estate's short-lived-session patterns + (Actions runners, leased exec) need a layer Keyhive doesn't provide — + revocation-as-expiry works only when replicas sync promptly. +3. The root-role append-only caveat and the ex-admin rotation discipline + are operational commitments: adopting Keyline means adopting its + operational folklore (constitutional flatness, fresh-key discipline, + rotate-after-admin-removal) as runbook, not just its API. +4. Bus factor: one small lab. The design docs are good enough to reimplement + from (and the conformance suite makes that verifiable), which is the + real insurance policy — but it should be priced into the decision. + +**Net**: if the programme's question is "p2panda for everything, or +p2panda + a composed auth layer," Keyhive is the only candidate whose auth +layer was *built* to be composed this way, and its revocation semantics +are the best-thought-through in the field. The honest sequencing is: +adopt the *model* now as the reference for whatever auth the estate +builds or borrows; revisit the *code* when the audit/gap list moves. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/ocap-family.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/ocap-family.md new file mode 100644 index 000000000..c90164c1d --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/ocap-family.md @@ -0,0 +1,626 @@ +# The object-capability network family: CapTP, OCapN, Endo, Spritely Goblins, Agoric + +Research lane OCAP, for the auth + transport investigation (tracking issue +developing-today/code#13779). Written 2026-11-23 from primary sources — +project specs, docs, repos, and release notes; every factual claim is linked. +Secondary summaries are flagged where used. + +**One-sentence verdict:** this family is the most completely realised design +for *live, delegated authority between mutually suspicious programs* that +exists anywhere — and it is a **distributed-objects** system, not a data +replication system. It has no answer to "how do two offline nodes converge on +shared state," because that is not the problem it solves. For this estate +(Rust / SQLite-Turso / Cloudflare / iroh) it is a poor base and a rich +idea-mine; §8 lists exactly what to borrow. + +--- + +## 1. What each piece IS, and which layer it sits at + +The five names are not five alternatives. They are one lineage at five +different layers, and most confusion about this family comes from treating +them as competitors. + +### 1.1 CapTP — the protocol (the idea layer) + +CapTP, the Capability Transport Protocol, is an abstract protocol for +message passing between objects on different machines in which **holding a +reference *is* the authority to invoke**: "an object can use another object +(capability) if and only if it possesses a reference to it — if you don't +have it, you can't use it" +([OCapN CapTP draft specification](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). +Its defining features, per the same draft: + +- **Distributed object references.** Within a pairwise session, objects are + exported/imported by position; a message can carry references as arguments, + so the reference graph and the access graph are the same graph. +- **Promises and promise pipelining.** A message send creates a promise for + the result; further messages can be sent *to the promise* before it + resolves and are delivered to its eventual resolution, collapsing what + would be N round trips into one message flight (the draft's car-factory + example: 6 sequential steps become 4 messages sent without waiting) + ([CapTP draft, Promises](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). + This comes straight from Mark S. Miller's dissertation work on the E + language, which the OCapN README cites as the explanation of pipelining's + value ([ocapn/ocapn README](https://github.com/ocapn/ocapn)). +- **Distributed (acyclic) garbage collection.** Peers cooperatively inform + each other when a cross-session reference is no longer needed + (`op:gc-exports` / `op:gc-answers`); acyclic-only because full distributed + cyclic GC "requires special hooks into the garbage collector, whereas + distributed acyclic GC merely requires weakrefs, weakmaps, and finalizers" + ([ocapn/ocapn README](https://github.com/ocapn/ocapn)). +- **Third-party handoffs.** When a message in session A↔B carries a reference + to an object that lives in session A↔C, a handoff protocol (roles: Gifter, + Receiver, Exporter) lets B connect *directly* to C with the same authority, + "in a secure fashion, even if the messages are viewed by a malicious actor" + — i.e. introductions without proxying and without trusting the introducer + with the traffic afterwards + ([CapTP draft, Third party handoffs](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). +- **Error propagation.** Broken promises propagate across the network; + partition breaks promises, which is how failure is represented. + +Lineage: CapTP was first openly implemented in the **E programming language** +(itself a continuation of Electric Communities Habitat); "CapTP is something +which has been implemented many times" since, incompatibly — in E, in Cap'n +Proto, in Agoric's implementation, and in Spritely's Goblins — and OCapN +exists precisely because those implementations could not talk to each other +([ocapn/ocapn README](https://github.com/ocapn/ocapn)). + +### 1.2 OCapN — the interop standardisation effort (the spec layer) + +OCapN (Object Capability Network) is the pre-standardisation effort to make +CapTP implementations interoperable. It is a suite of draft specifications — +**CapTP**, **Netlayers**, **Locators**, plus a data Model and Notation doc — +in the [ocapn/ocapn](https://github.com/ocapn/ocapn/tree/main/draft-specifications) +repo, with Syrup as the wire serialisation for messages crossing a CapTP +boundary ([CapTP draft, Additional Documents](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). + +- **Status, in its own words: "OCapN is still pre-specification."** The plan + is to first get Agoric's and Spritely's implementations interoperable, + *then* consider Cap'n Proto, "before beginning any discussion of + standardization" (i.e. no IETF/W3C submission yet) + ([ocapn/ocapn README](https://github.com/ocapn/ocapn)). The CapTP draft + itself warns it is "likely to undergo significant change" and is based on + Spritely Goblins' implementation as the starting point + ([CapTP draft, header](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). +- **Participants:** Spritely Institute (primary driver, spec editor), + Agoric, Cap'n Proto (advisory), MetaMask (review) + ([search-surfaced DeepWiki summary of ocapn meeting minutes, 2023-04-25](https://deepwiki.com/ocapn/ocapn/9.1-participating-organizations) — secondary). +- **Netlayers** are OCapN's transport abstraction: CapTP runs over any + netlayer providing a bidirectional, ordered, secure channel; the draft + names Tor onion services as the specified one, with TCP/TLS in development + at draft time and libp2p / IBC / I2P named as possible + ([Netlayers draft, via DeepWiki](https://deepwiki.com/ocapn/ocapn/6.1-netlayers-specification) — secondary summary of the draft). +- **Locators** define the `ocapn://` URI structure for machines and objects: + a peer designator (netlayer-specific, self-authenticating), a transport + name, routing hints, and for objects a *swiss number* — an unguessable + random nonce assigned at registration, which is itself the capability + ([Goblins manual, Using the CapTP API](https://files.spritely.institute/docs/guile-goblins/latest/Using-the-CapTP-API.html); + locator components as described in + [Spritely, End-to-end encrypted relays for OCapN](https://www.spritely.institute/news/end-to-end-encrypted-relays-for-ocapn.html)). +- There is a shared **test suite** ([ocapn/ocapn-test-suite](https://github.com/ocapn/ocapn-test-suite)) + that implementations run against a reference sturdyref-exporting peer — + the mechanism by which interop is actually checked (§5). + +### 1.3 Endo — the JavaScript ocap platform (the runtime layer) + +Endo (by Agoric, Apache-2.0) is a framework for ocap programming in +JavaScript: "tools for *confinement*, *communication*, and *concurrency*" +([Endo getting started](https://endojs.org/getting-started/)). Its parts: + +- **SES / Hardened JavaScript** — a shim that locks down JS intrinsics and + provides Compartments, so mutually suspicious code can share a process. + This is the piece with real production mileage: "Agoric and MetaMask rely + on Hardened JavaScript and the SES shim" for sandboxing third-party + plugins, and Salesforce's Lightning framework is a SES user + ([Endo getting started](https://endojs.org/getting-started/); + [Agoric platform paper](https://papers.agoric.com/documentation/platform/)). +- **Eventual send (`E()`)** — the programming surface that stretches async + method invocation over processes and networks via handled promises + ([Endo docs, Distributed Programming](https://docs.endojs.org/documents/get-started.html)). +- **`@endo/captp`** — Agoric's *production* CapTP, deliberately "a minimal + CapTP implementation": JSON-able messages over a connection object you + supply yourself; it is transport-agnostic because it doesn't do transport + at all ([@endo/captp README](https://raw.githubusercontent.com/endojs/endo/master/packages/captp/README.md)). + Historically it lacked the full OCapN feature set — the 2020 interop + discussion lists distributed GC emission and handoff tables as things + *both* sides still needed to build + ([Agoric/agoric-sdk#1827](https://github.com/Agoric/agoric-sdk/issues/1827)). +- **`@endo/ocapn`** — the *new* package implementing OCapN CapTP proper + (Syrup encoding, GC operations, swiss numbers), with netlayers for + WebSocket and a TCP testing netlayer; released at 1.1.0 and synced against + the OCapN test suite + ([Endo release PR #3209, @endo/ocapn 1.1.0 notes](https://github.com/endojs/endo/pull/3209)). +- **The Pet Daemon (`@endo/daemon`, `@endo/cli`)** — "a persistent host for + managing guest programs in hardened JavaScript worker processes," + communicating with its controller in CapTP over netstring envelopes on a + Unix domain socket / named pipe, with per-user storage + ([@endo/daemon README](https://raw.githubusercontent.com/endojs/endo/master/packages/daemon/README.md)). + On top of it sits the **petname system**: each agent keeps its own + namespace of human-meaningful names for capabilities ("@documents/work", + "@payment/groceries"); you grant, inspect, and revoke by name rather than + by hash or API key + ([Endo, Review: Sandboxes Won't Save You From OpenClaw](https://endojs.org/review-sandboxes-wont-save-you-from-openclaw/); + [DCF, Containing AI Agents: The Endo Familiar Demo](https://dcfoundation.io/containing-ai-agents-the-endo-familiar-demo/)). + Revocation is mechanical, not advisory: a daemon "Reaper" change makes + deleting every petname that retains a value collect its underlying + *formula*, cancel the live value, and sever the CapTP connections and + workers still holding it + ([endojs/endo PR #3087](https://github.com/endojs/endo/pull/3087)). + Endo is actively pitching this daemon as the containment layer for + AI-written code, with capability requests mediated by the user + ([endojs/endo#3019](https://github.com/endojs/endo/issues/3019)). + +### 1.4 Spritely Goblins — the distributed object environment (the other runtime) + +Goblins is Spritely Institute's "distributed object programming environment" +(Apache-2.0), implemented twice: **Guile Scheme** (the lead implementation; +"most new features are aimed at Guile Goblins") and **Racket Scheme** +(network-compatible, feature-lagging) +([Goblins v0.12.0 release post](https://community.spritely.institute/t/blog-post-spritely-goblins-v0-12-0-released-two-new-netlayers-join-the-ocapn-family-and-more/396)). +Current release: **v0.18.0** (April 2026) +([Spritely news](https://www.spritely.institute/news/spritely-goblins-v0-18-0-sleepy-actors.html)). +Spritely's own maturity label for Goblins is "Working Beta" +([spritelyproject.org](https://spritelyproject.org/) — search-surfaced). + +What Goblins adds on top of CapTP: + +- **Vats and transactional turns.** Objects live in vats (units of + synchrony); each turn is a cheap local transaction that rolls back on + error, which is also what enables its time-travel debugging (secondary + summary of the Spritely whitepaper: + [The Heart of Spritely](https://agent-comms.anuna.io/papers/ocap/the-heart-of-spritely---distributed-objects-and-capability-security/)). +- **The most complete CapTP in the family** — the OCapN README states + Spritely "has the most pieces of CapTP (including distributed acyclic GC, + handoffs) and the start of the netlayer abstractions and URI concepts" + ([ocapn/ocapn README](https://github.com/ocapn/ocapn)). +- **Aurie / the persistence system.** Persistent vats serialise their object + graph (in Syrup) to a store and restore it later, with upgrade/migration + support; v0.17.0 added **Bloblin**, a streaming binary-log store writing + compressed deltas per vat churn ("many thousands of deltas per second"), + replacing whole-graph rewrites + ([Goblins v0.17.0 release post](https://www.spritely.institute/news/spritely-goblins-v0-17-0-persistence-is-better-than-ever.html); + [Goblins manual, Persistence stores](https://spritely.institute/files/docs/guile-goblins/latest/Persistence-stores.html)). + v0.18.0 added "sleepy actors," a caching layer that lets persisted actors + be evicted and rehydrated on demand + ([Goblins v0.18.0 release post](https://www.spritely.institute/news/spritely-goblins-v0-18-0-sleepy-actors.html)). +- **Sealers/unsealers** — the standard ocap pattern for tamper-evident + envelopes and rights amplification, used throughout the actor library + ([Goblins garden tutorial, community post](https://community.spritely.institute/t/growing-a-networked-garden-with-spritely-goblins/195)). +- **Netlayers shipped in Guile Goblins:** Tor onion services; TCP+TLS; + Prelay (relay, see §4); libp2p (added v0.14.0, Sept 2024 — + [release announcement](https://www.mail-archive.com/guile-user@gnu.org/msg15207.html)); + WebSocket (exists — v0.18.0 fixed a signing-oracle vulnerability in its + designator authentication + ([v0.18.0 release post](https://www.spritely.institute/news/spritely-goblins-v0-18-0-sleepy-actors.html))). + No dedicated WebRTC netlayer has shipped; WebRTC appears only as community + discussion alongside the libp2p work + ([community forum index](https://community.spritely.institute/c/architecture/goblins/48) — search-surfaced). +- **Hoot** compiles Guile (and thus Goblins) to WebAssembly; Goblins has run + in the browser since v0.15.0, and OCapN-over-Hoot issues were fixed in + v0.16.1 ([Spritely news archive](https://www.spritely.institute/news/)). + +### 1.5 Agoric — the chain (the application/platform layer) + +Agoric is a Cosmos-SDK blockchain whose smart contracts are Hardened +JavaScript objects, built on **SwingSet**, a vat kernel: a vat is "a unit of +synchrony," vats communicate only asynchronously, vat state is orthogonally +persistent, and a special *comms vat* speaks CapTP to the outside world — +to other SwingSets, to solo machines (ag-solo), and over **IBC** to other +chains, so that a blockchain can be treated as "an ordinary machine +supporting distributed objects on the network" +([Agoric platform paper](https://papers.agoric.com/documentation/platform/); +[ocapn/ocapn README](https://github.com/ocapn/ocapn); +[Agoric/agoric-sdk#1827](https://github.com/Agoric/agoric-sdk/issues/1827)). +On top sit **ERTP** (transferable rights as objects) and **Zoe** (offer +safety for contracts) — the family's worked example of ocap *economics*. + +For a non-chain user, Agoric-the-chain is mostly irrelevant; what transfers +is (a) Endo/SES, which Agoric maintains and which runs in production at +MetaMask scale, (b) the SwingSet demonstration that CapTP semantics survive +even a store-and-forward, consensus-ordered "netlayer" (transactions as +transport), and (c) ERTP/Zoe's patterns for rights-as-objects. Agoric's own +engineering talent is historically central to CapTP — the OCapN README notes +Agoric "has most of the engineering talent who have implemented CapTP +historically" ([ocapn/ocapn README](https://github.com/ocapn/ocapn)). + +--- + +## 2. The conceptual core: distributed objects ≠ data replication + +This is the contrast the whole investigation turns on, so it is worth being +precise. + +**The ocap model answers:** *"Program A holds authority over a live service +run by program B. How does A invoke it, delegate part of that authority to +C, attenuate it, or take it back — with the guarantees enforced by the +reference graph itself rather than by an ACL checked at a boundary?"* +State lives **in exactly one place**: inside the object, on its home +machine, behind its methods. Other parties hold *presences* (remote +references), never copies. Consistency is therefore trivial — there is one +object, one turn order, one truth — and "conflict resolution" is a category +that does not exist. What exists instead is *liveness*: if the home machine +is offline or the session breaks, every promise to it breaks, and the +authority is simply unavailable until a sturdyref is re-enlivened over a new +session. + +**The log/CRDT model (p2panda, Willow, Hypercore, …) answers the opposite +question:** *"Many nodes each hold a copy of shared data and edit it while +disconnected. How do the copies converge, and who was allowed to write?"* +Authority there is about *past writes* (signed operations, capability +tokens checked at ingest), and the system's centre of gravity is durable, +replicated, mergeable state. + +Consequences, stated as wins and losses for the ocap side: + +**Where live references win:** +- **Real-time authority and immediate revocation.** Revoking in CapTP is a + local act with immediate effect: interpose a forwarding "caretaker" object + and flip it, or (Endo daemon) delete the petname and the formula + collection cancels the value and severs the connection + ([endojs/endo PR #3087](https://github.com/endojs/endo/pull/3087)). + No revocation list has to propagate; there is nothing to propagate *to* — + every call goes to the live object. Compare any token/log system, where a + revoked credential remains valid everywhere until expiry or until a CRL / + epoch update reaches every verifier. +- **Attenuation is just programming.** A restricted facet is an ordinary + object that forwards a subset of methods (read-only directory, spend-limit + payment source). It cannot be bypassed, because there is no other path to + the underlying object — authority only exists as references. Token systems + (UCAN/Biscuit/macaroons) attenuate *claims*; ocap attenuates *behaviour*, + including stateful, rate-limiting, revocable behaviour. +- **Delegation without identity infrastructure.** A third-party handoff + introduces two peers directly, with certificates that keep the handoff + secure "even when CapTP messages are not kept secret" + ([CapTP draft](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). + No directory, no token exchange, no shared namespace is needed for A to + give C exactly the reference A holds. +- **Latency shape.** Promise pipelining removes round trips from chained + calls, which is the dominant cost in chatty distributed-object workloads + ([CapTP draft, Promises](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). +- **Confused-deputy resistance by construction.** Because designation and + authority travel together (the reference names *and* empowers), the whole + class of "tricked into using its own authority on the wrong object" bugs + that ACL systems suffer is designed out — this is the family's founding + argument, restated in the Spritely whitepaper (secondary summary: + [The Heart of Spritely](https://agent-comms.anuna.io/papers/ocap/the-heart-of-spritely---distributed-objects-and-capability-security/)). + +**Where live references lose:** +- **Offline-first anything.** A capability to an offline object is a promise + that breaks. There is no store-and-forward in the core model, no + operation log to replay, no merge. (Agoric's chain use is the exception + that proves the rule: it works because the *chain itself* is the always-on + home of the objects, with consensus as the netlayer.) +- **Durable shared state.** Nothing in CapTP replicates data. Goblins' + answer is orthogonal persistence of *one node's own* object graph + (Aurie/Bloblin) — a checkpoint log, not replication; two nodes never hold + convergent copies of the same object + ([Goblins v0.17.0](https://www.spritely.institute/news/spritely-goblins-v0-17-0-persistence-is-better-than-ever.html)). +- **Many-reader / public-data workloads.** Content distribution, feeds, + shared documents, audit logs — the bread and butter of the log families — + are simply not the ocap shape; you'd end up building a replication system + *inside* objects, badly. +- **Availability coupling.** Every holder's liveness depends on the object's + home being up and reachable. NATs, sleep, and churn are protocol-level + problems (hence the relay work in §4), where a sync system treats them as + background conditions. + +**Neither model subsumes the other.** A composed estate — replicated log for +shared durable state, live references for control-plane authority — is not a +compromise; it is each model doing the job it is shaped for. This matters +for §7. + +--- + +## 3. Axes: identity & key management + +- **Peer identity is a keypair, scoped by netlayer.** In OCapN, a locator's + designator is "self-authenticating identity (usually a public key)" + ([Spritely, E2EE relays](https://www.spritely.institute/news/end-to-end-encrypted-relays-for-ocapn.html)). + Concretely: on the Tor netlayer the designator *is* the onion address + (an ed25519 public key); on TCP+TLS, "sturdyrefs for this netlayer use a + SHA-256D hash of the TLS certificate as the peer identifier," with address + hints carried alongside + ([Goblins manual, TCP+TLS](https://files.spritely.institute/docs/guile-goblins/latest/TCP-_002b-TLS.html)). +- **Sessions have their own keys, separate from peer identity.** The OCapN + CapTP draft requires each side to create a *per-session* Ed25519 keypair + at `op:start-session`, used to sign handoff structures; a peer's public + identifier within the session is the double-SHA256 of its session key + ([CapTP draft, Cryptography](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). + So there are two identity tiers: long-lived netlayer identity (how you + *reach* me) and ephemeral session identity (how handoffs *authenticate*). +- **Objects have no identity separate from their references.** A registered + object gets a swiss number — a large random nonce — inside its sturdyref; + knowing the sturdyref *is* the capability to enliven it + ([Goblins manual, CapTP API](https://files.spritely.institute/docs/guile-goblins/latest/Using-the-CapTP-API.html)). + There is no global object namespace and no lookup without a reference. +- **Humans name things locally.** Petnames (Endo daemon; Spritely's Brux + project) are per-user, non-global names bound to sturdyrefs/references — + Zooko's-triangle-aware: human-meaningful *and* secure because they are + local mappings onto unguessable identifiers, never a global registry + ([kriskowal.com, Endo](https://kriskowal.com/endo/); + [Endo review](https://endojs.org/review-sandboxes-wont-save-you-from-openclaw/)). +- **Key management story is thin.** Keys are generated by the netlayer + (self-signed TLS certs auto-generated in Goblins' TCP+TLS netlayer) or by + Tor; there is no PKI, no rotation protocol, no recovery story, no + multi-device identity in the specs. Persistence of netlayer secrets is + handled by the vat persistence system ("Goblins now handles storing and + providing the secrets… a netlayer might need to persist") + ([v0.14.0 announcement](https://www.mail-archive.com/guile-user@gnu.org/msg15207.html)). + Groups, as an identity concept, **do not exist** in this family — see §4. + +## 4. Axes: capability model — delegation, attenuation, revocation, groups + +- **Delegation** is reference-passing in a message, plus third-party + handoffs when the reference crosses sessions (§1.1). Delegation is exact: + you can only ever give what you hold, and giving a facet gives only the + facet. +- **Attenuation** is object composition: membranes, caretakers, read-only + facets, sealers. It is Turing-complete policy (stateful, contextual, + revocable), not a caveat list. This is the single largest capability-model + gap between this family and every token system in the investigation. +- **Revocation** has three mechanisms, all live: (1) don't hand out the + object, hand out a forwarder you control, then disable the forwarder; + (2) session severance — `op:abort` ends a session and breaks its promises + ([CapTP draft](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)); + (3) retention-based — Endo's daemon collects a value's formula when its + last petname goes, cancelling the value and disconnecting retainers + ([endojs/endo PR #3087](https://github.com/endojs/endo/pull/3087)). + There is deliberately **no expiry** in the core model: a reference is + valid until revoked or its object dies. (Token-style expiry can be built + as a facet; the reverse — live revocation on top of bearer tokens — is + the thing that cannot be retrofitted.) +- **Groups: nothing.** No group abstraction, no roles, no membership + protocol exists in CapTP/OCapN/Endo/Goblins. A "group" would be an + ordinary object someone writes (e.g. an object holding references to + members' objects and forwarding). Anyone whose auth problem is *primarily* + group membership over shared data (the p2panda-auth / Keyhive shape of + problem) gets no leverage here. + +## 5. Axes: encryption, transport & NAT traversal, spec/interop status + +**Encryption.** CapTP itself does no encryption; confidentiality and +channel authentication are *netlayer* requirements (a netlayer must provide +a secure, ordered, bidirectional channel where only the two participants +can insert messages — +[Netlayers draft, via DeepWiki](https://deepwiki.com/ocapn/ocapn/6.1-netlayers-specification), secondary). +In practice: Tor netlayer inherits Tor's encryption and anonymity; TCP+TLS +uses TLS with self-signed certs whose hash is the peer identity (so the +channel is authenticated by construction, no CA) +([Goblins manual, TCP+TLS](https://files.spritely.institute/docs/guile-goblins/latest/TCP-_002b-TLS.html)). +Handoff security does *not* depend on channel secrecy — handoff certificates +are signed with session keys so they stay safe "even when CapTP messages are +not kept secret" +([CapTP draft](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). +There is **no end-to-end encryption of object state at rest** in this +family (that is what Spritely's separate Porta/Bella work and the other +families' document encryption address), and no group encryption at all. + +**Transport & NAT.** The honest summary: this is the family's weakest axis +relative to the iroh/libp2p world. + +- Tor onion services are the flagship netlayer precisely because onion + services solve NAT by rendezvous — at the cost of high latency; the + Goblins manual itself steers NAT'd TCP+TLS users to Tor, noting TCP+TLS + has "lack of both 'store and forward' and NAT hole punching support" and + otherwise needs manual port forwarding + ([Goblins manual, TCP+TLS](https://files.spritely.institute/docs/guile-goblins/latest/TCP-_002b-TLS.html)). +- **Prelay** (v0.12.0) is a federated relay netlayer layered over other + netlayers — but v0 forwards messages **in cleartext through the relay**, + "unauthenticated, which means the relay has the power to both snoop on and + modify messages"; it was named *pre*-relay to discourage reliance on it + ([Goblins manual, Prelay](https://files.spritely.institute/docs/guile-goblins/latest/Prelay.html)). +- The fix is recent and not yet in a numbered release as of writing: an + NLnet-funded **Noise-protocol netlayer** that composes with Prelay to make + a federated, end-to-end-encrypted relay with perfect forward secrecy, + announced October 2026 for "the next release of Goblins," with an OCapN + spec for the relay to follow, and already dogfooded in a shipped p2p game + (Polydraw, Autumn Lisp Game Jam 2026) + ([Spritely, E2EE relays](https://www.spritely.institute/news/end-to-end-encrypted-relays-for-ocapn.html); + [Spritely news index](https://spritely.institute/)). +- A **libp2p netlayer** exists in Guile Goblins since v0.14.0 + ([announcement](https://www.mail-archive.com/guile-user@gnu.org/msg15207.html)), + which in principle inherits libp2p's hole punching and relay circuits, + but it is the least exercised of the shipped netlayers (community + questions about its status recur — + [community forum](https://community.spritely.institute/c/architecture/goblins/48), search-surfaced). +- Endo's side is transport-minimal: `@endo/captp` runs over whatever + message channel you hand it (WebSocket, MessagePort, …) + ([Endo docs](https://docs.endojs.org/documents/get-started.html)); + `@endo/ocapn` ships WebSocket and TCP-testing netlayers + ([Endo release PR #3209](https://github.com/endojs/endo/pull/3209)). + There is no NAT story in Endo at all — the Familiar demo reaches peers + through a WebSocket *relay* on the invite-accept model + ([DCF, Endo Familiar demo](https://dcfoundation.io/containing-ai-agents-the-endo-familiar-demo/)). + +**Spec & interop status — the question the brief asks directly: has +Goblins↔Endo OCapN interop actually been demonstrated?** Yes — but recently, +narrowly, and against a moving spec: + +- 2020–2023: interop was aspirational. The Agoric↔Spritely discussion + enumerates real divergences (serialisation: Goblins' Syrup vs Agoric's + JSON marshal/SmallCaps; session-break semantics; handoff tables and GC + unimplemented on the Agoric side) + ([Agoric/agoric-sdk#1827](https://github.com/Agoric/agoric-sdk/issues/1827)). +- 2023: the demonstrated interop was *intra-family* — Guile Goblins ↔ + Racket Goblins exchanging messages over OCapN, proven with a ported chat + app (Milestone 1 of the NLnet standardisation grant) + ([Spritely, Introducing OCapN](https://spritely.institute/news/introducing-ocapn-interoperable-capabilities-over-the-network.html)). +- 2026: **Endo's `@endo/ocapn` runs a CI interop test against Guile + Goblins** — a bilateral chatroom (goblin-chat) exercised in CI via + `guix shell`, plus the shared Python test suite pinned to a Feb 2026 + commit; the package shipped at 1.1.0 with the WebSocket netlayer "used + for interop with Guile-Goblins peers" + ([Endo release PR #3209](https://github.com/endojs/endo/pull/3209)). + So: two independent implementations, one application shape (chat), + CI-checked. That is a genuine milestone and also the *entirety* of + cross-vendor OCapN interop today. +- The spec still churns underneath implementers: Goblins v0.18.0 (April + 2026) bumped the CapTP protocol version — dropping `op:deliver-only`, + pluralising the GC ops — and states plainly that "applications built with + an earlier release of Goblins are incompatible with the OCapN shipped in + this release" + ([Goblins v0.18.0](https://www.spritely.institute/news/spritely-goblins-v0-18-0-sleepy-actors.html)). + The FOSDEM 2026 talk likewise describes OCapN as "pre-standardization" + with implementations in Racket, Guile, JS, and Dart + ([FOSDEM 2026 slides](https://archive.fosdem.org/2026/events/attachments/QPUXCQ-ocapn_the_secure_decentralized_protocol_of_the_future/slides/267538/presentat_e7u2q2b.pdf)). + +## 6. Axes: sync semantics, storage fit, languages, project health + +- **Sync/replication semantics:** none. Sessions are live, ordered, + pairwise; a disconnected session's ephemeral references are severed and + its promises break (the semantics of re-establishing them via sturdyrefs + was flagged as an unsettled design issue by both camps in + [Agoric/agoric-sdk#1827](https://github.com/Agoric/agoric-sdk/issues/1827)). + Offline behaviour is "unavailable," by design. +- **Storage fit (SQLite/Turso):** none natively. Goblins persistence is its + own Syrup/Bloblin file stores (a binary delta log of the object graph); + Endo's daemon keeps per-user formula/petname stores. Nothing in the + family speaks SQL, and nothing would gain from Turso — persistence here + is *object-graph checkpointing*, not tables or replicated logs + ([Goblins manual, Persistence stores](https://spritely.institute/files/docs/guile-goblins/latest/Persistence-stores.html)). +- **Languages:** JavaScript (Endo/Agoric), Guile Scheme and Racket Scheme + (Goblins), plus a Dart implementation reported in the FOSDEM talk + ([slides](https://archive.fosdem.org/2026/events/attachments/QPUXCQ-ocapn_the_secure_decentralized_protocol_of_the_future/slides/267538/presentat_e7u2q2b.pdf)). +- **Rust presence: effectively zero.** The only Rust OCapN implementation + is [cmars/ocapn-rs](https://codeberg.org/cmars/ocapn-rs) — a single-author + learning project, self-described as "Stage 0 in progress," whose stated + goals are understanding and eventual interop with Goblins. There is no + Rust CapTP in the OCapN sense, no crate, no maintainer community. (The + capability RPC that *does* exist in mature Rust form is Cap'n Proto's — + `capnp-rpc`, a Level-1 implementation + ([docs.rs](https://docs.rs/crate/capnp-rpc/latest)) — but that is the + capnproto family's divergent CapTP descendant, not OCapN; see the sibling + note.) +- **Cloudflare fit:** poor for the protocol, incidental for the runtime. + Workers are JS/Wasm isolates: SES/Endo code can run there in principle + and `@endo/ocapn`'s WebSocket netlayer matches Workers' WebSocket + support, but there is no Workers-targeted CapTP anything, no Durable + Objects integration, and the daemon/Goblins models assume long-lived + processes with local storage — the opposite of the Workers shape. Nobody + in this family is building for Cloudflare. +- **iroh fit:** none, and mildly competing. A netlayer over iroh is + *conceivable* (iroh gives an authenticated, encrypted, NAT-traversing + byte stream keyed by ed25519 NodeId — which maps cleanly onto OCapN's + "designator = public key" locator field), but no such netlayer exists, + and the family's own trajectory (Tor, Prelay+Noise, libp2p) is building + its own answer to the same problem iroh already solves better. +- **Project health:** Spritely Institute is a small 501(c)(3) shipping + steadily on NLnet grant funding (Goblins 0.18.0 April 2026, Hoot 0.10.0 + October 2026, active news cadence — + [spritely.institute](https://spritely.institute/)); OCapN standardisation + itself is NLnet-funded + ([ocapn/ocapn README](https://github.com/ocapn/ocapn)). Endo is maintained + by Agoric with MetaMask as a production SES consumer. All Apache-2.0. + One operational note for this estate specifically: the OCapN project + prohibits AI-generated contributions to its specs, test suite, and + official tooling by policy + ([ocapn/ocapn README](https://github.com/ocapn/ocapn)) — upstream + engagement from an agent-driven fleet would have to be human-authored. +- **Operational complexity:** high for a non-Lisp/non-JS shop. Running this + family means running a vat host (Guile or Node), a persistence store, + netlayer infrastructure (Tor or relays), and a pre-1.0 protocol whose + wire version has already broken compatibility once in 2026. +- **What it pointedly does NOT do:** replicate data; work offline; manage + groups or membership; provide a global namespace or discovery; encrypt + content at rest; run in Rust; target Cloudflare; promise a stable wire + protocol yet. + +## 7. Fit for this estate, honestly + +The estate's auth/transport problems, from the master prompt, are: agent +seats on laptops/sandboxes/Actions runners needing to reach each other and +the broker; delegation and revocation of authority between agents; group-ish +access to shared replicated state (queue, atlas data); all in Rust, over +SQLite/Turso, with iroh as the emerging transport and Cloudflare doors at +the edge. + +Against that shape, OCapN-as-base fails on nearly every load-bearing axis: +no Rust implementation beyond a stage-0 learning project; no replication +for the queue/atlas state that is the estate's centre of gravity; no group +model for seat/team access; NAT traversal a generation behind iroh (Tor +latency, a cleartext relay being replaced only now, an unexercised libp2p +netlayer); a wire protocol that broke compatibility within the last year; +and no Cloudflare story. Adopting it as the foundation would mean porting +CapTP to Rust *and* building the missing data layer *and* the missing +group layer — i.e. funding the family's unfinished decade with this +estate's own roadmap. + +Where the fit is genuinely good is narrower and real: **the fleet's +control plane is a distributed-objects-shaped problem.** A seat holding a +live, attenuated, revocable reference to "the broker's dispatch facet for +repo X" — rather than a bearer token plus an ACL check — is exactly the +CapTP shape, and the estate already feels the token model's limits (walls, +scopes, broker-mediated everything). If the estate ever builds a live +agent-to-agent RPC layer (as opposed to queue-mediated work), CapTP's +semantics — not necessarily its wire protocol — are the right blueprint, +and Cap'n Proto's Rust RPC is the pragmatic vehicle for those semantics +(sibling lane's subject). + +## 8. What to borrow even if we build elsewhere + +1. **Revocation by interposition as a first-class pattern.** Never hand a + raw authority to a delegate; hand a forwarder/caretaker object whose + forwarding can be switched off. This works in any RPC system (including + a Rust one over iroh) and gives immediate, propagation-free revocation — + the property token systems structurally lack. (Pattern evidence: + [Endo daemon Reaper](https://github.com/endojs/endo/pull/3087) shows the + retention-based variant: authority dies when its last name does.) +2. **Petnames for agent-facing authority.** Whatever the estate's capability + format becomes, the *human/agent-facing* layer should be local, + meaningful names bound to unguessable identifiers — never raw hashes or + tokens in prompts, logs, or UIs. Endo's pet daemon is the existence + proof that this UX works for capabilities specifically + ([Endo review](https://endojs.org/review-sandboxes-wont-save-you-from-openclaw/)). + This aligns directly with the estate's existing "secrets by name only" + discipline. +3. **Third-party handoff thinking for introductions.** When A introduces B + to C, design for B↔C direct connection with the introduction + cryptographically bound (gift certificates signed by session keys), not + permanent proxying through A and not "send C's token to B." The CapTP + handoff roles (Gifter/Receiver/Exporter) are the cleanest vocabulary + available for this + ([CapTP draft](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). + Directly relevant to the coordinator-handoff design in the fleet + actions-exec work. +4. **Promise pipelining as an API-design rule.** Any chatty cross-machine + API the estate designs should let callers chain operations on + not-yet-resolved results in one flight. Even without CapTP, "send the + plan, not the steps" is the lesson + ([CapTP draft, Promises](https://github.com/ocapn/ocapn/blob/main/draft-specifications/CapTP%20Specification.md)). +5. **The netlayer contract as a transport-abstraction checklist.** + OCapN's requirement set — bidirectional, ordered, session-secure, + at-most-once-or-die, designator = self-authenticating key, hints + separate from identity — is a sharp checklist for evaluating the + estate's own route-form/transport candidates (iroh satisfies it almost + by definition) + ([Netlayers draft, via DeepWiki](https://deepwiki.com/ocapn/ocapn/6.1-netlayers-specification), secondary; + [E2EE relays post](https://www.spritely.institute/news/end-to-end-encrypted-relays-for-ocapn.html)). +6. **SES/Hardened-JS thinking for the JS surfaces that already exist.** + The estate runs JS at the edge (Workers, the route proxy). Where + third-party or agent-written JS executes, Endo's confinement model — + not its network protocol — is the mature, production-proven piece + (MetaMask), and Endo is explicitly building bridges to AI-agent tooling + ([endojs/endo#3019](https://github.com/endojs/endo/issues/3019)). +7. **Formula/retention GC as a lifecycle metaphor for seats and sessions.** + Endo's daemon models every value as a *formula* whose liveness is its + reachability from named roots; collection cancels dependents and severs + connections. The fleet's seat/session/lease lifecycle (claims, leases, + emergency extension) is the same shape; the vocabulary transfers even + though the code cannot + ([endojs/endo PR #3087](https://github.com/endojs/endo/pull/3087)). + +## 9. Open questions / what would change this assessment + +- A Rust OCapN implementation reaching test-suite parity (today: stage 0, + one author — [ocapn-rs](https://codeberg.org/cmars/ocapn-rs)). +- The Noise E2EE relay landing in a numbered Goblins release *and* being + adopted by a second implementation (Endo) — that would make OCapN's NAT + story merely "young" instead of "behind." +- OCapN freezing a 1.0 wire version. The 2026 incompatible bump + ([v0.18.0 notes](https://www.spritely.institute/news/spritely-goblins-v0-18-0-sleepy-actors.html)) + is the current evidence against betting a foundation on it. +- Any group-membership or replicated-state work appearing in the family — + none is on any public roadmap found; Spritely's adjacent pieces + (Porta/Bella storage, Brux petnames) are separate projects, not a sync + layer. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/p2panda.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/p2panda.md new file mode 100644 index 000000000..4fe3675e9 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/p2panda.md @@ -0,0 +1,513 @@ +# Family research: p2panda (core, auth, sync, net, encryption, spaces, store) + +Lane PANDA — for the auth + transport investigation (tracking issue +developing-today/code#13779). Sources are primary: p2panda.org, docs.rs crate +documentation, the p2panda GitHub repo (READMEs, CHANGELOG), and the crates.io +API. All version/download figures were read from the crates.io API on +2026-11-23. Where a claim rests on a secondary source (DeepWiki's code index, +a conference-talk transcript), it is marked as such. + +## 0. Two generations — do not confuse them + +p2panda has been through a ground-up redesign. Almost everything findable +about "p2panda" before ~2025 describes the **old generation**, which is dead: + +- Old generation: the `p2panda-rs` client library (Bamboo append-only logs, + YASMF hashes) plus the `aquadoggo` reference node — GraphQL client API, + dynamic schema system with materialised views, libp2p networking, SQLite / + PostgreSQL storage, WASM/JS bindings (`p2panda-js`). `aquadoggo` is + explicitly "deprecated and unmaintained", its repo was archived + 2026-01-28, and its last release (0.9.1) was 2026-04-28 + ([lib.rs crate page](https://lib.rs/crates/aquadoggo), + [docs.rs deprecation notice](https://docs.rs/aquadoggo/latest/aquadoggo/), + [GitHub org listing showing aquadoggo as "Public archive"](https://github.com/p2panda)). + The old spec handbook already marks Bamboo "Deprecated" and points to the + `namakemono` design as its successor + ([old spec site](https://aquadoggo.p2panda.org/specifications/aquadoggo/data-types/bamboo/), + [namakemono draft spec](https://aquadoggo.p2panda.org/specifications/namakemono/)). +- New generation (everything below): a modular workspace of Rust crates, + first published to crates.io 2024-12-06, currently at **0.8.1 + (2026-11-13)**. No Bamboo, no GraphQL, no schema system, no libp2p — logs + are a new minimal operation format, networking is iroh, storage is SQLite + via SQLx ([crates.io API, p2panda-core](https://crates.io/api/v1/crates/p2panda-core)). + +Every crate README and the main README carry the same warning, verbatim: +"🚧 This library is under active development and the APIs are not yet +considered stable for production use. Core data types and user-facing APIs +may still undergo breaking changes. Stability guarantees will improve with +the release of v1.0.0." +([repo README](https://raw.githubusercontent.com/p2panda/p2panda/main/README.md)). + +## 1. p2panda core — operations, logs, data formats, "schemas" + +- The atom is an **Operation**: a signed `Header` plus an optional `Body`. + Header fields: format version, author's Ed25519 verifying key, Ed25519 + signature, payload size + BLAKE3 payload hash, sequence number, backlink + (BLAKE3 hash of the author's previous operation), and a generic + **extensions** slot. The operation's identity is the BLAKE3 hash of its + header bytes ([docs.rs p2panda-core](https://docs.rs/p2panda-core/latest/p2panda_core/)). +- An author (one Ed25519 keypair) maintains one or many **single-writer + append-only logs**; multi-writer collaboration is many logs read together. + Logs are fork-tolerant (an author who signs two operations at the same + sequence number creates a detectable fork, not corruption), bodies can be + handled "off-chain" and deleted independently of the log structure, and + headers support **pruning** of outdated operations + ([docs.rs p2panda-core](https://docs.rs/p2panda-core/latest/p2panda_core/)). +- Wire encoding is **CBOR**; application payloads are arbitrary bytes — + serde types serialised by the application (the high-level API serialises + message enums to CBOR automatically) + ([docs.rs p2panda](https://docs.rs/p2panda/latest/p2panda/)). +- **There is no schema system in the new generation.** The old generation's + distributed, versioned schemas and node-side validation/materialisation + were dropped. "Schema" today means: your own Rust types, plus whatever + validation your own stream processors implement. Core is deliberately + data-type-agnostic — "compatible with any application data and CRDT" + ([docs.rs p2panda-core](https://docs.rs/p2panda-core/latest/p2panda_core/)). + The extension mechanism is where system features attach: pruning, + tombstones, causal ordering, group encryption and auth all ride as header + extensions defined by the sibling crates, and users can define their own + ([docs.rs p2panda](https://docs.rs/p2panda/latest/p2panda/)). +- `p2panda-stream` is the processing pipeline between raw operations and the + application: ingest (validation, out-of-order buffering), causal ordering + (`Orderer`), log pruning, and processors for groups and spaces + ([crates.io API, p2panda-stream](https://crates.io/api/v1/crates/p2panda-stream)). + +## 2. Identity & key management + +- Identity **is** an Ed25519 keypair. The verifying key is the author ID in + every operation header; there is no account layer, no naming system, and + no binding to external identity systems (no X.509, no DID, no OIDC) in any + crate ([docs.rs p2panda-core](https://docs.rs/p2panda-core/latest/p2panda_core/)). +- The network identity is iroh's NodeId — also an Ed25519 public key — but + it is a *separate* key from the author key: `p2panda-net` exposes + `NodeId`/`EndpointAddr` from iroh alongside core's `VerifyingKey` + ([docs.rs p2panda](https://docs.rs/p2panda/latest/p2panda/)). +- For encrypted spaces, a member additionally holds encryption key material: + `p2panda-spaces`' `Credentials` is "a member's private key and identity + secret", and members publish **key bundles** (identity + pre-keys for + X3DH) into the network so others can invite them asynchronously; 0.8.0 + added cross-signing of X3DH identity keys by the verifying key and + automatic renewal of expired key bundles + ([docs.rs p2panda-spaces](https://docs.rs/p2panda-spaces/latest/p2panda_spaces/), + [CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md)). +- Multi-device is modelled socially, not by key linking: each device has its + own keypair, and a **group whose members are your devices** acts as your + collective identity (see §4) + ([p2panda-spaces README](https://raw.githubusercontent.com/p2panda/p2panda/main/p2panda-spaces/README.md)). +- What does **not** exist: key rotation for author identities, key recovery, + key escrow, hardware-key support, or any bridge to a CA/PKI. Lose the + signing key and that author identity is gone; the design answer is the + group-as-identity pattern (a manager can re-add a fresh device key). For + this estate that means p2panda identities would live *alongside* the fleet + CA / IdP CA, not under them — nothing in p2panda consumes certificates. + +## 3. Capability model — what p2panda-auth actually is + +This is the axis where precision matters most, because p2panda-auth is +**not a capability system**. There are no capability tokens, no delegation +chains, no bearer credentials, no caveats, no expiry. It is a **replicated +group-membership state machine** from which authorisation decisions are +derived locally: + +- A group is a DAG of signed **group operations** (create, add, remove, + promote, demote), each naming its causal predecessors plus an + application-defined dependencies field. Every peer that replicates the + operations computes the same group state — it is a CRDT (`GroupCRDT`) + ([docs.rs p2panda-auth](https://docs.rs/p2panda-auth/latest/p2panda_auth/)). +- Each member holds one of four strictly-ordered **access levels** — + `Pull < Read < Write < Manage` — each a superset of the one below. Only + `Manage` members may modify group state; operations from non-managers are + simply not applied ("Strict Group Modification"). `Pull` is a + replicator tier: sync metadata, no read access, no encryption secrets + ([docs.rs p2panda-auth](https://docs.rs/p2panda-auth/latest/p2panda_auth/), + [DeepWiki access-control page, summarising `p2panda-auth/src/access.rs`](https://deepwiki.com/p2panda/p2panda/4.2-access-control)). +- **Attenuation, of a sort:** each access level can carry application-defined + **conditions** (`Access`, `C: Conditions`) — e.g. a `Read` grant scoped + to a path prefix of a dataset. Conditions are opaque to the crate; the + application evaluates them when authorising. This is the only + fine-grained lever, and it is a policy hook, not an enforced caveat + language ([docs.rs p2panda-auth](https://docs.rs/p2panda-auth/latest/p2panda_auth/)). +- **Delegation:** there is no "delegate a subset of my rights to a third + party" operation. The nearest mechanisms are (a) a manager adding someone + at a lower level, and (b) **groups as members of groups** — an actor can + be a group (0.8.0 added "checking if actor id is a group" to the auth API), + so authority can be delegated to a *collective* whose own managers control + its membership ([CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md), + [p2panda-spaces README](https://raw.githubusercontent.com/p2panda/p2panda/main/p2panda-spaces/README.md)). + Notably, the project's own high-level docs name Willow's **Meadowcap** and + **UCAN** as external capability systems that can be integrated via header + extensions "for permission checks and delegated access control" — i.e. + p2panda itself frames delegated capability auth as something you compose + in, not something it provides + ([docs.rs p2panda](https://docs.rs/p2panda/latest/p2panda/)). +- **Revocation:** removal is a group operation. Because operations can be + concurrent, revocation semantics are defined by the **resolver**: the + default `StrongRemove` resolver walks concurrent "bubbles" in the DAG and + invalidates (1) any concurrent actions by a member who was concurrently + removed or demoted from manager, (2) dependent operations transitively; + mutual concurrent removals both apply; a remove-then-re-add keeps the + member but still invalidates their concurrent actions. The `Resolver` + trait is replaceable if an application wants different politics + ([docs.rs p2panda-auth](https://docs.rs/p2panda-auth/latest/p2panda_auth/)). + Revocation is therefore *eventually consistent and retroactive over + concurrent work* — a removed member's in-flight operations are annulled + once the removal is seen, but there is no instant global revocation, and + data already replicated to (and decrypted by) the removed member is not + clawed back; forward protection comes from encryption key rotation (§5). +- **Expiry:** none built in. Membership does not time out; key bundles have + lifetimes (encryption layer), group membership does not. +- **Enforcement point:** authorisation is evaluated by each receiving peer + when processing operations (e.g. `p2panda-stream`'s spaces processor + filters out application messages from concurrently removed members; + `p2panda-net` 0.8.0 added a `SyncHook` to accept/reject sync sessions and + an `Authoriser` maintaining allow/blocklists of node IDs). There is no + reference monitor and no server to appeal to — correct behaviour is a + property of honest peers running the same validation, which fits a fleet + of our own agents but is a different trust shape from a broker enforcing + ACLs ([CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md)). + +## 4. Group management + +- Groups are first-class, replicated, and nestable. `p2panda-spaces` builds + on auth groups to provide: groups reusable across multiple encryption + contexts ("spaces"), **nested groups** for multi-device profiles, private + space identifiers, and a single global auth context (`global_groups_id`) + shared across an application + ([p2panda-spaces README](https://raw.githubusercontent.com/p2panda/p2panda/main/p2panda-spaces/README.md), + [docs.rs p2panda-spaces](https://docs.rs/p2panda-spaces/latest/p2panda_spaces/)). +- Group operations ride the same operation/log machinery as data: they are + signed operations in logs associated with a topic, synced and gossiped + like everything else; the high-level Node emits group events and supports + promote/demote and membership-change validation (all added in 0.8.0) + ([CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md)). +- Practical shape for this estate: a "fleet" group with Manage = operator + keys, Write = seats allowed to publish, Read = observers, Pull = dumb + relays — and per-seat device groups nested inside. That maps well. What + groups do *not* give you: scoped one-shot grants ("this runner may read + artifact X for 10 minutes") — that pattern needs conditions gymnastics or + an external capability layer (§3). + +## 5. Encryption + +Three distinct layers, often conflated: + +1. **In transit (pairwise):** iroh connections are QUIC with TLS 1.3 using + self-certified Ed25519 node keys. The high-level docs state plainly that + data exchanged over direct topic streams "is always end-to-end encrypted" + by iroh's TLS — but that protects a *direct connection between two + nodes*, not data replicated through intermediaries + ([docs.rs p2panda](https://docs.rs/p2panda/latest/p2panda/)). +2. **End-to-end group encryption (`p2panda-encryption`):** a Rust + implementation of **DCGKA** — Decentralised Continuous Group Key + Agreement, from Weidner, Kleppmann, Hugenroth & Beresford (2020) — not + MLS. Two-party key agreement ("2SM") bootstraps with Signal's **X3DH** + (with XEdDSA) over published pre-key bundles and continues with **HPKE**; + group secret distribution is O(n) in group size. Two schemes on top: + - *Data Encryption* (the default, and the one spaces use): a shared + symmetric group key, XChaCha20-Poly1305, rotated when a member is + removed; late joiners can decrypt history; keys are retained for old + data unless the application deletes them, so forward secrecy is + *optional and application-managed*, while post-compromise security + comes from the key-agreement rounds. + - *Message Encryption*: a per-member Double-Ratchet-style scheme with + per-message keys dropped after use — strong forward secrecy, aimed at + chat ([docs.rs p2panda-encryption](https://docs.rs/p2panda-encryption/latest/p2panda_encryption/), + [p2panda-encryption README](https://raw.githubusercontent.com/p2panda/p2panda/main/p2panda-encryption/README.md)). + So: **yes, there is real E2EE for group data, and it exists today** in a + published crate (first released 2025-07-07) — this is not a roadmap item. + But the README's own security section is unusually candid: + - "**This crate has not yet received a security audit.**" + - "We currently *cannot* recommend using this technology for high-risk + use-cases." + - **Group control messages are currently unencrypted** — membership + metadata (who is in which group) is observable to anyone who can see + the traffic; encrypting control messages is in-progress work. + - **Not post-quantum**: no HNDL (harvest-now-decrypt-later) resistance + ([p2panda-encryption README, Security section](https://raw.githubusercontent.com/p2panda/p2panda/main/p2panda-encryption/README.md)). +3. **At rest:** nothing. p2panda has no encrypted-storage story; the SQLite + database holds operations (and, in the high-level API, "soon" encryption + and access-control state — see §10) in the clear. Disk/volume encryption + is the operator's problem + ([docs.rs p2panda](https://docs.rs/p2panda/latest/p2panda/)). + +`p2panda-spaces` is the integration crate that wires auth groups to the Data +Encryption scheme — membership changes drive key agreement, removed members +lose future keys, write authority is validated when processing application +messages. It is also the **youngest** crate in the stack: first published +2026-07-07 (0.7.0), and its integration into the high-level `p2panda` Node +API landed only in **0.8.0 (2026-11-09)** under the changelog entry +"Encrypted spaces and groups management integration into high-level API", +accompanied by a long tail of spaces fixes (deadlocks in the pipeline, +flaky spaces tests, acking of space control messages, repair-task rewrites) +([crates.io API, p2panda-spaces](https://crates.io/api/v1/crates/p2panda-spaces), +[CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md)). + +## 6. Transport & NAT traversal — p2panda-net on iroh + +- `p2panda-net` does **not** implement its own transport. Its `Endpoint` is + iroh: QUIC connections, STUN-based hole punching, and DERP-designated + relays as fallback — "most of the lower-level networking of p2panda-net is + made possible by the work of iroh". Feature flags make the layering + explicit: `iroh_endpoint` (dep: iroh), `gossip` (dep: iroh-gossip), + `sync` (dep: p2panda-sync), `discovery` (dep: p2panda-discovery), + `iroh_mdns` ([docs.rs p2panda-net](https://docs.rs/p2panda-net/latest/p2panda_net/), + [crates.io API, p2panda-net](https://crates.io/api/v1/crates/p2panda-net)). +- **Gossip** is iroh-gossip: PlumTree + HyParView broadcast overlays, one + overlay per topic, for ephemeral live messages (no delivery guarantee — + offline peers miss them; sync is the catch-up path) + ([docs.rs p2panda-net lib.rs source](https://docs.rs/p2panda-net/0.2.0/i686-unknown-linux-gnu/src/p2panda_net/lib.rs.html)). +- **Discovery** is three mechanisms: mDNS on LANs; a **confidential topic + discovery** protocol (`p2panda-discovery`) in which nodes prove shared + knowledge of a secret topic via Private Set Intersection / Private + Equality Testing over salted topic hashes — topics are never revealed to + non-members — combined with a **random-walk** peer-sampling strategy over + the address book, bootstrapped from configured bootstrap nodes; and + learning peers from gossip overlays. (The discovery docs credit Willow + for the PET idea.) No DHT is used for topic discovery, deliberately: + topics must not leak into global structures + ([docs.rs p2panda-discovery](https://docs.rs/p2panda-discovery/latest/p2panda_discovery/)). +- Relays: iroh relays are operator-replaceable — the Node builder takes a + `relay_url`, relays can require bearer (added 0.7.1), and the + project ships a configurable bootstrap-node repo. Running without n0's + public relay infrastructure is supported by the underlying iroh design + ([docs.rs p2panda](https://docs.rs/p2panda/latest/p2panda/), + [CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md), + [GitHub org](https://github.com/p2panda)). +- Resilience: modules run under Erlang-style supervision and restart on + failure; connections and sync sessions retry automatically + ([p2panda-net README](https://raw.githubusercontent.com/p2panda/p2panda/main/p2panda-net/README.md)). +- The architecture is explicitly transport-agnostic below the Endpoint + ("Walkaway Stack"): core data types are designed to move over packet + radio, LoRa, BLE or USB sticks, and the sync traits work over any + Sink/Stream pair. Today, over IP, the only realised transport is iroh + ([docs.rs p2panda](https://docs.rs/p2panda/latest/p2panda/), + [docs.rs p2panda-sync](https://docs.rs/p2panda-sync/latest/p2panda_sync/)). + +## 7. Sync / replication semantics — p2panda-sync + +- The shipped protocol is `LogSync` (wrapped by `TopicLogSync` after a + topic handshake). It is a **two-party, per-topic, log-height exchange**: + both sides send `Have(LogHeights)` — for every author and log in the + topic, the highest sequence number held — then a `PreSync` summary + (total operations / bytes), then the missing operations stream in + sequence, then `Done`. Because logs are single-writer with contiguous + sequence numbers, the height vector *is* the state vector; reconciliation + is exact set difference, not a heuristic + ([docs.rs, LogSyncMessage enum](https://docs.rs/p2panda-sync/latest/p2panda_sync/protocols/enum.LogSyncMessage.html)). +- Sync is partial by topic: a node replicates only the topics it subscribes + to. Sessions run once per peer per topic, with optional resync schedules + and automatic re-attempts managed by `p2panda-net`'s sync manager + ([docs.rs p2panda-net](https://docs.rs/p2panda-net/latest/p2panda_net/)). +- **Offline behaviour** is the design centre: publish locally, gossip if + connected, sync on next contact. Operations received out of order are + buffered by the stream layer until their causal predecessors arrive. +- **Conflict story:** at the log layer there are no merge conflicts — + single-writer logs can't conflict, they can only fork (equivocation by + the author) or be incomplete. All real conflict semantics live one layer + up: in your CRDT/data types (BYO — core is "compatible with any CRDT" but + ships none), in the auth CRDT's resolver (§3), and in the encryption + layer's handling of concurrent membership changes. +- The crate also exposes `Protocol`/`Manager` traits so applications can + sync *other* convergent data types (sets, Merkle trees) through the same + session machinery — sync is a framework, with log sync as the one built-in + ([docs.rs p2panda-sync](https://docs.rs/p2panda-sync/latest/p2panda_sync/)). +- Maturity signal from the changelog: the unreleased section already + contains a "Sync session management re-write", a fix for a memory leak + from uncleaned sync sessions, and a fix for operations dropped when a + channel ran full — the sync layer is being actively repaired as of + November 2026 ([CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md)). +- Blobs: `p2panda-blobs` wraps **iroh-blobs** (BLAKE3/bao content-addressed + verified streaming) for large files that don't belong in operation bodies + ([docs.rs p2panda-core page on storage](https://deepwiki.com/p2panda/p2panda/5-storage-and-data-management) — secondary; + [crates.io API, p2panda-blobs](https://crates.io/api/v1/crates/p2panda-blobs)). + +## 8. Storage fit (SQLite / Turso) + +- `p2panda-store` defines backend traits — `LogStore`, `OperationStore`, + `TopicStore`, plus processor/orderer/spaces stores — and ships **one** + real implementation: **SQLite via SQLx** (the `sqlite` feature, default), + with transactional writes (`BEGIN IMMEDIATE`, a `tx!` macro) and SQL + migrations in-crate. There is also an in-memory store for tests + ([crates.io API, p2panda-store](https://crates.io/api/v1/crates/p2panda-store), + [DeepWiki storage page](https://deepwiki.com/p2panda/p2panda/5-storage-and-data-management) — secondary). +- **Turso/libsql: no support exists.** Nothing in the workspace depends on + libsql. The trait surface is small enough that a libsql-backed store is + *implementable* (libsql speaks SQLite semantics), but it would be our + code to write and maintain, and SQLx is wired into the shipped store's + query layer (0.8.0 moved to "sqlx 0.9.0, safer query builder"). +- Fit assessment for the estate: fleet's stores are SQLite/Turso already, + so a p2panda node keeping its own SQLite file beside the broker's stores + is operationally natural; expecting p2panda operations to live *inside* + Turso (with its replication) is not something the project offers. + +## 9. Rust maturity — the crate table + +All crates are versioned in lockstep, MIT OR Apache-2.0, published from the +single `p2panda/p2panda` monorepo (603 GitHub stars, 54 forks, repo created +2020-10-12) by a small named team — the crates.io publish records show three +people: Andreas Dzialocha (adzialocha), Sam Andreae (sandreae), glyph +(mycognosist) ([GitHub repo](https://github.com/p2panda/p2panda), +[crates.io API](https://crates.io/api/v1/crates/p2panda-core)). + +| Crate | Latest | First published | Total downloads | Recent downloads | Role | +|---|---|---|---|---|---| +| p2panda-core | 0.8.1 | 2024-12-06 | 26,649 | 8,600 | Operation/log data types | +| p2panda-store | 0.8.1 | 2024-12-06 | 14,925 | 5,138 | Store traits + SQLite (SQLx) | +| p2panda-sync | 0.8.1 | 2024-12-06 | 12,797 | 3,535 | Log sync + sync traits | +| p2panda-discovery | 0.8.1 | 2024-12-06 | 12,137 | 2,982 | PSI topic discovery, random walk | +| p2panda-net | 0.8.1 | 2024-12-06 | 10,879 | 1,969 | iroh endpoint, gossip, sync manager | +| p2panda-encryption | 0.8.1 | 2025-07-07 | 10,304 | 3,288 | DCGKA group encryption | +| p2panda-stream | 0.8.1 | 2024-12-06 | 9,158 | 1,579 | Ingest/order/prune pipeline | +| p2panda-blobs | 0.8.1 | 2024-12-06 | 4,649 | 47 | iroh-blobs wrapper | +| p2panda-auth | 0.8.1 | 2025-07-07 | 4,532 | 2,667 | Group CRDT, access levels | +| p2panda-spaces | 0.8.1 | 2026-07-07 | 3,061 | 2,165 | Auth+encryption integration | +| p2panda | 0.8.1 | 2026-05-18 | 2,094 | 850 | High-level Node API | + +(Source: crates.io API per crate, read 2026-11-23; "recent" is crates.io's +trailing-window figure.) + +Reading the table: the *lower* layers (core/store/sync/net) have ~2 years of +published history and steady monthly releases (0.5.0 Jan 2026 → 0.8.1 Nov +2026, breaking changes between minors). The layers this estate cares most +about — auth, encryption, and especially their integration (spaces) and the +high-level API — are 4–16 months old. Download counts are small in absolute +terms (this is a niche ecosystem), and a large share of recent downloads is +the workspace's own CI and downstream app projects (Toolkitty, Dash Chat, +Reflection — the apps listed on [p2panda.org](https://p2panda.org)). There is +a fuzz target directory in the repo, and the encryption crate ships fuzz +test utilities, but no crate is 1.0 and none claims API stability. + +## 10. Cloudflare fit + +- **Essentially none, and by design.** p2panda is a native Rust stack built + on tokio + QUIC/UDP via iroh. Cloudflare Workers cannot host it (no UDP + listeners, no long-lived QUIC endpoints), and the current generation has + **no browser/WASM support**: asked at Local-First Week China (Oct 2026) + whether browsers can act as peers, Sam Andreae answered "In the current + form of p2panda, we don't have browser support implemented" — the old + generation's WASM path was not carried over + ([talk transcript](https://bd.ailishi.ai/blog/p2panda-local-first-building-blocks/transcript-en.pdf) — secondary source, project lead speaking). +- Composition with the estate's Cloudflare doors would be at arm's length: + a native p2panda node behind a Worker door (the commander/mcpx pattern) + bridging HTTP ↔ p2panda topics. KV/R2/Durable Objects have no p2panda + bindings; R2 could serve as blob backup storage only via our own code. +- The high-level docs also flag unfinished integration relevant to any + embedding: the Node's SQLite persistence covers "operations, sync state, + address books, stream cursors, and **soon** encryption/access-control + state", and decryption in the processing pipeline is described in future + tense in parts of the docs — the 0.8.0 changelog shows this integration + actively landing, docs lagging code + ([docs.rs p2panda](https://docs.rs/p2panda/latest/p2panda/), + [CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md)). + +## 11. iroh fit + +- **Native — p2panda-net *is* an iroh application.** Endpoint (connections), + iroh-gossip (overlays), iroh-blobs (files), iroh-mdns (LAN discovery) are + all n0's crates; p2panda tracks iroh closely (0.8.0 moved to iroh 1.4.1 / + iroh-gossip 0.102; unreleased work already bumps iroh to 1.5.0) + ([CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md)). +- For the estate's #13752 design (iroh NodeId as identity, self-hosted + relay/pkarr), adopting p2panda-net means adopting exactly that transport + with the same self-hosting options — plus topic discovery, gossip and sync + on top, which raw iroh does not provide. The overlap is total and the + composition is clean: p2panda consumes iroh; it does not compete with it. +- The cost of that coupling: p2panda inherits iroh's churn (iroh itself is + pre-1.0 in spirit — its 1.x line is recent) and its relay/DERP model of + NAT traversal. There is no alternative transport for IP networking in + p2panda-net; if iroh's relay model fails an estate requirement, p2panda + can't swap it out without dropping to the sync traits over a custom + transport. + +## 12. Spec / interop status + +- There is **no standards-track specification** (no IETF/W3C/RFC process) + and no second implementation. The effective spec is the crate docs + + source; the design lineage is documented in the (draft, old-site) + namakemono spec and the DCGKA paper for encryption. Interop today means + "another Rust program using the same crates" — plus experimental FFI: + `p2panda-ffi` (UniFFI bindings for Node.js, Python, Go) and + `p2panda-gobject`, both labelled experimental by the project + ([repo README](https://raw.githubusercontent.com/p2panda/p2panda/main/README.md)). +- Wire-format stability is not yet promised: header has a version field, + and 0.7.x already shipped a "new forwards-compatible API to create, + encode and decode operations" — expect format evolution before 1.0 + ([CHANGELOG](https://raw.githubusercontent.com/p2panda/p2panda/main/CHANGELOG.md)). + +## 13. Project health + +- **Funding:** EU public research money — the READMEs list Horizon 2020 / + NGI grants: NGI-POINTER (871528), NGI-ASSURE (957073), NGI0-ENTRUST + (101069594), NGI0-COMMONS (101135429), i.e. the NLnet-administered NGI0 + programme family. This is grant-funded open infrastructure, not a + venture-backed product and not a company + ([repo README](https://raw.githubusercontent.com/p2panda/p2panda/main/README.md)). +- **Activity:** high and current — 25 releases of the monorepo, 0.8.0 and + 0.8.1 shipped four days apart in Nov 2026, repo updated 2026-11-12, ~1,600 + commits ([GitHub repo](https://github.com/p2panda/p2panda)). +- **Community:** small. ~600 stars; real downstream apps exist (Toolkitty, + Dash Chat, GNOME Reflection, Meli on the old stack) but the user base is + the local-first research/activist niche, not industry + ([p2panda.org](https://p2panda.org)). +- **License:** MIT OR Apache-2.0 throughout the new stack (the old + aquadoggo was AGPL-3.0 — another reason the generations must not be + conflated) ([crates.io API](https://crates.io/api/v1/crates/p2panda-core)). +- **Risk shape:** a three-person core team on grant cycles. If a grant + lapses, development slows; the mitigation is that everything the estate + would depend on is small, readable Rust (the whole workspace is on the + order of 60k lines) under a permissive license — forkable in a way a + hosted service is not. + +## 14. Operational complexity + +To run p2panda "for everything" in this estate we would operate: one node +per seat (embedded in the fleet binary), our own **bootstrap nodes** and +**iroh relays** (or accept n0's public relays as a dependency), allow-list +management via net's `Authoriser`, topic design per data domain, and the +SQLite files the nodes keep. There is no server component to run — which is +the point — but also no admin tooling, no metrics ecosystem beyond emitted +events, and no hosted anything. Debugging a sync stall means reading Rust +logs from a pre-1.0 stack whose own changelog shows sync-session bugs being +fixed this month. + +## 15. What p2panda pointedly does NOT do — the build-it-yourself list + +1. **Delegated capabilities.** No UCAN/Biscuit-style tokens, no attenuation + chains, no expiry, no scoped one-shot grants. Auth = replicated group + state + 4 levels + app-evaluated conditions. The project itself points + to Meadowcap/UCAN as compose-in extensions (§3). +2. **Identity beyond raw keys.** No PKI/CA integration, no naming, no key + rotation/recovery, no binding to the estate's IdP/OIDC or fleet CA. +3. **Application data modelling.** No CRDTs shipped (BYO — Loro/Automerge/ + yrs integrate at the byte level), no schemas, no queries, no + materialised views. The old generation had these; the new one removed + them on purpose. +4. **Server-side anything.** No broker, no RPC, no request/response + semantics — it is broadcast + sync only. Fleet's queue/placement + coordination would have to be modelled as replicated state with all the + contention semantics that implies (single-writer logs make claims/ + leases awkward: a placement claim is inherently multi-writer state). +5. **Audited cryptography.** DCGKA implementation unaudited; group control + messages unencrypted (metadata exposure); no post-quantum story (§5). +6. **Browser / Cloudflare / WASM.** Native only (§10). +7. **Turso.** SQLite-only shipped store (§8). +8. **Stability.** Pre-1.0, breaking changes per minor, wire format still + evolving; the auth+encryption integration layer is months old and its + bug tail is visible in the current changelog (§9, §5). +9. **Non-Rust reach.** FFI is experimental; mcpx (Go) could only consume + p2panda via those bindings or a sidecar process. + +## 16. Estate fit — where it genuinely shines + +- **Seat-to-seat replication with offline tolerance**: agent seats on + laptops/sandboxes that meet opportunistically is exactly the topology + p2panda-sync + gossip + confidential discovery were built for, and it + rides the iroh transport the estate already chose in #13752. +- **Group-structured trust**: fleet seats, operator keys, relay-only nodes + map onto Manage/Write/Read/Pull and nested device groups without forcing. +- **Encrypted replicated data**: spaces give E2EE group data over untrusted + relays/intermediaries — something neither raw iroh nor the current + Tailscale/tsnet setup provides for *stored, replicated* content. +- **Rust, SQLite, permissive license, self-hostable relays** — every estate + hard-preference is natively satisfied by the lower two-thirds of the + stack (core/store/sync/net/discovery). diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/spritely-institute-review.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/spritely-institute-review.md new file mode 100644 index 000000000..e53cbd8de --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/spritely-institute-review.md @@ -0,0 +1,937 @@ +# Spritely Institute — full site review + +Research lane SPRITELY-REVIEW, for the auth + transport investigation +(developing-today/code#13779). Written 2026-11-23 from the Institute's own +site ([spritely.institute](https://spritely.institute)) and the pages/repos +it links. Companion to `ocap-family.md` in this folder, which covered +Goblins/OCapN from specs and repos; this note covers the same ground from +Spritely's own presentation, plus the complete news archive and a +deep-dive on the end-to-end encrypted relay work (§6). + +**Coverage statement.** News archive: all **61 articles** listed across +the seven archive pages ([news/](https://spritely.institute/news/) and +`index-1.html` … `index-6.html`), spanning **2023-01-30 to 2026-11-19**. +56 were read in full on their article pages; "Announcing Spritely Oaken" +was read via search-surfaced article text plus its NLnet project page; +four (Goblinville retrospective, Functional hash tables, Hoot 0.6.1, +Successful supporter drive) are summarised from the archive listing and +are marked † — the browser service rate-limited (HTTP 429) before their +article pages could be re-opened, and no detail beyond the listing is +claimed for them. Everything else on the site — home, about, project +pages, whitepaper list — was read directly. + +--- + +## 1. The organisation + +**What it is.** The Spritely Networked Communities Institute is a +501(c)(3) nonprofit research institution "built to develop new +technologies for the decentralized web"; all code is free/open-source and +all papers open access ([home](https://spritely.institute)). Its stated +purpose is "to advance networked user freedom" — communication systems +that respect agency and autonomy, and communities' rights to organise, +govern, and protect their members, framed as applying fundamental human +rights to networked systems +([about](https://spritely.institute/about/)). + +**Lineage.** Spritely's founders co-authored +[ActivityPub](https://www.w3.org/TR/activitypub/), the W3C standard +behind the Fediverse. The Institute's thesis is that ActivityPub-style +federation leaves too much power and data with servers, and that object +capability security — the tradition running from E and Electric +Communities through Mark Miller's work — is the missing foundation. The +history section traces this directly: Christine Lemmer-Webber's +post-ActivityPub research led to Randy Farmer (Electric Communities / +Habitat lineage), and the two co-founded the Institute +([about](https://spritely.institute/about/)). + +**Design values** (from the about page, paraphrased): secure +collaboration; "networks of consent" — capability security as consent +that is intentional, granted, contextual, accountable, and revocable, +explicitly rejecting both all-or-nothing trust and "zero trust" framing; +healthy self-governing communities; user agency; contextual +communication (an explicit rejection of the "global town square"); +decentralised-by-default foundations; gatekeeper-free participation; +honesty about limitations ("we should not pretend we can prevent what we +cannot"); contribute to the commons; and "fun is a revolutionary act" — +adoptability through delight is treated as strategy, which explains the +game-jam programme in §3. + +**People** ([about](https://spritely.institute/about/)): + +- **Christine Lemmer-Webber** — Executive Director (from April 2024; + co-founder, ActivityPub co-author, MediaGoblin co-founder). +- **David (Dave) Thompson** — Chief Technology Officer (from April 2024; + leads engineering; Hoot's lead author by output). +- **Jessica Tallon** — Founding Technologist; lead Goblins developer and + primary author of the OCapN specifications; ActivityPub co-editor. +- **Andy Wingo** (Igalia, contractor) — compiler specialist leading the + Guile-on-Wasm work; also upstream Guile maintainer (Whippet GC). +- Wider team visible in article bylines: Juliana/Juli Sims (Shepherd + port), Daphne Preston-Kendal (Oaken), tessa (developer relations), + Amy Grinn/Pillow (community/comms). +- **Board**: Karen Sandler (Software Freedom Conservancy), Deb Nicholson + (Python Software Foundation), Alex Handy (The MADE museum). +- **Randy Farmer** — co-founder; stepped down as Executive Director in + April 2024, remaining a consultant + ([org changes post](https://www.spritely.institute/news/organizational-changes.html)). + +**Funding model.** Three legs, all visible on the site: + +1. **NLnet / NGI Zero grants** — the technical programme's main funder. + Grant-funded work announced on the site includes: OCapN + standardisation + Guile/Racket interop (2023), the Shepherd×Goblins + port (2024), Spritely Oaken (2025), and the E2EE relay + Guile Noise + (2026). Adjacent NLnet grants to collaborators (Wingo's Whippet GC, + Andrew Whatson's Pre-Scheme port) are celebrated in the same posts. +2. **Individual supporter drive** — Spritely's first, launched December + 2024, passed its **$80,000 goal in January 2025** with three weeks to + spare and added a $40,000 stretch goal (a browser Goblins playground + and "Cirkoban Deluxe") + ([stretch-goal post](https://www.spritely.institute/news/2024-2025-supporter-drive-success.html)). + News posts close with named supporter tiers (Diamond/Gold/Silver/ + Bronze) — the E2EE relay post lists dozens of individual names. +3. **Organisational partners/grants** — an organisational partners page + is linked from About; its contents were **not verified** in this pass + (browser rate limit). + +**Community surfaces.** Developer community forum +([community.spritely.institute](https://community.spritely.institute), +opened to the public February 2024), IRC `#spritely` on libera.chat, +monthly-ish engineering office hours (from September 2024, Cal.com + +Jitsi), Fediverse (`@spritely@social.coop`) and Bluesky accounts, and a +twice-yearly Lisp Game Jam presence that functions as the project's +public demo engine. + +--- + +## 2. Papers and whitepapers + +Listed on the home page, all open access (HTML/PDF/org formats): + +- **A Scheme Primer** — the on-ramp text for the Scheme language family, + written for Spritely newcomers but general-purpose. +- **The Heart of Spritely: Distributed Objects and Capability Security** + — the core technical paper: Goblins' toolbox for building p2p + applications as naturally as local programs. +- **Petnames: A humane approach to secure, decentralized naming** — how + to map human-readable local names onto cryptographic identifiers + without a global registry. +- **Implementation of a Petnames System in an existing chat application** + — the follow-on experience report. +- **Content Addressed Descriptors and Interfaces** — programs describing + themselves to each other in a mutually suspicious network, using + content addressing + a simple petname system. + +All at [files.spritely.institute](https://spritely.institute) via the +home page's whitepaper section. + +--- + +## 3. Projects + +### 3.1 Goblins — the foundation +([project page](https://spritely.institute/goblins/)) + +Spritely's distributed object programming environment: local +transactions that roll back on error, asynchronous messaging that works +the same locally and over the network, automatic persistence, a +time-travelling debugger, distributed garbage collection, and promise +pipelining. Two implementations — **Guile** (primary since v0.10) and +**Racket** — both at **v0.18.0** per the project page, network-compatible +over OCapN. Code on Codeberg (`spritely/goblins`, +`spritely/racket-goblins`); manual published on the site. Spritely's own +maturity framing elsewhere is "working beta" (see `ocap-family.md`). + +### 3.2 Hoot — Scheme to WebAssembly +([project page](https://spritely.institute/hoot/)) + +A Scheme-to-Wasm compiler backend for Guile plus a self-contained Wasm +toolchain (assembler, disassembler, linker, and a Wasm interpreter that +runs on the Guile VM) — no Emscripten/Binaryen dependency. Built so +Goblins can run in browsers. Latest release **0.10.0** (October 2026). +Supports R7RS-small and a subset of Guile; runtimes: Firefox 121+, +Chrome 119+, Safari 26+, Node 22+. Distributed via Guix, Debian +testing/unstable, and a Homebrew tap. + +### 3.3 OCapN — the protocol suite +([ocapn.org](https://ocapn.org); linked from the home page) + +The pre-standardisation effort to make CapTP implementations +interoperate: CapTP itself, third-party handoffs, the netlayer +abstraction, and the `ocapn://` locator URI structure. Participants per +ocapn.org: Agoric, Spritely, Cap'n Proto, and independent experts; +meetings monthly, work on GitHub (`ocapn/ocapn`). Implementations listed: +Goblins (Guile), Goblins (Racket), Endo (JavaScript), DObjects (Dart). +Spritely drafted the first spec versions from Goblins' implementation, +with Jessica Tallon as primary spec author. Status remains explicitly +**pre-specification** — no standards-body submission yet (see +`ocap-family.md` §1.2 for the spec-repo detail). + +### 3.4 Oaken — capability-secure Scheme sublanguage (2025) +Announced May 2025, NLnet-funded, by Daphne Preston-Kendal +([announcement](https://spritely.institute/news/announcing-spritely-oaken.html); +[NLnet project page](https://nlnet.nl/project/SpritelyOaken/)). Oaken is +a new Scheme-family programming system for running **untrusted +third-party code** safely inside a host program: a library system with +"taming" as a first-class concept (a library can be closed over a +restricted version of, e.g., filesystem access that reaches only one +directory — the "powerbox pattern"), building on Scheme 48 and Jonathan +Rees's lambda-calculus security work (Rees advises). Aimed at safe mods, +macros, and plugins, and at composing with Goblins/Hoot. Early-stage; +initial version deliberately supports only basic tamings. + +### 3.5 Shepherd × Goblins — capability-secure system layer +A port of GNU Shepherd (Guix's init/service manager) to Goblins actors, +NLnet-funded, announced May 2024 and updated September 2025. Goal: +services as object capabilities, unifying root and user Shepherds, and +eventually distributed Shepherds managing each other over OCapN (a +possible `guix deploy` agent). Status at the September 2025 update: core +actors rewritten with unit tests, public API preserved as a +compatibility layer, demo managing services in a Guix home container; a +handful of shell tests still failing and syslog a known gap — **not yet +PID 1 ready** ([update](https://www.spritely.institute/news/shepherd-goblins-update.html)). + +### 3.6 Guile Noise — Noise Protocol library for Guile +Written for the E2EE relay work (§6.3): a general-purpose Noise +implementation for Guile/Hoot where none existed. All 12 fundamental +interactive handshake patterns; X25519, AES-GCM, SHA-256/SHA-512; +GnuTLS backend on the Guile VM, WebCrypto SubtleCrypto backend under +Hoot; validated against the Noise test vectors on both backends. Linked +from the relay article to Codeberg (exact repo path not re-verified in +this pass due to the browser rate limit). + +### 3.7 Applications and demos built on the stack + +- **Mandy** (January 2026) — a prototype implementing **ActivityPub on + Goblins**: Goblins actors bridged to HTTP via Guile Fibers, activities + unmarshalled into actors and delivered as ordinary Goblins messages. + The argument: ActivityPub's actor/inbox/outbox shape maps naturally + onto Goblins actors, opening a capability-secure path for Fediverse + software. +- **Brassica Chat** (November 2025) — local-first group chat composing + ocaps (online authority), actors, Byzantine-fault-tolerant + operation-based CRDTs (signed DAG events, hybrid logical clocks) for + offline sync, and zcaps for offline authorisation. Spritely's worked + answer to "capabilities vs replicated data" — compose them. +- **GoblinShare** (November 2025) — secure p2p file sharing in ~250 lines + over Goblins + a Guile port of **Magenc** (encrypted content-addressed + storage where the magnet link itself is the capability), delivered + over the Tor netlayer. +- **Polydraw** (November 2026) — peer-to-peer party drawing game + (Autumn Lisp Game Jam 2026, 5th overall); the first application to + exercise **third-party handoffs over the new E2EE relay netlayer**, + and the relay's dogfood test. +- **Cirkoban** (June 2024) — Sokoban × Wireworld puzzle game (15 levels, + 2nd in Spring Lisp Game Jam 2024); the first publicly accessible + Goblins-in-the-browser application, using transactional rollback as + its undo mechanic. +- **Goblinville** † (June 2025) — Spring Lisp Game Jam 2025 + retrospective; a networked virtual-town jam project. +- **Fantasary** (June 2023) — prototype text virtual world; testbed for + the TCP netlayer, petnames, and the "unum" pattern. +- **Wireworld** (June 2023) — WASM-4 cellular-automaton cartridge built + with Hoot's low-level Wasm tooling. +- Plus jam entries **Strigoform** and **Cybersol** (December 2023). + +--- + +## 4. The news archive — all 61 articles, individually + +Newest first, as listed by the archive. Format: **title** — author, +date — what it announced/argued; why it matters. † = summarised from the +archive listing only (see coverage statement). + +### 2026 + +1. **Lisp Game Jam devlog: Polydraw** — Thompson & Lemmer-Webber, + 2026-11-19 — Day-by-day build log of the p2p party game Polydraw + (draw a prompt in triangles in 60 seconds; others guess), built from + Player/Lobby/Game/Controller actors distributed over OCapN via the + new E2EE relay. Records real bugs found under deadline: a "crossed + hellos" race (promises on the losing connection never resolve; + worked around with a timeout retry) and the promise-vs-reference + `eq?` identity footgun. Ranked 5th overall. *Matters: first app to + exercise third-party handoffs over the relay netlayer — the relay's + public proof.* + ([article](https://spritely.institute/news/lisp-game-jam-devlog-polydraw.html)) +2. **Hoot 0.10.0 released!** — Thompson, 2026-10-28 — Adds R6RS library + versioning and a large `(rnrs …)` surface, partial SRFI-13/60, + `define-macro`, CLI validation and a Node exnref flag; promotes the + game-jam template. *Matters: closes much of the R6RS/Guile + compatibility gap for browser Scheme.* + ([article](https://spritely.institute/news/hoot-0-10-0-released.html)) +3. **End-to-end encrypted relays for OCapN** — Tallon, 2026-10-15 — + Announces the NLnet-funded federated, stateless, E2EE relay that + replaces prelay: a Noise meta-netlayer (XK, X25519/AES-GCM/SHA-256) + composed over the relay netlayer, a new Guile Noise library, and an + OCapN spec to follow. *Matters: the subject of §6 — Spritely's NAT + answer becomes recommendable.* + ([article](https://www.spritely.institute/news/end-to-end-encrypted-relays-for-ocapn.html)) +4. **Hoot 0.9.0 released!** — Thompson, 2026-05-13 — Moves to standard + Wasm exceptions and DWARF debug data (with a `hoot strip` for + production), a DWARF parser in reflect.js, an exported `main` for + non-JS runtimes, and a new `hoot compile` CLI replacing + `guild compile-wasm`. *Matters: debugging and portability of Hoot + binaries beyond JavaScript.* + ([article](https://spritely.institute/news/hoot-0-9-0-released.html)) +5. **Spritely Goblins v0.18.0: Sleepy actors!** — Thompson & + Lemmer-Webber, 2026-04-21 — "Sleepy actors": persisted actors can be + evicted to the store and woken on message receipt (sleep-every-turn + and LRU strategies shipped). Also adopts the latest OCapN draft — + `op:deliver-only` dropped, GC ops batched/pluralised, **protocol + version bumped (incompatible)** — and fixes a multi-vat restore race + and a WebSocket netlayer signing-oracle vulnerability. *Matters: + large persistent actor graphs no longer need to be memory-resident; + also the clearest evidence the wire protocol is still moving.* + ([article](https://www.spritely.institute/news/spritely-goblins-v0-18-0-sleepy-actors.html)) +6. **Hoot 0.8.0 released!** — Thompson, 2026-02-25 — A built-in + `(hoot repl)` for live hacking in Wasm, a web REPL/server proxying to + a browser tab, `hoot repl`/`hoot server` CLI commands, initial Emacs + (Geiser) support, web request/response/socket modules, and extensive + Wasm toolchain validation work. *Matters: REPL-driven development — + Scheme's signature workflow — arrives for Wasm.* + ([article](https://spritely.institute/news/hoot-0-8-0-released.html)) +7. **Mandy: ActivityPub on Goblins** — Tallon, 2026-01-06 — The + ActivityPub-on-Goblins prototype (§3.7): HTTP bridging via Fibers, a + nonce registry for persistent object IDs, activities as Goblins + messages. *Matters: a concrete bridge from Spritely's research back + to the Fediverse its founders standardised.* + ([article](https://spritely.institute/news/mandy-activitypub-on-goblins.html)) + +### 2025 + +8. **Composing capability security and conflict-free replicated data + types** — Thompson, 2025-11-24 — Argues ocaps and CRDTs compose + rather than compete, demonstrated by Brassica Chat (§3.7): ocaps for + online access, BFT operation-based CRDTs for offline sync, zcaps for + offline authorisation; contrasts capabilities with ACLs on + granularity, delegation, and confused-deputy risk. *Matters: + Spritely's position paper for local-first architecture — and the + family's first real answer to the offline question.* + ([article](https://spritely.institute/news/composing-capability-security-and-conflict-free-replicated-data-types.html)) +9. **GoblinShare: Secure, Peer-to-Peer File-Sharing with Goblins** — + Sims, 2025-11-18 — GoblinShare + the Guile Magenc port built in a + week (§3.7); core logic ~250 lines. *Matters: the "look how little + code secure p2p takes" demo.* + ([article](https://spritely.institute/news/goblinshare-secure-peer-to-peer-file-sharing-with-goblins.html)) +10. **Hoot 0.7.0 released!** — Thompson, 2025-10-22 — Guile source + modules on the load path by default, SRFI-1 from Guile's pure + Scheme, modules from JS typed arrays, explicit top-level imports; + first Safari 26 compatibility. *Matters: more real Guile code runs + under Hoot; WebKit unblocked.* + ([article](https://spritely.institute/news/hoot-0-7-0-released.html)) +11. **Spritely Goblins v0.17.0: Persistence is better than ever!** — + Tallon, 2025-10-16 — **Bloblin**, a streaming persistence store: + full graph once, then compressed Syrup deltas per churn (new file + every 1,000 churns), "many thousands of deltas per second"; store + migration tooling; new `^vector`/`^ring-buffer` actors. *Matters: + removes the whole-graph-rewrite bottleneck that capped persistent + vat scale.* + ([article](https://www.spritely.institute/news/spritely-goblins-v0-17-0-persistence-is-better-than-ever.html)) +12. **Shepherd × Goblins update** — Sims & Thompson, 2025-09-10 — + Progress on the Shepherd port (§3.5): core actors rewritten and + unit-tested, API kept as a compatibility layer, working demo in a + Guix home container; 4–7 shell tests still failing, syslog the big + gap. *Matters: capability security reaching the OS service layer, + honestly reported as not-yet-PID-1.* + ([article](https://www.spritely.institute/news/shepherd-goblins-update.html)) +13. **Spritely Goblins v0.16.1 released!** — Tallon, 2025-09-03 — Patch + fixing 0.16.0 issues that broke OCapN-over-Hoot, duplicate-connection + bugs, and a vat event-log data-loss bug. *Matters: restores the + browser networking path.* + ([article](https://www.spritely.institute/news/spritely-goblins-v0-16-1-released.html)) +14. **Spritely Goblins v0.16.0 released!** — Lemmer-Webber, 2025-08-07 — + Two core speedups claimed at 10–20× each (compile-time `spawn`; + cookie-comparison promises replacing sealer-based `bcom`), plus a + new **Unix Domain Socket netlayer** using socket-passing to avoid + ACL/confused-deputy risks for local IPC. *Matters: a step-change in + Goblins performance, and OCapN as a local IPC mechanism.* + ([article](https://www.spritely.institute/news/spritely-goblins-v0-16-0-released.html)) +15. **Spritely presented spirited speeches spanning the planet** — + Pillow, 2025-07-31 — Roundup of six months of talks (FOSDEM-heavy): + fediverse futures, ocap security, Hoot web deployment, Shepherd, + Spritely's vision. *Matters: the talks index for the programme.* + ([article](https://www.spritely.institute/news/spritely-presented-spirited-speeches-spanning-the-planet.html)) +16. † **Goblinville: A Spring Lisp Game Jam 2025 retrospective** — + 2025-06-04 (date from secondary listings) — Retrospective on + Goblinville, Spritely's Spring Lisp Game Jam 2025 networked + virtual-town project. + ([article](https://spritely.institute/news/goblinville-a-spring-lisp-game-jam-2025-retrospective.html)) +17. † **Functional hash tables explained** — 2025-05-21 — Explainer on + the quest for a persistent/functional hash table for Goblins: + association lists are immutable and O(1) to extend but O(n) to look + up; the post works through what a functional hash table must + provide. *Matters: the data-structure groundwork under Goblins' + persistence and Hoot's hashtable work.* + ([archive listing](https://www.spritely.institute/news/index-1.html)) +18. † **Hoot 0.6.1 released!** — 2025-05-06 — Patch release following + 0.6.0; details not verified in this pass. + ([archive listing](https://www.spritely.institute/news/index-1.html)) +19. **Announcing Spritely Oaken** — Preston-Kendal, 2025-05-05 — + Introduces Oaken (§3.4): an NLnet-funded secure Scheme sublanguage + for running untrusted code, with library "taming" and the powerbox + pattern, inspired by Rees's dissertation (Rees advising). Use cases + named: safe spreadsheet macros, game mods, sandboxed Shepherd + services. *Matters: Spritely's confinement layer — the missing + piece between Goblins' network security and in-process plugin + safety.* + ([article](https://spritely.institute/news/announcing-spritely-oaken.html)) +20. † **Successful supporter drive supplements Spritely's story** — + 2025-04-08 — Reports the success of Spritely's first supporter + drive (see #24/#25 for the goal and launch); the archive excerpt + stresses that donations are also individual endorsements of the + mission. *Matters: evidence the individual-funding leg works.* + ([archive listing](https://www.spritely.institute/news/index-1.html)) +21. **Spritely Goblins v0.15.1 released!** — Thompson, 2025-03-26 — + Patch (largely Tallon's work) fixing CapTP issues with ghashes/far + references in persistent vats, GC thread-safety, severed-connection + re-enlivening, prelay/WebSocket severance, and Hoot compilation; + adds serialisable vectors/pairs over CapTP, `on-sever`, and a + timers library. *Matters: stabilises the new browser/OCapN surface.* + ([article](https://www.spritely.institute/news/spritely-goblins-v0-15-1-released.html)) +22. **Spritely Goblins v0.15.0: Goblins in the browser!** — + Lemmer-Webber & Grinn, 2025-01-24 — Goblins compiled by Hoot to + Wasm from the same codebase as Guile, OCapN working in-browser + (in-page 150-line goblin-chat demo), a new WebSocket netlayer + bridged by prelay (noted as **not yet end-to-end encrypted** — the + gap §6 closes), and 1.2–2× performance gains. *Matters: the + Hoot bet pays off; Goblins reaches browser users.* + ([article](https://www.spritely.institute/news/spritely-goblins-v0-15-0-goblins-in-the-browser.html)) +23. **Guile Hoot 0.6.0 released!** — Thompson, 2025-01-22 — + Reimplemented weak-key/weak-value hashtables and weak vectors; + enough of Guile (psyntax expander, eval, environments, modules) to + compile nearly all of Goblins; Safari/WebKit 18.2+ joins the + supported list after WebKit shipped Wasm GC + tail calls. + *Matters: removes the last browser blockers to Goblins-on-Hoot.* + ([article](https://www.spritely.institute/news/guile-hoot-0-6-0-released.html)) +24. **Spritely is going to Guix Days and FOSDEM** — Grinn, 2025-01-16 — + Whole team to Brussels; two hours of talks across Guix Days and + FOSDEM 2025 (fediverse, Shepherd, Hoot, Goblins). *Matters: the + public debut of several programme threads at once.* + ([article](https://www.spritely.institute/news/spritely-is-going-to-guix-days-and-fosdem.html)) +25. **Supporter drive goal complete! Time for a stretch goal!** — + Lemmer-Webber & Grinn, 2025-01-15 — The first supporter drive + passed **$80,000 with three weeks to go**; stretch goal +$40,000 + for a browser Goblins playground and Cirkoban Deluxe. *Matters: + community funding validated early and publicly.* + ([article](https://www.spritely.institute/news/2024-2025-supporter-drive-success.html)) + +### 2024 + +26. **Spritely launches Supporter Drive** — Lemmer-Webber & Grinn, + 2024-12-04 — Launches the first supporter campaign (501(c)(3), + tiered perks) with the full pitch: Goblins + OCapN + Hoot as new + decentralised foundations rather than Web 2.0 replicas. *Matters: + the individual-funding leg begins.* + ([article](https://www.spritely.institute/news/spritely-launches-supporter-drive.html)) +27. **Make a game with Hoot for the Autumn Lisp Game Jam!** — tessa, + 2024-10-22 — Jam invitation with Spritely's Hoot game template and + forum support. *Matters: the jam pipeline that later produced + Polydraw starts here.* + ([article](https://www.spritely.institute/news/make-a-game-with-hoot-for-the-autumn-lisp-game-jam.html)) +28. **Our first office hours: A recap (and how to join the next one)** + — tessa, 2024-10-17 — Ten community members at the first session; + office hours become monthly (last Wednesday, Cal.com + Jitsi). + *Matters: a standing open support channel.* + ([article](https://www.spritely.institute/news/first-office-hours-recap.html)) +29. **Spritely went to DWeb Camp: 2024 Recap** — Thompson, 2024-09-26 — + Talks on the Wasm/Hoot bet and keeping decentralisation fun; a + "Spritely Arcade" demo table (with Endo JS) running Cirkoban and + Strigoform. *Matters: games-as-demos validated with the dweb + community.* + ([article](https://www.spritely.institute/news/spritely-went-to-dweb-camp-2024-recap.html)) +30. **Spritely Goblins v0.14.0: libp2p and Improved Persistence** — + Tallon, 2024-09-19 — Adds a **libp2p netlayer** (TCP/QUIC + NAT + hole punching via a companion Go libp2p daemon, mirroring how the + onion netlayer uses Tor) and upgrades Aurie persistence: + cross-vat far references, persistent netlayers, versioned + migrations. *Matters: Goblins' first non-Tor NAT traversal, and + persistence becomes practical across vats and firewalls.* + ([article](https://www.spritely.institute/news/spritely-goblins-v0-14-0-libp2p-and-improved-persistence.html)) +31. **Come work with us! Hiring a Technical Administrator** — + Institute, 2024-09-12 — Organisational-capacity hire bridging + technical and administrative work. *Matters: the nonprofit is + professionalising behind the research.* + ([article](https://www.spritely.institute/news/come-work-with-us-hiring-a-technical-administrator.html)) +32. **Guile Hoot v0.5.0 released!** — Thompson, 2024-09-06 — A Scheme + interpreter in `(hoot eval)`, a lightweight Fibers-style + concurrency API on JS promises/delimited continuations, more Guile + compatibility, backtraces with source locations. Safari still + unsupported. *Matters: runtime evaluation + async + debuggability + for real browser apps.* + ([article](https://www.spritely.institute/news/guile-hoot-v0-5-0-released.html)) +33. **Announcing Spritely Office Hours!** — tessa, 2024-09-05 — Trial + of engineering office hours; support routing (bugs → Codeberg + trackers, questions → forum first). *Matters: support + infrastructure for a growing user base.* + ([article](https://www.spritely.institute/news/announcing-spritely-office-hours.html)) +34. **Spritely goes to DWeb Camp** — tessa, 2024-08-09 — Itinerary + announcement for DWeb Camp 2024 (talks + Demo Night Market). + *Matters: outreach to the decentralised-web community.* + ([article](https://www.spritely.institute/news/spritely-goes-to-dweb-camp.html)) +35. **Cirkoban: Sokoban meets cellular automata written in Scheme** — + Thompson, 2024-06-03 — The Cirkoban story (§3.7): 15 levels, + transactional rollback as undo, first publicly accessible + Goblins-in-browser app, 2nd place in the Spring jam. *Matters: the + first complete, playable proof of Hoot + Goblins on the web.* + ([article](https://www.spritely.institute/news/cirkoban-sokoban-meets-cellular-automata-written-in-scheme.html)) +36. **Make a game with Hoot for the Lisp Game Jam!** — Thompson, + 2024-05-15 — Spring jam invitation; 100+ registered participants; + the Hoot game template introduced. *Matters: the jam as Hoot's + stress-test and recruiting channel.* + ([article](https://spritely.institute/news/make-a-game-with-hoot-for-the-lisp-game-jam.html)) +37. **Distributed System Daemons: More Than a Twinkle in Goblins' + Eye** — Sims, 2024-05-09 — Announces the NLnet-funded Shepherd port + (§3.5), "the largest real-world deployment of Spritely technology + so far," with the ambition of Guix as an object-capability OS and + distributed Shepherds; also notes NLnet grants for Whippet and + Pre-Scheme. (Slug retains its December-2023 drafting date.) + *Matters: Goblins tested at the operating-system layer.* + ([article](https://www.spritely.institute/news/spritely-nlnet-grants-december-2023.html)) +38. **Guile Hoot v0.4.1 released!** — Thompson, 2024-04-30 — + Maintenance release fixing 0.4.0 miscompilations (tailify pass), + FFI and linker bugs; adds `(hoot web-server)` and compiler flags. + *Matters: stabilises the compiler before the Spring jam.* + ([article](https://www.spritely.institute/news/guile-hoot-v0-4-1-released.html)) +39. **Organizational changes at the Spritely Institute** — + Lemmer-Webber, 2024-04-25 — Randy Farmer steps down as Executive + Director (remains consultant/co-founder); Lemmer-Webber becomes + ED, Thompson CTO; full team listing. *Matters: the leadership + handover that set the current structure.* + ([article](https://www.spritely.institute/news/organizational-changes.html)) +40. **Spritely Goblins v0.13.0: Object Persistence and Easier IO!** — + Lemmer-Webber, 2024-04-23 — Introduces **Aurie**, Goblins' + persistence system (version-tagged self-portraits via + `define-actor`, transactional deltas), and the `^io` actor wrapping + IO resources so programs avoid programming in raw Fibers. + *Matters: long-lived Goblins worlds can survive restarts and + evolve — the persistence line that Bloblin later completes.* + ([article](https://www.spritely.institute/news/spritely-goblins-v0-13-0-object-persistence-and-easier-io.html)) +41. **Guile Hoot v0.4.0 released!** — Thompson, 2024-04-09 — + User-defined modules (R6RS `library` first), the standard library + reorganised into importable modules, a project template, complex + arithmetic, Wasm exceptions; 54 of 57 Scheme benchmarks running. + *Matters: multi-file programs make Hoot usable for real projects.* + ([article](https://www.spritely.institute/news/guile-hoot-v0-4-0-released.html)) +42. **How to Draw an Owl with the Spritely Institute** — tessa, + 2024-04-01 — April Fools' two-step owl-drawing meme post. + *Matters: culture/fun as deliberate community strategy.* + ([article](https://www.spritely.institute/news/how-to-draw-an-owl-with-the-spritely-institute.html)) +43. **LWN on Spritely** — Institute, 2024-02-29 — Pointer to LWN.net's + piece on Spritely's long-term distributed-computing paradigm and + OCapN's role. *Matters: mainstream free-software press attention.* + ([article](https://www.spritely.institute/news/lwn-on-spritely.html)) +44. **[Contract] Goblins (Scheme/Wasm) Integration Engineer** — + Institute, 2024-02-26 — Remote 20 hrs/wk contract ad. *Matters: + targeted investment in the Goblins×Hoot integration point.* + ([article](https://www.spritely.institute/news/contract-goblins-scheme-wasm-integration-engineer.html)) +45. **Developer Community Forum open for everyone!** — Farmer, + 2024-02-02 — The community forum goes public; support expectations + set (bugs to trackers, questions to the forum). *Matters: Spritely's + public, searchable community home.* + ([article](https://www.spritely.institute/news/developer-community-forum-open-for-everyone.html)) +46. **Guile Hoot v0.3.0 released!** — Thompson, 2024-01-30 — Partial + module system (prelude split into importable libraries), hash + tables incl. weak-key, debugging aids; over half the Scheme + benchmarks passing; Firefox 121 enables Wasm tail calls. + *Matters: the prerequisite step to user modules in 0.4.0.* + ([article](https://www.spritely.institute/news/guile-hoot-v0-3-0-released.html)) +47. **Meet us at GuixDays & FOSDEM!** — Farmer, 2024-01-23 — FOSDEM + 2024 invitation (Hoot and unified-vision talks); openly solicits + partnership and joint-funding conversations. *Matters: Spritely + positioning inside the Guix/Guile community.* + ([article](https://www.spritely.institute/news/fosdem2024.html)) +48. **Spritely Goblins v0.12.0 Released: Two new netlayers join the + OCapN family and more!** — Tallon, 2024-01-22 — Introduces + **prelay** (the federated relay, shipped explicitly unencrypted and + unauthenticated — "the relay has the power to snoop and modify") + and the **TCP+TLS netlayer** (self-signed certs, faster than Tor); + CapTP hardening (crossed-hellos mitigation, handoff certificate + verification, test-suite integration). *Matters: the starting point + of the relay story §6 completes — and an unusually honest + "don't trust this yet" release.* + ([article](https://www.spritely.institute/news/spritely-goblins-v0-12-0-released-two-new-netlayers-join-the-ocapn-family-and-more.html)) + +### 2023 + +49. **[EFF] Spritely and Veilid: Exciting Projects Building the + Peer-to-Peer Web** — Institute, 2023-12-15 — Pointer to the EFF's + joint profile of Spritely and Veilid. *Matters: civil-society + endorsement beyond the Lisp world (and a Spritely–Veilid pairing + worth noting for our survey).* + ([article](https://www.spritely.institute/news/eff-spritely-and-veilid-exciting-projects-building-the-peer-to-peer-web.html)) +50. **Scheme in Scheme on Wasm in the browser** — Thompson, 2023-12-15 + — Building a browser REPL for Hoot from a metacircular Scheme + interpreter (SICP-style) because Hoot didn't yet expose Guile's + evaluator in Wasm. *Matters: capability-secure in-browser Scheme + REPL; the path to try-it-live tooling.* + ([article](https://www.spritely.institute/news/scheme-in-scheme-on-wasm-in-the-browser.html)) +51. **Having a Hoot at the Lisp Game Jam: A Tale of Two Daves** — + tessa, 2023-12-07 — Interview with David Wilson (Cybersol) and Dave + Thompson (Strigoform) on building jam games with Hoot 0.1.0 and + working around its limits. *Matters: the jam as real-world + stress-test driving Hoot's FFI.* + ([article](https://www.spritely.institute/news/having-a-hoot-at-the-lisp-game-jam-a-tale-of-two-daves.html)) +52. **Building interactive web pages with Guile Hoot** — Thompson, + 2023-11-30 — Tutorial: with Wasm GC, Hoot-compiled Scheme calls the + DOM directly via the new FFI; builds from hello-world to a full + to-do app with a React-like virtual-DOM layer, almost entirely in + Scheme. *Matters: proof Hoot builds real interactive front-ends.* + ([article](https://www.spritely.institute/news/building-interactive-web-pages-with-guile-hoot.html)) +53. **Guile Hoot v0.2.0 released!** — Thompson, 2023-11-30 — + Near-complete R7RS-small, the foreign function interface, + user-defined record types, a better tree-shaker; Chrome 119 ships + Wasm GC + tail calls. *Matters: the FFI release — Hoot reaches the + DOM and host APIs.* + ([article](https://www.spritely.institute/news/guile-hoot-v0-2-0-released.html)) +54. **Introducing OCapN, interoperable capabilities over the network** + — Tallon, 2023-11-16 — The OCapN launch post: NLnet-funded + standardisation with five milestones — Guile↔Racket interop done, + pre-standardisation group formed, three draft specs (CapTP, + Netlayers, Locators), an interop test suite (already passed by an + independent Haskell implementation), and both Goblins + implementations passing it; eventual IETF/W3C ambition stated. + *Matters: Goblins' internal protocol becomes a multi-implementation + effort — the founding document of the OCapN programme.* + ([article](https://www.spritely.institute/news/introducing-ocapn-interoperable-capabilities-over-the-network.html)) +55. **Guile Hoot v0.1.0 released!** — Thompson, 2023-10-16 — First + official Hoot release: Guile's Scheme-to-Wasm backend plus the + self-contained Scheme-written Wasm toolchain; kilobyte-scale + binaries on host Wasm GC; explicitly no module system, records, or + FFI yet. *Matters: a dynamic language becomes a first-class Wasm + citizen.* + ([article](https://www.spritely.institute/news/guile-hoot-v0-1-0-released.html)) +56. **Scheme in the browser: A Hoot of a tale** — Thompson, 2023-10-10 + — First end-to-end Hoot proof: Wireworld reimplemented in ~70 lines + of Scheme (28 KiB gzipped), and the design choices explained + (Wasm GC over a shipped collector, tail calls, in-Guile Wasm + interpreter for REPL-driven development). *Matters: the "it + actually works" moment before 0.1.0.* + ([article](https://www.spritely.institute/news/scheme-wireworld-in-browser.html)) +57. **[Hiring] Open Source Developer Relations Manager** — Institute, + 2023-09-29 — DevRel hire to support the Goblins ecosystem; more + roles promised as funding permits. *Matters: the shift from pure + R&D toward community growth.* + ([article](https://www.spritely.institute/news/hiring-open-source-developer-relations-manager.html)) +58. **Lisp Game Jam – "Wireworld" – Hoot's low level Wasm tooling in + action** — Lemmer-Webber, 2023-06-12 — A WASM-4 Wireworld cartridge + built with Hoot's low-level assembly tools; argues Scheme + generating Wasm beats hand-written WAT on readability, correctness, + and iteration speed. *Matters: Hoot's low-level layers as a + "programs that write programs" toolkit.* + ([article](https://www.spritely.institute/news/hoot-wireworld-live-in-browser.html)) +59. **Lisp Game Jam – "Fantasary" – prototyping an object world + (& TCP netlayer)** — Thompson, 2023-06-07 — Fantasary (§3.7): a + text virtual world built to test a prototype Simple TCP netlayer, + petnames, and the unum pattern; candid about open problems — NAT + traversal, 4,124-character sturdyref URIs from encoded certs, X.509 + as a poor fit. *Matters: the testbed for the TCP+TLS netlayer that + shipped in 0.12.0.* + ([article](https://www.spritely.institute/news/lisp-game-jam-fantasary-prototyping-an-object-world-tcp-netlayer.html)) +60. **Directly compiling Scheme to WebAssembly: lambdas, recursion, + iteration!** — Lemmer-Webber, 2023-05-30 — Three months after the + Guile-on-Wasm announcement, Hoot compiles Scheme procedures + directly to Wasm (factorial in 970 bytes; a tail-recursive loop + benchmarked ~5× native Guile, with caveats stated); roadmap: + R7RS-small, then Goblins in the browser. *Matters: first public + evidence direct Scheme-to-Wasm could be tiny and fast.* + ([article](https://www.spritely.institute/news/scheme-to-wasm-lambdas-recursion.html)) +61. **Spritely Goblins v0.10, for Guile and Racket!** — Lemmer-Webber, + 2023-01-30 — Guile and Racket Goblins interoperate over OCapN for + the first time (goblin-chat across both), and Guile becomes the + primary implementation. *Matters: cross-implementation interop + proves OCapN is a protocol, not an implementation detail — the + archive's founding release.* + ([article](https://spritely.institute/news/spritely-goblins-v0-10-for-guile-and-racket.html)) + +### Themes across the archive + +- **Release trains (31 of 61 posts).** Goblins: 0.10 → 0.18.0 (9 release + posts, roughly two per year, each with a named theme — persistence, + netlayers, browser, performance, sleepy actors). Hoot: 0.1.0 → 0.10.0 + (13 release posts, accelerating to ~4/year). The two trains are + visibly coupled: Hoot releases exist to unblock Goblins milestones + (0.6.0 → Goblins-in-browser; 0.16.1 fixes OCapN-over-Hoot). +- **OCapN standardisation (a 2023 founding, a 2026 relay).** #61 (first + interop) → #54 (the programme launch) → #48 (new netlayers) → #3 + (E2EE relay + spec). The through-line: every protocol claim is + shipped in Goblins first, then specified for others. +- **The browser as the deployment target.** From #60's first compiled + lambda to #22's Goblins-in-the-browser to #1's relay-served game, + the archive's main plot is Scheme/Goblins escaping the desktop via + Wasm — with the relay as the networking piece browsers forced. +- **Games as the demo strategy.** 11 posts are jam-related. This is + deliberate ("fun is a revolutionary act"): every major capability + (TCP netlayer, Hoot FFI, Goblins-in-browser, E2EE relay handoffs) + got its first public exercise in a jam game. +- **Grants and community funding.** NLnet underwrites the protocol + work (#54, #37, #19, #3); the supporter drive (#26, #25, #20) funds + the commons. Funding announcements are treated as technical news, + with amounts and goals published. +- **Institution-building.** Leadership handover (#39), forum (#45), + office hours (#33, #28), hiring (#57, #44, #31), conference presence + (#47, #24, #15) — roughly a fifth of the archive is the nonprofit + building its own scaffolding, reported with unusual candour about + gaps and failures (failing Shepherd tests, Safari gaps, prelay's + insecurity). + +--- + +## 5. Project health and contribution policy + +**Cadence.** The archive itself is the health signal: 61 posts over 46 +months with no silent year; Goblins releases roughly twice a year +(0.10 Jan 2023 → 0.18.0 Apr 2026), Hoot accelerating (0.1.0 Oct 2023 → +0.10.0 Oct 2026, four releases in 2026 alone counting 0.8–0.10). Work is +grant-paced: each NLnet grant maps to a visible deliverable chain +(standardisation → Shepherd → Oaken → relay), and the 2024–25 supporter +drive added a second, community leg ($80k goal publicly met). The team +is small (three named engineering leads plus a handful of staff and +contractors), which is both the strength (coherence) and the risk +(concentration: Tallon alone is Goblins lead *and* OCapN spec author). + +**Contribution policy — the AI question.** Confirmed, with a scope +nuance. The **OCapN project's** README states the prohibition on +AI-generated contributions to its specifications, test suite, and +official tooling (recorded in `ocap-family.md` §6, from +[ocapn/ocapn](https://github.com/ocapn/ocapn)). That policy belongs to +the multi-party OCapN group, whose work happens on GitHub with monthly +meetings open to anyone ([ocapn.org](https://ocapn.org)). On the +Institute's own site, contribution routes are the Codeberg repos (issue +and PR links from the project pages) and the community forum; this pass +did **not** surface an equivalent AI-contribution statement on +spritely.institute itself — so: OCapN upstream = no-AI-contributions by +policy; Spritely's own repos = not verified either way from the site. + +--- + +## 6. Deep dive: end-to-end encrypted relays for OCapN + +Primary source: Tallon, "End-to-end encrypted relays for OCapN," +2026-10-15 +([article](https://www.spritely.institute/news/end-to-end-encrypted-relays-for-ocapn.html)), +plus the Goblins 0.12.0 prelay announcement (#48), the Goblins manual's +netlayer pages as summarised in `ocap-family.md`, and the Polydraw +devlog (#1) as the field report. + +### 6.1 What Spritely means by it + +A **relay** in Spritely's usage is a public-internet server that proxies +messages between two peers that cannot connect directly — because of +home NATs, carrier-grade NATs that defeat port forwarding and UPnP, or +browser sandboxes where listening is impossible. Hole punching is +acknowledged and dismissed as "far from guaranteed"; the relay is the +general-case fallback, and Spritely is blunt that relays are +"unsatisfying compared to making direct connections" but necessary. + +The history matters. Goblins 0.12 (January 2024) shipped **prelay**, a +*federated* relay that was deliberately named "pre-" because, although +the peer↔relay legs were encrypted in transit, the relay could read and +modify the CapTP traffic passing through it — it was unauthenticated +and not end-to-end encrypted, and Spritely said so in the manual and +the release post. The October 2026 announcement is the fix: a relay +that is **federated, stateless, and end-to-end encrypted**, funded by +an NLnet grant, landing in the next Goblins release after 0.18.0, with +an OCapN specification so other implementations can build compatible +relays, relay test-suite support, and a Guix service for running one. + +So "E2EE relays for OCap" means, precisely: **the CapTP session between +the two peers is encrypted and authenticated peer-to-peer (Noise), and +the relay — even relaying between two different relay servers — handles +only ciphertext it cannot read, modify undetectably, or replay.** + +### 6.2 What the design provides + +- **Reachability in the general case.** Any two peers with outbound + internet can meet, regardless of NAT/CGNAT, and browser (Hoot) peers + — which cannot listen at all — become full OCapN citizens. This is + the property that made the relay "a critical part of the OCapN story" + once Hoot existed. +- **Federation instead of a platform.** A relay server exposes two + actors: a **Controller** (a client steers its own connections) and an + **Endpoint** (named in the peer's locator, publicly enlivenable). + Two peers homed on *different* relays still connect: the initiating + relay enlivens the remote relay's Endpoint, the two relays spawn + paired forwarding objects (`rarelay`/`rbrelay`), and the destination + relay calls the destination peer's registered incoming object. No + shared operator, no central directory — the relay-to-relay hop is + itself just OCapN. +- **Statelessness as an anti-lock-in guarantee.** The relay stores no + user data or configuration; its only job is forwarding live messages. + Spritely draws the ActivityPub lesson explicitly: an instance holds + your data and acts for you, so leaving is costly; a relay holds + nothing, so switching relays means pointing your sturdyrefs at a new + one. Relays are meant to be cheap and disposable — the grant includes + a Guix service precisely so many small operators can run them on "the + cheapest VPS or old computers." +- **End-to-end security properties.** Via Noise (below): confidentiality + and integrity against the relay and any intermediary, **man-in-the- + middle resistance** (peer authentication against the locator's + designator key), **replay protection**, and **perfect forward + secrecy** from per-session ephemeral keys. +- **Composability.** The encryption is not relay-specific: Noise is a + *meta-netlayer* that wraps any other netlayer, so the same E2EE + + mutual authentication can be layered over TCP+TLS or even Tor + (which authenticates only the outbound direction to an onion service; + Noise adds bidirectional authentication). + +**What the relay can and cannot see.** It cannot read message contents, +cannot undetectably modify them, and cannot replay them. It necessarily +*can* see connection metadata: which Endpoint/designator is being +contacted, when, how much traffic, and the connecting peers' network +addresses on their home legs (and, in federation, the other relay). +Spritely claims **no anonymity property** for the relay — that is Tor's +job in their stack, and the relay is positioned as the low-latency, +low-trust complement to the onion netlayer, not a replacement for it. +It can also deny service (drop/delay), as any relay can; federation + +statelessness are the mitigation (use another relay), not a protocol +guarantee. + +### 6.3 What Guile Noise is + +**Guile Noise** is Spritely's from-scratch implementation of the +[Noise Protocol Framework](https://noiseprotocol.org) for Guile Scheme, +written by Jessica Tallon because no Guile implementation existed. (A +Dart implementation by Ridley of DObjects followed the same path for +the same reason — a sign of how the OCapN ecosystem grows: each +implementation writes its own Noise.) + +- **What it implements.** The Noise state machines (CipherState, + SymmetricState, HandshakeState) and **all 12 fundamental interactive + handshake patterns**. Supported primitives: X25519 key agreement, + AES-GCM ciphers, SHA-256 and SHA-512 hashes — chosen because they are + available in both target environments: **GnuTLS** on the Guile VM and + **WebCrypto SubtleCrypto** under Hoot/in the browser. The crypto + backend is pluggable. +- **How OCapN uses it.** The relay/Noise netlayer uses the **XK** + pattern: the responder's static public key is known to the initiator + in advance — it *is* the designator in the peer's OCapN locator — and + the initiator transmits its own static key during the handshake, so + both sides end up mutually authenticated. XK's three-message + handshake mixes ephemeral and static DH operations to produce two + CipherStates (one per direction) with forward secrecy. +- **Verification/maturity.** The library is validated against the + official Noise test vectors for every pattern/cipher it supports, + with the vector runner executed on **both** backends (Guile VM and + Hoot). It is new (announced October 2026, shipping with the relay in + the next Goblins release) and general-purpose — usable independently + of Goblins — but it has not yet had a numbered-release soak, and + Spritely is candid that none of them are cryptographers: the design + deliberately stands on Noise (the framework behind WireGuard and + WhatsApp's transport) rather than inventing a protocol. Judge it as: + a careful, test-vector-checked implementation of a well-reviewed + framework, by a small team, at version-zero maturity. + +### 6.4 How the relay actually works, end to end + +1. Each peer registers an *incoming* object with its home relay's + Controller. Its sturdyrefs name the relay's **Endpoint** object plus + its Noise static key (the locator designator). +2. To connect, the initiator's CapTP enlivening asks its relay's + Controller to open a connection to the target sturdyref. The + Controller extracts the remote Endpoint, enlivens it (connecting + relay-to-relay if the peers are on different relays), and spawns a + forwarding object for the session. +3. The remote relay calls the target peer's registered incoming object, + handing it the paired forwarding object; both sides now hold a + message pipe through one or two relays. +4. Over that pipe, the peers run the **Noise XK handshake directly with + each other** — the relay forwards handshake bytes it cannot usefully + read (the responder's key is checked against the locator; the + initiator's static key arrives encrypted under keys derived from + the responder's). A **bootstrap inbox/outbox exchange** inside the + Noise netlayer then binds the encrypted channel to CapTP: each side + delivers its outbox to the bootstrap object named in the locator, + receives the peer's outbox, and thereafter sends CapTP messages as + Noise-encrypted payloads. +5. CapTP runs unchanged on top — including **third-party handoffs**: + when A introduces B to C mid-session, B and C establish their own + Noise session (over relays if needed) using handoff certificates + signed with session keys, so the introduction is secure even though + the original channel's messages transited relays. Polydraw (#1) is + the first shipped application to do handoffs over this netlayer — + and its devlog's "crossed hellos" bug (two simultaneous connections, + one must win, promises on the loser hang) is the honest footnote: + OCapN's **at-most-one-connection** invariant is load-bearing for + object identity, and the relay path is where it gets exercised. + +### 6.5 Comparisons: where each relay/rendezvous design puts trust + +| System | What the relay/route is | Can it read content? | Metadata it learns | Who runs it / federation | Anonymity aim | +|---|---|---|---|---|---| +| **Spritely E2EE relay (2026)** | Federated, stateless OCapN forwarder; Noise XK between peers | No — ciphertext only; modification/replay prevented | Peer designators/endpoints contacted, timing, volume, client IPs on home legs | Anyone; relays interoperate via OCapN itself; Guix service planned | None claimed | +| **Spritely prelay (2024)** | Same federation shape, no E2EE | **Yes — could snoop and modify** (documented) | Everything above plus plaintext | Anyone | None | +| **iroh relay** | Home-relay + fallback relay for QUIC endpoints; hole punching attempted first, relay is fallback | No — payload is QUIC/TLS 1.3 between endpoints | EndpointIds of both sides, IPs, timing, volume | n0's public relays or self-run; per-endpoint home relay | None claimed (endpoint IDs are public keys, linkable) | +| **Tor onion services** | Rendezvous over 6-hop circuits via introduction/rendezvous points | No — onion encryption end to end | Rendezvous point sees a rendezvous happening, not the parties' identities (by design) | Volunteer relay network; rendezvous points are chosen relays | **Yes — core goal**, at high latency cost | +| **Veilid** | Safety routes (relay hops, DHT-mediated) and private routes (peer-provided route blobs) | No — route traffic is encrypted to the destination | Compiled-route relays see fragments; design minimises any single node's knowledge | Any node in the public DHT network | **Yes** — route privacy is the product | +| **Nostr relays** | Store-and-forward servers holding signed events | Public events: yes, plaintext by design; DMs: NIP-44 ciphertext, but relay stores them | Nearly everything: authors, recipients (gift-wrap mitigates), timing, social graph | Anyone; users multi-home across relays | No (pseudonymity only) | +| **Matrix federation** | Homeservers that host rooms and replicate room state | E2EE rooms: content no; but the server holds room state, membership, and metadata, and *is* the user's home | Extensive — it is the user's server, not a transit hop | Federation of homeservers; users are bound to their server's data custody | No | +| **TURN (WebRTC)** | Generic media/data relay with credentials | No for DTLS-SRTP media (E2E between peers) | Both IPs, ports, timing, volume; allocation credentials identify the user to the operator | Usually the app operator's own servers; not meaningfully federated | No | + +Three contrasts Drew should take away: + +1. **Spritely's relay is closest to iroh's**, in shape and in honesty: + both are "dumb, replaceable pipes under endpoint-key cryptography, + run by anyone, leaking connection metadata, claiming no anonymity." + The differences are in what rides on top and how federation works — + iroh relays are located via DNS/home-relay config and forward QUIC + between EndpointIds, with hole punching as the preferred path and + the relay as fallback; Spritely's relays are *addressed as OCapN + objects* and federate by speaking OCapN to each other, and the + relay is a first-class netlayer rather than a fallback (there is no + hole-punching attempt in the Goblins relay path; the libp2p netlayer + is where Goblins gets hole punching). Spritely also composes + encryption as a separate meta-netlayer usable over *any* transport, + where iroh bakes TLS into QUIC. +2. **Against Tor and Veilid, the Spritely relay is deliberately + weaker on privacy and stronger on simplicity/latency.** Tor and + Veilid spend hops and complexity to hide *who is talking to whom* + from the infrastructure; Spritely's relay hides only *what is said*. + In Spritely's own stack those are different netlayers for different + threat models (onion for anonymity, relay for reachability), which + is the right way to read the design: the relay does not compete with + Tor, it complements it. +3. **Against Nostr/Matrix, the contrast is custody.** Nostr relays + store your events; Matrix servers store your rooms and *are* your + identity's home. Spritely's relay stores nothing and knows no + accounts — the ActivityPub lesson applied to infrastructure. The + cost is the mirror image: no store-and-forward, so an offline peer + is simply unreachable until it reconnects (the same liveness limit + as all of CapTP; see `ocap-family.md` §2). + +### 6.6 Fit with the OCapN netlayer contract + +The relay work is best understood as the netlayer contract being kept +under hostile conditions. The contract (Netlayers draft; see +`ocap-family.md` §5) requires a netlayer to provide a bidirectional, +ordered, secure channel between two designator-identified peers, with +at most one live connection per peer pair, so that CapTP above it can +assume authenticated, non-replayable delivery and stable object +identity. Prelay violated the "secure" clause in spirit (transport +encryption but a trusted middle); the Noise composition restores it +*without changing CapTP or the relay's federation machinery* — the +meta-netlayer pattern (a netlayer defined over another netlayer) is +doing the architectural work. Sturdyrefs survive unchanged: the +locator gains a Noise-key-bearing designator and a relay Endpoint, and +enlivening produces the same live references whether the path was +direct TCP+TLS, Tor, or two federated relays. Third-party handoffs — +the contract's hardest clause — are demonstrated working over the +relay by Polydraw, with the crossed-hellos race as the known wart: +when two peers connect simultaneously, one connection must be chosen +and the loser's promises currently hang rather than break cleanly; +Spritely shipped a timeout workaround in the game and flags a Goblins +fix as future work. + +**Estate note (one paragraph).** For our own transport programme, the +transferable ideas are: (a) encryption as a *composable layer* keyed by +the locator's designator, separable from the forwarding mechanism; +(b) statelessness as an explicit anti-custody design goal for relay +infrastructure, learned from federation's mistakes; (c) relays +addressed and federated *in the same capability system they serve*, +rather than as external configured infrastructure; and (d) the honest +metadata posture — Spritely's relay, like iroh's, does not pretend to +anonymity, and says what the relay can see. The non-transferable part +is the substrate: this is a Scheme/Guile implementation of a +pre-standardisation protocol, at first-release maturity, with no Rust +presence (see `ocap-family.md` §7). diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/ucan-deep.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/ucan-deep.md new file mode 100644 index 000000000..b39656587 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/ucan-deep.md @@ -0,0 +1,606 @@ +# Family research: UCAN 1.0 — deep dive (delegation, invocation, revocation) + +Lane UCAN-DEEP — for the auth + transport investigation (tracking issue +[#13779](https://github.com/developing-today/code/issues/13779)). Companion to +the survey entry in +[`capnp-and-survey.md`](capnp-and-survey.md), which flagged UCAN as +best-in-field on token semantics with a Rust lag; this note is the full +treatment. Primary sources: the UCAN Working Group spec repos +([core](https://github.com/ucan-wg/spec), +[delegation](https://github.com/ucan-wg/delegation), +[invocation](https://github.com/ucan-wg/invocation), +[revocation](https://github.com/ucan-wg/revocation)), the implementation repos +([rs-ucan](https://github.com/ucan-wg/rs-ucan), +[go-ucan](https://github.com/ucan-wg/go-ucan), +[ucanto](https://github.com/storacha/ucanto)), third-party 1.0 work +([pq-ucan](https://crates.io/crates/pq-ucan), +[ucantone](https://github.com/alanshaw/ucantone)), and production users' own +documentation ([Storacha specs](https://github.com/storacha/specs), +[w3up/ucanto docs](https://docs.storacha.network)). Read 2026-11-23. + +## 0. Verdict up front + +UCAN 1.0 is the most completely specified *delegation semantics* in this +programme: a required delegation sub-spec with mandatory monotonic +attenuation, a separate signed **invocation** object (authority vs its +exercise, with receipts and provenance chains), a revocation model that is +per-proof-path and irreversible, and principals that are bare `did:key` +identities — for Ed25519, mechanically the same key as an iroh NodeId and a +p2panda author key. It is the only candidate in the survey whose identity +layer is *free* for this estate. + +The blocker is not the design, it is the code and the calendar. The spec +family reached 1.0.0 text in 2025–2026, but the ecosystem is mid-transition: +the WG's own Rust crate self-describes as implementing **UCAN v1.0.0-rc.1** +and "work in progress… not formally audited"; the one Rust crate implementing +the final 1.0.0 tags is a third-party pre-release; the revocation sub-spec is +still at **v1.0.0-rc.1**; and the largest production deployment (Storacha's +ucanto) still runs **0.10-era semantics**, not 1.0. Judgment in §12: adopt +UCAN as the estate's delegation-layer *design* now; as a code dependency it +is a compatibility/pilot layer today, with a named trigger for promotion. + +## 1. What UCAN is, and the spec family as it stands + +UCAN (User Controlled Authorization Networks) is a **certificate-capability** +system in the SPKI/SDSI lineage: authority is carried by signed, serializable +tokens that form chains, verifiable offline by anyone, with no central +authority consulted at exercise time. The core spec is explicit that this is +*not* an object-capability system — ocap's consistency requirements "rule out +partition tolerance," and UCAN chooses partition tolerance +([core spec](https://github.com/ucan-wg/spec)). It originated at Fission +(co-founded by editor Brooklyn Zelenka) and was used in production there +(Webnative/ODD SDK, WNFS) in its 0.9-era JWT form; Fission the company shut +down in April 2024 and the work continues under the UCAN WG. + +The 1.0 family is four sub-specifications under one core document +([core spec, Lifecycle](https://github.com/ucan-wg/spec)): + +| Sub-spec | Requirement | Status (2026-11-23) | Repo shape | +|---|---|---|---| +| Delegation | **REQUIRED** | README states 1.0.0, tag `ucan/dlg@1.0.0` | [ucan-wg/delegation](https://github.com/ucan-wg/delegation), 7 commits | +| Invocation | **REQUIRED** | README states 1.0.0, tag `ucan/inv@1.0.0`; the rendered spec site still shows `ucan/inv@1.0.0-rc.1` | [ucan-wg/invocation](https://github.com/ucan-wg/invocation), 17 commits | +| Promise | RECOMMENDED | Extends invocation with distributed promise pipelining (await a result inside another invocation) | specified with the invocation family; implemented in Go ([ucantone](https://github.com/alanshaw/ucantone)), not found in Rust | +| Revocation | RECOMMENDED | **v1.0.0-rc.1** — a release candidate, not final, while its siblings are 1.0.0 | [ucan-wg/revocation](https://github.com/ucan-wg/revocation), 3 commits | + +The tag skew in that table is real and load-bearing: an independent Rust +implementer reports that "rs-ucan and the JavaScript implementation emit" +the `-rc.1` tags, and built dual-tag acceptance into their decoder +([pq-ucan docs](https://docs.rs/crate/pq-ucan/latest)). Anyone adopting 1.0 +today must decide which tag set they emit and accept; the specs' own text +has moved faster than the WG's implementations. The sub-spec repos are +still being touched (delegation and invocation pushed 2026-07, revocation +2026-08, core spec 2026-10 — GitHub repo metadata), i.e. the family is +settling, not settled. + +Governance: specs live under the **Community Specification License v1**, +each repo carrying Governance/Scope documents. Editorship is Zelenka +(Witchcraft Software); authors span Common Tools (Irakli Gozalishvili, +ex-Protocol Labs), Bluesky (Daniel Holmgren), n0 — the iroh company +(Philipp Krüger), and Storacha-adjacent contributors (Hugo Dias) +([core spec](https://github.com/ucan-wg/spec), +[delegation spec](https://github.com/ucan-wg/delegation)). The core spec repo +is small and slow-moving by design (97 commits, ~300 stars, created +2021-11-25). This is a handful-of-people, grant/consulting-paced working +group, not a standards body — competent and still active (spec text current +through 2026), but there is no conformance programme beyond shared test +fixtures, which pq-ucan uses as its interop vectors +([pq-ucan docs](https://docs.rs/crate/pq-ucan/latest)). + +## 2. Wire format and identity + +Every UCAN artifact is an **envelope**: `[signature, {h: VarsigHeader, +"ucan/@": payload}]`, canonically encoded in **DAG-CBOR** +for signing (DAG-JSON is permitted for presentation/storage). The token's +identity is its **CID**: CIDv1 + dag-cbor multicodec + SHA-256 multihash, +rendered base58btc (CIDs begin `zdpu`). Signatures MUST be canonical per the +varsig rules (e.g. low-S ECDSA) — otherwise a third party could derive a +second valid signature and therefore a second CID for the same token +([core spec](https://github.com/ucan-wg/spec)). + +**Varsig** is UCAN's algorithm-agility mechanism: a multiformat (prefix +`0x34`, version `0x01`) self-describing header naming the signature algorithm +and the payload encoding signed over, carried *inside* the envelope, so the +header can evolve without invalidating previously issued artifacts +([ucan-wg/go-varsig](https://github.com/ucan-wg/go-varsig)). + +**Principals are DIDs; `did:key` is required.** The mandatory cryptosuite +is SHA-256 plus **Ed25519 (RECOMMENDED/preferred), P-256, and secp256k1**. +The FAQ is blunt about anything else: other algorithms are possible but +"off spec" (non-interoperable) and MUST be declared in the varsig header +([core spec FAQ](https://github.com/ucan-wg/spec)). + +**P-384 status — the question this estate cares about, since the IdP CA is +P-384.** P-384 is **not** in UCAN's required suite and neither Rust +implementation ships it. Varsig *can express* ES384 today — the WG's Go +varsig library exposes constructors for ES256, **ES384**, ES512, ES256K and +RSA variants ([go-varsig](https://github.com/ucan-wg/go-varsig)) — so a +P-384 UCAN profile is mechanically possible and self-describing, but it +would be a private dialect: no interop guarantee, no fixture coverage, no +implementation to borrow. The honest reading: **in practice UCAN is an +Ed25519-first system** (P-256 exists for WebCrypto compatibility), and a +P-384 estate should treat UCAN as living one layer *below* its CA — the CA +certifies/enrols the Ed25519 seat keys; UCAN never needs to speak P-384. +That layering is the estate's design to make; UCAN neither helps nor +hinders it beyond not covering it. + +## 3. Capability model + +A capability in 1.0 is a triple: **subject × command × policy** +([delegation spec](https://github.com/ucan-wg/delegation)). This replaces +the 0.x-era `with` (resource URI) / `can` (ability string) pair: + +- **Subject** (`sub`): the DID the authority is *over*. "Unless explicitly + stated, the Resource of a UCAN MUST be the Subject" — chains are + self-certifying, rooted at the subject's own key. There is no separate + resource registry; the subject *is* the resource root. +- **Command** (`cmd`): lowercase, slash-led, slash-separated, no trailing + slash (`/space/blob/add`, `/crypto/sign`). Commands have **prefix + semantics**: holding `/crypto` MAY prove `/crypto/sign`, and MUST NOT + prove `/stack/pop` or `/cryptocurrency`. The command `/` ("Top") is the + wildcard — among other things it permits updating the subject's mutable + DID document and revoking their delegations, and the spec flags it + "handle with care." The `/ucan` namespace is reserved + (`^\/ucan\/.*`) for protocol operations such as revocation + ([core spec](https://github.com/ucan-wg/spec)). +- **Policy** (`pol`, required in delegations): an array of statements, + implicitly ANDed, each `[operator, selector, argument]` evaluated against + the eventual invocation's `args`. Selectors are a deliberately small + jq-inspired subset (no pipes, arithmetic, regex, or recursive descent; + missing values yield `null` via the `?` operator rather than throwing). + Operators: `==`, `!=`, `<`, `<=`, `>`, `>=`, `like` (glob, `*` only), plus + `and`/`or`/`not` and `all`/`any` quantifiers. Semantic conditions that + can't be expressed syntactically (day of week) are explicitly out of + scope; the spec's recommended trick is to shape the args so the fact is + *in* them ([delegation spec](https://github.com/ucan-wg/delegation)). + +**Attenuation is mandatory and structural.** The core rule: "Each direct +delegation MUST either directly restate or attenuate (diminish) its +capabilities"; merging follows set semantics and is always additive; every +delegated capability MUST be equal-or-narrower than its delegator's. It is +enforced three ways at validation time, not by issuer honesty: + +1. **Command narrowing is syntactic** — a child command must be the parent's + command or a path beneath it. +2. **Policies accumulate** — the invocation's args must pass the policies of + *every* delegation in the chain, so a child policy can only further + restrict; the parent's policy still applies in full. Widening by policy + is therefore impossible even if a delegate tries. +3. **Time intersects** — chain validity is latest `nbf` → earliest `exp` + (§6). + +Validation itself has exactly three criteria, performed on receipt of an +invocation before execution: **time bounds** (every proof valid at execution +time), **principal alignment** (each proof's `aud` MUST equal the next +UCAN's `iss`, forming an unbroken chain back to the subject; DID fragments +ignored), and **signature validation** against each `iss` DID. Validators +MUST NOT reject a chain merely because one capability in it is irrelevant +or not understood ([delegation spec](https://github.com/ucan-wg/delegation)). + +Two more load-bearing details: + +- **Powerline** (`sub: null`): a delegation with a null subject + automatically delegates *all future delegations regardless of subject* — + the subject is substituted at validation time from the prior link. This + is the multi-device pattern: a root identity powerlines `/` to each of + its device keys once, and every later delegation to the root is + automatically held by every device. A powerline MUST NOT be a root + delegation, MAY be revoked, and can itself be restricted (e.g. powerline + `/crud/read` only) ([delegation spec](https://github.com/ucan-wg/delegation)). +- **No confinement, by design.** Delegates can sub-delegate without + alerting the delegator; the spec calls revocation "a last resort" and is + explicit that you cannot enumerate all sub-delegations that exist. There + is also **no protection against a person-in-the-middle**: the core spec's + FAQ states plainly that you must delegate only to authenticated agents + over secure channels. A UCAN delegation is *addressed* (it names its + `aud`, and exercising it requires the audience's key — §4), so a leaked + delegation is not a bearer token; but *delivering* it confidentially is + the transport's problem, not UCAN's. + +`meta` fields exist on both delegations and invocations: asserted, signed, +but explicitly **not** delegated authority — the natural home for audit +annotations, job IDs, and (for this estate) handoff coordinates. + +## 4. Invocation: the separate signed object, and why the split matters + +The single most consequential design decision in 1.0 is that **exercising +authority is a different signed object from holding it** +([invocation spec](https://github.com/ucan-wg/invocation), tag +`ucan/inv@1.0.0`). The spec's own rationale is the function-reference vs +function-call distinction: a delegation carries no task intent, no concrete +arguments, no chosen executor, and no replay identity. An invocation +supplies all four: + +- `iss` — the invoker, who MUST be the delegator at the end of the proof + chain; `sub` — the subject (executor by default); `aud` — an *optional + different intended executor*, which is what makes brokers, proxies, + gateways and replicated state machines first-class: you can invoke + *through* an intermediary at a named executor. +- `cmd` — a concrete, dispatchable command; `args` — the argument map whose + shape the command defines; `prf` — the delegation CIDs, root-first, in + strict sequence. **The args MUST pass the policies of ALL delegations in + `prf`** or the invocation MUST be rejected. +- `nonce` — REQUIRED; SHOULD be empty (`0x`) for idempotent commands so + identical tasks share an ID. `exp` — REQUIRED but nullable; **a timeout + within a few minutes is RECOMMENDED**, giving invocations expressive + timeout and replay-prevention semantics delegations don't have. +- `cause` — the optional CID of the **Receipt** that enqueued this task; + `meta` — optional (the spec's own examples: Wasm fuel, internal job IDs, + GitHub issue references). + +The **Task ID is the CID of {subject, command, arguments, nonce}** — a +content-addressed, deduplicable, replay-detectable identity for a unit of +work, derived from the artifact itself rather than assigned by a server. + +Execution produces a **Receipt**, and a Receipt MAY enqueue further Tasks +via `cause` — so work composes into provenance chains: every task can name +the receipt that caused it, back to a root invocation. UCAN Promise +(RECOMMENDED) extends this with distributed promise pipelining — awaiting +another invocation's result inside an invocation, the CapTP-flavoured idea +rebuilt for partition-tolerant certificate chains. + +Why this matters beyond tidiness: most token systems (Biscuit, macaroons, +JWT) have only the delegation artifact; "the request" is an unsigned HTTP +call whose binding to the token is conventional. In UCAN the request is +itself signed by the chain's end-holder, names its proofs, carries its own +short expiry and replay identity, and yields a signed receipt. For an +estate whose centre of gravity is *dispatching work to agents and later +auditing who authorised what*, the invocation/receipt pair is the audit +trail, not a log you reconstruct. The core spec also explicitly blesses the +composition this estate wants: its "Beyond Single System Image" section +applies UCAN to CRDTs/RSMs by lifting the Executor=Subject requirement and +carrying provenance in an invocation log (push and pull models both +described) ([core spec](https://github.com/ucan-wg/spec)). + +## 5. Revocation + +The revocation sub-spec (still **v1.0.0-rc.1**) makes revocation *an +invocation of the reserved command* `/ucan/revoke`, with args +`{revoke: &Delegation CID, path?: [&Delegation]}` and an empty nonce +(idempotent) ([revocation spec](https://github.com/ucan-wg/revocation)). +Semantics, precisely: + +- Revocation names **one delegation by CID**. Any issuer whose proofs + appear in a chain MAY revoke a delegation in it — not only the direct + issuer. +- Revoking one proof does **not** kill a capability reachable through an + alternate unbroken chain (the spec's two-tickets analogy). Revocation is + per-proof-path, not per-capability. This is the price of the additive, + set-semantics merging in §3, and it is the sharpest semantic difference + from ACL-thinking: to truly cut off a delegate you must revoke every + path, or let expiry do it. +- Revocations are **immutable and irreversible**; the store is append-only + and recipients SHOULD treat it as a monotonically growing set. An + erroneous revocation is repaired by issuing a *new* delegation (new + nonce/time bounds), never by retracting. +- The agent controlling a resource MUST maintain a **revocation cache** for + its subject; validation checks each delegation's canonical CID against + it. Entries may be evicted once the revoked UCAN has expired (plus + clock-skew buffer). Executors MAY require a **path witness** to prevent + spurious-revocation denial of service. +- **Delivery is out of scope.** "How a validator learns of a revocation" + is explicitly not specified — the format doesn't change; transport is + the deployment's problem. The spec observes that single-source-of-truth + resources get near-ACL semantics by sending the revocation to the + resource's agent, and CRDT resources should embed the store at a + well-known path. + +**Checking cost, for offline seats** (the estate's question): the check +itself is trivial — set membership of each proof's CID in a local set, +O(chain length), no cryptography beyond the signature validation already +being done, and the spec's implementation guidance (CID-indexed store, +memoized validation, "a previously reviewed, unrevoked proof can be +considered valid immediately") makes the hot path cheap. The real cost is +**freshness, not computation**: a seat offline since time T knows no +revocations issued after T. UCAN's own posture is the mitigation — expiry +is the workhorse, revocation the backstop: short `exp` bounds the window +in which a stale revocation cache can hurt you, and revocations themselves +are small signed objects that gossip well and can ride any sync the seat +already does (including, in this estate, p2panda topics — §11.4). An +estate that needs hard, immediate revocation of a *specific* delegation +regardless of alternate paths will find UCAN's model honest but +unhelpful: it must engineer path-exhaustion or short lifetimes itself. + +## 6. Expiry and TTL semantics + +Delegations carry `nbf` (optional; omitted = valid from the epoch) and +`exp` (required; **if a token never expires, `exp` MUST be explicitly +`null`** — non-expiry is a stated decision, never a default). Chain +validity is the intersection: latest `nbf` to earliest `exp` across all +proofs. Timestamps are integer seconds; values outside ±(2⁵³−1) MUST be +rejected; a ±60-second clock-drift buffer is RECOMMENDED. Every token +carries a REQUIRED `nonce` (random 12-byte recommended) giving each +delegation a unique CID and replay resistance +([delegation spec](https://github.com/ucan-wg/delegation), +[core spec](https://github.com/ucan-wg/spec)). + +Invocations are stricter in practice: `exp` is REQUIRED (nullable) and the +spec RECOMMENDS timeouts within a few minutes, with replay prevention +REQUIRED of executors (a seen-CID set). The two-tier posture — long-lived +*authority*, minutes-lived *exercise* — is deliberate and is what makes +the weak revocation story survivable: most real-world "revocations" are +just invocations expiring. + +## 7. Identity and groups + +UCAN has **no group, role, or membership model** — deliberately. Principals +are DIDs; authority structure is expressed entirely as delegation graphs. +The patterns that substitute for groups: + +- **Powerline** (§3) is the device-group pattern: one root, many device + keys, automatic subject substitution. +- A *role* is a DID whose key is held by a service or shared under + application discipline; delegating to the role DID delegates to whoever + can sign for it. Late binding and roster management are the + application's problem (contrast Keyline, where roles are native graph + nodes with derived authority — §11.5). +- The subject-defaults-to-resource rule plus mutable DID documents under + `/` give a key-rotation path for `did:web`-style identities; bare + `did:key` identities rotate only by re-delegation (a new key is a new + principal; the powerline pattern is the intended bridge). + +## 8. Implementations — who implements what, exactly + +| Implementation | Spec generation actually implemented | State | +|---|---|---| +| [rs-ucan](https://github.com/ucan-wg/rs-ucan) (WG, Rust) | README: "These libraries conform to **UCAN v1.0.0-rc.1**"; crate `ucan = "0.8"`; contains a `varsig` crate | "Work in progress… **This code has not been formally audited**" (its own README). 94 stars, 102 commits, still pushed to (2026-06) — but **no GitHub release since v0.4.0 in June 2023**: the entire rc.1 line is unreleased. The reference Rust implementation in lineage, mid-migration from the 0.10 JWT generation | +| [pq-ucan](https://crates.io/crates/pq-ucan) 0.1.3 (ekayana-labs, Rust) | **Final 1.0.0** — `decode` accepts the released `ucan/...@1.0.0` tags; rc.1 tags only under an explicit `DecodeOptions` flag. Full delegation + invocation + policy language + execution-time chain validation; interops with the WG's fixtures | Pre-release, not externally audited. `no_std`+alloc core. Extras beyond spec: optional replay guard, a revocations set (`Validator::check_revocation`), `max_proofs` cap (UCAN itself has none). Builders refuse to sign until expiry and nonce are chosen. One sharp edge documented by the implementer: the policy `like` operator compares text literally per spec, so `/data/h1/*` matches `/data/h1/../../../etc/passwd` — **path args must be normalized before validation** | +| [go-ucan](https://github.com/ucan-wg/go-ucan) (WG, Go) | Delegation spec as immutable DAG-CBOR/varsig tokens with a full policy package — but its own worked examples emit `ucan/dlg@1.0.0-rc.1` | The WG's most actively *released* implementation (v1.0.1 2025-02 → v1.1.0 2025-10 → v1.2.0 2026-09); the rc.1 tags in its examples corroborate the tag-transition state of the WG's own code | +| [ucantone](https://github.com/alanshaw/ucantone) (Go, Alan Shaw — Storacha) | UCAN 1.0 including a **promise** package | The most complete 1.0 implementation found, in Go, from the production ecosystem rather than the WG org | +| ts-ucan (WG, TypeScript) | 0.9/0.10-era JWT library; the v0.10 update stalled in draft | Legacy. Production JS does not use it (see ucanto). A fresh third-party JS package implementing Delegation 1.0 appeared in Nov 2026 (`@haverstack/ucan`), evidence new implementers are targeting the final spec directly | +| [ucanto](https://github.com/storacha/ucanto) (Storacha, JS) + go-ucanto | **0.10-era semantics** (`can`/`with`/`nb` caveats) as an RPC framework | Production — §10. The model is proven at scale; the 1.0 wire format is not what production runs | +| Others | SpruceID's `ssi` crate carries an `ssi-ucan` module (0.x generation); a third-party Python profile (`tba-protocol-ucan`, Nov 2026) implements the `ucan/dlg@1.0.0` / `ucan/inv@1.0.0` wire tags for a restricted Ed25519 profile (linear chains ≤16, finite expiries, equality predicates) | Long tail of partial/profile implementations — a good sign for the spec's implementability, none of them a dependency to build an estate on | + +Algorithm coverage in Rust today: pq-ucan covers Ed25519, ES256 (P-256), +ES256K per spec, plus **ML-DSA-44/65/87** (FIPS 204) via *provisional* +self-describing varsig headers — post-quantum principals "as an ordinary +algorithm," intended for deployments controlling both ends. **No ES384 / +P-384 in either Rust implementation** (§2). + +## 9. Production evidence — Storacha, and what it taught + +Storacha (the web3.storage successor, w3up) is the existence proof, and the +invocation spec itself cites **ucanto** as "a production system that uses +UCAN as the basis for an RPC layer" ([invocation spec](https://github.com/ucan-wg/invocation)). +The shape: a **Space** is a `did:key` principal (the resource); an **Agent** +is the client's key; an **Account** (`did:mailto:…`) delegates to the agent +at login, and that delegation is *stored by the service* so any device can +reclaim it via email verification — "password reset" for capabilities. +ucanto adds what an RPC system needs: declarative capability definitions +(≈ routes), providers bound into services, a validation system, batched +invocations, pluggable transports (HTTP + CAR encoding in production), and +**signed receipts** — a receipt reader validates the executor's signed +result, i.e. §4's Receipt concept in production form +([ucanto](https://github.com/storacha/ucanto)). Storacha's documented +integration patterns (client-server, delegated, user-owned spaces) are all +delegation-graph shapes, and its CLI defaults to generating an Ed25519 key +([Storacha docs](https://docs.storacha.network)). + +What production added that the WG specs do not say — the most valuable part +of this section for the estate: + +1. **`ucan/attest` sessions.** Principals that cannot sign (a `did:mailto` + account) create delegations with a blank signature; a trusted authority + (the service) issues a `ucan/attest` delegation whose caveats name the + delegation's CID, and validators accept the pair. Specified in + Storacha's own w3-session spec, implemented in ucanto's validator + (`verifySession`, with a `SessionEscalation` error when neither + attestation nor DID-key resolution succeeds). Lesson: *real identity + systems include principals that can't hold keys; the bridge is an + attestation capability from an authority — an estate with a CA/IdP + already owns exactly that authority.* +2. **`ucan/conclude`.** Receipts are represented as a special UCAN + capability — production folded §4's receipt back into the token system. +3. **Revocation in production is a server hook.** ucanto server v9.0.0+ + lets a server reject explicitly revoked delegations — an + application-level deny-list consulted at validation time. Nobody runs + the revocation spec's gossip model; the resource's agent checks a list, + exactly the "near-ACL for single-source-of-truth resources" outcome the + revocation spec predicts. +4. **Delegation storage/retrieval is a service.** The specs declare token + resolution "transport specific"; Storacha filled the gap with service + endpoints (`access/claim`, `access/delegate`) that store delegations + and release them after out-of-band (email) confirmation. Any estate + deployment needs the equivalent — for us, the broker. +5. **Ergonomics gaps are real at the seams.** A documented third-party + account (meje.dev, "An up-close look at UCANs in the wild") hit the + account-level vs space-level capability split: `plan/get` is scoped to + the account DID while the CLI can only mint space-scoped delegations + and refuses account capabilities; Storacha's engineers confirmed the + workaround is dropping to `@ucanto/core` and hand-building the + delegation + proof chain in a script. At login the CLI agent receives a + root delegation granting `*` on `ucan:*` — essentially everything — + plus the service's attestation. Lesson: *the model composes; the + tooling for scoping authority across subject boundaries lags, and + production systems quietly hand out root-shaped grants at bootstrap.* + An estate adopting UCAN should budget for its own minting tooling and + treat bootstrap grants as a design surface, not a default. + +Fission is the second production data point, historically: Webnative/ODD +and WNFS ran 0.9-era UCANs for user-owned file systems before the company's +April 2024 shutdown; the protocols and WG editorship survived the company, +which is itself evidence about governance risk (§1) — the spec outlived +its originating firm, but pace since has been WG-volunteer pace. + +## 11. Estate fit, concretely + +### 11.1 `did:key` Ed25519 = iroh NodeId = p2panda author + +The mechanics: an Ed25519 `did:key` is `did:key:z6Mk…` — multibase +base58btc over the multicodec varint for `ed25519-pub` (0xed) followed by +the raw 32-byte public key. An iroh **NodeId is the same raw 32-byte +Ed25519 public key** (rendered base32/hex in iroh's own surfaces). A +p2panda author ID is likewise the author's Ed25519 verifying key. So one +keypair is, without any translation layer: + +- the seat's **transport endpoint** (iroh NodeId — reachable, encrypted, + NAT-traversed by the transport the estate is already choosing, #13752); +- the seat's **replication identity** (p2panda author); +- the seat's **UCAN principal** (issuer, audience, subject). + +What that buys, concretely: delegating authority *to a seat* is delegating +to the exact key that will terminate the connection and sign the +operations — there is no binding problem between "who may" and "who is on +the wire," no certificate mapping table to keep in sync, and a delegation's +`aud` is checkable against the transport peer ID at connection time for +free. Delegations can be delivered over the same channel they authorise. +What it does not buy: anything for the P-384 world (§2) — the IdP CA stays +the enrolment layer that vouches for seat keys, and UCAN operates beneath +it. That is a clean layering, but it is ours to build: UCAN has no opinion +about how a `did:key` becomes trusted, only about what holders can prove. + +### 11.2 UCAN over the fleet broker — dispatch authority to ephemeral Actions runners, vs Biscuit for this job + +The job (from the fleet-actions-exec design, #13774): the central +coordinator hands a short-lived exec session inside a GitHub Actions +runner to an agent; the runner proves it is inside the run (GitHub OIDC), +receives commands through the broker, under a lease with a hard max +lifespan; no connection material may appear in public logs; sessions must +survive brief disconnects. Head to head for *this* job: + +| Axis | UCAN 1.0 | Biscuit | +|---|---|---| +| Token binding | Delegation names its `aud`; exercising it requires an **invocation signed by the audience's key**. A leaked delegation alone is useless. The runner generates an ephemeral keypair; its DID is the audience; the OIDC proof binds run → key at handoff | **Bearer token**: whoever holds it, uses it. Audience binding is a check you add; there is no invocation object to sign | +| The work order | The invocation *is* the work order: signed, content-addressed **Task ID = CID{sub, cmd, args, nonce}**, minutes-scale `exp`, `cause`/`meta` carry the session handle, workflow id + run attempt. Receipts give signed provenance for what ran | The request is out-of-band (HTTP); the token authorises it by convention. Provenance/receipts are the broker's own logging | +| Attenuation for budgets | Command-prefix narrowing + policy accumulation over args. Policies are a jq-subset over the invocation's args — a budget must be shaped *into* the args to be policed | **Datalog checks are strictly more expressive** for data-dependent conditions (e.g. Blacksmith-minute budgets as facts evaluated at verification) — Biscuit's home turf | +| Expiry | Structural: `exp` required-or-explicitly-null, chain-intersected, invocations minutes-lived by recommendation | Idiomatic: a `time` check the author must remember to include | +| Revocation at the broker | Revoke-by-CID set consulted at validation; broker is online, so freshness is free. Cost identical in shape to Biscuit's | Per-block revocation-ID deny-list; same online lookup | +| Implementation risk today | **High**: rc.1 reference crate (unaudited) or third-party pre-release for final tags (§8) | **Low**: `biscuit-auth` 6.0 is the reference implementation, production-hardened (Clever Cloud/Outscale/Pulsar), official WASM build for the Workers surfaces | +| Fit with the rest of the estate | Same Ed25519 keys as transport/auth everywhere else (§11.1); chains extend naturally seat → coordinator → runner → sub-agent with provenance intact | A second, unrelated token system scoped to this one surface; attenuation/expiry semantics differ from whatever the agent-to-agent layer uses | + +Verdict for this job: **UCAN is the better-shaped tool** (audience-bound +authority + a signed work order with a content-addressed ID is almost +literally the coordinator-handoff design), **Biscuit is the safer +dependency today**, and its Datalog genuinely wins on budget-style +policies. A coherent split exists: Biscuit (or the broker's existing +tokens) as the broker's *internal* dispatch gate where policy richness and +maturity matter, UCAN as the authority agents hand *each other* where +provenance chains and transport-key identity matter. Forcing one winner +for both jobs would sacrifice something real either way. + +### 11.3 UCAN carried in p2panda operation extensions + +This composition is designed-for from both sides. p2panda's own +high-level docs name Meadowcap and **UCAN** as external capability systems +integrable via header extensions "for permission checks and delegated +access control" — p2panda-auth is a group-membership CRDT and deliberately +not a delegation system ([p2panda note](p2panda.md) §3). The UCAN core +spec's CRDT section (§4 above) describes exactly the carrying pattern. +Mechanically: a p2panda operation's extension carries the invocation (or +its CID) plus the proof CIDs; validators resolve delegations from a local +CID-indexed store — and both the delegation store and the revocation set +are append-only, content-addressed sets, which is to say they replicate +with the same log-sync machinery as everything else in p2panda, or ride a +dedicated topic. Costs: every validating peer needs the store (storage +grows with delegation count; expired entries are evictable), validation +adds signature checks per operation, and the group layer (p2panda-auth) +and the capability layer (UCAN) must be reconciled by application policy — +groups say who is *in*, UCAN says who may *do what*, and the estate +decides how they compose (the natural read: group membership gates sync; +UCAN gates operation acceptance). No other candidate in the programme has +both sides of this composition pre-designed. + +### 11.4 UCAN vs Meadowcap vs Keyline as the delegation layer + +Same axes as the sibling notes ([Willow/Meadowcap](willow-meadowcap.md), +[Keyhive/Keyline](keyhive-subduction.md)): + +| Axis | UCAN 1.0 | Meadowcap | Keyline (Keyhive) | +|---|---|---|---| +| Shape | Certificate chains, presented as proofs with each invocation | Certificate chains, area-scoped, travel with each entry | **No chains**: a CRDT *set* of delegations/revocations; authority is derived by evaluating the whole set (stratified Datalog) | +| What authority is over | subject × command × policy-over-args — computation-shaped (verbs, RPC) | subspace × path-prefix × time-range, read/write only — data-shaped | subject scopes (incl. roles as first-class nodes) × power ladder Relay (§1.4): whoever holds a + route blob can address messages to that route. Possession is the whole + credential — transferable by copying, revocable only by the route's + owner tearing the route down and publishing a fresh blob. +- There is **no group or membership abstraction** in the framework. Apps + build groups out of shared DHT records and shared secrets — OpenArchive's + Save backend does exactly this: a group is a DHT record whose owner + keypair and a ChaCha20Poly1305 shared secret are handed to every member, + and joining means receiving those secrets out of band + ([Save DWeb backend privacy overview](https://hackmd.io/@s74XZjUBQDuPPS04AgPvow/HkacodHgyx)). + +Verdict on this axis: **Veilid has capability-*shaped* addressing (route +blobs) and key-scoped write slots (schemas), but no capability system** in +the sense the rest of this investigation uses the word — nothing comparable +to Meadowcap areas, Keyline delegation, UCAN/Biscuit tokens, or capnp +facets. Auth would be entirely ours to build, same as on raw iroh. + +## 1.4 Transport, routing, and NAT traversal + +- Transports are **UDP, TCP, WebSocket, and WebSocket Secure** — notably + **no QUIC** + ([developer book, print edition](https://veilid-developer-book-8b0039.gitlab.io/print.html)). +- Two routing privacy mechanisms, which are the product's reason to exist: + - **Safety routes** protect the *sender*: a routing context flag (on by + default) that makes Veilid build a multi-hop route through other nodes + for outbound operations, with tunable hop count, stability, and + sequencing preferences + ([docs.rs RoutingContext](https://docs.rs/veilid-core/latest/veilid_core/struct.RoutingContext.html)). + - **Private routes** protect the *receiver*: the app allocates a route, + receives an opaque **route blob**, publishes the blob somewhere (usually + a DHT record); a sender imports the blob to obtain a RouteId and can + then AppMessage/AppCall the route's owner **without learning its NodeId + or IP address**. Routes churn as the network moves; the owner must + watch for `RouteChanged` events and re-publish fresh blobs + ([developer book, Private Routing](https://veilid.gitlab.io/developer-book/concepts/private-routing.html)). +- Live messaging is small and RPC-shaped: `app_call` / `app_message` carry + **at most 32,768 bytes** per message + ([docs.rs RoutingContext](https://docs.rs/veilid-core/latest/veilid_core/struct.RoutingContext.html)). + Bulk transfer is the app's problem (or, in Save's case, iroh-blobs'). +- NAT traversal is a named subsystem, **VICE** (Veilid Internet + Connectivity Establishment): STUN-like public-address detection performed + *in-network* (no specialised STUN servers), then signalling through each + node's chosen inbound relays to negotiate **reverse connections and UDP + hole punching**, falling back to TURN-like **inbound relaying** through + the same peer nodes when direct establishment fails. Nodes classify their + own NAT situation into dial-info classes (Direct, Mapped, FullConeNAT, + Blocked, AddressRestrictedNAT, PortRestrictedNAT) and pre-validate dial + info ahead of connection time + ([developer book, NAT Traversal](https://veilid.gitlab.io/developer-book/concepts/nat_traversal.html), + [dial_info_class.rs source](https://docs.rs/veilid-core/latest/src/veilid_core/network_manager/types/dial_info_class.rs.html)). + Relays are ordinary volunteer nodes (`RLAY`/`SGNL` capabilities), not + operated infrastructure — an altruistic-relay model, with the bootstrap + nodes as the only foundation-run rendezvous. +- The privacy routing is a **latency and throughput tax by construction**: + default-routed traffic takes extra hops through strangers' nodes. A + third-party 2026 evaluation of Veilid as an agent-network transport + concluded the privacy properties are compelling but deferred adoption, + citing API instability, latency overhead, and DHT limits + ([subspace-transceiver evaluation](https://github.com/banebot/subspace-transceiver/blob/HEAD/specs/planning-artifacts/veilid-evaluation.md)). + +## 1.5 The DHT — Veilid's real data primitive + +The DHT is "the central asynchronous data communication service" and the +discoverability layer everything else hangs off +([developer book, Distributed Hash Tables](https://veilid.gitlab.io/developer-book/concepts/dht.html)): + +- **Kademlia-shaped**: XOR distance between record keys and node identities; + a record is stored on the nearest node plus the nearest four neighbours + (replication factor ~5); lookups are an internal "fanout" walk + ([developer book, DHT](https://veilid.gitlab.io/developer-book/concepts/dht.html)). +- A **record** = a schema + up to a schema-defined set of numbered + **subkeys**, total size (schema + all values) **≤ 1 MiB**. The record key + is a hash of the schema digest and the owner's public key — you cannot + choose a record key, and the schema can never change + ([developer book, DHT](https://veilid.gitlab.io/developer-book/concepts/dht.html)). +- **Conflict model is per-subkey last-writer-wins by sequence number**: + every subkey value is signed by its writer and carries a sequence number; + a storage node accepts a write only if its sequence exceeds the one held. + Two schemas exist: `DFLT` (owner writes all subkeys) and `SMPL` (owner + plus named writers, each with an *exclusive* subkey range) — i.e. + multi-writer records are made safe by **partitioning**, never by merging. + There is no CRDT, no log, no history: a subkey is a single-writer register + ([developer book, DHT](https://veilid.gitlab.io/developer-book/concepts/dht.html)). +- One sharp primitive worth naming: `min_seqnum` lets a writer **burn a + subkey's remaining write budget**, up to writing at the maximum sequence + number, which closes the subkey to all future writes from anyone, + permanently — a one-shot commitment slot ("a cast vote, a published + commitment, a 'this log is frozen' marker") + ([developer book, DHT](https://veilid.gitlab.io/developer-book/concepts/dht.html)). +- **Watches**: a node can watch subkey ranges and receive `ValueChanged` + notifications; nodes with `DHTW` can watch on behalf of others; watches + are leased and renewed by the watcher (the 0.5.8 storage manager runs an + outbound watch manager with renewal timings) + ([docs.rs RoutingContext](https://docs.rs/veilid-core/latest/veilid_core/struct.RoutingContext.html), + [veilid-core 0.5.8 storage_manager source](https://docs.rs/crate/veilid-core/latest/source/src/storage_manager/mod.rs)). +- **Offline behaviour**: DHT writes may be deferred when the node is + offline (`AllowOffline`, default true) and flushed later; records are + "rehydrated" back into the DHT after absence. The store-and-forward + pattern is therefore *write it into a DHT record the recipient will read + later* — which is precisely how VeilidChat delivers messages to offline + contacts. There is no mailbox/queue protocol beyond that + ([veilid-core API docs](https://docs.rs/veilid-core/latest/veilid_core/), + [developer book, DHT](https://veilid.gitlab.io/developer-book/concepts/dht.html)). +- **Encryption of values**: historically the app's job; **v0.5.0 (Dec 2025) + added "automatic default record encryption"** and DHT transactions + ([Veilid's release announcement](https://bsky.app/profile/did:plc:3ik6gfryhy76repwatdkpzq3)). +- **Local storage**: the node's own record/table stores are an encrypted + KV — **SQLite on native, IndexedDB on WASM** — plus a ProtectedStore over + OS keychains for secrets + ([ComfyCon 2025 slides](https://app.yjmbo.net/veilid-comfycon2025/index.html)). + Note the shape: Veilid *contains* SQLite, but as its own sealed silo — + our Turso/libsql stores neither feed it nor read from it. + +## 1.6 Maturity — what "supported to some degree" concretely means + +- **Release cadence is real and current**: `veilid-core` 0.5.8 shipped + 2026-11-02; the 0.5 line began 2025-12-22 (0.5.0/0.5.1) after a steady + 0.4.x series through 2025 (0.4.1 Oct 2024 → 0.4.8 Aug 2025). Releases ship + simultaneously as crates, PyPI packages, and Debian/RPM packages, with + weekly builds for the apps + ([docs.rs veilid-core versions](https://docs.rs/crate/veilid-core/latest), + [Veilid beta page](https://veilid.com/chat/beta/)). +- **Still pre-1.0, and the project says so by its versioning**: minor + releases carry breaking API changes (the 0.5.0 release notes headline API + changes and new DHT features). The project has publicly pointed at a + **1.0 "next August"** in its 0.5.x announcements; as of this writing the + current line is 0.5.8, so 1.0 has not landed + ([release announcement thread](https://bsky.app/profile/did:plc:3ik6gfryhy76repwatdkpzq3), + [docs.rs versions](https://docs.rs/crate/veilid-core/latest)). +- **Flagship app is a beta tech demo**: VeilidChat is 1-to-1, text-only, + "currently in early beta", distributed via TestFlight / Play beta and + weekly builds — three years after launch it remains the reference demo, + not a production messenger + ([veilid.com beta page](https://veilid.com/chat/beta/), + [AlternativeTo listing](https://alternativeto.net/browse/all/?mf=encrypted-chat,end-to-end-encryption&p=3)). +- **One genuine third-party production-ish deployment exists**: + OpenArchive's **Save** app (human-rights media archiving) runs a DWeb + storage backend **in beta production** that uses **Veilid for encrypted, + onion-routed peer connections and iroh for blob storage, replication and + verification**, with custom glue architecture written by Hypha Worker + Co-operative to bridge the two; their 2025 white paper documents a + protocol comparison that chose exactly this pair + ([OpenArchive, Decentralization as Human Rights Defense](https://www.open-archive.org/news/decentralization-as-human-rights-defense-in-an-ai-shaped-world), + [OpenArchive/Hypha white paper](https://www.open-archive.org/pdf/Mobile_DWeb_Archiving.pdf)). +- **Network size is unpublished and evidently small**: the project + publishes no node statistics; independent 2026 assessments describe a + "tiny ecosystem" with "no large-scale third-party deployment data", in + contrast to libp2p's and iroh's six-figure networks + ([OCM mesh research, 2026-05](https://github.com/opencircuitdev/opencircuitmodel/blob/HEAD/docs/superpowers/research/2026-05-08-mesh-distributed-compute.md)). +- **Documentation is self-described as unfinished**: the developer book is + "a work in progress" and the internals book is still "forthcoming" + ([developer book introduction](https://veilid.gitlab.io/developer-book/)). +- Governance/support shape: a small foundation team (the two DEF CON + presenters remain the public faces), donation-funded, community on + Discord. Serious, credible, long-lived people — and a bus factor and + funding base far thinner than libp2p's or even p2panda's grant stack + ([veilid.com FAQ](https://veilid.com/faq/)). + +## 1.7 What Veilid pointedly does NOT do + +No QUIC. No bulk/streaming data plane (32 KB app messages; the block store +capability is unimplemented). No sync semantics beyond single-writer +registers. No groups. No capability delegation/attenuation/revocation. No +identity beyond key possession. No Cloudflare story at all (a Veilid node +is a long-lived UDP/TCP peer; nothing runs in Workers — the WASM build is a +browser *client* of the Veilid network, not an edge component). No +performance story for infrastructure traffic — privacy hops are the point. + +--- + +# Part 2 — IPFS / libp2p in general + +## 2.1 The family's current shape + +IPFS is a **content-addressed block distribution system**: data is chunked +into a Merkle-DAG, addressed by CID (multihash digest + codec), announced +via provider records on the **Amino DHT** (the public Kademlia network), +fetched with **Bitswap**, and named mutably — barely — by **IPNS**, signed +sequence-numbered records that point a key at a CID. HTTP gateways make the +whole thing readable by browsers. The reference implementation is **Kubo** +(Go), the shared library stack is **Boxo**, the JS implementation is +**Helia**, and the production gateway implementation is **Rainbow** +([Kubo v0.43.1 release](https://github.com/ipfs/kubo/releases/tag/v0.43.1)). + +libp2p, spun out of IPFS, is the **modular networking suite** underneath: +multiaddr addressing, PeerId identity (a hash of the public key; Ed25519 +keys inline), transports (TCP, QUIC-v1, WebSocket, WebRTC, WebTransport), +channel security (Noise as the baseline, or TLS 1.3 with a key-binding +certificate extension), yamux multiplexing, and a protocol shelf — identify, +ping, fetch, **kad-dht**, **gossipsub** (v1.0–1.3, with peer scoring from +v1.1), rendezvous, **AutoNAT**, **Circuit Relay v2**, and **DCUtR** hole +punching +([libp2p spec index, as summarised from the specs repo](https://github.com/ahmed-abdul-rahman/de-chat/blob/HEAD/.cursor/skills/libp2p-spec/SKILL.md), +[rust-libp2p on lib.rs](https://lib.rs/crates/libp2p)). +Crucially, NAT traversal in libp2p is **assembled, not included**: AutoNAT +to learn your reachability, a relay reservation to be contactable, DCUtR to +upgrade relayed connections to direct ones — three protocols the operator +must each wire and tune +([libp2p spec index](https://github.com/ahmed-abdul-rahman/de-chat/blob/HEAD/.cursor/skills/libp2p-spec/SKILL.md)). + +## 2.2 The 2026 stewardship break (the family's headline fact) + +- **Kubo v0.43 (and the v0.43.1 fix release, Sep 2026) is the last Kubo + from the Shipyard team.** Protocol Labs declined to renew Shipyard's + funding; the team's IPFS work **ended 2026-09-30**. Shipyard's + announcement lists **Kubo, Helia, Boxo, Rainbow, IPFS Desktop, IPFS + Companion** and others as losing dedicated maintainers, and the public + gateways and bootstrap infrastructure it operated as winding down; + Protocol Labs describes a transition to lighter-weight stewardship via + foundation grants to independent maintainers + ([operator notes on the 0.43.1 release and the Shipyard announcement](https://www.tismtek.com/articles/kubo-0-43-1-bootstrap-off-switch.html), + [IPFS Desktop releases, carrying the same notice](https://github.com/ipfs/ipfs-desktop/releases)). +- The hosted layer around IPFS had already been dying in sequence: + **Cloudflare's public gateway stopped serving IPFS on 2024-08-14** + (traffic handed to the foundation gateway — which is part of what is now + winding down), nft.storage Classic ended uploads in 2024, Estuary shut + down in 2023, and **Infura's IPFS service shut down in August 2026** + ([gateway/pinning graveyard](https://wiki.bitsy.services/wiki/cs/ipfs/pinning/providers/), + [Cloudflare's transition post](https://static.obstracts.com/feed/aee1ee27-a4ba-526d-97e3-c955ffc172d9/posts/a28f50b6-0933-5061-9e42-f32bcbef4ddc/a28f50b6-0933-5061-9e42-f32bcbef4ddc_cloudflares-public-ipfs-gateways.pdf)). +- **libp2p is not in the same position.** Its maintenance is distributed + across Protocol Labs (go-libp2p, v0.47 in Jan 2026) and the production + client teams that depend on it; rust-libp2p shipped facade **0.57.0 in + Sep 2026** (0.57.1 followed in October), draws ~718k downloads/month, and + is used by ~757 crates + ([lib.rs, libp2p](https://lib.rs/crates/libp2p), + [libp2p.io projects feed](https://www.libp2p.io/projects/)). + Any sentence about "IPFS maintenance" that lumps libp2p in with Kubo is + now wrong in both directions. + +## 2.3 Where the public network is healthy, and where it is not + +Healthy: + +- **The protocol engineering finally landed.** The provider-record system + was IPFS's best-documented scaling failure: records expire after 48h, + Kubo reprovides every 22h, and the legacy provider needed a ~15-second + DHT walk *per CID*, so pinsets beyond roughly 5–10k CIDs silently stopped + being findable while still pinned locally + ([content routing notes](https://wiki.bitsy.services/wiki/cs/ipfs/content-routing/), + [Provide Sweep write-up](https://guillaume.michel.id/posts/dht-provide-sweep/)). + **Provide Sweep** (default since Kubo 0.39) batches announcements by + keyspace region — **97% fewer DHT lookups** — and Optimistic Provide cut + publication time ~10×; the DHT bottleneck for self-hosters is largely + engineered away + ([Kubo v0.39.0 release](https://github.com/ipfs/kubo/releases/tag/v0.39.0), + [IPFS newsletter](https://newsletter.ipfs.tech/archive/u1f333-ipfs-newsletter-mainnet-improvements-web/)). + The bitter footnote is that this landed in the final year of the team + that built it. +- **libp2p's production base is the largest in p2p.** Ethereum's consensus + layer runs gossipsub in every client implementation; rust-libp2p's named + users include Lighthouse (Ethereum consensus), Forest (Filecoin in Rust), + fuel-core, and Espresso's HotShot + ([lib.rs, libp2p](https://lib.rs/crates/libp2p), + [ethereum.org on rust-libp2p](https://ethereum.org/developers/tools/rust-libp2p/)). + Even there, gravity has limits: Parity built **litep2p**, a leaner + libp2p-compatible stack (v0.13.x, actively released), rather than keep + carrying rust-libp2p inside Polkadot — the ecosystem's own heavyweight + user concluded the full stack was more than it wanted + ([libp2p.io projects feed](https://www.libp2p.io/projects/)). + +Struggling: + +- **Retrievability and replication are thin.** A 2025 measurement study + (three years of traffic, 20B+ messages) found only **2.71% of files + replicated more than 5 times**, and **5% of peers hosting over 80% of + content**, with centralisation *growing* over the three years + ([WWW '25, Centralization in the Decentralized Web](http://tddg.github.io/assets/pdf/www25-ipfs-dedup.pdf)). + Content on IPFS persists because someone specific pins it, not because + "the network" keeps it. +- **The maintainers themselves centralised the routing.** The NSDI '24 + paper by IPFS's own team documents the three hybrid components they had + to build — IPNI indexers, Hydra booster DHT nodes, HTTP gateways — + because pure-DHT lookup latency and publication cost (measured at over a + minute per publication in the worst cases) didn't work at scale + ([The Eternal Tussle, NSDI '24](https://tysong.github.io/files/NSDI24.pdf)). +- **Hosting concentration is a live security property**: a 2026 routing + study found providers concentrated in a few clouds/ASes such that a + single malicious AS could block >75% of content from 57% of requesters + ([Routing Centralization and Censorship in IPFS](https://securalab.org/publications/pdfs/SSS26routing.pdf)). +- **Mutable state was never really solved**: IPNS gives one signed pointer + per key with sequence numbers — a register, not a data model. Everything + else (logs, CRDTs, databases) is an application-layer construction on top + of immutable blocks, which is why every serious IPFS app ends up building + its own sync layer anyway. + +## 2.4 Auth and capability story + +There essentially isn't one, and the family is honest about that by +omission. A PeerId proves key possession inside the Noise/TLS handshake; +provider and IPNS records are signed by their keys; kad-DHT record +validation covers IPNS and public-key records. Beyond that: **no +delegation, no attenuation, no groups, no revocation, no access control on +content** — a CID is a bearer address readable by anyone who learns it, and +confidentiality means encrypt-before-you-add with key distribution as your +own problem. (It is not an accident that the most serious "IPFS storage +with authorization" system in production, Storacha, bolts UCAN on top — +see the UCAN material in [capnp-and-survey.md](capnp-and-survey.md).) +libp2p's one access-control-shaped feature, the private-network PSK +(`pnet`), is a single shared-secret fence for a whole swarm — the opposite +of per-principal capability discipline. + +## 2.5 Why iroh left — the primary-source version + +iroh *began* as a Rust implementation of IPFS with working interop. The +team's own retrospective gives three concrete reasons for the break +([The road to iroh 1.0](https://aggr.aymericbeaumet.com/items/lobste-rs/2026-10-16-the-road-to-iroh-1-0/)): + +1. **A narrow real use case was unbuildable on the stack.** Provisioning a + new DeltaChat device meant moving one large resumable blob under hard + disk/network constraints; the IPFS-based implementation couldn't hit + acceptable network performance and dragged in "a very large dependency + tree". The from-scratch QUIC + BLAKE3 side project outperformed the main + project on the thing that mattered. +2. **rust-libp2p ergonomics.** With two days to add networking to a demo, + "adding networking via rust-libp2p seemed impossible"; quinn (QUIC) + was, in their words, "an absolute joy". The replacements were + one-for-one simplifications: **multiaddrs → an Ed25519 public key; + multihashes → BLAKE3; many transports → just QUIC.** +3. **Scope philosophy.** Per the n0 CTO, quoted in interview: p2p projects + default to "boil-the-ocean" — a DHT, transports, pubsub, RPC — and "no + one wants the nginx team to ship postgres". iroh deliberately kept only + the transport layer and pushed sync/blobs/gossip up into composable + application protocols + ([LambdaClass interview with the iroh team](https://blog.lambdaclass.com/the-wisdom-of-iroh/)). + +Independent adopters echo the same trade from the other side: a 2025 +production postmortem chose iroh over libp2p for a gossip layer citing +exactly the "**configuration tax**" — every libp2p deployment is a snowflake +(yamux vs mplex, Noise vs TLS, mDNS vs seeds, gossipsub versions), while +iroh ships one opinionated NAT-traversal story +([iroh in production: encrypted-note gossip](https://blog.skill-issue.dev/blog/vanta_iroh_gossip_in_production/)). +And the bet has since hardened: **iroh 1.0 shipped 2026-06-15** with +wire-protocol stability commitments, and n0 reports >200M endpoints created +on its public relays in the preceding 30 days +([TechTimes on the iroh 1.0 release](https://www.techtimes.com/articles/318490/20260616/peer-peer-library-iroh-10-ships-dial-devices-key-not-ip-address.htm)). + +What libp2p/IPFS would still give this estate that iroh does not: + +- **Joinable public networks.** Ethereum, Filecoin, and the IPFS content + network exist *now*, with strangers in them. iroh gives you a superb + dial tone and no one to call but your own endpoints. +- **Content distribution at public scale with integrity built in**: a CID + published once is fetchable from any provider, deduplicated network-wide, + and readable through any HTTP gateway — a distribution property no + key-addressed transport provides. +- **Browser reach**: WebRTC/WebTransport transports and verified-fetch in + the browser are libp2p/IPFS home turf. +- **gossipsub with a decade of adversarial tuning** (peer scoring, mesh + maintenance) for open-membership broadcast — a different beast from + iroh-gossip's smaller-scale topic swarms. + +What it costs: the assembled NAT stack, the configuration surface, the +dependency weight, an identity format (PeerId/multiaddr) that would sit +*beside* our Ed25519/iroh identity rather than being it, and — for the IPFS +half — adopting infrastructure whose core team was disbanded this year. + +--- + +# Part 3 — Estate fit, axis by axis + +| Axis | Veilid | IPFS / libp2p | +|---|---|---| +| Identity & keys | Bare Ed25519 NodeId; versioned cryptosystems (VLD0); no names, no CA bridge | PeerId = key hash (Ed25519 inline); IPNS keys for naming; no CA bridge | +| Capability model | **None.** FourCC feature flags misnamed "capabilities"; DHT schema writer slots (immutable, key-possession); route blobs as bearer tokens | **None.** Key possession in Noise/TLS; PSK swarm fence; UCAN etc. must be bolted on (Storacha precedent) | +| Groups | None — apps fake it with shared records + shared secrets | None — swarms/topics only | +| Encryption | Strong in transit (VLD0 AEAD, signed envelopes) + IP-hiding routes; at-rest local stores encrypted; DHT values app-encrypted, default encryption since 0.5.0; **no PQ yet** | In transit via Noise/TLS; content is plaintext-by-default, encrypt-it-yourself; integrity (hash addressing) is the real guarantee | +| Transport & NAT | Own stack (UDP/TCP/WS/WSS, **no QUIC**); VICE: in-network STUN-like detection, signalled reverse-connect + hole punch, peer relays; privacy hops add latency | Broadest transport menu incl. browsers; NAT = AutoNAT + Relay v2 + DCUtR, assembled and tuned by the operator | +| Sync semantics | Per-subkey single-writer LWW registers, ≤1 MiB/record, watches; no log, no CRDT, no merge | Immutable DAG + provider records; IPNS single-pointer register; all mutable sync is app-built | +| Offline behaviour | DHT store-and-forward is the native pattern; deferred offline writes; record rehydration | Fetch-when-connected; pinning for persistence; nothing is delivered to an offline peer | +| Storage fit (SQLite/Turso) | Contains its own encrypted SQLite silo (native); Turso neither feeds nor reads it | Kubo uses flatfs + LevelDB/Pebble metadata stores; libp2p itself is storage-agnostic; no Turso story | +| Rust maturity | veilid-core 0.5.8 (2026-11), steady cadence, **pre-1.0 with breaking minors** | rust-libp2p 0.57.x, ~718k dl/mo, production users; heavyweight, also pre-1.0 by version, stable in practice | +| Cloudflare fit | None — long-lived p2p node; WASM build is a browser client only | Poor and worsening: Cloudflare exited the gateway business (2024); Workers cannot run Kubo/libp2p natively; R2 already does the useful part (artifact storage) without IPFS | +| iroh relationship | **Competitor as transport; proven complement as privacy layer** (Save runs Veilid routing + iroh data) | **Competitor libp2p rejected by iroh's own team on record; IPFS is a different category (distribution network, not transport)** | +| Spec / interop | Single implementation, single network; spec is the code + developer book | The interop champion: multi-language specs, cross-implementation test suites, existing public networks | +| Project health | Non-profit foundation, donation-funded, small team, steady releases, beta flagship, one real third-party deployment | Split: Kubo/Helia/Boxo/gateways **lost their team Sep 2026**, stewardship transition unproven; libp2p healthy via PL + production client teams | +| Operational complexity | One embedded library + bootstrap dependence; but a second identity space, second NAT stack, second network to monitor | Kubo is a daemon ecosystem of its own; libp2p is a configuration discipline of its own; both duplicate machinery iroh already runs here | + +## 3.1 Could Veilid's DHT be a discovery/rendezvous layer under our protocols? + +Technically yes, and it is the only Veilid-shaped idea that survives +contact with the estate: a seat publishes a small DHT record — "endpoint +hints for key X, current private-route blob, expiry" — and peers watch it. +That is, in fact, exactly the role the DHT plays inside Veilid itself +(route blobs are distributed through it) and in Save's group discovery +([developer book, Private Routing](https://veilid.gitlab.io/developer-book/concepts/private-routing.html), +[Save backend overview](https://hackmd.io/@s74XZjUBQDuPPS04AgPvow/HkacodHgyx)). + +But priced honestly for *this* estate: it means embedding a second, +pre-1.0 p2p stack (second identity space, second NAT traversal, second +network whose bootstrap and relay capacity are donated by strangers) to +obtain a rendezvous function that the #13752 design already gets from +iroh's own discovery (pkarr/DNS + relays we operate) and that the +Cloudflare doors already provide with accounts attached. The one thing it +adds that nothing else in our stack has is **IP-address privacy between +peers** — and the estate's stated hard requirements (no secret material in +logs, capability discipline, self-hosting) never ask for peer-IP anonymity; +our seats are our own machines, not dissident handsets. If a future +requirement does ask for metadata-private rendezvous, the Save composition +is the proven template and Veilid becomes a *sidecar*, adopted for that +requirement — not a substrate. + +## 3.2 Could IPFS be just a distribution channel for artefacts? + +Yes, and this is the only IPFS-shaped idea that survives: publish fleet +release binaries, book sites, or the nix cache as CIDs; anyone (including a +browser via a gateway) can fetch with integrity verification. But measured +against what the estate already runs — R2 buckets, GitHub releases, a +Cloudflare-served nix cache — IPFS adds a *public mirror*, not a missing +capability, and it adds it at the price of running Kubo, maintaining pin +discipline (the replication data says unpinned-by-others content is +effectively single-homed), and depending on gateway infrastructure whose +operator just wound down. As an optional public mirror for release +artefacts it is harmless and occasionally useful; as infrastructure it +would be adopting the family's weakest limb at its weakest moment. + +## 3.3 What adopting either as the base would displace + +- **Veilid as base** displaces iroh *and* p2panda-net while providing + neither QUIC performance nor sync semantics — the estate would rebuild + logs/CRDTs on 1 MiB LWW registers and rebuild auth from nothing, inside a + pre-1.0 API, to gain privacy properties it did not ask for. +- **libp2p as base** displaces iroh and reverses the #13752 design on the + strength of interop with networks (Ethereum/Filecoin/IPFS) the estate + has no requirement to join, at the documented configuration and + dependency cost that made iroh's team and at least one other production + adopter walk away. +- **IPFS as base** is a category error for fleet operations: it is a + distribution network for immutable content, and the fleet's centre of + gravity is mutable, authorized, small-group state. + +--- + +# Verdicts + +**Veilid — complement, narrowly; not an alternate base.** +Real advantages: the only framework in the investigation whose *product* +is metadata privacy (safety/private routes are genuinely well-shaped, and +route blobs are a clean rendezvous primitive); a conservative, versioned +cryptosystem; a Kademlia DHT with watches and an elegant one-shot-subkey +primitive; a Rust core with a steady release cadence and a non-profit +steward; and one real composition precedent (Save) proving it layers under +an iroh data plane. Blockers for this estate: pre-1.0 with breaking minors +and 1.0 still not landed; no capability system (the name notwithstanding), +no groups, no sync semantics, 32 KB messages, no QUIC, no Cloudflare +surface; a small, unpublished-size network and a thin funding/team base; +documentation still in progress. "Supported to some degree" resolves to: +*actively maintained by a small foundation, packaged everywhere, one beta +flagship app, one beta-production third-party deployment* — supported +enough to adopt as a sidecar for a privacy requirement, not enough to bet +the fleet's transport on. + +**IPFS — neither as base; optional public mirror only.** +Its real advantage is unique and should be stated plainly: it is the only +*existing public content-addressed distribution network* — publish once, +fetch from strangers, verify by hash, read from a browser. Nothing else in +this investigation, iroh included, offers that. Its blockers are equally +plain: no auth model, no mutable-state model, persistence-by-pinning +discipline, gateway dependence for web reach, and a stewardship vacuum at +its centre as of late 2026 (Kubo/Helia/Boxo/Rainbow team disbanded +2026-09-30; gateway/bootstrap wind-down; replacement stewardship +unproven). Adopting IPFS as estate infrastructure this year means adopting +an ecosystem mid-transition for a distribution property the estate mostly +already has via R2/GitHub. + +**libp2p — neither as base; keep as the interop escape hatch (survey +verdict stands, strengthened).** +It is the healthiest limb of its family: multi-language specs, the largest +production base in p2p (Ethereum consensus, Filecoin), a mature Rust +implementation with current releases. It would earn its place the day the +estate must *join* an existing libp2p network or ship browser-native peers +at scale. Until then it duplicates — at higher configuration and dependency +cost, per its own alumni's published reasoning — the transport job iroh +already does here with the identity format the estate has standardized on. +Note for the record that even its heaviest historical Rust user, Polkadot, +moved to the leaner litep2p rather than deepen the commitment. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/willow-meadowcap.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/willow-meadowcap.md new file mode 100644 index 000000000..5bad305fb --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/willow-meadowcap.md @@ -0,0 +1,683 @@ +# Willow / Meadowcap — research note + +Family lane for the auth + transport investigation (tracking issue developing-today/code#13779). +Researched 2026-11-23 from primary sources: the specifications at +[willowprotocol.org](https://willowprotocol.org/), the canonical Rust repo +([Codeberg: worm-blossom/willow_rs](https://codeberg.org/worm-blossom/willow_rs/)), +the TypeScript implementations, the n0 iroh experiment, and crates/docs.rs listings. +Every load-bearing claim is linked inline. + +## 0. What this family is + +Willow is a **family of specifications** (not one protocol) for synchronisable, +multi-writer, peer-to-peer data stores, designed by Aljoscha Meyer and Sam Gwilym +(worm-blossom), generalising and formalising the Earthstar data model +([About Us](https://willowprotocol.org/more/about-us/); +[LWN: Offline applications with Earthstar](https://lwn.net/Articles/1005639/)). +Earthstar (TypeScript, since 2020) is being rebuilt on Willow as Earthstar 11; +Willow is the reusable protocol layer underneath it +([Earthstar/Willow spring update](https://opencollective.com/worm-blossom/updates/willow-and-earthstars-sping)). + +The core idea is **naming, not content-addressing, at the protocol level**: +you bind arbitrary payloads to meaningful hierarchical names, and later re-bind +those names to new payloads or to nothing. The authors claim Willow has "the +strongest story for mutability" among comparable protocols precisely because it +"completely eschew[s] content-addressing on the protocol level" +([Comparison to Other Protocols](https://willowprotocol.org/more/willow_compared/)). + +### The data model (spec status: Final) + +Source: [Willow Data Model](https://willowprotocol.org/specs/data-model/index.html). + +- An **Entry** is metadata only: `namespace_id`, `subspace_id`, `path`, + `timestamp` (u64), `payload_length`, `payload_digest`. The payload itself is a + separate bytestring, tracked only via its digest — entries can be reconciled + before (or without ever) moving payloads. +- A **namespace** is a completely independent data universe. A **subspace** is a + partition inside it — intuitively one author's universe. A **path** is a + sequence of bytestring components, filesystem-like (`blog/idea/2`). +- Conflict semantics are filesystem semantics, defined by the **join** of two + stores (same namespace): union, then drop every entry that is *prefix-pruned* + (an entry whose path is a prefix of another's, in the same subspace, with a + newer timestamp) or *superseded* (same subspace + path, older timestamp; + ties broken by greater payload digest, then greater payload length). + Stores form a **join semi-lattice — a state-based CRDT** — so joins are + order-independent and convergence is guaranteed. A store holds **only the + surviving current entries: no history, no log, no tombstones**. +- Timestamps are *claimed*, not proven. The recommended interpretation is + microseconds of TAI since J2000, but logical counters are explicitly allowed. + This is a deliberate, much-discussed design choice + ([Timestamps, Really?](https://willowprotocol.org/more/timestamps_really/)). +- The model is **generic ("higher-kinded")**: namespace/subspace id types, path + limits, hash function, and the authorisation mechanism are parameters. + **Willow'25** ([spec, status: Proposal](https://willowprotocol.org/specs/willow25/index.html)) + is the recommended concrete instantiation: Ed25519 public keys as *both* + NamespaceId and SubspaceId, WILLIAM3 (from the Bab hash family) as payload + hash, path limits of 4096/4096/4096, Meadowcap as the authorisation system. + +### Grouping: 3dRanges, Areas, Areas of Interest, AreaSlices + +Source: [Grouping Entries](https://willowprotocol.org/specs/grouping-entries/). + +Entries are points in a 3D space (subspace × path × timestamp). Groupings: + +- **3dRange**: independent ranges on all three axes (most expressive; breaks + under path encryption because ciphertext order ≠ plaintext order). +- **Area**: the restricted, encryption-friendly grouping — subspace is one + exact id or `any`, path is a *prefix*, time is a range. Areas are closed + under intersection. **Areas are the unit of authorisation in Meadowcap and of + interest in sync.** +- **AreaOfInterest**: an Area plus `max_count` / `max_size` budgets (only the + newest N entries / M payload bytes) — partial-sync resource control. +- **AreaSlice**: an Area cut by a range over the *reconciliation order* + (timestamp, then path, then subspace) so any set can be split into roughly + equal halves — the unit of set reconciliation. + +### Spec family inventory and status + +From the spec pages themselves and the +[site changelog](https://willowprotocol.org/more/changes/): + +| Spec | Status | Notes | +|---|---|---| +| Data Model | **Final** | Core semantics above | +| Meadowcap | **Final** (21 Nov 2025) | Capability system, §2 below | +| Grouping Entries | Final-grade core doc | Areas/AreaSlices vocabulary | +| Willow'25 | Proposal (May 2025) | Recommended parameter set | +| Confidential Sync (ex-WGPS) | **Proposal — design paused** | Being redrafted after the Willow Transport Protocol work; spec page says so explicitly ([Confidential Sync](https://willowprotocol.org/specs/confidential-sync/index.html)) | +| Read Access & Confidentiality (PIO) | Sub-spec of Confidential Sync | Private interest overlap, §5 | +| Region-Based Set Reconciliation | Core technique doc | [RBSR](https://willowprotocol.org/specs/rbsr/) | +| Willow Transfer Protocol (WTP) | Proposal (Oct 2026) | Simpler request/stream protocol, current focus ([WTP](https://willowprotocol.org/specs/wtp/)) | +| Drop Format (ex-Sideloading) | Candidate per changelog; page header reads Proposal | Single-bytestring bundles for sneakernet/email/USB ([Drop Format](https://willowprotocol.org/specs/drop-format/)) | +| Encrypted Willow | Explanatory document, **not a protocol** | What can/cannot be encrypted, §5 | +| Willow URIs | Proposal | `willow://namespace.subspace/path` | +| Encodings | Proposal (Meadowcap encodings: Candidate) | Canonical + relative/private encodings | + +There is no standards-body involvement (no IETF/W3C track); interoperability +means "same parameter instantiation", in practice Willow'25. + +--- + +## 1. Identity & key management + +- **Identity is a bare signature keypair.** In Willow'25, a user *is* an + Ed25519 public key, and that key is simultaneously their SubspaceId + ([Willow'25](https://willowprotocol.org/specs/willow25/index.html)). There is + no account, handle, DID, certificate, or key-directory layer in the family. +- **What a "subspace key" is**: in a *communal* namespace, authority over a + subspace stems from holding the secret key whose public key *is* the + subspace id — you prove authorship by signing entries with it. In an *owned* + namespace, the **NamespaceId is itself a public key** and the namespace + secret key is the root of all authority + ([Meadowcap overview](https://willowprotocol.org/specs/meadowcap/index.html)). +- Meadowcap is **generic over signature schemes** — namespace and user schemes + are separate parameters, and any scheme with the usual + generate/sign/verify shape can be instantiated. Willow'25 pins Ed25519 for + both, but nothing in Meadowcap's security definitions requires Ed25519. + (Relevant to the estate: a P-256/P-384 instantiation is spec-legal, though no + such instantiation or implementation exists today.) +- **No key rotation, no recovery, no multi-device linking, no expiry of + identities** anywhere in the specs. Lose a communal subspace key and that + subspace is permanently read-only history; lose an owned namespace key and + all authority over the namespace is gone. Key custody is entirely the + application's problem. +- Communal vs owned is decided by a parameter function `is_communal(namespace_pk)`. + Willow'25 defines it as "least significant bit of the public key is 0" — so + roughly half of randomly generated namespace keys are communal and half are + owned, and you grind keys until you get the type you want. Elegant, + stateless, and a good example of the family's taste: the type of a namespace + is a mathematical property of its id, needing no registry. + +## 2. Capability model — Meadowcap in detail + +Source: [Meadowcap specification](https://willowprotocol.org/specs/meadowcap/index.html) +(status: **Final** as of 21 Nov 2025). This is one of the most completely +specified capability designs in the local-first field: validity is defined +recursively and precisely enough to implement from the spec alone (two +independent implementations exist, §8). + +### 2.1 What a capability is + +An unforgeable, receiver-bound token answering four questions: *to whom* +(a user public key — the **receiver**), *which access mode* (`read` or +`write` — the only two), *for which entries* (an **Area**: subspace, +path prefix, time range), and *is it valid* (a chain of signatures rooted in +the namespace or subspace owner). A capability is **useless if leaked**: +exercising it requires signing with the receiver's secret key. + +### 2.2 The two roots of authority + +**Communal namespaces** (horizontal model). `CommunalCapability` = +`{ access_mode, namespace_key, user_key, delegations[] }`. With zero +delegations it is a *source capability*: the `user_key` (== subspace id) +owner's authority over their own subspace area. Anyone can create one by +generating a keypair — communal namespaces are permissionlessly joinable, +and *nobody*, not even the namespace key's holder, has authority over other +people's subspaces. + +**Owned namespaces** (top-down model). `OwnedCapability` = +`{ access_mode, namespace_key, user_key, initial_authorisation, delegations[] }`. +The `initial_authorisation` is a signature by the **namespace secret key** +over the first receiver and access mode. With zero delegations the granted +area is the *full area* — the owner can mint a capability for any subspace, +any path, any time. This is the model that maps to managed systems (a fleet, +a company share): one root key, all authority flows from it. + +`McCapability` wraps either variant, and validity additionally checks +`is_communal(namespace_key)` so the two models can never be confused for the +same namespace — presenting an owned capability in a communal namespace (or +vice versa) is invalid by construction. + +### 2.3 Delegation and attenuation — one mechanism + +There is no separate "restriction token" in the final spec (the 2023 +announcement's source/delegation/restriction/merge taxonomy +([Open Collective](https://opencollective.com/worm-blossom/updates/meadowcap)) +was folded down). Instead: + +- A capability carries a list of **delegations**, each a triple + `(Area, new_receiver_key, signature)`. +- The capability is valid iff, recursively: the prefix capability is valid; + the **previous granted area includes the new Area** (area inclusion is + checked on subspace, path-prefix, and time-range simultaneously); and the + signature is a valid **handover signature by the previous receiver** over + bytes binding the new area, the new receiver, and the previous signature. +- So *every* delegation step may narrow the area — by subspace, by path + prefix, and/or by time range — and can never widen it. Attenuation is not a + policy convention; widening is cryptographically unverifiable. + Delegating to *yourself* with a narrower area produces a restricted + capability. The final delegation's area is the capability's granted area; + the final receiver is its holder. +- **Delegation is always transitive**: there is no "may not re-delegate" + flag or depth limit in the spec. Any receiver can delegate further, within + their area. Depth is bounded only by chain size (each step adds an area, a + key, and a signature that travel with the token). +- Verification cost is linear in chain length, and chains are verified from + the root every time (no caching semantics specified). + +### 2.4 How capabilities are used + +**Writes are self-certifying.** Willow's data model takes an +`AuthorisationToken` parameter; Meadowcap instantiates it as +`MeadowcapAuthorisationToken { capability, signature }`, where the signature +is the capability receiver's signature over the encoded entry. +`meadowcap_is_authorised_write` checks: capability valid, mode is `write`, +granted area includes the entry, signature valid. The token **travels with +the entry forever** — any peer, offline, at any later time, can verify that +this entry was authorised, with no reference to any server or registry. +This is the strongest part of the design for offline-first systems. + +**Reads are cooperative, not self-certifying.** The data model has no read +concept; read enforcement lives in the replication layer: "all peers must +cooperate in sending Entries only to peers who have presented a valid read +capability". A read capability is simply an `McCapability` with mode `read`. +Once a peer has legitimately received data, nothing in Meadowcap controls +what they do with it. The confidential presentation of read capabilities +(hiding even *which areas* you hold rights to) is the PIO protocol, §5. + +**Enumeration capabilities.** A companion type, `McEnumerationCapability`, +certifies read access to *arbitrary subspace ids* within a namespace (at an +unspecified path). It exists to resolve "awkward pairs" in private interest +overlap, where two peers' interests overlap only across different subspaces. +Notably, all-subspace read capabilities can only exist in **owned** +namespaces +([Read Access and Confidentiality](https://willowprotocol.org/specs/pio/index.html)). + +### 2.5 Revocation and expiry — the honest weak point + +**Meadowcap has no revocation mechanism.** No revocation lists, no epoch +keys, no online check — by design, because capabilities must verify offline. +What the design offers instead, in the authors' own reasoning +([Timestamps, Really?](https://willowprotocol.org/more/timestamps_really/)): + +1. **Time-bounded grants + non-renewal.** A capability's area includes a + time range, so you grant write access *for entries timestamped within a + window*. "Repeatedly handing out capabilities that grant access for a + small time span imitates the concept of revoking rights…: you simply do + not renew someone's capability." The essay is candid about the tension: + "Low latency in access revocation requires short-lived capabilities, but + those need to be continuously renewed by contacting the authority… If I + can only connect to the Internet once every three months, I need + long-lived capabilities." +2. **Supersession as effect-revocation.** Because stores keep only the + newest entry per (subspace, path), a grantor who retains (or is granted) + write access with *later* timestamps can overwrite / prefix-prune + everything a revoked party wrote. The authors' recommended hygiene for + expiring credentials: when a credential expires, write entries timestamped + just after expiry so backdated writes with the expired credential are + discarded in favour of the newer entries + ([LWN summary](https://lwn.net/Articles/1005639/)). Note the subtlety this + exposes: expiry constrains *claimed timestamps*, not wall-clock creation + time — an expired capability can still produce entries, but only + backdated ones, which lose every join against newer entries. +3. **Read revocation barely exists.** Peers can stop *serving* a revoked + reader, but data already replicated is already read. Nothing can undo it. + +Third parties are patching this from outside the spec: the Leaf protocol +(built on Willow) proposes **FROST threshold co-signing** — a capability +whose use requires a co-signature from an online server, which can simply +stop co-signing to revoke — explicitly trading offline usability for +revocability +([Leaf: Capabilities & Identity](https://blog.muni.town/capabilities-and-identity-with-leaf/)). + +**Estate translation**: Meadowcap revocation ≈ "short validity windows + +a renewal service + overwrite hygiene". In an infrastructure setting where +seats check in with a broker regularly, the renewal service is natural and +the offline tension mostly evaporates — but it is a system *you* build +around Meadowcap, not something Meadowcap gives you. + +### 2.6 What Meadowcap is not + +- Not an object-capability system: resources (areas) and identities (keys) + are separate concepts; capabilities are bearer-of-proof tokens bound to a + receiver key, not unforgeable object references (a distinction the Leaf + authors also note). There is no live object graph, no membranes, no + promise pipelining — it authorises *data access*, not *computation*. +- No caveats beyond the area: no rate limits, no operation sub-types + (append-only vs overwrite are the same `write`), no conditional logic. +- No delegation control (no depth caps, no non-transferable grants). + +## 3. Group management + +There is **no group abstraction** in Meadowcap or Willow: no membership +lists, no roles, no group keys, no join/leave protocol. What exists: + +- A **communal namespace** behaves like an open group: membership = having a + keypair and writing in your own subspace; there is no admission and no + removal. +- An **owned namespace** behaves like an owner-administered group: membership + = holding a delegation chain from the namespace key. "Removing a member" + is the revocation problem of §2.5. +- A "group" sharing a *subspace* means sharing a secret key (all authority, + no accountability separation) — the thing Meadowcap was created to replace + in Earthstar, where knowing a share's secret key gave irrevocable write + access to anyone who learned it + ([Meadowcap announcement](https://opencollective.com/worm-blossom/updates/meadowcap)). + +Any real group semantics (rosters, roles, admins, removal) must be modelled +by the application as data inside the namespace plus delegation discipline. + +## 4. Transport & NAT traversal + +**Willow provides no transport.** This is deliberate and total: + +- Confidential Sync is specified over "arbitrary reliable, ordered, + byte-oriented channels, whether tcp, quic, or unix pipe" + ([Confidential Sync](https://willowprotocol.org/specs/confidential-sync/index.html)). +- There is **no peer discovery, no NAT traversal, no relay, no addressing** + anywhere in the spec family. The Drop Format exists precisely because the + authors consider connection establishment somebody else's problem — drops + move over "USB keys, SD cards, email attachments, instant messages, + torrents, or whatever means users have at hand" + ([Drop Format](https://willowprotocol.org/specs/drop-format/)). +- WTP (the current sync focus) likewise runs over any reliable ordered + bidirectional channel and adds a handshake, but no discovery/NAT layer + ([WTP](https://willowprotocol.org/specs/wtp/)). + +For the estate this means Willow *composes with* the existing transport +story (iroh, tsnet, Cloudflare doors) rather than competing with it — and +also that "Willow for transport" is a category error: there is nothing +there to adopt. + +## 5. Encryption + +### 5.1 What Willow does NOT encrypt + +The [Encrypted Willow](https://willowprotocol.org/specs/e2e/) document opens: +"Willow has no built-in mechanisms for encrypting data." It is an analysis of +what *can* be layered on, not a protocol: + +- **Payloads**: encrypt freely at the application layer (symmetric; add a + nonce, pad to hide length). Relays can store/replicate ciphertext and still + compute joins. Authenticity comes from authorisation tokens, not the + encryption. +- **Timestamps: cannot be encrypted.** Joins require numeric comparison, so + timestamps are plaintext by necessity — timing metadata leaks to any + replicating peer. Mitigations are social/operational: coarsen resolution, + or use logical counters per subspace. +- **Namespace/Subspace ids: not worth encrypting** (equality must be + preserved for joins; per-namespace encryption changes no observer + inferences). Hash meaningful identifiers before using them as ids instead. +- **Paths: can be encrypted prefix-preservingly.** Encrypt each component + with a key derived from the previous component's key via a KDF (HKDF is + suggested). Equal plaintext prefixes ⇒ equal ciphertext prefixes, so + pruning/join semantics survive; holding the key for a prefix decrypts + exactly its extensions — *hierarchical decryption capabilities that mirror + the path structure*. The payload can be encrypted under the final + component's key, tying payload access to path access. This is a genuinely + elegant construction — and it is a *documented technique*, not an + implemented, versioned protocol with test vectors. +- **Authorisation tokens: cannot be encrypted** — verifiers who lack + decryption keys must still verify Meadowcap signatures. +- **At rest**: nothing specified; store encryption is the implementer's + problem. +- **Payload key distribution / group encryption**: out of scope entirely. + There is no ratchet, no group key agreement, no forward secrecy or + post-compromise security for stored payloads. Whoever holds a path key + reads past and future payloads under it until keys are manually rotated + (and rotation invalidates ciphertext addressing). + +### 5.2 Sync-session confidentiality (Confidential Sync + PIO) + +This is where the family's real cryptographic ambition lives — in a +**Proposal-status, currently-paused** spec: + +- **Private interest overlap (PIO)**: before reconciling, two peers must + discover which (namespace, area) interests they *share* without revealing + non-shared interests. They exchange *salted hashes* of "private interests" + (read capability + area of interest pairs), prove read access, and learn + only the overlap — designed to hold "even in realistic adversarial + settings", including against the counterparty + ([Read Access and Confidentiality](https://willowprotocol.org/specs/pio/index.html)). +- **Handshake-bound presentation**: the sync handshake is an authenticated + Diffie–Hellman exchange (Noise XX pattern fulfils the stated requirements) + in which each peer proves knowledge of the secret key corresponding to + the *receiver* of the read capabilities it will present; session traffic is + encrypted to that receiver, and capabilities are transmitted in special + **relative encodings that omit confidential fields** (namespace, paths) + already implied by the overlap. Willow'25 instantiates this as + `Nose_XX_ED25519_ChaChaPoly_WILLIAM3` (sic — the spec's protocol name + literally spells "Nose"), AEAD ChaCha20-Poly1305, 12-byte nonces, Ed25519 + scalar multiplication as DH, WILLIAM3 as handshake hash + ([Willow'25 §7](https://willowprotocol.org/specs/willow25/index.html)). + Being Noise-XX-shaped, the session gets forward secrecy from ephemeral DH + — for the *session*, not for stored data. +- **Man-in-the-middle resistance** was a major work item in the Confidential + Sync rewrite, via binding read access into the handshake + ([site changelog](https://willowprotocol.org/more/changes/)). + +Verdict: the *design* for confidential sync is the most privacy-serious in +the local-first field; the *artefact* is an unfinished spec whose own page +says design is paused and much of it outdated. + +## 6. Sync / replication semantics + +- **Model**: state-based CRDT (join semi-lattice, §0). No operation log, no + causal history, no vector clocks. Convergence is unconditional on order of + joins; deletion is *traceless by design* — the authors "deliberately avoid + any cryptographic proofs of completeness, allowing for traceless data + removal" ([Comparison](https://willowprotocol.org/more/willow_compared/)). + If the estate ever needs audit history, Willow's store semantics actively + work against it (history would live in a separate, application-level log). +- **Conflicts**: deterministic last-writer-wins per (subspace, path) with + digest/length tie-breaks, plus prefix pruning. Concurrent writes to the + same path in the same subspace silently lose — filesystem semantics, not + merge semantics. Different subspaces never conflict. There is no + text-merge/CRDT-payload story; payloads are opaque bytes. +- **Trust caveat**: within a subspace, writers are trusted with timestamps. + A writer can future-date entries to win all future joins and prune others' + work — simultaneously a moderation feature and an attack; Meadowcap + time-bounded capabilities are the mitigation. +- **Reconciliation efficiency**: region-based set reconciliation + ([RBSR](https://willowprotocol.org/specs/rbsr/)). Peers fingerprint sets of + *LengthyAuthorisedEntries* (entry + how many payload-prefix bytes are held) + with a set hash whose combine operation is associative and commutative + (Willow'25: sum of per-entry WILLIAM3 hashes mod 2²⁵⁶), then recursively + split mismatched AreaSlices into balanced halves and exchange only the + differing leaves. The spec's claim: peers "drill down to the differences… + in a logarithmic number of communication rounds, spending only little + bandwidth on those regions… where they hold the same items." Cost scales + with the *difference* between stores, not their size — the same RBSR family + (Meyer 2023) that iroh-docs also uses. Caveats: (a) these are asymptotic + design claims; the Willow team publishes no benchmark suite; (b) storage + layout determines whether fingerprints are cheap — an October 2026 + analysis by Amparore shows *no* lexicographic ordering of + (subspace, path, timestamp) makes every Area contiguous in an ordered + index, that current implementations pay for this with multi-index or + scan-and-filter strategies, and proposes a denormalised index + (AreaScopeIndex, 2(d+1) index entries per entry at depth d) to make every + Area one contiguous range + ([Making Every Willow Area Contiguous](https://worm-blossom.org/assets/papers/amparore2026making.pdf)). + Efficient Willow storage is an open research problem, not a solved one. +- **Partial sync is first-class**: intersections of AreasOfInterest, count/ + size budgets, eager-vs-lazy payload thresholds (expressive enough to + implement Plumtree-style dissemination), unsolicited forwarding within an + open session, and resumable payload transfer via Bab *verifiable streams* — + a partially received payload is verifiably a prefix of the expected + payload, because the payload digest is a Merkle-style Bab hash. +- **Offline behaviour**: total. Stores are local; any two stores join + whenever they meet, by any channel including Drop Format bundles with no + connection at all. Stale data in drops is harmless (joins discard it). + +## 7. Storage fit (SQLite / Turso) + +- The data model defines an abstract **Store trait**; each store holds + exactly one namespace. Implementations are responsible for 3D range + queries, area queries, fingerprint computation over ranges, and payload + prefix storage. +- **Existing Rust stores are embedded-KV, not SQL**: the canonical + `willow-store-simple-sled` (sled; separate trees for entries, payloads, + misc; keys encode subspace‖path‖timestamp for prefix scans); n0's + `willow-store` on **redb**; and a new persistent store in the willow25 + 0.6 alphas built on **fjall** (per the Riot audit, the umbrella crate pulls + storage + fjall + async-filesystem dependencies even if you only want the + data model). +- **No SQLite/libsql/Turso store exists** in either lineage. Writing one is + feasible — entries are rows, (subspace, path, timestamp) is an index — but + the two hard parts are bespoke: (1) fingerprints must be maintainable + incrementally over arbitrary AreaSlices (a commutative set hash helps: + it's a SUM over the slice, which SQL can compute but not cache for free); + (2) prefix pruning on ingest is a range delete keyed by path prefix. + Nothing about Turso (distributed SQLite) is used or usable off-the-shelf: + Willow already *is* the replication layer, so a Turso-backed store would + double-replicate. +- Payloads are stored separately from entries everywhere; large payloads are + a blob-store concern (iroh-willow used iroh-blobs), not a Willow concern. + +## 8. Rust maturity + +Two distinct Rust lineages — do not confuse them: + +**Canonical (worm-blossom)** — moved from GitHub (`earthstar-project/willow-rs`, +now archived) to [Codeberg](https://codeberg.org/worm-blossom/willow_rs/) in +Oct 2025. Crates: `willow-data-model`, `meadowcap`, `willow25`, `bab_rs`, +plus the `ufotofu` async ecosystem the team builds alongside. + +- `willow25` "currently implements the Data Model and Meadowcap"; persistent + storage and Drop Format are landing in the 0.6 alpha line + ([Willow — Rust](https://willowprotocol.org/rust/)). Version state per an + independent July 2026 audit: willow25 0.5.0 / 0.6.0-alpha.3; the audit + *requires* pinning `bab_rs = 0.8.1` because **every bab_rs version before + 0.7 computed incorrect WILLIAM3 digests** and 0.8 "truly fixes" them — + digest-correctness churn in the hash layer is a real adoption hazard + ([Riot Willow implementation audit](https://github.com/rabble/riot/blob/HEAD/docs/research/2026-07-10-willow-implementation-audit.md)). +- **No Rust implementation of Confidential Sync / WGPS exists** in the + canonical repo (still listed as future work); the TypeScript `willow-js` + implements the data model, WGPS, and sideloading. +- The canonical repo has **no hosted CI** (open issue, noted in the same + audit). The codebase is small-team academic Rust: heavy generics + (const-generic path limits, signature-scheme type parameters), its own + async philosophy ("frugal async" + ufotofu producers/consumers rather than + Tokio idioms). Embedding it in a Tokio fleet binary is possible — the + data-model and meadowcap crates are computational — but it is not a + drop-in Tokio-native library. +- License: Apache-2.0 (repo listing). Downloads are tiny (lib.rs shows + `willow-data-model` at ~410 downloads/month, 3 reverse dependencies) — + this is a research-grade ecosystem, not a depended-upon one. + +**n0 / iroh lineage** — see §10. + +**TypeScript**: `willow-js` + `meadowcap-js` (published as +[@earthstar/meadowcap on JSR](https://jsr.io/@earthstar/meadowcap)) are the +most complete implementations (data model + Meadowcap + WGPS + sideloading), +and Earthstar 11 (beta) is built on them. A Go implementation (`willow-go`) +exists as an independent interoperability cross-check. + +## 9. Cloudflare fit + +- **No Cloudflare-specific support exists anywhere in the family**: no + Workers examples, no KV/R2/D1 bindings, no Durable Objects store. +- What could work, honestly assessed: + - *Meadowcap verification as a pure function* is portable: the Rust + `meadowcap` crate is generic computation and the TS `meadowcap-js` runs + anywhere JS runs, including Workers. Capability *checking* at the edge + is plausible today. + - *A Willow store on Workers* is not: the Rust stores need a filesystem + (sled/fjall/redb); WASM storage modularity was still an open issue in + willow_rs (issue #56 per the Riot audit). A Durable Object hosting a + store + sync endpoint would be a from-scratch build on D1/SQLite with + the §7 caveats, syncing via the TS WGPS or a hand-rolled WTP. + - *Drops via R2/KV* is the one naturally Cloudflare-shaped pattern: a drop + is a single verifiable bytestring; R2 is an ideal drop mailbox. But + tooling for that pattern does not exist; you'd build it. +- Verdict: components are portable to the edge; the system is not available + there. Nothing about Willow *needs* Cloudflare, and nothing about + Cloudflare helps Willow except as dumb transport/storage for drops. + +## 10. iroh fit + +This is the family's most interesting composition story — and a cautionary +one. + +- **Conceptual fit is excellent.** Willow'25 identities *are* Ed25519 public + keys — the same key type as an iroh NodeId; a subspace key can literally + be an endpoint key. Confidential Sync needs only reliable ordered streams, + which is exactly what iroh provides over QUIC, plus the NAT + traversal/discovery Willow lacks. Payloads map naturally to iroh-blobs. +- **An implementation exists**: [n0-computer/iroh-willow](https://github.com/n0-computer/iroh-willow) + — a Rust implementation of Willow + Meadowcap + (its era's) Confidential + Sync over iroh, using `willow-store` (redb) for entries and `iroh-blobs` + (bao-tree verified streaming) for payloads, sessions over QUIC via + quic-rpc ([DeepWiki architecture summary](https://deepwiki.com/n0-computer/iroh-willow)). + n0 built it while exploring Willow as the successor direction to iroh-docs. +- **But it is not a maintained product.** docs.rs carries the crate + (v0.28.0) with the note "This work is not released yet" + ([docs.rs](https://docs.rs/iroh-willow/latest/iroh_willow/)); it is built + against iroh 0.34-era APIs with `[patch.crates-io]` overrides to n0 forks + of the willow crates and git-branch dependencies — several iroh generations + behind current iroh. Downstream projects vendoring it report broken builds. + Adopting willow-over-iroh today means *forking and porting* iroh-willow, + not depending on it. +- **Hash-world collision**: Willow'25 payload digests are WILLIAM3/Bab; + iroh-blobs is BLAKE3/bao. iroh-willow resolved this by instantiating + Willow with BLAKE3 digests — i.e. it is *a* Willow, but not Willow'25, and + would not interoperate with willow25 peers. Any estate adoption must pick + which hash world its payloads live in. + +## 11. Spec / interop status + +Covered in §0's table. Summary: the *settled* parts are the data model and +Meadowcap (both Final, with two independent implementations each in Rust and +TS). The *unsettled* parts are everything about moving data between peers +over a network: Confidential Sync paused mid-rewrite, WTP an early proposal, +Willow'25 itself still Proposal. Interop risk concentrates exactly where a +fleet would need stability — sync. + +## 12. Project health + +- **Team**: two people (Meyer, Gwilym) as worm-blossom, plus occasional + contributors (glyph worked on the Rust implementation). Bus factor is the + obvious risk. +- **Funding**: grant-based throughout — NLnet NGI Assure (2022), then a + €50K NGI0 Core grant, then a dedicated NLnet grant for Bab + ([Open Collective](https://opencollective.com/worm-blossom/updates/willow-and-earthstars-sping); + [Codeberg repo funding note](https://codeberg.org/worm-blossom/willow_rs/)). + Donation income is ~$3K/year. There is no company, no hosted service, no + commercial support. +- **Activity**: alive and publishing — weekly dev diary at worm-blossom.org, + spec updates through Nov 2025 (Meadowcap → Final), 2026 commits on + Codeberg (persistent-store work, April 2026), and external research uptake + (Amparore's storage paper, Riot's audit, Leaf building on top). The pace + is deliberate and specification-first: the team optimises for the spec + being *right*, not for shipping product surface. +- **Posture**: public-good infrastructure research. If the estate adopts + Willow, it is adopting a spec and a two-person upstream, and should expect + to carry implementation weight itself. + +## 13. Operational complexity + +- **Instantiation burden**: raw Willow is a blueprint; Willow'25 removes most + choices, but you still own key custody, renewal services, and store + operations. +- **Timestamp discipline becomes security-critical**: claimed timestamps + drive both conflict resolution and capability windows. Clock policy, + future-dating bounds, and expiry-hygiene writes are operational duties + most systems don't have. +- **Capability chains are per-entry overhead**: every authorised entry + carries its full delegation chain + signature; deep delegation graphs cost + bytes and verification time on every sync, forever. +- **Store operations are immature**: no admin tooling, no metrics, backup = + copy the embedded-KV directory or export drops; the efficient-storage + question is still being researched (§6). +- **Sync operations don't exist yet** in Rust (§8): any production sync is + your code, your bugs. + +## 14. What Willow / Meadowcap pointedly does NOT do + +1. **No revocation** (§2.5) — only non-renewal of time-bounded grants and + supersession of writes. +2. **No groups, roles, or membership management** (§3). +3. **No transport, discovery, NAT traversal, or relays** (§4). +4. **No built-in end-to-end encryption** — no payload key distribution, no + group encryption, no forward secrecy for stored data (§5.1). +5. **No history or auditability** — stores keep only current state, by + design (traceless deletion is a feature). +6. **No Byzantine tolerance inside a subspace** — authorised writers are + trusted, including with timestamps; there is no completeness proof a + malicious peer is withholding data (deliberately). +7. **No consensus / global ordering / cross-namespace transactions** — + namespaces are independent universes; a store is single-namespace. +8. **No SQL store, no Cloudflare story, no production Rust sync** (§§7–9). +9. **No identity recovery/rotation story** (§1). +10. **No rich authorisation logic** — read/write over areas is all there is; + no append-only mode, no quotas, no conditional caveats (§2.6). + +--- + +## 15. Judgment + +### (a) As a full stack + +Willow is two finished, excellent layers (data model + Meadowcap) wearing +an unfinished third layer (network sync). The data model's bet — mutable, +named, deletable data with filesystem semantics, replicated as a state-based +CRDT with first-class partial sync — fits infrastructure state (configs, +registries, seat state) arguably better than append-only log models, and +its reconciliation design is principled and difference-proportional. + +But adopting "Willow for everything" in Rust today means: alpha crates with +a recent hash-correctness incident in their history, a sled/fjall/redb store +instead of the estate's SQLite/Turso, *no* Rust sync implementation, a sync +spec paused mid-rewrite, your own transport integration, your own +revocation/renewal service, and a two-person grant-funded upstream. The +estate would become the de-facto third implementation team. That is a +research adoption, not a platform adoption. + +### (b) As a borrowed capability layer + +Meadowcap is the family's export-grade asset, and it was *designed* to be +borrowed: the data model treats authorisation as a parameter, and Meadowcap +itself is generic over signature schemes and needs only an area-like +grouping (subspace × path-prefix × time-range) over whatever it protects. + +Borrowed into another stack (p2panda logs, a fleet broker, a sync protocol +of our own), it buys: + +- receiver-bound, offline-verifiable, self-certifying authorisation tokens + that travel with the data; +- attenuation that is cryptographically monotone (area inclusion enforced by + the validity definition, not by policy code); +- the cleanest available answer to "who may write/read *this slice* of the + data space", including the owned/communal duality that maps directly onto + "managed fleet" vs "open federation"; +- a Final spec with two independent implementations to check against. + +And its costs travel with it: no revocation (budget for a renewal service +issuing short-window capabilities — cheap for the fleet, whose seats already +check in with a broker; expensive for genuinely offline peers), always-on +transitive delegation, read enforcement that requires cooperating servers, +and per-entry chain overhead. A borrower should also decide early whether +to take the `meadowcap` crate (generic but const-generic-heavy, ufotofu +ecosystem) or re-implement the (compact) validity rules against the spec — +the spec is genuinely implementable, which is itself the strongest thing +that can be said about a capability design. + +**Bottom line**: Willow/Meadowcap is the field's best-specified answer to +*area-scoped capability authorisation for replicated data*, and its data +model is a serious contender wherever mutable named state matters. As a +turnkey stack for this estate it is not ready — the sync layer is a draft, +the Rust storage story conflicts with the estate's SQLite/Turso standard, +and revocation/group semantics would be estate-built regardless. The +composed play — another sync/transport core, Meadowcap (spec or crate) as +the authorisation layer, short-window renewal run by the fleet broker — +captures most of the value at a fraction of the adoption risk. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/worm-blossom-catalogue.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/worm-blossom-catalogue.md new file mode 100644 index 000000000..28fc7c0ba --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/worm-blossom-catalogue.md @@ -0,0 +1,1588 @@ +# Worm Blossom catalogue — the collective's entire blog and project set + +Research note for the capability-auth + peer-to-peer transport investigation +(developing-today/code#13779). Companion to `willow-meadowcap.md` in this folder, +which covers the Willow/Meadowcap specifications in depth; this note covers the +*people, their public diary, and everything they maintain*, from their own pages. + +Compiled 2026-11-23 from primary sources only: worm-blossom.org (front page + +the three archive pages + the All Music / All Comics index pages), +willowprotocol.org, bab-hash.org, sneakerweb.org, the Codeberg organisation +`worm-blossom` (org page snapshot), the JSR scope `@wormblossom`, and docs.rs. + +## Counting method and totals + +- **Blog: 59 weekly updates.** The blog *is* a weekly diary — there are no + standalone posts; every update bundles editorials, announcements, a music + pick, link notes, and a comic. Counted as update-blocks on the site's own + archive index (https://worm-blossom.org/archive): **2025 = 12 updates** + (2025-W41–W52, page `archive_2025_2`; the diary launched 2025-W41, there is + no 2025 part 1), **2026 Part 1 = 26 updates** (2026-W01–W26, page + `archive_2026_1`), **2026 Part 2 = 21 updates** (2026-W27–W47, page + `archive_2026_2`). The front page repeats the 8 most recent updates + (W40–W47); verified duplicate, not additional posts. Week labels come from + the site's own asset paths (`assets/week/yYYYYwWW/…`); the diary prints no + dates, so calendar ranges below are the ISO weeks. The diary's own + first-anniversary editorial says "52 weeks" — their count is looser than + the archive's block count (some weeks are near-empty); the archive count + above is the verifiable one. +- **Two index pages** re-collect weekly segments and are not separate posts: + *All Music* (the playlists pages: every weekly song, plus album playlists) + and *All Comics* (https://worm-blossom.org/archive/comics/ — 43 comic + entries: 10 from 2025, 33 from 2026, including the multi-part *Blossoquest* + serial). +- **Projects: 20 maintained by the collective** (catalogued below), plus + **3 independent third-party implementations** of their specs (Ourcana's + Dart Willow, Freckles' willow-ts, a Zig Bab) listed separately because + they are the strongest external-adoption evidence. + +## The collective + +Two founders, one later member, grant-funded (NLnet/NGI) throughout: + +- **Aljoscha Meyer** — researcher (PhD work on set reconciliation and, + lately, certificate transparency); author of the Willow specs, Bab, + Ufotofu, Macromania; signs editorials `~Aljoscha`. +- **Sammy M. Gwilym** ("Sammy", formerly credited as Gwilym) — developer and + artist; inherited stewardship of Earthstar from its creator Cinnamon; + co-author of Willow; draws the comics; signs `~sammy`. +- **Emmy Walker** — contributor from early 2026 (ufotofu, sneakerweb; earlier + editorials bylined "Dan/danmw" are the same person), **officially joined + as third member in autumn 2026** and works on Pillow. +- Regular community contributors named in the diary: Miaourt (Bab, guest + editorials), Vivicat (WILLIAM3 debugging), Sarah Aronson/"Heni" (Ourcana), + Freckles (willow-ts, test-vector auditing), Slug, interfect, Ben Frye. + +--- + +# Part 1 — The blog, week by week + +Relevance tags: **[auth]** capability/Meadowcap · **[sync]** sync protocols · +**[enc]** encryption · **[store]** storage/indexing · **[rust]** Rust library +design · **[eco]** ecosystem/adoption · **[—]** no direct bearing. + +## 2025 (archive_2025_2) + +### 2025-W41 · Oct 6–12, 2025 — Diary launch; first `bab_rs` release +Aljoscha's launch editorial: after a quiet year accumulating Willow work and +technical debt under grant deadlines, worm-blossom will publish minimally +useful subsets early, clear the backlog publicly, and post joyful weekly +updates. Announcement: first release of `bab_rs`, the Rust implementation of +**Bab**, a BLAKE3-inspired hash-function family designed for content-addressed +storage; fully generic over Bab's parameterisation, shipping **WILLIAM3** as +the recommended default; verified-streaming features planned (funded). Sammy: +two Willow specs renamed — Willow General Purpose Sync → **Willow +Confidential Sync**, Sideloading Protocol → **Willow Drop Format**. +*Relevance: [enc][store] — Bab/WILLIAM3 is the hash layer under Willow'25 +payloads and verifiable streams; everything later in the diary builds on it.* + +### 2025-W42 · Oct 13–19, 2025 — Ufotofu week; Frugal Async Rust +Aljoscha: heavy **Ufotofu** week (docs, tests, doc-tests toward a proper +release) — their Rust lazy-sequences library (producers/consumers, i.e. +streams/sinks) that "served us well for our async needs while implementing +Willow in Rust"; plus breaking core changes to **Macromania**, their +TypeScript-embedded templating language that generates willowprotocol.org +(core now stable, JSR release, high-level docs missing). Announcement: +**Frugal Async Rust** page published and **`frugal_async` crate released** — +simplifying assumptions for async Rust (an awaitable Mutex example; +smol-based). Sammy's editorial is about cooking. +*Relevance: [rust] — Ufotofu and the frugal-async discipline (no `Send` +bounds, single-threaded futures) shape every later implementation choice, +including a real framework incompatibility in 2026-W42.* + +### 2025-W43 · Oct 20–26, 2025 — willowprotocol.org mega-update +Sammy: 18 months of Willow work (Apr 2024–Oct 2025, NLnet-funded) published +at once in a 67,020-additions mega-branch: Confidential Sync reworked to be +**MITM-resistant** (Private Interest Overlap redesigned; a threat-model +page), Drop Format can add entries **without payloads** with a more efficient +encoding, a new **Willow'25** page (the recommended parameter set), a new +Rust section with tutorials and rustdoc integration, front page redesigned. +Miaourt's Bab contributions landed in that week's `willow25` release. +Announcement: Joakim's contribution reinterprets Willow timestamps as **TAI** +(leap seconds), surfacing epoch-choice pitfalls in the Rust `hifitime` crate. +*Relevance: [sync][auth] — the public spec surface (Confidential Sync's +privacy design, Willow'25 parameters) dates from this drop.* + +### 2025-W44 · Oct 27–Nov 2, 2025 — First `willow25` crate release +Announcement: first `willow25` crate — the full Willow Data Model with +Willow'25 parameters; highlights: optimised immutable `Path` with zero-copy +prefix creation, `Timestamp` arithmetic, the core `Entry` struct; new Rust +tutorials. Aljoscha: the past year's Rust implementations are being reworked +and re-released over coming weeks; roadmap: Groupings → Meadowcap → storage +traits → in-memory + persistent stores → Drop Format; then slower work on +application ideas, E2EE, network sync; Bab, Ufotofu, Macromania on the side. +Also part 1 of the "why *is* this website called 'worm-blossom'?" series +(French revolutionary decimal time). +*Relevance: [store][rust] — the implementation roadmap they then actually +followed, in order, for a year.* + +### 2025-W45 · Nov 3–9, 2025 — `willow25` 0.2.0 groupings; `order_theory` +Announcement: `willow25` 0.2.0 adds the `groupings` module (WillowRange, +Range3d, Area, AreaOfInterest types; a `Grouping` trait so entries can be +checked against any grouping). Aljoscha: **`order_theory` crate** published +"accidentally" — traits for successors/min/max/lattices born from Willow's +needs; its property-testing utilities found several errors in their previous +groupings implementations. Sammy: funding chase, including the **Rummager** +proposal (a general-purpose GUI for "organically expressing your own +applications through the act of nesting free-form data"); new **ufotofu +website**. Aljoscha's essay traces ufotofu's lineage to SSB pull-streams +(Dominic Tarr), xstream/callbag (André Staltz), and Go SSB's streams lib — +his rejected Onward! 2024 stream-API essay became the ufotofu site's basis; +the library has been "simmering for almost ten years." +*Relevance: [auth][store] — Areas/groupings are the unit Meadowcap grants +over; order_theory is the lattice toolkit underneath.* + +### 2025-W46 · Nov 10–16, 2025 — "…on 'fancy' CRDTs"; ufotofu codec traits +Publishing day moves Monday→Friday; the **Rummager proposal was rejected** +("we'll just need to build out a prototype in our spare time"). The titled +essay **"…on 'fancy' CRDTs"** argues Willow's last-write-wins choice: fine- +grained merge CRDTs "often require lugging around a complete history of +changes, forever," while most connected apps (microblogging, chat, forums, +media, issue trackers) author data alone then pool it — Willow focuses on +"merging potentially huge collections of interleaved data," a system "we +*know* we can make efficient." Announcement: **ufotofu minor release adding +codec traits** — `Encodable`/`Decodable` plus **relative encodings** (encode +relative to context shared by encoder/decoder → delta encodings); many +Willow encodings rely on this, and ufotofu's codec traits map directly onto +Willow's (relative) encoding relations. Aljoscha details the codec axioms +(every value has an encoding; no two values share one; no encoding is a +prefix of another) and the `codec::proptest` module (`assert_codec`) with +coverage-guided fuzzing, which finds counterexamples in implementations +*and in spec encoding definitions*; Meadowcap's Rust implementation is next. +*Relevance: [sync][rust] — the LWW-over-history argument is the core design +bet Willow makes against log-based systems; relative encodings recur in the +WTP design a year later.* + +### 2025-W47 · Nov 17–23, 2025 — Interactive Data Model; `compact_u64`; the semilattice editorial +Sammy built the **Interactive Willow Data Model** (browser toy: view/add +entries, "sync" between three peers) for willowprotocol.org. Announcement: +**`compact_u64` crate released** — the variable-length u64 encoding used +throughout the Willow specs. Aljoscha's rant: **LEB128 is "the linked list +of varints"** — byte-at-a-time decoding with unpredictable branches is +hostile to modern hardware; length-up-front designs (CBOR, his VarU64 spec, +Willow's generalisation) process words at a time and their lexicographic +order coincides with numeric order (helpful for kv-stores). His long +"ivory tower" editorial: op-based CRDTs are mostly ad-hoc commutative +operators dressed up; **state-based CRDTs = semilattices** are the real +structure — irredundant join decompositions, join-decomposition +reconciliation, CALM-theorem reflections (Willow's overwriting entry = +deletion inside a monotone system), and **sublattices as the formal basis +of access control and partial sync — "it is no coincidence… every Willow +Area induces a sublattice"**; also intent-preserving lattices (Pijul). +*Relevance: [auth][sync] — this is the theory under Meadowcap Areas and +under range-based set reconciliation: partial sync and scoped access are +the same sublattice operation.* + +### 2025-W48 · Nov 24–30, 2025 — `meadowcap` crate released; the empty-ranges bug +Announcement: **`meadowcap` crate released** — Rust implementation of the +Meadowcap spec: authorise writing entries and whether a peer may request +entries; access scoped to arbitrary Areas; holders can delegate, optionally +restricting to a smaller area. Aljoscha's editorial: the **empty-ranges +bug** — syntactic vs semantic equality of ranges (`[2..2)` vs `[3..3)`) +broke the `EncodeAreaInArea` relative encoding during the Meadowcap port; +normalising would violate Willow's encoding axioms (equal values ⇔ equal +encodings), so **empty groupings were removed from the spec entirely**; +caught by a property test; cost days of refactoring. +*Relevance: [auth] — Meadowcap as running Rust code dates from here (the +crate was later deprecated in favour of willow25's built-in module, see +2026-W33); the bug story is a data point on their spec↔implementation +feedback loop actually working.* + +### 2025-W49 · Dec 1–7, 2025 — willow25 gains batteries-included Meadowcap +Announcement: **willow25 gains batteries-included Meadowcap** (ed25519 +instantiation; `WriteCapability::new_communal` example producing authorised +entries); "with access control in place, willow25 is ready for… persistent +entry storage." Contribution: danmw added `Path::create_slice`/ +`Path::create_suffix` to willow25 (restructured Path internals for O(1) +instead of O(n)). Aljoscha: forking BeepBox→AbyssBox (a fork-of-forks mod) +to build the site's **playlists page** — the origin of the weekly music. +*Relevance: [auth] — capability issuance/verification usable from the main +crate; the communal-namespace entry point is the one an adopter calls.* + +### 2025-W50 · Dec 8–14, 2025 — WebTT spec; Bab storage internals +Announcement: **WebTT (Web Tooltips) spec published** — lightweight nestable +cross-domain tooltips for any website with no server-side logic: include a +spec-compliant JS file + CSS, mark elements with `data-tooltip-anchor` +pointing at a tooltip page loaded in an iframe on mouseover; JS on Codeberg; +powers willowprotocol.org's tooltip-heavy specs. Aljoscha: **Bab storage +internals** — pluggable backends via a minimal **`ByteStorage` trait** +(essentially an async `Vec` with up-front capacity); backends bridged +to Bab by treating the byte array as an **implicit representation of the +Bab Merkle tree** (flat-array tree layout, chunk-data offsets for partial +slices); **`SliceProgressIterator`** emits the Merkle nodes of a verifiable +stream with skip annotations, decoupled from backends, guiding both +producing and consuming; next: consuming/verifying streams into storage. +Sammy: Splintercon (Paris) on the splinternet. Contribution call: willow25 +issue #21 (the spec's well-known default keypair enabling public access). +*Relevance: [store][enc] — Bab's storage-first API design (the trait is +tiny; a filesystem backend later took Sammy "next to nothing" to write) is +the piece that makes verifiable partial payloads practical.* + +### 2025-W51 · Dec 15–21, 2025 — `willow://` URIs; Drop Format revised; the Cobweb +Announcements: **`willow://` URI scheme spec published** (denotes Willow +Entries and Areas); **Drop Format spec updated** — partial entry payloads +supported (powered by Bab, everything stays verifiable), **drop encryption +removed from the spec** (left to applications; their own apps will default +to encrypted drops), Willow'25 now specifies Drop Format parameters; +persistent storage + drop import/export targeted "within the next two +months." Aljoscha: **the Cobweb** — a hypertext system idea on Willow: +built-in transclusion of multiple documents at once (directory-scale +iframes), Willow URIs → mutability without link rot, extreme simplicity +(markdown-subset markup, one simple image format), efficiency (binary +storage format, mmap-able, interleaved progressive images with +Bab-verified prefixes); inspirations Gopher, Gemini, man pages, RFCs, +Mastodon, TiddlyWiki, Joplin. Sammy: FOSDEM talk accepted ("Willow - A +family of peer-to-peer storage protocols"); implemented a **filesystem +backend for Bab** (ByteStorage over `async-fs` File). Comic: Christmas +"revoking your friends' keys" joke. +*Relevance: [enc][sync] — note the spec-level honesty: drop *encryption* +was removed from the spec rather than hand-waved; encryption is an +application-layer choice in their stack.* + +### 2025-W52 · Dec 22–28, 2025 — Maximalism post-mortem; `willow_data_model` 0.6.1; 2026 roadmap +Sammy's year-end editorial, **the maximalism post-mortem**: Confidential +Sync's complexity "radiated onto everything" (storage needed RBSR +fingerprint/partition APIs and push-centric APIs; ufotofu needed a menagerie +of encoding traits for Private Interest Overlap's private encodings); the +Macromania site rewrite congealed into a mega-branch that sealed +willowprotocol.org against small updates; silence fed perfectionism; +lessons: avoid complexity, deliver frequently, focus, communicate often — +worm-blossom.org is the antithesis. Announcement: **`willow_data_model` +0.6.1** — beginning of proper storage: a basic `Store` trait + non-persistent +`MemoryStore`; the trait can't support sync yet (no incremental payload +receiving/verifying — that'll be a subtrait); planned hierarchy of +subtraits (Bab-related methods, summarising for RBSR, …). Aljoscha's **2026 +roadmap**: by end of January, simple persistent storage + Drop Format +implementation → sneakernet apps possible; then revisit **E2EE of +entries/payloads** (specify techniques in Willow'25, augment stores to +encrypt/decrypt on the fly, encrypted by default); **pull-based-only +doctrine** (premature push-based APIs — Confidential Sync + subscription +store APIs — blamed for past slowness); next big chunk: **WTP (Willow +Transfer Protocol)** — Confidential Sync is "deeply push-based, so it is +not an option"; WTP is HTTP-inspired simple requests/responses (draft +linked); after WTP: push-based local APIs (subscribable Bab, then +subscribable stores); a more efficient storage backend (currently linear +scans; 3D generalisations of zip-trees and G-trees in mind); long-term: a +**capability-scoped Willow database server** shared by multiple apps, with +persistent subscriptions resumed by offset + set-reconciliation catch-up; +Confidential Sync rework comes last, informed by WTP; plus benchmarking +suites, transactional store APIs, a peer-sampling service, Willow URIs +implementation; application ideas Rummager + Cobweb. +*Relevance: [sync][store][auth] — the single most decision-dense post of +2025: it admits the flagship sync protocol was over-complex, demotes it, +and lays out the pull-based WTP + capability-scoped server direction that +the whole of 2026 then executes (and that Pillow later funds).* + +## 2026 Part 1 (archive_2026_1) + +### 2026-W01 · Dec 29, 2025–Jan 4, 2026 — Unified media formats (design) +Sammy: rest week, sketching the FOSDEM talk. Aljoscha: designing **unified +simple media formats** for Cobweb/Rummager — one format per media type +(image/audio/video) sharing structure: channels of integer samples, +interleaving with per-channel frequencies (chroma subsampling), +**quantisation as the only lossy step**, LZ + predictor residuals (never +encode samples verbatim), seeking via absolute samples + anti-monotone +binary linking forward-pointers; target ~400 lines of C per format (QOI/QOA +as models, ruled out as-is: no combined lossy+lossless). +*Relevance: [—] mostly; the formats work recurs at W39 (seeking schemes) +and feeds Cobweb/sneakerweb media ambitions.* + +### 2026-W02 · Jan 5–11, 2026 — Bab stream verification breakthrough +Sammy: FOSDEM talk in "concept phase." Aljoscha: reflective editorial on a +creativity/coding block, ending with a **breakthrough on how to elegantly +implement verification of incoming data streams in Bab** (details promised +the following week). +*Relevance: [enc] — incremental verification is Bab's core promise; +implementation detail lands over the following weeks.* + +### 2026-W03 · Jan 12–18, 2026 — Light week +Mines/extractivism comic (the metaphorical-mines series), music picks. +No substantial technical content. +*Relevance: [—].* + +### 2026-W04 · Jan 19–25, 2026 — Pointer week +Sammy: restructuring the FOSDEM talk — not "what Willow is" (the website +does that) but "**why** is Willow like it is? What kind of world made us +feel such a thing was necessary?" Aljoscha's editorial is mostly a pointer +to Bab implementation notes on bab-hash.org. +*Relevance: [—] light; the talk framing signals their positioning: +motivations first, mechanism second.* + +### 2026-W05 · Jan 26–Feb 1, 2026 — Bab slice verification lands; Open Collective +Sammy: train to p2p-basel (listening, not speaking); FOSDEM talk retitled +"**Willow - protocols for an uncertain future**." Announcement: **worm- +blossom Open Collective opened** — all work (Willow, Bab, Ufotofu, +Macromania, the site) is funded by public funding + volunteers. Aljoscha: +travelled to p2p-basel with Andreas + Glyph **from p2panda**; **Bab slice +verification is implemented**, close to a simple storage backend storing a +single contiguous slice; the FOSDEM deadline was self-imposed and "silly"; +Pijul's Pierre expected at Basel. +*Relevance: [eco] — the p2panda connection is personal and long-standing +(weekly calls, shared events) well before the Pillow collaboration.* + +### 2026-W06 · Feb 2–8, 2026 — Site restructure; motto list +Aljoscha runs the update solo (Sammy at FOSDEM prep) with a parody letter +from "Samy Gwylim"; the week's **motto list** includes "being-able-to- +cross-a-moat-full-of-crocodiles-based access control" and "gardeners +rather than architects." Announcement: **site restructure** — front page +now shows only the eight most recent weekly updates; a full-archive page +plus All Music and All Comics pages launched. +*Relevance: [—] (and provenance for this catalogue's counting method).* + +### 2026-W07 · Feb 9–15, 2026 — p2p-basel sessions: delay-tolerant UIs, "lazy identity" +Sammy's double report. At p2p-basel she moderated "**delay tolerant UIs**" +(authored data arriving a week later, divorced from context; instant- +delivery UIs don't lift) and "**zero / low identity systems**" (digital +doubles linkable to real people are the risk; her "**lazy identity**" +sketch: random IDs for all data, with the owner able to derive a new ID +provably linked to the original — "identity on demand"; compared to +image-board tripcodes; "it would be interesting to plug such a system into +Willow"). FOSDEM: her talk (opening cutscene, ~50 drawings, music by +Aljoscha; recording exists) got a glowing reception; highlights include +Modal Collective's secure p2p-heart OS talk, seeing **adz of p2panda**, +meeting GNOME's Tobias Bernard; Miaourt + danmw attended. Aljoscha: taking +a break (depressive episode). +*Relevance: [auth] — "lazy identity" is their only identity-system sketch: +deliberately minimal, owner-derived, linkability-on-demand — consistent +with Meadowcap's "no assumptions about what an identity is."* + +### 2026-W08 · Feb 16–22, 2026 — Drop Format private encodings; ufotofu error design +Sammy: implementing the **prerequisite encodings for the Drop Format** — +Willow's **private encodings** (items decodable only with a bit of common +knowledge; justified by compactness — squeezing maximal Willow data onto +low-capacity USB keys); porting to "another, hopefully final incarnation +of an Ufotofu-based encoding abstraction"; also pondering Discord's +age-verification dispersal problem (no persuasive p2p answer yet). +Contribution: **danmw added chaining combinators to ufotofu**. Aljoscha: +the **ufotofu error-design discussion** Dan's work triggered — some methods +"irretrievably swallow up their arguments in case of an error"; fix +direction: error cases return the original arguments; resolution: "normal" +APIs requiring `Copy` items + clunkier `Clone` variants; **`Copy` exempts +types from linear typing**, matching his mathematical mental model. +*Relevance: [rust][enc] — private encodings are a compactness (not +confidentiality) mechanism; the error-design entry is a good sample of +their API-design rigour.* + +### 2026-W09 · Feb 23–Mar 1, 2026 — Private encodings merged; Bab backend logic done +Sammy: **private path encoding, private area encoding, and private +authorisation token encoding merged into willow_rs `main`** — all past the +fuzz-testing apparatus; immediate goal: save/retrieve Willow data + at +least one exchange path (Drop Format). Aljoscha: **Bab persistent backend +logic in place** (remaining: rearrange public API, document, more tests). +Why-worm-blossom part 4 (Dominic Tarr/SSB lineage; Git precedent). +*Relevance: [auth][enc] — note there is a *private authorisation token +encoding*: Meadowcap tokens have a compact shared-knowledge encoding for +the sneakernet path.* + +### 2026-W10 · Mar 2–8, 2026 — Rust type-system limits; "persona" not "identity" +Sammy: Internet Archive Europe HQ visit; **hit a dead end in how well Rust +accommodates Willow's generic/parameterised ambitions** in willow_rs; +started the **Drop Format implementation** (WIP PR) using liberal `todo!` +macros — breadth-first vs her usual depth-first. Aljoscha's editorial, +**the Rust type-system limits piece**: the generic implementation + +non-generic willow25 wrappers (via a `wrapper!` macro, `repr(transparent)` +unsafe) break down for wrappers of *composite* generic types (an +`AuthorisedEntry` = generic Entry + generic AuthorisationToken): the +safety of the unsafe code would depend on how generics are instantiated, +which the compiler cannot enforce — "an unholy abomination"; **decision: +keep the generic codebase for now, but new work provides willow25 +(concrete) APIs only; long-term, phase out the generic codebase entirely**; +spec genericity still defended; dual-API docs were a pain anyway. +Why-worm-blossom part 5 (Cinnamon's SSB abuse audit — 76 abuse vectors; +deletion impossible in SSB; Earthstar founded 2020 by dropping immutability: +deletion/editing, subset download in any order, one keypair across devices += keypair represents a person, not a device; but unlinked sets lose SSB's +easy sync — the puzzle Aljoscha's set-reconciliation answers). +*Relevance: [rust][auth] — the genericity retreat begins here and completes +at W33 (generics stripped, −15k lines); the Earthstar history explains why +deletion + subset sync are Willow's founding requirements.* + +### 2026-W11 · Mar 9–15, 2026 — Persistent store ported to Fjall; keypair UX +Sammy: **new persistent store for Willow** — a port of the previous +sled-based persistent store to **Fjall** (translation "pretty +straightforward"); store still missing payload methods (Store trait update +depends on Aljoscha's Bab work). Also Tauri GUI experiments raising the +keypair-UX problem — keypairs "are just not anything like user accounts"; +proposes **"persona" instead of "identity"** (a persona proves authorship; +you can have many; attach as much or as little identifying info as you +want); notes others are also building Willow GUIs. Aljoscha: **Bab public +API for (persistent) single-slice-per-string storage with partial +verification** well-documented and nearly releasable; creating a +**Bab-aware store trait in willow25** to unblock Sammy's persistent store + +Drop Format; aside: Brooklyn Zelenka's **bijou64** varint spec is an +interesting variation on his older VARU64. +*Relevance: [store] — the shipped persistent store is Fjall-backed (an +embedded LSM kv-store), not SQLite — a concrete data point for storage-fit +comparisons. Persona-not-identity is their answer to multi-device: +one keypair = one persona, carried across devices by the user.* + +### 2026-W12 · Mar 16–22, 2026 — `bab_rs` alpha: verifiable streaming + storage +Announcement: **new `bab_rs` alpha release exposing verifiable streaming +and data storage** — create storage backends for strings of a known hash, +feed data piece by piece; prefix data is added, non-prefix data errors and +can resume later; **explicitly alpha: everything about the k-grouping +optimisation is untested and "very, very likely to be broken"; the +persistent storage backend is also untested; in-memory incremental +verification works**. Sammy: wireframes (Penpot) for a **generic Willow +management UI** — Discord's server UIs map cleanly onto namespaces, but +keypairs/capabilities ("What's a root pass? What's a path?…") are the hard +part; the single-namespace-as-bucket vision; past attempts (drop-in React +component; web mini-OS "CinnamonOS"); current suspicion: the answer is +agreed conventions — a "pattern language." Contributions: **Ben Frye** +added ufotofu adaptors (and found a bug in built-in consumers); **danmw +given full ufotofu repo access + crates.io publishing rights and published +ufotofu 0.10.1 himself** ("bus_factor += 1"). +*Relevance: [enc][store] — alpha caveats stated in the release +announcement itself; capability UX ("root pass" language) flagged by the +authors as the unsolved adoption problem.* + +### 2026-W13 · Mar 23–29, 2026 — Payload storage via Bab; stateless+untrusted impossibility musing +Sammy: XPUB (Rotterdam experimental publishing) talk report. Technical: +**implemented payload storage in the new Willow persistent store using Bab +— "streaming, verified storage."** Aljoscha: admin/teaching week; filed a +batch of Bab issues; main thinking: **a stateless protocol for mutually +untrusting peers may be impossible** — WTP is stateless and assumes a +trusted peer; Confidential Sync is stateful and doesn't; the +stateless+untrusted quadrant resists because untrusted-peer techniques rely +on establishing shared context and referencing it later, "an inherently +stateful business"; even stateful-client/stateless-server eludes him; +intuition: actually impossible (left to future Aljoscha). +*Relevance: [sync] — a stated open problem that directly shapes WTP's +final shape (it ends up supporting *both* stateful and stateless operation, +W44/W35-36).* + +### 2026-W14 · Mar 30–Apr 5, 2026 — "Anti-design" talk; Super Drop Format sketch +Sammy: DWeb virtual meetup lightning talk — storyline: data groupings → +extractive capitalisation → Willow as "a kind of anti-design": **devalue +data — make it illegible, disposable, impose a half-life on it through +mutability and forgetfulness**; persistent store + Drop Format "within +reach"; a **secret project** teased (later revealed: sneakerweb). +Aljoscha: Prague workshop — notes from a session on **the limits of +CRDTs** (promised write-up); nerd-sniped into a "**Super Drop Format**" +sketch: drops storing a 3D search tree so area queries run in logarithmic +time in total entries (or linear in area size); "extremely low priority. +Probably." +*Relevance: [sync] — the anti-design framing (data should decay) is the +philosophical root of traceless deletion and expiry-by-timestamp design.* + +### 2026-W15 · Apr 6–12, 2026 — SSB design mantras, kept and rejected +Sammy: Prague aftermath (material banked on sneakernets, p2p UIs, +collaboration); shadow-council comic. Aljoscha: **how SSB still influences +his design work** — mantras kept: *no global singletons* (a dependency on +any global server/network/legal entity/blockchain "is brittle and will be +co-opted"); *against consensus* (with nuance: a minimal, clearly-labelled, +eventually-retirable unchanging foundation is valuable; everywhere +evolution is desirable, no global consensus); *free listening* (listening +opt-in, not opt-out). Rejected SSB patterns: **immutability-by-default**, +the **public follow-graph** (enables spidering/surveillance — "this +tradeoff feels inacceptable to me by now"), and SSB's general +virality/network-effect optimisation, which makes it "unsuitable for +vulnerable users" — Willow may be "fated to being crowded out by projects +that emphasise virality over privacy." Note: danmw contributed nicer skip ++ filter adaptors to ufotofu; Sammy posted a clean version of her DWeb +lightning talk. +*Relevance: [auth][sync] — the clearest statement of their threat model +and non-goals: no global anything, no public social graph, privacy over +growth. Any composition with their work inherits these constraints.* + +### 2026-W16 · Apr 13–19, 2026 — `willow25` 0.5.0-alpha.1 PersistentStore; sneakernet theory +Why-worm-blossom part 6 (late 2019: Bamboo append-only logs can't support +multi-device identity; sets are dual to logs; unions of sets are easy where +merging logs isn't; Aljoscha's **set-union algorithm** presented at +p2p-basel 2020; Earthstar needs exactly that sync for mutable unlinked +datasets; he chose his masters-thesis topic — fleshing out the set-union +algorithm — "as a present to Cinnamon"). Sammy: **sneakernets** (from +Prague) — her drop model rebuilt: sneakernets as **homeostatic** (data +pushed out + *need* for data expressed; the overlap is a "hot zone" worth +transporting); users should be able to *query* a drop (random access — the +Super Drop Format nerd-snipe); Aljoscha's framing: **sneakernets are +congestion control without explicit feedback** (a full USB drive forces +choices = throttling; implicit feedback = tracking what you receive from +others to prioritise what you send). Announcement: **`willow25` +0.5.0-alpha.1** — the `storage` module with **`PersistentStore`** for +on-disk Willow data; "an *alpha release*: we expect the persistent store +to be buggy." +*Relevance: [store][sync] — persistent storage exists but is labelled +buggy-alpha by its own authors; the set-union origin story is the +intellectual root of RBSR.* + +### 2026-W17 · Apr 20–26, 2026 — Interfaces for p2p applications +Sammy: **rethinking interfaces for p2p applications** (Prague session) — +chat interfaces presume orderly, timely delivery; p2p data may arrive long +after authoring, out of context; every device has a different view (email +clients are the precedent for divergent views); order-collapsing interfaces +(emoji reactions reduce many messages to a count) as a pattern for richer +types; archival/canonicity question (are p2p systems inherently +ahistoric?); emblems: the centralised **linear ledger** vs the p2p +**scattered pinboard**. Also: building the **bab-hash.org website**; +curating the **p2p tent at DWeb Camp**. Aljoscha: no code (life confluence). +*Relevance: [—] for the protocol decision; useful signal that their UX +thinking assumes divergent, stale views as normal.* + +### 2026-W18 · Apr 27–May 3, 2026 — bab-hash.org launched +Announcement: **bab-hash.org launched** — a dedicated Bab website ("our +cutest website yet"); `bab_rs` framed as a "batteries-included" API going +beyond digests to persisting Bab-annotated data to disk (as used by +Willow's persistent store). Sammy's design editorial: Bab designed for p2p +data exchange — interrupted transfers, malicious peers, many simultaneous +peers; nobody wants to restart an interrupted download or unwittingly +store/propagate illicit data; site is static, built with Macromania ("We +really need to release it someday"); Sammy announces a short break. +Aljoscha: wrapping up the **Bab grant** — implementing a storage backend +that can store **multiple subslices of a single string and append to them +concurrently** (the website promises parallel downloads from multiple +peers, "so the implementation better catch up"); optimised Bab slice +streaming still to test. +*Relevance: [enc] — Bab's stated design centre: verifiable partial data +(resume, reject malicious slices, multi-source download).* + +### 2026-W19 · May 4–10, 2026 — Bab fuzzing; Seasonal Clock sighting +Sammy on break. Aljoscha: making the Bab high-level picture precise — +**fuzzing the Bab implementation, finding integer overflows**, +documenting/asserting invariants to turn low-level failures into semantic +concepts. Project sighting: the **Seasonal Clock** (seasonalclock.org) — +"a worm-blossom project we have not really posted about here before"; +Gergely Polonkai is porting it to **Pebble e-paper watches** (via SSB) and +seeks pixel-art help drawing its 24 emoji (commission offered). +*Relevance: [enc] — fuzzing is finding real overflow bugs in Bab at this +stage; maturity evidence, not a scandal — they publish it themselves.* + +### 2026-W20 · May 11–17, 2026 — 3D zip-trees fiesta +Aljoscha, three editorials: (1) a **visual guide to zip-trees** + the last +missing algorithms for **3D zip-trees** (Willow's 3D data model needs 3D +data structures; existing multidimensional structures all have problems); +a graphical algorithm notation developed as a pseudocode replacement. +(2) Complexity analysis: in a logarithmic-height tree, queries are +logarithmic; **updates logarithmic on average but worst-case O(n^0.792)** +(master theorem, 3 subproblems of size n/4) — "not *great*, but probably +good enough maybe?… R-trees and their ilk typically just hope for the +best." Definition of **2D zip-trees** (4-ary tree; root = maximal-rank +point; quadrants recurse). (3) **2D skip lists** defined recursively and +shown **isomorphic to 2D zip-trees**; connectivity: a directed path exists +between any two vertices; generalises to higher dimensions. +*Relevance: [store] — the 3D-indexing problem that dominated their storage +roadmap — until Amparore's denormalisation insight (W45) dissolved it. +The honest worst-case bound is characteristic: they publish the ugly +number.* + +### 2026-W21 · May 18–24, 2026 — Skip-list correction; G-trees generalised +Sammy returns after surgery (short editorial). Aljoscha: **correction to +W20** — the 2D skip-list's links from top-right/bottom-left sublists back +to the pivot are **not needed**; the variant without them should be the +default (destroys unilateral connectivity but gains a **unique path from +the "least" vertex to any other vertex**); progress generalising **G-trees** +to multiple dimensions; neat instantiation: G-trees over almost-complete +BSTs (history-independent, minimal height, but not clamping-invariant; +maintenance not logarithmic — acceptable since G-nodes are small w.h.p.); +the same generalisation for skip lists yields **skip-skip-lists** +(isomorphic to zip-zip-trees); musing that his PhD should be about data +structures, not append-only-log research he "barely care[s] about anymore." +*Relevance: [store] — public self-correction within a week; the storage +substrate research was still unsettled mid-2026.* + +### 2026-W22 · May 25–31, 2026 — Sneakerweb announced; Bab fuzz status +Sammy: **Summer'26 edition of worm-blossom.org launched** (seasonal +redesign); DWeb Camp p2p track planning; both will attend and talk on +Willow, "and there's also something else we'd like to showcase…" — +**sneakerweb announced**: "**sneakerweb** is our new experiment in +peer-to-peer publishing, a squirrelly little sibling to the world wide +web." WWW data travels immediately through countless intermediaries and +lives on always-on servers, addressed by scarce/rented/seizable domain +names; **sneakerweb data travels gradually and directly from user to user** +(over the sneakernet — physically moving media), is stored on user +devices, and **anyone can claim their own (base32-key, "far less +memorable") domain forever**. The CLI will: claim sneakerweb domains, +publish websites to them, serve the sneakerweb to an ordinary web browser, +import/export website data from files obtained from others, and block +unwanted data. "**It's all built on Willow** and we're aiming to demo it +at Dwebcamp!" Aljoscha: **Bab fuzz-test status** — a massive fuzz test +(writes data into storage, interrupts at random points, exercises +optimisation options): **with all optimisations disabled it cannot find +crashes any longer; some optimisations still don't work** and he may have +to revisit the actual verification logic rather than fix off-by-ones. +*Relevance: [eco][enc] — sneakerweb is the flagship Willow application; +Bab's optimised paths were still broken at announcement time (they say +so).* + +### 2026-W23 · Jun 1–7, 2026 — First interview: Ourcana (a Dart Willow in production); dripdrop; `bab_rs` 0.6.0 +Sammy: sneakerweb front page design — browsing to `sneakerweb.localhost` +shows an overview of your collected sites; rejected a `.sneakerweb` +metadata-file approach as dull/bureaucratic; inspired by webrings and +**Nekoweb's** tile grid — let authors present their own sites (an image, +or an iframe to a `sneakerweb.html` page). **First interview on +worm-blossom.org**: Sarah Aronson (aka Heni, heni.lol) on **Ourcana** +(ourcana.space) — an app for the plural community (journalling/notes across +personality states) built after Simply Plural announced its shutdown; +~**9,000–10,000 users** estimated (no analytics, by privacy design; +installs + Discord); Sarah **wrote her own Willow implementation in Dart** +(Flutter clients on iOS/Android/Windows/Mac/Linux/web; the Rust +implementation runs on always-on server nodes — "Rust… is a *service*. +Flutter and Dart are for *clients*"); she matched the Rust implementation +"over the wire in a bit-perfect way" as her correctness criterion; she +plans to **open-source the Dart Willow submodule, a client implementing +the WTP draft spec**; design driver: communal backup — "your friends can +hold onto things for you" without being able to mutate, tamper with, or +(if encrypted) read them; servers open-source from the start, any client +to any number of servers. Aljoscha: **the Bab fuzz test no longer +crashes** — left label omission was the tricky part (fixed); right label +omission on and "everything *continued working*"; **released as `bab_rs` +0.6.0**; next: a backend storing multiple non-overlapping subslices. +Also: **Drop Format spec revised** (motivated by sneakerweb) — the old +count-prefixed encoding breaks when the store is modified concurrently +during drop creation (counts invalidated → invalid drops, fallible +creation); the new encoding is **streaming-friendly**: each entry/subslice +simply flags whether it is final; upfront counts would also be a DoS +footgun (a malicious drop can claim huge counts to force allocations); +decisive argument (Sarah's observation): without upfront counts, **drops +can be created in a completely streaming fashion — e.g. written straight +to a TCP connection**; Aljoscha coins "**dripdrop**" for this streaming +use — one-directional streaming sync for Willow — and notes it could let +him **remove roughly a third of the WTP spec** (the client-push part that +fits pull-based WTP poorly). +*Relevance: [eco][sync] — the strongest adoption evidence in the whole +diary: an independent implementer running a Willow service for ~10k users, +bit-compatible with the Rust implementation, and her production feedback +changing the Drop Format spec. Also: the WTP's shape was still negotiable +mid-2026.* + +### 2026-W24 · Jun 8–14, 2026 — Sneakerweb front page; `bab_rs` 0.6.1; Bab grant concludes +Sammy: DWeb Camp prep; sneakerweb front page implemented with arbitrary +`sneakerweb.html` iframes (sandboxed previews); sneakerweb spec drafting +begun. Aljoscha: **finished `bab_rs` 0.6.1** — adds a storage backend that +can store multiple subslices of a single string; **"that should conclude +our funding for Bab"**; options next: DWeb Camp prep, polishing willow25, +implementing Willow URLs, Macromania, multidimensional zip-trees, writing. +External Bab activity: a **Zig implementation of Bab is in the works by +folks involved with Spritely**; Sarah is contributing **SIMD-optimised +assembly to `bab_rs`** (expected 2–4× hash speedup; shoutout deferred +until merged). +*Relevance: [enc][eco] — Bab's funded development ends here; a second +independent implementation (Zig) appears — which matters at W26.* + +### 2026-W25 · Jun 15–21, 2026 — Bab project finished; ufotofu-first Drop Format +Sammy's illustration celebrates finishing the funded Bab project; funding +exhausted, grant applications in the pipeline. Sammy + Dan pairing on the +**Ufotofu-first Willow Drop Format implementation** — drop encodings can +be very large, so the API must not "splosh the entire contents of a store +in memory"; a composable API someone can chain into e.g. an entry filter; +"this has not been easy." Aljoscha: small Drop Format spec tweaks; +**drafted a spec for sneakerweb**; DWeb Camp Willow presentation outline; +a proper writeup of **truncated exponential golomb codes**; decided the +residual encoding for the media formats (open: seeking mechanism, audio +sample predictor); started drafting an introduction to p2p systems design. +*Relevance: [rust][sync] — streaming/composable APIs are a hard requirement +their own application imposed on the library; the Drop Format +implementation is ufotofu-shaped.* + +### 2026-W26 · Jun 22–28, 2026 — WILLIAM3 digest bugs found by the Zig implementers; ufotofu equality semantics +Sammy: DWeb Camp events announced (**The Willow Skill Tree** talk, +**Sneakerweb workshop**, demo night market); *sammy's guide to the +sneakerweb* prepared as sneakerweb-only content (never to be published on +the www); sneakerweb hardening grant writing ("whether we can harden the +sneakerweb enough that it becomes useful in adversarial environments"). +Aljoscha: **the folks implementing Bab in Zig found a bug in `bab_rs` that +produced incorrect WILLIAM3 digests; then he found more bugs; the +implementation still appears to diverge from BLAKE3 in ways it shouldn't; +no complete fixes published yet.** Also a long ufotofu semantics result +with Dan: producer equality — slurping is *not* fully transparent (it may +report errors item-production wouldn't), so either allow observable +side-effects in `ProducerExt::equals` or make `slurp`/`flush` infallible +(`()` return); infallible flush is unjustifiable (flush ≈ `fsync`; a +silently failing fsync is absurd) → **API unchanged, mental model of +producer equality adjusted instead** ("we are nothing if not pragmatic"). +And: two albums finished, to be distributed via sneakerweb only. +*Relevance: [enc] — critical maturity evidence: as of June 2026 the +reference WILLIAM3 implementation produced wrong digests (found by an +independent implementer — the multi-implementation strategy working as +intended). Fixed by 0.8.0 (W28), but any "should we use Bab" decision +must price this history in.* + +## 2026 Part 2 (archive_2026_2) + +### 2026-W27 · Jun 29–Jul 5, 2026 — Sneakerweb RELEASED +Announcement: **sneakerweb released** — "a small application for storing, +browsing, and sharing static websites without relying on the internet at +all"; install the CLI from sneakerweb.org; worm-blossom will bring +sneakerweb-exclusive sites to DWeb Camp. "One of the most exciting aspects +of Willow-based applications such as the sneakerweb is that there is no +need for a single, global seed from which everything grows." Aljoscha: +first **Willow Drop Format data exchanged and ingested** end-to-end — "I +am storing and reading a site that Sammy created. And it all runs on our +own protocols and software. Willow feels so very real all of a sudden!" +(Thanks to Dan's contributions for the running software.) +*Relevance: [eco] — the flagship application ships; Willow's stack +(data model + Meadowcap + Drop Format + Bab + Fjall store) carries a real +product.* + +### 2026-W28 · Jul 6–12, 2026 — `bab_rs` 0.8.0: WILLIAM3 verified; guest articles +Aljoscha: **WILLIAM3 bug fixes** — Vivicat spotted and fixed several bugs; +"our WILLIAM3 implementation produces the same digests as a BLAKE3 +implementation when undoing exactly the bits that differ between the two +specs. This gives me high confidence that the newly released **version +0.8.0 of `bab_rs`** provides a WILLIAM3 implementation free of bugs." +Guest comic by Christine Lemmer-Webber (Spritely). **Guest article by Dan**: +demoing sneakerweb at his local hackerspace — expected 90 minutes, ran +three hours; attendees swapped `.snk` files and left with personal sites, +photography, a cocktail recipe, and a vanity-prefix brute-forcer for +sneakerweb domains. **Guest article by Miaourt**: **Wi-Fi Aware** — phones +can advertise/discover services and open direct high-bandwidth links +(Android 17 / iOS 26), which could power Willow-style proximity sharing — +but Apple/Google force a manual system pairing prompt for apps while +exempting their own Find My/AirDrop, which "kinda make[s] our dreamed p2p +wireless internet useless." +*Relevance: [enc][eco] — WILLIAM3's correctness is re-established via +cross-implementation checking (BLAKE3 modulo the spec deltas). The Wi-Fi +Aware piece is their only transport-adjacent writing: platform gatekeeping, +not protocol design, is the blocker they identify for proximity sync.* + +### 2026-W29 · Jul 13–19, 2026 — DWeb Camp report +Sammy: sneakerweb at DWeb Camp — demo night market table, a workshop +(participants claimed domains, exported `.snk` files), Aljoscha +coordinating physical distribution by USB key; sneakerwebsites reached +Canada, the US, Argentina, New Zealand, Switzerland, the Netherlands, the +UK, Denmark, and Germany; a "getting started" section added to +sneakerweb.org; the site did the rounds on Lobsters and Hacker News. +Aljoscha: post-camp editorial — the politics of the space (software that +"minimises hierarchy and power-over"); his introduction to p2p systems +design "is going to be far from a neutral technical document." +Contribution call: curated good-first-issues in the sneakerweb tracker; +help wanted with cross-compilation for Windows/macOS builds. +*Relevance: [eco] — real-world sneakernet distribution worked socially, +not just technically; the project has outside contributors and press.* + +### 2026-W30 · Jul 20–26, 2026 — Seasonal Clock icons; next phase = networked communication +The Hummingcrow icon set for the **Seasonal Clock** (commissioned by +Gergely Polonkai for the Pebble port; 24 hour-icons at 32px/48px, colour + +1-bit versions, CC-BY-SA-4.0, in Gergely's repo) is showcased. Sammy +(holiday editorial): "**The next phase of Willow will be about exploring +what sits *just* above the extreme latency of the Drop Format and +sneakerweb. So: networked communication.** My plan is to use the sneakerweb +itself to find the limits of comfort… (this is what people call 'drinking +your own champagne')." Guest editorial by Emmy (lino printing; a Rust +code-joke marking her name change from Dan). +*Relevance: [sync] — explicit sequencing: sneakernet first, internet sync +(WTP) second, dogfooded through their own app.* + +### 2026-W31 · Jul 27–Aug 2, 2026 — Why-worm-blossom part 8 (Seasonal Clock origin) +The series explains the Seasonal Clock's origin: Sammy's Earthstar apps +(microblogging; *Twodays Crossing*, a roleplaying chatroom whose messages +fade over 48 hours) needed a "low res timestamp" that isn't a number — +fractions of the day as symbols (a seed, a leaf, a tree, a shell); +Cinnamon seized on the idea (spreadsheet), and in early 2021 pulled it out +into the standalone **Seasonal Clock** app during "a golden era for the +Earthstar community." +*Relevance: [—] background; establishes the Seasonal Clock as Cinnamon's +design, stewarded by the collective (see project entry).* + +### 2026-W32 · Aug 3–9, 2026 — WTP spec work: keep RequestPut; Broadcast-Based Programming +Aljoscha: published **Broadcast-Based Programming** (on his personal site +aljoscha-meyer.de) — a language-design sketch structuring a PL around +broadcasting information rather than method calls on objects (abandons +object identity; spatial computing via active broadcast). Main work: +**fleshing out the WTP into a full specification**. The WTP has three +request types: `RequestGet` (HTTP GET analogue), `RequestGetMany` (areas +or 3D ranges), `RequestPut` (HTTP PUT analogue). He seriously considered +removing `RequestPut` (pure pull-based read-only protocol) but decided to +**keep it**: otherwise app developers need a separate protocol (dripdrop) +to write entries to a peer, forcing multiplexed/multiple connections — +"complexity that outweighs the minimalism." Next steps listed: rework the +start-of-connection flow (the current draft forces every client to first +prove possession of the secret for its read-capability key — write-only +clients shouldn't be forced into useless signatures or a server challenge); +**remove non-Bab usage** (partial verification is too good to let +implementations skip it — no raw byte-offset payload indexing without Bab +verification metadata); define `GetMany` responses; define encodings; +sketch Rust types for all messages (enums instead of optional-field rules). +Sammy: unified navigation ("mega bar") planned across the worm-blossom / +Willow / Bab / sneakerweb sites. +*Relevance: [sync][auth] — the WTP's connection-start detail matters for +any capability composition: read capabilities are *presented and proven* +at session start in the current draft; write-only flows are being +explicitly designed for.* + +### 2026-W33 · Aug 10–16, 2026 — Generics stripped: `willow25` 0.7.0; old crates deprecated +Aljoscha: "**we stripped out all generics from our Rust Willow +implementation.** … The pull request ends up reducing our lines-of-code by +about 15000. We have published the new code as **`willow25` 0.7.0**, and +we have **deprecated the old, generic `willow_data_model` and `meadowcap` +crates**." On WTP: making the protocol **symmetric** (both peers may +request entries) might be another way of removing `RequestPut` — but the +decision is "sufficiently fundamental" that WTP work is **postponed** +until Sammy has time to weigh in. Media formats: sample encoding fully +specified; a "half-specification half-rant" document on magic numbers in +file formats. Sneakerweb: Emmy's "fix-all-the-things" PR heading toward +**sneakerweb 1.2.0** (Chrome/Edge support). Also: the **Invisible Library** +— a zero-technology push-based book-gifting practice (contrast drawn with +blockchain/IPFS library schemes: "that… seems a bit excessive"); the +editorial notes the p2panda crew's trajectory (festival planning → +Hoffnung3000 → p2panda → Toolkitty) as the pull-based-general-framework +path deliberately not taken. +*Relevance: [rust] — a major maturity signal, in both directions: the +codebase is now concrete Willow'25 only (the generic spec-parameterised +library is abandoned), and the canonical crates going forward are +`willow25` alone. Anyone evaluating "the Meadowcap crate" should know it +is deprecated in favour of willow25's built-in support.* + +### 2026-W34 · Aug 17–23, 2026 — Thin week +Sammy with the kids (no work attempted); a music note. No technical +content. +*Relevance: [—].* + +### 2026-W35 · Aug 24–30, 2026 — PILLOW: the p2panda × worm-blossom collaboration; WTP encoding realisations +Sammy's announcement editorial: in March, at a hotel bar with **adz, +glyph, and sam from p2panda**, they drafted a joint grant proposal hours +before its deadline. "**Pillow is a new collaboration between p2panda and +worm-blossom. It's a way for p2panda apps to quickly store and retrieve +data from highly available peers. These highly available peers don't know +anything about p2panda data, but they do have decentralised, +capability-powered permissions, can happily evict stale data, and can +efficiently sync with each other. That's because they're Willow peers!** +In this grant we'll be implementing **WTP**, meaning that at long last +Willow peers will be able to sync over the internet via range-based set +reconciliation. We'll also be developing WTP-powered servers with web +interfaces for configuring capabilities, data eviction, and viewing +storage usage. The first users of these Willow 'support peers' will be +p2panda apps, which will be able to interface with them via Pillow… we'll +also be bringing a new member into worm-blossom." Aljoscha's double +editorial on **WTP message encodings**: stateless requests (responses +fully self-contained — and therefore indistinguishable from eagerly pushed +messages) vs stateful requests (request IDs + relative encodings, e.g. +omitting the namespace from a response); **cancellation** semantics — +no sensible cancellation for stateless requests; stateful cancellation +must normally be confirmed before state can be freed, *but* +length-prefixing responses lets a receiver discard an unwanted response +and keep decoding, giving immediate non-interactive cancellation. Then the +follow-up: `ResponseGet` and `RequestPut` carry the same information +(absolute vs relative encoding) and can **merge into a single message +type**; making as many messages as possible admit both absolute and +relative encodings enables **both symmetric and asymmetric RBSR** (the old +design was client-driven asymmetric only). Contrast drawn with +Confidential Sync (mandatory stateful encodings, mandatory cooperative +cancellation) — WTP is explicitly designed to do better. +*Relevance: [sync][auth][eco] — the single most decision-relevant post of +2026. p2panda — the project this estate is leaning toward — has itself +chosen Willow peers as its availability layer, with Meadowcap as the +permission system for oblivious storage. That is the composed stack +(p2panda data plane + Willow support peers) being built by the two teams +jointly, with WTP as the wire protocol. It also confirms WTP's design is +still moving (message types merged this week).* + +### 2026-W36 · Aug 31–Sep 6, 2026 — "Support peers are not servers"; test vectors; the big todo list +Sammy's essay defending support peers against "that's just another name +for a server": servers are high-uptime but **not fungible** (a Mastodon +instance being down can't be substituted); peers are fungible but +intermittent (mobile foreground-only); **a fungible machine with high +uptime is "relatively unexplored"** — a swarm of support peers, possibly +constrained (low storage → prioritise recent data), syncing with each +other. Includes the Pillow↔p2panda bridging diagrams. Aljoscha: work on +the **Willow test vector repository** (encoding vectors updated — some had +been outdated and "actively misleading" — plus new data-model test data: +entry-overwrite determination, path lexicographic successor). His +overwhelm todo list is a map of open work: WTP design (proofs of knowing +the secret for a write capability; unifying request messages; feature +pre-announcement; response mapping); the **ed25519 ambiguity issue of +willow25** (filed on GitHub); updating the ed25519 implementation; +"mildly panicking about quantum computers breaking ed25519"; **store +traits for aggregating metadata (for RBSR) and splitting 3D ranges into +roughly-equal chunks (again for RBSR)**; a database file format for 3D +Willow entry storage + prerequisite 3D-zip-tree work; **recommended ways +of encrypting Willow data (and metadata) at rest as part of Willow'25 — +"we already have generic designs, but no specific instantiation for +Willow25 yet"**; API/implementation designs for that encryption; encrypted +sneakerweb sites (backwards-compatible, ideally); a Willow-powered email +alternative sketch + its encryption issues; Macromania website/macros; +more test vectors for Willow and Bab. +*Relevance: [enc][store][auth] — straight from the author's list: +at-rest encryption for Willow'25 is *designed generically, not yet +instantiated*; RBSR store traits are the active implementation frontier; +ed25519 has both an open ambiguity issue and acknowledged post-quantum +exposure.* + +### 2026-W37 · Sep 7–13, 2026 — Test vectors catch a serious capability-verification bug; willow-ts +Contribution notes: **Freckles**, scrutinising the test vectors because +they are writing **a TypeScript implementation of Willow** (browser +Willow), "found a rather serious missing check in our capability +verification implementation" — plus further bugs in specs and +implementation, all reported and fixed through the test-vector process. +**Slug contributed a `sneakerweb` command** (locally removing sites +without blocking them; merged into fix-all-the-things). Sammy: the +"mega bar" navigation is live across the worm-blossom sites; **new Willow +tutorials being written now that the Store and Drop Format APIs have been +published** — writing them surfaces beginner-viewpoint design flaws. +*Relevance: [auth][eco] — two-sided evidence: the capability verifier had +a serious missing check (found late 2026, by an external implementer), +*and* their test-vector programme is exactly what caught it. A third +implementation (TypeScript) is underway.* + +### 2026-W38 · Sep 14–20, 2026 — WTP cast into Rust types; media seeking schemes +Sammy: BYOW webcraft meetup report (Rotterdam). Aljoscha: media-format +**seeking schemes** — two designs for logarithmic segment seeking with +single-pass O(1)-memory encoding: a backwards skiplist over segments +(each segment links to predecessor + a power-of-two skip target), and a +**self-synchronising codes** scheme (zero-byte-prefixed segment indexes, +guess-and-scan seeking). Surfer link: **willow-ts** — "A new TypeScript +implementation of the Willow'25 spec. Not quite production ready." +Aljoscha (second editorial): "I took all my pondering over the WTP design +and cast it into a single ~~specification~~ **collection of Rust types** +for the different message types… I hope I can gather some feedback (from +Heni in particular :3)" — i.e. the Ourcana/Dart implementer is a design +reviewer for WTP. He hopes "the WTP design will stay mostly stable" now. +*Relevance: [sync] — WTP exists as Rust types awaiting feedback, not yet +as a wire encoding or implementation; the design review loop includes the +one production implementer.* + +### 2026-W39 · Sep 21–27, 2026 — Thin technical week +Sammy: LLM/chat-interface editorial (Kate Bush's *Deeper Understanding*); +contributed content from meetup attendees. Aljoscha: nothing to report +(vacation/cold) + a programming-language design sketch (interface-only +type system; equality from publicly observable behaviour only). +*Relevance: [—].* + +### 2026-W40 · Sep 28–Oct 4, 2026 — Sneakerweb 1.2.0 released +Announcement: **sneakerweb 1.2.0** — importantly, collections can now be +browsed from **Chromium and WebKit browsers (Chrome, Safari)**: the +problem was the **base16 encoding previously used for domains**, which +produced hostnames too long; **domains now use base32** (old base16 links +still work in some browsers). Also added: **`sneakerweb remove`** (remove +a domain + its data without blocking it — "an extra level of nuance to +curating your collection"); `serve`/`publish` respect **custom collection +locations** (independent collections; "a stopgap to more complete +collection organisation"). Downloads at sneakerweb.org; full changelog on +Codeberg; thanks to Emmy, slug, and interfect for contributions. +*Relevance: [eco] — a shipped, versioned product with a changelog and +outside contributors; the base16→base32 fix is a real-world encoding +lesson (hostname length limits) from production use.* + +### 2026-W41 · Oct 5–11, 2026 — Store tutorial published; Pillow support-node work begins +Announcement: **a new Store tutorial on willowprotocol.org** — willow25's +storage APIs (released two months earlier; "the same APIs we use to power +sneakerweb") now have a walkthrough: instantiate a store, insert an entry, +get it back, append a payload, query areas. Sammy describes the tutorial +pipeline (a `willow-tutorials` repo holding runnable tutorial code; +rustdoc JSON dumped and committed to the willowprotocol.org repo, whose +macro turns API references into docs.rs links). Sammy's main work: **the +Pillow support nodes** — "configurable Willow peers which can communicate +with any other peer which understands WTP. You'll be able to configure +them with capabilities (so that they know what to sync), set storage +limits (so that your Pi with 4gb of storage can pitch in), and configure +if it should sync with other support nodes too. So it's got to be a little +TCP server which can field WTP requests, *and* a HTTP server which serves +up a web UI for administration." Framework research: she likes **Rocket**'s +shape and plans to practise by refactoring sneakerweb's (single-threaded, +"very relaxed pace") HTTP server to Rocket first — then use it for Pillow. +Also: owned vs communal Meadowcap namespaces explainer still being worked +on ("it's about describing the most powerful capability each kind can +have"). Aljoscha: began the **WTP specification** proper (nothing online +yet); **Cardboard** recalled — his older spec for papers-as-static-websites +bundled with their transitive citations; sneakerweb enables the same thing; +proposes **sneakerdep**: a `/sneakerdeps.json` per site listing depended-on +domains, enabling transitive extraction of a self-contained collection and +lazy/on-demand partial downloads of large "papers." +*Relevance: [sync][auth][eco] — Pillow's support node is, in estate terms, +a capability-configured always-on relay/store peer with an admin UI — +the closest existing analogue to the "dumb relay" tier in composed-stack +designs, and it is being built now, not vapourware-roadmapped.* + +### 2026-W42 · Oct 12–18, 2026 — `ufotofu` 0.12.7 (tokio wrappers); Rocket experiment FAILS on frugal async +Announcement: **ufotofu 0.12.7 released**, featuring **compatibility +wrappers for the tokio async runtime** — "Now you can use, say, a +tokio-provided TCP stream with ufotofu." Sammy: the Rocket experiment's +verdict — "**sneakerweb cannot work with Rocket.** We can get ufotofu and +Willow'25 working with tokio, but only with the `current_thread` +(i.e. single-threaded) flavour of tokio. Rocket requires a multi-threaded +environment. Ufotofu and willow25's incompatibility with a multi-threaded +environment is due to our adherence to **Frugal Async Rust**." She wonders +whether to be concerned "that Willow and Ufotofu *can't* work in +multi-threaded runtimes, or whether I happened to stumble into the one +situation (Rocket) where this was a showstopper." Pivot: **Axum** (works +with single-threaded tokio) for sneakerweb and, by extension, the Pillow +admin UI. Aljoscha: more WTP spec progress (not yet shareable); a call +with Olivia of **wobbleweb** brainstorming wobbleweb×sneakerweb +integration ("aesthetic sovereignty"); Macromania work — the new +**macromania-web** package (URL references across domains, asset +moving/transformation, automatic stylesheet/script dependency injection; +KaTeX now renders on worm-blossom.org "in a principled way"). +Why-worm-blossom penultimate instalment: Sammy inherits Earthstar +stewardship from Cinnamon (2022); Earthstar's sync was "theoretically the +worst possible implementation imaginable: two peers exchange *everything* +they have"; Aljoscha recruited for set reconciliation. +*Relevance: [rust] — a hard, named constraint for any adopter: the whole +Willow/ufotofu stack is single-threaded-tokio only (`current_thread`), +by deliberate design (no `Send` futures). Compositions must budget for +that (e.g. a dedicated thread/runtime per peer), and the authors +themselves flag it as an open worry.* + +### 2026-W43 · Oct 19–25, 2026 — Emmy joins worm-blossom; first anniversary +Announcement: "**Emmy Walker is officially joining as worm-blossom's third +member.** Emmy caught our attention with their high quality contributions +to Ufotofu, and has been a driving force behind sneakerweb. Emmy will +immediately be joining the Pillow project." Sammy's anniversary editorial: +"Since then we've posted **52 weeks of editorials**, musical compositions, +and comics. We even released some software." Emmy's forward list: ufotofu +guides ("how to" and "why to") + API creature comforts; making ufotofu +"weirder" (nested producers/consumers); "**working on the Willow'25 side +of the Pillow project, including implementing WTP**"; a +**`SummarisableStorage` trait** "coming to a Codeberg repo near you very +soon." Aljoscha: anniversary reflections (the original premise — publish +useful incremental work — vs the "pretty mad and unsustainable dash" of +the first three months; Macromania is "of all our tooling the one we are +currently using the most" yet least progressed); **multidimensional +G-trees** definition (generalising 2D zip-trees to 2D G-trees; insertion/ +deletion "left as an exercise to the reader"). Final why-worm-blossom +instalment: the name is a Seasonal Clock time ("speak to you at +*worm-blossom*"); the weekly p2p call circle includes Sam Andreae and +glyph of p2panda; Sammy + Aljoscha built a TypeScript RBSR implementation +for Earthstar (Sammy wrote a *monoid skip list*). +*Relevance: [eco] — team of three now, with the third member assigned to +WTP implementation for Pillow; the SummarisableStorage trait is the RBSR +store API landing.* + +### 2026-W44 · Oct 26–Nov 1, 2026 — New WTP specification uploaded +Announcement: "**We have uploaded a new version of the Willow Transport +Protocol specification.** We will start implementing things based on this +spec, so any and all feedback is highly welcome. The WTP is a protocol by +which peers can exchange Willow data. It supports both **pull-based** (one +peer issues a request, the other responds) and **push-based** (one peer +issues a *long-lived* request, and the other can continuously send new +matching data over time) communication. It can **resume interrupted +payload transfers through the power of Bab**. It can do **efficient set +reconciliation**. It supports both **stateful or stateless operation**. +Oh, and **it doesn't have an actual on-the-wire encoding yet.** We will +start working on that after there's been a bit of time for feedback." +New column launched: **Auntie Source** (agony-aunt for open source). +*Relevance: [sync] — the definitive WTP status: spec (sans wire encoding) +published and declared implementable-for-feedback; push subscriptions are +back in (as long-lived requests) despite the 2025 pull-based doctrine — +the doctrine yielded to a cleaner formulation.* + +### 2026-W45 · Nov 2–8, 2026 — Amparore's denormalisation: AreaSlices dissolve the 3D storage problem +Aljoscha: an email from **Elvio Amparore** ("Some observations on Willow +storage and RBSR," building on his 2026 papers on range-based set +reconciliation via range-summarisable order-statistics stores) "was so +impressive that we immediately started reworking the WTP spec and several +pages of Willow docs. Put simply: **it is possible to efficiently answer +arbitrary Area queries *without multidimensional data structures*.**" The +idea: **denormalisation** — materialise additional one-dimensional indexes +instead of one multidimensional structure. Per-subspace 2D trees +(timestamp × path) plus an all-subspaces tree reduce 3D→2D; a further +per-path-prefix denormalisation reduces to 1D trees (each entry indexed in +as many trees as its path has components), and every Area query consults +exactly one index. Generalised: **AreaSlices** — groupings that can be +split into evenly-sized subslices, still served by the denormalised +indexes, and convertible into a small number of normal 3D ranges (so +traditional 3D backends can serve them too). "**We have a definition of +AreaSlices. And the new WTP spec does RBSR in terms of AreaSlices +already. Our old 3dRange type is effectively deprecated.**" The payoff +they name: the Areas-over-arbitrary-ranges restriction, chosen years +earlier, is exactly what makes this possible. Sammy: two `.snk` deliveries +by train (the second-edition guide); sneakerweb **axum branch** underway +(partly as Pillow admin-UI practice); Frugal Async vs multi-threaded +runtimes friction again ("five hours of coding and then running face-first +into a brick wall of inscrutable Rust compiler errors concerning the +`Send` trait"), but reconcilable. Emmy: **SummarisableStore** work +progressing on the Amparore clarity. +*Relevance: [store][sync] — the estate-relevant consequence: a Willow +store no longer needs an exotic 3D index; denormalised 1D/2D indexes +(a design any SQL/kv backend can express) suffice for Area queries and +RBSR. This materially lowers the cost of a libsql/SQLite Willow store — +the gap the earlier research note flagged.* + +### 2026-W46 · Nov 9–15, 2026 — Prefix pruning vs Meadowcap scoping; LLM policy; trailing empty components +Sammy's editorial (from a community report by **Alex Burdiyan**): **the +prefix-pruning vs scoped-capability tension** — if you hold read +permission only for `/blog/summer`, a write to `/blog` prefix-prunes your +data, but Meadowcap "really doesn't let you learn about something outside +of the granted area," so the deletion cannot propagate to you without +breaking the scoping rule. Resolution: "**we can let peers determine +whether to reveal pruning entries at their own discretion during sync**" +— no spec change needed. Also a **spec-status policy change**: statuses +are Draft, Proposal, Candidate, Final; "previously we promoted the Willow +Data Model and Meadowcap to final after implementing them, but **in the +future we'll only be doing so after these implementations have seen +meaningful real world usage**." Announcement: **LLM policy** — worm-blossom +projects "won't accept contributions containing output from LLMs" +(formalised on Codeberg). Emmy's editorial: the **trailing empty component +convention** — store data at `/some/path/` so that adjusting +`/blog/summer` doesn't prefix-prune `/blog/summer/assets`; writes carry a +trailing empty component, deletions don't (empty payload), so entries +split into two flavours: writes and deletions. Sharing signed deletions +out-of-scope still leaks *who/when/at what prefix*, but no payload +information — making the W46 pruning-disclosure trade-off easier to reason +about. Aljoscha: Macromania **defref** ported with **cross-domain +references** (via WebTT) — worm-blossom.org can now define-discuss +AreaSlices although they're defined on willowprotocol.org. +*Relevance: [auth] — a genuine, newly-surfaced (Nov 2026) semantic gap +between deletion propagation and read scoping in Meadowcap/Willow, with +the authors' chosen mitigation (peer-discretionary disclosure) rather than +a protocol fix. Also note: the "Final" status of the Data Model and +Meadowcap specs was granted on implementation, not usage — by the +authors' own new standard, treat both as less battle-tested than the +label suggests.* + +### 2026-W47 · Nov 16–22, 2026 — Sneakerweb axum release (speed + big sites); SummarisableStore done; WTP encodings nearly done +Announcement: **a new sneakerweb release focused on speed and big sites** +— sites served "as fast as locally stored content should be served"; +**very large files (video) served/scrubbed/seeked via the `video` +element**; sites' total byte sizes shown on the front page; collection +orderable by size; responsive front-page layout; progress indicator for +`sneakerweb publish`; "made possible by **replacing our homebrew web +server with axum**, with Emmy interfacing axum to the Willow store" +(Emmy built **ufotofu↔axum streaming-body adapters**; a ~150 MB-per-episode +BBC series sneakersite as the test case). Also: Aljoscha's album *Computer +Has No Feelings* on Bandcamp (the sneakerweb version's track 4 differs — a +cover, replaced on Bandcamp for legal reasons). Emmy: **store summarising +finished** — "These summaries are one of two ingredients we need to +perform **region-based set reconciliation**… The remaining ingredient is +the ability to split the contents of a store into evenly-sized chunks… +Once we can do both of these things, we'll be well on our way to +implementing the WTP, and having Willow peers that synchronise just the +data they want and need, over the internet." And her **splittable storage** +work (AreaSlices split "more or less by construction" thanks to Amparore); +the wrinkle: "most recent N entries" subsets can only be reported +best-effort, which simplified the summarising API. Sammy: sneakerweb +site-size "weights" (green 0–10 MB, orange 10–100 MB, red >100 MB); +*Sammy's guide to the sneakerweb* 2nd edition now a downloadable `.snk` +starter pack; sneakerweb funding proposals sent; two in-person workshop +proposals accepted; the Safari 30-second-request mystery (base32 hostnames +→ localhost + connection handling); the **willowprotocol.org outage** +(Deno Deploy credits exhausted → six hours down for a static site; site +redeployed and **its repo moved to Codeberg**). Aljoscha: "getting close +to being done with **WTP encoding designs**" (wrists recovering). +Link note: "A Critique of GPUI" (blog.zortax.de) shared by Sammy with a +brief comment (loved Elm; lack of component-level state was fiddly; lack +of a component model makes render diffs harder) — a shared link + comment, +not a worm-blossom position paper. Upcoming: **sneakmeet @ v2 Rotterdam, +13 Dec 26**. +*Relevance: [sync][store][eco] — as of the latest update: store +summarising (RBSR ingredient 1 of 2) is done, splitting is underway, WTP +encodings are nearly designed. Internet sync is the active frontier, not +a finished feature — plan any adoption accordingly.* + +--- + +# Part 2 — The projects + +Ordered by decision-relevance. "Depends on it" lists what the diary itself +attests. Versions/dates are as announced in the diary or shown on the +project's own page. + +## 1. Willow — the protocol family (willowprotocol.org) +**What:** A family of peer-to-peer storage protocols: the **Data Model** +(entries = subspace × path × timestamp + payload digest; state-based CRDT +join-semilattice; last-writer-wins per (subspace, path) with prefix +pruning = traceless deletion), **Meadowcap** (capability authorisation), +**Confidential Sync** (private, MITM-resistant sync — now demoted, see +below), **Drop Format** (single-file sneakernet transport), **WTP — Willow +Transfer Protocol** (the new network sync protocol), **Willow'25** (the +recommended parameter instantiation: ed25519, WILLIAM3, TAI timestamps), +the **`willow://` URI scheme**, and **AreaSlices** (the RBSR grouping, +late 2026). Spec statuses (their ladder: Draft → Proposal → Candidate → +Final): Data Model and Meadowcap were promoted to **Final** after +implementation — under the policy announced 2026-W46, future promotions +require meaningful real-world usage first. +**Maturity:** Specs mature and versioned; implementations mid-flight (see +willow25). Confidential Sync is effectively superseded by WTP before ever +shipping broadly — the 2025-W52 post-mortem calls its complexity the +collective's biggest mistake. +**Depends on it:** sneakerweb, Pillow support peers, Ourcana, Earthstar 11 +(per the earlier research note), the Interactive Data Model toy. +**Relevance:** The family's centre of gravity. The honest internal history +(maximalism post-mortem, pull-based doctrine, WTP replacing Confidential +Sync) is documented in the diary, not hidden. + +## 2. Meadowcap (spec) +**What:** The capability system: receiver-bound signed delegation chains +over Areas (subspace × path-prefix × time-range), communal vs owned +namespaces, self-certifying write tokens; read enforcement is cooperative +(sync layer). Full analysis in `willow-meadowcap.md`. +**Maturity:** Spec Final (see the status-policy caveat above); Rust +implementation folded into willow25 (2025-W49) after the standalone crate +(2025-W48) was deprecated (2026-W33). Known open edges from the diary: +no revocation (by design — time-bounded grants + supersession), the +2026-W46 pruning-vs-scoping tension (mitigated by peer-discretionary +disclosure), and a **serious missing check found in the capability +verification implementation in 2026-W37** via test vectors (fixed). +**Depends on it:** Willow sync/drop authorisation everywhere; Pillow's +"decentralised, capability-powered permissions" are Meadowcap. +**Relevance:** The estate's candidate capability layer; the diary adds +production-hardening evidence (and caveats) the spec alone doesn't show. + +## 3. willow_rs / `willow25` (Rust implementation) +**What:** The reference Rust implementation of the Willow specs. Current +shape (post-2026-W33): a single concrete crate **`willow25`** (Willow'25 +parameters only) with data model, groupings, Meadowcap, Drop Format, and +storage (`MemoryStore`, Fjall-backed `PersistentStore`). The formerly +generic `willow_data_model` and `meadowcap` crates are **deprecated**. +**Maturity:** Active weekly development. Milestones: 0.2.0 groupings +(2025-W45), storage trait + MemoryStore in `willow_data_model` 0.6.1 +(2025-W52), `PersistentStore` 0.5.0-alpha.1 ("we expect the persistent +store to be buggy," 2026-W16), **0.7.0** generics stripped (−15,000 lines, +2026-W33), storage APIs powering sneakerweb + Store tutorial (2026-W41), +SummarisableStore (RBSR) landing (2026-W47). Constraints: **tokio +`current_thread` only** (frugal async — no multi-threaded runtimes); +**no SQLite/libsql backend** (Fjall instead); WTP not yet implemented +(encodings in design, 2026-W47). Test vectors repo maintained and used by +external implementers. +**Depends on it:** sneakerweb, Pillow (in progress), Ourcana's server +nodes. +**Relevance:** Adopting Willow in Rust today means adopting willow25's +concrete, single-threaded, Fjall-backed shape — or writing your own store +backend against its traits (which Amparore's denormalisation result makes +much cheaper than it looked a year ago). + +## 4. Bab / `bab_rs` (+ bab-hash.org) +**What:** A **family of hash functions** inspired by BLAKE3 and Bao, with +"judicious tweaks": APIs designed from a storage rather than a hashing +perspective, constant-size length proofs, a parameterisable specification, +and optimised computations for repeating substrings. Bab is about +**verifiable partial data**: make progress on interrupted connections, +detect malicious partial transfers, download concurrently from multiple +sources. **WILLIAM3** is the recommended parameterisation (Willow'25's +payload digest). `bab_rs` provides the generic implementation + WILLIAM3, +plus storage backends over a minimal `ByteStorage` trait (in-memory, +filesystem) supporting verifiable streaming and multi-subslice storage. +**Maturity:** Funded development **concluded** (2026-W24/W25). Releases: +first release 2025-W41; alpha verifiable streaming 2026-W12 (k-grouping +optimisation "very, very likely to be broken" at the time); 0.6.0 fuzz- +clean (2026-W23); 0.6.1 multi-subslice backend (2026-W24); **0.8.0 +(2026-W28) — WILLIAM3 digests verified equal to BLAKE3 modulo the spec +differences**, after the Zig implementers and Vivicat found digest bugs +(2026-W26). SIMD assembly contributed by Sarah (2–4×, pending merge at +last report). A **Zig implementation** exists (Spritely-adjacent authors). +**Depends on it:** Willow payload verification everywhere (Drop Format +partial payloads, WTP resumable transfers, the persistent store's +"streaming, verified storage"). +**Relevance:** Bab vs BLAKE3 is a real trade: BLAKE3 alone gives you +verified streaming via Bao, but Bab adds the storage-first API, +parameterisation, constant-size length proofs, and repeating-substring +optimisation — at the cost of a young implementation whose digest bugs +were only flushed out in mid-2026 by cross-implementation checking. The +0.8.0 verification approach (diff against BLAKE3 with the spec deltas +undone) is the right kind of evidence; there is still no independent +audit. + +## 5. Ufotofu +**What:** A Rust library of abstractions for lazily producing/consuming +sequences — **producers and consumers** (their streams/sinks), designed +around strict producer/consumer **duality**: `Producer`/`Consumer`, +`BufferedProducer`/`BufferedConsumer`, `BulkProducer`/`BulkConsumer` for +zero-copy slice processing, `pipe`/`bulk_pipe`, plus **codec traits** +(`Encodable`/`Decodable` with **relative encodings**) that map directly +onto Willow's encoding relations, with a proptest harness (`assert_codec`) +that has found bugs in spec encodings. Futures are **not cancellation- +safe** and carry **no `Send` bound** (single-threaded runtimes only) — +deliberate "frugal async" design. Site: worm-blossom.org/ufotofu/. +**Maturity:** The most mature code they ship: a decade of simmering, +releases through **0.12.7** (2026-W42, tokio compatibility wrappers); +external contributors with publishing rights (danmw/Emmy published 0.10.1); +Emmy is writing "how to / why to" guides (2026-W43). +**Depends on it:** willow25's encodings and Drop Format implementation; +sneakerweb (ufotofu↔axum streaming adapters); historically the reason +Willow's async code looks the way it does. +**Relevance:** If the estate adopts any worm-blossom code first, this is +the lowest-risk piece — and the `Send`-lessness is the constraint that +propagates up the whole stack (see the Rocket failure, 2026-W42). + +## 6. Sneakerweb (+ sneakerweb.org) +**What:** "A parallel web transported by physical media" — a p2p protocol ++ CLI for web publishing without DNS, registrars, or hosts. Claim a domain +(a base32-encoded key, yours forever), `publish` a static site to it, +`export`/`import` collections as **`.snk` files (Willow drops)**, +`block` unwanted domains, `remove` without blocking, `serve` the +collection to an ordinary browser at `sneakerweb.localhost`. Sites merge +and forgery is prevented by Willow/Meadowcap; a full protocol +specification exists beyond the CLI. In design: **sneakerdep** +(dependency lists for transitive collections) and collection roots/GC. +**Maturity:** **Released** 2026-W27; **1.2.0** 2026-W40 (base32 domains +fixing Chromium/WebKit hostname limits, `remove`, custom collections); +axum-based speed/big-sites release 2026-W47 (seekable video from the +local store). Real-world distribution demonstrated at DWeb Camp (sites +reached 9 countries by USB key); HN/Lobsters coverage; outside +contributors (Emmy, slug, interfect); workshops running (sneakmeet @ v2 +Rotterdam, 13 Dec 2026). Note on names: there is **no separate product +called "sneaker world"** — Sammy uses "sneaker-world" once as a jocular +dateline ("This week's news from sneaker-world"); the project is +sneakerweb, its sites are sneakerwebsites, its events sneakmeets. +**Depends on it:** — (it is the flagship application; it depends on +Willow, Meadowcap, Drop Format, Bab, willow25, ufotofu, Fjall store). +**Relevance:** The existence proof that the whole stack composes into a +shipped product people enjoy using — and the dogfood that drove the Drop +Format streaming revision, the base32 fix, and the store APIs. + +## 7. Pillow (with p2panda) +**What:** A joint p2panda × worm-blossom grant project: **Willow "support +peers"** — highly available peers that store/retrieve data for p2panda +apps without understanding p2panda data: decentralised capability-powered +permissions (Meadowcap), happy to evict stale data, efficiently syncing +with each other via **WTP**. Deliverables: the WTP implementation, plus +support-node servers with web UIs for configuring capabilities, data +eviction, and storage usage. Support nodes are configurable Willow peers +(WTP over TCP + HTTP admin UI; storage limits; optional support-node +inter-sync). +**Maturity:** Announced 2026-W35; in active build (Sammy on support +nodes/UI, Emmy on Willow'25/WTP implementation) as of the latest updates. +**Depends on it:** p2panda apps are the named first users. +**Relevance:** Directly the estate's question, answered by the field: +p2panda's own availability layer is being built on Willow+Meadowcap. +Watch this project's deliverables as the WTP's first production test. + +## 8. Macromania (+ macro packages) +**What:** A TypeScript-embedded, JSX-syntax templating DSL for generating +strings — "especially good at HTML" — used to generate willowprotocol.org +and worm-blossom.org (definitions/tooltips via **defref**, RSS, code +highlighting). Core lives in its own Codeberg org (`macromania`); +packages published on JSR under `@wormblossom`: macromania (v1.0.2), +macromania-cite, -config, -counters, -defref, -fs, -html, +-idempotentify, -katex, -logger, -memoise, -names, -web (v0.4.2), +-webtt, and **wb-megabar** (the cross-site navigation bar); plus +`getting-started-with-macromania` (example repo). The GitHub repo is a +migration stub pointing at Codeberg. +**Maturity:** Core stable since 2025-W42; in daily use for all their +sites; high-level onboarding docs still missing (their own assessment); +Aljoscha calls it the tooling they use most and progress it least +(2026-W43). +**Depends on it:** all worm-blossom websites; WebTT's reference behaviour. +**Relevance:** Low for the auth/transport decision; it explains the spec +sites' unusual quality (cross-domain definition tooltips) and is a real, +if niche, JSR-published ecosystem of 15 packages. + +## 9. WebTT (Web Tooltips) +**What:** A small specification for nestable **cross-domain tooltips with +no server-side logic**: include a compliant JS file + CSS, mark elements +with `data-tooltip-anchor`, tooltips load in an iframe on mouseover. +**Maturity:** Spec published 2025-W50; JS implementation on Codeberg; +macromania-webtt package on JSR; powers the Willow spec sites' tooltips +and defref's cross-domain references (2026-W46). +**Relevance:** Minor, but it's the mechanism that makes their multi-site +spec corpus feel like one hyperlinked document. + +## 10. Frugal Async Rust / `frugal_async` +**What:** A set of simplifying assumptions for async Rust (documented on +the Frugal Async Rust page) + a utility crate (e.g. an awaitable Mutex; +smol-based): futures need not be `Send`, runtimes may be single-threaded, +APIs get simpler and cheaper. +**Maturity:** Page + crate released 2025-W42; the doctrine is load-bearing +across ufotofu/willow25. +**Relevance:** The single most consequential *constraint* in their stack +for an adopter: everything is `current_thread`-tokio only (Rocket +incompatibility, 2026-W42; `Send`-bound friction with axum, 2026-W45). + +## 11. `compact_u64` +**What:** A Rust crate implementing the machine-friendly variable-length +u64 encoding used throughout the Willow specs — length-up-front (contrast +LEB128), word-at-a-time decoding, lexicographic order = numeric order. +**Maturity:** Released 2025-W47; small and stable by design. +**Relevance:** A borrowable micro-design: order-preserving varints are +directly useful in kv/SQLite index keys. + +## 12. `order_theory` +**What:** Rust traits for order theory — successors, min/max, lattices — +born from Willow's grouping needs; generic array implementations reused +by willow25; its property-testing utilities found errors in their earlier +groupings code. +**Maturity:** Published 2025-W45 ("accidentally" — released while tidying). +**Relevance:** The semilattice formalisation under Areas/RBSR, as a +standalone borrowable crate. + +## 13. Seasonal Clock (seasonalclock.org) +**What:** Cinnamon's "global clock with non-numerical hours": the day is +divided into named, symbol-bearing fractions (seed, leaf, tree, shell…) +instead of numbers — designed to gently replace Swatch Internet Time. +Stewarded by worm-blossom (repo in the org; the site is theirs to keep). +**Maturity:** Long-standing small app; **Gergely Polonkai's Pebble +e-paper watch port** (via SSB) in progress, with the Hummingcrow 24-icon +set commissioned and delivered (2026-W19, W30). +**Relevance:** None for the protocol decision; included for completeness — +and because the collective's name is one of its hours ("speak to you at +worm-blossom"). + +## 14. Earthstar (predecessor; Sammy is steward) +**What:** Cinnamon's earlier p2p storage protocol/project (TypeScript), +from which Willow descends: Earthstar dropped SSB-style immutability +(deletion/editing, subset download in any order, one keypair = a person +across devices) but lacked efficient sync for unlinked sets — the gap +Willow's set reconciliation fills. Sammy inherited stewardship in 2022 +("mortality driven development": Cinnamon left extensive design docs, +comments, tests). Earthstar 11 is being built on Willow (per the earlier +research note). +**Maturity:** Legacy/predecessor; its community produced Willow's first +external implementer ecosystem (Ourcana's author is an Earthstar lurker- +turned-implementer). +**Relevance:** The lineage explains Willow's non-negotiables: real +deletion, subset sync, person-keypairs. + +## 15. wb-box + the playlists (music tooling) +**What:** Their fork of BeepBox (via AbyssBox) — a piano-roll chiptune +player/editor whose distinguishing feature is **playlist pages**; powers +worm-blossom.org's weekly tracks, the Weekly Tracks / Assorted Music +playlists, and Aljoscha's albums (*Computer Has No Feelings*, +*Circumference* — distributed via sneakerweb first). +**Maturity:** In weekly production use since 2025-W49. +**Relevance:** None for the decision; completes the project census (and +explains the "Edit link" saga in the diary). + +## 16. Interactive Willow Data Model (toy) +**What:** A browser toy on willowprotocol.org: view/add entries and "sync" +between three peers, to build intuition for the data model. +**Maturity:** Released 2025-W47; Codeberg repo (org listing: "An +interactive toy version of the Willow Data Model," updated 2025-11-21). +**Relevance:** The fastest way to develop a feel for entries/Areas before +reading the specs. + +## 17. Willow test vectors (repo) +**What:** Inputs + expected outputs for Willow encodings and data-model +functions (overwrite determination, path successor, capability +verification), maintained on Codeberg; refreshed 2026-W36 after some +vectors had become "outdated and thus actively misleading." +**Maturity:** Actively maintained; used by Freckles (willow-ts) and Heni +(Ourcana) as correctness criteria. +**Relevance:** The interop backbone — and demonstrably a bug-finding +instrument for the reference implementation itself (2026-W37). + +## 18. willow-tutorials (repo) +**What:** A Codeberg workspace holding the runnable code for +willowprotocol.org's Rust tutorials (data model, groupings, Store), with +a rustdoc-JSON → site-macro pipeline keeping docs and code in sync. +**Maturity:** Created ~2026-W40; Store tutorial published 2026-W41. +**Relevance:** Onboarding path for any estate developer evaluating +willow25 hands-on. + +## 19. Rummager (proposal only) +**What:** A proposed general-purpose GUI application for "organically +expressing your own applications through the act of nesting free-form +data" on Willow. +**Maturity:** Grant proposal **rejected** (2025-W46); prototype only as +spare time allows; no code known. +**Relevance:** None directly; shows their application ambitions beyond +publishing (general personal data). + +## 20. Cobweb + Sufficiently Good Media Formats + Cardboard (designs) +**What:** Three design-stage projects from the editorials: **Cobweb** +(2025-W51) — a hypertext system on Willow (transclusion, Willow URIs, +one simple image format, Bab-verified progressive media); **Sufficiently +Good Media Formats** (2026-W01, W38, W39) — unified image/audio/video +formats, quantisation-only lossy step, LZ + predictor residuals, novel +segment-seeking schemes (backwards skiplist; self-synchronising codes), +target ~400 lines of C each; **Cardboard** (Aljoscha's older GitHub spec) +— papers as static websites bundled with transitive citations, the idea +sneakerdep now revives inside sneakerweb. +**Maturity:** Designs/editorials only; no implementations announced. +**Relevance:** Low; the media-format seeking work shows the same +data-structure depth they bring to storage, and Cobweb is the long-term +"what Willow apps could feel like" sketch. + +## Independent implementations (not worm-blossom projects — adoption evidence) + +- **Ourcana (Dart/Flutter)** — Sarah Aronson's plural-community app + (~9,000–10,000 users) with **her own Willow implementation in Dart**, + bit-compatible "over the wire" with the Rust implementation; a WTP-draft + client; Rust willow25 runs on always-on server nodes; Dart submodule + planned for open-sourcing. Interview: 2026-W23. Her feedback changed the + Drop Format spec (streaming/dripdrop). +- **willow-ts (TypeScript)** — Freckles' Willow'25 implementation for the + browser; "not quite production ready" (2026-W38); its auditing of the + test vectors found a serious capability-verification bug (2026-W37). +- **Bab in Zig** — by Spritely-adjacent implementers; found the WILLIAM3 + digest bugs (2026-W26) that led to the verified 0.8.0. + +--- + +# Part 3 — What the catalogue adds up to + +## The posts that matter most for the estate's decision + +1. **2026-W35 (Pillow)** — p2panda itself is building its availability + layer on Willow peers with Meadowcap permissions, and funding WTP. + The "p2panda + capability layer" composition the investigation + converged on is the one the two projects chose themselves. +2. **2025-W52 (maximalism post-mortem + 2026 roadmap)** — Confidential + Sync's complexity admitted and demoted; pull-based doctrine; WTP and + the capability-scoped Willow server named as the future. Read before + citing Confidential Sync as a reason to adopt anything. +3. **2026-W44 + W32 + W35/W36 (WTP design trail)** — WTP's actual status: + spec published without a wire encoding; message model still being + merged/symmetrised; stateful *and* stateless operation; Bab-verified + resumable transfers; RBSR over AreaSlices. +4. **2026-W45 (Amparore/AreaSlices)** — the 3D-storage objection to + Willow dissolves into denormalised 1D/2D indexes; a SQL-backed store + becomes a design exercise, not a research project. +5. **2026-W46 (pruning vs scoping) + W37 (capability-verification bug)** + — the two hardest honesty tests in the diary: a real semantic tension + in Meadowcap/Willow (mitigated, not solved) and a serious verifier bug + (caught by their own test-vector programme, via an external + implementer). +6. **2026-W26 + W28 (WILLIAM3 bugs → verified 0.8.0)** — Bab's maturity + in one arc: wrong digests in the reference implementation in June + 2026; cross-implementation verification restoring confidence in July. +7. **2026-W23 (Ourcana interview)** — the only production deployment + story: ~10k users, an independent implementation, and the + "Rust is a service, Dart/Flutter are for clients" topology — which + maps neatly onto support-peer thinking. +8. **2026-W33 + W42 (generics stripped; Rocket failure)** — the + implementation's real shape: concrete, single-threaded, frugal-async. + Any composition must be designed around `current_thread` tokio and + no-`Send` futures. +9. **2025-W47 (semilattice editorial) + 2025-W46 ("fancy CRDTs")** — the + theoretical core: Areas as sublattices unifying access control and + partial sync; LWW-over-history as a deliberate, argued choice. +10. **2026-W36 (support peers essay + todo list)** — the fungibility× + uptime framing for relay-like peers, and the author's own list of + what's *not* done (Willow'25 at-rest encryption instantiation, + RBSR store traits, ed25519 PQ exposure). + +## Surprises + +- **The diary is an unusually candid engineering record.** Failed + experiments (Rocket), broken optimisations (Bab k-grouping), wrong + digests (WILLIAM3), a serious capability-verification bug, an + over-complex flagship protocol (Confidential Sync) — all published by + the authors themselves, usually within a week. For due-diligence + purposes this blog is worth more than the specs' status labels. +- **"Final" doesn't mean final.** The Data Model and Meadowcap were + promoted to Final on implementation alone; the collective changed the + rule in Nov 2026 to require real-world usage — retroactively + downgrading what their own Final labels certify. +- **Encryption is the thinnest layer.** Drop encryption was *removed* + from the Drop Format spec (left to apps); Willow'25 at-rest encryption + has "generic designs, but no specific instantiation yet" (2026-W36); + encrypted sneakerweb sites are a hope, not a feature. The Encrypted + Willow analysis in the earlier note is consistent with everything the + diary says across a full year. +- **The ecosystem is real but small and personal.** Three members, a + handful of recurring contributors, one production app (Ourcana), two + in-progress independent implementations (Dart shipped, TypeScript and + Zig in flight) — and a weekly call that includes p2panda's people. + Bus factor remains the honest summary: two founders + one new member, + grant-to-grant funding (Bab's grant ended mid-2026; Pillow is the + current vehicle). +- **They refuse LLM-generated contributions** (policy formalised + 2026-W46) — relevant if the estate ever wants to upstream patches: + contributions must be human-written. +- **"Sneaker world" is not a thing** — just a joke dateline. Sneakerweb, + sneakerwebsites, sneakmeets, `.snk` files, and (in design) sneakerdep + are the real vocabulary. +- **GPUI:** the diary contains no worm-blossom position on GPUI — only + Sammy sharing "A Critique of GPUI" (blog.zortax.de) in 2026-W47 with a + brief personal comment about Elm-style architectures. (Answered here + because the catalogue is the natural place a reader would look.) + +## Sources + +- https://worm-blossom.org/archive (index) · /archive_2025_2 · + /archive_2026_1 · /archive_2026_2 · front page (W40–W47 duplicates) · + /archive/comics/ · /playlists/ (+ /playlists/wb, /playlists/assorted_music) +- https://willowprotocol.org/ · https://bab-hash.org/ · + https://sneakerweb.org/ · https://worm-blossom.org/ufotofu/ +- https://codeberg.org/worm-blossom (org page snapshot, crawled + 2026-07-06: 14 repos listed with descriptions — sneakerweb site, + willow_rs, worm-blossom.org source, bab-hash.org site, bab_rs, ufotofu, + one further repo updated 2026-05-28, compact_u64, frugal_async, WebTT, + interactive Data Model toy, macromania-fs, getting-started-with- + macromania, Seasonal Clock; later repos attested from the diary: + sneakerweb, willow test vectors, willow-tutorials, wb-box, + willowprotocol.org source) · https://jsr.io/@wormblossom (15 packages) + · docs.rs (ufotofu). +- Caveat: the live Codeberg org listing could not be re-extracted in full + on 2026-11-23 (the fetch returned the July snapshot without repo names); + repo names above are corroborated from the diary, JSR, and search + results rather than from a fresh org-page read. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/worm-blossom-projects-addendum.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/worm-blossom-projects-addendum.md new file mode 100644 index 000000000..54b6bb5a4 --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/worm-blossom-projects-addendum.md @@ -0,0 +1,294 @@ +# Worm Blossom projects addendum — Rummager, Cobweb, Macromania, Willow URIs, WebTT + +Lane WB-PROJECTS for the auth + transport investigation +([developing-today/code#13779](https://github.com/developing-today/code/issues/13779)). +Researched 2026-11-23. Baseline: the catalogue entries in +[worm-blossom-catalogue.md](worm-blossom-catalogue.md) (§8 Macromania, §9 WebTT, +§19 Rummager, §20 Cobweb, and the diary entries cited per project), extended +from primary sources: the [projects page](https://worm-blossom.org/projects/), +the [WebTT page](https://worm-blossom.org/webtt), the +[Willow URIs specification](https://willowprotocol.org/specs/uris/) +(read from the local mirror at `~/workspace/worm-blossom-mirror/willowprotocol.org/specs/uris/`), +[JSR package pages](https://jsr.io/@wormblossom/macromania), and the diary +archive / [TODOs 2025 page](https://worm-blossom.org/notes/todos2025). +One sourcing caveat: Codeberg returned HTTP 429 throughout this pass, so +repo-level details rest on JSR, the project pages, and the diary rather than +fresh repo reads; the catalogue's earlier Codeberg org listing corroborates +the repo layout. + +State labels up front: **Macromania — released, in daily production use +(theirs). WebTT — released (spec + implementation, in production on their +sites). Willow URIs — spec published, Proposal status, no implementation +found. Rummager — proposal only, grant rejected, no code. Cobweb — design +sketch only, no implementation.** + +--- + +## 1. Rummager — proposal only + +**What it is.** A proposed general-purpose GUI application on top of Willow. +Sammy's grant pitch (diary, 2025-W45) described it as a way of "organically +expressing your own applications through the act of nesting free-form data" +([catalogue §19](worm-blossom-catalogue.md); [diary archive](https://worm-blossom.org/archive_2025_2)). +The collective's own TODO page states the idea more concretely: "a +Willow-powered, collaborative, multi-media data publishing platform allowing +for arbitrary nesting as the only organisational principle" — with the +ambition to "move from Discord to Rummager for Willow/worm-blossom community +interaction" ([TODOs 2025](https://worm-blossom.org/notes/todos2025)). The +current projects page describes it in the same terms: "a collaborative tool +for manipulating nested data, flexible enough to be useful for a variety of +different tasks (chat, forums, image sharing, etc)", illustrated with +hand-drawn UI sketches ([projects page](https://worm-blossom.org/projects/)). + +**How it would work.** The single organisational primitive is *nesting*: +Willow entries arranged in nested paths, multi-writer and capability-scoped +via Meadowcap, and the "applications" (a chat, a forum, an image board) are +not separate programs but emergent shapes of how a group nests and arranges +its data. It is the personal/small-group data environment the collective +imagines on top of the store — the application-layer counterpart to +sneakerweb's publishing. Aljoscha's TODOs also note an open design question: +assessing how much his bulk-transclusion ideas (see Cobweb) impact Rummager +([TODOs 2025](https://worm-blossom.org/notes/todos2025)). + +**State.** Proposal only, and stalled. The grant proposal was **rejected in +2025-W46**; Sammy's response was "we'll just need to build out a prototype in +our spare time" ([catalogue, 2025-W46 entry](worm-blossom-catalogue.md)). +No repository or prototype has surfaced since; the projects page still +frames it as "an application we would like to build." With the team's funded +time going to Pillow/WTP through 2026, Rummager is effectively dormant. + +**Relation to the stack.** Pure application layer: it consumes Willow + +Meadowcap and adds nothing protocol-side. It exists to answer "what is a +general-purpose Willow app?" — and currently answers it only on paper. + +**Estate relevance.** None directly. Its value to us is diagnostic: the +Willow application ecosystem is so young that even the protocol's own +authors have not shipped a general Willow application — the one they most +want to build is an unfunded sketch. Anyone adopting Willow today is +adopting protocols, not applications. + +## 2. Cobweb — design sketch only + +**What it is.** A hypertext system on Willow, floated in Aljoscha's +2025-W51 diary editorial and still listed on the projects page as "an +application we would like to build on top of Willow: an efficient hypertext +system exploring some ideas around bulk transclusion" +([projects page](https://worm-blossom.org/projects/); [catalogue §20](worm-blossom-catalogue.md)). +Think Gopher/Gemini-grade simplicity, but where documents live in a +multi-writer, capability-scoped Willow store instead of on servers — the +named inspirations are Gopher, Gemini, man pages, RFCs, Mastodon, +TiddlyWiki, and Joplin (catalogue, 2025-W51 entry). + +**How it would work.** Four design commitments from the editorial: +(1) **bulk transclusion** as a built-in — embedding many documents at once +("directory-scale iframes"), so a page can aggregate whole collections +rather than link-or-embed one target at a time; (2) **Willow URIs as the +link format**, which makes links point at mutable entries — content can be +updated without link rot, the deliberate opposite of content-addressed +immutable linking; (3) **extreme authoring simplicity** — a markdown-subset +markup and exactly one simple image format; (4) **efficiency** — a binary, +mmap-able storage format, with media interleaved so images render +progressively and every prefix of the stream is Bab-verifiable as it +arrives. The "Sufficiently Good Media Formats" design work (unified simple +image/audio/video formats, 2026-W01 and W38–39) is largely Cobweb-driven: +one format per media type is a Cobweb requirement, not an independent +whim. An older Aljoscha spec, **Cardboard** (papers as static websites +bundled with transitive citations), is a recognisable predecessor; part of +it now revives inside sneakerweb's sneakerdep (catalogue §20). + +**State.** Design/editorial only. No implementation has been announced; it +sits downstream of two things that don't exist yet either (a Willow URI +implementation and the media formats). It is the long-term "what Willow +apps could feel like" sketch. + +**Relation to the stack.** Cobweb is to Willow what a browser is to HTTP: +the intended reading/aggregation surface. Its conservative sibling +**sneakerweb** — static sites over the Drop Format, exchanged on physical +media — is the version of the vision that actually shipped; Cobweb is the +live-sync, transcluding version that hasn't. + +**Estate relevance.** Low. Nothing to adopt or interoperate with. It is +worth knowing as the clearest statement of where Willow's designers think +hypertext on mutable, capability-scoped data goes (transclusion + +mutable links), and as another data point that the family's application +layer is vision, not software. + +## 3. Macromania — released; the collective's production site generator + +**What it is.** A TypeScript-embedded domain-specific language for +generating strings — "especially good at HTML" — using JSX syntax. Its own +JSR page puts it precisely: "an highly expressive but completely +unopinionated templating language" taking inspiration from Lisp-like macro +expansion and TeX, designed for "meaningful error reporting, principled +interaction between stateful macros, and static typing for the input +expressions" — and, pointedly, "not a UI library… It produces static text" +([JSR: @wormblossom/macromania](https://jsr.io/@wormblossom/macromania)). +It generates willowprotocol.org and worm-blossom.org — including the +definition/tooltip system (defref), RSS feeds, and code highlighting that +make their spec sites feel like one cross-linked document +([catalogue §8](worm-blossom-catalogue.md)). + +**How it works.** You write JSX-looking markup in TypeScript (Deno-first); +macros are typed functions that expand to text, can carry state, and +compose. Around the core sits a family of **15 packages published on JSR +under `@wormblossom`**: the core (v1.0.2), plus -cite, -config, -counters, +-defref, -fs, -html, -idempotentify, -katex, -logger, -memoise, -names, +-web (v0.4.2), -webtt, and wb-megabar (the cross-site navigation bar), with +a `getting-started-with-macromania` example repo. The core lives in its own +Codeberg org (`macromania`); the GitHub repo is a migration stub pointing +there (catalogue §8). 2026 development concentrated in **macromania-web** +(cross-domain URL references, asset moving/transformation, automatic +stylesheet/script dependency injection, principled KaTeX rendering) and in +porting **defref** to support *cross-domain* references via WebTT — so +worm-blossom.org can now define-discuss terms (e.g. AreaSlices) whose +definitions live on willowprotocol.org (catalogue, 2026-W42 and W46 +entries). + +**State.** Released and load-bearing — for them. Core stable since +2025-W42 and in daily use for all their sites; the package family is still +actively publishing (macromania-webtt 0.2.3 shipped days before this +research, November 2026 — see WebTT below). Two honest debits from the +diary itself: Aljoscha calls Macromania "of all our tooling the one we are +currently using the most" yet the one they progress least (2026-W43), and +high-level onboarding documentation is still missing by their own +assessment (catalogue §8). The 2025-W52 maximalism post-mortem also names +the Macromania site rewrite "congealing into a mega-branch" as one of the +collective's formative process failures — the tool is good; the rewrite it +enabled was a lesson. + +**Relation to the stack.** Orthogonal to Willow-the-protocol: it is the +*publishing* layer for the whole project (specs, diary, sites), and the +substrate WebTT's reference behaviour is expressed in (via +macromania-webtt). + +**Estate relevance.** Low, and indirect. We will not adopt a niche, +documentation-poor TypeScript templating DSL. But defref + WebTT together +are a genuinely interesting *documentation technique* — define a term once, +reference it from any of several independently hosted sites, get a tooltip +of the canonical definition — which is the closest existing analogue to +what our own multi-book documentation (fleet/atlas/id/mcpx) might want for +cross-references. Worth remembering as a pattern, not a dependency. + +## 4. Willow URIs — spec published (Proposal); no implementation found + +**What it is.** The `willow://` URI scheme: a standardised, human-readable +way to *name* Willow resources — the stack's missing URL. The specification +opens: "each willow:// URI identifies either an Entry (optionally together +with a single contiguous slice of its Payload), or an AreaOfInterest in +some namespace" ([Willow URIs spec](https://willowprotocol.org/specs/uris/)). +Spec status, per its own header: **Proposal**. + +**How it works.** The syntax mirrors the data model: +`willow://namespace.subspace/path/components?select_features#fragment` for +entries (example from the spec: `willow://family.alfie/blog/idea.txt?from=5&digest=b287af#about`), +and the same shape with `?area&count=12`-style parameters for areas. Four +semantic details reward an engineer's attention: + +- **Digest pinning that respects deletion.** An entry URI may carry an + expected payload digest; it then identifies only an entry with exactly + that payload. The spec is explicit that this does *not* pin data against + pruning: "using an Entry URI will not 'pin' it in any way… retrieval + deliberately fails if the intended Entry got pruned." Deletion wins over + links, by design. +- **Payload slices.** Optional start/end indices identify a contiguous + subslice of the payload, with out-of-range indices truncated — a URI can + address a byte range of an entry, not just the entry. +- **Area URIs.** An area URI carries the AreaOfInterest's bounds + (max_count, max_size, time range) — a link can denote "this slice of the + dataset," the same Area object Meadowcap grants over and sync + reconciles. +- **Resolution hints.** Every URI contains a (possibly empty, ordered) + sequence of *other* URIs serving as hints for how/where to obtain the + data — the scheme is transport-agnostic and expects resolution to be + bootstrapped from ordinary web hints. + +The spec is carefully RFC 3986-conformant (percent-encoding, dot-segment +normalisation, relative references inherited as URI references) and +parameterised: an instantiation must supply host-safe encodings for +namespace/subspace ids and a query-safe encoding for payload digests +(Willow'25 provides the defaults). + +**State.** Spec published **2025-W51** (December 2025) alongside the Drop +Format revision (catalogue, 2025-W51 entry). The 2025-W52 roadmap listed +"Willow URIs implementation" among 2026 work, but as of this research **no +released implementation has been found** — not in willow25, not elsewhere. +It remains a published Proposal awaiting code. + +**Relation to the stack.** The naming/addressing layer: Meadowcap says who +may write, WTP moves data, URIs are how anything *refers* to data. Cobweb +is its flagship intended consumer (mutable links without link rot); +sneakerweb conspicuously does without it (subspace key = domain, served +locally), which shows the scheme is for the live, linked web of Willow +data rather than the sneakernet. + +**Estate relevance.** Modest and conceptual. If the estate ever adopts +Willow-family storage, this is the link format that comes with it. As a +design, it is a clean pattern for content references generally — +namespace.subspace/path + optional digest expectation + optional slice + +ordered resolution hints — and its "digest pin fails rather than pins" +choice is a small, sharp statement of the family's deletion-first values +that contrasts with IPFS-style addressing. + +## 5. WebTT (Web Tooltips) — released; spec + implementation in production + +**What it is.** A small specification for **nestable, cross-domain tooltips +with no server-side logic whatsoever**. The project's own page: "WebTT (Web +Tooltips) are nestable, cross-domain tooltips without any server-side +logic… Tooltips seamlessly work across domains. Tooltips are isolated in +iframes, no need [to] trust tooltip authors. Tooltips can nest arbitrarily +— and even recursively" ([WebTT](https://worm-blossom.org/webtt)). It is +the mechanism behind the Willow spec sites' definition tooltips — hover a +term on willowprotocol.org and you get its canonical definition, wherever +it is hosted. + +**How it works.** Three components ([WebTT](https://worm-blossom.org/webtt)): +(1) *tooltip definitions* — arbitrary self-contained static HTML pages, +served from any domain; (2) *references* — any HTML element carrying a +`data-tooltip-anchor=` attribute; (3) *one client-side +JavaScript file* (plus CSS) included on both referencing pages and tooltip +pages, which loads the tooltip page in a **sandboxed iframe** on hover. +Nesting falls out naturally: a tooltip page can itself contain anchors. +The specification proper prescribes only the *required communication flow* +between tooltip page and containing page (how heights/presence are +negotiated); how tooltips are displayed, timed, or dismissed is explicitly +implementation-defined, so independent compatible implementations are +possible. The authors' own limitation list is candid: iframe tooltips +cannot be styled by the host page; a tooltip cannot communicate a +preferred width; their current JS sometimes reports an incorrect height. + +**State.** Released. Spec published **2025-W50** (December 2025); the +reference JavaScript implementation lives on Codeberg +(`codeberg.org/worm-blossom/webtt`, linked directly from the spec page); +the Macromania integration, `@wormblossom/macromania-webtt`, is on JSR at +**0.2.3, published days before this research** (November 2026) — actively +maintained ([JSR: @wormblossom/macromania-webtt](https://jsr.io/@wormblossom/macromania-webtt)). +In production on the collective's sites since the spec landed, and since +2026-W46 it also carries defref's cross-domain references (catalogue §9 +and 2026-W46 entry). + +**Relation to the stack.** Not a Willow protocol at all — it belongs to +the Macromania publishing layer — but it is load-bearing for how the +family presents itself: the multi-site spec corpus (willowprotocol.org, +worm-blossom.org, bab-hash.org, sneakerweb.org) reads as one hyperlinked +document because definitions resolve across domains at hover time. + +**Estate relevance.** Minor but real, as a technique rather than a +product: WebTT is a working proof that *static, serverless cross-references +between separately hosted documents* are practical — no API, no build-time +coupling, just a convention plus one script. If our published books ever +want live cross-book definition references, this is the lightest known +pattern for it. As infrastructure for fleet/id/atlas/mcpx or the iroh work, +it is irrelevant. + +--- + +## Bottom line for the five + +Two of the five are real, shipped software — and both are *publishing +tooling* (Macromania, WebTT), not p2p technology. One is a finished-on-paper +naming spec waiting for an implementation (Willow URIs). Two are +application visions with no code at all (Rummager, Cobweb). That +distribution is itself the finding: worm-blossom's protocol layer is +genuinely built, its site tooling is genuinely built, and its application +layer — the layer that would show what Willow is *for*, end-user-side — +remains sketches, one rejected grant, and good intentions. diff --git a/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/worm-blossom-questions.md b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/worm-blossom-questions.md new file mode 100644 index 000000000..f8f22eb1b --- /dev/null +++ b/doc/2026-11-24T00-53-05Z_research_p2panda-investigation/research/worm-blossom-questions.md @@ -0,0 +1,607 @@ +# Worm Blossom questions — Sneakerweb, vaporware audit, Reed, GPUI, ufotofu, Bab + +Lane WB-QUESTIONS for the auth + transport investigation +(developing-today/code#13779). Researched 2026-11-23 from primary sources: +[worm-blossom.org](https://worm-blossom.org/) (the collective's weekly diary), +[sneakerweb.org](https://sneakerweb.org/), [bab-hash.org](https://bab-hash.org/), +the [Reed specification](https://worm-blossom.github.io/reed/), +[willowprotocol.org](https://willowprotocol.org/), docs.rs/crates.io, and the +[Riot Willow implementation audit](https://github.com/rabble/riot/blob/HEAD/docs/research/2026-07-10-willow-implementation-audit.md). +Baseline: the existing family note, +[willow-meadowcap.md](willow-meadowcap.md) — this document verifies, updates, +and extends it where Drew's questions go further. One baseline update matters +throughout: the Rust implementation has moved fast since the July 2026 audit — +`willow25` is now **0.7.11 (2026-11-06)** with 0.7.12-alpha.1 already out, +depending on `bab_rs ^0.8.1` and `ufotofu ^0.12.6` +([docs.rs: willow25](https://docs.rs/crate/willow25)). + +--- + +## 1. What are SneakerWeb and Sneaker World? + +### Sneakerweb — a web that travels on physical media + +**Sneakerweb is a peer-to-peer protocol for publishing static websites with no +servers, no DNS, no registrars, and no hosting** — plus a released command-line +application implementing it. Its own one-liner: "a parallel web transported by +physical media" ([sneakerweb.org](https://sneakerweb.org/)). + +- **The problem it addresses** is permission and infrastructure dependence in + web publishing: to put a page on the normal web you need a domain registrar, + DNS, and a host, all revocable and all rented. Sneakerweb removes all three. + Websites live on users' devices and move between them on "the ultimate + fallback infrastructure: physical storage media" — USB keys, SD cards, local + networks — packaged as `.snk` files + ([sneakerweb.org](https://sneakerweb.org/)). +- **Architecture** (from the [protocol specification](https://sneakerweb.org/spec)): + sneakerweb is a thin application protocol over **Willow'25**. There is exactly + one communal Willow namespace for the entire sneakerweb; each website is one + Willow **subspace**, and the subspace's Ed25519 public key *is* the site's + "domain" (a one-to-one correspondence — claiming a domain means generating a + keypair). Entry paths map directly onto URL paths, and a local web server + serves your collection to your ordinary browser at + `http://.localhost:1312/`. Willow is used, in their + words, "to prevent the forgery of websites, merge updated data, and create + efficient and compact .snk files" — `.snk` files are Willow **Drop Format** + bundles. The protocol is deliberately transport-agnostic, but the spec + *recommends* `.snk` files exchanged via physical media or LANs only, and says + so in strikingly normative terms: "these restrictions might seem cumbersome, + but they will shape your interactions with this technology into a form that + the internet cannot replicate" + ([spec](https://sneakerweb.org/spec)). +- **Does it run?** Yes — it is the worm-blossom project's flagship *working* + application. The CLI offers `domain`, `publish`, `export`, `import`, `block`, + and `serve` commands, is downloadable from sneakerweb.org, and is iterated in + public: a 1.2.0 announcement went out on the fediverse, and the most recent + diary entries describe a performance release that replaced their homebrew + server with axum, added seekable streaming video (150 MB files served through + the `video` element), site-size indicators, and responsive layout + ([worm-blossom.org diary](https://worm-blossom.org/)). They run in-person + **sneakmeets** (DWeb Camp, V2_ Rotterdam) where people swap `.snk` files, and + Sammy hand-delivered `.snk` files by train. A starter pack — "sammy's guide + to the sneakerweb" as a downloadable `.snk` — exists for people with no sites + to exchange yet. +- **Relation to Willow and to our estate**: sneakerweb is the proof-of-concept + that the Willow data model + Meadowcap + Drop Format work end-to-end for a + real (if deliberately small-scale) application. It is also a statement of + values our estate does *not* share: it is anti-scale and anti-internet by + design. For the fleet, sneakerweb matters as evidence (the stack runs), not + as a model (its transport stance is the opposite of ours). + +### "Sneaker World" + +There is **no separate product, protocol, or spec called "Sneaker World."** +In the diary, **"sneaker-world" is the collective's jocular name for the whole +scene around sneakerweb** — Sammy's weekly diary literally runs a recurring +beat headed "This week's news from sneaker-world:" to introduce sneakerweb +development news ([worm-blossom.org](https://worm-blossom.org/)). Read +generously, it names the emerging universe the protocol creates: the totality +of sneakerwebsites in circulation, the sneakmeets, the collectors swapping +`.snk` files — a "world" in the same sense as "the fediverse" names a scene, +not a piece of software. If Drew saw the term somewhere as if it were a +distinct thing, the diary usage is almost certainly the source. + +--- + +## 2. Is Willow/Meadowcap vaporware? + +Short answer: **no — but the family's centre of gravity is its specs, and the +layer a fleet would need most (network sync) is the layer that is still +paper.** Split by evidence: + +### Shipping / works today + +- **Two Final specs with independent implementations.** The Willow Data Model + and Meadowcap are Final (Meadowcap since 21 Nov 2025), each implemented at + least twice (Rust + TypeScript; a Go implementation exists as a third + cross-check) — spec status per the baseline note, §0/§8 + ([willowprotocol.org](https://willowprotocol.org/)). +- **A real, fast-moving Rust implementation.** `willow25` on crates.io is at + **0.7.11 (Nov 2026)**, with a dense release cadence (0.7.0 → 0.7.11 in about + three months), a persistent fjall-backed store, and dependencies pinned to + `bab_rs ^0.8.1` / `ufotofu ^0.12.6` + ([docs.rs](https://docs.rs/crate/willow25)). The July 2026 Riot audit's + pin recommendation (0.6.0-alpha.3) is already two minor lines behind. +- **A working application.** Sneakerweb (§1) is released, downloaded, used at + events, and visibly iterated week to week — it exercises the data model, + Meadowcap authorisation, the persistent store, and the Drop Format for real. +- **TypeScript implementations + Earthstar 11 (beta)** built on them + (`willow-js` implements data model, Meadowcap, the older WGPS sync, and + sideloading) — baseline note §8. + +### Real but alpha / in-flight + +- **The Rust store layer** is mid-construction in the open: recent diary + entries describe Emmy implementing store *summarising* and *splittable + storage* — the two ingredients of region-based set reconciliation — and + wrestling the 3D-indexing problem with Amparore's AreaSlice work + ([diary](https://worm-blossom.org/)). This is sync being built bottom-up, + in public, not yet usable as sync. +- **Drop Format** is Candidate/Proposal-grade, shipping inside willow25 alphas + with open payload-import issues (Riot audit, issue #51) — sneakerweb uses + it, but the audit's advice was "do not use the alpha Drop Format" for + evidence-grade work. +- **WTP (Willow Transfer Protocol)** — the current sync focus — is at the + *message-encoding design* stage in the diaries ("progress on defining + message encodings for the WTP"), i.e. pre-implementation. + +### Paper-only / paused + +- **Confidential Sync** (the sync protocol with private interest overlap): + Proposal status, and its own spec page says design is **paused**, to be + redrafted after WTP (baseline note §0). +- **Private Interest Overlap**, **Willow URIs**, **LCMUX** (their stream + multiplexing spec): proposals/designs without implementations. +- **Encrypted Willow** is explicitly *an analysis document, not a protocol* + (baseline note §5.1). + +### Credibility debits (the honest vaporware-adjacent evidence) + +- **The bab_rs digest incident**: every `bab_rs` version before 0.7 computed + *incorrect WILLIAM3 digests*; 0.8 "truly fixes" them (canonical changelog, + quoted in the [Riot audit](https://github.com/rabble/riot/blob/HEAD/docs/research/2026-07-10-willow-implementation-audit.md)). + A hash layer that silently produced wrong digests for multiple releases is + the single hardest fact against the family's engineering maturity. +- **No hosted CI** in the canonical willow_rs repo (open issue #54 per the + same audit). +- **Spec churn under the "Final" label**: a recent diary episode ("So, crisis + within worm-blossom? Are we going to have to eat humble pie and change the + specifications we've marked as FINAL?") records discovering that AreaSlices + — needed by the store work — were not properly defined in the Final specs, + and resolving it by re-homing the definition. The specs are living documents + maintained by two-to-three people, not frozen standards. +- **Bus factor**: the collective is Aljoscha Meyer, Sam Gwilym, and (since + 2026) Emmy Walker, grant-funded (NLnet), ~$3K/yr donations (baseline §12). + +### Credibility credits + +- Specs precise enough that independent implementations (willow-go) can serve + as interoperability cross-checks — and caught digest discrepancies. +- External adopters do their own audits (Riot, §3) rather than trusting. +- The team publishes failures and design retractions in a weekly diary and in + essays (e.g. "Timestamps, Really?") — vaporware projects do not usually + document their own weakest points this carefully. + +**Verdict**: Willow/Meadowcap is **not vaporware**: the data model, Meadowcap, +the Rust/TS implementations, and a real application demonstrably exist and +run. What *is* still vapor, years in, is the confidential network sync layer +(Confidential Sync/PIO) and any production-grade Rust sync at all. An estate +adopting Willow today is adopting finished *data + authorisation* layers and +volunteering to build or wait for the *network* layer. + +--- + +## 3. What other projects support Willow? + +Ordered by seriousness of commitment: + +- **Earthstar** — the origin and flagship. Willow began as a reimagining of + Earthstar; Earthstar 11 is being rebuilt on Willow (`willow-js`, + `@earthstar/meadowcap`), and Earthstar's core maintainer is one of the two + Willow authors ([Comparison to Other Protocols](https://willowprotocol.org/more/willow_compared/)). + This is first-party support, not external validation. +- **Sneakerweb** — worm-blossom's own application (§1). Also first-party, but + it is the strongest existence proof that the full stack works end-to-end. +- **Leaf / Weird (muni.town)** — the most substantial *external* design + adoption. Leaf is a protocol family built on Willow that uses Meadowcap + directly, and extends it where Willow is silent: **FROST threshold + co-signing** so a capability can require an online co-signature — their + answer to Meadowcap's missing revocation — plus petnames and contact-book + identity for their app Weird + ([Capabilities & Identity with Leaf](https://blog.muni.town/capabilities-and-identity-with-leaf/)). + Nuance worth recording: the same team's later project (Roomy) evaluated + Willow, then also explored Keyhive seriously because CRDT-native revision + tracking fit chat better — evidence that even sympathetic adopters treat + Willow as one ingredient, not the whole answer + ([A Brief History of Roomy's Architectures](https://blog.muni.town/brief-history-of-roomy-architectures/)). +- **Riot (rabble)** — the deepest external *Rust* adoption. Riot is a + community application runtime being built directly on the `willow25` + crates (Rust core + WASM browser node), and its team produced the July 2026 + implementation audit this note cites — pinning exact crate versions, + working around the alpha Drop Format, vendoring willow25 for the browser + ([audit](https://github.com/rabble/riot/blob/HEAD/docs/research/2026-07-10-willow-implementation-audit.md); + [About Riot](https://riot-protest-net-marketing.protestnet.workers.dev/about/)). + Riot is itself a prototype ("No stable release has shipped"), so this is a + serious fellow-traveller, not a production reference deployment. +- **iroh-willow (n0)** — n0 (the iroh company) built a Willow + Meadowcap + + sync implementation over iroh while exploring a successor direction to + iroh-docs. It exists and its architecture is instructive, but it is + unreleased and stale (iroh 0.34-era APIs, baseline note §10) — an + experiment by a well-placed neighbour, not a supported product. +- **willow-go (Deln0r)** — an independent Go implementation used as an + interoperability cross-check (it independently hit and fixed the WILLIAM3 + digest divergence). Its existence is evidence for spec quality (§2). +- **TagDrop (mofosyne)** — evaluated Willow as the import format for a + dead-drop system and documented the fit assessment (including a real + blocker: TagDrop signs with ML-DSA-44, Willow/Meadowcap authorises with + Ed25519). An evaluation, not an adoption — included because it shows the + shape of external interest: people *assess* Willow often, *ship on it* + rarely ([commit record](https://github.com/mofosyne/tagdrop/commit/ce0e3105c895aa155c5de54382a7edaf396a64b3)). +- **Research uptake** — Amparore's storage-indexing analysis (2026) treats + Willow's 3D structure as a research object in its own right (baseline §6). + +Summary: support is real but thin and mostly first-party or prototype-grade. +Nobody is running Willow in production infrastructure; the two external +projects that matter (Leaf, Riot) are pre-release and are both, tellingly, +building *around* Willow's gaps (revocation, sync) rather than waiting for +worm-blossom to close them. + +--- + +## 4. Is Willow the most "pure/correct" option — fewest shortcuts, most theoretically right? + +**Judgment: within its variety — replicated data stores with capability +authorisation — yes, Willow is the most formally rigorous and least +shortcut-taking design currently under active development. Its purity is +real, and it is also precisely where its practical costs come from.** + +Where the formalism genuinely leads the field: + +- **Spec precision as the product.** The data model is defined as a join + semi-lattice with exact join/prune rules; Meadowcap validity is a recursive + definition tight enough to implement from the paper alone — and two + independent codebases did. Compare p2panda (engineering-led, spec follows + code) or Nostr (deliberately laissez-faire — the Willow authors' own + comparison concedes Nostr is "significantly easier to implement, but + arguably also more difficult to *solidly* build upon" + ([Comparison](https://willowprotocol.org/more/willow_compared/))). +- **The Area algebra.** Subspace × path-prefix × time-range areas, closed + under intersection, serve simultaneously as the unit of authorisation + (Meadowcap), the unit of interest (partial sync), and the unit of + reconciliation (AreaSlices in RBSR). One concept, three jobs, no seams — + nobody else in the survey has an authorisation scope that is *the same + object* as their sync scope. +- **Attenuation as a theorem, not a policy.** Meadowcap delegation validity + *requires* area inclusion at every hop; widening is cryptographically + unverifiable (baseline §2.3). Keyhive's Keyline matches this rigour in the + auth layer specifically (set-based evaluation, RT₀-style reasoning) — it is + the one peer that plays the same purity game, on a narrower board. +- **Private Interest Overlap.** Willow is the only family that even attempts + metadata-private sync discovery — peers learn only their shared interests. + The authors' comparison notes, fairly, that "few if any protocols devote + the attention to controlling data propagation through read capabilities, + and even fewer extend this care to metadata privacy" + ([Comparison](https://willowprotocol.org/more/willow_compared/)). +- **Refusing the easy outs.** No content-addressing at the protocol level + (they argue it, at length, against IPFS-style designs); no server/ACL + fallback for revocation — instead a published essay dissecting why + timestamps are a compromise ("Timestamps, Really?"); no completeness + proofs, *deliberately*, to keep traceless deletion possible. When their + hash needs (constant-size length proofs) weren't met by Bao, they designed + a hash family (§8) rather than accepting the logarithmic proof. When their + log scheme (Bamboo) was beaten by their own newer result, they published + Reed (§5) — and then abandoned logs anyway when the data model changed. + This is a research programme behaving like one. + +Where purity costs — the same choices, read from the operator's side: + +- **No revocation** is a *theorem-shaped* hole: offline-verifiable + capabilities cannot be revoked without an online element, so Meadowcap + doesn't pretend — and every adopter (Leaf's FROST co-signer, our renewal + service idea) ends up bolting the online element back on. +- **Claimed timestamps** are load-bearing for both conflict resolution and + capability windows; the design trusts writers with time because a purer + alternative (causal history) would break the state-based model. The purity + is in *admitting* this, not in solving it. +- **Storage efficiency is an open research problem** (no lexicographic index + makes every Area contiguous — Amparore 2026): the 3D formalism is + beautiful and, as yet, nobody knows how to store it optimally. +- **The network layer is unfinished after years** precisely because the + confidential-sync design refuses the straightforward version (sync first, + privacy later). Purity has a schedule cost, and Willow pays it in the open. + +Against the rest of our survey: p2panda is the pragmatic engineer (compose +iroh, ship crates, let auth be simple); the ocap family is *older* theory +(decades of capability literature) but solves a different problem (live +objects, not replicated data); Keyhive is Willow's only true peer in rigour, +and it is even less mature. So: **Willow is the leading-edge research +artefact of its class — the one you'd cite, teach, and steal designs from. +That is a different claim from "the one to bet a fleet on today," and the +family's own behaviour (specs Final, sync paused, implementations alpha) +keeps those two claims separate.** + +--- + +## 5. What is Reed's prefix auth scheme? Is it good? + +**First, a naming correction that changes the answer: "prefix auth" is +prefix *authentication*, not prefix *authorisation*.** Reed has nothing to +do with Meadowcap-style path-prefix capabilities. It belongs to the other +meaning of "auth" entirely. + +### What it is + +**Reed** is Aljoscha Meyer's lightweight specification of a **prefix +authentication scheme** — the cryptographic primitive behind append-only / +transparency logs ([Reed Specification](https://worm-blossom.github.io/reed/)). +Given a single totally-ordered stream of events, a prefix authentication +scheme lets anyone produce a *short certificate* proving that one event +happened before another — equivalently, that the sequence of events up to +position *i* is a prefix of the sequence up to position *j*. This is the +primitive Certificate Transparency uses (signed tree heads + inclusion / +consistency proofs), generalised. + +The construction, from the spec: + +- Build a Merkle-DAG over the event sequence: events get **commitment + vertices**, plus inner vertices arranged as a **ternary almost-skip-list** + (inner vertices sit at positions (i, j) where 3^j divides i — hence short + paths between any two positions). +- Each vertex is labelled by a hash of its out-neighbours' labels (plus + position metadata, which lets any label prove its own position). Each + commitment vertex can reach the commitment vertices of *all earlier* + events. +- The **prefix certificate** for two events is the set of labels of the + closed out-neighbourhood of the shortest path between their commitment + vertices; from those labels a verifier recomputes both commitment labels, + and matching labels unforgeably certify the ordering. Path-finding is a + simple greedy walk (jump if you don't overshoot, else step to predecessor). +- For a transparency-log deployment, a logging authority signs commitment + vertices, which then play the role of CT's signed tree heads. + +Reed is the spec form of the scheme from Meyer's paper **"Better Prefix +Authentication"** ([arXiv:2308.15058](https://arxiv.org/abs/2308.15058)), +which recasts these schemes as *antimonotone linking schemes* and improves +on the state of the art in both prefix authentication and secure relative +timestamping — explicitly positioned as "more efficient alternatives to +certificate transparency logs." Reed **supersedes Bamboo**, Meyer's earlier +log format (the one old p2panda was built on): the Reed spec says it is "more +efficient than Bamboo, more minimalistic in feature set, and generic over any +particular cryptographic primitives," and the Bamboo repo now points readers +to Reed ([Bamboo](https://github.com/AljoschaMeyer/bamboo)). Tellingly, the +Reed spec also records *why* it shed features: Bamboo was designed for data +replication, "but I have since come to prefer more flexible replication +technologies" — i.e. Willow. + +### Is it good? + +- **As a design: yes.** It comes with a paper, a complexity analysis, and a + cleaner construction than its predecessor (shorter proofs than CT logs; + fewer moving parts than Bamboo's lipmaalink certificate pools). It is the + same author's second, better attempt at a problem he had already shipped + once — usually a good sign. +- **As an authorisation scheme: it isn't one.** The comparison the question + invites — Reed vs Meadowcap areas vs Keyline — is a category distinction, + not a contest. Meadowcap and Keyline answer "who may do what to which + data"; Reed answers "can you prove event A precedes event B in this one + stream". Reed could sit *under* a log-based system (it is what Bamboo was + for p2panda); it cannot substitute for a capability layer, and a capability + layer cannot substitute for it. +- **As an adoption target today: weak.** No production implementation + surfaced in crates.io/Codeberg/GitHub searches — the spec site is the + artefact, and unlike Bamboo it has no flagship user. Its author has moved + on twice over: from logs to Willow's set-based model, and in a companion + paper (arXiv:2308.13836) he publicly retracts the "append-only log" + framing itself. Reed is best read as a finished piece of research whose + natural habitat (single-writer log replication) its own author no longer + inhabits. +- **For our estate**: Reed becomes relevant only if we build a component + that genuinely needs prefix proofs — a transparency log for the fleet CA, + or an audit log whose consumers must verify ordering without trusting the + broker. There, it is a better primitive than a hand-rolled Merkle log and + worth implementing from the spec. For access control, it is not a + candidate at all. + +--- + +## 6. What is their opinion on GPUI? + +The honest framing first: **worm-blossom has no GPUI essay and does not use +GPUI.** Their UI surface is the ordinary web — sneakerweb serves HTML from a +local axum server to your normal browser. What exists is a diary link-roundup +gloss, and it is unambiguous about which side they're on. + +In a recent weekly diary, Sammy's link list includes +[**A Critique of GPUI**](https://blog.zortax.de) (by the author of the +signal-based `zgui` framework) with this worm-blossom gloss, verbatim in +substance: *"A nuanced take on where Rust UI libraries inspired by Elm +(which feels like all of them really) fall flat. Personally I loved Elm but +found the lack of component-level state very fiddly. And there's lots to +suggest the lack of a component model makes it much harder to calculate diffs +between renders"* ([worm-blossom.org diary](https://worm-blossom.org/)). + +So their position, as far as it is stated: + +1. **Endorsement of the critique.** The linked post argues GPUI's (and + egui's) state models are dead ends for complex apps: GPUI's `notify` + names an entity but not what changed, so invalidation re-renders whole + view subtrees — cost follows tree size, not change size (their benchmark: + ~8.4 ms for a one-label change at 3,000 live rows) — and fixing it means + hand-building a signal graph out of heavier parts. The field's converged + answer, per the critique, is tracked reads / signals with run-once + components ([DevPlace mirror](https://devplace.net/news/26192b3ad0cb-a-critique-of-gpui)). +2. **The specific worm-blossom complaint is architectural, not about + rendering speed**: Elm-style architectures (a single global model + + message updates, which they see GPUI as belonging to) lack + *component-level state*, which makes both programming (fiddly) and + efficient diffing (no component boundaries to diff against) harder. + Note the affection in it — "Personally I loved Elm" — this is a + disappointed-former-believer critique, not a dismissal of the paradigm's + goals. + +Caveats: this is one link blurb, not a developed position; no other GPUI +discussion appears on the site (searches of the diary and archives return +only this entry); and they have no skin in the game — no worm-blossom +project ships a native GUI. Weight it as "informed bystanders who agree with +the signals critique," not as a framework evaluation. + +--- + +## 7. What is ufotofu? + +**Ufotofu is worm-blossom's Rust library of abstractions for asynchronously +working with series of data — streams and sinks, redesigned from first +principles** ([worm-blossom.org/ufotofu](https://worm-blossom.org/ufotofu/); +[docs.rs: ufotofu 0.12.7](https://docs.rs/crate/ufotofu/latest/source/src/lib.rs)). +It is the async idiom the whole Willow/Bab stack is written in, and Emmy +Walker joined the collective largely on the strength of ufotofu contributions +([diary](https://worm-blossom.org/)). + +How it works: + +- **Two dual traits.** A *sequence* is items terminated by at most one final + value. A `Producer` yields `Either` one at a time (with + `slurp` to fill internal buffers); a `Consumer` receives them (with + `flush` to empty buffers). Both can error on any call. The traits are + designed as exact duals, which makes composition (piping a producer into a + consumer; in-memory channels whose sender/receiver are the two halves) + fall out naturally. +- **Bulk traits for zero-copy.** `BulkProducer`/`BulkConsumer` expose slices + — a closure writes into a consumer-exposed mutable slice, or reads from a + producer-exposed one — so byte-oriented code avoids per-item overhead + while remaining semantically identical to the item-wise traits. +- **Codec modules.** `codec` provides async encoding/decoding traits on top + of producers/consumers; `codec_relative` does the same where encodings may + exploit shared context between encoder and decoder (exactly what Willow's + relative encodings for capabilities need). +- **Frugal async.** Ufotofu follows the team's "frugal async Rust" + principles: futures from its methods are **`!Send`** (single-threaded + executors only), `no_std`-compatible, with explicit buffering instead of + hidden allocation. Compatibility adapters turn any futures-io + `AsyncRead`/`AsyncWrite` into bulk producers/consumers, so Tokio/smol I/O + can be bridged in at the edges. + +Maturity and use: actively developed (0.12.7; Codeberg PRs through 2026; +combinator ecosystem — Limit/Chain/etc. — with fuzz-testing utilities); +used by `willow25` (depends on ufotofu ^0.12.6, +[docs.rs](https://docs.rs/crate/willow25)), by sneakerweb (Emmy built +ufotofu↔axum streaming adapters to serve seekable video, +[diary](https://worm-blossom.org/)), and it has a small devoted following +(the diary's guest poster describes "morphing into the ufotofu sicko I was +perhaps always meant to be"). + +**Relevance to our Rust work**: ufotofu itself is a respectable, principled +alternative to futures-rs `Stream`/`Sink` for streaming *serialisation* +workloads — the Final-value-in-the-type design genuinely fits protocol +codecs (a stream that ends with a checksum/status is one type, not a +convention). But adopting the Willow crates means adopting ufotofu's async +worldview with them: `!Send` futures and pollster-style executors sit +awkwardly inside a Tokio multi-threaded fleet binary, and bridging is +per-boundary work. As a standalone choice for *our own* new streaming code +it is a small-ecosystem bet (one collective, no Tokio-native ecosystem) — +interesting where its codec discipline pays, not a default. + +--- + +## 8. Should Drew use `bab`? Why bab and not BLAKE3? + +### What bab is + +**Bab is a family of hash functions designed for verifiable partial data in +peer-to-peer systems** — spec at [bab-hash.org](https://bab-hash.org/spec), +Rust implementation `bab_rs`. Like BLAKE3/Bao, a Bab digest is the root of a +binary Merkle tree over 1024-byte chunks, so a receiver can verify a stream +*as it arrives* (each verified prefix is safe to persist and forward), +verify arbitrary *slices* independently, and pull different slices from +different peers in parallel. **WILLIAM3** is the family's concrete +instantiation — the one Willow'25 uses as its payload hash — and it is, +deliberately, *almost* BLAKE3. + +### Why not just BLAKE3 (+ Bao)? — their reasoning, in their words + +Meyer's [Bab Introduction](https://aljoscha-meyer.de/posts/bab_funding/index.html) +gives three advantages of Bab over Bao (the verified-streaming spec layered +on BLAKE3): + +1. **Constant-size length proofs.** Given a Bab digest, a peer can certify + *how many bytes* were hashed in constant space. Bao needs logarithmic + space for the same proof — small, but growing, and it complicates + storage-oriented APIs. +2. **A generic, parameterisable construction.** Bab is specified over + abstract `hash_chunk`/`hash_inner` functions (there is an instantiation + over any conventional hash function); Bao is tied to BLAKE3's specific + primitives. Bab is "a family of special-purpose hash functions" where Bao + is "a byproduct of a well-designed general-purpose hash function" + ([spec §1](https://bab-hash.org/spec)). +3. **Streaming optimisations Bao doesn't have** — omitting left labels, + omitting lower layers, slice streaming, and optimised computation for + repeating substrings ([spec §4](https://bab-hash.org/spec); the + [bab-hash.org](https://bab-hash.org/) homepage lists the same deltas as + "APIs designed from a storage rather than a hashing perspective"). + +WILLIAM3's three concrete differences from BLAKE3 implement exactly this +([spec §2.2.2](https://bab-hash.org/spec)): (i) **no chunk indices** in chunk +labels (BLAKE3 feeds the chunk counter into its compression function; +WILLIAM3 sets it to 0) — this is what makes chunk labels position-independent +and the repeating-substring optimisation possible; (ii) **the substring +length is mixed into inner-node labels** (the compression function's `t` +parameter carries the length) — this is what makes constant-size length +proofs work; (iii) **different IV constants** (the BLAKE3 digest of the +ASCII string `WILLIAM3`) so WILLIAM3 and BLAKE3 digests can never be +confused for the same input. WILLIAM3 drops BLAKE3's KDF mode and XOF +output; width 32 bytes, chunk size 1024, keyed mode retained. + +And why Willow cares: a Willow payload digest is not just a checksum — it is +the verifiable-stream root for resumable payload transfer and an input to +set-reconciliation fingerprints. Plain BLAKE3 gives Willow none of the +streaming semantics; Bao gives most of them with worse length proofs and a +second spec to track. So Willow'25 standardised on WILLIAM3. + +### Correctness state — read this before pinning anything + +- **Every `bab_rs` before 0.7 computed incorrect WILLIAM3 digests.** The + canonical changelog (quoted in the + [Riot audit](https://github.com/rabble/riot/blob/HEAD/docs/research/2026-07-10-willow-implementation-audit.md)) + says 0.8 "truly fixes" them. `willow25` 0.6.0-alpha.1 regenerated its + default digests when it moved to bab_rs 0.8; current `willow25` 0.7.11 + depends on `bab_rs ^0.8.1` ([docs.rs](https://docs.rs/crate/willow25)). +- The independent Go implementation also had to correct its WILLIAM3 + (commit 9d848ee, per the audit) — the divergence was in the wild, on both + sides. +- Practical meaning: **WILLIAM3 digests produced before bab_rs 0.8 are a + different hash function in effect.** Any stored digests from the 0.5/0.6 + era are not comparable to current ones. Pin `bab_rs = "=0.8.1"` (or the + exact version your willow25 resolves), keep the lockfile as the evidence + of which digest-world you are in, and expect that a young spec like this + may do it once more before 1.0. + +### Recommendation for this estate + +- **Use bab where it comes with the territory**: if we adopt Willow'25 data + (or build Willow-interoperable tooling), WILLIAM3 via `bab_rs =0.8.1` is + not optional — payload digests and reconciliation fingerprints are defined + over it. Budget for digest-world versioning (record the bab_rs version + alongside any persisted digest). +- **Do not adopt bab as the estate's general-purpose hash.** BLAKE3 is + faster (SIMD-tuned, massively deployed), and the estate already lives in + the BLAKE3 world via iroh-blobs/bao. Bab's unique wins — constant-size + length proofs, storage-shaped streaming APIs — only pay inside a + Willow-style store/sync design; outside one, they buy nothing and cost a + second, single-implementation, pre-1.0 hash ecosystem with a demonstrated + silent-digest-bug history. +- **What using BLAKE3 instead would break**: Willow'25 *interoperability* — + a BLAKE3-digested store cannot reconcile with willow25 peers (digests and + fingerprints won't match), and you lose constant-size length proofs. What + it would *not* break: local correctness. iroh-willow already proved a + BLAKE3-instantiated Willow works fine as a closed system (baseline note + §10). So the decision is exactly: **interop with the Willow'25 world → + bab/WILLIAM3; closed system on our own transport → BLAKE3/bao is the + safer default.** Given the estate's iroh direction, bab adoption should + follow a Willow adoption decision, never precede it. + +--- + +## Sources (primary) + +- worm-blossom.org — [homepage/diary](https://worm-blossom.org/), + [projects page](https://worm-blossom.org/projects/), + [ufotofu](https://worm-blossom.org/ufotofu/) +- [sneakerweb.org](https://sneakerweb.org/) and its + [protocol specification](https://sneakerweb.org/spec) +- [bab-hash.org](https://bab-hash.org/) and the + [Bab specification](https://bab-hash.org/spec); Meyer, + [Bab Introduction](https://aljoscha-meyer.de/posts/bab_funding/index.html) +- [Reed Specification](https://worm-blossom.github.io/reed/); Meyer, + [Better Prefix Authentication](https://arxiv.org/abs/2308.15058); + [Bamboo](https://github.com/AljoschaMeyer/bamboo) +- willowprotocol.org — + [Comparison to Other Protocols](https://willowprotocol.org/more/willow_compared/), + [Meadowcap](https://willowprotocol.org/specs/meadowcap/index.html) +- docs.rs — [willow25](https://docs.rs/crate/willow25), + [bab_rs](https://docs.rs/bab_rs/0.8.1/src/bab_rs/lib.rs.html), + [ufotofu](https://docs.rs/crate/ufotofu/latest/source/src/lib.rs) +- Rabble, [Riot Willow Implementation Audit](https://github.com/rabble/riot/blob/HEAD/docs/research/2026-07-10-willow-implementation-audit.md); + muni.town, [Capabilities & Identity with Leaf](https://blog.muni.town/capabilities-and-identity-with-leaf/), + [A Brief History of Roomy's Architectures](https://blog.muni.town/brief-history-of-roomy-architectures/) +- zortax, [A Critique of GPUI](https://devplace.net/news/26192b3ad0cb-a-critique-of-gpui) + (linked and glossed by worm-blossom) diff --git a/doc/README.md b/doc/README.md index f88a1651d..539d371b6 100644 --- a/doc/README.md +++ b/doc/README.md @@ -200,6 +200,7 @@ Two names break the pattern. They stay as they are because other documents link - [Fleet investigation research corpus](2026-11-23T23-48-17Z_research_fleet-investigation/2026-11-23T23-48-17Z_research_fleet-investigation.md) — the 2026-11-23 research behind the fleet programme investigation (#13272): census, queue broker, agents/secrets/quota, designs. - [ID investigation research corpus](2026-11-23T23-50-00Z_research_id-investigation/2026-11-23T23-50-00Z_research_id-investigation.md) — the 2026-11-23 research behind the ID programme investigation (#13240): system state, technology, Roc research, the ID-100 list. - [mcpx investigation research corpus](2026-11-23T23-51-36Z_research_mcpx-investigation/2026-11-23T23-51-36Z_research_mcpx-investigation.md) — the 2026-11-23 research behind the mcpx programme investigation (#13264), plus the mcpx door build notes. +- [p2panda investigation research corpus](2026-11-24T00-53-05Z_research_p2panda-investigation/2026-11-24T00-53-05Z_research_p2panda-investigation.md) — the p2panda/P2P research set (26 Markdown files) behind the `research_p2p-auth-transport` bundle, plus two worm-blossom mirror notes; the HTML mirror is not included. - [Code Book census — retrospective](2026-11-24T00-56-13Z_research_code-book-census-retrospective/2026-11-24T00-56-13Z_research_code-book-census-retrospective.md) — the retrospective census for the Code Book programme (#13905), compiled 2026-11-23: the honestly covered period assessed source by source, week-by-week rollups (biggest builds, hardest challenges, where the time went, capabilities unlocked) for W12–W48 with thin weeks stated plainly, month rollups, quarter/year honesty notes, and the capabilities timeline — with all raw supplements (source inventory, GitHub merged-PR counts and title samples, doc/ census, memory completion extracts, cycle-log inventory) inside the folder. - [PM book programme — research record](2026-11-24T01-11-42Z_research_pm-book-programme-13900/2026-11-24T01-11-42Z_research_pm-book-programme-13900.md) — The Project Management book programme's gathered material: coverage ledger, Turso estate list, surveys, LLM evidence pack, sideline deposits, Space content pack (#13900).