While testing external signers in 22.0rc2
, I noticed that I can create many watch only wallets with the external signer option, each with a different name, but they will all be tied to the same external signer. Not sure if this should be a bug, but it is definitely unexpected and leads to misleading information in the GUI/RPC commands. At the very least, perhaps all that’s needed is better documentation on how external signers work with Bitcoin Core to avoid confusion, which I’d be happy to write.
Expected behavior
If createwallet allows me to create 3 different wallets with different names, I expect them to be different wallets:
0./src/bitcoin-cli -datadir=$DATA_DIR -signet listwallets
1[
2 "trezor_1",
3 "trezor_2",
4 "trezor_3"
5]
If a wallet has already been created with the existing external signer, I would expect new wallet creation to fail, even if the wallet name is different, or create a new wallet on the same external signer but be under a different account (derviation path)
**Actual behavior
The three wallets above are all attached to the same external signer and account, even tho they are shown as separate wallets in the cli and the gui.
0./src/bitcoin-cli -datadir=$DATA_DIR -signet -rpcwallet=trezor_1 getwalletinfo
1{
2 "walletname": "trezor_1",
3 "walletversion": 169900,
4 "format": "sqlite",
5 "balance": 0.01799890,
6 "unconfirmed_balance": 0.00000000,
7 "immature_balance": 0.00000000,
8 "txcount": 7,
9 "keypoolsize": 3000,
10 "keypoolsize_hd_internal": 3000,
11 "paytxfee": 0.00000000,
12 "private_keys_enabled": false,
13 "avoid_reuse": true,
14 "scanning": false,
15 "descriptors": true
16}
and
0./src/bitcoin-cli -datadir=$DATA_DIR -signet -rpcwallet=trezor_2 getwalletinfo
1{
2 "walletname": "trezor_2",
3 "walletversion": 169900,
4 "format": "sqlite",
5 "balance": 0.01799890,
6 "unconfirmed_balance": 0.00000000,
7 "immature_balance": 0.00000000,
8 "txcount": 7,
9 "keypoolsize": 3000,
10 "keypoolsize_hd_internal": 3000,
11 "paytxfee": 0.00000000,
12 "private_keys_enabled": false,
13 "avoid_reuse": true,
14 "scanning": false,
15 "descriptors": true
16}
To reproduce
-
Setup HW wallet using an external signer. The steps I followed are here: https://gist.github.com/josibake/9799b348e261e81881fa621d0c9d8dfb#testing-wallet-changes
-
Create two separate wallets with the same external signer
0./src/bitcoin-cli -datadir=$DATA_DIR -signet createwallet "trezor_1" true true "" true true true true
1./src/bitcoin-cli -datadir=$DATA_DIR -signet createwallet "trezor_2" true true "" true true true true
- Send a transaction to one of the wallets
- Verify both wallets have the same transaction listed using
getwalletinfo
- If you have previous transactions on the external signer, you will need to run
rescanblockchain
for each and you can also verify they have exactly the same information
System information
Using https://github.com/bitcoin/bitcoin/releases/tag/v22.0rc2 (self compiled) on:
OS: Pop!_OS 20.10 (Ubuntu 20.10) OS Type: 64 bit GNOME: 3.83.3