Ramifications of creating Electrum 2.x seeds which are not BIP39 Electrum 2.0 seeds (mnemonic phrases) are created with a checksum based algorithm (such that the hmac_sha512 starts with 01. It's usually a 13 word seed, but can be 12 in some circumstances.

If all 12 word Electrum 2.x seeds were filtered such that they are not BIP39 compatible, what is the decrease in entropy going to be?

=> The question pertains to this Python code

I guess the problem can be summed up as:


What is the percentage of 12 words Electrum 2.x seeds (relative to 13 word seeds)?
What is the percentage of Electrum 2.x (12 word) seeds which do not meet the BIP39 standard? (The last word decides the checksum)
For the purposes of this answer, I'll assume we're only talking about mnemonics which can be generated by Electrum 2.x, and not ones that are simply accepted by Electrum 2.x for restore (the latter number is infinite).




  
  What is the percentage of 12 words Electrum 2.x seeds (relative to 13 word seeds)?
  


Electrum 2.x seeds by default encode 136 bits of data. Any leading zero bits are ignored during encoding, so the resulting mnemonic length varies.

Each word encodes log2(word_list_length) bits of data, so for most* Electrum 2.x word lists, that's log2(2048) = 11 bits per word.

Therefore 13 and 12-word long mnemonics can encode up to 143 and 132 bits of data respectively. In order for a 136-bit seed to be encoded into 132 bits (12 words), at least the first 4 bits must be zero, which happens with probability 1 in 24, so 1 in 16 random mnemonics will be of length 12 or fewer.

Likewise, for an 11-word mnemonic, encoding 136 bits into 121 bits requires that 15 leading bits must be zero, so 1 in 215 or 1 in 32768 will be of length 11 or fewer.

Finally, if you need an exact answer, it would be 1/16 - 1/32768 = 2048/32768 - 1/32768 = 2047 in 32768 will be of length 12 exactly.

* For the Portuguese word list, it's log2(1626) ≈ 10.67 bits per word




  
  What is the percentage of Electrum 2.x (12 word) seeds which do not meet the BIP39 standard?
  


12-word long BIP-39 mnemonics have 4 bits of checksum, so 1 in 24 generated 12-word Electrum 2.x mnemonics will happen to be valid BIP-39 ones, and 15 in 16 Electrum ones will be invalid for BIP-39.




  If all 12 word Electrum 2.x seeds were filtered such that they are not BIP39 compatible, what is the decrease in entropy going to be?


I'm interpreting this as asking: If valid Electrum 2.x mnemonics were required to be invalid BIP-39 ones, by how much would this decrease their entropy?

Wolfram|Alpha says very small: about 0.0056 bits based on this input:

solve  (2^n - 1) / 2^n = 2047/32768 × 1/16  for n