BIP-32: Understanding Hierarchical Deterministic Wallets
KEY TAKEAWAYS: |
— Hierarchical Deterministic (HD) wallets allow you to manage a near infinite number of accounts with just one secret recovery phrase — HD wallets were introduced with the BIP-39 standard, and today they are the most popular type of wallet due to their convenience. — HD wallets let you back up your entire wallet in ease, plus, they also allow you to recover your original wallet on whichever HD wallet interface you choose. |
Crypto wallets are easy to use today, but that wasn’t always the case. When the Bitcoin network was still in its infancy, the tools to manage your crypto were almost impossible to use. Of course, with more people joining the crypto community, the need for more accessible tools arose. Throughout the years, the crypto wallet has evolved to cater to those needs. After all, if crypto mass adoption is on the cards, it won’t be with inaccessible tools.
One of the most important innovations for crypto wallets to date includes Hierarchical deterministic wallets. While that may be a long and complicated name, this standardization is all about making your life easy. The standard, introduced in Bitcoin Improvement Proposal 32 (BIP-32), allows you to manage multiple accounts with a single wallet. It also makes restoring your accounts easier. In short, HD wallets exist purely for your convenience.
Let’s see how this works:
What Is a Hierarchical Deterministic (HD) Wallet?
A hierarchical deterministic wallet is a crypto wallet that uses a hierarchical structure to derive key pairs (your public and private keys). On a basic level, this allows you to manage multiple accounts with a single crypto wallet.
To get into the tech a little deeper, it allows each crypto wallet to generate multiple key pairs, with each key pair controlling a separate account. HD wallets generate their key pairs in several layers, with each layer responsible for generating the next layer of key pairs. They also generate public keys directly from private keys; without the public key leading to the private key.
To explain the significance of this, let’s first dive into the problem they are trying to solve.
The Origin of HD Wallets: BIP-32
When the Bitcoin network was still in its infancy, wallets were non-deterministic. That means they would generate random key pairs. These two codes were not related to each other, despite making up the two integral pieces of the same account. This resulted in users having to back up each key pair individually. So, if you had three accounts, you’d have to record the private and public keys for each of those accounts (six codes in total) and store them somewhere safe.
For just three accounts, this method works perfectly fine. However, when managing ten or more accounts, you can imagine it becomes rather impractical.
What is BIP-32
Bitcoin Improvement Proposal 32 (BIP-32) provided the solution to this problem in 2012. It was proposed by Pieter Wuilla, a Bitcoin Core developer, to simplify the recovery process of crypto wallets. BIP-32 introduced a hierarchical tree-like structure for wallets that allowed you to manage multiple accounts much more easily than was previously possible. It’s essentially a standardized way to derive private and public keys from a master seed.
To understand it fully, let’s dive into what it’s for.
What are HD wallets for?
HD wallets allow for a lot of different capabilities. But there are a few key features that HD wallets have over others, so let’s dive into some of those examples.
Managing Multiple Accounts
HD wallets are important to help you manage multiple accounts at the same time. Without these types of wallets, you’d be stuck writing down every single public and private key for every single account controlled by your crypto wallet. Using the hierarchical structure, you can also track your balance across all of them with ease. Checking the balance of an account high up in the hierarchy will show you the combined balances of all the accounts further down the structure.
Privacy
Another key advantage of HD wallets is privacy. With this method, it’s easy to set up a burner wallet for a single transaction and manage it from the same interface as all of your other accounts.
For example, let’s say you run a blog and allow for Bitcoin donations. To accept the donations, you’ll need to share your public address. However, the blockchain is transparent, so anyone with your public address can see all of the funds in that account. With HD wallets, you can set up an account for a single purpose, and share the public key to that account without anyone knowing the address of the master account
Restoring Your Accounts
If you lose the physical store of your keys, it’s impossible to recover your accounts. With HD wallets, you only need to look after the master private key and you can restore all of the accounts in the wallet if they are further down the hierarchy. To understand how this fully, let’s dive into how HD wallets work.
How do Hierarchical Deterministic (HD) Wallets work?
Your HD wallet can generate the master private key, also called the extended private key (xPRIV), and an extended public key (xPUB). The xPUB is much like a unique identifier that can show you the balances of all accounts managed by its corresponding xPRIV. Thus, keeping your xPUB private is probably a good idea if you don’t want the public to know your overall crypto holdings.
Each time you add a new account, your wallet derives a new private key from that extended private key(xPRIV). It does so using a trapdoor function: it’s very easy to work out the associated private keys using the master private key, but impossible to work out the master private key with a private key further down the hierarchy.
HD wallets derive public keys from private keys. Anyone with your public key will only have the power to see the balance in that specific account. Importantly though, that public key retains a cryptographic link to its corresponding private key. This allows you to restore the public and private keys of accounts with any private key above it in the hierarchical structure.
Using the HD wallet scheme, the same input will always result in the same output. To reiterate, a wallet will always derive the same public keys from the private keys. Since it’s a standardized method and your crypto is stored on the blockchain, you can use any wallet using this scheme to restore your accounts on any other interface. This makes managing multiple wallets and switching between wallet providers much easier.
Hierarchical Deterministic (HD) Wallets: Why They Are So Important
BIP-32 was a huge step forward for the accessibility and ease of use of crypto wallets. With the introduction of this standard, normal people had ways to manage multiple wallets and even restore their accounts on different interfaces without having to buy or manage new interfaces.
Today, wallets have seen countless more innovations and are easier to manage than ever. Restoring your accounts no longer requires careful planning and is possible on almost every wallet interface. Plus, wallet providers are still working on releasing smarter, more capable wallets too.
For example, Ledger devices are also HD wallets, allowing you to manage a near-infinite number of accounts with a single device. And of course, only you can exercise true control over your assets, choosing to use whichever interface you please without forfeiting your custody.
Because if not self-custody, then why crypto?