Missing word in recovery phrase

Hi guys,

I went to login to my ALGO wallet after 3 years - and it seems I have incorrectly written down the 24th word of my phrase. It is the same word as my 7th word, which I’m assuming is impossible.

I have looked at other threads, installed python + pip (but have no idea how to use it).

Is anyone able to help with a code I can run to find the 24th word?

@scholtz I have seen you helping in the previous thread. Would really appreciate if you could help me out!

Thank you so much - for anyone that can help :slight_smile:

I have been trying a code from an old thread, but keep getting this error below:

if not check:
… print(“!!!Some words are wrong … try to find error in the allowed words: bips/bip-0039/english.txt at master · bitcoin/bips · GitHub”)
… exit()

… found=0
File “”, line 5
found=0
^^^^^
SyntaxError: invalid syntax

I am attempting to use this code:

# recover.py
# written by danger_dave
# updated by Ludovit Scholtz
# Works with py-algorand-sdk:2.0.0 & python 3.10+
#
# This code searches for one missing word in 25 mnemonic algorand phrase with known address

from algosdk import mnemonic
from algosdk import account
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")
    exit()
        
found=0
curr = 0
first_part = ""
second_part = confirmed
for location in range(25):
    print(location)
    if location != 0:
        if location == 24:
            first_part = confirmed
            second_part = ""
        else:
            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
        #print(test_phrase)
        try:
            private_key = mnemonic.to_private_key(test_phrase)
            test_address = account.address_from_private_key(private_key)
            
            print(test_address)
            print(test_phrase)
            found=found+1
        except Exception as e:
            #print('Exception: '+ e)
            continue
        if test_address == address:
            print("Found match for specific address >>>>>>>>>>> "+address)
            print(test_phrase)
            exit()

if found == 0: 
    print("Mnemonic not found")```

Hi,

when i remove the 7th word from the mnemonic above it finds it correctly…

# recover.py
# written by danger_dave
# updated by Ludovit Scholtz
# Works with py-algorand-sdk:2.0.0 & python 3.10+
#
# This code searches for one missing word in 25 mnemonic algorand phrase with known address

from algosdk import mnemonic
from algosdk import account
from algosdk import wordlist

# Write in Public Key here
address = "JU73IC5WZRS2AF4LN6WBAY5ZFDWMNNRXU6O5VIPZIFRLLT53VHDOBYP3HQ"

# 24 words go here (single space seperated)
confirmed = "loyal youth journey spot increase action  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")
    exit()
        
found=0
curr = 0
first_part = ""
second_part = confirmed
for location in range(25):
    print(location)
    if location != 0:
        if location == 24:
            first_part = confirmed
            second_part = ""
        else:
            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
        #print(test_phrase)
        try:
            private_key = mnemonic.to_private_key(test_phrase)
            test_address = account.address_from_private_key(private_key)
            
            print(test_address)
            print(test_phrase)
            found=found+1
        except Exception as e:
            #print('Exception: '+ e)
            continue
        if test_address == address:
            print("Found match for specific address >>>>>>>>>>> "+address)
            print(test_phrase)
            exit()

if found == 0: 
    print("Mnemonic not found")

In your code you have extra ``` at the end of the file
just store it to any folder and run the python

python.exe recovery.py

i am using windows with python 3.11.5, but it should work with any

1 Like