Derivation paths in Leather

What are derivation paths, and which ones does Leather use exactly to store Stacks and Bitcoin assets?

Introduction

In simple terms derivation paths are used to systematically derive public keys from a private key. For example if you have seed phrase say 1. And you want to derive private keys from that. You would make a format for multiple keys. With just one layer the format would be:

Add one to derive next private key:

- So the first key is 1 + 0

- Next key 1 + 1

- And so on

The derivation path for Bitcoin taproot addresses starts with m/86'/ basically a prefix for a type of chain so that the keys generated are specific to that chain then you have four more layers (coin_type', account', change and account_index) so that you have flexibility in differentiating between different wallets, accounts and invoices. This is the standard format for derivation paths:

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

Below are the exact derivation paths that are commonly used by the Leather wallet.

For Bitcoin balance native segwit is used.

Account 1: m/84'/0'/0'/0/0 Account 2: m/84'/0'/1'/0/0

… Account 500: m/84'/0'/499'/0/0

For Ordinals the taproot address is used

Account 1: m/86'/0'/0'/0/0 Account 2: m/86'/0'/1'/0/0

… Account 500: m/86`/0`/499`/0/0

Regenerated Taproot addresses (Ordinal inscriptions)

Special case, prior to March 20th 2023 the wallet would use regenerated addresses for storing Ordinal inscriptions. As the wallet detected activity on one address the next fresh address would be generated for deposits. Note that the wallet has also always supported several Ordinal Inscriptions on the same address it was simply deemed safer and more private to store them on individual addresses. Account 1: m/86'/0'/0'/0/0,1,2,3 etc. for example this could include ordinals on m/86'/0'/0'/0/9 and m/86'/0'/0'/0/78 Account 2: m/86'/0'/1'/0/0,1,2,3 etc.

… Account 500: m/86'/0'/499'/0/0,1,2,3 etc.

For Stacks

Used for storing STX and other Stacks assets such as SIP009 NFT’s, SIP010 fungible tokens or SIP013 semi-fungible tokens. Account 1: m/5757'/0'/0'/0/0 Account 2: m/5757'/0'/0'/0/1

… Account 500: m/5757'/0'/0'/0/499

Stacks address with Ledger

Note: (Unused) Stacks addresses added/generated with Ledger live will follow this path: Account 1: m/5757'/0'/0'/0/0 Account 2: m/5757'/0'/1'/0/0

… Account 500: m/5757'/0'/499'/0/0 Ledger will also reveal addresses on the path (m/5757'/0'/0'/0/1) typically used by the Leather wallet if they have STX balance (= a used address). When adding addresses in Ledger live, the ones with balance created with Leather+Ledger (or the Hiro Wallet prior) will be available for adding to access in Ledger live directly but their derivation paths deviate from the scheme used for Bitcoin in order to maintain legacy compatibility. Ledger in this case is using the 'standard' scheme. There is an issue on the Leather repo suggesting this may be changed in the future so that Leather follows the same scheme as Ledger for additional accounts: https://github.com/leather-wallet/extension/issues/4224. Knowing the derivation paths of your assets also means you can determine if addresses are compatible with other wallets and if so where to find the assets exactly.

Last updated