Skip to content

Conversation

@Sjors
Copy link
Owner

@Sjors Sjors commented Jun 25, 2025

Combines the following:

Best combined with bitcoin-core/HWI#794.

Update note to self:

git merge sjors/2025/06/gethdkey
git merge sjors/2025/07/smart-createwalletdescriptor
git merge sjors/2025/07/no_script_path
git merge sjors/2025/07/external-signer-relax
git merge sjors/2025/07/bip388-register

(update master on the fork repo if needed)

Tests to run as a quick sanity check:

build/bin/test_bitcoin --run_test=descriptor_tests,script_tests,transaction_tests,txvalidationcache_tests,wallet_tests,walletload_tests,psbt_wallet_tests,wallet_rpc_tests

python3 build/test/functional/test_runner.py wallet_hd.py wallet_derivehdkey.py wallet_createwalletdescriptor.py wallet_importdescriptors.py wallet_multisig_descriptor_psbt.py wallet_signer.py wallet_taproot.py

@Sjors
Copy link
Owner Author

Sjors commented Aug 1, 2025

Fresh rebase after bitcoin#31244 landed.

@Sjors
Copy link
Owner Author

Sjors commented Aug 5, 2025

Added bitcoin#33135 and the latest change to bitcoin#33008 (storing one hmac record per policy and fingerprint combination).

@Sjors
Copy link
Owner Author

Sjors commented Aug 6, 2025

The registerpolicy will now derive the BIP388 policy and perform registration (for some basic descriptor forms). Spending still requires manually passing the PSBT(s) to HWI with bitcoin-core/HWI#794. You should no longer need MooSig, except to display an address.

The fixup commits reflect changes made to the original branches. I'll up the commit history occasionally when one of its dependencies lands.

- use bitcoin rpc instead of bitcoin-cli
- use named "external_signer" argument
- mention GUI setting
There's no need to treat external signer wallets different in this
regard. When the user sets the 'blank' flag, don't generate or
import keys.

For multisig setups that involve an external signer, it may be useful
to start from a blank wallet and manually import descriptors.
External signer enabled wallets should always use the process PSBT flow.
Avoid going through CreateTransaction.

This has no effect until the next commit when WALLET_FLAG_EXTERNAL_SIGNER
no longer implies WALLET_FLAG_DISABLE_PRIVATE_KEYS. Without this change
signing with the GUI would break for external signers with private keys
enabled.
Before this change the external_signer flag required the wallet to be watch-only.
This precludes multisig setups in which we hold a hot key.

Remove this as a requirement, but disable private keys by default. This leaves
the typical (and only documented) use case of a single external signer unaffected.
With the removal of legacy wallets and the relaxing of restrictions
in the previous commit, it's no longer a problem to toggle this flag.
@Sjors
Copy link
Owner Author

Sjors commented Oct 31, 2025

bitcoin#29675 landed! Waiting for bitcoin#29136 to get a rebase so I can update the stack here.

Sjors pushed a commit that referenced this pull request Dec 29, 2025
achow101 and others added 10 commits January 2, 2026 16:51
unused() descriptors do not have scriptPubKeys. Instead, the wallet uses
them to store keys without having any scripts to watch for.
A helper method to obtain all unused(key) descriptor SPKMs.
When a wallet contains only an unused(KEY) descriptor, use it. Previously the user would have to call listdescriptors and manually specify it.
Sjors added 4 commits January 5, 2026 10:31
Use derivehdkey instead of extracting each participant xpub (and
derivation info) from  the listdescriptors output.

Additionally use the new <0;1> descriptor syntax.

Finally this commits adds a few debug log lines, and expand the
explanation for why we use m/44h/1h/0h.
Use derivehdkey instead of extracting each participant xpub
from  the listdescriptors output.

Additionally use the new <0;1> descriptor syntax.

Also use bitcoin rpc instead of bitcoin-cli.
@Sjors Sjors force-pushed the 2025/06/musig2-power branch from c1959d3 to a42a034 Compare January 5, 2026 05:02
@Sjors
Copy link
Owner Author

Sjors commented Jan 5, 2026

Rebased! bitcoin#32821 and bitcoin#33135 also landed. Down from 67 commits to 44. I haven't had a chance to manually retest the whole flow though.

@Sjors Sjors force-pushed the 2025/06/musig2-power branch from a42a034 to 25e66d9 Compare January 22, 2026 11:46
@Sjors
Copy link
Owner Author

Sjors commented Jan 22, 2026

Rebased after bitcoin#32471 landed. Down to 37 commits.

Sjors added 12 commits January 22, 2026 15:48
Replace the sign, finalize , bip32derivs and sighash_type arguments which
are passed to FillPSBT() and SignPSBTInput() with a PSBTFillOptions struct.

This makes it easier to add additional options later without large code
churn, such as avoid_script_path proposed in bitcoin#32857. It also makes the
use of default boolean options safer compared to positional arguments
that can easily get mixed up.
Expand taproot tests to cover avoid_script_path in  walletprocesspsbt.

When avoiding script paths, there's no need for the workaround that increases fee_rate to compensate for the wallet's inability to estimate fees for script path spends. We use this to indirectly test that key path was used.

We also check that taproot_script_path_sigs is not set.

Finally, for transactions that can't be signed using their key path, we try again by allowing the script path.

Additional test extended private keys were extracted from other tests.
@Sjors Sjors force-pushed the 2025/06/musig2-power branch from 25e66d9 to b7bb56e Compare January 22, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants