AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 26 Bitcoin

Merge bitcoin/bitcoin#35493: wallet, descriptor: Fix MuSig private key completeness checks on `importdescriptors`

Public commit record

What the developer wrote

Authored by merge-script

100/100 · Strong
Merge bitcoin/bitcoin#35493: wallet, descriptor: Fix MuSig private key completeness checks on `importdescriptors`

0390338692a7d1dda8062b5b90eb36724da6195d test: check MuSig import private key warnings (woltx)
5e62fbf09c01a644b0b85f80ee101814ad2c330d wallet: check descriptor private key completeness on import (woltx)
cd8d01bf47a289a80e288fa6c38a56557f8f7dcf descriptors: require complete MuSig private keys (woltx)

Pull request description:

`importdescriptors` currently checks whether all private keys are present by expanding the descriptor and verifying that every expanded origin pubkey has a private key.

This is wrong for MuSig descriptors because expansion includes the synthetic aggregate pubkey. There is no individual private key for that aggregate pubkey, so importing a fully private MuSig descriptor such as `rawtr(musig(A_priv,B_priv))` incorrectly returns:

```
Not all private keys provided. Some wallet functionality may return unexpected errors
```

This PR fixes the issue by making descriptor private-key completeness account for MuSig participant keys, and by having `importdescriptors` use `Descriptor::HavePrivateKeys()` instead of duplicating its own manual completeness check.

The functional test covers both cases:

- `rawtr(musig(A_priv,B_priv))` imports without warnings.
- `rawtr(musig(A_priv,B_pub))` still warns that not all private keys were provided.

ACKs for top commit:
achow101:
ACK 0390338692a7d1dda8062b5b90eb36724da6195d
theStack:
Code-review ACK 0390338692a7d1dda8062b5b90eb36724da6195d

Tree-SHA512: a55fb084c63f725a0991556acdfb822f3a5a669f745a00b9f0bf0996b639986cdf5e2be2e8d3d0a2ee3fe5744355f20b40df576601792ef3db698e606629ad52
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a bug in Bitcoin Core's wallet import logic for a new type of multi-signature setup called MuSig. Previously, when a user imported a MuSig descriptor that already contained all needed private keys, the wallet incorrectly warned that some private keys were missing. The fix makes the wallet correctly check the individual participant keys inside a MuSig group rather than looking for a private key for the combined group key, which does not exist. It is a correctness and usability fix, not a remote-exploitable vulnerability.

Recommended action

No urgent action required. This is a bug-fix merge; operators using MuSig descriptors with `importdescriptors` should upgrade to avoid misleading warnings. Reviewers should verify that `HavePrivateKeys()` correctly handles nested MuSig and mixed private/public participant descriptors.

Security signals we found

01

False-positive warning in wallet import for fully-private MuSig descriptors

02

Incorrect private-key completeness check on synthetic aggregate public key

03

Descriptor logic now delegates completeness to `Descriptor::HavePrivateKeys()`

04

MuSig participant keys individually checked for private key availability

05

Functional and unit tests added/updated to cover warning behavior

Risk score

Why this scored 26/100

Our methodology →
Potential impact 5/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 4/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.