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

Danger_Dave,

I like many it seems, have lost access to my AlgoWallet. I have 13 words of my passphrase. Would you be able to help me out?

Fabrice,

I believe I have the first 13 words in my phrase, is there a python script that may sort the remaining?

Hi, @ThatTylor , welcome on the Forum.
You miss the last 12 words of the passphrase. The last word is a checksum, so you miss only 11 words.
Every word of the passphrase codes 11 bits, i.e. you miss 11*11=121 bits. That is roughly 10**36 possibility, so the Python script would run till doomsday.

1 Like

How many attempts can one run in a minute?

Even if you could attempt 1 quadrillion mnemonics per second, it would still take you around 100 trillion years.

It worked for me Fam. I’m not a developer and didn’t know how to run the script. @lime on the discord helped me with a quick tutorial. There it goes;
‐-----------‐-----------------------‐-----------‐---------------------------------
If what you are missing is the last 2 words you can try this script from algosdk import wordlist, mnemonicfrom base64 import *from nacl.signing - Pastebin.com

save it to your computer, open it and edit the truncated_key = “xxx” line with the words you have, edit the address = “XXX” line to have the address of the account.

  • Then download and install python I think the App store is the easiest Microsoft Apps .

  • Next open a terminal in the directory where you saved the fAepNpXp.py script. right click select “Open in terminal”.

  • Install the Algorand python SDK by running pip install py-algorand-sdk

  • Run the script by running python fAepNpXp.py.

‐-----------‐-----------------------‐-----------‐---------------------------------

Hope it helps someone

For all readers. This is the best reason for Vendible’s Trustible product. It protects your seed phrase.

Trustible is getting close to testnet and in talks with major providers in Algoland. Take a look.

https://www.vendiblelabs.com/trustible

Had a look at Trustible. Seems to be a really awesome product with a real market need. Seed recovery is a case of when not if.

Sir i lost my 1 passphrase. 25 to 24 passphrase i have.

But one passphrase i lost. Please contact with me. My email:- mdmamunmiha12345@gmail.com

Hi, @Sakib003 , welcome on the Forum!
If you have 24 words out of 25, it is easy to recover the missing word.
There are only 2048 possible words. See them here: word list
With a suitable program it is a matter of a jiffy.

See this code, e.g., reposted from 25th word missing

# recover.py
# written by danger_dave
# updated by Ludovit Scholtz
#
# This code searches for one missing word in 25 mnemonic algorand phrase with known address

from algosdk import mnemonic
from algosdk import wordlist

# Write in Public Key here
address = "JU73IC5WZRS2AF4LN6WBAY5ZFDWMNNRXU6O5VIPZIFRLLT53VHDOBYP3HQ"

# 24 words go here (single space seperated)
confirmed = "youth journey spot increase action robust teach rubber direct world turn blouse camp hundred vessel pottery ozone brain hard risk quiz window abstract include"

word_list = wordlist.word_list_raw().split("\n")

wordscheck = confirmed.split(" ")
check = True
for word in wordscheck:
    if word in word_list:
        print(word+" is ok")
    else:
        print(word+" IS WRONG")
        check = False

if not check:
    print("!!!!!Some words are wrong .. try to find error in the allowed words: https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt")
    raise
        
curr = 0
first_part = ""
second_part = confirmed
for location in range(25):
    print(location)
    if location != 0:
        curr = confirmed.index(" ", curr + 1)
        first_part = confirmed[:curr]
        second_part = confirmed[curr:]
    for word in word_list:
        test_phrase = first_part + " " + word +" "+ second_part
        try:
            test_address = mnemonic.to_public_key(test_phrase)
        except:
            continue
        if test_address == address:
            print(test_phrase)
            raise

First, you should install Py-Algorand-sdk. Run $ pip3 install py-algorand-sdk in a Linux OS to install the package. Then you should edit the above file, and substitute your address in the code to address, and also the 24 words you know to confirmed. Finally, run python3 yourfile.py

1 Like