<p>The checksum is expressed in Hex, so I believe the first character '3' represents the first four bits of the checksum string? If so, this is 0b0011. Word "about" is actually index '3' because the word list is 0-indexed (hence all zeroes maps to "abandon").</p>

CC BY-SA 4.0
2018-06-21T04:28:36.277Z
2018-06-21T04:28:36.277Z
Aaron
<p>You are using the wrong byte-order. In big-endian the hash is <code>0b0011011101000111000010001111111111110111011100011001110111010101100101111001111011001000011101011101010101101100110100100010100001101111011011010011110011110111111011000011000101111010001110110010010101100011001010101010101100101000111011000011011110111011</code> so the first four bits are <code>0b0011</code> = <code>3</code> = <code>about</code></p>

<p>You can find a python implementation of the mnemonic validation <a href="https://github.com/mcdallas/cryptotools/blob/master/btctools/HD/__init__.py#L27" rel="nofollow noreferrer">here</a></p>

CC BY-SA 4.0
2018-06-21T08:49:04.843Z
2018-06-21T08:49:04.843Z
Mike D
<p>I am trying to generated the checksum for the mnemonics (BIP39) but can't get the correct value.</p>

<p>I used 3 resources </p>

<ul>
<li>This explains the mnemonic generation <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#Generating_the_mnemonic" rel="nofollow noreferrer">https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#Generating_the_mnemonic</a></li>
<li>This contains test vectors
<a href="https://github.com/trezor/python-mnemonic/blob/master/vectors.json" rel="nofollow noreferrer">https://github.com/trezor/python-mnemonic/blob/master/vectors.json</a></li>
<li>This is the word list 
<a href="https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt" rel="nofollow noreferrer">https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt</a></li>
</ul>

<p>I can't get the first test vector to work out.</p>

<p>I SHA256 0x00000000000000000000000000000000 into 374708fff7719dd5979ec875d56cd2286f6d3cf7ec317a3b25632aab28ec37bb</p>

<p>The first four bits, which are the checksum bits, are 0b1101</p>

<p>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".</p>

<p>I get the wrong word for every test vector. Probably a silly mistake. Thanks.</p>

<mnemonic-seed>
Checksum generation for seed
Paul
# Checksum generation for seed

(Asked by: username_0 on 2018-05-13)

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.

**Tags:** mnemonic-seed


---

## 2 answers

### Answer by username_1 on 2018-06-21. Score: 1

The checksum is expressed in Hex, so I believe the first character '3' represents the first four bits of the checksum string? If so, this is 0b0011. Word "about" is actually index '3' because the word list is 0-indexed (hence all zeroes maps to "abandon").


---

### Answer by username_2 on 2018-06-21. Score: 0

You are using the wrong byte-order. In big-endian the hash is `0b0011011101000111000010001111111111110111011100011001110111010101100101111001111011001000011101011101010101101100110100100010100001101111011011010011110011110111111011000011000101111010001110110010010101100011001010101010101100101000111011000011011110111011` so the first four bits are `0b0011` = `3` = `about`

You can find a python implementation of the mnemonic validation [here](https://github.com/mcdallas/cryptotools/blob/master/btctools/HD/__init__.py#L27)


---

