<p>Those are valid mnemonics with valid checksums. In  the bip39 spec is the following: </p>

<blockquote>
  <p>The following table describes the relation between the initial entropy length (ENT), the checksum length (CS) and the length of the generated mnemonic sentence (MS) in words.</p>
  
  <p>CS = ENT / 32</p>
  
  <p>MS = (ENT + CS) / 11</p>
</blockquote>

<p><code>|  ENT  | CS | ENT+CS |  MS  |
+-------+----+--------+------+
|  128  |  4 |   132  |  12  |
|  160  |  5 |   165  |  15  |
|  192  |  6 |   198  |  18  |
|  224  |  7 |   231  |  21  |
|  256  |  8 |   264  |  24  |</code></p>

<p>As per the top row, 12 word mnemonics have 128 bits of entropy and 4 bits of checksum. That means any random 12 word mnemonic has a 1 in 16 chance to have a valid checksum.</p>

<p>The "blocking" of the valid final words instead of a totally random distribution is because the checksum bits are appended to the end of the entropy bits. So for every first 128 bits, there is exactly one valid final four bits. Bits are mapped to words by just counting down the alphabetically-sorted word list for each 11-bit chunk. So the first 128 bits determine the first eleven words and which "block" of the wordlist you are considering, and then within that block only one word corresponds to the correct checksum.</p>

CC BY-SA 4.0
2018-07-29T16:05:34.737Z
2018-07-29T16:05:34.737Z
idolrevolver
<p>According to the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" rel="nofollow noreferrer" title="BIP39">BIP39</a> spec, invalid checksums should be displayed by software.</p>

<p>However, <a href="https://www.ledgerwallet.com/support/bip39-standalone.html" rel="nofollow noreferrer">Ledger's BIP39 generation tool</a> (which looks like a copy of <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">Ian's tool</a>), will not show an error for invalid checksums.</p>

<p>Example phrases to test with:</p>

<p>Correctly Generated Recovery Phrase: 
square cactus nurse pond share rescue prepare bottom suffer speed will tomorrow</p>

<p>another "valid phrase" (different but invalid checksum):
square cactus nurse pond share rescue prepare bottom suffer speed will account</p>

<p>another "valid phrase" (different but invalid checksum): 
square cactus nurse pond share rescue prepare bottom suffer speed will acoustic</p>

<p>For a 12 word phrase, if you split the 2048 wordlist into 16 word blocks, every 1 word out of the 16-word block will not produce an invalid mnemonic (or checksum) error.</p>

<p><strong>My two questions:</strong></p>

<ol>
<li>Is this going against the BIP39 spec?</li>
<li>Why does this code allow for 1 out of every 16 words of a block to be deemed as "valid"?</li>
</ol>

<ledger-hardware-wallet><mnemonic-seed>
Is the Ledger Implementation of BIP39 Generation Not Following the Spec?
Ryan Ellis
# Is the Ledger Implementation of BIP39 Generation Not Following the Spec?

(Asked by: username_0 on 2018-02-01)

According to the [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki "BIP39") spec, invalid checksums should be displayed by software.

However, [Ledger's BIP39 generation tool](https://www.ledgerwallet.com/support/bip39-standalone.html) (which looks like a copy of [Ian's tool](https://iancoleman.io/bip39/)), will not show an error for invalid checksums.

Example phrases to test with:

Correctly Generated Recovery Phrase:
square cactus nurse pond share rescue prepare bottom suffer speed will tomorrow

another "valid phrase" (different but invalid checksum):
square cactus nurse pond share rescue prepare bottom suffer speed will account

another "valid phrase" (different but invalid checksum):
square cactus nurse pond share rescue prepare bottom suffer speed will acoustic

For a 12 word phrase, if you split the 2048 wordlist into 16 word blocks, every 1 word out of the 16-word block will not produce an invalid mnemonic (or checksum) error.

**My two questions:**

1. Is this going against the BIP39 spec?
2. Why does this code allow for 1 out of every 16 words of a block to be deemed as "valid"?

**Tags:** ledger-hardware-wallet, mnemonic-seed


---

## 1 answers

### Answer by username_1 on 2018-07-29. Score: 2

Those are valid mnemonics with valid checksums. In the bip39 spec is the following:

> The following table describes the relation between the initial entropy length (ENT), the checksum length (CS) and the length of the generated mnemonic sentence (MS) in words.
>
> CS = ENT / 32
>
> MS = (ENT + CS) / 11

`| ENT | CS | ENT+CS | MS |
+-------+----+--------+------+
| 128 | 4 | 132 | 12 |
| 160 | 5 | 165 | 15 |
| 192 | 6 | 198 | 18 |
| 224 | 7 | 231 | 21 |
| 256 | 8 | 264 | 24 |`

As per the top row, 12 word mnemonics have 128 bits of entropy and 4 bits of checksum. That means any random 12 word mnemonic has a 1 in 16 chance to have a valid checksum.

The "blocking" of the valid final words instead of a totally random distribution is because the checksum bits are appended to the end of the entropy bits. So for every first 128 bits, there is exactly one valid final four bits. Bits are mapped to words by just counting down the alphabetically-sorted word list for each 11-bit chunk. So the first 128 bits determine the first eleven words and which "block" of the wordlist you are considering, and then within that block only one word corresponds to the correct checksum.


---

