Repository navigation
docs(adr): drop Ed25519 wire signature on ProbeResponse/StreamResponse; consolidate on slash_sig (#408) - #409
Conversation
…e; consolidate on slash_sig (#408) The Ed25519 message-body signature on ProbeResponse and StreamResponse was a historical artifact: ADR 005 originally specified it as the slashing-evidence mechanism (April 2026, #2), and when ADR 014 added slash_sig (EIP-712 secp256k1) six months later for cheap on-chain verification (~3k gas vs. ~500k-1M for Ed25519), the Ed25519 sig was kept rather than removed. Every job it does is also covered by slash_sig: SlashJudge never consumes it, and off-chain evidence portability works via ecrecover + StakingRegistry.nodeIdOf lookup. The "production opt-out" path (zero-length slash_sig as opt-out, with Ed25519 as fallback non-repudiation) is also dropped. Every node is already mandatorily on-chain registered, staked, and slashable via ADR 003 vouchers and ADR 011 origin blacklisting. Granting a hatch out of probe/stream-specific slashing while requiring full on-chain participation everywhere else made universal accountability the protocol's stance with an unjustified exception. Reputation pressure squeezes out non-conforming nodes equally well when slash_sig is simply mandatory. Wire format changes: - ProbeResponse {has_blob, rate_per_mb, timestamp_us, total_bytes?, slash_sig} - StreamResponse {ok, rate_per_mb, total_bytes, timestamp_us, redirect?, error?, voucher_interval_mb?, slash_sig} NodeAnnounce and ReputationReport keep their Ed25519 signatures (gossip, no slash_sig alternative). The Ed25519 NodeId-ownership proof on StakingRegistry.registerNode is unrelated and unchanged. This is a Tier 3 / ALPN bump per ADR 013, taken now before any production traffic exists. Closes #408. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request refactors the protocol's signature scheme by removing redundant Ed25519 message-body signatures in favor of a single secp256k1 EIP-712 slash_sig for on-chain accountability and message attribution. Ed25519 remains the primary mechanism for connection-level peer authentication. The changes update multiple ADRs to reflect this streamlined approach, which reduces wire overhead and simplifies verification logic. Feedback suggests adding the optional ? indicator to the total_bytes field in StreamResponse definitions across ADR 005 and ADR 014 for consistency with other optional fields.
|
|
||
| P->>D: StreamRequest {hash, channel_id, byte_offset, timestamp_us, voucher_interval_mb?} | ||
| D->>P: StreamResponse {ok, rate_per_mb, total_bytes, timestamp_us, signature, redirect?, error?, voucher_interval_mb?, slash_sig} | ||
| D->>P: StreamResponse {ok, rate_per_mb, total_bytes, timestamp_us, redirect?, error?, voucher_interval_mb?, slash_sig} |
There was a problem hiding this comment.
The total_bytes field in StreamResponse is missing the optional ? indicator, which is inconsistent with its usage in ProbeResponse and the description of it being an optional field. Please add ? to total_bytes for consistency and to ensure the documentation accurately reflects the implementation.
References
- In dense formats like tables, rely on convention (e.g., the
?indicator) and contextual descriptions instead of redundant type annotations. - Ensure documentation accurately reflects the implementation, particularly regarding optional fields and protocol specifications.
There was a problem hiding this comment.
Disagreeing on this one. The asymmetry between ProbeResponse.total_bytes? and StreamResponse.total_bytes is intentional:
ProbeResponse.total_bytes?— optional and not covered byslash_sig(adr/005-protocol.md L55: "The field is not covered byslash_sig— it is not needed for any slashing mechanism"). At probe time the node may not yet have looked up the blob.StreamResponse.total_bytes— mandatory, and the slash_sig EIP-712 typed data signs it (adr/005-protocol.md L134: "slash_sigis an EIP-712 secp256k1 signature over{hash, ok, rate_per_mb, total_bytes, channel_id, timestamp_us, redirect}"). The delivering node always knows the blob size at this point, and§BlobTooLarge enforcement(L259) reads it on cache-miss pulls.
Marking total_bytes? on StreamResponse would create wire-format ambiguity in the signed payload (no defined encoding-when-absent for the EIP-712 type) and contradicts the pre-PR mandatory shape on main. This PR is scoped to dropping the Ed25519 wire signature — changing field optionality is out of scope. Leaving as-is.
| ProbeResponse {has_blob, rate_per_mb, timestamp_us, signature, total_bytes?, slash_sig} | ||
| StreamResponse {ok, rate_per_mb, total_bytes, timestamp_us, signature, redirect?, error?, voucher_interval_mb?, slash_sig} | ||
| ProbeResponse {has_blob, rate_per_mb, timestamp_us, total_bytes?, slash_sig} | ||
| StreamResponse {ok, rate_per_mb, total_bytes, timestamp_us, redirect?, error?, voucher_interval_mb?, slash_sig} |
There was a problem hiding this comment.
The total_bytes field in StreamResponse is missing the optional ? indicator, which is inconsistent with its usage in ProbeResponse and the description of it being an optional field. Please add ? to total_bytes for consistency and to ensure the documentation accurately reflects the implementation.
References
- In dense formats like tables, rely on convention (e.g., the
?indicator) and contextual descriptions instead of redundant type annotations. - Ensure documentation accurately reflects the implementation, particularly regarding optional fields and protocol specifications.
There was a problem hiding this comment.
Same reasoning as the duplicate comment on adr/005-protocol.md: StreamResponse.total_bytes is mandatory and signed by slash_sig (see L41 of this file: "StreamResponse slash_sig covers: {hash, ok, rate_per_mb, total_bytes, channel_id, timestamp_us, redirect}"). The ? only applies to ProbeResponse.total_bytes, which is unsigned. Leaving the StreamResponse line unchanged.
- adr/001-network.md mermaid: fix fallback semantics (DHT no-providers triggers directory fallback; directory-returned providers must be probed before selection) - adr/001-network.md step 3: restore signature field in ProbeResponse field list (signature removal is scoped to PR #409, not this PR) - adr/005-protocol.md: update inbound probe rate limit reference from 20 to 5 to match the recalibrated value in adr/001-network.md Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ck (#411) (#415) * docs(adr): drop bootstrap probe fan-out; on-chain directory is fallback (#411) Removes broadcast probe fan-out from the content-discovery flow. ADR 022 made the DHT primary; fan-out was retained as a "bootstrap fallback before the routing table is populated." But the DHT bootstraps from StakingRegistry.getActiveNodes() — a node's first peers come from the on-chain registry and immediately participate in DHT lookups, so there is no separate window during which DHT cannot resolve. When DHT returns no providers, the on-chain origin directory (ADR 022 § Origin discovery) is the deterministic last-resort fallback for both registered and default-open namespaces. Fan-out becomes a fallback for a fallback that the second layer already covers. Probe rate budgets shrink accordingly: - Outbound: 10 fan-outs/s → 3 probe batches/s (DHT-targeted) - Inbound: 20 probes/peer/s → 5 probes/peer/s The Sybil/probe-flood attack surface goes away; an attacker can no longer observe a node's full peer list via fan-out traffic. Same simplification pattern as #408. Closes #411. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(adr): address Gemini review comments on PR #415 - adr/001-network.md mermaid: fix fallback semantics (DHT no-providers triggers directory fallback; directory-returned providers must be probed before selection) - adr/001-network.md step 3: restore signature field in ProbeResponse field list (signature removal is scoped to PR #409, not this PR) - adr/005-protocol.md: update inbound probe rate limit reference from 20 to 5 to match the recalibrated value in adr/001-network.md Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(adr): finish fan-out cleanup across architecture.md, ADR 015, 017, 019, 022 Follow-up to PR #415: the original PR updated ADR 001/005/022/architecture.md but left stale fan-out references in: - architecture.md (overview text + cache-miss mermaid) - ADR 015 (0-RTT motivation framed around 30-peer fan-out) - adr/appendix-observability.md (probe_fanout_latency_seconds metric) - ADR 017 (P-09/P-10 privacy threat surfaces) - ADR 019 (bootstrap failure mode prose) - ADR 022 (Context section presented fan-out as 'current design') Recasts all to reflect: DHT FIND_VALUE returns 3-5 candidates; probes are targeted; on-chain origin directory is the deterministic last-resort fallback. Renames probe_fanout_latency_seconds metric to probe_collection_latency_seconds. Addresses leftover-references sweep findings on PR #415. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
# Conflicts: # adr/001-network.md # adr/architecture.md
Closes #408.
Drops the Ed25519 message-body signature on
ProbeResponseandStreamResponse, leavingslash_sig(EIP-712 secp256k1) as the sole body signature. Removes the production opt-out path (zero-lengthslash_sig).Why
The Ed25519 body sig was the original slashing-evidence mechanism (April 2026, #2) — designed assuming on-chain Ed25519 verification was tractable. ADR 014 (#167) discovered it isn't (~500k–1M gas on-chain) and bolted on
slash_sigfor cheapecrecover(~3k gas). The Ed25519 sig was kept rather than removed; its load-bearing reason silently shifted from "primary slash evidence" to "off-chain non-repudiation."Every job the Ed25519 body sig does today is also done by
slash_sig:SlashJudgeconsumes onlyslash_sig.ecrecover+StakingRegistry.nodeIdOf(recovered)lookup attributes any signed message to a NodeId.The "production opt-out" misfeature: every node is already mandatorily on-chain registered (
StakingRegistry.registerNode), staked, and slashable via ADR 003 (vouchers) and ADR 011 (origin blacklisting). The opt-out granted immunity from probe/stream-specific slashing while requiring full on-chain participation everywhere else — a hatch with no legitimate use case (smart accounts handled bySignatureCheckerper ADR 024; EIP-712 signing trivial for any operator stack capable of staking). Reputation pressure works equally well whenslash_sigis just mandatory.Wire format changes
NodeAnnounceandReputationReportkeep their Ed25519 sigs — they're gossip with noslash_sigalternative. The Ed25519 NodeId-ownership proof onStakingRegistry.registerNodeis unrelated and unchanged. Off-chain verifiers go from native Ed25519 verify toecrecover+ aStakingRegistry.nodeIdOflookup; the binding cache is already maintained forclientStakeOf/ voucher attribution, so the marginal cost is one extra map lookup per verification.This is a Tier 3 / ALPN bump per ADR 013 (signed-field-set change). Cheap to take now before any production traffic exists; expensive post-launch.
Files changed
adr/005-protocol.md— dropsignaturefrom wire definitions; rewrite Signer-binding paragraph; drop PoC-constraint calloutadr/014-on-chain-verification.md— rewrite §1 as "Slash Signatures — secp256k1 EIP-712" (single-signature framing); drop "dual-key" / "second signature" wording; drop production-opt-out paragraphs; update consequencesadr/001-network.md— update probe-flowProbeResponsedefinition; update §1 cross-ref anchoradr/003-payments.md— update §1 cross-ref anchorsadr/011-content-takedown.md— drop "dual-key scheme" reference in blacklist evidence pathadr/012-client.md— fix "StreamResponseis signed by the node's iroh key" (nowslash_sig)adr/architecture.md— update ADR 014 summary lineadr/README.md— update Slash-signature glossary entryadr/appendix-operator-key-rotation.md—iroh node-keyno longer signsProbeResponse/StreamResponsebody; update key-role tableadr/_history/alternatives-pre-launch.md— relabel "Dual-key" → "secp256k1 EIP-712" in the Slash-Signature-Scheme alternatives table; update breadcrumb anchorTest plan
#1-slash-signatures--secp256k1-eip-712anchor refs render correctly on GitHubarchitecture.mdandREADME.mdglossary entries are consistentsignaturefield appears in anyProbeResponse {...}orStreamResponse {...}wire definition🤖 Generated with Claude Code