Export a watch wallet only (with descriptors and without private keys) for an air gap setup #24829

issue Tracachang openend this issue on April 11, 2022
  1. Tracachang commented at 8:05 pm on April 11, 2022: none

    Is your feature request related to a problem? Please describe.

    For long time I’ve seen users looking for a way to do an air gap setup with Bitcoin Core, since there were no easy way people tend to go with other solutions such as armory, electrum which offers an easy and friendly way to do it.

    Since Bitcoin Core v 22.0 and with the command listdescriptors it can be done easily:

    OFFLINE PC - Create a wallet with descriptors=true, export descriptors with “listdescriptors”. ONLINE PC - Create a wallet without privatekeys, descriptors=true, and importdescriptors to have a functional watch only wallet for receiving funds and create unsigned transactions.

    Describe the solution you’d like

    Instead of creating two wallets, one offline and a watch only and manually have to export/import descriptors, the wallet containing the private keys could offer an option like “exportwatchonly” that would generate a “watch_wallet.dat” without private keys and all descriptors already imported. Making very easy and user friendly the process to create an air gap setup.

  2. Tracachang added the label Feature on Apr 11, 2022
  3. pinheadmz commented at 3:32 pm on March 20, 2023: member
    I don’t understand how an “exportwatchonly” command is any more efficient or straight forward than listdescriptors -> importdescriptors ?
  4. Tracachang commented at 9:30 am on March 24, 2023: none

    I don’t understand how an “exportwatchonly” command is any more efficient or straight forward than listdescriptors -> importdescriptors

    I did not mean it would be more efficient but much more user friendly (as already exists in electrum for example) to have an option that creates a “watch_wallet.DAT” that they can just load instead of manually listdescriptors and import:

    importdescriptors "[{\"desc\": \"wpkh([66bb13d5/84'/0'/0']xpub6CtDSW4S3XVd5uYp9CgsLTZKQcKieJSmjehcvfVJBSy1rPbkKNU3T6UmZ3mn7DoSsTsM6uH8ZKem7LQh3PHyrBAtZopSvF2tonEE7foTWFe/1/*)#a9twa6j5\", \"range\": [0, 1000], \"timestamp\": 1647182091, \"internal\": true, \"watchonly\": true, \"active\": true}]"

  5. pinheadmz commented at 6:38 pm on March 28, 2023: member

    I was able to do what you want to do with a few bash commands (see below).

    I suppose we could add arguments -file <path/to/file> to both listdescriptors and importdescriptors that would make this even easier…?

     0$ bccli -regtest createwallet original
     1{
     2  "name": "original",
     3  "warning": ""
     4}
     5
     6$ bccli -regtest listdescriptors | jq .descriptors -c >> ~/Desktop/watchonly.json
     7$ bccli -regtest -named createwallet wallet_name=watchonly disable_private_keys=true
     8{
     9  "name": "watchonly",
    10  "warning": ""
    11}
    12
    13$ bccli -regtest -rpcwallet=watchonly importdescriptors $(cat ~/Desktop/watchonly.json)
    14[
    15  {
    16    "success": true
    17  },
    18  {
    19    "success": true
    20  },
    21  {
    22    "success": true
    23  },
    24  {
    25    "success": true
    26  },
    27  {
    28    "success": true
    29  },
    30  {
    31    "success": true
    32  },
    33  {
    34    "success": true
    35  },
    36  {
    37    "success": true
    38  }
    39]
    
  6. Tracachang commented at 10:06 pm on March 28, 2023: none

    I was able to do what you want to do with a few bash commands (see below).

    I suppose we could add arguments -file <path/to/file> to both listdescriptors and importdescriptors that would make this even easier…?

    Yes please, that would be great.

  7. Tracachang commented at 5:09 pm on March 29, 2023: none

    @pinheadmz

    I have followed all the steps using the bash commands from your previous answer and using the watch_wallet from the GUI, I am unable to create a receiving taproot address ( it shows both base58 legacy & p2sh-segwit and bech32 but not bech32m). If I select the “original_wallet” it appears in the GUI all 4 types of address including bech32m.

    In any case, from console I can getnewaddress "test" "bech32m" and it works for watch_wallet but for some reason not on GUI.

  8. pinheadmz commented at 2:32 pm on March 31, 2023: member

    Hm, seems to work for me on master branch. The taproot addresses are identical from each wallet.

    Screen Shot 2023-03-31 at 10 29 57 AM Screen Shot 2023-03-31 at 10 29 42 AM

  9. Tracachang commented at 7:51 pm on April 7, 2023: none

    Hm, seems to work for me on master branch. The taproot addresses are identical from each wallet.

    Did not try the master branch, I am on v.24.0.1

  10. pinheadmz commented at 7:00 pm on April 12, 2023: member
    Ok I just pulled v24.0.1 and repeated steps with CLI and GUI, same outcome – are you still unable to do this?
  11. Tracachang commented at 7:22 pm on April 12, 2023: none

    Ok I just pulled v24.0.1 and repeated steps with CLI and GUI, same outcome – are you still unable to do this?

    Just tried again following this commands and I am still unable to see taproot in GUI

     0$ bitcoin-cli createwallet original
     1{
     2  "name": "original",
     3  "warning": ""
     4}
     5
     6$ bitcoin-cli -rpcwallet=original listdescriptors | jq .descriptors -c >> ~/Desktop/watchonly.json
     7$ bitcoin-cli -named createwallet wallet_name=watchonly disable_private_keys=true
     8{
     9  "name": "watchonly_original",
    10  "warning": ""
    11}
    12
    13$ bitcoin-cli -rpcwallet=watchonly importdescriptors $(cat ~/Desktop/watchonly.json)
    14[
    15  {
    16    "success": true
    17  },
    18  {
    19    "success": true
    20  },
    21  {
    22    "success": true
    23  },
    24  {
    25    "success": true
    26  },
    27  {
    28    "success": true
    29  },
    30  {
    31    "success": true
    32  },
    33  {
    34    "success": true
    35  },
    36  {
    37    "success": true
    38  }
    39]
    
  12. pinheadmz commented at 7:34 pm on April 12, 2023: member

    Just tried again following this commands and I am still unable to see taproot in GUI

    at all? or just in the watch-only wallet?

  13. Tracachang commented at 1:27 pm on April 22, 2023: none

    Just tried again following this commands and I am still unable to see taproot in GUI

    at all? or just in the watch-only wallet?

    Just on GUI with the watch-only wallet, but on console using watch-only I can create taproot receiving addresses.

  14. pinheadmz assigned achow101 on Apr 27, 2023
  15. achow101 unassigned achow101 on Apr 30, 2023
  16. pinheadmz commented at 5:54 pm on May 1, 2023: member

    @Tracachang We’re going to close this issue as “won’t fix” for now. I’m going to follow up in #9492 where I see you’ve already chimed in. I think a simple doc outlining the list/import descriptor commands I commented above and using PSBT for signing would be the most valuable.

    As far as the missing taproot addresses in the GUI you’ve reported - that could be opened as a new issue if you can provide steps to reproduce it with the latest release of Bitcoin Core or master branch (I was unable to reproduce personally)

  17. pinheadmz closed this on May 1, 2023

  18. bitcoin deleted a comment on May 2, 2023
  19. bitcoin locked this on May 1, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-22 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me