feat: verify and sign the length-framed NUT-11 SIG_ALL message - #2232
Open
robwoodgate wants to merge 5 commits into
Open
feat: verify and sign the length-framed NUT-11 SIG_ALL message#2232robwoodgate wants to merge 5 commits into
robwoodgate wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2232 +/- ##
==========================================
+ Coverage 76.99% 77.01% +0.01%
==========================================
Files 379 379
Lines 96708 96823 +115
==========================================
+ Hits 74460 74566 +106
- Misses 22248 22257 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
asmogo
previously approved these changes
Jul 21, 2026
Collaborator
|
@cdk-bot review |
Collaborator
Seem like the bot took a nap last night. Should be back up and reviewing now |
Contributor
Author
|
Removed the legacy signing format this PR had re-added. |
The mint accepts the v1 ("Cashu_SigAllSig_v1") and current message
formats, counting unique public keys with valid signatures and
ignoring signatures that do not verify. Wallet signing helpers sign
v1, current and legacy so requests verify on mints at any upgrade
stage. Witness length gets its own cap to fit one signature per
format per signer. Canonical vectors from the NUT-11 spec tests are
pinned in the test suite.
Wallets sign v1 and current; the pre-0.14 message (secrets then B_ values) is no longer produced, as it does not commit to C values or output amounts (cashubtc/nuts#404). Mint verification is unchanged.
robwoodgate
force-pushed
the
feat/sigall-v1
branch
from
August 18, 2026 21:03
cd2f953 to
c64c544
Compare
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.
Description
Implements the length-framed NUT-11 SIG_ALL message aggregation (
Cashu_SigAllSig_v1) proposed in cashubtc/nuts#404. The new format matches the domain separation and length framing already used for NUT-20/29 mint quote signatures, and reuses their helpers.Notes to the reviewers
sig_all_msgs_to_verify), and wallet signing produces both, so requests verify on mints on either side of the upgrade. The pre-0.14 format is neither signed nor accepted: it does not commit to C values or output amounts, andtest_sig_all_should_reject_if_the_output_amounts_are_swappedcovers this.valid_signatures_any_msgcounts each pubkey at most once across formats, so a multi-format witness cannot tripDuplicateSignature.MAX_PROOF_WITNESS_LEN, 8192 bytes) so multisig witnesses carrying one signature per format per signer still fit.tests/11-test.mdare pinned in the nut11 test module.cargo test -p cashu --features mint,wallet,nostr,cargo test -p cdk --lib,cargo clippy -p cashu --all-targets,cargo fmt --check.Suggested CHANGELOG Updates
CHANGED
ADDED
sign_sig_allsigns all accepted message formatsChecklist
just quick-checkbefore committing (ran the equivalent commands listed above on stable in a container)crates/cdk-ffi) — not modified