Repository navigation
feat(transport): encrypt every frame between coordinator and volunteers (F3) - #21
Conversation
Handshake at connect: each side sends a fresh X25519 key signed with its Ed25519 identity (the coordinator's signature also covers the volunteer's hello). The volunteer checks the coordinator key against --coordinator-key, or accepts it on first use only with --trust-first-use (prints a warning). Per-direction keys from BLAKE3 derive_key; records are ChaCha20-Poly1305 with the length header as associated data and a per-direction 64-bit counter nonce, so tampered, replayed, reordered or reflected records fail to open. beacon-core gains EphemeralKeyAgreement and SessionCipher, thin wrappers over the x25519-dalek and chacha20poly1305 crates it already uses. Coordinator::serve runs the handshake on every connection; both demos pass the printed coordinator key. Co-authored-by: Drake Stapleton <drake@aien.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
⚖️ Sovereign Code Review & Alignment GateGreetings @aien-spark. I am AIEN, the automated review gate for the AIENOS project. Your pull request #21 ("feat(transport): encrypt every frame between coordinator and volunteers (F3)") has undergone automated auditing against the project standards. ✅ Doctrine Diff Audit: PASS
🌿 Sovereign Steward: Contributor Alignment InterviewGreetings @aien-spark. I am AIEN, the automated steward for the AIENOS project. We welcome all contributors who share our commitment to open collaboration, global humanity, and disciplined systems craftsmanship. We build to expand computing capability, advance open-source intelligence, and share technology freely with the world. Your pull request #21 ("feat(transport): encrypt every frame between coordinator and volunteers (F3)") is ready for stewardship alignment. Please respond directly to these four alignment inquiries:
Reply to this comment with your affirmation. Once verified against the project standards, I will grant the |
Evidence
cargo test --workspace --verbose: every suiteok, 0 failed. oh-core 61 passed (11 new transport tests); beacon-core 19 passed (3 new); newencrypted_transportintegration test 1 passed; existing loopback (4) and teaching (3) tests pass over the encrypted link.cargo clippy --workspace --all-targets: no new warnings (the 3 existing ones are in beacon-core cuckoo/lib and beacon-client, untouched code).cargo audit: 0 vulnerabilities, 252 crates (main after #19). No new dependencies; Cargo.lock unchanged.cargo fmt --checkclean for the oh-* crates; beacon-core edits are additions only.Tests:
serveround (one training volunteer, one teaching volunteer). No 16-byte run of the training shards and none of the teaching text appear; negative control: the same check finds both in plain frames.Demos:
scripts/demo-local.sh(ROUNDS=2 STEPS=50 DIM=16 SEEDS=1): 6 of 6 updates accepted over the encrypted link.scripts/demo-teach.shagainst a throwaway fake chat server (the Qwen server was down): batch 1 accepted, +824.615 T; batch 2 refused as a replay because the fake server repeats its text.What changed
EphemeralKeyAgreement(x25519-dalek, refuses non-contributory results) andSessionCipher(chacha20poly1305 with caller nonce and associated data), plusBeaconError::KeyAgreementFailed. Thin wrappers only; no new crypto math.transport: two-message handshake (fresh X25519 per connection, each hello signed with the Ed25519 identity; the coordinator signs over the volunteer's hello too), keys from BLAKE3derive_keyover the shared secret and the hash of both hellos, andEncryptedStream(Read + Write; each flush is one sealed record with a 64-bit counter nonce per direction).Coordinator::serveruns the handshake on every connection (30 s limit; failures are logged and do not take a slot).oh-volunteer: refuses to connect without--coordinator-keyunless--trust-first-use(prints a warning naming the key, then pins it); work units must be signed by the key proven in the handshake.Not built
Zero secrets: none in this diff.
🤖 Generated with Claude Code