Post
Topic
Board Bitcoin Technical Support
Re: What is the best/correct way to manage new HD wallets
by
tiffy
on 14/12/2024, 11:24:36 UTC
Is the `listdescriptors true` command what I want here?

Yes, that's exactly what you're looking for. This describes your HD Wallet mathematical complete. Even if your backup of wallet.dat is lost, you can use this output to restore your wallet. It contains the xprv key from which all key material can be derived.

If you use listdescriptors (without true), you will get the descriptors with the corresponding xpub keys. You can use this to set up a watch-only wallet on an online system.

I had exactly the same problem/questions as you.

This is how I proceeded:

  • First I wrote `listdescriptors true` in a file on my offline system. Then I wrote down the xprv key manually. Then I removed the xprv key in the file from all descriptors and replaced it with a string, for example:
    '__XPRV-KEY-HERE__'
  • I then saved the file with the descriptors (without xprv key) electronically and also printed it out.
  • Finally (for testing only), I took a completely new offline system and merged the descriptor file and the xprv key again. I imported the result into the core client and used it to sign a test transaction.

The encoded xprv key is about twice as long as the old legacy keys. But you have stored all the private keys of your wallet with it. 

This is not a complete description of what to do. But I hope this gives you an idea of how you can proceed for your purposes.