Skip to content

proof(xmss): move the signer's secrets behind two hidden-seed hops - #1586

Merged
tcoratger merged 1 commit into
ethereum:masterfrom
tcoratger:xmss-seed-hops
Nov 8, 2026
Merged

tcoratger merged 1 commit into
ethereum:masterfrom
tcoratger:xmss-seed-hops

Conversation

@tcoratger

Copy link
Copy Markdown
Collaborator

The leanXMSS signing-failure event moves, in two hidden-seed game hops, to a game where the signer's derivations come from an independent lazy table.
Each hop costs at most q / 2^256, where q bounds the game's hash calls.
This is step 2 of route B on #1385, approved by the maintainer on #1385.

The problem

signingFailure is the probability that some signing request of the game fails, and #910 left it unbounded.
A request fails when one of its two codeword searches finds no codeword in 2^32 trials.
For fresh trials that has probability below exp(-4000), but the adversary can query the hash too.
It cannot aim at the trial inputs, because their randomizer base is a hash of the secret seed.
Making that argument formal needs the seed out of the game first.

The idea

A hidden-seed hop (the generic prEvent_romImpl_deriveImpl_le in Proofs/DerivationTable.lean, which the VRF proof uses) turns hashes of a secret into derivation queries.
In the ideal game those queries read an independent table, and the secret appears nowhere.
The hop costs q * ε, where ε bounds the chance that one hash input encodes a derivation of the drawn secret.

leanXMSS derives in two levels, so there are two hops:

  1. S = H("leanXMSS" | S_0): the scheme seed becomes a derivation query, read again at each request (seedGame).
  2. H(P | A | S | suffix): every derivation from S becomes a derivation query (prfGame), through the seed function of refactor(xmss): derive the signer's secrets through one seed function #1582.

Each hash input fixes the seed it encodes, since the prefixes before the seed have fixed lengths.
So ε = 2^-256 for both hops.

The game is written once, as failGameOf, over a handler of hash queries and a source of derivations.
The real game and both derivation games are instances, related by simulateQ_failGameOf.
That lemma rests on MapMonad.lean: every leanXMSS algorithm commutes with a map of monads.

Example

The statements, with q = gameQueries qH r = 205 * 2^16 + 1 + qH + r (2^33 + 615 * 2^16) + 384:

signingFailure_le_seedGame:  signingFailure A <= Pr[fail, ideal seedGame] + q / 2^256
prEvent_seedGame_ideal_le:   Pr[fail, ideal seedGame] <= Pr[fail, ideal prfGame] + q / 2^256
signingFailure_le_prfGame:   signingFailure A <= Pr[fail, ideal prfGame] + 2 q / 2^256

The last one takes the adversary's budgets: at most qH hash queries and r signing requests, on every path (IsQueryBoundP).
For qH = 2^64 and r = 2^32, q is about 1.5 * 2^65, and the two hops cost below 2^-189.

For reviewers

  • The budget q counts every hash call of the game: key generation, the signer's, the adversary's and the verification.
    QueryBound.lean proves the per-algorithm counts on every path, counting each seed-function call as one: publicKeyOf at most 205 * 2^16, signDerived at most 2^33 + 615 * 2^16 - 3, verifyWith at most 384.
  • The adversary's budget is structural (IsQueryBoundP), not the support-based HasHashQueryBound of the main theorem.
    The structural form is what the hop lemma takes.
  • The first hop's ideal game draws S once from a table of one entry; the second hop uses that table as its secret (prfEncoding).
    The lazy-to-eager step between them is prEvent_idealImpl_eq_bind_fixDerivations.
  • signDerived_map_monad needs a third hypothesis, that the map commutes with <$>: the codeword test maps a digest.
    simulateQ and liftM satisfy it.
  • Step 3 of proofs: leanXMSS unforgeability follow-ups #1385 bounds the ideal prfGame failure; this pull request leaves it as the right-hand side.

Checks

  • lake build --wfail EthLib.Cryptography.Proofs.Xmss EthLib.Cryptography.Proofs.Wots EthLib.Consensus.Proofs.PqKeys.Possession EthLib.Consensus.Proofs.PqKeys.PossessionBinding: passes.
  • lake env leanchecker on Proofs.Wots, Proofs.Xmss.MapMonad, Proofs.Xmss.QueryBound, Proofs.Xmss.Unforgeability.SeedHops and Proofs.Xmss.Unforgeability: passes; peak about 3.4 GB for SeedHops.
  • #print axioms of signingFailure_le_prfGame: propext, Classical.choice, Quot.sound only, pinned by #guard_msgs.
  • scripts/check_lean_layout.py --base upstream/master: no finding.

Part of #1385.

🤖 Generated with Claude Code

The game of the signing-failure event now runs over a source of
derivations. Two hidden-seed hops replace the scheme seed, then every
derivation from it, by derivation queries, each at a cost of at most
q / 2^256 for a game of q hash calls. Structural bounds count the hash
calls of key generation, signing and verification.

Part of ethereum#1385.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant