RFC 9162 inclusion-proof vector set (41 vectors) — would you run it against proof.VerifyInclusion?

Open
#271 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
58/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go, python

Research direction

Read conformance/ADAPTER-PROTOCOL.md and inspect proof.VerifyInclusion and rfc6962/rfc6962.go to build an adapter that feeds the raw leaf input through HashLeaf before verification. Run python tools/conformance_harness.py --adapter "<your command>" against the 41 vectors; done means the receipt reports root agreement and verdict agreement separately.

Written by the indexing model from the issue text.

Description

I maintain a small RFC 9162 inclusion-proof vector set and I would like to know
whether your proof.VerifyInclusion reads it the same way we do.

What the vectors are. 41 cases, six classes, all at the tree layer — leaf
input, leaf index, tree size, inclusion path, expected root:

Class Count
valid 21
invalid inclusion path 12
invalid leaf index 2
invalid leaf digest 1
invalid tree size 1
valid but tree size unauthenticated 4

Tree shapes covered: 1–9, 15–17, 31, 32, 33, 63, 64, 65. The package is byte-reproducible from a
script (--check-drift compares the committed files against a fresh build in
both directions), and each file carries its SHA-256 in SHA256SUMS.

The seven fail-path-short* / fail-path-swap* vectors isolate two properties a
verifier can get wrong separately: length (a dropped sibling stops the fold one
level below the root) and order (two siblings exchanged keep byte count and path
length identical, so only a verifier that actually folds catches it).

Two things in it are deliberately not scored:

  • tree_size = 0 is under-specified by the RFC. We refuse to fold it; an
    independent reading folds to the empty-tree root. Rather than pick a winner, the
    case is declared in manifest.underspecified_inputs and not scored.
  • Four cases declare a tree_size one larger than the path requires. The root is
    unchanged by that, so they cannot serve as invalid-tree-size cases; they are
    filed as ambiguous instances, found by exhausting sizes 1..19 rather than by
    guessing.

What running it costs you. One executable speaking two lines of JSON:

stdin  : {"leaf_input_hex":"…","leaf_index":3,"tree_size":8,
          "inclusion_path":["…","…","…"],"root_true":"…"}
stdout : {"reconstructed_root":"…","result":"YOUR VERDICT WORD"}

python tools/conformance_harness.py --adapter "<your command>" starts it once per
vector, folds nothing itself, and writes a receipt naming your command, your OS,
your runtime and the UTC time.

// the whole adapter, modulo your I/O
lh := rfc6962.DefaultHasher.HashLeaf(leafInput) // it adds the RFC 6962 0x00 prefix
if err := proof.VerifyInclusion(rfc6962.DefaultHasher, index, size, lh, path, root); err != nil {
    // your verdict word; ours is INVALID_INCLUSION_PATH
}

(checked against rfc6962/rfc6962.go — HashLeaf writes the leaf-hash prefix itself,
so pass the raw leaf input; VerifyInclusion takes the leaf hash.)

What the receipt separates, and why. root_agreement (did your fold produce
the same root — language-neutral, a byte string either matches or not) is reported
apart from verdict_agreement (did your verdict word match ours). If you say
E_PROOF_MISMATCH and we say INVALID_INCLUSION_PATH, the receipt records
wording only and does not count it as a failure. A report that says "6 of 41
failed" because of vocabulary teaches nobody anything.

What I am not asking for. Not an endorsement, not a review of our design, not
a change to your code. If the roots disagree, that is our defect to fix and the
receipt will say which step differed byte-for-byte.

Disclosure, so this is not a pitch. We are not in a position to claim a better
implementation; we are asking whether a set of vectors agrees. Until 2026-11-21
this page would have told you that our own Rekor inclusion proof did not verify —
by our reading, and by a third party's on the same proof. That was wrong, and the
error was ours, in two places: the leaf is SHA-256(0x00 ‖ body bytes) (we hashed
the body first and hashed the digest again), and a proof folds against
verification.inclusionProof.logIndex, which is a different number from
entry.logIndex. It verifies now, and the retraction with a reproduction is
published at docs/REKOR-INCLUSION-2026-11-21.md. A negative result we had to
withdraw ourselves is an honest description of where we stand: we can fold a path
and check a checkpoint signature, and we have not audited whether the log ever
signed a conflicting root.

If you would rather not be named in the filed receipt, say so and the row will
read independent implementer (anonymous, at their request) with your receipt
still attached.

Repo: https://github.com/zhaoxinghua09-cell/uibc-core — conformance/ADAPTER-PROTOCOL.md
is the one page to read; docs/INVITE-ONE-PAGE.md is the short version.

— Xinghua Zhao

Dominant language
Go
Stars
42
Forks
14
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from transparency-dev/merkle

All issues in transparency-dev/merkle

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.