Skip to content

4.1.1 enumerates two Merkle constructions while ADR-0003 now names four #337

Description

@Mayur021

Spec section

Section 4.1.1 (Merkle Tree Domain Separation). Related: ADR-0003, Section 3.2.2,
Section 3.2.6, Section 3.2.7.

Problem

Section 4.1.1 states:

All Merkle tree constructions in this specification (corpus merkle_root, tool
catalog_hash) MUST use the RFC 9162 / RFC 6962 domain-separated hashing
convention

and its leaf bullet points leaf_data at "the relevant section (section 3.2.3
for catalog, section 3.2.5.1 for corpus)".

#335 closed the composite leaf-encoding gap and updated ADR-0003, whose header
now lists Section 3.2.2 alongside 4.1.1, 3.2.3 and 3.2.5. Section 4.1.1 was not
part of that change. The clause claiming to cover all constructions enumerates
two, the ADR names four, and a reader starting at 4.1.1 does not reach the
composite rule #335 made normative.

The memory root in 3.2.6 and the merkle-log in 3.2.7 sit outside both lists as
well. Both define tagged leaves locally, so they are covered in practice rather
than by the umbrella clause.

Proposed change

Either extend the parenthetical and the leaf_data pointer to name every
construction, or drop the parenthetical so "all" means all and the per-section
definitions are the single source. The second is less to maintain the next time
a construction is added:

All Merkle tree constructions in this specification MUST use the RFC 9162 /
RFC 6962 domain-separated hashing convention:

  • Leaf hash: SHA-256(0x00 || leaf_data), where leaf_data is defined by the
    section specifying that construction.

Impact

  • Backward compatible: yes. No construction changes; this states the scope the
    clause already intends.
  • Affects conformance level(s): all
  • Conformance tests that need updating: unclear, and this is worth a second pair
    of eyes. ADR-0003 says implementations that omit the prefixes "will fail
    conformance test AM-BIND-015", and I could not locate that test. Searching the
    repository, AM-BIND-015 appears only in ADR-0003 itself.
    python/tests/test_am_bind.py carries 44 test functions, none of which
    reference a conformance ID and none of which touch the 0x00 or 0x01
    prefixes, while CONTRIBUTING.md asks for IDs in test docstrings. AM-VEC ids do
    resolve, as files under python/tests/vectors/. If AM-BIND-015 exists
    somewhere I have not looked, pointing me at it answers this line.
  • Regulatory mapping impact: none

Alternatives considered

Leaving it as is. The ADR is operative for an implementer who finds it, but
4.1.1 is where the specification asserts the rule and it currently under-claims
its own scope.

Naming only 3.2.2. That closes today's gap and leaves 3.2.6 and 3.2.7 outside a
clause that says all, which is the same defect one construction later.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cosai-ws4CoSAI WS4 Phase 1 review (ws4 #149): raised from it, or landed in response to itneeds-review:UNKNOWNContributor check flagged UNKNOWN riskspec

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions