Review report

bitcoin/bitcoin: PR #35918

1 suggestion

Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · HavePrivateKeys() documentation omits MuSig's all-participant requirement

A future caller using HavePrivateKeys(out) to reject private input would accept musig(xprvA,xpubB) when B's private key is unavailable, despite parsing A's private key into out.

Location: src/script/descriptor.h:142 (head).

Details and suggested fix

The newly public comment says only whether private data is available, but MuSigPubkeyProvider::HavePrivateKeys() requires every participant's private key. For distinct participants in musig(xprvA,xpubB), parsing into a fresh provider records A's key in out.keys while the returned provider reports HavePrivateKeys(out) == false. In contrast, ToPrivateString() succeeds when any participant has private data. Clarify the all-participant requirement here and document that callers rejecting any supplied private material should parse into a fresh FlatSigningProvider and check !out.keys.empty(). Keep the current predicate semantics, which existing descriptor-level MISSING_PRIVKEYS tests already depend on, and add a mixed-private/public case to parse_pubkey_musig to demonstrate the distinction through the standalone API. No production caller of the new overload was found, so the policy consequence is conditional rather than an observed bypass.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.