gurnec / btcrecover

An open source Bitcoin wallet password and seed recovery tool designed for the case where you already know most of your password/seed, but need assistance in trying different possible combinations.
GNU General Public License v2.0
1.27k stars 680 forks source link

Bip39 #114

Open vator999 opened 6 years ago

vator999 commented 6 years ago

I need some help with the bip38 passphrase recovery for a Trezor. The point :

This is the XPUB from the wallet without an passphrase right?

And where should I enter my XPUB? After the --bip39 command or should I put it in a file or something? C:\python27\python btcrecover.py --bip39 --tokenlist tokens.txt [other-options...] An example would be great. Thanks

gurnec commented 6 years ago

I need some help with the bip38 passphrase recovery for a Trezor.

You do mean bip39, correct? I don't think bip38 has anything to do with hardware wallets like the Trezor, and in any case btcrecover has no support for bip38.

This is the XPUB from the wallet without an passphrase right?

Yes.

And where should I enter my XPUB?

If you don't give your xpub to btcrecover on the command line, it will ask for both it and your seed when you run it:

image

image (The "best guess" part above is a minor bug of sorts... when you're searching for a BIP39 passphrase, you need to know your exact seed, so asking for your "best guess" is poor wording.)

Alternatively, if give your xpub to btcrecover on the command line like this, the first window above will be skipped:

python btcrecover.py --bip39 --tokenlist tokens.txt --mpk xpub6D3uXJmdUg4xVnCUkNXJPCkk18gZAB8exGdQeb2rDwC5UJtraHHARSCc2Nz7rQ14godicjXiKxhUn39gbAw6Xb5eWb5srcbkhqPgAqoTMEY [other-options...]

And if you're running on a headless server (one with only a command prompt and no GUI), you can also add the --mnemonic-prompt option and it will ask for your seed at the command prompt instead of using a window.

vator999 commented 6 years ago

Thanks, yes bip39 not 38. So it not enough with just the xpub. I have to expose my 24 word mnemonic seed to my computer/ internet. Or will btcrecover work without an internet connection?

Entering the bip39 seed: I have the 4 first letters of each word. I enter them 1-24 with an "space" between each I would suppose?

python btcrecover.py --wallet wallet.dat --tokenlist tokens.txt --mpk xpub6D3uXJmdUg4xVnCUkNXJPCkk18gZAB8exGdQeb2rDwC5UJtraHHARSCc2Nz7rQ14godicjXiKxhUn39gbAw6Xb5eWb5srcbkhqPgAqoTMEY [other-options...] Why would I use the --wallet wallet.dat command here when its a --bip39? Thanks again

gurnec commented 6 years ago

So it not enough with just the xpub. I have to expose my 24 word mnemonic seed to my computer

Correct, the full mnemonic is needed—it is combined with each bip39 passphrase guess to create the corresponding xpub which is then compared to the xpub you entered. When there's a match, the passphrase guess is correct.

will btcrecover work without an internet connection?

There's no networking code in btcrecover whatsoever (edit: except for the standalone download-blockchain-wallet.py script which you're welcome to delete). It will work without an Internet connection (and I'd recommend it!).

Entering the bip39 seed: I have the 4 first letters of each word. I enter them 1-24 with an "space" between each I would suppose?

Yes, although btcrecover isn't smart enough to accept just the first 4 letters of each word, you'll have to enter the full words. You can find the bip39 word lists for each language here (bip39-en.txt is for English) and as of seedrecover v0.7.3 you can enter just the first 4 letters of each word and it will work correctly (but you should ensure they're either all truncated or all full words, no mixing).

Is the 4-first-letters thing common? Is it a Trezor thing, or maybe something you just decided to do yourself?

Why would I use the --wallet wallet.dat command here when its a --bip39?

You're absolutely right... no reason at all! Sorry, I must have copy-and-pasted the wrong thing. I corrected it above.

Hope this works out for you!

vator999 commented 6 years ago

Is the 4-first-letters thing common? Is it a Trezor thing, or maybe something you just decided to do yourself?

No, I'm using a Cryptosteel and that only takes the 4 first letters of each word. So I just have to go through the list. No problem.

Correct, the full mnemonic is needed—it is combined with each bip39 passphrase guess to create the corresponding xpub which is then compared to the xpub you entered. When there's a match, the passphrase guess is correct.

Hmm, I'm using the xpub from my none passphrase wallet with the bip39 seed and it still can find the mach between my "passphrase wallet" and "none passphrase wallet xpub plus bip39 seed". Interesting.

gurnec commented 6 years ago

Hmm, I'm using the xpub from my none passphrase wallet with the bip39 seed and it still can find the mach between my "passphrase wallet" and "none passphrase wallet xpub plus bip39 seed".

Sorry, but I don't understand....

vator999 commented 6 years ago

Ok, I might be the one not understanding. Im not so good in this stuff. i just thought that btcrecover would go and check every passphrase guess and se if there was a btc balance on that specific adress since every passphrase is valid. But apparently btcrecover does it in another way by matching the xpub from the none passphrase wallet, the seed and the guessed passphrase to find the wallet with a btc balance.

gurnec commented 6 years ago

Im not so good in this stuff.

Nah you're fine, this stuff just gets complicated. I have to run, but I'll get back to you tomorrowish.

vator999 commented 6 years ago

I figured out the problem by myself but I would like to donate anyway since I think this is a very valuable project for people in my situation that can't figure it out. I also find your quick and helpful support to be really helpful in such an stressing moment as when you think you've lost it all. Keep up the good work! Could you think about adding an Segwit address to your donation address? I would really like to support Segwit!

gurnec commented 6 years ago

That's great, I'm glad I could help!

I would really like to support Segwit!

The best way to support segwit via the blockchain is to make a segwit address, accept a payment to that address, and then send that coin elsewhere. It's that second transaction, not the first, which is actually a segwit transaction.

So you can support segwit by donating some coin that was received by a segwit address of yours. It doesn't matter if the donation address itself is segwit or not. In fact, even if I added a segwit address, there'd be no way for you to tell if it's actually segwit or not until after you donated and I moved the funds elsewhere (unused segwit addresses (those with no "outgoing" transactions) are indistinguishable from any other P2SH address).

Regardless of all of the above, I'm personally avoiding the use of segwit for the time being.

vator999 commented 6 years ago

there'd be no way for you to tell if it's actually segwit or not

Doesn't Segwit addresses start with a 3 instead of a 1? Donation is on it's way. Thanks again

gurnec commented 6 years ago

Thank you!!

Doesn't Segwit addresses start with a 3 instead of a 1?

Addresses which start with a 3 are called Push-to-Script-Hash, or P2SH. This type of address predates segwit by a few years, and can be used for many different things (most commonly they are used for multi-signature transactions). So a P2SH could be a multi-sig tx, a segwit tx, or something else entirely. You can only find out once the output is later redeemed.