Among all Bitcoin improvement proposals, BIP39 stands out as one of the most famous and important, mainly because we use it daily when configuring our Bitcoin wallets.
Although its formal title is “Mnemonic code for generating deterministic keys”, it is better known as BIP39, and that is what we will call it in this article.
This innovation helps users protect their private keys and recover their wallets seamlessly from other compatible wallets.
In this article, we will understand what BIP39 is, how it came about, how it works, and its main characteristics.
What is BIP39?
BIP39 is an established standard for generating a mnemonic ‘seed’ – a series of words – that serves as a backup for recovering Bitcoin wallets.
Thus, BIP39 is an improvement to Bitcoin that made life easier for Bitcoiners when it comes to storing private keys, known as a backup phrase.
From this implementation onwards, wallet private keys began to be presented in the form of a deterministic key: simple, common words that can be more easily spoken, written, or, possibly, memorized.
Therefore, it was BIP39 that introduced the set of 12, 18, or 24 words that appear when setting up a non-custodial wallet, which we are instructed to write down in the order in which they appear and keep in a safe place.
How did BIP39 come about?
BIP39 was created in 2013, by developers Marek Palatinus, Pavol Rusnak, Aaron Voisine, and Sean Bowe, due to the challenges and limitations that users faced when storing and managing their private keys, given that traditional private keys are composed of long alphanumeric sequences, full of numbers and letters, obtained through binary number — the language used by computers, which consists of 1s and 0s.
These keys are in a language that is difficult for us human beings to understand, recognize, and remember; therefore, they can be easily lost.
In the image below, we can better understand how the sequence of 0s and 1s is “translated” into words, using BIP39.
Now, imagine how difficult it would be if you had to read, copy, or type a sequence of 256 ones and zeros as your private key to prove ownership of your Bitcoin!
In addition to the possibility of error, it would be a barrier for those who are not used to technological language.
Therefore, BIP39’s main innovation was to bring an easier, safer, and more convenient way to generate and write down private keys, using mnemonic phrases.
The mnemonic phrases help the user to easily access and retrieve their wallets if necessary. This is because today several wallet manufacturers support BIP39, which not only facilitates configuration but also facilitates migration from one wallet to another.
What are mnemonic phrases?
Mnemonic phrases, also known as backup phrases and seeds, are a set of words, usually in English, that serve as your wallet’s private key.
Every Bitcoin wallet has two types of keys:
- public
- and private.
Both are very large alphanumeric sets.
Thus, to facilitate the storage and management of keys, with BIP39, mnemonic phrases emerged, which represent private keys in a more ‘readable’ way.
Therefore, when creating your Bitcoin wallet, you can generate a set of 12, 18, or 24 words, which act as a crucial mechanism for backing up and recovering your wallet.
Your private key is a specific series of 256 bits, so you must always keep these bits in the same order to access the funds in your wallet. Therefore, mnemonic words should always be written down in the exact order in which they were presented.
That is, if you change the order of these words, your private key will not be recognized because the wallet will not be able to revert your phrase to the correct sequence of bits.
BIP39 words come from a predefined dictionary with 2048 words. They are selected in a particular sequence based on randomness, ensuring that each phrase is unique and very secure.
Some people have even turned the 2048 words of BIP39 into a poster to make it easier to view.
*If you want, you can access all BIP39 words on GitHub.
The main functions of a mnemonic phrase (seed)
Backup and recovery
Mnemonic phrases serve as a safe method for recovering your digital wallet.
Therefore, in situations where your wallet is lost, stolen, or damaged, you can use mnemonic phrases to access your digital assets on a new device. This is possible because the phrase contains all the information needed to completely restore your wallet and your balance.
Wallet migration
In the same way, as mentioned above, mnemonic phrases allow you to easily migrate your wallet to different devices.
When setting up a wallet on a new device, entering the correct mnemonic phrase will restore access to your digital assets while keeping all information intact. This is particularly useful for users who change phones or computers frequently, or who want to keep multiple copies of their wallets for security reasons.
Ease for humans
Unlike traditional private keys, which are long, complex alphanumeric sequences that are virtually impossible to memorize, mnemonic phrases are made up of common words. This not only makes them easier to write down and store safely but also allows, in some cases, users to memorize their mnemonic phrase.
However, it is still vital to maintain the correct order of the words and understand that any error can prevent access to the wallet.
Features of BIP39
BIP39 introduced several important features to enhance usability and security for users. This update incorporated an error-checking system into the key generation process, preventing users from making mistakes when transcribing the phrase and losing their wallets.
Furthermore, BIP39 supports words in other languages, such as Portuguese, allowing users to create a mnemonic phrase (seed) in their native language.
Finally, the main feature of this BIP was to transform alphanumeric private keys into words, as we saw earlier in this article.
In addition, other characteristics of BIP39 words include:
- Smart Word Selection: The word list is specially designed for easy identification. In most cases, you only need to type the first 4 letters of a word to recognize it without confusion. This simplifies the process of finding and remembering the correct words.
- Similar words avoided: To reduce errors and confusion, very similar words are not used together. For example, pairs like “build” and “billed,” “woman” and “women,” or “fast” and “fasted” are avoided. This makes it easier to remember your unique phrase without getting confused by similar words, increasing security and reducing the chance of mistakes when typing or writing down your phrase.
How to use a BIP39 tool or a Bitcoin mnemonic generator
There are a few ways to generate a Bitcoin mnemonic: you can use data, let a wallet do it for you, or use a tool called Ian Coleman.
In this step-by-step guide, we will show you how to use a mnemonic generator from the Ian Coleman website, which is a well-known password generator used mainly for testing purposes, to understand and visualize how Bitcoin keys and Bitcoin addresses are generated.
Step 1
Go to iancoleman.io and select the number of words in your mnemonic. Generally, 12, 18, or 24 words are used.
Step 2
After selecting the number of words, you can choose the mnemonic language you prefer. Here, we will demonstrate it in English, as it is commonly used by wallets.
After making this selection, click on ‘GENERATE’.
Note: Ensure you have selected ‘Bitcoin’ in the Coin section.
And there you have it! Your BIP39 mnemonic is generated!
It is easy, isn’t it?!
Now, as you scroll down the page, you will find the addresses, along with the public and private keys generated.
Although this tool is incredibly cool for tinkering and exploring, we do not recommend using the seed generated online by this site, as your words could be exposed to leaks.
Therefore, it’s unnecessary to take this risk, as most Bitcoin wallets generate the seed safely for you.
“Oh, but I can use this tool offline!”
Yes, you can. However, we only recommend this function for advanced users who possess the technical knowledge to do so safely.
What is the chance of someone guessing my seed?
The chance of someone guessing your seed is astronomically small, making it virtually impossible due to the high level of entropy and the vast number of possible combinations.
As we’ve seen, BIP39 uses entropy (randomness) to generate words from a dictionary of 2048 words.
A seed can be generated with 12, 18, or 24 words, corresponding to 128, 192, or 256 bits of entropy, respectively. In short, the longer the sentence, the greater the entropy and, therefore, the more difficult it will be for someone to guess the words.
In BIP39, each word corresponds to a binary number (0 or 1). Therefore, each of the 2048 words represents a decimal number (from 0 to 2047) in binary form.
For example, the binary number 11111011000 can be converted to the decimal 2008. Thus, the 2008th word in the BIP39 list is “WILD.”
With 12 words, the seed represents 12 binary sequences (of 0s and 1s). Each sequence contains eleven bits, thus providing 11 bits of entropy per word. Mathematically, considering 12 words out of the 2048 possible, we would have 2048^12 distinct combinations. This is equivalent to 2^132, since 11 bits per word multiplied by 12 words gives 132 bits.
However, a part of the mnemonic phrase is not random and can be derived from the other words, resulting in 128 bits of entropy instead of 132. This gives 2^128 possible combinations.
For comparison, the number of atoms on Earth is estimated to be about 2^166. Considering this math, the chance of someone being able to guess your mnemonic is, at the very least, astronomically small.
So rest assured! It’s easier to find a needle in a haystack than for someone to guess your seed.
How can I further protect my seed?
Although they are highly secure and it is difficult for someone to simply guess your seed, it’s important to take certain precautions to ensure your wallet is not vulnerable to attacks.
Here are 5 tips that can help you further protect your seed:
- Avoid storing your seed electronically, such as in notes on your cell phone or in a folder on your computer. This could expose you to theft, hacking, or data loss.
- Refrain from writing it down on materials that are not durable, such as paper or materials that can corrode. This will prevent degradation over time. A safer option is to engrave it on a metal wallet.
- Create additional copies of your seed and store them in different locations to ensure you always have a backup. However, be extremely cautious. Creating more copies of the same seed also increases the chances of someone finding one of those copies.
- Keep the seed in a secure and non-obvious place, making it difficult for someone who enters your home to easily find these words.
- For added security, consider using multisig addresses, which require more than one seed or private key to move funds. Even if someone finds one of your seeds, they won’t be able to steal your funds.
Conclusion
To conclude, there is no perfectly secure method for storing your seeds. All methods require personal responsibility and entail choosing the mechanism with which you feel most comfortable.
I hope this article has provided insight into the critical role of BIP39 for users and its significance in the development of Bitcoin, particularly in terms of usability.
Thanks to BIP39, we can easily store the private keys for our Bitcoin wallets and recover balances in other wallets.
This enhancement is extremely important and was swiftly adopted by the majority of the market. As a result, leading wallets such as Jade, Trezor, Ledger, Blue Wallet, BitBox, and many others now support BIP39.
Be sure to share this article with a friend, and see you next time!
Share on your social networks:
One of the leading Bitcoin educators in Brazil and the founder of Area Bitcoin, one of the largest Bitcoin schools in the world. She has participated in Bitcoin and Lightning developer seminars by Chaincode (NY) and is a regular speaker at Bitcoin conferences around the world, including Adopting Bitcoin, Satsconf, Bitcoin Atlantis, Surfin Bitcoin, and more.
Enjoyed this article? Donate some sats so we can grab a cup of coffee and keep writing. ☕