hardware wallets

What is HD path? A Beginner’s Guide

If you’re new to the realm of blockchain and cryptocurrencies, you might encounter a lot of jargon that can be quite daunting. One such term is “hierarchical derivation path.” This concept is fundamental to the functioning of cryptographic wallets and blockchain technology, ensuring both security and efficiency in managing digital assets. In this blog post, we’ll demystify hierarchical derivation paths, explain why they are important, and guide you through the basics of how they work.

Table of Contents

  1. Introduction to Hierarchical Deterministic Wallets
  2. What Is a Hierarchical Derivation Path?
  3. The Structure of a Hierarchical Derivation Path
  4. Understanding BIP32 and BIP44
  5. Creating a Hierarchical Wallet
  6. Advantages of Hierarchical Derivation Paths
  7. Common Use Cases
  8. Final Thoughts

Introduction to Hierarchical Deterministic Wallets

Before diving into hierarchical derivation paths, it’s crucial to understand what a hierarchical deterministic (HD) wallet is. An HD wallet is a type of cryptocurrency wallet that generates a tree-like structure of keys starting from a single master seed. This seed is a randomly generated value, usually represented as a series of mnemonic words that ensure your private keys are secure and easy to back up.

The Benefits of HD Wallets:

  • Security: A single seed can generate an infinite number of private keys, ensuring that if one key is compromised, the others remain secure.
  • Convenience: With an HD wallet, you only need to back up the master seed to recover all derived keys.
  • Organization: HD wallets are capable of creating multiple accounts and sub-accounts, facilitating better management of funds.

What Is a Hierarchical Derivation Path?

A hierarchical derivation path is the method used to navigate the complex tree structure created by an HD wallet. Simply put, it’s a way to systematically generate new addresses and keys from a single master seed. It organizes the wallet’s structure in a predictable, standardized manner, which is essential for both compatibility and functionality.

For example, commonly used derivation paths in Bitcoin and Ethereum follow specific conventions that allow wallet software to understand and generate the correct keys and addresses.

The Structure of a Hierarchical Derivation Path

A hierarchical derivation path is typically represented in a format like this:

m / purpose' / coin_type' / account' / change / address_index

Each part of this path has a specific function and is separated by slashes. Let’s break down each component to understand what they represent:

1. m (Master Node)

The master node is the starting point or the root of the path structure generated from the master seed.

2. purpose'

The purpose field defines the standard or reason for the wallet’s creation. A common standard is BIP44, denoted as 44'.

3. coin_type'

This field indicates the type of cryptocurrency. For instance, 0' is for Bitcoin (BTC) and 60' is for Ethereum (ETH).

4. account'

The account field allows users to segregate the funds within an HD wallet. It helps in managing multiple accounts within the same wallet.

5. change

This field indicates whether the address is used for receiving external transactions (0) or as a change address (1).

6. address_index

Finally, the address index specifies the specific address in the account and change chain.

Example of Full Path

A full derivation path might look like this:

This path represents a Bitcoin address generated using the BIP44 standard, the first account, and the first receiving address.

Understanding BIP32 and BIP44

BIP32: The Foundation

BIP32 (Bitcoin Improvement Proposal 32) introduced the concept of hierarchical deterministic wallets and the derivation paths. It allows a single master seed to generate an unlimited number of private and public keys. BIP32 paths use a similar structure to what we’ve discussed and are the backbone of HD wallets.

BIP44: The Standard

BIP44 builds on BIP32 by specifying a multi-account hierarchy for deterministic wallets. It introduces the standardized path m / purpose' / coin_type' / account' / change / address_index for more organized wallet structures.

Why These Standards Matter

These standards ensure compatibility across different wallet applications and hardware devices. If you switch wallets or lose your device, you can recover your funds using the seed and the specified derivation path.

Creating a Hierarchical Wallet

Creating a hierarchical wallet involves several steps. Here’s a simplified guide:

Step 1: Generate a Master Seed

Most wallets provide a 12 to 24-word mnemonic phrase that serves as your master seed. This seed is critical; keep it secure and backed up.

Step 2: Create the Master Node

Using the master seed, generate the master node (m). This is the root of your hierarchical tree.

Step 3: Derive Child Keys

From the master node, derive child keys using the hierarchical derivation path. For example, follow the path m / 44' / 0' / 0' / 0 / 0 to generate the first Bitcoin receiving address.

Step 4: Use Addresses

Now you can use the derived keys and addresses to receive and manage cryptocurrencies.

Advantages of Hierarchical Derivation Paths

1. Enhanced Security

With hierarchical derivation, losing one private key doesn’t compromise the entire wallet. Each derived key is independent yet can be tracked back to the master seed.

2. Simplified Backup

Backing up a single master seed phrase recovers all keys and addresses, simplifying the backup process.

3. Organizational Efficiency

Hierarchical paths facilitate organized management of funds, allowing multiple accounts and sub-accounts within the same wallet.

4. Cross-Compatibility

Standardized derivation paths (e.g., BIP44) ensure that wallets can be restored and accessed across different applications and devices.

Common Use Cases

1. Personal Wallets

Individuals use hierarchical wallets to manage multiple cryptocurrencies securely and efficiently.

2. Business Accounts

Businesses benefit from the multi-account feature for better financial management and auditing.

3. Hardware Wallets

Hardware wallets extensively use hierarchical derivation paths to provide secure, offline storage for cryptocurrencies.

4. Exchanges

Cryptocurrency exchanges use hierarchical wallets to manage user accounts and cold storage funds.

Final Thoughts

Hierarchical derivation paths are a cornerstone in the world of HD wallets, providing a structured and secure way to manage cryptocurrency keys and addresses. While the terminology and concepts may seem complex at first, understanding them is essential for anyone who wants to take control of their digital assets.

By mastering hierarchical derivation paths and the standards like BIP32 and BIP44, you can ensure the security, efficiency, and compatibility of your cryptocurrency wallet. Whether you are starting your journey into cryptocurrencies or looking to deepen your understanding, knowing how hierarchical derivation paths work is a crucial step.

Stay curious, stay secure, and happy crypto managing!


Did you find this guide helpful? Learn more about blockchain development with our new course “Build a Production-Ready Blockchain with Cosmos-SDK”.