Bitcoin

How to use a watch-only wallet in Bitcoin Core?

If you use Bitcoin Core 23.0 and created a new wallet using it, by default Descriptor Wallet. This is a next-generation wallet that uses output descriptors to determine which keys/scripts/addresses “belong” to the wallet. This is in contrast to legacy wallets, which use a much less well-defined process to determine this.

Several RPCs, such as: importaddress, importpubkeyand importmulti Disabled for descriptor wallets because the behavior for legacy wallets cannot be exactly replicated for descriptor wallets. This is a good thing. Deducing what that behavior was was very complicated.

To import something into your descriptor wallet you will need: importdescriptors RPC instead. This single RPC includes the functionality of all legacy import commands in a single RPC by using an output descriptor language to specify what to import. This includes the ability to get a single address (using addr((ADDR)) descriptor) or HD key derivation script scope (e.g. wpkh((XPUB)/0/1/2/*) Get all P2WPKH addresses derived from xpub. (XPUB)Include derivation path m/0/1/2/0, m/0/1/2/1, m/0/1/2/2…).

The documentation on developer.bitcoin.org appears to be out of date. Bitcoin Core 23.0 RPC documentation (accessible via: help The RPC command) says:

Note: This command is only compatible with legacy wallets. For descriptor wallets, use “importdescriptors” with “addr(X)”.

Related Articles

Back to top button