Pages:
Author

Topic: How do I identify the valid checksums for bip39 if I generate 11/12 of the word? - page 3. (Read 530 times)

legendary
Activity: 4354
Merit: 3260
Specifically what I'm trying to do is print out a list of the 2048 bip39 words and randomly select 12 to create my own offline generated seed.

The right way to do it is to follow BIP-39:

  • 1. Generate 128 random bits.
  • 2. Compute the SHA-256 hash of the 128 bits.
  • 3. Append the first 4 bits of the hash to the 128 bits, giving you 132 bits.
  • 4. Split the 132 bits into 12 11-bit values.
  • 5. Generate the phrase by using the 11-bit values as indexes into the list of 2048 words.

However, there is another way similar to what you want to do, but the result may be less secure depending on how random your input is:

  • 1. Select 11 words from the word list. Duplicates are acceptable.
  • 2. Concatenate the indexes into a 121 bit string.
  • 3. Add another 7 bits, random, 0, or whatever.
  • 4. Compute the SHA-256 hash of the 128 bits.
  • 5. Append the first 4 bits of the hash to the 7 bits, giving you the index of the 12th word.

Finally, here is minor variation of the previous method. Again, the security depends on how the words are chosen:

  • 1. Select 11 words from the word list. Duplicates are acceptable.
  • 2. Determine the 128 words that would be valid as the 12th word.
  • 3. Choose one.
legendary
Activity: 2380
Merit: 5213
Maybe if I try to clarify a little bit further as far as to what I'm trying to do exactly it might be able to give us a better picture of whether it's feasible or not.
I fully understand what you are trying to achieve.


Specifically what I'm trying to do is print out a list of the 2048 bip39 words and randomly select 12 to create my own offline generated seed. Can this be feasibly done?
If you select 12 words, there's a big probability that your seed phrase doesn't pass the checksum.
Instead, you can select 11 words and then try to find a word which lead to a valid BIP39 seed phrase. By valid, I mean it passes the checksum
This is completely feasible, but it's not a common method for generating a seed phrase.
If you insist on generating your seed phrase in this way, you should make sure that the words are picked 100% random.

For generating a BIP39 seed phrase, I would start with a random 128 bit entropy instead of directly going to the word list.
member
Activity: 104
Merit: 120
Maybe if I try to clarify a little bit further as far as to what I'm trying to do exactly it might be able to give us a better picture of whether it's feasible or not. Specifically what I'm trying to do is print out a list of the 2048 bip39 words and randomly select 12 to create my own offline generated seed. Can this be feasibly done? I'm trying to ensure true ravdsomness in seed creation and this seems to be the only way I can come up with outside of being able to independently verify the code from wallet manufacturers etc. Thanks.
legendary
Activity: 2380
Merit: 5213
Specifically I'm interested in generating a 12 word seed but my understanding is that the 12 word would be a checksum.........
This is not true.
The checksum isn't the last word. The checksum is the last 4 bits.
Each of words include 11 bits. The first 7 bits of the last word have been generated randomly and its last 4 bits are the checksum.
So, if you have 11 word, for selecting the 12th word, you have to test different words until you find a valid word. As I already said in my previous post, 128 out of the 2048 words will lead to valid BIP39 seed phrase.
member
Activity: 104
Merit: 120
Thank you for the reply. Just to clarify what I'm attempting to do is trying to generate my own offline bip39 seeds. Specifically I'm interested in generating a 12 word seed but my understanding is that the 12 word would be a checksum and therefore I would need to to be able to figure out a way to easily identify the viable checksum options which is what I'm attempting to do here. Thank you very much for your assistance
legendary
Activity: 2380
Merit: 5213
You have 11 words and you want to select the 12th word, so the BIP39 seed phrase passes the checksum. Am I right?

If I have understood you correctly, first of all note that that's not how a BIP39 seed phrase is generated.
It's not that 11 words are generated and then the 12th word is selected. Instead you generate a random number and your seed phrase represents that number. Your seed phrase provides 128 bits of entropy and 4 bits are added as the checksum.

Anyway, if you have the first 11 words and you want to have valid BIP39 seed phrase, there are 8 words that can be used as the 12th word.
To find that word, you should use brute-force method. This means that you should test all the 2048 words one by one.

The post has been edited. Thanks  o_e_l_e_o for the correction.
member
Activity: 104
Merit: 120
Hello all, I was hoping someone can help me identify the best way for identifying what the correct checksum would be in a bip 39 seed list when I've generated 11/12 words. Thanks in advance for your support!
Pages:
Jump to: