I write educational content about Bitcoin.
- First, it allows you to better understand the mechanisms at the base of your Bitcoin wallet;
- Secondly, it enables you to know how to do it. I'm not saying it will be useful one day, but it might!
What is a mnemonic phrase?
Preparation of the necessary materials
- A sheet of paper;
- A pen or pencil, ideally of different colors to facilitate organization;
- Several dice, to minimize the risks of bias related to an unbalanced die;
- The list of 2048 BIP39 words printed out.
A Few Reminders on the Recovery Phrase
| Phrase (words) | Entropy (bits) | Checksum (bits) | Entropy + Checksum (bits) |
| 12 | 128 | 4 | 132 |
| 15 | 160 | 5 | 165 |
| 18 | 192 | 6 | 198 |
| 21 | 224 | 7 | 231 |
| 24 | 256 | 8 | 264 |
0s or 1s. This represents a number composed of 128 digits in base 2 (binary).
Based on this entropy, a checksum will be generated. A checksum is a value calculated from a set of data, used to verify the integrity and validity of that data during its transmission or storage. Checksum algorithms are designed to detect accidental errors or alterations in the data.
In the case of our mnemonic phrase, the function of the checksum is to spot any input errors when entering the phrase into a wallet software. An invalid checksum signals the presence of an error in the phrase. Conversely, a valid checksum indicates that the phrase is most likely correct.N bits will be retained, N depending on the desired length of the recovery phrase (see the table above). Thus, for a 12-word phrase, the first 4 bits of the hash will be kept.
These first 4 bits, forming the checksum, will then be added to the original entropy. At this stage, the recovery phrase is practically constituted, but it is still in binary form. To convert this binary sequence into words in accordance with the BIP39 standard, we will first divide the sequence into 11-bit segments.
Each of these packets represents a number in binary which will then be converted into a decimal number (base 10). We will add 1 to each number, because in computing, counting starts from 0, but the BIP39 list is numbered starting from 1.Step 1: Generating the Entropy
0s and 1s in a row. To do this, we will use dice.
0 to each roll that lands on an even number, and 1 for each odd number. As a result, we will perform 128 rolls to create our 128-bit entropy. If the die shows 2, 4, or 6, we will write down 0; for 1, 3, or 5, it will be 1. Each result will be noted sequentially, from left to right and top to bottom.Step 2: Calculating the checksum
Start Tails.Applications tab.Utilities menu.Terminal application.echo command, followed by your previously generated entropy, making sure to insert a space between echo and your binary digit sequence.
|):| shasum -a 256 -0
echo 11010111000110111011000011000010011000100111000001000000001001011011001010111111001010011111110001010100000101110010010011011010 | shasum -a 256 -0
echois used to send the bit sequence;|, the pipe, is used to direct the output of theechocommand to the input of the next command;shasuminitiates a hashing function belonging to the SHA (Secure Hash Algorithm) family;-aspecifies the choice of a specific hashing algorithm;256indicates that the SHA256 algorithm is used;-0allows the input to be interpreted as a binary number.
Enter key to execute the command. The terminal will then display the SHA256 hash of your entropy.a27abf1aff70311917a59a43ce86fa45a62723a00dd2f9d3d059aeac9b4b13d8
a. Carefully note this character somewhere on your sheet, then turn off your computer.| Decimal (base 10) | Hexadecimal (base 16) | Binary (base 2) |
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| 10 | a | 1010 |
| 11 | b | 1011 |
| 12 | c | 1100 |
| 13 | d | 1101 |
| 14 | e | 1110 |
| 15 | f | 1111 |
a corresponds to the binary number 1010. These 4 bits form the checksum of our recovery phrase. You can now add them to the entropy already noted on your sheet of paper, placing them at the end of the last word.Step 3: Converting Words into Decimal
0 or 1. To proceed with a conversion to decimal, assign to each first digit the value 1024 if it is 1, otherwise 0. For the second digit, the value 512 will be assigned if it is 1, otherwise 0, and so on until the eleventh digit. The correspondences are as follows:- 1st bit:
1024; - 2nd bit:
512; - 3rd bit:
256; - 4th bit:
128; - 5th bit:
64; - 6th bit:
32; - 7th bit:
16; - 8th bit:
8; - 9th bit:
4; - 10th bit:
2; - 11th bit:
1.
1 to obtain the decimal number equivalent of the binary number. Let's take the example of a binary line equal to:1010 1101 101
1389
1, report the associated number below. For each bit equal to 0, report nothing.1s to get the decimal number representing each binary line. For example, here's what it looks like for my sheet:
Step 4: Searching for the Words of the Mnemonic Phrase
1 to 2048. But, our calculated binary results range from 0 to 2047. Therefore, there is a one-unit shift that needs to be corrected. To correct this shift, simply add 1 to the twelve previously calculated decimal numbers.1721. strike
Step 5: Creating the Bitcoin Wallet
Invalid Checksum, it means that an error has crept into your creation process. Generally, this error stems either from a miscalculation during the manual conversions and additions, or from a typo when entering your entropy in the terminal on Tails. It will be necessary to restart the process from the beginning to correct these errors.Specific Case of the Dice Roll Option on Coldcards
0) or odd (1). Therefore, the entropy generated by each roll is equal to log2(2). In the case of Coldcard, which takes into account the six possible faces of the dice (from 1 to 6), the entropy per roll is equal to log2(6). This is why in our tutorial, we need to perform more rolls to achieve the same level of entropy.Entropy = number of rolls * log2(number of possible outcomes on the dice) Coldcard : Entropy = 99 * log2(6) Entropy = 255.91 Our tutorial : Entropy = 128 * log2(2) Entropy = 128
Author
This tutorial has been written by Loïc Morel
You can say thanks by tipping the professor.
Credits
This tutorial has not been proofread yet
The original content has been translated by AI, but human review is necessary to ensure its accuracy.
5 035 sats2 518 sats1 259 satsEvery content on the platform is the result of a collaborative effort: each lesson, translation, and revision is made possible by the work of contributors. For this reason, we are always looking for proofreaders who can review our content in many languages. If you want to participate in the proofreading process, please reach out in our Telegram group and read our tutorial. We remind you that this content is open-source - licensed under CC BY-SA - so it can be freely shared and used, as long as the original source is credited.
