Skip to content

proofs: leanXMSS unforgeability follow-ups #1385

Done

Description

@tcoratger

Problem

The leanXMSS unforgeability proofs have open follow-ups.
One bound term is not bounded, the Merkle tree has no public bridge to VCVio's tree, and the leanXMSS signer has no seed-PRF parameter.
Two cleanups wait on the draft XMSS VCV stack.

Facts

Bound the signing failure (EXT-23, part 2):

  • reasonForgeAdvantage_le_add bounds a game whose signing reply is Except XmssError Signature by q / 2^127 + signingFailure (proof(xmss): bound forgery when the signer tells why signing failed #910).
  • signingFailure has no bound.
  • The ingredient is prEvent_findCodeword_none_le.
  • The plan: show that the 2^32 trial inputs of each search are fresh when the search runs. Their randomizers derive from a hash of the secret seed, so this needs a hidden-seed game hop, as in the leanSPHINCS proofs. Then take a union bound over the distinct (layer, key, message) searches, plus the probability that the adversary queries an input with the seed.
  • Repeated requests make the search deterministic, so count distinct searches only.
  • Shared pieces go to Proofs/HashSig. Never import Sphincs from Xmss.

A public bridge to VCVio's PerfectMerkleTree (EXT-22):

A seed-PRF parameter for the leanXMSS signer (EXT-1):

  • leanSPHINCS has SeedPrf and seedPrf.
  • leanXMSS hashes the seed inline, for example in chainStarts.
  • With a parameter, a reduction could swap the PRF without a callback copy of the signer.
  • This is a change to the specification, so it must keep leanXMSS byte-identical with leanVM.

Blocked on the draft XMSS VCV stack (#839, #843, #852, #855):

Proposed approach

  1. Bound signingFailure with the hidden-seed hop. This is the largest item.
  2. Add the public Merkle bridge, and remove the duplicate lemmas.
  3. Decide on the seed-PRF parameter with the maintainers before any specification change.
  4. Do EXT-24 and EXT-25 only when the stack moves.

Acceptance criteria

  • A theorem bounds signingFailure by explicit terms in the number of requests and hash queries, with no new axiom.
  • One public copy of each bridge lemma.
  • FULL audit for each security statement.

Risks

  • The hidden-seed hop is research-size.
  • Any change to the leanXMSS definitions must keep the output identical to leanVM.

Activity

  1. tcoratger commented on Nov 8, 2026

    @tcoratger
    CollaboratorAuthor

    Status from the run of 2026-11-08, and a decision on how to do EXT-23 part 2 and EXT-1.

    Done

    EXT-22 (Merkle bridge and duplicate lemmas): done in #1518.

    • The Merkle node, root, path and climb now equal the perfect tree of the imported oracle framework, in every lawful monad (Proofs/Merkle/Perfect.lean).
    • The leanXMSS and leanSPHINCS models share one in-order helper and one copy of its lemmas, in Proofs/HashSig.lean.
    • xor_one in Completeness.lean stays private. Making it public would rebuild every importer of that file; proof(merkle): bridge to the framework's perfect tree, and share the in-order lemma #1518 explains this.

    EXT-23 part 2: why the existing pieces do not suffice

    • prEvent_signWith_error_le needs a cache with no input at the key's message address and a payload of the trial length.
    • In the game, the adversary knows the public parameter and the addresses, so it can query such inputs. The hypothesis then fails.
    • A trial input is a trial input of one base only up to 2^32 choices, and the base is a hash of the scheme seed. The adversary cannot aim at it unless it learns the seed. Making that argument formal needs a hidden-seed hop.
    • The chain of hops in Security/XmssSecurity/Proof/Bridge cannot carry the failure event:
      • Its games return only the win bit, through the model's gameRest, which much of the model proof uses.
      • The step from the table signer to the model's fresh-randomizer signer (cleanGame_le_ref) is an inequality proved only for the win event.

    Decision: a seed-PRF signer, then the generic hidden-seed hop

    The plan is a short series of pull requests:

    1. EXT-1, specification. Add a seed-PRF type to leanXMSS, PublicParam → Address → ByteArray → m (Vector UInt8 32). Its instance is H(P | A | S | suffix).

      • The public parameter, the chain starts and the randomizer base take this PRF instead of the seed: publicParamOf, chainStarts, randomizerBase, and every caller up to signDerived and publicKeyOf.
      • keyGenWith and signWith pass the seed's PRF, so the bytes do not change. The chain starts hash S with an empty suffix, and a one-line lemma removes the empty suffix.
      • The leanXMSS key generation and signing vectors in the Python suite check that the outputs stay the same.
      • Every caller is in Xmss/ and Proofs/Xmss/; no file outside them uses these names.
    2. Two hidden-seed hops with the generic hop in Proofs/DerivationTable.lean, as the VRF unpredictability proof uses it. The game's derivations become derivation queries:

      • First, the key's seed S_0 behind S = H("leanXMSS" | S_0).
      • Then S behind every PRF call.
      • Each point fixes its seed, because the prefixes have fixed length, so each hop costs at most q / 2^256. The event is "some request fails", which the hop allows because it holds for any event.
    3. The failure in the ideal game. There, each derivation is drawn from a lazy table on first use.

      • A new search (layer, key, message) draws its base fresh when it runs.
      • Each cached input at that key's message address is a trial input for at most 2^32 of the 2^128 bases. So the trials are all fresh except with probability at most q / 2^96, and a fresh search fails with probability at most exp(-4000).
      • A repeated search reads the same base from the table. If the earlier search succeeded, the cache holds a trial input whose answer is a codeword, so the repeat succeeds too. One lemma about the codeword search in a cache shows this.
    4. The bound. Let q be the game's hash-call budget and r the number of signing requests. The target is

      signingFailure ≤ 2 q / 2^256 + r (q / 2^95 + 2 exp(-4000))

      It then feeds reasonForgeAdvantage_le_add. Shared pieces, such as the lemma that a cached codeword stops the search, go to Proofs/HashSig or Proofs/Wots, so leanXMSS imports nothing from leanSPHINCS.

    Why this route:

    • The generic hop already holds for any event and any public oracle, and the VRF proof already uses it.
    • It leaves the large model proof alone.
    • It gives EXT-1 a user, so the specification change is not speculative.
    • A route that reuses the model's chain would have to change the model's return type and reprove its last step for a new event.

    Gate: step 1 changes the specification. This issue asks for agreement before any such change. So I stop here, and step 1 starts after a maintainer agrees with the change above. If you prefer to keep the signer as it is, steps 2 and 3 can run over a copy of the signer that takes the PRF, but that is the callback copy that EXT-1 was meant to avoid.

    EXT-24 and EXT-25: still blocked

  2. tcoratger commented on Nov 8, 2026

    @tcoratger
    CollaboratorAuthor

    Status after route B, which the maintainer approved here.

    Done

    Limits worth a follow-up

    • The failure term is at least r^2 / 2^62, so it says nothing from about 2^31 requests. The loss comes from the proof: it charges each new search the whole cache. Only the adversary's queries can hold a new search's trial inputs, so counting those, or counting how many trials are cached rather than whether one is, would give a bound linear in r.
    • The final theorem takes two budgets of one adversary: the support-based q of the main theorem and the structural qH, r. Deriving q from qH and r would leave one.
    • signDerived_map_monad takes a map_map hypothesis; LawfulMonad would imply it.

    Still blocked

    EXT-24 and EXT-25 still wait on the drafts #839, #843 and #852. I did not touch any draft. I leave this issue open for them.

  3. tcoratger commented on Nov 10, 2026

    @tcoratger
    CollaboratorAuthor

    Status from the run of 2026-11-10.

    The parts that need no change to the specification are done: EXT-22 (#1518), EXT-1 and EXT-23 part 2 (#1582, #1586, #1588), and the acceptance criteria above hold on master.

    What is left is outside this lane's reach:

    The improvement listed under "Limits worth a follow-up" (a failure bound linear in the number of requests) is not part of the acceptance criteria. It needs no change to the specification, but it is a new proof of research size, so it fits better in its own issue.

    I leave this issue open for EXT-24 and EXT-25.

  4. added
    type: proof
    on Nov 19, 2026
  5. tcoratger commented on Nov 25, 2026

    @tcoratger
    CollaboratorAuthor

    Status on 2026-11-25.

    Nothing else is open in this issue.
    A maintainer can close it now and let #839 carry EXT-24 and the drafts carry their pins, or keep it open until #839 lands.

    🤖 Generated with Claude Code

  6. tcoratger commented on Nov 25, 2026

    @tcoratger
    CollaboratorAuthor

    PR #4697 bounds signingFailure by Q (1 - p)^(2^31) <= Q exp(-2000) (signingFailure_le_pow, signingFailure_le_exp in Proofs/Xmss/Unforgeability/SearchFailure.lean), where Q bounds the game's hash calls.
    That bound is at most the older signingFailure_le of IdealFailure.lean for every qH and r, and it needs no seed hop.

    Follow-up worth a decision: the ideal-game route (IdealBase, IdealFailure, most of IdealSearch, and the hop half of SeedHops) now only feeds the weaker bound.
    It could be retired, keeping KeptOk, trialInput and codeword_messageDigest_queryH beside their consumers, and signingFailure_le_pow could then take the name signingFailure_le, as in leanSPHINCS.

    Smaller cleanups from the review of #4697, left for later:

    • Move cached_of_mem_support_findFirst_none into the Cached section of Proofs/Wots.lean, beside its siblings.
    • State run_failSignerOf_inl and run_failSignerOf_inr for any handler beside failSignerOf, and reuse them in IdealFailure.lean.
    • Define blockPoint through trialInput, and share one lemma that splits a trial-input equality (three copies today).
  7. tcoratger commented on Nov 26, 2026

    @tcoratger
    CollaboratorAuthor

    Closing: the acceptance criteria hold on master (#1518, #1582, #1586, #1588, #4697), and EXT-25 is done (VCVio pinned to tag v4.36.0). EXT-24 stays with draft #839, and the small follow-ups of #4697 are listed on that pull request.

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

    type: proof

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions