User Tools

Site Tools


public:setting_up_a_watch-only_bitcoin_wallet

Setting up a watch-only Bitcoin wallet

On an airgapped computer

First, set up a new wallet the usual way. Then, export the descriptors for that wallet via the following console command:

listdescriptors

:!: Do not add true as a parameter, as that would also export your private key descriptors!

Copy the descriptors array to a removable drive. It should look similar to this (but you will probably see more):

[{
    "desc”: "wpkh([66bb13d5/84'/0'/0']xpub6CtDSW4S3XVd5uYp9CgsLTZKQcKieJSmjehcvfVJBSy1rPbkKNU3T6UmZ3mn7DoSsTsM6uH8ZKem7LQh3PHyrBAtZopSvF2tonEE7foTWFe/1/*)#a9twa6j5",
    "timestamp": 1647182091,
    "active": true,
    "internal": true,
    "range": [
    0,
    999
    ],
    "next": 0
    },
    {
    "desc": "wpkh([66bb13d5/84'/0'/0']xpub6CtDSW4S3XVd5uYp9CgsLTZKQcKieJSmjehcvfVJBSy1rPbkKNU3T6UmZ3mn7DoSsTsM6uH8ZKem7LQh3PHyrBAtZopSvF2tonEE7foTWFe/0/*)#v3w0q0zv",
    "timestamp": 1647182091,
    "active": true,
    "internal": false,
    "range": [
    0,
    1000
    ],
    "next": 1
    }]

Note that you should only see descriptors with the key prefix xpub. If you see the prefix 'xprv' instead, you have also exported your private descriptors.

On a connected, fully-synced computer

Create a new, blank wallet that cannot store private keys. You can do so using the GUI or with the following console command:

bitcoin-cli createwallet walletname true true

Then, import the descriptors in your wallet:

bitcoin-cli -rpcwallet="walletname" importdescriptors '[{ "desc": "<my descriptor>", "timestamp":1455191478, "internal": true }, { "desc": "<my desccriptor 2>", "label": "example 2", "timestamp": 1455191480 }]'

If the original wallet already exists for a long time, the import may take a very long time and even time out, but will continue in the background. You can check the progress in the debug log. The blockchain will be checked as far back as needed to see if there are any addresses that match the descriptor.

References

public/setting_up_a_watch-only_bitcoin_wallet.txt · Last modified: by thomas

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki