April 20, 2024

BIP39 and mnemonic phrase

You are reading this article because you want to do your own research. You don't trust, but check.It is not enough if you are simply told:“Here, write these words down. Don't lose them and don't show them to anyone. Good luck!" We need to understand where these words came from and what they mean. Most importantly, you need to understand how and why these words allow you to own bitcoins in your new wallet.

In this article, you will read the explanations you need. But you don't have to trust her - you can check the information with other sources.

</p>

If you want to use Bitcoin for the first time,you will be told to download the wallet app. After you download the application to your phone, computer or other device, you will see the option "create a new wallet". When you do, you are strongly advised to write down a list of words (12 or 24 depending on the wallet) and not take pictures of them. They will also tell you to keep them in a safe place and that if you lose or forget them, you will lose access to the coins on the newly created wallet.

Your private key in mnemonic form (BIP39)

An example of a 24-word mnemonic phrase. : privacypros.io

In short, these 12 or 24 words are whatit will turn out if you translate from binary code (the language of computers, consisting of zeros and ones) into a language that you can learn, understand and (perhaps most importantly) remember.

Bitcoin is a digital mathematical fortress.It would be strange and difficult if you had to read, copy, or enter the 256 ones and zeros string that makes up your private key to prove ownership of a certain amount of bitcoins. To make things easier and safer for all users, a standard system known as BIP39 has been developed to provide a convenient set of words known as a mnemonic phrase, or seed phrase (both names appear).

Since your private key allowing youspending your bitcoins is an exact, ordered string of 256 bits, those 256 bits must always be in the same order if you want to dispose of your funds.

Healthy:since your mnemonic phrase is made up of words, each of which represents a part of your secret key, you must store these words in the same order and with the same spelling. Otherwise, your secret key will not be recognized as the wallet will not be able to translate your mnemonic phrase back into the correct binary.

This is just a simple and general answer. If you are holding or planning to hold Bitcoins, read on. It is very important for any cryptocurrency user to understand their secret key.

Your wallet is not a bank account

</p>

So far, you have learned only the very basics. If you do not want to know more, then do not buy bitcoins - until you are ready to take responsibility for them.

When you downloaded the app, created a new onewallet and got the mnemonic phrase, you didn't just open a new account for bitcoins like a bank account for dollars. Generally speaking, the name "wallet" introduces some confusion, since in fact your bitcoins are not stored on it at all.

Keep in mind:it is just software that stores your secret key (your mnemonic phrase) and allows you to spend your bitcoins. If you store your mnemonic phrase securely and then drop your phone in the ocean, you can simply buy a new one, download the wallet again, enter your mnemonic phrase and regain access to your bitcoins.

You don't even need to download the same wallet. You can download any wallet that supports BIP39 and enter your mnemonic phrase to access your bitcoins.

Therefore, many people choose to use the Billfodl device to store this set of words on stainless steel plates that are impervious to fire and water.

Are you starting to see the "magic" of Bitcoin? Read on to find out what BIP39 is and how it works.

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

Bipstands for Bitcoin ImprovementProposal – “a proposal to improve Bitcoin.” You can view such proposals on GitHub, but we'll only look at BIP-0039 (usually just called BIP39) here.

Repository for BIP. : privacypros.io

BIP39 describes the steps that need to be takentake to turn the private key into a mnemonic phrase. This proposal has become a standard for wallets and is also used by many other cryptocurrency projects (often known as &#171;shitcoins&#171;).

BIP39 helps users secure theirprivate keys, representing them in the form of a deterministic phrase - ordinary words that are easier to pronounce, write down, and possibly remember. The easiest way to explain how this works is by illustrating how to create your own private key.

How to Create Your Own Bitcoin Private Key

: privacypros.io

The following steps are a general guide on how to generate your own private key. We will consider each step in more detail later in the article.

  1. Let's choose 256 bits (i.e. 256 ones and zeros).Convert our 256 bits from binary to hexadecimal (unless they are already written in hexadecimal. Make sure you have both - you will need both).
  2. We insert the hexadecimal version into the SHA-256 (binary) hash function to get the hash that we will use to create the checksum.
  3. The new hash will be written in hexadecimal code,so we take the first two digits and convert them from hexadecimal to 8 binary digits (bits). Now that we have our last 8 bits, add them to the original 256 bits for a total of 264 bits.
  4. Let's divide our 264 bits into groups of 11. We insert each group of 11 bits (from left to right) into the converter to get regular decimal numbers instead of binary numbers.
  5. Let's find the corresponding words in the BIP39 word list.

Keep in mind:in binary, counting starts at 0. If you are looking at the BIP39 wordlist, notice whether it starts with 1 or 0. If it starts with 1, you will need to add +1 to your binary to decimal conversion to find the list contains the correct matching word.

  1. With the help of Ian Coleman's mnemonic converter, you can check if you did everything right.
  2. So, we created our own private key and turned it into a mnemonic phrase according to the BIP39 standard.

Before you start

If you make a mistake in this process, then,you will most likely get the wrong result. And it's not so hard to make a mistake. Therefore, before you start, create a text document where you will write down the information that will be used in the next steps so that you can double-check if necessary. If you still get the wrong result, read the end tips for what might have gone wrong and why.

Step 1: Selecting Our Beats

: privacypros.io

Choosing the 256 bits you will useto create a mnemonic phrase, ideally you need randomness. Using a downloaded wallet to automatically generate a random mnemonic phrase is probably the best way. However, for educational purposes, we will create our phrase ourselves. To get my 256 bits, I'll put “billfold waterproof fireproof metal” into the SHA-256 hash function, and the result will be my desired random sequence (also often called “entropy”). I am using this online SHA-256 hash generator.

: privacypros.io

Keep in mind that this generator, like almost all others available on the net, only gives a hexadecimal output. If you need a binary hash, see step 2.

Step 2: Hash the selected 256 bits and use the output to create a checksum

To convert hexadecimal tobinary and vice versa you can use this excellent converter. If you originally had binary, use this tool to convert your 256 bits to hexadecimal. In the same way, from the hexadecimal code obtained in the previous step, you can get a binary.

: privacypros.io

Now take the hex output and paste it into this converter to get the output of the SHA-256 binary function.

: privacypros.io

After that, if you scroll down, you will see a list of exits. Find SHA-256. Copy only the first two digits of this output.

: privacypros.io

My hash result starts at 41 - this isentry in hexadecimal code. However, we need a binary code (8 bits), so I quickly went back to the previous conversion tool and entered those first two digits of the hash to find the 8 numbers we wanted: 11000000.

Step 3: Add the first 8 bits of the hash to the original 256 bits to get 264 bits

: privacypros.io

Please note that we want to receivea 24-word mnemonic phrase for more security, so we use 264 bits. However, you can follow the instructions in BIP39 to get 12, 15, 18, or 21 words.

Step 4: Divide our 264 bits into 24 groups of 11 bits

You will end up with something like this:

01100111101
11100010000
11111010011
10011011100
00010100000
10010000111
00011110000
10101011011
10111111010
01000111010
11000011111
11010001011
01010010010
01001011010
01110000001
00100110100
10111010001
11100101111
11001101111
01010101000
10111100110
00001011000
11111101001
10111000000

Step 5: Convert Binary to Decimal

Keep in mind:BIP39 has a list of 2048 words because there are 2048 possible combinations of ones and zeros in a group of 11 bits. They are numbered from 1 to 2048 in the BIP39 help file, but you can find another file where they are numbered from 0 to 2047. Each of your 11-bit groups will correspond to one word from the list.

If the list you find starts with 1, you need to add +1 to each number you get to find the corresponding word. If your list starts at 0, then nothing needs to be done.

But first we need to convert our groups11 bits from the binary system in all of us familiar decimal. If you know binary math, you can do it in your head. Alternatively, you can use the already mentioned conversion tool. Please note that all the numbers you get will be less than 2048.

01100111101 829
11100010000 1808
11111010011 2003
10011011100 1244
00010100000 160
10010000111 1159
00011110000 240
10101011011 1371
10111111010 1530
01000111010 570
11000011111 1567
11010001011 1675
01010010010 658
01001011010 602
01110000001 897
00100110100 308
10111010001 1489
11100101111 1839
11001101111 1647
01010101000 680
10111100110 1510
00001011000 88
11111101001 2025
10111000000 1510

Step 6: Convert Decimal Numbers To BIP39 Words

Now we will find in the BIP39 word list the words corresponding to the obtained numbers and write them in the correct order. Someone on Reddit also made a handy printable version of this list.

Here's what we end up with:

01100111101 829 1.guilt
11100010000 1808 2.tilt
11111010011 2003 3.whip
10011011100 1244 7.oppose
00010100000 160 8.beef
10010000111 1159 9.movie
00011110000 240 13. bulk
10101011011 1371 14.problem
10111111010 1530 15.satisfy
01000111010 570 19. elder
11000011111 1567 20. sentence
11010001011 1675 21. sphere
01010010010 658 4.false
01001011010 602 5. ensure
01110000001 897 6. ice
00100110100 308 10.charge
10111010001 1489 11.riot
11100101111 1839 12. tourist
11001101111 1647 16.social
01010101000 680 17. fence
10111100110 1510 18.rubber
00001011000 88 22. arch
11111101001 2025 23. wood
10111000000 1510 24. rubber

Step 7: Don't Trust - Check

Mnemonic Code Converter by Ian Coleman
: privacypros.io

Use a mnemonic code converterIan Coleman to check if you've created the correct 24-word mnemonic phrase. Enter your 24 words in the "BIP39 Mnemonic" field. If you did everything correctly, you will not see any errors. Scroll down and this tool will show you a lot of information about your mnemonic phrase and your addresses. This tool can also expand your mnemonic phrase by adding an extra word for more security and use with your HD wallet.

A warning:use the offline version of this tool on a computer that is not connected to the network. Use the online version only to test how the above process works. We do not recommend entering the mnemonic phrase that you are going to actually use to store coins on any website.

If the mnemonic converter says your phrase is incorrect

That happens. It's very easy to make a mistake. Here are some tips if this happens:

  • Make sure the checksum is correct. This is the most likely source of error.
  • When creating a checksum, make sureuse the SHA-256 hash generator recommended in the article because it hashes a binary value. If you use a different generator, it can hash the hexadecimal value, and then you will get a completely different result!
  • If the first most likely source of error ischecksum, and the second is hashing, then the third is the correlation of numbers with words from the list. Unfortunately, you will need to double-check if you did it correctly. If you are doing this in order to actually use a Bitcoin address to store money, then you must make sure that everything is correct.
  • And one last tip: if all else fails, start from the very beginning and follow all the steps carefully - they work.

Additional words for more safety

The extra word is similar to a password, but it is not called that so as not to be confused with another password that may be required to enter a Bitcoin wallet.

Such words increase the safety of yourmnemonic phrase, requiring a special additional element that you create to access the bitcoins in your wallet. BIP39 provides a recommended way to generate an extended seed.

This process is also well explained in the book."Mastering Bitcoin" by Andreas Antonopoulos. The BIP39 mnemonic phrase + the word "mnemonic" + an optional user-generated passphrase are entered into the PBKDF2 key stretching function using HMAC-SHA512.

Entering 2048 times goes through the function and outputs 512bits, which is your new seed phrase. This seed has additional security because a potential attacker will need to know your passphrase in addition to the words from your original mnemonic phrase.

With this new seed phrase, hierarchicala deterministic wallet (HD wallet) can generate an almost unlimited number of bitcoin addresses for you. All of these addresses are protected by your secret seed phrase.

So now you know more about your secretmnemonic phrase and its meaning. This was just an example for educational purposes, so you can understand what your wallet does. Better to let the wallet pick a seed phrase randomly. Do not enter your mnemonic phrase on the Internet. Do not save it in a text document on your computer. Don't even take screenshots of her. Do not email it. Do not use the sites listed in this article to generate your keys.

That's all. You created your secret key and turned it into a mnemonic phrase, but most importantly, you understand what your wallet does.

Frequently asked Questions

What does "mnemonic" mean?

Mnemonics, or mnemonics, is a collection ofmethods that help you remember something through words, ideas, or associations. Accordingly, mnemonic means one that helps memorization.

Is a passphrase the same as a password?

The password is usually short and insecure for use as a key in encryption systems. The passphrase resembles a password, but is usually significantly longer for added security.

What is a private key?

A private key is a cryptographic string with which a user can access their cryptocurrency.

</p>
You can always thank the translator for the work done:BTC:3ECjCH5tPoyDCqHGCXfiiiLZQ3tVGzCSxBETH:0xf45a9988c71363b717E48645A412D1eDa0342e7E