Skip to content

ADR: production BLAKE3 corruption verification (interactive keccak256 Merkle proof + root-binding) #387

Closed

Description

@alpergundogdu

Background

ADR 014 § 2 currently specifies a single-round optimistic challenge-response for BLAKE3 content corruption: challenger posts the node's signed `StreamResponse` + 100 TOKEN bond; node has 24 h to counter with delivery proof; if no counter, slash. This relies on bond economics + the node being unable to produce counter-evidence, not on cryptographic proof of corruption.

ADR 014 also originally sketched a production-grade upgrade path — interactive keccak256 Merkle proofs over 1024-byte chunks — but that sketch was incomplete. In particular, the spec said:

Binding Merkle root to BLAKE3 hash: The contract cannot independently verify that a keccak256 Merkle root corresponds to a given BLAKE3 hash (BLAKE3 is not available on-chain). The production protocol addresses this by requiring the node to commit a keccak256 Merkle root for each blob it serves, either at delivery time (included in `StreamResponse` as an additional field) or registered on-chain. This commitment is the subject of a future ADR.

That subject was never written. The half-design has been dropped from ADR 014 (PR #386) so the ADR doesn't carry sketches of unbuilt designs; this issue tracks the missing follow-up ADR.

What needs deciding

A future ADR must answer at least:

  1. Where does the keccak256 Merkle root live?
    • Added to `StreamResponse` as a signed field (wire-format change, ALPN tier per ADR 013), or
    • Pre-registered on-chain by the publisher at ingest, indexed by BLAKE3 hash, or
    • Computed lazily by an indexer service and posted on-challenge.
  2. How is the Merkle root bound to the BLAKE3 hash? Each option above has a different trust model — a signed wire field commits a node to one root per request; an on-chain registry needs the publisher to opt in; a lazy indexer needs anti-griefing.
  3. Tree shape. ADR 014 sketched a 1024-byte leaf size matching iroh-blobs' BLAKE3 hash-tree leaves. Confirm vs alternative sizes (gas cost vs proof depth tradeoff).
  4. Two-round protocol mechanics. Challenger submits commitment + corrupt chunk + Merkle proof; node responds with correct chunk + Merkle proof. Resolution rules. Bond mechanics on each side.
  5. Migration / coexistence with the optimistic path. Both at once? Optimistic deprecated when Merkle ships?

Why now-ish

Optimistic challenge has two known weaknesses:

  • Bond-economics dependency — at low TOKEN price the 100 TOKEN griefing cost is small. Cryptographic proof eliminates this dependency.
  • Counter-evidence ambiguity — "did the node deliver the bytes" is loose. Cryptographic proof of corruption removes the judgement call.

Neither is a launch blocker if bond + reputation are deemed sufficient at first; this is a hardening step for when the optimistic surface starts to show.

Definition of done

  • A new ADR (next free number, currently 028) documenting the production design end-to-end.
  • ADR 014 § 2 updated with a one-line cross-reference to the new ADR once it lands.
  • Implementation tracking issue(s) filed against the new ADR.

Activity

  1. self-assigned this
    on May 8, 2026
  2. alpergundogdu commented on May 8, 2026

    @alpergundogdu
    ContributorAuthor

    Resolved without on-chain enforcement.

    After working through the threat model end-to-end: progressive BLAKE3 verification at the client (already mandatory in cdn/client/v1 per ADR 002 / ADR 005) catches corrupt bytes at the wire, and post-verification voucher signing means a corrupt window never yields a voucher. Client monetary loss in the corruption case is zero.

    This collapses the original five questions:

    1. Where does keccak256 Merkle root live? N/A — no per-stream merkle_root needed; client-side BLAKE3 verifier is the authority.
    2. How is the root bound to the BLAKE3 hash? N/A — no root needed.
    3. Tree shape. N/A.
    4. Two-round protocol mechanics. N/A — no on-chain dispute.
    5. Migration / coexistence with the optimistic path. Both paths superseded; the optimistic path itself becomes vestigial after this resolution lands.

    The "node signs wrong R / serves bytes that don't BLAKE3 to X" attack is observably harmful only when the node also ships matching wrong bytes — at which point it's wire corruption, caught by streaming verification. R is never observable to anyone in the corruption case.

    Outcome:

    • #477 (ADR 030 production path) closed.
    • #480 updates ADR 003 §Corrupted delivery with the wire-level resolution.
    • Follow-up PR will remove ADR 014 §2 (optimistic path) and drop OffenseType.Corruption from the enum.

    Closing this issue as resolved-no-action.

    🤖 Generated with Claude Code

  3. thiras commented on May 10, 2026

    @thiras
    Contributor

    Closing as resolved per the prior comment by @alpergundogdu and PR #480.

    PR #480 dropped ADR 014 §2 (optimistic corruption challenge) and OffenseType.Corruption, with corruption now fully absorbed at the wire by progressive BLAKE3 verification + post-verification voucher signing (see ADR 003 §Corrupted delivery, ADR 014 lines 16, 259-260). No follow-up ADR for keccak256 Merkle proofs is needed — the production-path question is moot.

    PR #477 (the ADR 030 production-path proposal) was closed as superseded; this issue was missed at that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions