-
Notifications
You must be signed in to change notification settings - Fork 65
Add Trezor support #75
base: master
Are you sure you want to change the base?
Conversation
This is great! Thanks for jumping on it, @zulucrypto! |
@prusnak Thanks, fixed! |
@zulucrypto Can you please update the PR to require connect 5.0.32? Also, can you please publish the built version of your PR somewhere so I can test? (I am hitting some strange build errors, so I can't build by myself) |
Can you post the build log? If you are running Node 6.9 (I know it's old but |
Hi there, I'm keen to see this get merged, can I help at all? |
Hi @neanias - It could always use more testing! If you're running linux or OS X and interested in giving it a shot, let me know and I'll update with some more detailed testing/setup instructions. |
@zulucrypto, I use OS X/macOS and happy to give a hand. What can I do to help? |
Thanks @neanias ! I've updated the PR description with some detailed OS X instructions. Give them a try when you get a chance and let me know how it goes. |
I confirmed this works. Stellar firmware is released for both T1 and T2 (1.7.1 and 2.0.8) - available from https://beta-wallet.trezor.io./ @bartekn can you please review, merge and deploy to https://www.stellar.org/account-viewer/ ? Or is there anything else we need to do? |
Do you know what was left to finish implementing this? I'm currently able to login with the Trezor model T, but am unable to sign transactions. Here is my reddit post with more details: The latest Trezor firmware is now 2.0.10, does this affect your implementation? |
Hi @spacesailor24 - I am able to reproduce the issue you're having when I use the emulator. Based on the error message, I'm guessing that it's an issue with the javascript library that communicates between the account viewer and the Trezor device. Hopefully it will be fixed in trezor/trezor-core#421 . I'll keep an eye on that issue and contribute if necessary. @bartekn - This shouldn't be merged until the above issue gets figured out since it seems to affect basic payments as well as more complicated transactions. |
This should not be merged, because it does not work as is. In order to get this working extra patches from Also, the current Ledger code is written very naively and sends U2F requests to all connected USB devices, that's why I have removed it from our fork. |
@zulucrypto could you update this PR with @prusnak updates? |
Our fork is now fixed and works, feel free to pull the code. |
Description
Adds support for logging in with a Trezor and signing a payment transaction (fixes #70).
Note: This relies on unreleased Trezor firmware, please do not merge until it's available publicly.
The workflow for Trezor login/signing is:
TrezorConnect
objectTrezorConnect
method returnsTrezor Connect project: https://github.com/trezor/connect
Trezor Connect documentation: https://wiki.trezor.io/Trezor_Connect_API
Stellar-specific documentation:
Changes
In general, I kept this the same as the Ledger implementation, with a couple changes:
bip32Path
is now shared between Ledger and TrezorTesting
Since Trezor hasn't released firmware with support for the Stellar functions, this must be tested with the Trezor emulator.
Instructions for installing the Model T emulator can be found here: https://github.com/trezor/trezor-core/blob/master/docs/build.md
In order to use it with trezor connect, you will also need to install the trezor bridge from here: https://github.com/trezor/trezord-go
See the section on "Emulator Support" at the trezord-go project.
OS X Testing Instructions
Requirements:
brew install golang
)Follow these instructions: https://github.com/trezor/trezor-core/blob/master/docs/build.md#build-instructions-for-emulator-unix-port
At this point, the emulator will be installed. If you can run ./emu.sh proceed to the next step.
Install trezord bridge:
Once the emulator and trezord-go are installed, you will need to run this code. For convenience, I've created a docker container with everything ready to go:
If it says
Finished 'start-serve' after 71 ms
then it's working. You may see a warning about "Unexpected token", this is safe to ignore.Now, in a separate terminal window, start trezord-go with emulator support:
And finally, in a third window, start the emulator:
You should now be able to go to http://localhost:8180/ and see the account viewer.
Click "Sign in with Trezor". The first time you do this the device won't be initialized, so follow the prompts to create a new wallet and initialize the emulator.
Once you've done that, return to the account viewer and click "Sign in" again. This time, you should be prompted to share your account and then you will be logged in to the Account viewer.
You'll now have an unfunded account on the testnet. Fund it with curl:
Your balance should update and you'll be able to transfer testnet XLM to other accounts.