{"action":"created","comment":{"url":"https://api.github.com/repos/zcash/zcash/pulls/comments/76001261","id":76001261,"diff_hunk":"@@ -70,6 +71,47 @@ const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const\n     return &(it->second);\n }\n \n+// Generate a new spending key and return its public payment address\n+CZCPaymentAddress CWallet::GenerateNewZKey()\n+{\n+    AssertLockHeld(cs_wallet); // mapZKeyMetadata\n+    auto k = SpendingKey::random();\n+    auto addr = k.address();\n+\n+    // Check for collision, even though it is unlikely to ever occur\n+    if (CCryptoKeyStore::HaveSpendingKey(addr))\n+        throw std::runtime_error(\"CWallet::GenerateNewZKey(): Collision detected\");","path":"src/wallet/wallet.cpp","position":21,"original_position":21,"commit_id":"aa4463fc120e75fd8e9f5fee8f444ece0da9178a","original_commit_id":"61eae0087985b2a14e5baffc7596e55748ec8cd7","user":{"login":"defuse","id":4211072,"avatar_url":"https://avatars.githubusercontent.com/u/4211072?v=3","gravatar_id":"","url":"https://api.github.com/users/defuse","html_url":"https://github.com/defuse","followers_url":"https://api.github.com/users/defuse/followers","following_url":"https://api.github.com/users/defuse/following{/other_user}","gists_url":"https://api.github.com/users/defuse/gists{/gist_id}","starred_url":"https://api.github.com/users/defuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/defuse/subscriptions","organizations_url":"https://api.github.com/users/defuse/orgs","repos_url":"https://api.github.com/users/defuse/repos","events_url":"https://api.github.com/users/defuse/events{/privacy}","received_events_url":"https://api.github.com/users/defuse/received_events","type":"User","site_admin":false},"body":"Maybe we should get rid of this check and instead add a unit tests that looks for collisions in 1000 randomly-generated addresses?","created_at":"2016-08-24T06:33:34Z","updated_at":"2016-08-24T06:33:34Z","html_url":"https://github.com/zcash/zcash/pull/1208#discussion_r76001261","pull_request_url":"https://api.github.com/repos/zcash/zcash/pulls/1208","_links":{"self":{"href":"https://api.github.com/repos/zcash/zcash/pulls/comments/76001261"},"html":{"href":"https://github.com/zcash/zcash/pull/1208#discussion_r76001261"},"pull_request":{"href":"https://api.github.com/repos/zcash/zcash/pulls/1208"}}},"pull_request":{"url":"https://api.github.com/repos/zcash/zcash/pulls/1208","id":80740280,"html_url":"https://github.com/zcash/zcash/pull/1208","diff_url":"https://github.com/zcash/zcash/pull/1208.diff","patch_url":"https://github.com/zcash/zcash/pull/1208.patch","issue_url":"https://api.github.com/repos/zcash/zcash/issues/1208","number":1208,"state":"open","locked":false,"title":"RPC calls to manage zkey creation, management and backup","user":{"login":"bitcartel","id":194979,"avatar_url":"https://avatars.githubusercontent.com/u/194979?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcartel","html_url":"https://github.com/bitcartel","followers_url":"https://api.github.com/users/bitcartel/followers","following_url":"https://api.github.com/users/bitcartel/following{/other_user}","gists_url":"https://api.github.com/users/bitcartel/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcartel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcartel/subscriptions","organizations_url":"https://api.github.com/users/bitcartel/orgs","repos_url":"https://api.github.com/users/bitcartel/repos","events_url":"https://api.github.com/users/bitcartel/events{/privacy}","received_events_url":"https://api.github.com/users/bitcartel/received_events","type":"User","site_admin":false},"body":"Rebased on PR #1205 for keystore functionality.\r\n\r\nFor #1197, implements:\r\nz_getnewaddress\r\nz_importkey\r\nz_exportkey\r\n\r\nFor #1198, spending key support added to:\r\nz_exportwallet\r\nz_importwallet\r\n\r\nExample dump file containing zkeys:\r\nhttps://gist.github.com/bitcartel/d7013b30b19419c6a550bc5d6ff6cc47\r\n\r\nAlso adds:\r\nz_listaddresses\r\n\r\nTests in:\r\ngtest/test_wallet_zkeys\r\ntest/rpc_wallet_tests","created_at":"2016-08-10T06:21:56Z","updated_at":"2016-08-24T06:33:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cab008e019f0b848cf2f1604b52d21e9d6f6f4ff","assignee":{"login":"bitcartel","id":194979,"avatar_url":"https://avatars.githubusercontent.com/u/194979?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcartel","html_url":"https://github.com/bitcartel","followers_url":"https://api.github.com/users/bitcartel/followers","following_url":"https://api.github.com/users/bitcartel/following{/other_user}","gists_url":"https://api.github.com/users/bitcartel/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcartel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcartel/subscriptions","organizations_url":"https://api.github.com/users/bitcartel/orgs","repos_url":"https://api.github.com/users/bitcartel/repos","events_url":"https://api.github.com/users/bitcartel/events{/privacy}","received_events_url":"https://api.github.com/users/bitcartel/received_events","type":"User","site_admin":false},"assignees":[{"login":"bitcartel","id":194979,"avatar_url":"https://avatars.githubusercontent.com/u/194979?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcartel","html_url":"https://github.com/bitcartel","followers_url":"https://api.github.com/users/bitcartel/followers","following_url":"https://api.github.com/users/bitcartel/following{/other_user}","gists_url":"https://api.github.com/users/bitcartel/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcartel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcartel/subscriptions","organizations_url":"https://api.github.com/users/bitcartel/orgs","repos_url":"https://api.github.com/users/bitcartel/repos","events_url":"https://api.github.com/users/bitcartel/events{/privacy}","received_events_url":"https://api.github.com/users/bitcartel/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/zcash/zcash/milestones/27","html_url":"https://github.com/zcash/zcash/milestones/z9%20Release%20-%20RPC,%20Testing%20improvements","labels_url":"https://api.github.com/repos/zcash/zcash/milestones/27/labels","id":1670694,"number":27,"title":"z9 Release - RPC, Testing improvements","description":"","creator":{"login":"nathan-at-least","id":4369700,"avatar_url":"https://avatars.githubusercontent.com/u/4369700?v=3","gravatar_id":"","url":"https://api.github.com/users/nathan-at-least","html_url":"https://github.com/nathan-at-least","followers_url":"https://api.github.com/users/nathan-at-least/followers","following_url":"https://api.github.com/users/nathan-at-least/following{/other_user}","gists_url":"https://api.github.com/users/nathan-at-least/gists{/gist_id}","starred_url":"https://api.github.com/users/nathan-at-least/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathan-at-least/subscriptions","organizations_url":"https://api.github.com/users/nathan-at-least/orgs","repos_url":"https://api.github.com/users/nathan-at-least/repos","events_url":"https://api.github.com/users/nathan-at-least/events{/privacy}","received_events_url":"https://api.github.com/users/nathan-at-least/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":32,"state":"open","created_at":"2016-03-28T23:10:42Z","updated_at":"2016-08-24T06:15:37Z","due_on":"2016-08-24T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/zcash/zcash/pulls/1208/commits","review_comments_url":"https://api.github.com/repos/zcash/zcash/pulls/1208/comments","review_comment_url":"https://api.github.com/repos/zcash/zcash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zcash/zcash/issues/1208/comments","statuses_url":"https://api.github.com/repos/zcash/zcash/statuses/aa4463fc120e75fd8e9f5fee8f444ece0da9178a","head":{"label":"bitcartel:z8_rpc_keys","ref":"z8_rpc_keys","sha":"aa4463fc120e75fd8e9f5fee8f444ece0da9178a","user":{"login":"bitcartel","id":194979,"avatar_url":"https://avatars.githubusercontent.com/u/194979?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcartel","html_url":"https://github.com/bitcartel","followers_url":"https://api.github.com/users/bitcartel/followers","following_url":"https://api.github.com/users/bitcartel/following{/other_user}","gists_url":"https://api.github.com/users/bitcartel/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcartel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcartel/subscriptions","organizations_url":"https://api.github.com/users/bitcartel/orgs","repos_url":"https://api.github.com/users/bitcartel/repos","events_url":"https://api.github.com/users/bitcartel/events{/privacy}","received_events_url":"https://api.github.com/users/bitcartel/received_events","type":"User","site_admin":false},"repo":{"id":58775418,"name":"zcash","full_name":"bitcartel/zcash","owner":{"login":"bitcartel","id":194979,"avatar_url":"https://avatars.githubusercontent.com/u/194979?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcartel","html_url":"https://github.com/bitcartel","followers_url":"https://api.github.com/users/bitcartel/followers","following_url":"https://api.github.com/users/bitcartel/following{/other_user}","gists_url":"https://api.github.com/users/bitcartel/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcartel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcartel/subscriptions","organizations_url":"https://api.github.com/users/bitcartel/orgs","repos_url":"https://api.github.com/users/bitcartel/repos","events_url":"https://api.github.com/users/bitcartel/events{/privacy}","received_events_url":"https://api.github.com/users/bitcartel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bitcartel/zcash","description":"zcash","fork":true,"url":"https://api.github.com/repos/bitcartel/zcash","forks_url":"https://api.github.com/repos/bitcartel/zcash/forks","keys_url":"https://api.github.com/repos/bitcartel/zcash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcartel/zcash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcartel/zcash/teams","hooks_url":"https://api.github.com/repos/bitcartel/zcash/hooks","issue_events_url":"https://api.github.com/repos/bitcartel/zcash/issues/events{/number}","events_url":"https://api.github.com/repos/bitcartel/zcash/events","assignees_url":"https://api.github.com/repos/bitcartel/zcash/assignees{/user}","branches_url":"https://api.github.com/repos/bitcartel/zcash/branches{/branch}","tags_url":"https://api.github.com/repos/bitcartel/zcash/tags","blobs_url":"https://api.github.com/repos/bitcartel/zcash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcartel/zcash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcartel/zcash/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcartel/zcash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcartel/zcash/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcartel/zcash/languages","stargazers_url":"https://api.github.com/repos/bitcartel/zcash/stargazers","contributors_url":"https://api.github.com/repos/bitcartel/zcash/contributors","subscribers_url":"https://api.github.com/repos/bitcartel/zcash/subscribers","subscription_url":"https://api.github.com/repos/bitcartel/zcash/subscription","commits_url":"https://api.github.com/repos/bitcartel/zcash/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcartel/zcash/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcartel/zcash/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcartel/zcash/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcartel/zcash/contents/{+path}","compare_url":"https://api.github.com/repos/bitcartel/zcash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcartel/zcash/merges","archive_url":"https://api.github.com/repos/bitcartel/zcash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcartel/zcash/downloads","issues_url":"https://api.github.com/repos/bitcartel/zcash/issues{/number}","pulls_url":"https://api.github.com/repos/bitcartel/zcash/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcartel/zcash/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcartel/zcash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcartel/zcash/labels{/name}","releases_url":"https://api.github.com/repos/bitcartel/zcash/releases{/id}","deployments_url":"https://api.github.com/repos/bitcartel/zcash/deployments","created_at":"2016-05-13T22:11:54Z","updated_at":"2016-05-13T22:11:58Z","pushed_at":"2016-08-23T22:33:05Z","git_url":"git://github.com/bitcartel/zcash.git","ssh_url":"git@github.com:bitcartel/zcash.git","clone_url":"https://github.com/bitcartel/zcash.git","svn_url":"https://github.com/bitcartel/zcash","homepage":"https://z.cash/","size":42749,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"zc.v0.11.2.latest"}},"base":{"label":"zcash:zc.v0.11.2.latest","ref":"zc.v0.11.2.latest","sha":"27bd8e4129b4b72db528ca2a473c4d6fbe4eaf6a","user":{"login":"zcash","id":16122764,"avatar_url":"https://avatars.githubusercontent.com/u/16122764?v=3","gravatar_id":"","url":"https://api.github.com/users/zcash","html_url":"https://github.com/zcash","followers_url":"https://api.github.com/users/zcash/followers","following_url":"https://api.github.com/users/zcash/following{/other_user}","gists_url":"https://api.github.com/users/zcash/gists{/gist_id}","starred_url":"https://api.github.com/users/zcash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcash/subscriptions","organizations_url":"https://api.github.com/users/zcash/orgs","repos_url":"https://api.github.com/users/zcash/repos","events_url":"https://api.github.com/users/zcash/events{/privacy}","received_events_url":"https://api.github.com/users/zcash/received_events","type":"Organization","site_admin":false},"repo":{"id":26987049,"name":"zcash","full_name":"zcash/zcash","owner":{"login":"zcash","id":16122764,"avatar_url":"https://avatars.githubusercontent.com/u/16122764?v=3","gravatar_id":"","url":"https://api.github.com/users/zcash","html_url":"https://github.com/zcash","followers_url":"https://api.github.com/users/zcash/followers","following_url":"https://api.github.com/users/zcash/following{/other_user}","gists_url":"https://api.github.com/users/zcash/gists{/gist_id}","starred_url":"https://api.github.com/users/zcash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcash/subscriptions","organizations_url":"https://api.github.com/users/zcash/orgs","repos_url":"https://api.github.com/users/zcash/repos","events_url":"https://api.github.com/users/zcash/events{/privacy}","received_events_url":"https://api.github.com/users/zcash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zcash/zcash","description":"zcash","fork":false,"url":"https://api.github.com/repos/zcash/zcash","forks_url":"https://api.github.com/repos/zcash/zcash/forks","keys_url":"https://api.github.com/repos/zcash/zcash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zcash/zcash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zcash/zcash/teams","hooks_url":"https://api.github.com/repos/zcash/zcash/hooks","issue_events_url":"https://api.github.com/repos/zcash/zcash/issues/events{/number}","events_url":"https://api.github.com/repos/zcash/zcash/events","assignees_url":"https://api.github.com/repos/zcash/zcash/assignees{/user}","branches_url":"https://api.github.com/repos/zcash/zcash/branches{/branch}","tags_url":"https://api.github.com/repos/zcash/zcash/tags","blobs_url":"https://api.github.com/repos/zcash/zcash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zcash/zcash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zcash/zcash/git/refs{/sha}","trees_url":"https://api.github.com/repos/zcash/zcash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zcash/zcash/statuses/{sha}","languages_url":"https://api.github.com/repos/zcash/zcash/languages","stargazers_url":"https://api.github.com/repos/zcash/zcash/stargazers","contributors_url":"https://api.github.com/repos/zcash/zcash/contributors","subscribers_url":"https://api.github.com/repos/zcash/zcash/subscribers","subscription_url":"https://api.github.com/repos/zcash/zcash/subscription","commits_url":"https://api.github.com/repos/zcash/zcash/commits{/sha}","git_commits_url":"https://api.github.com/repos/zcash/zcash/git/commits{/sha}","comments_url":"https://api.github.com/repos/zcash/zcash/comments{/number}","issue_comment_url":"https://api.github.com/repos/zcash/zcash/issues/comments{/number}","contents_url":"https://api.github.com/repos/zcash/zcash/contents/{+path}","compare_url":"https://api.github.com/repos/zcash/zcash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zcash/zcash/merges","archive_url":"https://api.github.com/repos/zcash/zcash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zcash/zcash/downloads","issues_url":"https://api.github.com/repos/zcash/zcash/issues{/number}","pulls_url":"https://api.github.com/repos/zcash/zcash/pulls{/number}","milestones_url":"https://api.github.com/repos/zcash/zcash/milestones{/number}","notifications_url":"https://api.github.com/repos/zcash/zcash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zcash/zcash/labels{/name}","releases_url":"https://api.github.com/repos/zcash/zcash/releases{/id}","deployments_url":"https://api.github.com/repos/zcash/zcash/deployments","created_at":"2014-11-22T03:13:10Z","updated_at":"2016-08-23T20:49:43Z","pushed_at":"2016-08-24T06:15:36Z","git_url":"git://github.com/zcash/zcash.git","ssh_url":"git@github.com:zcash/zcash.git","clone_url":"https://github.com/zcash/zcash.git","svn_url":"https://github.com/zcash/zcash","homepage":"https://z.cash/","size":49587,"stargazers_count":895,"watchers_count":895,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":389,"forks":99,"open_issues":389,"watchers":895,"default_branch":"zc.v0.11.2.latest"}},"_links":{"self":{"href":"https://api.github.com/repos/zcash/zcash/pulls/1208"},"html":{"href":"https://github.com/zcash/zcash/pull/1208"},"issue":{"href":"https://api.github.com/repos/zcash/zcash/issues/1208"},"comments":{"href":"https://api.github.com/repos/zcash/zcash/issues/1208/comments"},"review_comments":{"href":"https://api.github.com/repos/zcash/zcash/pulls/1208/comments"},"review_comment":{"href":"https://api.github.com/repos/zcash/zcash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zcash/zcash/pulls/1208/commits"},"statuses":{"href":"https://api.github.com/repos/zcash/zcash/statuses/aa4463fc120e75fd8e9f5fee8f444ece0da9178a"}}}}
{"actor":{"display_login":"defuse"}}