I am trying to generated the checksum for the mnemonics (BIP39) but can't get the correct value.
I used 3 resources
- This explains the mnemonic generation https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#Generating_the_mnemonic
- This contains test vectors https://github.com/trezor/python-mnemonic/blob/master/vectors.json
- This is the word list https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt
I can't get the first test vector to work out.
I SHA256 0x00000000000000000000000000000000 into 374708fff7719dd5979ec875d56cd2286f6d3cf7ec317a3b25632aab28ec37bb
The first four bits, which are the checksum bits, are 0b1101
That makes the last 11 bits of seed + checksum 0b00000001101, the last word of the mnemonic. Corresponds to 13 or index 12 "accident". However in the test vector it's index 4 "about".
I get the wrong word for every test vector. Probably a silly mistake. Thanks.