In a typical crypto wallet, a pair of private/public addresses (or keys) is randomly generated. This requires you to take a backup each time you make a new pair of addresses.
However, at the start, you might feel that this process is easy. But slowly, it will become more and more complicated and cumbersome to track/backup so many private/public addresses as the number of your transactions increase.
Moreover, if you are a person who cares about financial privacy and does frequent transactions, then you might need to generate a lot of private/public pair of addresses (or keys).
Which means more backups!
On the other hand, some wallets re-use the same wallet address for all transactions to avoid losses, which can happen from the loss of a backup. This is not a very healthy practice and can compromise your financial privacy.
Imagine how easy it would be if there were a mechanism to somehow generate a pattern of public/private keys that couldn’t be guessed and needed no complicated backup.
Well, there is!
Such easy to use wallets are called HD wallets.
HD is an abbreviation for Hierarchical Deterministic. All HD wallets use 12-word master seed keys. Each time this seed is appended by a counter at the end and is used to derive seemingly unlimited new wallet addresses hierarchically and sequentially.
Since all the address are derived from a single master seed, you only need to worry about backing it up. That’s why it is called Hierarchical Deterministic.
What happens inside an HD wallet?
HD wallets generate a hierarchical tree-like structure of keys which start from the seed master key based on BIP 32. When you restore an HD wallet using the seed key, the wallet goes ahead and derives all the private keys of the tree using BIP 32.
And as soon as the scanning of keys is completed on the network, your funds are recovered!
While using an HD wallet, the backing up of the seed key is mandatory and should be kept safe so that you can restore your wallet in case your device is lost or damaged.
And this is the beauty of HD wallets. Taking a backup only once means that all subsequent addresses can easily be re-created mathematically from the algorithm. HD wallets use a one-way SHA-256 hash algorithm which produces this tree of keys without any error if the input (or seed key) is the same.
Advantages of HD Wallets
You need to backup only one key (i.e. “seed key”). It is the only backup you will ever need.
You can generate many receiving addresses every time you receive coins.
You can protect your financial privacy.
Confuse new users, as your receiving address changes every time.
2. How to use an HD wallet - Backup/Recover
In TWINS and FIX wallets HD support is disabled by default. In order to enable it, wallet must be launched with "-usehd=1" command line parameter, as follows:
Alternatively, "usehd=1" line can be included in the configuration file, as follows:
In that case you'll need to save the conf file and restart the wallet.
Please note: Once created, wallet can't be changed to/from HD/legacy format. If you want to migrate from one format to another, you will have to create a new wallet (remove wallet.dat from the folder) and transfer all the funds.
Random 24 words mnemonic seed will be generated for new wallets, which can be shown using 'dumphdinfo' console/CLI command, as follows:
In order to create new HD wallet by restoring existing seed / mnemonic phrase, the wallet should be launched with the following options :
Once restored, wallet can be launched with just "usehd=1" parameter.
dumphdinfo command should return the same output prior and after wallet recover. That way you are sure the wallet is well recovered.
dumphdinfo command returns sensitive private info about the HD wallet, never share that info with anyone.
If in spite of the above check, your funds do not appear after recovering, go to tools/wallet repair and "rescan blockchain files". It should rescan the blockchain and recover old transactions (if you have any). All your funds should then be visible in the wallet.
When restoring an HD wallet, the Receiving Address you had earlier will not be present under File -> Receiving Address. However they still belong to your wallet and you will be able to use them in CLI in debug console for example.