{"action":"created","issue":{"url":"https://api.github.com/repos/stellar/account-viewer/issues/75","repository_url":"https://api.github.com/repos/stellar/account-viewer","labels_url":"https://api.github.com/repos/stellar/account-viewer/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/stellar/account-viewer/issues/75/comments","events_url":"https://api.github.com/repos/stellar/account-viewer/issues/75/events","html_url":"https://github.com/stellar/account-viewer/pull/75","id":360713340,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1ODY2NjUy","number":75,"title":"Add Trezor support","user":{"login":"zulucrypto","id":29358017,"node_id":"MDQ6VXNlcjI5MzU4MDE3","avatar_url":"https://avatars2.githubusercontent.com/u/29358017?v=4","gravatar_id":"","url":"https://api.github.com/users/zulucrypto","html_url":"https://github.com/zulucrypto","followers_url":"https://api.github.com/users/zulucrypto/followers","following_url":"https://api.github.com/users/zulucrypto/following{/other_user}","gists_url":"https://api.github.com/users/zulucrypto/gists{/gist_id}","starred_url":"https://api.github.com/users/zulucrypto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulucrypto/subscriptions","organizations_url":"https://api.github.com/users/zulucrypto/orgs","repos_url":"https://api.github.com/users/zulucrypto/repos","events_url":"https://api.github.com/users/zulucrypto/events{/privacy}","received_events_url":"https://api.github.com/users/zulucrypto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-09-17T03:30:25Z","updated_at":"2019-01-03T13:40:17Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/stellar/account-viewer/pulls/75","html_url":"https://github.com/stellar/account-viewer/pull/75","diff_url":"https://github.com/stellar/account-viewer/pull/75.diff","patch_url":"https://github.com/stellar/account-viewer/pull/75.patch"},"body":"### Description\r\n\r\nAdds support for logging in with a Trezor and signing a payment transaction (fixes #70).\r\n\r\n**Note:** This relies on unreleased Trezor firmware, please do not merge until it's available publicly.\r\n\r\nThe workflow for Trezor login/signing is:\r\n\r\n1. User clicks a button to sign in\r\n2. Trezor Javascript API call is made via `TrezorConnect` object\r\n3. New window is opened that communicates with the Trezor device and walks the user through signing\r\n4. When finished, new window is closed and the asynchronous `TrezorConnect` method returns\r\n\r\nTrezor Connect project: https://github.com/trezor/connect\r\nTrezor Connect documentation: https://wiki.trezor.io/Trezor_Connect_API\r\nStellar-specific documentation: \r\n * https://github.com/trezor/connect/blob/develop/docs/methods/stellarGetAddress.md\r\n * https://github.com/trezor/connect/blob/develop/docs/methods/stellarSignTransaction.md\r\n\r\n### Changes\r\n\r\nIn general, I kept this the same as the Ledger implementation, with a couple changes:\r\n\r\n* `bip32Path` is now shared between Ledger and Trezor\r\n* Trezor signing can fail before the transaction is submitted (for example, if the signing window is closed early) so I've added a \"pre-submit\" error handler and error message.\r\n\r\n### Testing\r\n\r\nSince Trezor hasn't released firmware with support for the Stellar functions, this must be tested with the Trezor emulator.\r\n\r\nInstructions for installing the Model T emulator can be found here: https://github.com/trezor/trezor-core/blob/master/docs/build.md\r\n\r\nIn order to use it with trezor connect, you will also need to install the trezor bridge from here: https://github.com/trezor/trezord-go\r\n\r\nSee the section on \"Emulator Support\" at the trezord-go project.\r\n\r\n### OS X Testing Instructions\r\n\r\nRequirements: \r\n * git\r\n * [Homebrew](https://brew.sh)\r\n * [Docker](https://docs.docker.com/docker-for-mac/install/)\r\n * Go (`brew install golang`)\r\n\r\nFollow these instructions: https://github.com/trezor/trezor-core/blob/master/docs/build.md#build-instructions-for-emulator-unix-port\r\n\r\nAt this point, the emulator will be installed. If you can run ./emu.sh proceed to the next step.\r\n\r\nInstall trezord bridge:\r\n\r\n```\r\n$ go get github.com/trezor/trezord-go\r\n$ go build github.com/trezor/trezord-go\r\n$ ./trezord-go -h\r\n```\r\n\r\nOnce 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:\r\n\r\n```\r\n$ docker run \\\r\n    --rm \\\r\n    -it \\\r\n    --name account-viewer-test \\\r\n    -p 8180:8000 \\\r\n    -p 8001:8001 \\\r\n    zulucrypto/stellar-account-viewer-test\r\n```\r\n\r\nIf 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.\r\n\r\nNow, in a separate terminal window, start trezord-go with emulator support:\r\n\r\n```\r\n$ ./trezord-go -e 21324\r\n```\r\n\r\nAnd finally, in a third window, start the emulator:\r\n\r\n```\r\n$ ./emu.sh\r\n```\r\n\r\nYou should now be able to go to http://localhost:8180/ and see the account viewer.\r\n\r\nClick \"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.\r\n\r\nOnce 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.\r\n\r\nYou'll now have an unfunded account on the testnet. Fund it with curl:\r\n\r\n```\r\n$ curl https://friendbot.stellar.org?addr=YOURADDRESSHERE\r\n```\r\n\r\nYour balance should update and you'll be able to transfer testnet XLM to other accounts."},"comment":{"url":"https://api.github.com/repos/stellar/account-viewer/issues/comments/451145381","html_url":"https://github.com/stellar/account-viewer/pull/75#issuecomment-451145381","issue_url":"https://api.github.com/repos/stellar/account-viewer/issues/75","id":451145381,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTE0NTM4MQ==","user":{"login":"spacesailor24","id":20375610,"node_id":"MDQ6VXNlcjIwMzc1NjEw","avatar_url":"https://avatars2.githubusercontent.com/u/20375610?v=4","gravatar_id":"","url":"https://api.github.com/users/spacesailor24","html_url":"https://github.com/spacesailor24","followers_url":"https://api.github.com/users/spacesailor24/followers","following_url":"https://api.github.com/users/spacesailor24/following{/other_user}","gists_url":"https://api.github.com/users/spacesailor24/gists{/gist_id}","starred_url":"https://api.github.com/users/spacesailor24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacesailor24/subscriptions","organizations_url":"https://api.github.com/users/spacesailor24/orgs","repos_url":"https://api.github.com/users/spacesailor24/repos","events_url":"https://api.github.com/users/spacesailor24/events{/privacy}","received_events_url":"https://api.github.com/users/spacesailor24/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T13:40:17Z","updated_at":"2019-01-03T13:40:17Z","author_association":"NONE","body":"Do you know what was left to finish implementing this?\r\n\r\nI'm currently able to login with the Trezor model T, but am unable to sign transactions. Here is my reddit post with more details:\r\n\r\nhttps://www.reddit.com/r/Stellar/comments/abynfg/send_fails_with_stellar_account_viewer/?utm_source=reddit-android\r\n\r\nThe latest Trezor firmware is now 2.0.10, does this affect your implementation?"}}
{"actor":{"display_login":"spacesailor24"}}