Expanding off of this answer (using python) from the related question you linked to we can start to narrow down the list of possibilities.
Start off with your ordered list of known words:
ordered_known_words = [
'glory',
'twice',
'film',
'near',
'senior',
'trust',
'thunder',
'endorse',
'suggest',
'scheme',
'habit',
'limit',
'slow',
'yard',
'clog',
'attend',
'axis',
'enough',
'only',
'magic',
'hair',
'rule',
'zone',
]
First, generate a phrase pattern for each possible position of your missing word:
def generate_phrase_patterns(ordered_known_words, mnemonic_length=24):
list_of_patterns = []
for i in range(0, mnemonic_length):
list_template = ['{x}'] * mnemonic_length
word_position = 0
for position, known_word in enumerate(ordered_known_words):
if i <= position:
list_template[position + 1] = known_word
else:
list_template[position] = known_word
word_position += 1
list_of_patterns.append(', '.join(list_template))
return list_of_patterns
This will a list of lists yield something like the following:
{x}, glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, {x}, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, {x}, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, {x}, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, {x}, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, {x}, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, {x}, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, {x}, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, {x}, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, {x}, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, {x}, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, {x}, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, {x}, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, {x}, yard, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, {x}, clog, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, {x}, attend, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, {x}, axis, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, {x}, enough, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, {x}, only, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, {x}, magic, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, {x}, hair, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, {x}, rule, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, {x}, zone
glory, twice, film, near, senior, trust, thunder, endorse, suggest, scheme, habit, limit, slow, yard, clog, attend, axis, enough, only, magic, hair, rule, zone, {x}
Now, feed this into the code from this answer on the related question you linked to generate a list of all possible phrases:
def generate_all_valid_phrases(phrase_patterns):
from btctools.HD import check, WORDS
total_phrases = []
for pattern in phrase_patterns:
for word in WORDS:
mnemonic = pattern.format(x=word)
if check(mnemonic):
total_phrases.append(mnemonic)
return total_phrases
At this point we have 180 valid 24 word mnemonic phrases, one of which contains your coin.
While you could manually check all of these that would be a tedious task. As discussed in m1xolyd1an's answer, if you know one of the address' previously used, we can use each of these mnemonic phrases to generate the first 5 or so deterministic addresses
produced by each phrase and perform a comparisson to check for an address match.
from btctools import Xprv
import json
master_address_list = []
for phrase in total_phrases:
m = Xprv.from_mnemonic(phrase)
# check first few address spaces for a known match
for i in range(0, 5):
addr = (m/44./0./0./0/i).address('P2PKH')
if addr == '1C26mdyEsNpe4fpkYtuHzH4Y378wez8mxP':
master_address_list.append({addr: phrase})
elif addr == '1BjoCJhvRCx9nVLPaKhg4qQ2YYps8mDgY4':
master_address_list.append({addr: phrase})
print(f'Address match(s) found: ', len(master_address_list))
print(json.dumps(master_address_list, indent=4, sort_keys=True))
If any address matches are found this will print them as key value pairs:
{
"<address>": "<mnemonic phrase>"
}
Here are two python scripts using incorporating the above logic in different ways: