# Low-Priority Repos — Reference Index

Background/comparison material for SPT (single-binary Rust inter-agent messaging on Windows + Unix). Per the Networked Messaging Research Brief these rank 5+ or are disqualified, except `min-sized-rust` which directly informs SPT's binary-size discipline.

Local repo root: `docs/research/inspiration/repos/`

---

## min-sized-rust (BORROW — binary-size recipes)

**What:** johnthagen/min-sized-rust — curated catalog of every known trick to shrink a Rust binary. License MIT (per subproject `Cargo.toml`s; top-level `LICENSE.txt`). Active, maintained alongside Rust nightly developments (covers `panic=immediate-abort` PR #146317, `optimize_for_size` tracking issue #125612).

**Why SPT cares:** SPT ships `owl.exe` to thousands of users; every KB matters and we already use `panic = "abort"`. This repo is the canonical checklist to verify nothing's left on the table, plus a roadmap for future shrink passes (nightly-only knobs, `build-std`, `no_main` tricks).

### Recipe checklist (README sections)

| Recipe | README anchor | MSRV | SPT applicability |
|---|---|---|---|
| `cargo build --release` | "Build in Release Mode" L14-26 | 1.0 | already on |
| `strip = true` | "`strip` Symbols from Binary" L28-50 | 1.59 (Cargo profile) | check Cargo.toml |
| `opt-level = "z"` (try `"s"` too) | "Optimize For Size" L52-74 | 1.28 | candidate |
| `lto = true` | "Enable Link Time Optimization" L76-90 | 1.0 | candidate |
| `codegen-units = 1` | "Reduce Parallel Code Generation Units…" L102-112 | stable | candidate |
| `panic = "abort"` | "Abort on Panic" L114-133 | 1.10 | **on** (verified for SPT) |
| `-Zlocation-detail=none` | "Remove Location Details" L136-149 | nightly | nightly-gated, skip until stable |
| `-Zfmt-debug=none` | "Remove `fmt::Debug`" L151-164 | nightly | nightly-gated |
| `build-std=std,panic_abort` + `optimize_for_size` | "Optimize `libstd` with `build-std`" L166-221 → 51 KB on macOS | nightly | aspirational; needs per-target triple in CI |
| `-Cpanic=immediate-abort` | "Remove `panic` String Formatting…" L223-244 → 30 KB | nightly | aspirational |
| `#![no_main]` + manual stdio | "Remove `core::fmt`…" L246-277 → 8 KB | nightly | not viable (SPT uses `std`, clap, rusqlite) |
| `#![no_std]` + libc | "Removing `libstd` with `#![no_std]`" L279-316 → 8 KB | 1.30 | not viable |
| UPX `--best --lzma` | "Compress the binary" L318-334 | external | **avoid** — flags AV heuristics, bad fit for distributed plugin |
| `cargo-bloat`, `cargo-llvm-lines`, `cargo-unused-features`, `momo`, Twiggy | "Tools" L336-347 | external | run `cargo-bloat` against SPT to find low-hanging fruit |

### Concrete profile patterns

`min-sized-rust/Cargo.toml` L9-14 — top-level fully-loaded release profile (drop-in for SPT):
```
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true
```

`min-sized-rust/build_std/Cargo.toml` L7-19 — adds `[profile.dev] panic = "abort"` so dev builds behave like release (useful when debugging size-only regressions).

`min-sized-rust/no_main/nix/src/main.rs` L1-13 and `…/win/src/main.rs` L1-25 — `#![no_main]` + raw `GetStdHandle` for Windows. Reference only; SPT cannot drop `std`.

`min-sized-rust/no_std/win/Cargo.toml` L7-11 — minimal `windows-sys` features list pattern (`Win32_Foundation`, `Win32_System_Threading`, `Win32_System_Console`). SPT already uses `windows-sys`; the lesson is to keep feature flags tight.

### References worth reading

README "References" L363-422 — curated blog posts: "Making Rust binaries smaller by default" (Kobzol 2024), "Trimming down a rust binary in half" (2024), "Tighten rust's belt" (PLDI 2022). Skim before any size-reduction sprint.

### SPT TODO derived from this index
- Audit `Cargo.toml`: confirm `strip`, `lto`, `codegen-units = 1`, `opt-level` are all set.
- Run `cargo bloat --release --crates` once; record top 10 contributors.
- Consider `opt-level = "s"` A/B against current `"3"`/`"z"`.
- Park `build-std`/`panic=immediate-abort` until they hit stable Rust.

---

## cjdns (SKIP — C, GPLv3, mesh router daemon)

`cjdelisle__cjdns` — encrypted IPv6 mesh with PK-derived addresses + DHT routing; v22.3 (Dec 2025), actively released. GPLv3 (`LICENSE` L1-2). Predominantly C with a Rust sidecar (`Cargo.toml` present), structured as a long-running router daemon (`admin/`, `dht/`, `crypto/`, `net/`). Nothing here resembles SPT's short-lived perch-and-message model: cjdns is a kernel-adjacent network stack with TUN integration, distinct threat model (anonymity-ish), and a copyleft license that's incompatible with SPT's permissive plugin distribution. **Verdict: SKIP** — note the existence and move on.

---

## hypercore-protocol/hypercore (REFERENCE — append-only signed log; JS)

`hypercore-protocol__hypercore` — Mathias Buus's signed-merkle-tree append-only log; v11.30.2, MIT, active (now under Holepunch/`pears.com`). Pure Node.js (`package.json` L1-30, `lib/` ~20 files). Design ideas worth knowing: (1) Ed25519-signed manifests as the data identity (`lib/verifier.js` L17-44, Signer class) — interesting if SPT ever needs a verifiable message history shared between perches. (2) Sparse replication of a merkle-indexed log (`lib/merkle-tree.js`, `lib/replicator.js`) — applicable only if SPT grows multi-host syncing. (3) `feature-flags.js`/`compat.js` pattern for wire-protocol forward-compat without breaking older peers — directly applicable to SPT's plugin handoff story. **Verdict: REFERENCE** — borrow conceptually; do not depend on JS.

Pointers:
- `lib/verifier.js` L17-44 (manifest-hash-as-namespace signing scheme)
- `lib/merkle-tree.js` L1-30 (NodeQueue + flat-tree iteration)
- `lib/feature-flags.js` (wire-compat bit flags)

---

## iroh-loro (REFERENCE — CRDT over iroh; tiny demo)

`loro-dev__iroh-loro` — 2-peer collaborative text editor: iroh QUIC for transport, Loro CRDT for state. ~307 lines total (`src/lib.rs` 125, `src/main.rs` 182). `Cargo.toml` shows iroh 0.91 + loro 1.6. License not in repo root; treat as exemplary code rather than ingestable dep. Only relevant to SPT if a future phase introduces shared mutable state across perches (e.g. distributed inbox). The demo's value is the integration glue: ALPN registration, bidirectional sync loop, subscribe-to-local-changes pattern.

Pointers:
- `src/lib.rs` L11-22 (`IrohLoroProtocol` shape, ALPN = `b"iroh/loro/1"`)
- `src/lib.rs` L24-41 (`update_doc` — incremental CRDT update with size threshold for refined diff)
- `src/lib.rs` L43-60 (`initiate_sync` — initial export + subscribe pattern)
- `src/main.rs` (serve/join CLI scaffolding — clap derive)

---

## nostr-protocol (REFERENCE — relay model & event signing spec)

`nostr-protocol__nostr` — the canonical protocol README pointing to NIPs at github.com/nostr-protocol/nips. Public domain. Repo itself is README + diagram only. Relevant insight for SPT: relays-as-dumb-routers model where signed events flow through any willing relay; clients verify signatures end-to-end. Maps loosely onto SPT's "spool + registry" but SPT keeps everything local. Read NIP-01 if SPT ever considers a federated message bus.

**Verdict: REFERENCE (spec only)** — no code to borrow here; the value is the architecture lesson (signed events + permissive relays).

---

## rust-nostr (REFERENCE — Rust nostr impl; event signing & no_std)

`rust-nostr__nostr` — Yuki Kishimoto's Rust nostr workspace. MIT, actively maintained, broad NIP coverage. Workspace splits into `crates/nostr` (core, `no_std`-capable), signers, databases (lmdb/sqlite/nostrdb), gossip, relay builder, sdk. Two SPT-relevant patterns: (1) `nostr` core compiles under `no_std` with `alloc` fallback (`crates/nostr/src/lib.rs` L11-26) — useful blueprint if SPT ever wants a slim embed target. (2) Event ID = hash-of-canonical-json + Schnorr signature (`crates/nostr/src/event/mod.rs` L14-30 imports `secp256k1::schnorr::Signature`) — clean reference for "self-verifying message" if SPT adds cryptographic stamping later. Heavy `bitcoin_hashes` / `secp256k1` deps make wholesale adoption a non-starter for binary size.

Pointers:
- `crates/nostr/src/lib.rs` L11-26 (std/alloc/no_std feature gating)
- `crates/nostr/src/event/mod.rs` L14-30 (Schnorr signature imports + module structure)
- `crates/nostr/src/event/builder.rs` (event construction pattern)
- `crates/nostr-relay-builder/` (minimal relay scaffolding — read if SPT ever wants a long-running broker)

**Verdict: REFERENCE** — borrow the layering ideas; do not pull deps.

---

## webrtc-rs (SKIP — large dep tree; QUIC is SPT's path if it ever ships networking)

`webrtc-rs__webrtc` — pure-Rust WebRTC stack. MIT/Apache-2.0, v0.20.0-alpha.1, active. Massive surface (ICE/DTLS/SCTP/SRTP/data channels) split across the `rtc/` and `webrtc-*` sub-crates. SPT's networking needs (if any) would be QUIC peer-to-peer, not browser-compat WebRTC; pulling in this stack to ship a CLI plugin is a non-starter (transitive dep count, build time, binary growth). **Verdict: SKIP** — if browser interop ever matters, revisit; otherwise iroh/quinn from the brief are the right tools.

---

## yggdrasil-go (SKIP — Go, daemon, IPv6 mesh)

`yggdrasil-network__yggdrasil-go` — end-to-end encrypted IPv6 mesh daemon written in Go. Active, multi-platform. Long-running router with TUN integration, similar territory to cjdns but cleaner. Wrong language (Go), wrong shape (daemon with config files), wrong scope (network-layer mesh) for an inter-agent message plugin. **Verdict: SKIP**.

---

## arti (REFERENCE — Rust Tor; crate-layout patterns only)

`tpo__arti` — Tor Project's Rust rewrite of Tor. Dual-licensed MIT/Apache-2.0 with some GPL/LGPL files for specific components (see `LICENSE-*`, `GPL-3`, `LGPL-3` at root). Very active. 68 crates under `crates/` (`arti`, `arti-client`, `arti-config`, ~50 `tor-*` foundation crates: `tor-bytes`, `tor-cell`, `tor-cert`, `tor-chanmgr`, `tor-circmgr`, `tor-config`, `tor-dirmgr`, `tor-error`, …).

**SPT-relevant patterns (skim only):**
- Deep workspace split — every protocol concern is its own `tor-*` crate. Overkill for SPT but instructive if `owl.exe` ever grows enough to warrant carving (`src/owl/` vs `src/live/` vs `src/common/` already mirror this at a tiny scale).
- `arti-client` as the embeddable API surface, `arti` as the binary wrapper — same shape as SPT's "binary contains everything, skills drive UX".
- `fs-mistrust`, `fslock-guard`, `safelog`, `test-temp-dir` — small reusable utility crates worth cherry-picking *ideas* from (filesystem permission checks, lockfiles, redacted logging) rather than depending on.
- `tor-error` — structured error taxonomy with `Kind` enums; clean error-design template.

**What SPT will NOT need:** anything tor-specific — onion routing, directory consensus, circuit management, anonymity threat model. Arti's threat model assumes a global passive adversary; SPT's threat model is "local agents on the same machine cooperate, IPC must be reliable." Completely disjoint.

Pointers:
- `README.md` L1-60 (project framing, why-Rust)
- `crates/` directory listing — read crate names to map Tor's domain decomposition
- `crates/arti-client/README.md` — embeddable-library pattern
- `doc/dev/Architecture.md` (referenced from README) — read once if curious about workspace scaling

**Verdict: REFERENCE (architecture only)** — never depend on; occasionally re-skim the crate split when SPT considers carving its workspace.

---

## Summary table

| Repo | Verdict | One-line reason |
|---|---|---|
| min-sized-rust | **BORROW** | Direct binary-size recipes; audit SPT's release profile against this. |
| cjdns | SKIP | C, GPLv3, daemon — wrong shape and license. |
| hypercore | REFERENCE | Append-only signed log ideas; JS-only impl, conceptual borrow if SPT grows multi-host. |
| iroh-loro | REFERENCE | CRDT-over-QUIC integration template; revisit only if shared state lands. |
| nostr-protocol | REFERENCE | Spec/NIPs only — relay+signed-event architecture lesson. |
| rust-nostr | REFERENCE | no_std layering + Schnorr-signed events; deps too heavy to pull. |
| webrtc-rs | SKIP | Browser-WebRTC stack; QUIC/iroh is the right path if networking ever ships. |
| yggdrasil-go | SKIP | Go daemon, mesh router — wrong domain. |
| arti | REFERENCE | 68-crate workspace decomposition pattern; anonymity features out of scope. |
