Any tips on retrieving a missing 24th word from mnemonic (MyAlgoWallet)

So after finding out that when Chrome updates it wipes local storage and that means you need to re-import your MyAlgoWallet. I have realised for some reason I have stupidly written down 23 words and not 25 of my mnemonic phrase.

I have seen a separate thread about the 25th word being a checksum that you can retrieve via Python if you have the 24 but it doesn’t seem that there are any nifty ways to retrieve the 24th word.

I don’t suppose anyone would have any ideas about the best way to go about it? There are over 171,000 words in the English language but that would obviously take a lot of time and then for each of those attempts I’d need to try and get the 25th word using the approach in the thread above.

There’s enough Yieldly in the wallet for it to sting but not enough to sob uncontrollably so if it’s just a case of having to learn a lesson, that’s fair enough.

Any advice / tips appreciated.

There are only 2048 possible words: go-algorand-sdk/wordlist.go at develop · algorand/go-algorand-sdk · GitHub
So your solution would be quite fast.

I would estimate anything above 3 missing words will take too much time to compute :thinking:

The number of phrase combinations from any 23-word sequence is:

Combinations = (2048 ways to choose 1st word) * (2048 ways to choose 2nd word) * (300 possible locations) = 1,258,291,200

:hot_face: A lot of iterations, but it’s doable

Note: 300 comes from choosing 2 locations from the 25 of the complete phrase (i.e. 25 choose 2)

In general, the number of possible iterations for a brute force computation of a phrase missing n words is:

Combinations = 2048^n * (25 choose n)

Indeed, if you don’t know the positions of the two missing words, it looks like it’s about 1B tries.
The check that the key is valid is done in two phases:

  1. first check the checksum (you can do around 1-10M of such checks in 1s on a recent computer with a single core),
  2. then if the checksum is valid (this should happen every 2000 tests or so - even less because there is some redundancy I believe), compute the public key (you can do at least 5,000 such computations in a second)

So overall, in average, you should be able to do at least 0.5M checks per second per CPU core, with optimized enough software.
You should be able to recover your key in less than one hour cpu core, with optimized enough software.

PS: If you assume that one missing word is the 25th, the 25th word does not need to be brute-force, it can be recomputed from the first 24 words.

The hope is that it is the final 2 words that I’ve missed. With the 2,048 words is that minus the 23 I already have or is it possible to have repeated words? Not that 23 words less makes it any easier of course.

I have extremely limited knowledge of Python so it will likely be a bit to get my head around but it at least sounds like it is possible.

Is there a way to iterate through the mnemonic attempts once they are created or is that already part of the Python script?

As another option would a restore on the laptop from a few days back recover the lost LocalStorage?

Thanks for all the help

Hi, I have something similar happen to me, did you manage to sort it out? If so how?

Kind regards,
Stefan

Hi Stefan,

Not sure how this issue was resolved, but it is certainly possible to retrieve your full phrase if you only know 23 words and the public key.

It does take willingness to learn Python, though. Building the brute-force program would take a bit of effort. If you know 24 of the words, I posted a program for finding the last one at the link in the original post of this thread.

Does this help?

Best,
David

2 Likes