Skip to content

Replace global Injective2 in Merkle uniqueness (single + batch) with queried-domain ("Option Injective2") formulation #486

Description

@Abraxas1010

Follow-up from #473 (Bolton's suggestion), also touching the point Quang raised there: the Merkle uniqueness results in

  • VCVio/CryptoFoundations/MerkleTree/Inductive/Uniqueness.lean (single opening), and
  • VCVio/CryptoFoundations/MerkleTree/Inductive/Batch/Uniqueness.lean (batch openings)

are currently stated under global Function.Injective2 h. That is fine as a structural sanity check, but it is not a realistic assumption for a compressing hash, and it doesn't connect to the query-transcript world where the cryptographic argument actually lives.

Proposed refinement (Bolton's "Option Injective2"): treat the hash as partial on the queried domain — e.g. a query log L : Finset (α × α) (or an (α × α) →? α partial function / Option-valued map that is none off the log) — and restate uniqueness as:

if two openings (resp. batch openings) verify against the same root and every hash evaluation they induce lies in the queried domain, then either the openings agree, or there is a collision among the queried pairs.

Concretely:

  1. Define injectivity-on-a-log: ∀ p q ∈ L, h p = h q → p = q (no global assumption).
  2. Prove the single-opening uniqueness theorem in this form; the existing constructive collision kernel (findCollision*) already produces the disagreeing pair, so the content is locating that pair inside the induced query set.
  3. Do the same for the batch version (the pruned BatchProof induces a query set that is the union over selected leaves).
  4. Keep (or demote to deprecated-style doc note) the current global-Injective2 statements as corollaries at L = univ, so nothing downstream breaks.

This gives the uniqueness lemmas the shape a game-level extractability/query-bound argument can consume directly (the collision lands in the adversary's transcript), matching the direction discussed for the addressed-tree work in #474.

Not urgent; both statements are internally consistent today. Filed so the two files get upgraded together in one later PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions