WIP: rpc, wallet: Support BIP322 simple message signing

bitcoin/bitcoin: PR #36809

3 suggestions

Optional improvements

Link

[suggestion] · The GUI's version-wide SegWit message warning is now inaccurate

The GUI still rejects native-witness proofs and reports version-wide lack of support, although this PR adds RPC support; GUI acceptance itself is unchanged.

Location: src/rpc/signmessage.cpp:49 (head).

Details and suggested fix

The sign tab rejects every non-PKHash destination. The verify tab calls MessageVerify, which rejects those destinations before parsing the signature. Consequently, a valid smp proof from this node's signmessage RPC reaches the existing “not supported in this version” message. Change both status strings to explain that native P2WPKH, P2WSH and P2TR message signing and verification are available through RPC only. Full GUI support can remain a follow-up.


Link

[suggestion] · Fully keyed timelock and MuSig2 failures report missing keys

Fully keyed, unlocked wallets receive “Private key not available” for mandatory incompatible timelocks or MuSig2-only paths, but the help explains only the timelock restriction.

Location: src/wallet/wallet.cpp:2093 (head).

Details and suggested fix

SignBIP322Message maps an incomplete SignTransaction result to PRIVATE_KEY_NOT_AVAILABLE. The fixtures assert this for mandatory after(1)/older(1) policies with imported keys and for tr(musig(...)) with both participant secrets local. Simple proofs use fixed zero transaction fields, while the existing MuSig2 signer tries aggregation and partial signing before generating nonces, so the one-shot call cannot complete its rounds. Add a help and release-note sentence explaining that signmessage cannot complete MuSig2 signing sessions even when all participant keys are local; an independently satisfiable script leaf may still sign. This explains why importing more keys cannot resolve that missing-key error without weakening complete-proof enforcement.


Link

[suggestion] · Script-derived fuzz proofs have no result oracle

Matching-commitment fuzz inputs reach verification without an assertion on the result, so silent classification errors in this block remain undetected.

Location: src/test/fuzz/message.cpp:105 (head).

Details and suggested fix

The prefix-equivalence assertions above cover a separate invocation. Here, after a successful CreateTapTweak, every generated Taproot leaf version other than 0xc0 or 0x50 has a matching script-path commitment and must return INCONCLUSIVE: unknown leaves bypass script execution, and the size bounds stay below the weight limit. Retain the returned value and assert that class for those cases; flipping the control-block parity bit should then return INVALID. Exclude 0x50 because the control block can be interpreted as an annex. The fixed 0xc2 unit test covers one case, while this would check varied leaves, stacks and messages without changing the generator's input encoding.


Coverage details