# Have 10 of 12 of my mnemonic along with the BTC address, how can i automate recovery?

So I wrote down my mnemonic on a piece of paper and somehow the last 2 words got ripped off and I cannot find where it went. I do have 10 out of the 12 word phrase still (along with the order, they are 1-10), along with the last address that coins were sent to on it.

My question, is there a way to automate finding the last 2 words? I found various examples online for finding 1 out of 12 but nothing about situations with 2 out of 12 missing. Given that theres only 2048 words in the dictionary for it and each word in the mnemonic can only use certain ones from this dictionary, I'd presume this wouldn't be too difficult of a task. Preferably, Id like to find a way to not only generate the phrases but also check them for a balance in the blockchain if possible. Anyone know how I should go about this given what I have?

Yes, you could write a simple little program that would iterate through all the possible combinations and generate the address for each one.

If you know the address then you could simply compare the generated addresses until it finds the one that matches. If you don't know the address then yes you will need to look on-chain to find the one that has a non-zero balance.

Since 2048 is 2^11 each word represents 11 bits, and all 12 words give you 132 bits, which is why this approach is secure.

For 2 words it's only 22 bits, which translates to 2^22 == 4,194,304 possible combinations, which can probably be computed in under a second or so.

There do exist tools for this sort of situation. For example:

btcrecover

btcrecover is an open source Bitcoin wallet password and seed recovery tool. It is designed for the case where you already know most of your password or seed, but need assistance in trying different possible combinations.

Seed Savior / mnemonic-recovery (courtesy of MCCCS)

A tool for recovering BIP39 seed phrases.
[...]
Enter your seed phrase into the 'BIP39 Phrase' field. If a word is missing or unknown, please type "?" instead and the tool will find all relevant options. If a word is wrong, the tool will try to suggest the closest option.

I don't know if they work or just steal your money, so I'd only use downloadable tools that can be run on a disconnected PC.