Recovering Ethereum from Trezor with Old Firmware | trezorctl

Hello,

I’m currently facing a challenge with my Trezor hardware wallet and an old firmware version (1.5.2). Unfortunately, I no longer have access to the recovery seed, which prevents me from upgrading the firmware. I successfully retrieved my Bitcoin using the Mycelium Android app, but it doesn’t support Ethereum on Trezor.

I’ve already attempted using the old Trezor Bridge without any success. However, I made some progress by installing an older version of Trezorctl (0.9.0).

By using the command trezorctl ethereum-get-address -n “‘m/44’60’/0’/0/0’”, I managed to obtain the correct Ethereum address associated with my balance.

Now, I’m trying to create a transaction via Trezorctl, but I’m encountering an error. Here’s the command I used:

trezorctl ethereum-sign-tx -c 0 -n "m/44'/60'/0'/0/0" -v "1 milliether" -g "21000" -t "70 gwei" "0x04C1a5ad367fb9E1F978ff9fC91970eb2Bc2fA74"

Unfortunately, the command above throws the following error:

Traceback (most recent call last):
  File "/usr/bin/trezorctl", line 847, in <module>
    cli()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/bin/trezorctl", line 683, in ethereum_sign_tx
    from ethjsonrpc import EthJsonRpc
  File "/home/debian/.local/lib/python3.7/site-packages/ethjsonrpc/__init__.py", line 1, in <module>
    from ethjsonrpc.client import (EthJsonRpc, ParityEthJsonRpc,
  File "/home/debian/.local/lib/python3.7/site-packages/ethjsonrpc/client.py", line 7, in <module>
    from ethereum import utils
  File "/home/debian/.local/lib/python3.7/site-packages/ethereum/utils.py", line 103, in <module>
    assert sha3('').encode('hex') == 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
AttributeError: 'bytes' object has no attribute 'encode'

I would greatly appreciate any guidance or suggestions from the community to help me resolve this issue and successfully create the transaction.

Thank you,
Dave

the error is not coming from trezorlib but from EthJsonRpc library, and it looks a lot like it’s incompatible with Python 3. Which is rather old news.

As a start, try updating trezorctl to version 0.10. AFAICT it should still support your Trezor version, and maybe it will pull in a better version of the EthJsonRPC library.

if that doesn’t help, you’ll need to get your hands dirty and edit out the ethjsonrpc import. if you specify all parameters yourself, it’s not actually needed.

1 Like

Thank you for the advice. During my holiday, I’ve had the opportunity to explore further. Setting up a Debian VM with a specific Python version was successful. However, I’m currently facing a challenge: every time I try to input the PIN on the early versions of Trezor, it’s incorrect. Notably, I don’t have this issue when using the PIN on Desktop or Android via Mycelium.

Is there a recognized bug related to the PIN logic in the early versions of trezorctl?

Additionally, is there a possibility to perform a partial upgrade of the Trezor Fiirmware? I aim to find a solution that won’t reset the seed while enabling the use of the new API for ETH access.

Not that I remember.

Do keep in mind that you need to apply the same scrambling in trezorctl as you do in other apps. The Trezor display tells you the keypad layout.

No, that would not make any sense. The firmware is a single monolithic blob, there are no “parts” that can be modified separately.