Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: BlackHatCoiner on February 18, 2021, 08:54:33 AM



Title: Problems with btcrecover
Post by: BlackHatCoiner on February 18, 2021, 08:54:33 AM
This thread will be generally for problems with btcrecover, I'm sure I'll face more issues in the future.

I've trying to use btcrecover instead of FinderOuter since I heard that it goes extremely faster, maybe because it's not UI? I don't know. I haven't confirmed it yet. But I need to brute force too many combinations, and with FinderOuter it takes 2 hours each (I only have an address and 10 out of 12 words), so I'd like to give btcrecover a try.

20482 combinations should be checked, which is a little too much if I want to search among many derivation paths. So I downloaded btcrecover. The problem is the installation of course. It requires python 2.7.8 and coincurve 5.2.0.

As you can see, I've installed both, but it keeps returning me this error:


This is the error:
Code:
C:\Users\bymet\Pictures\btcrecover>C:\Python27\python.exe seedrecover.py --big-typos 1
Traceback (most recent call last):
  File "seedrecover.py", line 30, in <module>
    from btcrecover import btcrseed
  File "C:\Users\bymet\Pictures\btcrecover\btcrecover\btcrseed.py", line 35, in <module>
    import sys, os, io, base64, hashlib, hmac, difflib, coincurve, itertools, \
ImportError: No module named coincurve

Have you any idea why does this happen? What should I fix?


Title: Re: Problems with btcrecover
Post by: NeuroticFish on February 18, 2021, 09:08:31 AM
I may be completely off, but I've seen here ( https://omariskandarani.com/how-to-install-btcrecover-for-beginners/ ) that a couple of Microsoft redistributables may need to be installed.
I guess it doesn't hurt to check if you didn't miss something.


Title: Re: Problems with btcrecover
Post by: Pmalek on February 18, 2021, 09:22:08 AM
I haven't used btcrecover, but I did a quick search to see what can be found through search engines. I ran into a reddit post from a year ago where another user seemed to have a similar error. You can check it out here > https://www.reddit.com/r/btc/comments/co0pxt/problem_with_btcrecover_tool/

The solution seems quite simple. Check it the below line helps:
Quote
pip install coincurve


Title: Re: Problems with btcrecover
Post by: NotATether on February 18, 2021, 10:02:38 AM
Trying to see the error is very annoying because the animation only shows it for a split second and hen it disappears. You should take a screenshot of the GIF of that particular error instead.

I managed to see that you are missing a module called "coincurve". Do what @Pmalek said and run pip install coincurve and try running btcrecover again.

I may be completely off, but I've seen here ( https://omariskandarani.com/how-to-install-btcrecover-for-beginners/ ) that a couple of Microsoft redistributables may need to be installed.
I guess it doesn't hurt to check if you didn't miss something.

BTCRecover doesn't need Microsoft C++ redistributables.


Title: Re: Problems with btcrecover
Post by: BlackHatCoiner on February 18, 2021, 10:19:08 AM
Yes! I did it. I installed it and it works fine, so there's no need for further discussion about the error. The link of NeuroticFish helped a lot. Now I have another question to make. As I said I have a mnemonic with 2 words missing, but I do know their position. For example:

offer * sad collect chair tip short bid essay * salmon behave

Does btcrecover allow you to choose the position of the missing words? If yes, how do you choose them? I only see this "Give your best guess" dialog box:


This guy from youtube (https://youtu.be/XXw6dP7OPR4?t=321), just enters the mnemonic without the word, but I don't get how the program will understand the position of the word. Does it just brute force every different combination of positions?

Trying to see the error is very annoying because the animation only shows it for a split second and hen it disappears. You should take a screenshot of the GIF of that particular error instead.
I've written it, in the end of OP.


Title: Re: Problems with btcrecover
Post by: BlackHatCoiner on February 18, 2021, 12:41:16 PM
Nevermind, I just had to put "*" instead. Program works fine, thank you for your replies. I'll come back here if I ever need help again.


Title: Re: Problems with btcrecover
Post by: PawGo on February 18, 2021, 01:33:29 PM
What exactly is your problem? Find 2 words?
Did you try https://github.com/PawelGorny/lostword ?
There is already a 'solver' for your problem: KNOWN_POSITION
Let me know if you need support.


Title: Re: Problems with btcrecover
Post by: BlackHatCoiner on February 18, 2021, 02:22:21 PM
What exactly is your problem? Find 2 words?
I want to brute force a mnemonic with 2 words missing. The address is a bech32 one. I check your lostword repository, but I don't understand how to run it. I downloaded the .jar file and double-clicked on it. Nothing happened.

Why don't you use this fork of btcrecover (https://github.com/3rdIteration/btcrecover/ (https://github.com/3rdIteration/btcrecover/)) which uses Python 3 and have wider support towards wallet?
I saw it, it seems that I'll need that one, because the old version doesn't support bech32 addresses. Whether someone knows the answer to the following problem or not, I'll quote it from the issues of btcrecover in case someone knows what's the fault:

Quote from: BlackHatCoiner
Hi, I get the following error once I run C:\Python39\python.exe seedrecover.py --help:
 
Code:
File "C:\Users\bymet\Pictures\btcrecover2\seedrecover.py", line 30, in <module>
    from btcrecover import btcrseed
  File "C:\Users\bymet\Pictures\btcrecover2\btcrecover\__init__.py", line 2, in <module>
    from .btcrpass import *
  File "C:\Users\bymet\Pictures\btcrecover2\btcrecover\btcrpass.py", line 40, in <module>
    from lib.emip3 import emip3
  File "C:\Users\bymet\Pictures\btcrecover2\lib\emip3\emip3.py", line 5, in <module>
    from Crypto.Cipher import ChaCha20_Poly1305
ModuleNotFoundError: No module named 'Crypto'
I've installed pycryptodome~=3.9.9 and all the other requirements. Have you any ideas what's the fault? Thank you.
issue #126 (https://github.com/3rdIteration/btcrecover/issues/126)


Title: Re: Problems with btcrecover
Post by: PawGo on February 18, 2021, 02:25:46 PM
You need Java jre to launch it.
Prepare text file with configuration (like in example on github) and then launch from the console
Code:
java -jar lostword.jar Config.txt


Title: Re: Problems with btcrecover
Post by: BlackHatCoiner on February 18, 2021, 03:06:08 PM
@PawGo, I opened an issue (https://github.com/PawelGorny/lostword/issues/1). Let's continue the lostword discussion there, because it's considered off topic.


Title: Re: Problems with btcrecover
Post by: BlackHatCoiner on February 22, 2021, 05:02:12 PM
I saw it, it seems that I'll need that one, because the old version doesn't support bech32 addresses. Whether someone knows the answer to the following problem or not, I'll quote it from the issues of btcrecover in case someone knows what's the fault
I solved the issue by just re-doing the entire process. I uninstalled python 3.8.5 and started all over again. I guess I had done something wrong. Btcrecover works great and specifically seedrecover.py that I wanted. Although I face another issue, that I've also posted on github (https://github.com/3rdIteration/btcrecover/issues/131). I can't brute force certain path(s). For example I want to brute force an address that was created with Wasabi and then it received funds with CoinJoin, but I can't brute force certain paths (like change addresses).

For example, I can only try this one:
Code:
m/84'/0'/0'/0/x

and not this:
Code:
m/84'/0'/0'/1/x

I tried:

Code:
seedrecover.py --big-typos 1 --bip32-path "m/84'/0'/0'/1/1"

but it doesn't seem to work. It returns me the above error:
Code:
Traceback (most recent call last):
  File "C:\Users\bymet\Pictures\btcrecover2\seedrecover.py", line 38, in <module>
    mnemonic_sentence, path_coin = btcrseed.main(sys.argv[1:])
  File "C:\Users\bymet\Pictures\btcrecover2\btcrecover\btcrseed.py", line 2474, in main
    loaded_wallet = wallet_type.create_from_params(**create_from_params)
  File "C:\Users\bymet\Pictures\btcrecover2\btcrecover\btcrseed.py", line 682, in create_from_params
    self = cls(path, loading=True)
  File "C:\Users\bymet\Pictures\btcrecover2\btcrecover\btcrseed.py", line 1046, in __init__
    super(WalletBIP39, self).__init__(path, loading)
  File "C:\Users\bymet\Pictures\btcrecover2\btcrecover\btcrseed.py", line 642, in __init__
    for arg_path in arg_derivationpath.split(","):
AttributeError: 'list' object has no attribute 'split'


Title: Re: Problems with btcrecover
Post by: HCP on February 27, 2021, 04:12:28 AM
Seems like the maintainer of the 3rditeration version of btcrecover has recently put in a commit to deal with this specific issue: https://github.com/3rdIteration/btcrecover/commit/641d8b97d4e5bd536acedb9bdfdaf4d06689b815

"Fixes around re-doing the way that derivation path arguments are handled"

The code that is showing in your error has been modified... so try redownloading the btcrecover repo again to get the latest code and then try running it again.