3rdIteration / btcrecover

BTCRecover is an open source wallet password and seed recovery tool. For seed based recovery, this is primarily useful in situations where you have lost/forgotten parts of your mnemonic, or have made an error transcribing it. (So you are either seeing an empty wallet or gettign an error that your seed is invalid) For wallet password or passphrase recovery, it is primarily useful if you have a reasonable idea about what your password might be.
https://btcrecover.readthedocs.io/
GNU General Public License v2.0
580 stars 180 forks source link

EncodingError running seedrecover.py on an ETH address #105

Closed DavidVeksler closed 3 years ago

DavidVeksler commented 3 years ago

Trying to recover an ETH wallet using a partial seed list. Running:

python3 seedrecover.py --no-dupchecks --mnemonic-length 12 --language EN --dsw --wallet-type BIP39 --addr-limit 1 --addrs 0x0430aA0c191eAE159946906eA3D8F7F6C9BB5684 --tokenlist seed.tx --bip32-path m/44\'/60\'/0\'/0

Getting an error: `Traceback (most recent call last): File "btcrecover/btcrecover/btcrseed.py", line 280, in _addresses_to_hash160s hash160 = binascii.unhexlify(encoding.grs_addr_base58_to_pubkeyhash(address, True)) #assume we have a P2PKH (Legacy) or Segwit (P2SH) so try a Base58 conversion File "btcrecover/lib/bitcoinlib/encoding.py", line 499, in grs_addr_base58_to_pubkeyhash raise EncodingError("Invalid address %s: %s" % (address, err)) lib.bitcoinlib.encoding.EncodingError: Invalid address 0x0430aA0c191eAE159946906eA3D8F7F6C9BB5684: Unknown character b'0' found in input string

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "btcrecover/seedrecover.py", line 38, in mnemonic_sentence, path_coin = btcrseed.main(sys.argv[1:]) File "btcrecover/btcrecover/btcrseed.py", line 2462, in main loaded_wallet = wallet_type.create_from_params(**create_from_params) File "btcrecover/btcrecover/btcrseed.py", line 702, in create_from_params self._known_hash160s = self._addresses_to_hash160s(addresses) File "btcrecover/btcrecover/btcrseed.py", line 282, in _addresses_to_hash160s hash160 = binascii.unhexlify(encoding.addr_bech32_to_pubkeyhash(address, prefix=None, include_witver=False, as_hex=True)) #Base58 conversion above will give a keyError if attempted with a Bech32 address for things like BTC File "btcrecover/lib/bitcoinlib/encoding.py", line 531, in addr_bech32_to_pubkeyhash raise EncodingError("Invalid bech32 character in bech string") lib.bitcoinlib.encoding.EncodingError: Invalid bech32 character in bech string`

3rdIteration commented 3 years ago

You need to specify an Ethereum wallet, not BIP39. (Or select it from he gui)

DavidVeksler commented 3 years ago

When I specify: --wallet-type ethereum (or the same via the UI) I get:

Starting seedrecover 1.5.0-CryptoGuide, btcrecover 1.5.0-Cryptoguide on Python 3.9.1 64-bit, 21-bit unicodes, 64-bit ints
Using the 'en' wordlist.
2021-01-28 17:27:42 : Phase 1/1: up to 12 mistakes, 12 of which can be an entirely different seed word.
2021-01-28 17:27:42 : Search Complete
 Seed not found, sorry...

btcrecover fails immediately and does not actually perform the search :-/

3rdIteration commented 3 years ago

Looks like your tokenlist is producing zero possible seeds...

You can try the example below:

python seedrecover.py --mnemonic "boat must spread fence laugh shoe road boy three infant drive coast aerobic x x" --wallet-type ethereum --addrs 0x15700999FE41D2F62477Aa3b0EE38d56Ec60d136 --addr-limit 1 --mnemonic-length 15

Or the same code with a tokenlist:

boat 
must
spread
fence
laugh
shoe
road
^8^boy
^9^three
^10^infant
^11^drive
^12^coast
^13^aerobic
^14^board
^15^clog

Both work fine and the tokenlist will run through about 5000 possibilities and find a result.

DavidVeksler commented 3 years ago

I really appreciate the prompt response.
I guess the issue all along is that no possible seeds were generated.

I have words 1-4 and 9-12. I'm missing 5-8 entirely. I specified the position of 1-4 and 9-12. Can I use btcrecover to find the 4 missing words?

3rdIteration commented 3 years ago

For that kind of recovery you can don't need to use a tokenlist.

That said, four missing words will take years, the realistic limit is three. (Done in a few days) You can review John Cantrell pure OpenCL stuff running on multiple servers for something which may work for four missing words.

Alternatively, things may improve in terms of computing power for the recovery to be both possible and economically worthwhile in about 10 years. (So don't throw it out)