Review report

bitcoin-core/gui-qml: PR #1057

1 major finding · 2 minor findings

Earlier concerns neither republished nor resolved: 3 minor findings. See the Run archive for their assessments.

Findings

Link

[major] · “Complete watch-only wallet” export omits inactive descriptors

After first encryption of a funded signing wallet, the export omits the old descriptors, so the copy advertised as complete misses existing funds and payments to previously issued addresses.

Location: qml/models/walletqmlmodel.cpp:1300 (head).

Details and suggested fix

watchOnlyExports() queries only the active receive/change manager for each output type. Setting the first password through Wallet settings reaches CWallet::EncryptWallet(), which generates descriptors from a fresh seed for a non-blank signing wallet and replaces those active mappings. Core retains the old managers, but this exporter never visits them. An export taken afterwards therefore excludes the pre-encryption addresses and their balance and history; reopening the modal does not restore that coverage. The source wallet retains its keys and spending ability. Silently skipping unsupported active descriptors can also leave the aggregate incomplete. Enumerate all retained descriptor managers, as listdescriptors does, export the publicly derivable inactive descriptors too, and disclose any omissions rather than describing a partial result as complete. Add a regression that issues an address before encryption and verifies that the subsequent export still covers it.


Link

[minor] · Extended-key exports do not round-trip through this app's watch-only import

The app rejects its SegWit SLIP-132 exports, while accepting Taproot and Legacy account keys as P2WPKH wallets with different addresses.

Location: qml/models/walletqmlmodel.cpp:637 (head).

Details and suggested fix

Pasting an exported extended key into another instance of this GUI does not preserve the source wallet's script type. validateXpub() accepts only the active chain's standard xpub/tpub prefix, so the exported ypub/zpub/upub/vpub keys fail validation. Taproot and Legacy exports retain their standard prefix and pass, but createWatchOnlyWallet() always creates wpkh(KEY/0/*) and wpkh(KEY/1/*). Those copies do not monitor the source's Taproot or P2PKH addresses. If used to receive payments, they issue addresses outside that source descriptor set. Descriptor export is the default, and the Taproot note recommends it, but neither explains that this app accepts the bare key with a different script type. Explicitly warn that this app's xpub import assumes P2WPKH and cannot faithfully re-import these extended-key exports.


Link

[minor] · Extended-key export drops incompatible receive/change layouts

For imported descriptors with separate account keys or nonstandard branches, the unconditional receive-key export can miss change or derive different receive addresses without warning.

Location: qml/models/walletqmlmodel.cpp:1315 (head).

Details and suggested fix

watchOnlyExports() always exports receive->xpub, even when MakeWatchOnlyDescriptor() needs two descriptors to preserve both chains. The added legacy fixture demonstrates this with receive and change account keys derived under purposes 44 and 45: the receive key cannot reproduce the independent change account. An importer using /0/i and /1/i also derives different receive addresses when the original receive suffix is empty, multistep, or not /0. Extended-key mode discards those suffixes and hides the Chains row without warning. No current GUI wallet-creation path producing these layouts was identified; active descriptors imported through importdescriptors can produce them, and production occurrence remains unconfirmed. Expose an extended-key compatibility flag requiring receive /0 and either no change descriptor or matching script/origin/xpub on change /1, then disable the option for incompatible layouts and assert that behavior in the split-key fixture.


Coverage details

Earlier concerns

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