<p>Do you know one of the addresses in the keychain? Ledger uses BIP44 derivation so you could write a loop to check different seed phrases and check the resulting addresses against an address you know that should be in the keychain. This way you can type in your recovery words without having to be online. </p>

<p>For example if it were me I'd probably write something using the <a href="https://github.com/bitcoinjs/bitcoinjs-lib/releases/tag/v3.3.2" rel="nofollow noreferrer">bitcoinjs-lib</a>. Here's a start written with <a href="https://github.com/bitcoinjs/bitcoinjs-lib/releases/tag/v3.3.2" rel="nofollow noreferrer">bitcoinjs</a> (NOTE I'm using version 3.3.2). This will take a recovery seed and an address and it will search the keychain and tell you whether or not the address exists within it. </p>

<pre><code>//var words = "segment increase inch ensure corn cigar suggest fetch output proof peasant enact";
//var addr = "1c4XzQx7Uh8CnxzAN5CRrUjkbxGB1GUWp";

var searchbtn = document.getElementById("searchbtn");
searchbtn.onclick = function(){

    var words = document.getElementById("words").value;
    var addr = document.getElementById("addr").value;
    var depth = document.getElementById("depth").value;
    inkeychain(addr, words, depth);
}


function inkeychain(addr, keychain, depth){
    var isfound = false;
    for(var i=0;i&lt;depth;i++){
        var seed = hd.bip39.mnemonicToSeed(keychain);
        var root = b.bitcoin.HDNode.fromSeedBuffer(seed)
        //const root = bitcoin.HDNode.fromSeedHex(seed.toString('hex'))
        var wallet = root.derivePath("m/44'/0'/0'/0/"+i);

        //legacy
        var address = wallet.getAddress();
        var wif = wallet.keyPair.toWIF();

        //segwit p2sh
        var pubKey = wallet.keyPair.getPublicKeyBuffer();
        var pubKeyHash = b.bitcoin.crypto.hash160(pubKey);
        var redeemScript = b.bitcoin.script.witnessPubKeyHash.output.encode(pubKeyHash);
        var redeemScriptHash = b.bitcoin.crypto.hash160(redeemScript);
        var scriptPubKey2 = b.bitcoin.script.scriptHash.output.encode(redeemScriptHash);
        var p2shsegwit = b.bitcoin.address.fromOutputScript(scriptPubKey2);

        if(address===addr){
        isfound = true;
            console.log(address, wif);
            $('#result').html('Found '+addr+' in this keychain at '+i+' position in the keychain');
            alert('Found!');
        } else if (p2shsegwit===addr){
            //check for segwit p2sh
            isfound = true; 
            console.log(p2shsegwit, wif);
            $('#result').html('Found '+addr+' in this keychain at '+i+' position in the keychain');
            alert('Found!');
        } 
    }
if(isfound===false){
    $('#result').html('No matches');
}

}
</code></pre>

<p><a href="https://bitcoinfunction.com/?id=5d9ea508d9bed" rel="nofollow noreferrer">https://bitcoinfunction.com/?id=5d9ea508d9bed</a></p>

<p>From here you could take it a step further and make the <code>words</code> variable an array with all your different combos and then loop them all through. </p>

CC BY-SA 4.0
2019-10-10T20:53:33.027Z
I only know 23 of the 24 words and I actually just found the transaction record of me moving the bitcoin from a different wallet to the ledger nano s.
Would you method work in this case?

Also if I were manually testing sets of words in electrum and I selected m/84'/0'/0' instead of m/44'/0'/0' would it show me if there were coins in the wallet or not?

I am slightly computer savvy but some of this is way over my head, so sorry for what may seem like stupid questions.
Nate Gray
CC BY-SA 4.0
2019-10-10T03:18:30.533Z
2019-10-10T03:27:55.593Z
2019-10-10T03:27:55.593Z
m1xolyd1an
<p>Expanding off of <a href="https://bitcoin.stackexchange.com/a/78992/102745">this</a> answer (using python) from the related question you linked to we can start to narrow down the list of possibilities. </p>

<p>Start off with your ordered list of known words:</p>

<pre><code>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',
]
</code></pre>

<p>First, generate a phrase pattern for each possible position of your missing word:</p>

<pre><code>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 &lt;= 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
</code></pre>

<p>This will a list of lists yield something like the following:</p>

<pre><code>{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}
</code></pre>

<p>Now, feed this into the code from <a href="https://bitcoin.stackexchange.com/a/78992/102745">this</a> answer on the related question you linked to generate a list of all possible phrases:</p>

<pre><code>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
</code></pre>

<p>At this point we have 180 valid 24 word mnemonic phrases, one of which contains your coin. </p>

<p>While you could manually check all of these that would be a tedious task. As discussed in <strong>m1xolyd1an's</strong> 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. </p>

<pre><code>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))
</code></pre>

<p>If any address matches are found this will print them as key value pairs:</p>

<pre><code>{
    "&lt;address&gt;": "&lt;mnemonic phrase&gt;"
}
</code></pre>

<p>Here are two python scripts using incorporating the above logic in different ways:</p>

<ul>
<li><a href="https://github.com/d-fay/cryptotools/blob/master/solve_partial_12word_mnemonic_example.py" rel="nofollow noreferrer">https://github.com/d-fay/cryptotools/blob/master/solve_partial_12word_mnemonic_example.py</a></li>
<li><a href="https://github.com/d-fay/cryptotools/blob/master/solve_partial_24word_mnemonic_example.py" rel="nofollow noreferrer">https://github.com/d-fay/cryptotools/blob/master/solve_partial_24word_mnemonic_example.py</a></li>
</ul>

CC BY-SA 4.0
2020-02-28T05:49:02.810Z
2020-03-27T01:03:19.387Z
2020-03-27T01:03:19.387Z
taky2
<p>1 - I'm afraid, you can't find/search a bitcoin address with 23 of 24 mnemonic seed phrase words.</p>

<p>2 - Another disaster is not knowing the order of the words.</p>

<p>Going forward... My suggestion will be that you generate and save an <code>entropy</code> like the <code>hex</code> value in this <a href="https://bitcoinfunction.com/?id=5db0f8f6060cd" rel="nofollow noreferrer">sample</a> . So that you can easily retrieve any address in cases like this.</p>

CC BY-SA 4.0
2020-02-28T05:50:19.853Z
The author mentions being certain of the order of the other 23 words
taky2
CC BY-SA 4.0
2019-10-24T01:23:20.417Z
2019-10-24T01:23:20.417Z
Cunlay
<p>I recently was locked out of my Ledger NanoS when I forgot the pin code. Upon trying to reset from my recovery phrase I realized that I only have 23 of the 24 required words (not sure how it happened unfortunately). I am not positive which position the word is in but I am certain the order of the other 23 words is correct.
That being said I have to try all possibilities in every other position.</p>

<p>I found this post giving me a list of words to populate the missing word:
<a href="https://bitcoin.stackexchange.com/questions/78987/lost-my-bitcoin-wallet-and-have-only-11-out-of-12-mnemonic-seed-phrase-words-ho/">Lost my Bitcoin wallet and have only 11 out of 12 mnemonic seed phrase words. How can I get my Bitcoins?</a></p>

<p>I am searching for a piece of code that would allow me to churn the solutions without manually trying the wallets 1 by 1.</p>

CC BY-SA 4.0
2019-10-09T19:49:52.160Z
Do you have to need a program for generating all possible combinations? an example a program that save inside the file that all possible combination. Or you are finding an program for testing all possible combinations directly on dispositive?
vincenzopalazzo
CC BY-SA 4.0
2019-10-09T20:11:52.787Z
I have now listed all the possibilities through the code on the link the the original post. I just want to have an automated way to test the list of about 200 entries (I believe the list is so small due to checksum rule).
I downloaded electrum wallet and have been testing a few manually but the process is quite tedious
Nate Gray
CC BY-SA 4.0
2023-06-12T19:03:32.567Z
@NateGray, hello from the future. DId you recover your wallet?
dhempler
<wallet-recovery><mnemonic-seed>
Automate Bip39 seed recovery
Nate Gray
# Automate Bip39 seed recovery

(Asked by: username_0 on 2019-10-09)

I recently was locked out of my Ledger NanoS when I forgot the pin code. Upon trying to reset from my recovery phrase I realized that I only have 23 of the 24 required words (not sure how it happened unfortunately). I am not positive which position the word is in but I am certain the order of the other 23 words is correct.
That being said I have to try all possibilities in every other position.

I found this post giving me a list of words to populate the missing word:
[Lost my Bitcoin wallet and have only 11 out of 12 mnemonic seed phrase words. How can I get my Bitcoins?](https://bitcoin.stackexchange.com/questions/78987/lost-my-bitcoin-wallet-and-have-only-11-out-of-12-mnemonic-seed-phrase-words-ho/)

I am searching for a piece of code that would allow me to churn the solutions without manually trying the wallets 1 by 1.

**Tags:** wallet-recovery, mnemonic-seed

> **Comments:**
> **username_1**: Do you have to need a program for generating all possible combinations? an example a program that save inside the file that all possible combination. Or you are finding an program for testing all possible combinations directly on dispositive?  
> **username_0**: I have now listed all the possibilities through the code on the link the the original post. I just want to have an automated way to test the list of about 200 entries (I believe the list is so small due to checksum rule). I downloaded electrum wallet and have been testing a few manually but the process is quite tedious  
> **username_2**: @username_0, hello from the future. DId you recover your wallet?  

---

## 3 answers

### Answer by username_3 on 2019-10-10. Score: 1

Do you know one of the addresses in the keychain? Ledger uses BIP44 derivation so you could write a loop to check different seed phrases and check the resulting addresses against an address you know that should be in the keychain. This way you can type in your recovery words without having to be online.

For example if it were me I'd probably write something using the [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib/releases/tag/v3.3.2). Here's a start written with [bitcoinjs](https://github.com/bitcoinjs/bitcoinjs-lib/releases/tag/v3.3.2) (NOTE I'm using version 3.3.2). This will take a recovery seed and an address and it will search the keychain and tell you whether or not the address exists within it.

```
//var words = "segment increase inch ensure corn cigar suggest fetch output proof peasant enact";
//var addr = "1c4XzQx7Uh8CnxzAN5CRrUjkbxGB1GUWp";

var searchbtn = document.getElementById("searchbtn");
searchbtn.onclick = function(){

    var words = document.getElementById("words").value;
    var addr = document.getElementById("addr").value;
    var depth = document.getElementById("depth").value;
    inkeychain(addr, words, depth);
}

function inkeychain(addr, keychain, depth){
    var isfound = false;
    for(var i=0;i<depth;i++){
        var seed = hd.bip39.mnemonicToSeed(keychain);
        var root = b.bitcoin.HDNode.fromSeedBuffer(seed)
        //const root = bitcoin.HDNode.fromSeedHex(seed.toString('hex'))
        var wallet = root.derivePath("m/44'/0'/0'/0/"+i);

        //legacy
        var address = wallet.getAddress();
        var wif = wallet.keyPair.toWIF();

        //segwit p2sh
        var pubKey = wallet.keyPair.getPublicKeyBuffer();
        var pubKeyHash = b.bitcoin.crypto.hash160(pubKey);
        var redeemScript = b.bitcoin.script.witnessPubKeyHash.output.encode(pubKeyHash);
        var redeemScriptHash = b.bitcoin.crypto.hash160(redeemScript);
        var scriptPubKey2 = b.bitcoin.script.scriptHash.output.encode(redeemScriptHash);
        var p2shsegwit = b.bitcoin.address.fromOutputScript(scriptPubKey2);

        if(address===addr){
        isfound = true;
            console.log(address, wif);
            $('#result').html('Found '+addr+' in this keychain at '+i+' position in the keychain');
            alert('Found!');
        } else if (p2shsegwit===addr){
            //check for segwit p2sh
            isfound = true; 
            console.log(p2shsegwit, wif);
            $('#result').html('Found '+addr+' in this keychain at '+i+' position in the keychain');
            alert('Found!');
        } 
    }
if(isfound===false){
    $('#result').html('No matches');
}

}

```

<https://bitcoinfunction.com/?id=5d9ea508d9bed>

From here you could take it a step further and make the `words` variable an array with all your different combos and then loop them all through.

> **Comments:**
> **username_0**: I only know 23 of the 24 words and I actually just found the transaction record of me moving the bitcoin from a different wallet to the ledger nano s. Would you method work in this case?  Also if I were manually testing sets of words in electrum and I selected m/84'/0'/0' instead of m/44'/0'/0' would it show me if there were coins in the wallet or not?  I am slightly computer savvy but some of this is way over my head, so sorry for what may seem like stupid questions.  

---

### Answer by username_4 on 2020-02-28. Score: 0

Expanding off of [this](https://bitcoin.stackexchange.com/a/78992/102745) 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](https://bitcoin.stackexchange.com/a/78992/102745) 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 **username_3'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:

* <https://github.com/d-fay/cryptotools/blob/master/solve_partial_12word_mnemonic_example.py>
* <https://github.com/d-fay/cryptotools/blob/master/solve_partial_24word_mnemonic_example.py>


---

### Answer by username_5 on 2019-10-24. Score: -1

1 - I'm afraid, you can't find/search a bitcoin address with 23 of 24 mnemonic seed phrase words.

2 - Another disaster is not knowing the order of the words.

Going forward... My suggestion will be that you generate and save an `entropy` like the `hex` value in this [sample](https://bitcoinfunction.com/?id=5db0f8f6060cd) . So that you can easily retrieve any address in cases like this.

> **Comments:**
> **username_4**: The author mentions being certain of the order of the other 23 words  

---

