Post
Topic
Board Development & Technical Discussion
Re: Bruteforce partial electrum seed words
by
HCP
on 10/02/2021, 00:35:48 UTC
If I'm understanding what you're writing... you have something like:

- possible_word1(list of ~4-10 words)
- possible_word2(list of ~4-10 words)
- possible_word3(list of ~4-10 words)
...
- possible_word12(list of ~4-10 words)

and from the sounds of it, you actually 13 words? so, this is the "old" electrum seed format? Huh

Anyway, assuming just 12 words for now, your possible seed combinations are: #word1_words * #word2_words * #word3_words * ... * #word12_words. Doesn't sound like much, until you do the math... even with "best case" of just 4 possible words in each position... that's 4^12 or 16,777,216 permutations.

Rough experience tells me that around ~6% of those will be "valid" (ie. the checksum matches)... so you're looking at something like ~1,006,632 "valid" seeds that you'd need to check for a match against your public address.


Anyway, I wrote a quick python script that takes in 12 files named 1.txt, 2.txt, 3.txt ... 12.txt... and then just iterates through the words in each position... it generates over 10,000 seeds/minute... and is finding (as expected) slightly more than 6% of those to be "valid".
Quote
Start: 2021-02-10 13:19:45.293000
10000 Seeds 2021-02-10 13:20:29.445000
621 Valid Seeds 2021-02-10 13:20:29.445000
20000 Seeds 2021-02-10 13:21:11.167000
1204 Valid Seeds 2021-02-10 13:21:11.167000
30000 Seeds 2021-02-10 13:21:55.523000
1832 Valid Seeds 2021-02-10 13:21:55.523000
40000 Seeds 2021-02-10 13:22:38.955000
2442 Valid Seeds 2021-02-10 13:22:38.955000
50000 Seeds 2021-02-10 13:23:23.073000
3041 Valid Seeds 2021-02-10 13:23:23.073000
60000 Seeds 2021-02-10 13:24:08.397000
3670 Valid Seeds 2021-02-10 13:24:08.397000
70000 Seeds 2021-02-10 13:24:53.846000
4308 Valid Seeds 2021-02-10 13:24:53.846000
80000 Seeds 2021-02-10 13:25:37.352000
4911 Valid Seeds 2021-02-10 13:25:37.352000
90000 Seeds 2021-02-10 13:26:23.622000
5543 Valid Seeds 2021-02-10 13:26:23.622000
100000 Seeds 2021-02-10 13:27:09.700000
6180 Valid Seeds 2021-02-10 13:27:09.700000
...

So, at ~10k seeds/minute... maybe ~1677 minutes to go through the full search space (only 4 words per slot, 12 slots)... which is around 28hours. Undecided

The main slow downs will be:
- More words in a given position... that's going to ramp up the total search space
- Actually generating private keys/addresses to check, as these are computationally a lot slower than just checking if a seed is valid.

With some optimisation, and maybe porting to C or something faster than Python, you'd probably gain some performance benefits... I'm sure it's in the realms of reality to be able to do it within a matter of days? Huh It really depends on how big your search space is... what are the exact number of words you have in each position? Huh