Normally, when we create a Bitcoin wallet, if you have a Hardware Wallet or use Software, it will randomly generate 12 or 24 words for us. Many people often wonder if there's a way for us to choose our own words, because they don't trust the words randomly generated by the Software. The answer is yes, you can choose your own words, but you need to understand the principles because the last word cannot be random; it must be calculated as it is a Checksum. In this content, I will show everyone how to create their own Seed Phrase using coins they have at home.

How Seed Phrases Work

Bitcast

Before we dive into the more complex parts, let's briefly discuss how Seed Phrases work for those who have read the previous article, to refresh their memory on its functionality, and to gain a deeper understanding of this article. If you haven't read it yet, I recommend you read this article first: "What is a Seed Phrase? Why is it important?" The words that a Hardware or Software Wallet randomly generates are merely markers to make it easier for us to remember. If there's an error, we can review what we wrote incorrectly or where, or if some words are lost, it might still be possible to guess them.

From the image, you can see that the words, or Seed Words, are merely markers used to convert into Binary Code in the final step (raw binary code before converting to master seed). The Seed Words are compared to the BIP39 Word List. Once the order is obtained, it is necessary to subtract 1 because the Word List starts from 1, but Binary Code starts from 0. Each word will be converted into an 11-digit Binary Code. Therefore, if there are 24 words, it will be 11*24 = 264. However, Raw Binary Code only uses 256 bits for 24 Seed Words. So, if we take 264-256 = 8, these 8 bits are the Checksum in the last word, which means this word cannot be randomly chosen and must be calculated. Thus, in the last word, which has 11 bits, 3 bits will be used for the raw binary code, and the other 8 bits will be the Checksum. If this is confusing, I recommend watching this video:

What is a Checksum and Why is it Important in a Seed Phrase?

A Checksum is a small block of data derived from another block of digital data for the purpose of detecting errors or data corruption that may have occurred during transmission or storage.

The process that generates this Checksum is called a Checksum Function or Checksum Algorithm, depending on the design goal. A good Checksum typically produces significantly different values, even with minor changes to the input data, especially with hash functions used in Blockchain. It is therefore used to detect errors in wallet creation and to verify the integrity of the Seed Phrase.

Understanding Checksums in Seed Phrases More Deeply

When I first studied this, it was confusing. I had to read it repeatedly and go through it digit by digit because it's Binary Code. Personally, I don't recommend attempting to guess words until you understand how to calculate the Checksum. I suggest you try to calculate it yourself, knowing the result in advance, so you can determine if what you're doing is wrong or new. I recommend using this tool: "Seed Phrase Generation Tool." Then, try copying these 24 words and pasting them. You should get the same result as me.

dial shy about twelve cart giggle news outside snow twice cupboard coil mechanic maid canyon cage treat toss spring remind race protect soldier gospel

I won't teach you how to use it; I recommend watching this video:

Don't forget to select the "Show entropy details" option to see. If you look at the Raw Binary Code, you'll see that the last word only has 3 bits.

Bitcast

Raw Binary (256bits)

 00111101000 11000111100 00000000011 11101011000 00100011000 01100001111 10010101001 10011101100 11001101100 11101011010 00110101110 00101101010 10001010001 10000110000 00100001110 00100000001 11100111110 11100101101 11010011001 10110101110 10110000011 10101100101 11001110100 011

The other eight digits are used as the Checksum.

Binary Checksum

00100110

How to Calculate a Checksum

 From the example Seed Phrase, I want us to assume we don't know what the last word is. Therefore, after randomly selecting 23 words, we only need to randomly select 3 bits for the last word. The method to calculate the Checksum is to concatenate all the Raw Binary values, removing all spaces. It will look something like this, with a total of 256 digits (256 bits).

0011110100011000111100000000000111110101100000100011000011000011111001010100110011101100110011011001110101101000110101110001011010101000101000110000110000001000011100010000000111100111110111001011011101001100110110101110101100000111010110010111001110100011

After that, input it into the SHA256 Checksum command.

 #echo 0011110100011000111100000000000111110101100000100011000011000011111001010100110011101100110011011001110101101000110101110001011010101000101000110000110000001000011100010000000111100111110111001011011101001100110110101110101100000111010110010111001110100011 | shasum -a 256 -0

The result is

 262bc48039658c37ded8139f3c6359f40b1419c182e5ae9f36c075e249b86f58 ^-

The result is in hexadecimal. We need 8 bits, and in hexadecimal, 1 digit consists of 4 bits. In this case, extracting only the first two characters in the Checksum is sufficient for us to verify the correctness of our word set in the future.

2=0010

6=0110

You can try using this tool to convert (Hex to Binary Converter).

Therefore, we now know what the last word is. By combining the 3 bits from the 24th word with the 8 bits we just obtained from the conversion, we get the following:


01100100110

If we convert from Binary to Decimal to look it up in the BIP39 Word List, we get position 806. Don't forget to add 1 since Binary starts from 0. Therefore, the word at position 807 is gospel. If you can do this, you have successfully calculated the Checksum.

For those who are familiar with commands, you can use the following method for hexadecimal to decimal conversion:

#echo "$((2#01100100110))"

=806 

=806+1

=807

= gospel

How We Can Randomly Generate Seed Words Using Coins or Dice

The principle is simple: we just need to randomly generate 256 digits of 0s or 1s. If you can find anything to randomize and set a rule that a certain outcome equals 0 and another equals 1, then it works. In my experiment, I used 11 coins and randomized 24 times, with the last randomization only for 3 bits. The results I obtained are as follows:

Bitcast

I defined heads as 1 and tails as 0. If you're using dice, you might set a rule like 1-3 for low equals 0 and 4-6 for high equals 1. No matter how many coins or dice you have, calculate what you need to get 256 bits. For example, if you have 256 coins, you can randomize all at once.

Calculate Checksum from 256 bits of Raw Binary

After we have randomized, as before, we arrange those numbers together without any spaces. We will get 256 bits of Raw Binary to calculate the Checksum, which looks like this:

 0011111100110100100000101100010011111001101001010100001100101111001011100000101000100100111100110001001100000010001001110100010010000100110010111001111010100011111000110011010000100010110111100111001010001101101011011001001101100100001000000010100110110001

After that, you need to run the command in the Command Line.

#echo 0011111100110100100000101100010011111001101001010100001100101111001011100000101000100100111100110001001100000010001001110100010010000100110010111001111010100011111000110011010000100010110111100111001010001101101011011001001101100100001000000010100110110001 | shasum -a 256 -0

The Checksum result is:

 39d987b42f78626a3020e0a3a0d1354509d14268cf6bad84cddf4233dd8dd664 ^-

Take the first two digits of the Checksum and convert them from base 16 to base 2.

3=0011
9=1001

Combine this with the last three digits in the Raw Binary, and we get the final word like this:

 00100111001

 Take the obtained Binary to find the word in the BIP39 Word List for notation.

No.

Binary Code

Decimal

BIP Index (+1)

Seed Word

1

00111111001

505

506

dish

2

10100100000

1312

1313

piano

3

10110001001

1417

1418

raise

4

11110011010

1946

1947

viable

5

01010100001

673

674

feature

6

10010111100

1212

1213

nurse

7

10111000001

1473

1474

return

8

01000100100

548

549

duty

9

11110011000

1944

1945

vessel

10

10011000000

1216

1217

object

11

10001001110

1182

1183

mean

12

10001001000

1096

1097

math

13

01001100101

613

614

erosion

14

11001111010

1658

1659

soon

15

10001111100

1148

1149

moon

16

01100110100

820

821

grief

17

00100010110

278

279

carpet

18

11110011100

1948

1949

vicious

19

10100011011

1307

1308

pet

20

01011011001

729

730

forest

21

00110110010

434

435

curve

22

00010000000

128

129

avoid

23

10100110110

1334

1335

plug

24

00100111001

313

314

cheese

My 24-word Seed Phrase, randomized with coin flips, is as follows:

 dish piano raise viable feature nurse return duty vessel  object mean math erosion soon moon grief carpet vicious pet forest curve avoid plug cheese

Summary of Self-Randomizing a Seed Phrase

If we randomize the Seed Phrase incorrectly, the wallet will not allow us to import it. It will verify it first, and we also have tools to check it. We can use this tool to check. If the calculation is wrong, it will state that the Seed Phrase is incorrect. I recommend downloading the software to your machine and turning off the internet while doing it.

Another thing to be careful about is running commands in the Shell. It will keep a history, so don't forget to clear the history with the command:


#rm ~/.bash_history
 

For me, on Mac, it's zsh.

#rm ~/.zsh_history

Self-randomization also carries the risk of repetition. Be very careful about this. The method is to select 23 words, and for the 24th word, only randomize 3 bits, then calculate the checksum. Upon reflection, creating it via a hardware wallet might be easier or safer. This is because if we don't randomize truly randomly and instead choose words that are easy to remember when arranged, there might be a risk of repetition. I recommend randomizing by truly "flipping" (or randomizing), not by choosing words ourselves. I hope this article helps you understand Seed Phrases better. If you're still confused, you can watch this video to see how to randomize seed words yourself:

Leave a comment

Please note, comments need to be approved before they are published.

This site is protected by hCaptcha and the hCaptcha Privacy Policy and Terms of Service apply.