GithubHelp home page GithubHelp logo

pawelgorny / lostword Goto Github PK

View Code? Open in Web Editor NEW
20.0 5.0 12.0 74 KB

Program for retrieving lost words of Bitcoin BIP39 seed.

Java 100.00%
seed bitcoin bip39 bip141 p2wpkh p2pkh derivation-path maven java ethereum

lostword's Introduction

LostWord

Tool for finding partially lost BIP39 seed. Program works with P2WPKH: BIP84, BIP141; P2PKH: BIP32, BIP44; P2WPKH nested in P2SH: BIP141.

Usage: java -jar lostWord.jar configurationFile

If your problem cannot be covered by any of modes below, please contact me, I will try to modify program accordingly or help you find a seed.

How to use it

Please check files in /examples/ folder to see how to set up the configuration file. Configuration file expects: address, number of words, known words and additionally derivation path. If not specified, the default will be used (m/0/0). This version checks only one address - for the given path. In the future (or if requested) I will add possibility to verify all the addresses up to address number x. If you know the address but you do not know if it was first or second from the derivation path, you must launch program twice, using two different paths (for example m/0/0 and m/0/1). It is possible to launch tests against 'hardened' addresses, using ' (apostrophe) as the last character of path. Using page https://iancoleman.io/bip39/ you may easily check what to expect for the given seed. By default program uses P2PKH script semantics for addresses like "1...", P2WPKH for addresses like "bc1..." and P2WPKH nested in P2SH for addresses like "3..." (BIP141).

If derivation path is not specified, by default program is using "m/0/0" (BIP32 for P2PKH and BIP141 for P2WPKH). For example: if you want to do calculations for BIP44 or BIP84, please use the proper derivation path, for example "m/44'/0'/0'/0/0" or "m/84'/0'/0'/0/0", where the last two digits are the most important (account & number of address).

Program supports also Ethereum (path m/44'/60'/0'/0/0)

Program could be launched in several modes:

  1. ONE_UNKNOWN
  2. 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. Configuration file example (seed with 6 words, one word missing):
    ONE_UNKNOWN
    1AcuLxsQSMTi6fLEbJ6F6sNsZ4NyqnUNSo
    6
    brother
    medal
    remove
    pitch
    hill
    
  3. KNOWN_POSITION
  4. 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). Configuration file example (seed with 6 words, three first words are missing):
    KNOWN_POSITION
    bc1q8ctl93aqztw8z3jsfhzcl0hlukq9pc7jclmmt0
    6
    ?
    ?
    ?
    home
    car
    test
    

    It is possible to resume search from the specific word on the first unknown position. For example:

    KNOWN_POSITION
    bc1q04v0u7sy29tu3g6a0zwldlthjms2u00p0ucq7q
    6
    ?ability
    ?
    ?
    home
    car
    that
    
  5. ONE_UNKNOWN_CHECK_ALL
  6. 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
    ONE_UNKNOWN_CHECK_ALL
    anyAddress
    6
    brother
    canal
    remove
    pitch
    hill
    m/0/0'
    
  7. PERMUTATION_CHECK
  8. Worker creates all the possible (correct) seeds from the given list of words and checks them using given address and derivation path. Configuration file example (seed with 6 words):
    PERMUTATION_CHECK
    1NzWRF78WKHGCNvSjvRB5cU9WzjpYF1RMb
    6
    hill
    canal
    brother
    medal
    pitch
    remove
    m/1/4
    
  9. PERMUTATION
  10. Worker displays and writes to file all the possible (correct) seeds from the given list of words. Configuration file example (seed with 6 words):
    PERMUTATION
    anyAddress
    6
    brother
    canal
    medal
    remove
    pitch
    hill
    
  11. POOL
  12. 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. Configuration file example (seed with 6 words, one word unknown, known possible words on two positions):
    POOL
    bc1q0v5q36eaculyrykjnjsyuey6ctd3802ft4jdcc
    6
    brother
    window master canal cat
    ?
    black master remove cat
    pitch
    hill
    
  13. PRINT_SEEDS
  14. Prints on screen and saves to file all the possible seeds generated from the given list of works (with 1 or more words missing). Configuration file example (seed with 6 words):
    PRINT_SEEDS
    anyText
    6
    brother
    canal
    ?
    remove
    pitch
    hill
    

For BTC only (not ETH): It is possible to specify the derivation path as a range. For example "m/0/0-4" if you want to launch search on the first five addresses or "m/0/1-2'" if you want to check second and third hardened addresses. Example of search with a range:

ONE_UNKNOWN
bc1qg3m687gpwljqnzja233sf99aex79cmwr5ewhxh
6
brother
canal
remove
pitch
hill
m/0/2-7'

Contact

Contact email: [email protected] If you found this program useful, consider making a donation, I will appreciate it! BTC: bc1qz2akvlch75rqdfg8pv7chqvz3m8jsl49k0kszc

lostword's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lostword's Issues

Electrum derivation path

Hi, at first I love your projects and sorry for my bad English. I want to solve an electrum bip39 seed puzzle from 2020 the address starts with a 1...., and have found 34 seed words, I only need 24 from them so I used the POOL example. My question is, which derivation path I have to use? My tests with m/0/0, m44/0/0/0/0 didn't produce any findings.
Thank you

What do I do wrong?

The mnemonic: reward news divorce text local race patrol eager planet dish chief actress creates the following address: bc1qh3gygn44mhkshg0j6va5nzevj67ys6cjfgqtxe on m/84'/0'/0'/0/0
My Config.txt is:

KNOWN_POSITION
bc1qh3gygn44mhkshg0j6va5nzevj67ys6cjfgqtxe
12
reward
news
divorce
?
local
race
patrol
eager
planet
dish
chief
actress
m/0/0'

I run it, but it doesn't find the address:

What do I do wrong?

Time Estimation for permutation check case

Is there a rough estimation on how long it will take to check 12! cases of a permutation check on a 16 core cpu?

Would you say it’s at least 1000 checks per second per core?

possible to add extra words?

I'm trying to create all valid 12 word seeds with 18 words, is that possible? This script is much faster than the one I wrote in python.

whats the number for?

very confusing, I'm using permutation check and I must say that I don't know what' going on I have this "2022-05-24 00:32:51 Alive! 1088218" on my screen with that number going up and down. I don't know what it means and it doesn't help me get an idea on progress or anything. The number is changing and that's it.

Is it possible to select the range of indexes?

Hi again, I'd like to know if there is an option for brute forcing many derivation paths (indexes specifically) at once. For example I want to brute force the addresses below, but I can't with my hand. (I want to leave it all night long)

m/84'/0'/0'/1/0
m/84'/0'/0'/1/1
m/84'/0'/0'/1/2
m/84'/0'/0'/1/3
...
m/84'/0'/0'/1/99
m/84'/0'/0'/1/100

Your program has made my life easier btw.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.