Repository navigation
docs: add ADR 012 (client architecture) and move key delivery to iroh QUIC - #162
Conversation
Closes #144. Clients are referenced throughout ADRs 001-011 but no ADR defined how they discover the network, manage keys, or what their trust assumptions are. This ADR consolidates client behaviour into a canonical spec covering bootstrap procedure, key management (iroh Ed25519 + Ethereum secp256k1 + derived X25519), ephemeral identity lifecycle, eclipse attack resolution (Option B for production, registry-only for PoC), and an explicit three-tier trust boundary. Also resolves the open eclipse attack question in ADR 003 and adds the ADR 012 entry to architecture.md. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds ADR 012 to consolidate and canonically specify client behavior (bootstrap, keys, identity lifecycle, eclipse mitigation, and trust boundary), and updates existing ADR index/notes to reflect the new decision.
Changes:
- Add new ADR 012 detailing client architecture, bootstrap procedure, key management, identity lifecycle, eclipse-attack mitigation decision, and trust boundary.
- Update
adr/architecture.mdto include ADR 012 in the architecture/ADR index. - Update ADR 003 to note that the eclipse-attack option decision is resolved in ADR 012.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| adr/architecture.md | Adds ADR 012 entry to the architecture ADR index and summarizes its scope. |
| adr/012-client.md | Introduces ADR 012 with the consolidated client specification (bootstrap, keys, identity, eclipse mitigation, trust model, config). |
| adr/003-payments.md | Adds a resolution note pointing eclipse-attack decision-making to ADR 012. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request introduces ADR 012, which establishes a comprehensive specification for client architecture, bootstrap procedures, and trust boundaries. It consolidates client behaviors previously scattered across other ADRs and resolves the eclipse attack mitigation strategy by adopting a multi-source bootstrap for production. The review feedback suggests enhancing security by encrypting the iroh secret key in PoC environments and using domain-separated messages for hot key derivation to prevent replay attacks. Additionally, it recommends using the on-chain registry as the canonical source for peer addresses and refining technical terminology regarding backoff strategies for better precision.
Replace WebSocket/SSE key delivery with a new cdn/keys/v1 ALPN on iroh
QUIC. The app server now communicates with clients over authenticated
QUIC streams instead of a separate WebSocket transport. This eliminates
crypto_box_seal and the X25519 key from the client's key set — QUIC
TLS 1.3 provides equivalent confidentiality and mutual authentication.
Changes across ADRs 005, 006, 012, and architecture.md:
- ADR 006: app server uses cdn/keys/v1 with three stream types (epoch
key, play request, offline lease); envelopes are {wrapped, epoch_id,
blob_hash} over QUIC; client decryption flow simplified
- ADR 012: X25519 key removed (two keys not three); key compromise
table updated; trust boundary updated for cdn/keys/v1
- ADR 005: cdn/keys/v1 added to ALPN and stream concurrency tables
- architecture.md: diagram, summaries, and external components updated
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- CLAUDE.md: update ADR range to 012-client.md, next number to 013 - ADR 006: fix stale POST /offline/lease and HTTPS reference in offline lease pseudocode — now references cdn/keys/v1 stream type 0x03 - architecture.md: fix ALPN count to "Five protocols" matching ADR 005 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/gemini review |
- Bootstrap: specify paginated getActiveNodes calls - nonce=0 security: fix incorrect claim that on-chain requires nonce>0; actual protection is EIP-712 domain separator (contract addr + chain ID) - Hot key derivation: add Ethereum address for domain separation and rejection sampling note for secp256k1 scalar conversion - DNS seeds: reconcile hardcoded vs config (built-in defaults + runtime override); registry multiaddrs are canonical source of truth - TOML: add note that client must perform home-directory expansion - architecture.md: remove "Canonical" from ADR 012 summary wording Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces ADR 012, which defines the client architecture, bootstrap process, and trust model, while refactoring ADR 006 to use a new iroh QUIC protocol (cdn/keys/v1) for key delivery instead of WebSocket/SSE. The encryption model is simplified by removing the asymmetric layer in favor of QUIC TLS 1.3. Review feedback identifies several improvement opportunities, including caching a window of epoch keys to prevent decryption failures during rotation and addressing missing App Server configuration details. Other suggestions include refining retry terminology, using generic RPC placeholders, and documenting security trade-offs for session token storage.
- Bootstrap: add DNS seed merge steps (4-5) for production; label PoC skip explicitly - ADR 006: add authentication sequencing constraint — epoch key stream must be established before play/lease streams - ADR 006: cache current + previous epoch key (not just current) to handle content buffered at epoch boundaries - ADR 012: add [app_server] config section with node_id and addrs - ADR 012: use generic RPC URL placeholder instead of Alchemy Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
cdn/keys/v1iroh QUIC ALPN, droppingcrypto_box_sealand the X25519 key from the client's key setCloses #144
ADR 012 covers
~/.decdn/directory structure and TOML config defaultsKey delivery redesign (ADR 006 + cross-cutting)
The app server now communicates with clients over
cdn/keys/v1iroh QUIC instead of WebSocket/SSE. Three stream types on a single connection:POST /playPOST /offline/leaseQUIC TLS 1.3 provides confidentiality and mutual authentication, eliminating
crypto_box_sealand the X25519 key. Clients now manage two keys (iroh + Ethereum) instead of three. iroh key rotation is seamless — reconnect with new NodeId, re-authenticate with session token, no sealed envelopes to invalidate.Files changed
adr/012-client.mdadr/006-e2e-encryption.mdcdn/keys/v1; dropcrypto_box_seal; simplify decryption flowadr/005-protocol.mdcdn/keys/v1to ALPN + stream concurrency tablesadr/architecture.mdadr/003-payments.mdCLAUDE.mdTest plan
crypto_box_sealno longer appears as active protocol (only in "not needed" context)WebSocket/SSEreferences for key deliveryX25519removed from ADR 012 key managementcdn/keys/v1appears consistently across ADRs 005, 006, 012, and architecture.md[ADR NNN](NNN-*.md)cross-references resolve🤖 Generated with Claude Code