25th word missing :-(

Yes, that was a joke… Never share your mnemonic phrase in public servers…

However in some point if you are not able to use the code provided eg from @danger_dave , you will have to share your mnemonic with someone or you can learn how to code… With sharing the code there is always a risk of that person stealing your assets there… Therefore you should pick someone who you know… Ideally one person because if you reveal it to two persons and one of them steals it, you will not know who was it…

On the other side, the account address is not secret… By revealing it, we may consider if it is worthy even discussing about it.

1 Like

Comes back with 0
Using the code from the first post
I have a friend who is trying to help

He thinks something is missing

Just can’t make this work at all
My only hope is someone will step up and help me if I share my 24 words with them, I understand the risks but feel I’m left with no other choice but to trust this community to help someone who made a mistake and was assaulted just for a stupid I-phone

I would hope this person is decent and trustworthy as I’m still upset about the mugging

My last hope really

There is error in the recovery code above… try this one…

# 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

add your address to the address variable and word list in the word list as shown above

i have updated the original line test_phrase = first_part + " " + word +" "+ second_part

note that this solution requires only one library to work with, so you should run

pip install py-algorand-sdk

to install it

I have also updated it to validate the bips words, so that it does not attempt to brute force when we know some of the words are wrong

1 Like

Your my Hero!
Thank you do so much

Hi i setip my planetwatch wallet and missed the 25th word compleately as this is specific to algorand (i suppose becuase any other crypto uses 24 words plus 1 if you chose to)

I tried your script but all i get is a check if the 24 words are valid and it lists the numbers 0 to 24. After that it throws an error:

This is cropped but the words are OK and it continues like this:


0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Traceback (most recent call last):
  File "recover.py", line 37, in <module>
    curr = confirmed.index(" ", curr + 1)
ValueError: substring not found

Since i am not a programmer this looks like gibberish to me?
It kind of expects something too be there that isn’t?

thx

This means one of two things:

  1. The Public Key being tested (in the variable “address”) is incorrect
    or
  2. The missing word is the very last one. The program crashes because there are only 23 spaces and it’s looking for the 24th one.
    Add these 4 lines of code above the line “curr = confirmed.index(” “, curr + 1)”
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:]

Let me know if this helps!

Hi! It’s been some time since this post, but I’m having the same issue.
I tried running this script but seems the to_public_key was removed from the algosdk.mnemonic.
Is there another function I could use?
Thank you all for your help

Here is the updated script:

# 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")

It worked! Thank you so much

1 Like