{"action":"created","issue":{"url":"https://api.github.com/repos/MelbourneDeveloper/Trezor.Net/issues/10","repository_url":"https://api.github.com/repos/MelbourneDeveloper/Trezor.Net","labels_url":"https://api.github.com/repos/MelbourneDeveloper/Trezor.Net/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/MelbourneDeveloper/Trezor.Net/issues/10/comments","events_url":"https://api.github.com/repos/MelbourneDeveloper/Trezor.Net/issues/10/events","html_url":"https://github.com/MelbourneDeveloper/Trezor.Net/issues/10","id":370002809,"node_id":"MDU6SXNzdWUzNzAwMDI4MDk=","number":10,"title":"Ethereum transaction signing issues","user":{"login":"ThatSlyGuy","id":19557547,"node_id":"MDQ6VXNlcjE5NTU3NTQ3","avatar_url":"https://avatars1.githubusercontent.com/u/19557547?v=4","gravatar_id":"","url":"https://api.github.com/users/ThatSlyGuy","html_url":"https://github.com/ThatSlyGuy","followers_url":"https://api.github.com/users/ThatSlyGuy/followers","following_url":"https://api.github.com/users/ThatSlyGuy/following{/other_user}","gists_url":"https://api.github.com/users/ThatSlyGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/ThatSlyGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThatSlyGuy/subscriptions","organizations_url":"https://api.github.com/users/ThatSlyGuy/orgs","repos_url":"https://api.github.com/users/ThatSlyGuy/repos","events_url":"https://api.github.com/users/ThatSlyGuy/events{/privacy}","received_events_url":"https://api.github.com/users/ThatSlyGuy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":30,"created_at":"2018-10-15T05:21:03Z","updated_at":"2018-10-17T20:09:05Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"In the current state of the Trezor.Net library, there are some very strange results when attempting to sign an Ethereum transaction. \r\n\r\nThis is the code I am using to try and sign a transaction:\r\n\r\n```c#\r\n[TestMethod]\r\npublic async Task SignEthereumTransaction()\r\n{\r\n    await GetAndInitialize();\r\n\r\n    //Note: these are not reasonable values. They should not be used for a transaction. Looking for a better example here...\r\n    var txMessage = new EthereumSignTx\r\n    {\r\n        Nonce = 0.ToHexBytes(),\r\n        GasPrice = 1000000000.ToHexBytes(),\r\n        GasLimit = 21000.ToHexBytes(),\r\n        To = \"689c56aef474df92d44a1b70850f808488f9769c\".ToHexBytes(),\r\n        Value = 100000000000000.ToHexBytes(),\r\n        AddressNs = ManagerHelpers.GetAddressPath(false, 0, false, 0, 60),\r\n        ChainId = 4\r\n    };\r\n\r\n    var transaction = await TrezorManager.SendMessageAsync<EthereumTxRequest, EthereumSignTx>(txMessage);\r\n\r\n    Assert.AreEqual(transaction.SignatureR.Length, 32);\r\n    Assert.AreEqual(transaction.SignatureS.Length, 32);\r\n}\r\n```\r\n\r\nThe transaction signing goes wrong in a few different areas. \r\n\r\nFirstly, when attempting to sign a transaction on the Rinkeby network through https://mycrypto.com, we can see the output on our device as something related to the following:\r\n\r\n> Send 1.0 tEth to 0x689c56aef474df92d44a1b70850f808488f9769c?\r\n\r\nAfter confirming this, we get the next message:\r\n\r\n> Really send 1.0 tEth paying up to 0.000021 tEth for gas?\r\n\r\nWhen attempting to sign the same transaction through Trezor.Net, we get the something similar to the following:\r\n\r\n> Send message to 0x689c56aef474df92d44a1b70850f808488f97600\r\n\r\nAfter confirming this, we'll get this next message: \r\n\r\n> Really send message paying up to 0.000021 UNKN for gas?\r\n\r\nThe first bit of strange behavior is with the fact that even though we are sending an `EthereumSignTx`, the Trezor is interpreting it as signing a message through `EthereumSignMessage`. The text 'Send Message' should only really appear if we are signing a message through `EthereumSignMessage`.\r\n\r\nThe second bit of strange behavior is seen in the actual address. The address where the message is being sent to the device in its entirety it seems. Sometimes only the last few characters of the address will be '0', sometimes it will be many more. \r\n\r\nThe last bit of strange behavior is that the Trezor doesn't seem to recognize the ChainCode that we have entered, and therefore states we are trying pay the transaction fee with currency UNKN.\r\n\r\nI'm not really sure where the issue lies in all of this, but clearly something is up. "},"comment":{"url":"https://api.github.com/repos/MelbourneDeveloper/Trezor.Net/issues/comments/430770380","html_url":"https://github.com/MelbourneDeveloper/Trezor.Net/issues/10#issuecomment-430770380","issue_url":"https://api.github.com/repos/MelbourneDeveloper/Trezor.Net/issues/10","id":430770380,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDc3MDM4MA==","user":{"login":"MelbourneDeveloper","id":16697547,"node_id":"MDQ6VXNlcjE2Njk3NTQ3","avatar_url":"https://avatars0.githubusercontent.com/u/16697547?v=4","gravatar_id":"","url":"https://api.github.com/users/MelbourneDeveloper","html_url":"https://github.com/MelbourneDeveloper","followers_url":"https://api.github.com/users/MelbourneDeveloper/followers","following_url":"https://api.github.com/users/MelbourneDeveloper/following{/other_user}","gists_url":"https://api.github.com/users/MelbourneDeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/MelbourneDeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MelbourneDeveloper/subscriptions","organizations_url":"https://api.github.com/users/MelbourneDeveloper/orgs","repos_url":"https://api.github.com/users/MelbourneDeveloper/repos","events_url":"https://api.github.com/users/MelbourneDeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/MelbourneDeveloper/received_events","type":"User","site_admin":false},"created_at":"2018-10-17T20:09:05Z","updated_at":"2018-10-17T20:09:05Z","author_association":"OWNER","body":"I have merged the fix in to master and will do a NuGet release.\r\n\r\n@ThatSlyGuy @juanfranblanco so transactions are all good now? I can close these issues?"}}
{"actor":{"display_login":"MelbourneDeveloper"}}