Repository navigation
refactor(xmss)!: remove the XMSS specification and its proofs - #5461
Merged
Merged
Conversation
The leanVM formalization, which used these modules, now lives in leanEthereum/leanVM, so nothing in EthLib uses leanXMSS any more. Remove the specification, the proofs, the C export, the Python bindings and the pinned vectors of leanXMSS. Remove the four shared proof modules that only the XMSS proofs imported: SufCmaMultiKey, SupportBind, Wots/AcceptedScan and Hash/Keccak/LastBlock. Remove the import rule between XMSS and SPHINCS, which cannot fail with one scheme left. Regenerate the binding contract and SOUNDNESS.md. BREAKING CHANGE: ethlib.cryptography.xmss, XmssError, the native xmss_* functions, the XMSS_* constants and the Lean modules under EthLib/Cryptography/Xmss/ and EthLib/Cryptography/Proofs/Xmss/ are removed, with no replacement in EthLib. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Dec 4, 2026
refactor(sphincs)!: remove leanSPHINCS and the hash-based signature modules it leaves orphaned
#5460
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes leanXMSS from EthLib: its specification, its proofs, its C export, its Python bindings and its test vectors.
The leanVM formalization, which used these modules, now lives in leanEthereum/leanVM.
The problem
EthLib kept leanXMSS for one user, the leanVM formalization.
That work now lives in its own repository, so nothing in EthLib uses these modules any more.
They still cost CI time and review time on every change that touches the shared hash-based-signature code.
The idea
Delete every module whose path names XMSS, and every module that only those modules imported.
Keep each shared module that something outside XMSS still uses.
The import graph decides which modules go.
A module is removed only when every module that imports it is an XMSS module or an aggregator, a file that only gathers imports.
Four shared modules meet that condition, and no other module does.
Example
Proofs/SufCmaMultiKey.leandefines the many-key strong-unforgeability game.On master, two modules import it: the aggregator
Proofs.leanandProofs/Xmss/Unforgeability/MultiKey.lean.Once the XMSS file is gone, only the aggregator imports it, so it goes too.
Proofs/SufCma.leanis the single-key game.The SPHINCS proofs import it as well, so it stays.
What is removed
345 files and 71,462 lines are deleted:
EthLib/Cryptography/Xmss.leanandXmss/: 14 files, 1,611 lines.EthLib/Cryptography/Proofs/Xmss.leanandProofs/Xmss/: 253 files, 66,867 lines.EthLib/Cryptography/Exports/Xmss.lean: 150 lines.bindings/python/xmss.c, the packageethlib.cryptography.xmssandbindings/python/tests/xmss/: 11 files, 1,559 lines.tests/cryptography/xmss/, the pinned vectors: 62 files, 445 lines.Proofs/SufCmaMultiKey.lean,Proofs/SupportBind.lean,Proofs/Wots/AcceptedScan.leanandProofs/Hash/Keccak/LastBlock.lean: 830 lines.The same change also edits these files:
Cryptography.lean,Exports.lean,Proofs.leanandProofs/Hash/Keccak.lean;Base/Exports/Bindings.lean,module.c,wrappers.h,XmssErrorandsetup.py, and the regenerateddocstrings.h,_native.pyiandcontract.json;tests/downstream/Consumer.lean;tests/sources.toml,tests/generators.toml, the labeler, the proof shards and the comment allowlist;tests/cryptography/README.md.ARCHITECTURE.md had a rule that no
Xmssmodule reaches aSphincsmodule through its imports, nor the reverse.With one scheme left, the rule cannot fail, so the rule and its check in
scripts/check_layers.pyare removed.What stays shared
Something outside XMSS still uses each of these, so each one stays:
HashSig.lean,Wots.leanandProofs/HashSig/: the SPHINCS specification and proofs use them.Proofs/SufCma.leanandProofs/SufCma/: the SPHINCS unforgeability proofs use them, directly or throughProofs/HashSig/.Proofs/Wots/,Proofs/QueryAvoidance.lean,Proofs/RandomOracleWithCoins.lean,Proofs/EvalDistEq.lean,Proofs/Merkle/and the Keccak proofs: SPHINCS, BLS, the VRF, SSZ or the consensus proofs use them.Their doc comments named leanXMSS as a user, so they now say "the hash-based signatures".
The code example of CONTRIBUTING.md now shows the leanSPHINCS layer encoding, in place of the XMSS one.
For reviewers
Nothing else uses them, so they are removed rather than kept unused.
git grep -i xmssstill finds a few mentions on purpose:Proofs/SufCma.lean;Aggregation/Interface.lean;LeanVm/README.md;xmss_nodeandxmss_pkFromSigin the SPHINCS files.Sphincs/andProofs/Sphincs/still say that leanXMSS shares the search, the hash style or the oracle.This pull request leaves the SPHINCS paths alone, because a parallel pull request removes SPHINCS.
If SPHINCS stays, those three lines need an edit.
Checks
lake build EthLib Exports EthLib.Cryptography.Proofs gen-bindings check-decls --wfail: passed, 12092 jobs.lake buildof the modules thattests/downstream/Consumer.leanimports, thenlake lean tests/downstream/Consumer.lean: passed.lake exe gen-bindings, thenlake exe gen-bindings --check: passed.check-decls EthLib EthLib.Exports EthLib.Cryptography.Proofs: 83345 declarations, 0 findings, 0 stale.The baseline is unchanged, since no entry named a removed declaration.
lake exe check-accessors: passed, baseline unchanged.lake exe proof-coverage: not run, since it needs every proof built.No removed Lean line names a Consensus or
Forkdeclaration, so no touched rule can change, and the baseline is unchanged.uv sync --frozen --extra test, thenpytest -n 8: 78504 passed, 664 skipped, 13 xfailed.tests/cryptography/check_vectors.py: 2270 pinned vectors match their digests.soundness_facts.py: regenerated;--checkpassed (586 operations and 38 constants, from 590 and 50).check_layers,check_lean_layout --base upstream/masterand--all --rule wrap,check_comment_code,release_manifest --check,check_fixture_pins: passed.check_layers,proof_shardsandcheck_vectors: passed.ruff check,ruff format --check,check_python_comments,check_docstrings,ty checkandty check --python-version 3.10 bindings/python/ethlib: passed.check_writing --base upstream/master: only S1 and D1 suggestions, on sentences and docs that this change did not write.🤖 Generated with Claude Code