Repository navigation
Done
Labels
type: proofNew or changed theorems, with no change to the library code
Description
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_addbounds a game whose signing reply isExcept XmssError Signaturebyq / 2^127 + signingFailure(proof(xmss): bound forgery when the signer tells why signing failed #910).signingFailurehas 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):
PerfectMerkleTreeappears nowhere underEthLib/.- A private
xor_oneis inProofs/Merkle/Completeness.lean:259. ofFnInOrder_eq_sequenceFinis duplicated inProofs/Xmss/Unforgeability/Translate.lean:75andProofs/Sphincs/Unforgeability/Bridge/Ots.lean:82.Proofs/Merkle/RandomOracle.leanalready imports VCVio and could hold the bridge.Completeness.leanstays VCVio-free.
A seed-PRF parameter for the leanXMSS signer (EXT-1):
- leanSPHINCS has
SeedPrfandseedPrf. - 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):
- EXT-24: derive
prEvent_ofBV_truncateHashfromofBVEquiv 16once proof(xmss): relate full words to shared byte conversions #839 landsofBVEquiv. - EXT-25: master pins VCVio
bbf05ee, a commit on VCVio main (lakefile.lean). proof(xmss): define a counted game with complete signing replies #843 pins516e8b8and proof(xmss): reconstruct a cached root from its settled path #852 pins7d5df99, unmerged VCVio integration commits. Before any merge of the stack, pin a VCVio main commit and rebuildProofs/XmssandProofs/Sphincs.
Proposed approach
- Bound
signingFailurewith the hidden-seed hop. This is the largest item. - Add the public Merkle bridge, and remove the duplicate lemmas.
- Decide on the seed-PRF parameter with the maintainers before any specification change.
- Do EXT-24 and EXT-25 only when the stack moves.
Acceptance criteria
- A theorem bounds
signingFailureby 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.
Metadata
Metadata
Assignees
Labels
type: proofNew or changed theorems, with no change to the library code
Activity
proof(merkle): bridge to the framework's perfect tree, and share the …
proof(merkle): bridge to the framework's perfect tree, and share the …
proof(merkle): bridge to the framework's perfect tree, and share the …
tcoratger commentedon Nov 8, 2026
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.
Proofs/Merkle/Perfect.lean).Proofs/HashSig.lean.xor_oneinCompleteness.leanstays 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_leneeds a cache with no input at the key's message address and a payload of the trial length.2^32choices, 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.Security/XmssSecurity/Proof/Bridgecannot carry the failure event:gameRest, which much of the model proof uses.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:
EXT-1, specification. Add a seed-PRF type to leanXMSS,
PublicParam → Address → ByteArray → m (Vector UInt8 32). Its instance isH(P | A | S | suffix).publicParamOf,chainStarts,randomizerBase, and every caller up tosignDerivedandpublicKeyOf.keyGenWithandsignWithpass the seed's PRF, so the bytes do not change. The chain starts hashSwith an empty suffix, and a one-line lemma removes the empty suffix.Xmss/andProofs/Xmss/; no file outside them uses these names.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:S_0behindS = H("leanXMSS" | S_0).Sbehind every PRF call.q / 2^256. The event is "some request fails", which the hop allows because it holds for any event.The failure in the ideal game. There, each derivation is drawn from a lazy table on first use.
2^32of the2^128bases. So the trials are all fresh except with probability at mostq / 2^96, and a fresh search fails with probability at mostexp(-4000).The bound. Let
qbe the game's hash-call budget andrthe number of signing requests. The target issigningFailure ≤ 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 toProofs/HashSigorProofs/Wots, so leanXMSS imports nothing from leanSPHINCS.Why this route:
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
ofBVEquivfrom proof(xmss): relate full words to shared byte conversions #839, a draft.refactor(xmss): derive the signer's secrets through one seed function
refactor(xmss): derive the signer's secrets through one seed function
refactor(xmss): derive the signer's secrets through one seed function (…
proof(xmss): move the signer's secrets behind two hidden-seed hops
proof(xmss): move the signer's secrets behind two hidden-seed hops (#…
proof(xmss): bound the probability that a signing request fails
proof(xmss): bound the probability that a signing request fails
proof(xmss): bound the probability that a signing request fails (#1588)
tcoratger commentedon Nov 8, 2026
Status after route B, which the maintainer approved here.
Done
SeedPrf;keyGenWithandsignWithpassseedPrf H S. Lemmas restate the old definitions underseedPrf, and the leanXMSS key generation and signing vectors are unchanged (ETHLIB_SLOW_VECTORS=1, 42 passed).signingFailure_le_prfGame: with an adversary of at mostqHhash queries andrrequests on every run, the failure moves to the ideal game of the derivations at a cost of2 Q / 2^256, whereQ = 205 * 2^16 + 1 + qH + r (2^33 + 615 * 2^16) + 384.signingFailure_le:signingFailure <= 2 Q / 2^256 + r (Q / 2^95 + 2 exp(-4000)).reasonForgeAdvantage_le_boundedadds it toq / 2^127.Limits worth a follow-up
r^2 / 2^62, so it says nothing from about2^31requests. 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 inr.qof the main theorem and the structuralqH,r. DerivingqfromqHandrwould leave one.signDerived_map_monadtakes amap_maphypothesis;LawfulMonadwould 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.
tcoratger commentedon Nov 10, 2026
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:
ofBVEquivfrom the draft proof(xmss): relate full words to shared byte conversions #839.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.
tcoratger commentedon Nov 25, 2026
Status on 2026-11-25.
ofBVEquivfrom the draft proof(xmss): relate full words to shared byte conversions #839, which is not merged.Master has no byte and bit-vector equivalence that the proof of
prEvent_ofBV_truncateHashcould use instead.It still builds its own bijection inline.
proof(xmss): relate full words to shared byte conversions #839 belongs to another contributor, so this item was not done here, to avoid a second copy of that work.
lakefile.leannow pins VCVio by its release tagv4.36.0, not by a commit on VCVio main.The drafts proof(xmss): define a counted game with complete signing replies #843 and proof(xmss): reconstruct a cached root from its settled path #852 still pin their own VCVio commits,
516e8b8and7d5df99.They have to move to master's tag before they merge.
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
tcoratger commentedon Nov 25, 2026
PR #4697 bounds
signingFailurebyQ (1 - p)^(2^31) <= Q exp(-2000)(signingFailure_le_pow,signingFailure_le_expinProofs/Xmss/Unforgeability/SearchFailure.lean), whereQbounds the game's hash calls.That bound is at most the older
signingFailure_leofIdealFailure.leanfor everyqHandr, and it needs no seed hop.Follow-up worth a decision: the ideal-game route (
IdealBase,IdealFailure, most ofIdealSearch, and the hop half ofSeedHops) now only feeds the weaker bound.It could be retired, keeping
KeptOk,trialInputandcodeword_messageDigest_queryHbeside their consumers, andsigningFailure_le_powcould then take the namesigningFailure_le, as in leanSPHINCS.Smaller cleanups from the review of #4697, left for later:
cached_of_mem_support_findFirst_noneinto theCachedsection ofProofs/Wots.lean, beside its siblings.run_failSignerOf_inlandrun_failSignerOf_inrfor any handler besidefailSignerOf, and reuse them inIdealFailure.lean.blockPointthroughtrialInput, and share one lemma that splits a trial-input equality (three copies today).tcoratger commentedon Nov 26, 2026
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.