Derivation Paths & My Solflare Wallet
Digital wallets introduce many new concepts such as public & private keys, keystore files, mnemonics, and self-custody. It can be intimidating to newcomers who only hear about the risks of losing access to these wallets or sending funds to the wrong address.
While those risks are real, the benefits of non-custodial digital wallets like Solflare greatly outweigh them. For a refresher on how Non-custodial wallets benefit society, be sure to check out this article. One of the most important features of the Solflare wallet is its derivation path structure.
Derivation paths enable users to generate and access as many accounts as they wish to have, all while using a single mnemonic phrase. To begin explaining how this works, let’s review all the ways you can access a non-custodial wallet.
Ways to Access Non-Custodial Wallets
There are three main ways to access your non-custodial wallet:
· Private key
· Keystore file (a password-protected private key)
· Mnemonic phrase (a sequence of words that can access multiple private keys)
Besides having different security features, there is a primary distinction between these ways to access a wallet. A Private key or a keystore file only generates one account. Creating a mnemonic phrase, however, grants you access to many accounts, all of which may be accessed using the same phrase.
What Is a Mnemonic Phrase?
A Mnemonic Phrase, which is also known as a seed phrase or secret recovery phrase, is a variation of a private key and works slightly similar to it. A seed phrase is composed of a set of words that usually varies from 12 to 24 words, each separated by a space. Mnemonic Phrases more or less look like this:
magician crumble practice give trust close laugher whole path late fire least
These phrases may be used to generate a theoretically limitless number of accounts. Mnemonic Phrases are often used in conjunction with hardware wallets and should be written down by the user on a piece of paper to safely back up their digital assets as wallets cannot be recovered without them.
How Does a Mnemonic Phrase Create More than One Address?
A mnemonic phrase produces addresses by combining its sequence of words with a piece of information known as a derivation path. Together, they generate an unlimited number of accounts using cryptography. But what is a derivation path anyway?
- A derivation path looks like this: m/44’/501’/0’/0’/0
- This formula equates to the following:
- m’ / purpose’ / coin_type’ / account’ / change / address_index
Each number in the sequence has a role to perform, and each one alters the private key, public key, and address. This means that in this sequence, each section is separated by a / and has a different meaning that changes based on what you’re working with.
This quickly becomes complex, but the key takeaway is that if you want the next address from a phrase, simply add one to the previous address_index number:
Address #1: m/44’/501’/0’/0’/0
Address #2: m/44’/501’/0’/0’/1
Address #3: m/44’/501’/0’/0’/2
Address #99: m/44’/501’/0’/0’/98
In programming, you begin counting at 0…1…2…3… rather than 1…2….3…. This is different from how we count in our daily lives, which can be confusing at times.
The result of this derivation path structure is that one mnemonic phrase will give you access to as many accounts as you wish to have. By using the derivation path, you are able to obtain all your accounts from a single mnemonic phrase.
The Bottom Line
With Solflare, you don’t necessarily need to understand how the derivation paths work; you simply need to understand how to use the wallet interface. For the user, this will consist of clicking on Add a new account and following a few simple prompts. The numbers and the anatomy of these derivation paths will still be visible if you are interested in looking into them in more detail.
Although you don’t need to know everything that happens on the backend of your Solflare wallet, it is interesting to know the structure in order to actually understand how a single mnemonic phrase allows you to have more than one wallet.