Repository navigation
Conversation
Add wallet-independent BIP322 simple proof verification for native P2WPKH, P2WSH and P2TR challenges. Construct the tagged message hash and virtual transactions, and verify witnesses with Core's script interpreter under the BIP's required and upgradeable rules. Use a local signature checker for the permitted sighash types. Distinguish invalid proofs from inconclusive upgrade mechanisms, and accept current smp signatures and pre-final unprefixed proofs, including witnesses whose Base64 text starts with a variant name. Existing legacy message routines retain their behavior. Include pinned BIP322 2.1.0 test vectors with CC0 provenance, regressions for encoding, commitments and script rules, and structured message fuzz inputs. The verification helpers provide the basis for wallet and RPC integration.
Sign native P2WPKH, P2WSH and P2TR message challenges with the wallet's descriptor data. Supply the zero-valued virtual output to the existing transaction signer and request SIGHASH_ALL for each supported type. Require a complete witness and successful BIP322 verification before returning an smp proof. Preserve the caller's output on failure, including when keys or script data are unavailable or the wallet is locked. Cover the published vector inputs, multisig thresholds, compound Miniscript and Taproot key and script paths. Add failure tests for partial signatures, encryption, unsupported destinations and timelocked policies.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. LLM Linter (✨ experimental)Possible places where named args for integral literals may be used (e.g.
2026-11-09 16:07:24 |
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
Route native P2WPKH, P2WSH and P2TR message signing and verification through the BIP322 simple proof helpers. Keep legacy P2PKH behavior. Add published-vector RPC tests, descriptor-wallet coverage and help describing the supported formats and signing limits.
a6ede81 to
ed9a469
Compare
Transaction-only signing exports scripts and witnesses but discards the public nonce data needed to resume a MuSig2 signing session. Give the merged provider call-local secret nonce storage so incomplete key-path attempts and successful script fallback release unused nonces when the call returns. The existing MuSig2SecNonce wrapper preserves secure allocation and cleanup. Keep persistent provider storage for ongoing PSBT sessions. Add repeated BIP322 and raw transaction signing regressions, and verify that split-wallet and all-local PSBT sessions survive intervening one-shot signing calls.
Try required and upgrade rules together so valid BIP322 proofs need only one signature verification pass. On failure, retry the required rules and preserve required-error precedence and the original upgrade error. Keep commitment validation before the CODESEPARATOR scan and preserve annex and unknown-version classification. Pin Result/ScriptError precedence and the exact transaction-weight limit with regression tests. Validated with BIP322 unit and published-vector tests, full wallet-enabled CTest, and the three message-signing functional tests. An isolated checker-count probe confirms one delegated check for each valid single-signature proof form.
Request SIGHASH_DEFAULT for wallet message proofs to omit the extra Taproot sighash byte. Keep witness-v0 signatures on SIGHASH_ALL and check that their deterministic proof bytes match explicit ALL signing. Explain the fixed simple-proof transaction fields and incompatible timelock requirements in RPC help and release notes, while allowing other satisfiable script branches or Taproot key paths.
Generate bounded script-derived P2WSH proofs and depth-zero Taproot proofs with matching output keys and control blocks. Preserve the existing program/proof parser and legacy message checks so existing corpus inputs retain their behavior. Verify execution and classification using deterministic seeds, source coverage, sanitizer fuzzing and the branch-wide test gates.
8330aad to
4874938
Compare
|
🐙 This pull request conflicts with the target branch and needs rebase. |

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: