Post
Topic
Board Development & Technical Discussion
Re: BIP39 Calculate checksum
by
AdolfinWolf
on 16/12/2020, 23:54:54 UTC

You already have 11 words: possible wage deliver gossip first party hair antique salute fuel survey miracle, the 12th word is a combination of 1000110 and a 4 bit checksum. So the last word 10001101011 "miracle" is actually invalid.

Your first 128 bits are 10101000100  11110110001   00111010000  01100100111  01010111011  10100000100  01101000010  00001001111  10111110110  01011101111  11011010101  1000110. This is the 128-bit entropy. It is 0xa89ec4e8327577411a104fbecbbf6ac6 in hex.

Your checksum is first_4_bits(SHA256(entropy)), or for your example:

SHA256(0xa89ec4e8327577411a104fbecbbf6ac6) = 0xfdd211682c17f1af399453a541827c07

We take the first 4 bits of this hex, which is 7 ==> 0111. Then we append this to the entropy to get:

 10101000100  11110110001   00111010000  01100100111  01010111011  10100000100  01101000010  00001001111  10111110110  01011101111  11011010101  10001100111


Nah, don't confuse him, i'm pretty sure the checksum is 1011.