Skip to content

feat(xmss): add delayed layer signing callbacks - #785

Closed
alexanderlhicks wants to merge 2 commits into
codex/xmss-ots-callbacksfrom
codex/xmss-layer-callbacks
Closed

alexanderlhicks wants to merge 2 commits into
codex/xmss-ots-callbacksfrom
codex/xmss-layer-callbacks

Conversation

@alexanderlhicks

Copy link
Copy Markdown
Contributor

The layer signer gains delayed callbacks for its one-time signature and authentication path.
The default callbacks give exactly the existing signer for any monad.

Stacked on #777.

The problem

Reduction proofs need to interpret the one-time signer while retaining the actual path algorithm and failure order.
A failed one-time signature must return before the path computation starts.

The idea

signLayerWithCallbacks assembles the signature from two functions that take Unit.
The default identity is proved by rfl, without assuming monad laws.
Success packs the exact randomizer, chain values and path returned by the callbacks.

Example

At bottom-layer key 7, let the one-time callback record ots and return none.
The result is noAdmissibleEncoding bottom 7, and the path callback never runs.
On success the path follows the one-time callback:

ots -> path -> layer signature

An outer exception from the path keeps both recorded effects.
The proved trace law distinguishes this exception from the normal signing-error value.
It quantifies over every initial trace and both callback replies.

For reviewers

The original natural-number key remains in the error.
The default one-time callback still uses UInt32.ofNat e, and the path still receives the original e.
Existing signLayer and its generated equation remain unchanged.
The whole signer retains its full bottom-tree computation.
The VCVio pin, package version, exports and bindings are unchanged.
This interface is a prerequisite for reduction proofs and adds no security bound.

Checks

Validation uses parent df37081c over master 59d8233e, with VCVio pinned to bbf05eee.

  • Full lake build --wfail: passed, 6,015 jobs.
  • Whole lake exe check-decls: passed, 53,250 declarations and zero findings or baseline entries.
  • Scoped declaration and axiom audits: no findings or nonstandard axioms.
  • Initialization audit: 36 constants and zero initialization work or hazards.
  • All 16 linters on 8 runtime and 11 proof declarations, style, layout, layer rules, soundness and release-manifest checks: passed.
  • Independent named regressions and controls for a non-lawful monad, large error keys, state-dependent paths and both outer exceptions: passed.

The soundness and release-manifest Python unit tests also passed.
The binding and vector suites were skipped because their sources and interfaces are unchanged.

Prepared by OpenAI Codex, an AI coding agent.

alexanderlhicks and others added 2 commits November 6, 2026 10:38
Expose one-time signing and its dependent path as delayed callbacks. The actual defaults give signLayer by rfl for any monad. Failed search preserves the natural-number key in its error and skips the path. Generic branch and joint trace properties distinguish normal signing errors from outer monad errors. Existing signer bodies and generated equations remain unchanged.
The callback form of the layer signer moves from the specification file
to the proof file that uses it. The specification of leanXMSS stays as it
is on master, and the callback form is a view of the layer signer for
proofs only.

The doc comments now cite no implementation and no history.

The definition's type and every theorem statement are unchanged; only
the implicit monad is now bound on the definition itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tcoratger
tcoratger force-pushed the codex/xmss-ots-callbacks branch from df37081 to 7bb68b0 Compare November 6, 2026 09:43
@tcoratger
tcoratger force-pushed the codex/xmss-layer-callbacks branch from 711d847 to bc5fde2 Compare November 6, 2026 09:43
@github-actions github-actions Bot added type: feat New behaviour, such as a new function, module or export crypto Cryptography: EthLib/Cryptography crypto: xmss XMSS hash-based signatures proofs Theorems under a Proofs directory labels Nov 19, 2026
@tcoratger

Copy link
Copy Markdown
Collaborator

XMSS was removed from EthLib in #5461; the formalization of leanVM, including its hash-based signatures, now lives in https://github.com/leanEthereum/leanVM. Closing this pull request here.

@tcoratger tcoratger closed this Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crypto: xmss XMSS hash-based signatures crypto Cryptography: EthLib/Cryptography proofs Theorems under a Proofs directory type: feat New behaviour, such as a new function, module or export

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants