greenaddress / garecovery

GreenAddress recovery tool for 2of2 and 2of3 wallets
MIT License
107 stars 53 forks source link

UnicodeDecodeError: 'ascii' codec can't decode byte #38

Open kim0 opened 3 years ago

kim0 commented 3 years ago

I'm trying this on testnet, and getting the below crash! Any help please

(.venv) root@5f39888528d5:/garecovery# hexdump -C ~/men
00000000  62 69 74 74 65 72 20 72  65 6d 69 6e 64 20 61 72  |bitter remind ar|
<snip>
00000080  72 79 20 6c 65 67 65 6e  64 20 67 75 6e 20 69 6d  |ry legend gun im|
00000090  69 74 61 74 65 0a                                 |itate.|
00000096
(.venv) root@5f39888528d5:/garecovery# hexdump -C nlock
00000000  47 41 65 6e 63 72 79 70  74 65 64 80 00 00 00 00  |GAencrypted.....|
00000010  5f f9 bb 90 65 fa b7 37  38 37 80 5e 69 f3 26 73  |_...e..787.^i.&s|
00000020  71 a5 ae 39 48 ac 86 ae  ce be 1d fd 9f 64 4a 70  |q..9H........dJp|
00000030  e8 93 90 aa ed 77 6a f1  02 5e 1a c8 b1 db 7f b2  |.....wj..^......|
00000040  c9 68 7a fc c1 69 01 5e  5a d1 12 43 39 f7 2e 04  |.hz..i.^Z..C9...|
00000050  62 80 f3 52 0d 4b ae 03  d8 ea c9 e6 1e d3 1f c3  |b..R.K..........|
00000060  ef f1 5e c5                                       |..^.|
00000064
(.venv) root@5f39888528d5:/garecovery# rm -rf garecovery.csv &&  garecovery-cli -n testnet --nlocktime-file nlock --mnemonic-file ~/men -d 2of2
INFO:root:Reading nlocktime transactions from nlock
Traceback (most recent call last):
  File "/garecovery/.venv/bin/garecovery-cli", line 7, in <module>
    sys.exit(recoverycli.main(sys.argv))
  File "/garecovery/.venv/lib/python3.8/site-packages/garecovery/recoverycli.py", line 96, in main
    recovery = get_recovery(clargs.args, mnemonic, seed)
  File "/garecovery/.venv/lib/python3.8/site-packages/garecovery/recoverycli.py", line 69, in get_recovery
    return TwoOfTwo(mnemonic, seed, options.nlocktime_file)
  File "/garecovery/.venv/lib/python3.8/site-packages/garecovery/two_of_two.py", line 29, in __init__
    self.txdata = [json.loads(txdata.decode("ascii")) for txdata in zipdata]
  File "/garecovery/.venv/lib/python3.8/site-packages/garecovery/two_of_two.py", line 29, in <listcomp>
    self.txdata = [json.loads(txdata.decode("ascii")) for txdata in zipdata]
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 11: ordinal not in range(128)
kim0 commented 3 years ago

When I received the nlock zip file, I unzipped it before proceeding! It seems this is what was causing the issue. The error messages really need to improve, because blockstream is a company with reputation to protect. When people need to use this recovery tool, they will be very anxious so it really needs to be improved.