4 suggestions
Earlier concerns neither republished nor resolved: 1 minor finding · 2 suggestions. See the Run archive for their assessments.
Optional improvements
[suggestion] · Valid BIP322 proofs repeat uncached signature verification
Every OK proof completes both interpreter passes, duplicating signature checks even for consensus-sized tapscript witnesses; trying the upgrade-inclusive flags first avoids the second pass for valid proofs.
Location: src/common/signmessage.cpp:258 (head).
Details and suggested fix
BIP322Verify first executes REQUIRED and then REQUIRED|UPGRADE with a TransactionSignatureChecker that does not cache signature verification. Wallet proof self-checks use the same path. Near the 4,000,000-weight limit, a committed tapscript can reuse a signature for tens of thousands of Schnorr checks per pass, so this duplicates substantial cryptographic work. Run the upgrade-inclusive pass first and fall back to REQUIRED only on failure. Preserve required-failure and CODESEPARATOR precedence with separate errors, retain the upgrade error when appropriate, and still classify annexes and unknown witness versions as INCONCLUSIVE. The upgrade flags only add rejection points, so valid proofs then need one interpreter pass; invalid or inconclusive proofs may still need two. This establishes an operation-count saving, not measured elapsed time. The RPC requires authentication, and any availability impact depends on deployments forwarding untrusted large proofs.
[suggestion] · Timelock-only signing failures look like missing keys
An unlocked, fully keyed wallet gets “Private key not available” when its only signing path requires a positive absolute or enforced relative timelock, but the help and release notes omit the fixed-field restriction.
Location: src/wallet/wallet.cpp:2093 (head).
Details and suggested fix
For a descriptor such as wsh(and_v(v:pk(K),after(1))), signmessage fails even when the unlocked wallet holds K. CreateBIP322Transactions fixes version, nLockTime and nSequence at zero. The satisfier therefore rejects after(1) against nLockTime zero and enforced older() checks because version is below two. SignBIP322Message maps the incomplete satisfaction to PRIVATE_KEY_NOT_AVAILABLE, which the RPC reports as “Private key not available”. Importing more keys, unlocking again, or waiting for blocks cannot resolve this case. Rejection is correct, but add an explicit sentence to the signmessage help and release notes explaining the fixed-field limitation. Keep the restriction branch-specific: another satisfiable branch or an available Taproot key path may still permit signing.
[suggestion] · Explicit SIGHASH_ALL adds a byte to each Taproot signature
Requesting SIGHASH_DEFAULT would preserve witness-v0 SIGHASH_ALL signatures while shortening produced Taproot signatures from 65 to 64 bytes.
Location: src/wallet/wallet.cpp:2092 (head).
Details and suggested fix
SignBIP322Message explicitly requests SIGHASH_ALL, although CreateSig already maps SIGHASH_DEFAULT to SIGHASH_ALL for witness v0. CreateSchnorrSig appends a hash-type byte only for a nonzero request, so using DEFAULT here would shorten both Taproot key-path and script-path signatures without changing the required P2WPKH or P2WSH encoding. This also follows ordinary wallet signing and the 64-byte encoding in both published P2TR vectors. Update the comment and the official_vectors and taproot_paths assertions that require 65 bytes ending in SIGHASH_ALL. Current proofs conform, and no third-party verifier rejecting them was identified; the benefit is one byte per Schnorr signature and consistency, not a demonstrated compatibility fix.
[suggestion] · The transaction-weight rejection has no boundary test
The oversized-proof case fails at the decoded-byte limit, so removing the later transaction-weight guard would leave the current BIP322 assertions passing.
Location: src/test/bip322_tests.cpp:321 (head).
Details and suggested fix
The huge-proof case decodes to MAX_BLOCK_WEIGHT+1 bytes and returns MALFORMED_WITNESS before constructing to_sign. The other size cases do not exercise rejection by GetTransactionWeight. Add a boundary pair using MakeTapProof with leaf version 0xc2 and depth zero, so the interpreter checks the commitment without executing the large script. A 3,999,714-byte script produces a 3,999,754-byte serialized witness. With the 61-byte stripped transaction and witness marker/flag, its weight is exactly 4,000,000, so expect INCONCLUSIVE. Add one script byte and rebuild the commitment; expect INVALID while the decoded witness remains below MAX_BLOCK_WEIGHT. Without the weight guard, that second case would instead return INCONCLUSIVE. This protects the helper's classification boundary; both results still map to false in verifymessage.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [minor]: One-shot BIP322 signing retains unusable MuSig2 secret nonces (earlier report)
- [suggestion]: The GUI still describes RPC-supported SegWit signing as unavailable (earlier report)
- [suggestion]: Independent commitments restrict BIP322 script fuzzing (earlier report)