Description
The message RPCs currently support legacy compact signatures for P2PKH addresses. This adds BIP322 simple proofs for native P2WPKH, P2WSH and P2TR addresses, allowing users to sign and verify messages for these addresses without creating an on-chain transaction.
signmessage uses the wallet’s existing descriptor signing machinery and requires a complete satisfaction. This includes P2WSH multisig and supported Miniscript satisfactions, and Taproot key and script paths. It returns smp followed by the base64-encoded serialized witness stack.
verifymessage uses Core’s script interpreter to check the proof against the address and message. Verification requires no wallet or chain data and accepts both prefixed and older unprefixed simple proofs. Malformed base64 or witness serialization raises an RPC error; invalid proofs, unsupported signature formats and inconclusive results return false.
The RPC names and argument counts are unchanged. P2PKH compact signatures and signmessagewithprivkey retain their existing behavior. Full signatures, proofs of funds and P2SH addresses, including wrapped SegWit, are outside this change. Signing remains limited to satisfactions available to the wallet.
No consensus rules or signing-provider interfaces are changed. Help and release notes describe the supported formats and limitations.
Related earlier work: #24058.
Tests
A shared fixture imports the applicable CC0 vectors from the pinned BIP: eight simple rows containing ten proofs, three hash cases and sixteen error cases. Published proofs are checked independently of locally generated signatures.
Coverage includes:
- bip322_tests and bip322_wallet_tests: transaction construction, parsing bounds, address binding, sighash and script rules, descriptor signing, incomplete satisfactions and wallet locking.
- rpc_bip322.py: published proofs in both encodings, invalid proofs and network-specific address parsing.
- Both existing message tests: legacy behavior, RPC errors and native witness signing.
- rpc_help.py: updated help.