Derivation Path
In the use of blockchain and hardware wallets, derivation path is an important concept that determines which addresses your wallet generates and why addresses differ between wallets.
For beginners with hardware wallets, the generated address format may vary based on the default settings of different wallets. By selecting the appropriate derivation path and address format according to their needs, users can achieve optimal transaction efficiency and compatibility.
What is a Derivation Path?
A derivation path is a rule used to define how blockchain addresses are generated. Through a specific path, wallet software (such as hardware wallets) can generate different addresses based on a seed.
The basic format of a derivation path is as follows:
m / purpose' / coin_type' / account' / change / address_index
Each part has a specific meaning:
- m: Represents the master path (master key).
-
purpose': Defines the wallet's purpose, common values include:
- 44': Used for traditional Bitcoin addresses (Legacy).
- 49': Used for nested SegWit addresses (Nested SegWit).
- 84': Used for native SegWit addresses (Native SegWit).
- coin_type': Differentiates between different blockchains, with Bitcoin being 0 and Litecoin being 2.
- account': Used to distinguish between different user accounts.
- change: 0 represents external addresses, 1 represents internal addresses (usually for change).
- address_index: The index number of the address, used to generate multiple addresses.
Why Do Addresses Differ on Different Hardware Wallets?
If you import the same seed phrase on multiple hardware wallets but find that the generated addresses are different, it is usually due to the derivation path being different. Here are some common hardware wallet brands and their derivation paths (for Bitcoin).
Hardware Wallet | Common Derivation Path | Address Type |
---|---|---|
Ledger | m/44'/0'/0'/0/0 | Legacy |
Trezor | m/49'/0'/0'/0/0 | Nested SegWit |
Ledger (SegWit) | m/84'/0'/0'/0/0 | Native SegWit |
Different wallets may use different default derivation paths, so even if the seed phrase is the same, the generated addresses can differ. For example, Ledger defaults to using 84' to generate native SegWit addresses, while Trezor may default to using 49' to generate nested SegWit addresses.
When using hardware wallets, selecting the appropriate derivation path is crucial, especially when switching between different address formats.
Taking Bitcoin as an example, the OneKey hardware wallet and OneKey App support the derivation paths for Legacy, Nested SegWit, Native SegWit, and Taproot, assisting you in your cryptocurrency journey.
Legacy, Nested SegWit, Native SegWit
Taking Bitcoin as an example, Bitcoin addresses come in different formats, each with distinct appearances and functionalities:
Address Type | Prefix | Derivation Path | Description |
---|---|---|---|
Legacy | 1xxx | m/44'/0'/0'/0/0 | This is the original address format for Bitcoin, with higher transaction fees. |
Nested SegWit | 3xxx | m/49'/0'/0'/0/0 | SegWit address nested in P2SH, backward compatible with older Bitcoin wallets. |
Native SegWit | bc1xxx | m/84'/0'/0'/0/0 | A new Bitcoin address format, with lower transaction fees, widely used in modern hardware wallets. |
To be compatible with different formats, BIP (Bitcoin Improvement Proposal) introduces various rules for derivation paths. These different address formats are essentially the result of soft forks. The Bitcoin network introduced SegWit functionality through soft forks, enhancing scalability and transaction efficiency.
Do Forked Addresses Follow the BIP Framework?
The BIP framework used by Bitcoin and many other blockchain projects is aimed at addressing consistency and compatibility issues. Even after a soft fork, newly introduced address formats (such as SegWit) must still operate within the BIP framework to ensure:
- Backward Compatibility: Older wallets can still recognize the new address formats.
- Standardization: Different wallets can generate addresses using the same rules.
In this way, although the address format has changed (for example, from 1xxx to bc1xxx), they still follow the derivation path standards of the BIP framework. This ensures compatibility between new and old wallets and guarantees that different wallets can correctly generate and manage addresses.