#36154 wallet: fill PSBT_GLOBAL_XPUB for descriptors with more than one key

full analysis

https://github.com/bitcoin/bitcoin/pull/36154 · jeanpablojp · +336/-36 in 13 files, 2 commits · labels: Wallet, Needs rebase

Goal

  • Populate BIP 174 global xpubs in wallet PSBTs for descriptors with multiple keys
  • Allow stateless hardware signers to recognize multisig setups and sign directly

This pull request populates the BIP 174 PSBT_GLOBAL_XPUB field when creating or filling PSBTs from wallet descriptors with multiple keys. It adds a method to Descriptor to extract extended public keys at the deepest hardened path step with their key origins. This enables stateless external signers to recognize multisig configurations and sign without external coordinator intervention.

Problem: Bitcoin Core's wallet does not write PSBT_GLOBAL_XPUB fields into PSBTs even though BIP 174 defines them and the parser supports them. Certain hardware signers, such as the BitBox02 via HWI, require these global xpubs to reconstruct the multisig setup and refuse to sign when they are missing.

Category: Wallet (#29 of 84)

P2 · user request

  • P2 because it fixes an issue where hardware signers refuse to sign multisig PSBTs
  • Stateless devices like BitBox02 require global xpubs and otherwise need manual workarounds

P2 because it resolves a long-standing user friction point in hardware multisig setups (#27583). Devices like the BitBox02 fail to sign PSBTs generated by Bitcoin Core without manual coordinator workarounds to populate the BIP 174 global xpub metadata.

Membership: Changes descriptor methods and DescriptorScriptPubKeyMan::FillPSBT to write PSBT_GLOBAL_XPUB entries into wallet PSBTs.

Factors: security/stability 0, bug 1, performance 0, user value 2, leverage 1

Reviewability: Paused: Waiting on author

  • Needs rebase
  • Author has not responded to major architectural objections

Material architectural objections from achow101 regarding descriptor design and scope have been open for more than 7 days without author response, alongside a merge conflict requiring rebase.

Author status: silent since 2026-09-03

Open concerns:

  • achow101 questioned why global xpubs are restricted only to multisig descriptors rather than treated generically across descriptor types.
  • achow101 objected to passing SigningProvider into GetExtPubKeysWithOrigins and taking an out-parameter instead of returning the map directly.
  • achow101 noted that the MuSig implementation should traverse participants to collect their xpubs rather than returning empty.

Resolved concerns:

  • Sjors requested clarification and links to downstream workarounds (Specter Desktop) and simulator behavior across devices, which the author added to the PR description.

Agreement: Blocked

  • Unaddressed objection: global xpubs should not be restricted to multisig (achow101)
  • Unaddressed objection: API should return maps directly and support MuSig (achow101)
  • Noted utility for non-HWI flows and clarified device requirements (Sjors)

Blocked: achow101 raised substantial architectural and implementation objections that the author has not addressed.

achow101 raised multiple blocking interface and behavioral criticisms on 2026-09-07, and the author has not responded.

  • Sjors noted the utility for non-HWI flows and asked for documentation on hardware device requirements.
  • achow101 criticized limiting the feature to multisig, the use of SigningProvider and out-parameters in descriptor APIs, and the omission of MuSig participants.

Review verdicts (DrahtBot): 0

Dependencies

Enables:

Files

162 lines under test/bench/ci.

  • src/script/descriptor.cpp +96/-33
  • src/test/descriptor_tests.cpp +98/-0
  • test/functional/wallet_multisig_descriptor_psbt.py +55/-0
  • src/wallet/scriptpubkeyman.cpp +37/-0
  • src/script/descriptor.h +14/-0
  • doc/release-notes-36154.md +9/-0
  • src/key_io.cpp +7/-0
  • src/key_io.h +6/-0
  • src/test/fuzz/descriptor_parse.cpp +6/-0
  • src/wallet/rpc/spend.cpp +2/-2
  • src/wallet/scriptpubkeyman.h +4/-0
  • src/wallet/test/psbt_wallet_tests.cpp +1/-1
  • src/wallet/test/walletload_tests.cpp +1/-0

Card

This PR fills BIP 174 PSBT_GLOBAL_XPUB entries when the wallet creates or processes PSBTs involving descriptors with multiple extended public keys. It solves a compatibility issue where hardware signers such as the BitBox02 refuse to sign PSBTs lacking global xpubs, removing the need for external coordinators like Specter to monkey-patch the transaction. While Sjors expressed concept interest, achow101 raised substantial architectural concerns regarding the descriptor API design, unnecessary restrictions to multisig, and MuSig handling. The PR currently needs a rebase and is paused waiting on the author to respond to those review comments.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T15:58, confidence high, input hash c454aff394cbb90c