Back
Understanding Wallet Derivation Paths
Wallet Security
5 min
Simply put, a derivation path refers to a hierarchical structure that is used to derive public keys from a private key. This hierarchical deterministic (HD) key generation is commonly used to securely manage multiple wallet accounts or addresses.
Components of a Derivation Path
A derivation path typically consists of a series of indices or numbers that specify the path from the main private key to a particular public key in the hierarchical structure. This is represented as a string of numbers separated by slashes that look like:
m/84’/0’/0’/0/0
Here, “m” stands for “master key.” The rest of the path consists of the following:
m/purpose’/coin_type’/account’/change/address_index
Common Derivation Paths in Leather Bitcoin Wallet
Derivation paths for Native SegWit addresses
For Bitcoin balances, Leather uses Native SegWit addresses. This means that the derivation path for Bitcoin balances in Leather follow this format:
m/84’/0’/0’/0/0
The “account” number you see in the derivation path would increase based on the number of accounts associated with your wallet and private key. This means that if you were to create additional accounts, the derivation paths for the generated public keys would follow this convention:
Account 2 would have a derivation path of: m/84’/0’/1’/0/0
Account 500 would have a derivation path of: m/84’/0’/499’/0/0
Derivation paths for Taproot addresses
For Ordinals-related transactions, Leather uses Taproot addresses. The derivation path associated with Taproot addresses take this structure:
m/86’/0’/0’/0/0
Similar to what you’d see for Native SegWit addresses, subsequent Taproot addresses that are associated with your wallet would have a different “account” number. This means that if you were to create additional accounts, the derivation paths for the generated public keys would follow this convention:
Account 2 would have a derivation path of: m/86’/0’/1’/0/0
Account 500 would have a derivation path of: m/86’/0’/499’/0/0
Derivation paths for Stacks addresses
For Stacks-related assets like STX tokens, Stacks NFTs, and SIP10 tokens, Leather uses a wallet’s Stacks address. Derivation paths for Stacks addresses in Leather look like:
m/5757’/0’/0’/0/0
However, the derivation path for Stacks addresses in Leather differs in that the “address_index” value is what changes when users create additional accounts. This means that for Stacks addresses, the derivation paths for the generated public keys would follow this convention:
Account 2 would have a derivation path of: m/5757’/0’/0’/0/1
Account 500 would have a derivation path of: m/5757’/0’/0’/0/499
Derivation paths for Stacks addresses in Ledger
Ledger devices will typically reveal the derivation path of existing Stacks addresses associated with a Leather wallet using the same convention outlined above.
However, the derivation paths for Stacks addresses generated by a Ledger device are different than those created by the Leather extension. In this case, the “account” value will change as users generate additional Stacks addresses with their Ledger device. This means that if you were to create additional Stacks accounts in Ledger, the derivation paths would normally follow this convention:
Account 2 would have a derivation path of: m/5757’/0’/1’/0/0
Account 500 would have a derivation path of: m/5757’/0’/499’/0/0
Why are Wallet Derivation Paths Important?
Understanding wallet derivation paths is important for a number of reasons:
Security: The hierarchical structure of derivation paths allows you to generate multiple public keys from a single master private key. This reduces the risk of exposure, though it’s technically very difficult to trace different accounts back to one wallet.
Organization: Derivation paths can help organize and manage multiple accounts or addresses associated with different networks.
Compatibility: Following standard derivation paths ensures compatibility with various wallets and services that support HD key generation.
Overall, understanding derivation paths is crucial for effectively managing and securing your assets.
Viewing Accounts in Other Wallets Using Derivation Paths
Knowing how to identify derivation paths can help you track different accounts associated with Leather in other wallet applications. In this case, we’ll use Sparrow as an example.
In Sparrow’s “Settings” tab, you’ll notice that the “Derivation” line under “Keystores” is filled in with a derivation path. This is the derivation path associated with the Leather wallet that you imported into Sparrow.
You can change the numbers in the “account” portion (or the “purpose” tab if you’re looking for a Taproot or Stacks address) of the wallet’s derivation path to view the address associated with a specific account you’ve created. Go to the “Addresses” tab after entering a derivation path value, and you’ll notice that the address associated with that specific Leather account will show up.