Numerous types of wallets have been discovered since the inception of Bitcoin and other cryptocurrencies. Wallets are the main user interface that helps in the interaction of the user with the cryptosystem.
However, one should understand that no actual coins are stored in a crypto wallet; instead, it stores key pairs. These key pairs are then used for managing the transaction and the digital assets stored on the blockchain.
However, a backup is required every time a new pair of addresses is generated. This makes the whole system much more complicated when the number of transactions being carried out increases.
In addition, a user concerned about the security of his assets might require multiple private keys and thus addresses that lead to a more significant number of backups.
Moreover, some wallets may repeatedly use the wallet addresses to avoid losses due to backup, which may not prove beneficial in many aspects. Therefore, the concept of Hierarchical Deterministic (HD) wallets was introduced.
This guide will explain the concept and purpose of using hierarchical deterministic wallets. In addition, it will also explain to the readers the pros and cons of using these wallets and if they are safe to use.
What is a Non-Deterministic Wallet?
Typically, cryptocurrencies based on the blockchain network use pairs of private and public signing keys or digital signatures. Users sign a transaction after paying money and are provided with a private key.
On the other hand, to confirm the validity of the signatures, the recipients can use the public key. One can use the private keys to generate public keys for his wallet, but the opposite is impossible.
A Bitcoin wallet owned by a user usually contains a set of private keys enabling the user to spend the Bitcoins integrated with those keys. In case of need, a Bitcoin address and private keys will be randomly generated by the Bitcoin wallets. These kinds of wallets are known as non-deterministic wallets.
However, it is essential to create a backup of every key whenever a new key is generated, as the keys are not following any specific pattern. Therefore, one might lose all the keys and addresses if the wallet details are lost.
Such kinds of Bitcoin wallets are named just-a-bunch-of-keys (JBOK) wallets. This name relates to the fact that the user needs to keep track of the transactions every time he decides to sell or buy any wallet, as unrelated keys are produced by it.
What is a Hierarchical Deterministic Wallet?
JBOK wallets were then replaced by hierarchical deterministic wallets as users can get many edges by using the extended keys and back up their wallets utilizing only a single key. Therefore, the hierarchical deterministic wallet is a wallet in the crypto space that can generate its public and private keys through a single seed.
Users can carry out multiple functions through these wallets, such as online shopping, permissionless auditing, and funding distribution in any department via a treasurer.
It is up to the owner if he wants to reveal his public key to anyone or not. The public key can then be used to view any future transaction carried out through Bitcoin. However, the funds of the user are still safe in this case as he has not shared the private key to his wallet with anyone.
Why are Hierarchical Deterministic Wallets Needed?
There are several benefits that hierarchical deterministic wallets provide to the users as compared to using non-deterministic wallets. Some of the features that made hierarchical deterministic wallets are discussed below.
- Single Backup
While using a traditional wallet, a pair of public and private keys are generated every time a transaction is carried out. This creates a need for backup every time the owner carries out a transaction.
However, while using a hierarchical deterministic wallet, the master key can be generated using a single key that is further used to create multiple child keys; therefore, one only needs to back up the seed key in order to protect his holdings from any loss.
The hierarchy of hierarchical deterministic wallets is an essential and distinct feature that makes it different from traditional wallets. Every child key in the hierarchical deterministic wallet can create its key. This forms a tree-like structure organizing all the keys generated in the wallet. Moreover, for different parts of his accounts, different keys can be used by the owner.
- Independent Generation of Public Keys
While dealing with hierarchical deterministic wallets, the master key can be used by the owner to generate corresponding public keys. One does not necessarily need access to the wallet’s private keys to do so.
The web address can be generated if one shares his master key with any other person or sends it to another device. Moreover, it even reduces the fear of private keys being stolen in case of any scam or illicit activity.
Difference Between Hierarchical Deterministic wallets and Non-Deterministic Wallets
A master key is generally used by the hierarchical deterministic wallets to generate a public and private key. If the user gains access to that key, it helps him create a new account and retrieve all the keys and addresses.
On the contrary, wallet addresses and keys are randomly generated by non-deterministic wallets. This restricts the user from losing all his keys and wallet addresses if the wallet details are lost.
In the case of the hierarchical deterministic wallets, the master key or the sed phrase needs a backup to prevent any loss; however, while dealing with the non-deterministic wallets, every time a key is generated, a backup is needed as these keys are random, and no one can ever guess it if it is lost during any trading activity.
Working of Hierarchical Deterministic Wallets
A new pair of keys is generated by the hierarchical deterministic wallets every time a crypto transaction is carried out by utilizing the master key. The master key is composed of an extended public key and an extended private key. This adds to the privacy and security of the wallet.
When any transaction is carried out using the crypto wallets, there is no actual movement of currency from one account to another, like in the case of fiat transactions.
However, the transaction is approved through a private key that helps create a signature that directs its approval to the blockchain network. This transaction is then reflected in the public ledger of the user, thus displaying his new balance in the account.
The hierarchical deterministic wallets have become the de-facto standard for Bitcoin by using the BIP-32. It is the Bitcoin Improvement Proposal (BIP) that helped in the introduction of a wallet system resembling a hierarchical tree.
MetaMask is one of the popularly known hierarchical deterministic wallets where the wallet seed is used to create a single master key. This master key generates different child keys that can be used to create more child keys.
A seed is an information that can be further used to produce both private and public keys of the wallet. It is usually composed of a mnemonic phrase.
The hierarchical deterministic wallets for Bitcoins usually contain the master key composed of the extended public key (XPUB) and the extended private key (XPRIV). Moreover, this master key is used to generate a child private key randomly. In addition, if anyone knows the master key, he can create public keys matching the parent key.
XPRIV produces all the child private keys, and all the balances in the wallet are displayed using XPUB. Moreover, as one can generate the addresses for the hierarchical deterministic wallets using the master seed or key, it eliminates the need to store many key pairs.
Therefore, in the case of hierarchical deterministic wallets, the user needs to back up a single master key instead of hundreds of different keys, as the same pattern of keys can be generated again by using the master key. In addition, the user can receive Bitcoin directly into his cold storage wallet by utilizing the XPUB keys.
However, the extended private key should be kept offline and not shared with anyone because users can generate new addresses by only utilizing the public keys available. An encouraging use case of the hierarchical deterministic wallets is the creation of new public keys by a web trader for every new sale.
The hierarchical deterministic wallets help the merchant to create and safely secure the public keys over the internet and hide all the information regarding private keys offline.
Moreover, the hierarchical characteristics of these wallets only require the user to use his public keys to proceed with the payments of the customers. This helps in the improvement of the security and transparency of the system.
Extended Private and Public Keys Explained
By using a hierarchical deterministic wallet, the child private keys are generated by the master key. The user can generate new public addresses using the extended public keys without requiring access to the wallet’s private keys.
As there is no information integrated with the extended public keys, they cannot provide access to the funds in the wallet or allow them to spend them. However, users are only given read-only access.
Moreover, sharing the public keys with anyone also involves a high risk as it enables others to view the complete transaction history of the owner and all the associated public addresses and balances with the wallet.
Impact of Hierarchy on Crypto Wallets
Almost a decade back, BIP-32 led to the discovery of hierarchical deterministic wallets that quickly became popular among crypto enthusiasts and traders.
Moreover, several other crypto wallets were then also created on the same pattern. The main benefit that hierarchical deterministic wallets provided the traders was enhanced security for their funds.
The primary foundation in the case of hierarchical deterministic wallets is the master key that may diverge into several different branches that are then used for securing multiple crypto assets.
In the same way, as BIP-32, Bitcoin Improvement Proposal created BIP-44 too, which can be used for securing the crypto assets forming a tree-like structure.
Compared to the ND wallets, the security provided by the hierarchical deterministic wallets is much enhanced as the key pairs are automatically generated. All the blockchains, including Bitcoin, are public ledgers, and the balances contained in the accounts are open for public access.
Therefore, if the user has not shared his extended public key with anyone and carries multiple addresses, the third party can never guess which public address is linked to the actual owner, keeping the anonymity of the user intact. However, all the balances can be accessed if someone knows the extended private key of the user.
Moreover, most hierarchical deterministic wallets make it difficult and nearly impossible for someone to share his extended private keys. Therefore, if anyone wants to access the holder’s wallet, he would need several private keys to prove his identity. So if one has not shared the private keys, his funds are fully secured.
In addition, BIP-39 is another improvement made by the Bitcoin Improvement Proposal that assists the user in keeping his master keys safely, thus protecting their entire wallets. This is done by using a recovery phrase. It is usually a phrase consisting of about 12 to 24 words that have a specific order of words and are generated randomly.
However, it acts as a backup in case one fails to access his hierarchical deterministic wallet, or it stops functioning correctly. The recovery phrase helps regenerate all the balances in the wallet and, thus, the entire wallet. However, it should be kept a secret offline, thus not sharing it with anyone.
The funds will be lost permanently and cannot be recovered at any cost if one loses access to his wallet and forgets or loses the recovery phrase.
Pros and Cons of Using Hierarchical Deterministic Wallets
Using the hierarchical deterministic wallets enables one to share public keys with others without risking their investment. It helps in the improvement of the security and safety of the system.
Moreover, as the funds are diversified in several addresses, the hierarchical deterministic wallets are considered relatively more secure. However, if the private or public keys are revealed to the public, it increases the possibility that the user might lose his funds.
The hierarchical deterministic wallets generate the private keys that can be used as master keys to generate more keys further, and it might continue depending on the user’s need.
This has been made practical due to the hierarchical feature of these wallets. Moreover, by using the public ledger, no one can find out the exact wallet balance of the user due to the addresses being changed continuously by the owner, thus providing security to the system.
On the other hand, sharing the extended private keys with only trusted parties is always advised, as one might end up losing all his funds if someone gets access to his wallet using the private keys.
Moreover, as the user has dispersed all his funds along different addresses, it also helps provide an extra security layer to the hierarchical deterministic wallets, as anyone can only get access to the crypto assets when he proves his access to all the private keys generated to protect them.
In addition, if any one of the private keys gets lost or is compromised in any mishappening, the coins stored within other private keys will still be safe. On the other hand, if the seed gets lost by mistake or during an illicit trap, the owner will lose all his funds that cannot be gained back at any cost.
Can Hierarchical Deterministic Wallets Be Considered Safe?
One can consider hierarchical deterministic wallets as safe and secure as the digital or physical medium on which they are stored. The deterministic wallets produce a tree-shaped hierarchical structure of private keys by using the BIP-32 feature.
Therefore, one can use the backup mechanism for recovering the seed if one loses or destroys his device. It will help recover all the associated addresses and the wallet’s private keys.
Moreover, the hierarchical deterministic wallets provide additional privacy and security to the users than the non-deterministic wallets. As for every transaction being carried out, a new address is generated. Therefore, hacking and scamming the user becomes a complicated and challenging process.
Moreover, for collecting payments, the user can create an infinite number of public addresses that also helps in keeping the identity of the user anonymous.
However, if one does not secure his private keys and a scammer gets his hold over them, the user might lose all his assets and holdings. Therefore, the user should choose a key phrase that is difficult to crack and not related to the personal details and credentials of the user, making it a complicated task for the scammers to guess.
The holders of cryptocurrencies such as Bitcoin and Ethereum greatly benefit from the hierarchical deterministic wallets. It has enabled users to control their crypto accounts using public and private keys generated through a master key. However, they need to back up the master key regularly to avoid any permanent loss in the future.