Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-trezor 0.9.1 required for Trezor T support #4031

Closed
mocmocamoc opened this issue Mar 5, 2018 · 8 comments
Closed

python-trezor 0.9.1 required for Trezor T support #4031

mocmocamoc opened this issue Mar 5, 2018 · 8 comments

Comments

@mocmocamoc
Copy link

The release notes for Electrum 3.1 say that "The Trezor T hardware wallet is now supported", but at least on Windows this doesn't work with python-trezor 0.9.0 which appears in requirements-hw.txt for 3.1. Electrum 3.1 as released just hangs when trying to create a wallet using a Trezor T. For it to work requires python-trezor 0.9.1 which was tagged a couple of hours after Electrum 3.1.

Tangentially, the Windows build also includes libusb 1.0.21 which has a bug affecting the enumeration of Trezor Ts: trezor/python-trezor#223
The bug is fixed in libusb 1.0.22-rc3 but I don't know if it would be appropriate to include that in the build.

@SomberNight
Copy link
Member

Well I've only tested on Ubuntu, with the emulator, but apart from passphrases ( #3996 ), it works for me on 0.9.0.

@SomberNight
Copy link
Member

As for the libusb thing; the potential error is that a hw device is listed twice in enumeration, but otherwise it's harmless, right? In that case I think we can wait for a full release of libusb; and feel free to remind us when that happens :)

@mocmocamoc
Copy link
Author

I've tested 0.9.0 on Ubuntu now and I see the same behaviour as Windows, it hangs when performing any interaction with the Trezor T. It works as expected with python-trezor 0.9.1. This is with a real device, so if it works with the emulator then it may be a difference in behaviour between the emulator and the device.

@mocmocamoc
Copy link
Author

mocmocamoc commented Mar 6, 2018

This is the important commit to trezorlib: trezor/python-trezor@4cfcd93

Evidently there was a "v2" protocol that was intended to be used by the Trezor T, but it was removed from the device (and hence the emulator) on 27th Feb: trezor/trezor-core@323714d

So I'd guess that the emulator code you tested with predates 27th Feb, meaning it supports the v2 protocol, which means it works with trezorlib 0.9.0 whereas a real device will not.

TL;DR: If you update the emulator code to latest and test again then I think it will display the same behaviour as I'm seeing with the device?

@SomberNight
Copy link
Member

That sounds plausible.
However, I've just tried with Electrum 3.1.0, python-trezor 0.9.0, and git HEAD trezor/trezor-core@a697d48 of trezor-core, on Ubuntu, and it worked as long as I did not enable passphrases.

It might be due to emulator / real device differences though.
I really should get a real device; but I'll have to wait until they enable orders.

In any case, python-trezor 0.9.1 will be included in the binaries for the next release, there isn't much else we can do anyway. We will probably do a minor release relatively soon.

@mocmocamoc
Copy link
Author

Thanks, moving to 0.9.1 should sort it out.

I investigated a bit further, so in case you're curious: the emulator works with trezorlib 0.9.0 because the emulator is seen as a UDP device (rather than a WebUSB device like the real thing), and in 0.9.0 UDP devices were already forced to use protocol v1: https://github.com/trezor/python-trezor/blob/v0.9.0/trezorlib/transport_udp.py#L53

@SomberNight
Copy link
Member

Ahhh; indeed I should get a real device. :)

@SomberNight
Copy link
Member

Can you confirm that the Windows binaries for Electrum 3.1.1 can detect the Trezor T?
A user claims they don't :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants