-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Trezor Model T not detected #99
Comments
Hey, I don't own a Trezor T yet. Etherwall uses the low-level USB interface directly to talk to Trezor One so it has hard-coded the device-id so it only picks a Trezor One atm. I need to confirm that Trezor T is 100% compatible on the usb-level communication with how things are done with the Trezor One before enabling it. If you want, you can easily compile a version of Etherwall that will detect the Trezor T by changing this line to allow the enumeration of Trezor One's device ID (second parameter). The HID documentation at trezor.io currently does not even mention the USB HID id of Trezor T however. I'll try to get the ID and confirmation that Trezor T is compatible on the HID level with Trezor One from Satoshi Labs. If they confirm I'll enable it in the next release. |
It seems Trezor One should be API compatible on the USB level. Found the "vendor/device" ID's in their Java implementation here. I'm still waiting for a confirmation from the devs but if you're willing please reply here and I'll build a beta release with Trezor One detection enabled. |
I just tried it (deviceId is 0x53c1 for me, so 0x53c0 might be a preproduction unit or something like this). With this change, the trezor gets recognized as soon as device has been unlocked by entering the PIN (which makes sense, since model T is only supposed to enable USB after successful PIN entry), but then Etherwall hangs at the "Loading" spinner, so there seems to be some difference there... |
Yeah I was afraid that'd be the case. I wish they'd update their docs to reflect these things. I'll talk to Pavol (one of the Satoshi Lab's devs) see if he can give me an idea on what needs to be done. Maybe I can coerce him into sending me a Trezor T :) Sadly until then this will remain unfixed. I'll update the webpage to make sure people understand that only Trezor One is currently supported. |
Alright, if you need me to test anything, just update the issue, please! :-) |
Sure, if you feel like it we could try and make this work. You could start by adding Then there's the account model response to trezor being initiated here After which it's mostly communication directly as needed. We first need to find out where things get stuck. It's either somewhere in these two or when it's trying to get the addresses from Trezor. |
As a side note: if you decide to go and debug this please make a fork of the repo under your github user so you can easily make a PR if you figure this out :) |
So actually, it looks as if the first message to trezor (the "Initialize" message) already doesn't return the expected answer. I've checked their trezor-python libs as well (since they seem to be more up to date), and while trezor-core apparently as a protocol version 2 now, it's not being used, but the trezor-one protocol is still the default (see: here) Could you do me a favor and try the trezor-t branch on my account? I've added hexdumps of the bytes sent and received on the wire, and that's my output on the model t – it doesn't look right.
Also, I don't always get the 0x3f 0x23 0x23 "magic bytes" in the reply, sometimes I get 0x3f 0xff 0xff instead. It'd be helpful to compare that with your output from the Trezor One! Thanks! |
Hmm interesting. I'll do the test tomorrow. I've just pushed a minor fix for exception handling (catch by value vs reference) + updated the trezor-common submodule with the protobuf definitions. See if that maybe changed anything since I haven't upgraded the protobufs in some time. You need to make sure your submodules are updated to latest and then run the |
Updating the protobufs after merging your latest commit didn't help, unfortunately... Yeah, it's strange, I consistently get the same garbage data... the overall problem then is that |
This is what I got from the SatoshiLab guys:
So it seems they changed the channel. If the protobuf/messages are the same it shouldn't be that hard to implement this but I can't test. |
Here's the full communication in case you decide to give it a go:
So it seems messages and protocol should be the same with the Transport needing to be updated. He also mentioned some initial byte being present in some cases, not sure what that is atm. I don't have much knowledge of what "webusb" is tho. My understanding is it's some sort of non-finished standard for USB to Browser safe transport. Best I found is this page. |
ahaa, that sheds some light on it – I didn't realize the HID device exposed by T is just for U2F! well, yes, it appears they've implemented a "WebUSB" transport in their python lib, which is basically just raw usb access via libusb. It seems to be really just the transport, otherwise the same protobufs are used, so I think the most straight-forward way would be to implement it directly in wire.cpp, since it'll be just a switch in a couple of places, and factoring this out into its own transport class is probably overkill for this... |
Looking at the python code it seems that the only difference is them using hidapi vs libusb directly for the "webUSB" transport. I'm looking at the hid version here and the web usb version here We can easily start using libusb for model T (and eventually model One when they update it) and switch to libusb. It seems the hid version is the one with the magic bytes and special handling here. We also need to make sure we don't miss an interesting hack for windows here |
Yup sounds good! Thanks for tackling this. If you need help ping me here. If we need a more direct line I can set up IRC or gitter whichever you prefer. |
Fixed by your PR, thanks again! For next steps please #102 |
My Trezor Model T doesn't get detected by Etherwall 2.2.3 on MacOS 10.12.6. The Trezor works fine in other apps, though, such as Electrum and via WebUSB on MyEtherWallet or the Trezor Wallet.
I've tried plugging it in before and after starting the app, as well as entering the PIN before and after starting the app.
There doesn't seem to be anything trezor/usb related in the logs either.
The text was updated successfully, but these errors were encountered: