Understanding BIP39 and your mnemonic phrases

If you are new to owning Bitcoin, you will need to download a wallet app. And after you download the Bitcoin wallet application to your phone, computer or other device; you will see the option to “create a new wallet”. So you’ll do that and then strictly tell you to write down a list of words (either 12 or 24, depending on your wallet) and don’t paint them. They’ll tell you to keep them, and if you lose or forget them, you won’t be able to access any coins in the wallet you just created.

You are here because you want to conduct your own research (DYOR). “You don’t believe,” “you confirm.” It is not good enough to just be told, “Here, take these words. Don’t lose them. Don’t show it to anyone. Good luck!” and then just to go our own way. You want to understand where they come from and what they mean. Most importantly, you want to know how and why those words allow you to own Bitcoin in your new wallet.

Your mnemonic private key (BIP39)

 

The short answer is that these 12 or 24 words are what you get when you translate binary (the language computers use, consisting of 1 and 0) into a language you can understand, recognize, and (perhaps most importantly) remember.

Bitcoin is a purely digital fortress of mathematics. It would be strange and difficult to have to read, copy or type a string of 256 units and zeros as your private key to claim ownership of a certain amount of bitcoin. To make it easier and safer for all users, a standard security-minded system, known as BIP39 , has been developed to conveniently provide you with a set of words called your mnemonic phrase or mnemonic seed (both names can be used interchangeably).

Because your private key that allows you to spend bitcoin is an accurate, ordered string of 256 bits, you must always keep those 256 bits in the same order if you want to spend.

It’s a simple answer, but it’s just ‘good enough’ as a concept. If you own any bitcoin or plan to own it, keep reading. Understanding your secret key is of great importance to anyone who has bitcoin.

 

Your wallet is not a bank account

 

The above answer is only the first and most basic concept to be understood. If you don’t want to learn anymore, then don’t buy bitcoin – only until you’re ready to be responsible for it.

When you downloaded a Bitcoin wallet, chose to “create a new wallet” and received a mnemonic phrase, you didn’t just create a new account for your bitcoin like you would at your local bank for your dollars. In fact, the name “wallet” is misleading because it doesn’t actually store your bitcoin at all.

You potentially don’t need to retrieve the same wallet. You can download any wallet that supports BIP39 and enter a mnemonic phrase to access your bitcoin using the new software.

Have you already started to see the “magic” of Bitcoin? Keep reading to find out what BIP39 is and how it works.

Bitcoin Improvement Suggestion # 39: What is it and how does it work?

 

The term “Bitcoin Improvement Proposal” is abbreviated to “BIP”. You can browse them and read about them on github here , but for our purposes, we will only look at BIP-0039 (usually referred to simply as BIP39).

BIP39 describes the steps to be taken to convert wallet seed into mnemonic seed and which has become the standard for wallets and has also been adopted for use in a number of other cryptocurrency projects (mainly “ shitcoins ”). It’s important enough to be covered in books that explain the basics of bitcoin (like Mastering Bitcoins , by Andreas Antonopoulos , and Groking Bitcoin , by Kalle Rosenbaum ) in sections that talk about wallets.

BIP39 helps users secure secret keys by presenting the secret key in the form of a deterministic key: simple and common words that are easier to pronounce, write, or possibly remember. The easiest way to explain how it works is to show you how it works. So, we will create our own private key for bitcoin.

The following steps are general guidelines for self-generating a private key. We will go through each step in detail through the rest of this article.

  1. Select 256 bits (that is 256 1 and 0). Convert our 256 bits from binary to hexadecimal (unless already written in hexadecimal. Be sure to have both. You will need both).
  2. Plug the hexadecimal (entropy) into the SHA256 (binary) hash function to get another hash that we will use to create our checksum.
  3. A new hash written in hexadecimal will appear, so we will take the first 2 characters and convert them from hexadecimal to 8 characters (bits) of the binary file. Once we get our final 8 bits, we will add them to our original 256 bits, a total of 264 bits.
  4. Divide our 264 bits into groups of 11. Plug each group of 11 bits (from left to right) into our converter so we look at common numbers (Base10) instead of binary (base2).
  5. Find the corresponding word in the word list BIP39.
  6. When choosing your 256 bits to use to create mnemonics, ideally you want randomness. Using the wallet you downloaded to automatically generate random mnemonic data is probably the best way to do this. However, in the name of education, we will make our own. To get my 256 bits, I’ll type the term “waterproof refractory metal” into the SHA256 hash function and use that 256-bit output as my random case set (often called ‘entropy’). I used this online SHA256 Scatter Generator , Note that you cannot use a binary file as input for this generator. Reads only hexadecimal input. If you need a hash binary, see step 2.

If Mnemonic Converter says your seed is invalid

 

We were all there. It’s easy to screw up. Here are some suggestions if this happens:

  • Check that the checksum is correct. This is the most likely point of error
  • When creating a checksum, make sure you are using the SHA256 hash generator I suggested because the hashing is binary. If you are using another SHA256 generator, hexadecimal, not binary, may be hashed, and this will give you a completely different result!
  • The most likely point of failure is the checksum, the second is scattering, but the third is mapping the numbers in the word from the list. Unfortunately, you’ll have to double-check that you did it right, but if you’re doing this so you can really use a bitcoin address for money, then you need to make sure everything is correct. Do it.
  • The last suggestion, if all else fails, is to start all the steps again from scratch and follow them carefully. They are working.

Add security: Extended words

 

‘Extended word’ is similar to a password, but it is said that the password avoids being different from the other password you may need to open your bitcoin wallet.

The words for extension are also called seed extensions or are Andreas Antonopoulos called “stretching” . They increase the security of your seed mnemonic phrase by requiring another special ingredient created by you to access bitcoin in your wallet. BIP39 explains the recommended way to create seeds from mnemonics.

This process is also well explained in bitcoin mastery. BIP39 mnemonic phrase seeds plus the word “mnemonics” plus an optional password created by the user are entered in the function of stretching the key so-called. PBKDF2 using HMAC-SHA512 . The input makes 2048 rounds through the function and outputs 512 bits, which is your new seed. This seed has extra protection because a potential thief must know your access phrase next to the word in your mnemonic seed phrase.