{"action":"created","comment":{"url":"https://api.github.com/repos/monero-project/monero/pulls/comments/170050929","pull_request_review_id":98677913,"id":170050929,"diff_hunk":"@@ -173,10 +191,14 @@ namespace crypto {\n     assert(end <= buf.output_index + sizeof buf.output_index);\n     hash_to_scalar(&buf, end - reinterpret_cast<char *>(&buf), res);\n   }\n+  void derivation_to_scalar(const key_derivation &derivation, size_t output_index, ec_scalar &res, hw::Device &device) {\n+    device.derivation_to_scalar(derivation, output_index, res);\n+  }\n+\n \n   bool crypto_ops::derive_public_key(const key_derivation &derivation, size_t output_index,\n     const public_key &base, public_key &derived_key) {\n-    ec_scalar scalar;\n+    crypto::ec_scalar scalar;","path":"src/crypto/crypto.cpp","position":63,"original_position":63,"commit_id":"35e3a63ca167ae93b55f4bae56beb4687536cc40","original_commit_id":"35e3a63ca167ae93b55f4bae56beb4687536cc40","user":{"login":"cslashm","id":5478387,"avatar_url":"https://avatars3.githubusercontent.com/u/5478387?v=4","gravatar_id":"","url":"https://api.github.com/users/cslashm","html_url":"https://github.com/cslashm","followers_url":"https://api.github.com/users/cslashm/followers","following_url":"https://api.github.com/users/cslashm/following{/other_user}","gists_url":"https://api.github.com/users/cslashm/gists{/gist_id}","starred_url":"https://api.github.com/users/cslashm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cslashm/subscriptions","organizations_url":"https://api.github.com/users/cslashm/orgs","repos_url":"https://api.github.com/users/cslashm/repos","events_url":"https://api.github.com/users/cslashm/events{/privacy}","received_events_url":"https://api.github.com/users/cslashm/received_events","type":"User","site_admin":false},"body":"same thing, will try to remove that tomorrow.","created_at":"2018-02-22T18:29:50Z","updated_at":"2018-02-22T18:29:50Z","html_url":"https://github.com/monero-project/monero/pull/3303#discussion_r170050929","pull_request_url":"https://api.github.com/repos/monero-project/monero/pulls/3303","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/monero-project/monero/pulls/comments/170050929"},"html":{"href":"https://github.com/monero-project/monero/pull/3303#discussion_r170050929"},"pull_request":{"href":"https://api.github.com/repos/monero-project/monero/pulls/3303"}},"in_reply_to_id":169947386},"pull_request":{"url":"https://api.github.com/repos/monero-project/monero/pulls/3303","id":170549266,"html_url":"https://github.com/monero-project/monero/pull/3303","diff_url":"https://github.com/monero-project/monero/pull/3303.diff","patch_url":"https://github.com/monero-project/monero/pull/3303.patch","issue_url":"https://api.github.com/repos/monero-project/monero/issues/3303","number":3303,"state":"open","locked":false,"title":"Ledger Nano S","user":{"login":"cslashm","id":5478387,"avatar_url":"https://avatars3.githubusercontent.com/u/5478387?v=4","gravatar_id":"","url":"https://api.github.com/users/cslashm","html_url":"https://github.com/cslashm","followers_url":"https://api.github.com/users/cslashm/followers","following_url":"https://api.github.com/users/cslashm/following{/other_user}","gists_url":"https://api.github.com/users/cslashm/gists{/gist_id}","starred_url":"https://api.github.com/users/cslashm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cslashm/subscriptions","organizations_url":"https://api.github.com/users/cslashm/orgs","repos_url":"https://api.github.com/users/cslashm/repos","events_url":"https://api.github.com/users/cslashm/events{/privacy}","received_events_url":"https://api.github.com/users/cslashm/received_events","type":"User","site_admin":false},"body":"This a new push request for Hardware Wallet support in Monero client.\r\n\r\nIt replaces the push request #3095 \r\n\r\n# Goals\r\n\r\nThe goal of this PR is to propose code modifications to integrate the ledger HW into \r\nmonero-wallet-cli. \r\n\r\n# Approach\r\n\r\nThe idea relies on 2 main principles:\r\n\r\n  - master spend key and view key never leave the device\r\n  - all other needed secret are computed by the device but stored encrypted by the Monero client\r\n\r\nThe basic approach it to delegate all sensitive data (master key, secret ephemeral key, \r\nkey derivation, ....) and related operations to the device. As the device as low\r\nmemory the device do not keep itself the values (except for view/spend keys) but once\r\ncomputed  there are encrypted (AES) and return back to monero-wallet-cli. When\r\nthey need to be manipulated by the device, they are decrypted on receive.\r\n\r\nMoreover using the client for storing the value in encrypted form limits the modification\r\nin the client code. Those values are transfered from one C-structure to another one\r\nas previously.\r\n\r\nThe code is modified at tow main levels:\r\n\r\n. crypto operations, mainly crypto.cpp and cryptonote_format_utils.cpp\r\n. signature level, mainly rctSigs.cpp and cryptonote_tx_utils.cpp\r\n\r\nThe pdf (https://github.com/LedgerHQ/blue-app-monero/blob/master/doc/developer/blue-app-monero.pdf) gives more details (but is a little be obsolete)\r\n\r\nThe application device is located at https://github.com/LedgerHQ/blue-app-monero.\r\n\r\n\r\n# Open Integration \r\n\r\nThe integration has been done with the wishes to be open to any other hardware wallet.\r\nTo achieve that a C++ class hw::Device  has been introduce.  All the Monero\r\nclient code has been modified to use this new interface.\r\n\r\nTwo initial implementation are provided:\r\n\r\n- the \"default\", which remaps all call to initial Monero code\r\n- the \"ledger\", which delegates all call to Ledger device.\r\n\r\nNow any HW that provide a class Device implementation would be defacto\r\nsupported by the Monero client.\r\n\r\n# What works\r\n\r\nThe today code support sending and receiving moneroj. It support main and sub-address.\r\n\r\nIn the \"soon\" future, it will support proof of send, proof of reserve.\r\n\r\nThen will come other stuffs.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","created_at":"2018-02-21T18:18:41Z","updated_at":"2018-02-22T18:29:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"43a02a02b47f821db63b22d84858f4e9206fd63e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/monero-project/monero/pulls/3303/commits","review_comments_url":"https://api.github.com/repos/monero-project/monero/pulls/3303/comments","review_comment_url":"https://api.github.com/repos/monero-project/monero/pulls/comments{/number}","comments_url":"https://api.github.com/repos/monero-project/monero/issues/3303/comments","statuses_url":"https://api.github.com/repos/monero-project/monero/statuses/35e3a63ca167ae93b55f4bae56beb4687536cc40","head":{"label":"cslashm:Ledger-NanoS","ref":"Ledger-NanoS","sha":"35e3a63ca167ae93b55f4bae56beb4687536cc40","user":{"login":"cslashm","id":5478387,"avatar_url":"https://avatars3.githubusercontent.com/u/5478387?v=4","gravatar_id":"","url":"https://api.github.com/users/cslashm","html_url":"https://github.com/cslashm","followers_url":"https://api.github.com/users/cslashm/followers","following_url":"https://api.github.com/users/cslashm/following{/other_user}","gists_url":"https://api.github.com/users/cslashm/gists{/gist_id}","starred_url":"https://api.github.com/users/cslashm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cslashm/subscriptions","organizations_url":"https://api.github.com/users/cslashm/orgs","repos_url":"https://api.github.com/users/cslashm/repos","events_url":"https://api.github.com/users/cslashm/events{/privacy}","received_events_url":"https://api.github.com/users/cslashm/received_events","type":"User","site_admin":false},"repo":{"id":100196130,"name":"monero","full_name":"cslashm/monero","owner":{"login":"cslashm","id":5478387,"avatar_url":"https://avatars3.githubusercontent.com/u/5478387?v=4","gravatar_id":"","url":"https://api.github.com/users/cslashm","html_url":"https://github.com/cslashm","followers_url":"https://api.github.com/users/cslashm/followers","following_url":"https://api.github.com/users/cslashm/following{/other_user}","gists_url":"https://api.github.com/users/cslashm/gists{/gist_id}","starred_url":"https://api.github.com/users/cslashm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cslashm/subscriptions","organizations_url":"https://api.github.com/users/cslashm/orgs","repos_url":"https://api.github.com/users/cslashm/repos","events_url":"https://api.github.com/users/cslashm/events{/privacy}","received_events_url":"https://api.github.com/users/cslashm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cslashm/monero","description":"Monero: the secure, private, untraceable cryptocurrency","fork":true,"url":"https://api.github.com/repos/cslashm/monero","forks_url":"https://api.github.com/repos/cslashm/monero/forks","keys_url":"https://api.github.com/repos/cslashm/monero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cslashm/monero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cslashm/monero/teams","hooks_url":"https://api.github.com/repos/cslashm/monero/hooks","issue_events_url":"https://api.github.com/repos/cslashm/monero/issues/events{/number}","events_url":"https://api.github.com/repos/cslashm/monero/events","assignees_url":"https://api.github.com/repos/cslashm/monero/assignees{/user}","branches_url":"https://api.github.com/repos/cslashm/monero/branches{/branch}","tags_url":"https://api.github.com/repos/cslashm/monero/tags","blobs_url":"https://api.github.com/repos/cslashm/monero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cslashm/monero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cslashm/monero/git/refs{/sha}","trees_url":"https://api.github.com/repos/cslashm/monero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cslashm/monero/statuses/{sha}","languages_url":"https://api.github.com/repos/cslashm/monero/languages","stargazers_url":"https://api.github.com/repos/cslashm/monero/stargazers","contributors_url":"https://api.github.com/repos/cslashm/monero/contributors","subscribers_url":"https://api.github.com/repos/cslashm/monero/subscribers","subscription_url":"https://api.github.com/repos/cslashm/monero/subscription","commits_url":"https://api.github.com/repos/cslashm/monero/commits{/sha}","git_commits_url":"https://api.github.com/repos/cslashm/monero/git/commits{/sha}","comments_url":"https://api.github.com/repos/cslashm/monero/comments{/number}","issue_comment_url":"https://api.github.com/repos/cslashm/monero/issues/comments{/number}","contents_url":"https://api.github.com/repos/cslashm/monero/contents/{+path}","compare_url":"https://api.github.com/repos/cslashm/monero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cslashm/monero/merges","archive_url":"https://api.github.com/repos/cslashm/monero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cslashm/monero/downloads","issues_url":"https://api.github.com/repos/cslashm/monero/issues{/number}","pulls_url":"https://api.github.com/repos/cslashm/monero/pulls{/number}","milestones_url":"https://api.github.com/repos/cslashm/monero/milestones{/number}","notifications_url":"https://api.github.com/repos/cslashm/monero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cslashm/monero/labels{/name}","releases_url":"https://api.github.com/repos/cslashm/monero/releases{/id}","deployments_url":"https://api.github.com/repos/cslashm/monero/deployments","created_at":"2017-08-13T18:21:32Z","updated_at":"2018-01-08T09:49:11Z","pushed_at":"2018-02-21T17:20:46Z","git_url":"git://github.com/cslashm/monero.git","ssh_url":"git@github.com:cslashm/monero.git","clone_url":"https://github.com/cslashm/monero.git","svn_url":"https://github.com/cslashm/monero","homepage":"https://getmonero.org","size":137753,"stargazers_count":8,"watchers_count":8,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":8,"default_branch":"master"}},"base":{"label":"monero-project:master","ref":"master","sha":"421ab3119ce8ccbf73ad12d736d3daa897fa0347","user":{"login":"monero-project","id":7450663,"avatar_url":"https://avatars2.githubusercontent.com/u/7450663?v=4","gravatar_id":"","url":"https://api.github.com/users/monero-project","html_url":"https://github.com/monero-project","followers_url":"https://api.github.com/users/monero-project/followers","following_url":"https://api.github.com/users/monero-project/following{/other_user}","gists_url":"https://api.github.com/users/monero-project/gists{/gist_id}","starred_url":"https://api.github.com/users/monero-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monero-project/subscriptions","organizations_url":"https://api.github.com/users/monero-project/orgs","repos_url":"https://api.github.com/users/monero-project/repos","events_url":"https://api.github.com/users/monero-project/events{/privacy}","received_events_url":"https://api.github.com/users/monero-project/received_events","type":"User","site_admin":false},"repo":{"id":19316619,"name":"monero","full_name":"monero-project/monero","owner":{"login":"monero-project","id":7450663,"avatar_url":"https://avatars2.githubusercontent.com/u/7450663?v=4","gravatar_id":"","url":"https://api.github.com/users/monero-project","html_url":"https://github.com/monero-project","followers_url":"https://api.github.com/users/monero-project/followers","following_url":"https://api.github.com/users/monero-project/following{/other_user}","gists_url":"https://api.github.com/users/monero-project/gists{/gist_id}","starred_url":"https://api.github.com/users/monero-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monero-project/subscriptions","organizations_url":"https://api.github.com/users/monero-project/orgs","repos_url":"https://api.github.com/users/monero-project/repos","events_url":"https://api.github.com/users/monero-project/events{/privacy}","received_events_url":"https://api.github.com/users/monero-project/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/monero-project/monero","description":"Monero: the secure, private, untraceable cryptocurrency","fork":false,"url":"https://api.github.com/repos/monero-project/monero","forks_url":"https://api.github.com/repos/monero-project/monero/forks","keys_url":"https://api.github.com/repos/monero-project/monero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/monero-project/monero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/monero-project/monero/teams","hooks_url":"https://api.github.com/repos/monero-project/monero/hooks","issue_events_url":"https://api.github.com/repos/monero-project/monero/issues/events{/number}","events_url":"https://api.github.com/repos/monero-project/monero/events","assignees_url":"https://api.github.com/repos/monero-project/monero/assignees{/user}","branches_url":"https://api.github.com/repos/monero-project/monero/branches{/branch}","tags_url":"https://api.github.com/repos/monero-project/monero/tags","blobs_url":"https://api.github.com/repos/monero-project/monero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/monero-project/monero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/monero-project/monero/git/refs{/sha}","trees_url":"https://api.github.com/repos/monero-project/monero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/monero-project/monero/statuses/{sha}","languages_url":"https://api.github.com/repos/monero-project/monero/languages","stargazers_url":"https://api.github.com/repos/monero-project/monero/stargazers","contributors_url":"https://api.github.com/repos/monero-project/monero/contributors","subscribers_url":"https://api.github.com/repos/monero-project/monero/subscribers","subscription_url":"https://api.github.com/repos/monero-project/monero/subscription","commits_url":"https://api.github.com/repos/monero-project/monero/commits{/sha}","git_commits_url":"https://api.github.com/repos/monero-project/monero/git/commits{/sha}","comments_url":"https://api.github.com/repos/monero-project/monero/comments{/number}","issue_comment_url":"https://api.github.com/repos/monero-project/monero/issues/comments{/number}","contents_url":"https://api.github.com/repos/monero-project/monero/contents/{+path}","compare_url":"https://api.github.com/repos/monero-project/monero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/monero-project/monero/merges","archive_url":"https://api.github.com/repos/monero-project/monero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/monero-project/monero/downloads","issues_url":"https://api.github.com/repos/monero-project/monero/issues{/number}","pulls_url":"https://api.github.com/repos/monero-project/monero/pulls{/number}","milestones_url":"https://api.github.com/repos/monero-project/monero/milestones{/number}","notifications_url":"https://api.github.com/repos/monero-project/monero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/monero-project/monero/labels{/name}","releases_url":"https://api.github.com/repos/monero-project/monero/releases{/id}","deployments_url":"https://api.github.com/repos/monero-project/monero/deployments","created_at":"2014-04-30T14:38:28Z","updated_at":"2018-02-22T15:57:32Z","pushed_at":"2018-02-22T14:00:38Z","git_url":"git://github.com/monero-project/monero.git","ssh_url":"git@github.com:monero-project/monero.git","clone_url":"https://github.com/monero-project/monero.git","svn_url":"https://github.com/monero-project/monero","homepage":"https://getmonero.org","size":137574,"stargazers_count":2539,"watchers_count":2539,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1143,"mirror_url":null,"archived":false,"open_issues_count":186,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1143,"open_issues":186,"watchers":2539,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/monero-project/monero/pulls/3303"},"html":{"href":"https://github.com/monero-project/monero/pull/3303"},"issue":{"href":"https://api.github.com/repos/monero-project/monero/issues/3303"},"comments":{"href":"https://api.github.com/repos/monero-project/monero/issues/3303/comments"},"review_comments":{"href":"https://api.github.com/repos/monero-project/monero/pulls/3303/comments"},"review_comment":{"href":"https://api.github.com/repos/monero-project/monero/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/monero-project/monero/pulls/3303/commits"},"statuses":{"href":"https://api.github.com/repos/monero-project/monero/statuses/35e3a63ca167ae93b55f4bae56beb4687536cc40"}},"author_association":"NONE"}}
{"actor":{"display_login":"cslashm"}}