Author

Topic: LostWord - Program for retrieving lost words of Bitcoin BIP39 seed. (Read 386 times)

legendary
Activity: 952
Merit: 1386
Update: I have just added support for Ethereum addresses, please check example (file example_21.conf) to see how to launch it. Maybe someone will find it useful.
legendary
Activity: 952
Merit: 1386
ONE_UNKNOWN_CHECK_ALL
Suitable for seeds where we know the number of words, we know order of words, but we do not know one word. Program checks seeds testing a 'lost' word on each position. This worker generates 10 addresses for the created seed and checks the balance online (using blockchain.info API). Currently it works only with P2PKH

Wouldn't it be faster if you generate all the addresses in advance, and fetch the blockchain.info results for all addresses you want to query and save them in some kind of cache, instead of doing a network request each time addresses are generated? I suspect the network latency in making the request for will dominate the iteration time per key.

I think there is limit of addresses to ask (at least using free version of blockchain.info API). Probably it could be better/faster with paid version or other provider, I did not investigate it.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
ONE_UNKNOWN_CHECK_ALL
Suitable for seeds where we know the number of words, we know order of words, but we do not know one word. Program checks seeds testing a 'lost' word on each position. This worker generates 10 addresses for the created seed and checks the balance online (using blockchain.info API). Currently it works only with P2PKH

Wouldn't it be faster if you generate all the addresses in advance, and fetch the blockchain.info results for all addresses you want to query and save them in some kind of cache, instead of doing a network request each time addresses are generated? I suspect the network latency in making the request for will dominate the iteration time per key.
legendary
Activity: 952
Merit: 1386
Now program words in two modes:
ONE_UNKNOWN

KNOWN_POSITION


Recently I have made some changes and enhancements, so let's summarize the current state:
Available search modes:
ONE_UNKNOWN
Suitable for seeds where we know the number of words, we know order of words, but we do not know one word. Program checks seeds testing a 'lost' word on each position.

KNOWN_POSITION
Suitable for seeds where we know the number of words, we know order of words, we do not know one or more words, but we know position of lost word(s). Program checks seeds testing a 'lost' word(s) on specified position(s).

ONE_UNKNOWN_CHECK_ALL
Suitable for seeds where we know the number of words, we know order of words, but we do not know one word. Program checks seeds testing a 'lost' word on each position. This worker generates 10 addresses for the created seed and checks the balance online (using blockchain.info API). Currently it works only with P2PKH

PERMUTATION_CHECK
Worker creates all the possible (correct) seeds from the given list of words and checks them using given address and derivation path.

PERMUTATION
Worker displays and writes to file all the possible (correct) seeds from the given list of words. (This was requested in topic: https://bitcointalksearch.org/topic/need-a-script-to-find-valid-mnemonic-seed-5319624)

POOL
Suitable for seeds where we know the number of words, we know order of words and we know potential candidates on each position. Still '?' could be used for the whole dictionary.

Additionally I managed to support BIP84, BIP141 (P2WPKH) and BIP32, BIP44 (P2PKH). I also added possibility to search for address not only on one specified position in derivation path, but to specify the range.
 
For details please check readme on github https://github.com/PawelGorny/lostword and corresponding example files.


legendary
Activity: 952
Merit: 1386
Java is designed to be portable such that the same Java program that's compiled with one Java development kit should run on a JVM from a different vendor. So it shouldn't matter whether you used Oracle, Amazon, Red Hat, or some community-developed JDK, they're all based on the same OpenJDK standard.

Theory.... Wink
As long as you do not use features from newer version than yours or library compiled with the newer version of java...
And minor version sometimes matters, unfortunately... but it is off-topic.

Anyway, you may always get maven and compile project yourself.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
I don't see many bitcoin tools created with Java (mostly uses Python or C/C#/C++). Most Java program i use usually need specific version range (such as Java 1.8/8).
It would be great if you can write required Java version and whether it support OpenJDK.

I used Java8 for compilation (1.8.271), but you may use any 1.8+. I did not test with OpenJDK, but I think it will work - on 99% Wink
Later I will try to install it one some machine and launch.

Java is designed to be portable such that the same Java program that's compiled with one Java development kit should run on a JVM from a different vendor. So it shouldn't matter whether you used Oracle, Amazon, Red Hat, or some community-developed JDK, they're all based on the same OpenJDK standard.
legendary
Activity: 952
Merit: 1386
I don't see many bitcoin tools created with Java (mostly uses Python or C/C#/C++). Most Java program i use usually need specific version range (such as Java 1.8/8).
It would be great if you can write required Java version and whether it support OpenJDK.

I used Java8 for compilation (1.8.271), but you may use any 1.8+. I did not test with OpenJDK, but I think it will work - on 99% Wink
Later I will try to install it one some machine and launch.
legendary
Activity: 952
Merit: 1386
I played a little and released a new version.
Now it is possible to search for more than one word if the position is specified.
More details in readme.
legendary
Activity: 952
Merit: 1386
Validating the mnemonic's checksum should limit the number of possibilities to around 192.

Indeed! I have published the new release, it is much faster now. Thanks.
legendary
Activity: 4522
Merit: 3426
Validating the mnemonic's checksum should limit the number of possibilities to around 192.
legendary
Activity: 952
Merit: 1386
Usually it isn't the last word of the seed that is lost, it could be any word in the list that is lost somehow and forgotten by human memory. So I suggest implementing support for guessing which word position in the phrase you want to find.

Yes, it is how it works. Missing word could be on any position. Maybe I incorrectly used word 'last', but I wanted to say that one is unknown.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Usually it isn't the last word of the seed that is lost, it could be any word in the list that is lost somehow and forgotten by human memory. So I suggest implementing support for guessing which word position in the phrase you want to find.
legendary
Activity: 952
Merit: 1386
Hello

edited
Recently someone on this forum wrote that he has 23 words of his seed and was looking for a way to find the last, missing word, which could be on any position. As he had problems with his python for btcrecover, I wrote a very simple java program. Unfortunately for some reason it did not work for him, but as I had some time today to play with it, I publish the next release. It is nothing special, but I treat it as a way to learn something new and maybe someone will find it interesting - or even better, someone will find it useful. My idea was to make it more user-friendly than btcrecover. There is still lot of things which could be done, but let's start slowly.
Currently I use library from bitcoin core, what I was able to cover is (based of wonderful page https://iancoleman.io/bip39/) BIP32 and BIP141/P2WPKH. Maybe it is possible to have other modes implemented, I must investigate.
It is also possible to specify derivation path, if one wants to look for address which is not the first one. And 'hardened address' option works too.
Please let me know if you have any idea what also could be useful for some people, maybe you know any other interesting use cases. I think the easiest would be to check several consecutive addresses from derivation path, but is it really important?
The code and compiled jar is available on github: https://github.com/PawelGorny/lostword
edited

Now program words in modes: https://bitcointalksearch.org/topic/m.56473042
All is described in ReadMe in github.

Regards,
Jump to: