Skip to content

docs(adr): drop Ed25519 wire signature on ProbeResponse/StreamResponse; consolidate on slash_sig (#408) - #409

Merged
thiras merged 2 commits into
mainfrom
claude/frosty-tu-703c68
May 6, 2026
Merged

thiras merged 2 commits into
mainfrom
claude/frosty-tu-703c68

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Closes #408.

Drops the Ed25519 message-body signature on ProbeResponse and StreamResponse, leaving slash_sig (EIP-712 secp256k1) as the sole body signature. Removes the production opt-out path (zero-length slash_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_sig for cheap ecrecover (~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:

  • On-chain slashing: SlashJudge consumes only slash_sig.
  • Off-chain evidence portability: ecrecover + StakingRegistry.nodeIdOf(recovered) lookup attributes any signed message to a NodeId.
  • In-session integrity: iroh's QUIC handshake already authenticates connection-level NodeId; body-level message tampering by middleboxes is impossible under QUIC encryption.
  • Connection-level peer auth: handled by the iroh transport, never the body sig.

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 by SignatureChecker per ADR 024; EIP-712 signing trivial for any operator stack capable of staking). Reputation pressure works equally well when slash_sig is just mandatory.

Wire format changes

- ProbeResponse {has_blob, rate_per_mb, timestamp_us, signature, total_bytes?, slash_sig}
+ ProbeResponse {has_blob, rate_per_mb, timestamp_us, total_bytes?, slash_sig}

- StreamResponse {ok, rate_per_mb, total_bytes, timestamp_us, signature, redirect?, error?, voucher_interval_mb?, slash_sig}
+ StreamResponse {ok, rate_per_mb, total_bytes, timestamp_us, redirect?, error?, voucher_interval_mb?, slash_sig}

NodeAnnounce and ReputationReport keep their Ed25519 sigs — they're gossip with no slash_sig alternative. The Ed25519 NodeId-ownership proof on StakingRegistry.registerNode is unrelated and unchanged. Off-chain verifiers go from native Ed25519 verify to ecrecover + a StakingRegistry.nodeIdOf lookup; the binding cache is already maintained for clientStakeOf / 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 — drop signature from wire definitions; rewrite Signer-binding paragraph; drop PoC-constraint callout
  • adr/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 consequences
  • adr/001-network.md — update probe-flow ProbeResponse definition; update §1 cross-ref anchor
  • adr/003-payments.md — update §1 cross-ref anchors
  • adr/011-content-takedown.md — drop "dual-key scheme" reference in blacklist evidence path
  • adr/012-client.md — fix "StreamResponse is signed by the node's iroh key" (now slash_sig)
  • adr/architecture.md — update ADR 014 summary line
  • adr/README.md — update Slash-signature glossary entry
  • adr/appendix-operator-key-rotation.md — iroh node-key no longer signs ProbeResponse/StreamResponse body; update key-role table
  • adr/_history/alternatives-pre-launch.md — relabel "Dual-key" → "secp256k1 EIP-712" in the Slash-Signature-Scheme alternatives table; update breadcrumb anchor

Test plan

  • Verify all #1-slash-signatures--secp256k1-eip-712 anchor refs render correctly on GitHub
  • Verify architecture.md and README.md glossary entries are consistent
  • Verify no remaining signature field appears in any ProbeResponse {...} or StreamResponse {...} wire definition

🤖 Generated with Claude Code

…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]>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread adr/005-protocol.md

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}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
  1. In dense formats like tables, rely on convention (e.g., the ? indicator) and contextual descriptions instead of redundant type annotations.
  2. Ensure documentation accurately reflects the implementation, particularly regarding optional fields and protocol specifications.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disagreeing on this one. The asymmetry between ProbeResponse.total_bytes? and StreamResponse.total_bytes is intentional:

  • ProbeResponse.total_bytes? — optional and not covered by slash_sig (adr/005-protocol.md L55: "The field is not covered by slash_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_sig is 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}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
  1. In dense formats like tables, rely on convention (e.g., the ? indicator) and contextual descriptions instead of redundant type annotations.
  2. Ensure documentation accurately reflects the implementation, particularly regarding optional fields and protocol specifications.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

alpergundogdu added a commit that referenced this pull request May 5, 2026
- 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]>
thiras pushed a commit that referenced this pull request May 6, 2026
…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
@thiras
thiras merged commit 4e99764 into main May 6, 2026
8 of 9 checks passed
@thiras
thiras deleted the claude/frosty-tu-703c68 branch May 6, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop Ed25519 wire signature on ProbeResponse/StreamResponse; consolidate on slash_sig

2 participants