In this article we will be covering what is a seed phrase, why it is important and what worth to know about it. Seed phrase is one of the most important things to know, remember and always keep it safe to secure our wallet.
So seed phrases and wallets are somehow connected? Yes, in order to understand everything we will going back in time and we will review the evolution of the crypto wallets in order to understand the seed phrase.
The first cryptocurrency was Bitcoin, so it’s logical the first wallet was a Bitcoin wallet. Today hard to imagine, but back in 2009 only one wallet existed. The first wallet was the Satoshi client, made by Bitcoin’s founder and developer the unknown person we calling Satoshi Nakamoto. Later that wallet got graphical user interface, and it got integrated to Bitcoin’s core. This wallet was a node also and downloaded all the transaction history, what wasn’t big of an issue back then because the blockchain’s size was small. Back then the private key, public key is stored in wallet.dat file on the hard disk and this file is protected by a password (passphrase).
We introduced three terms already so have to explain it deeper. Public key and private key is came from cryptography. In short public key is safely shareable information, and with public key and a specific algorithm someone can encrypt a message what can be only unlocked with the private key which must be secured and as the name suggests have to keep it private. With the wallet, everything is come in private key – public key pair. The public key was the wallet address, but because it’s so long, later a shortened form of public key became the wallet address. So if we want to receive crypto to that wallet, we have to give the wallet address and everyone can find our wallet on the blockchain if they want to see it. However, the private key is the secured part, that never leaving our device, we are using just to sign transactions. We should never ever give out this private key to anyone, because who is having the private key owning the wallet and controlling it’s funds. After we set up our wallet, the wallet or websites never asking for the private key for any legitimate reasons, only time we need the private key again if we are uninstalling the wallet or installing on new device then we must enter again to access our wallet. So it’s important to have it, store securely and never forget to keep our funds, but in day to day practice we aren’t going to use it. The transaction signing happening with a click of a button and the wallets automatically signing, approving the transactions internally without our private key exposed. But since the public key comes in pair with the private key the outside world still knows that we own that wallet and signed with it’s private key, without revealing the actual private key to them. It’s working based on mathematical algorithms and this post’s scope isn’t to go into that any deeper.
Passphrase was very important back then because the wallet.dat could be stole from the machine and because of this it had to be encrypted. The early days this file was a simple text file and basically anyone got access to it can take over the wallet, thats why passphrase got introduced.The passphrase was the password which can unlock the wallet.dat file for the program and then it can access the public – private keypair. Without the passphrase the wallet.dat was just an unusable encrypted data.
Today more phylosophy of wallets are available, most of the cases the passphrase isn’t the most important thing anymore (still the best to remember, because forgetting things can be quickly very expensive in crypto!). Lately, we are relying on private keys and from that the public key, wallet address is figured out by the wallet itself. Even if we have passphrases still, if we forget them we can’t unlock our wallet but not a problem cause in the worst case we can re-import our wallet by it’s private key and give a new passphrase. So passphrases have the same reason to exist, to protect our locally saved details, but we don’t have to save any file anymore in order to keep access for the wallet. (Some wallets still generating files, but basically the same private key is saved in them insecurely so not so recommended to store our private key like this.)
I know it is taking long, but I promise just one more step and we will arrive at seed phrases. Okay so we have a keypair which represents our wallet everything is nice, until we want more wallets. Then every individual wallet going to have it’s own private key what we must remember. Some people who really was considered about privacy wanted to use the new wallet for every transaction. That soon made very chaotic to remember all the private keys so the developers in the Bitcoin Improvement Proposals (further, we will be referring as BIP) figured out how to solve this. Also, a private key isn’t something what can be remembered easily. On the hardware level the private key is 256 numbers (0s and 1s, that represents 256 bit) after each other. On developer level usually represented as byte array (1 byte = 8 bit so 256/8 = 32 bytes) or hexadecimal version (a way of computers understands large numbers, combination of numbers and letters). On the user level this came as 64 seemingly random letters and numbers. (each byte represented as hexadecimal 2 characters so 2 * 32 = 64 characters at the total) This practice wasn’t user friendly, now we can understand the reason why, and developers had to figure out something much more simple. They solved both of the problem with the BIP 32, 39 and 44 standards what introduced the seed phrases.
The seed phrase is usually a 12 or 24 word “sentence” what not making much sense for us, but it’s telling everything to our wallet. This 12 or 24 words even if not a meaningful text much easier to remember for the advantages and we are not stopping here. It’s called seed for a reason, as a planted seed can grow a tree with many branches, a seed phrase can generate many-many unique keypair which means we can have virtually unlimited amount of wallet from the same seed phrase. And we don’t have to remember each and every private key anymore, we just have to know the seed phrase and every wallet comes after each other on the hierarchy we can unlock with it. And if this wouldn’t be enough seed phrases so great it used as standard so we can use the same seed phrase between most of the blockchains! Before Bitcoin and Ethereum private keys wasn’t compatible with each other. With seed phrases everything changed, and HD wallets became the new standard. HD, in this case, have nothing to do with high definition, it’s the hierarchical deterministic wallet, what referring for that tree structure I was mentioned. What I told before about private key’s storing practices, also valid for seed phrase, because with the HD wallets this seed phrase is everything for us. So the best way if we are storing on paper where only we can access, never in the phone, or text, or image.
I hope I got everyone excited about seed phrases so let’s look under the hood for deeper understanding! BIP 39 introduced the wordlist with the mnemonic words and the method how the algorithm can choose randomly. The word list contains 2048 words and we getting 12 or 24 for our mnemonic sentence (seed phrase). However, it sounds like a fun idea to read the word list and choose 12 or 24 words you like, but this is a very bad idea for more reasons. First of all, not every combination of words is a valid seed phrase, there is a chance after choosing 12 or 24 words that you get an invalid combination and when you are trying to import to the wallet you getting an error message only. Even if you got a combination which passing still not good idea to use those wallets because humans are terrible of randomly choosing words. Even we are thinking we are very very random and unpredictable we are not so, and this leads for weaker combination and security risks. The correct methods using the standard, have entropy and true randomness while choosing our seed phrase. Always using a trustable wallet for making a new mnemonic sentence! Fun fact that mnemonic words are available for more languages, because only the position of the word matters on that 2048 list, and not the actual meaning, however the standard is the english one which used by most people.
Between BIP 32 and BIP 44 the only difference is the BIP 32 introduced the HD wallets and BIP 44 extended this for multi-account hierarchy where every account can have multiple wallets so if we are using the tree example the BIP 44 tree’s branches are much more dense.
How we are getting the same wallet’s keypairs, from the seed phrase? First of all the mnemonic words are converted to a seed (it’s not a phrase anymore!) under the hood, that is a 64 byte long, so if we would need to remember it would be 128 long in hexadecimal format numbers and letters combined. From the seed what is the base a new master extended private key is made which is 64 byte also and the first 32 is the private key, the last 32 contains the chain data, like Ethereum or Bitcoin we are using for. From this extended key the new child private keys can be created and from those the public keys too so we are getting a keypair for the wallet.
Thankfully we will never be seeing anything from this on the surface, for us it will be a click of a button, but its interesting to know. Another important thing which guiding the above process is something called a derivation path. That is for making sure we are arriving always the same path from the same seed. Usually, it’s set automatically, but some blockchains used multiple derivation paths in the past and both wallet format is still valid so the wallets are supporting and letting us choose what we want. The actual wallet address can look very different even if the derivation path just changed slightly.
A derivation path looks like this m/44’/60’/0’/0’/1. This is the standard derivation path of Ethereum. The m stands for master. The 44 indicates the BIP 44 standard. BIP 32 had no number in that position but that is deprecated so we should find a number there. The 60 is the coin type in this example 60 indicates Ethereum. Every coin can choose a not taken number, and wallets know which chain to derive the wallets for. After the 0 indicates the first account, telling the depth of hierarchy, because every account can have many wallets. The another 0 represent the first change, which introduced because of Bitcoin, which don’t really have accounts, and when sending BTC and have some unused change that have to return to somewhere and 0 means to return the same wallet which sent. The 1 stands for the wallet index it’s the second wallet. In programming counting starts from 0 so thats why the 1 indicates the second address actually. If we are creating 100 wallets for the first account, the 100th wallet’s derivation path will be: m/44’/60’/0’/0’/99. Every time our wallet wants to derive the 100th account will using this path and deriving from the seed so always giving us back our 100th wallet. For example if we want to separate for our company purpose, we can derive the second account’s first wallet like this: m/44’/60’/1’/0’/0. Only one thing left to explain, the ‘ actually stands for “hardened” number, sometimes it indicated by h also. Hardened is the default today and it introduced because it made the keypair derivation from the seed more secure.
I hope after this post you can understand the seed phrase and even much more about the wallets inner mechanics. Don’t worry you don’t have to keep all this in mind, usually wallets have user friendly interfaces. Even then, all this knowledge can come handy in case of troubleshooting. For example what if you are creating a wallet address in one program and want to change and importing the seed phrase to another wallet software but our public wallet address is totally different what can we do? All our funds lost? No, it’s not, now you won’t panic because you already know most likely one program using one derivation path, and the other program is using a different derivation path so have to make sure our new wallet using the same path as the first so it will derive us our old wallets. This is the power of the seed phrase.