{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/202532071","pull_request_review_id":137255445,"id":202532071,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjUzMjA3MQ==","diff_hunk":"@@ -1404,14 +1404,14 @@\n     \"P2PK with too much S padding\"\n ],\n [\n-    \"0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201\",\n+    \"0x47 0x3044022093c20fae34ef6ba13038515d18ece7374141b3f051e2cb93a78e4fd7f4e63f34022075037b8f491c746f92318816314c9269679d8702161b9c541f95bd9f029b3ac401\",","path":"src/test/data/script_tests.json","position":5,"original_position":5,"commit_id":"d7be065a0b5007d9eb09f70436f13b8ba2fcc1f5","original_commit_id":"d7be065a0b5007d9eb09f70436f13b8ba2fcc1f5","user":{"login":"achow101","id":3782274,"node_id":"MDQ6VXNlcjM3ODIyNzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3782274?v=4","gravatar_id":"","url":"https://api.github.com/users/achow101","html_url":"https://github.com/achow101","followers_url":"https://api.github.com/users/achow101/followers","following_url":"https://api.github.com/users/achow101/following{/other_user}","gists_url":"https://api.github.com/users/achow101/gists{/gist_id}","starred_url":"https://api.github.com/users/achow101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achow101/subscriptions","organizations_url":"https://api.github.com/users/achow101/orgs","repos_url":"https://api.github.com/users/achow101/repos","events_url":"https://api.github.com/users/achow101/events{/privacy}","received_events_url":"https://api.github.com/users/achow101/received_events","type":"User","site_admin":false},"body":"I assume that they are changing because they are signatures produced with an extra entropy value of 0 (provided by the test case, not the signing method). However in the signing method, an entropy value of 0 has the same meaning as no extra entropy provided which means that the signature will be ground for low R. So in order to get high R, the extra entropy value will need to increment so that a high R signature can be found which is going to result in a different signature.","created_at":"2018-07-15T05:50:17Z","updated_at":"2018-07-15T05:50:17Z","html_url":"https://github.com/bitcoin/bitcoin/pull/13666#discussion_r202532071","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13666","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/202532071"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/13666#discussion_r202532071"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13666"}},"in_reply_to_id":202531735},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13666","id":201481378,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNDgxMzc4","html_url":"https://github.com/bitcoin/bitcoin/pull/13666","diff_url":"https://github.com/bitcoin/bitcoin/pull/13666.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/13666.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13666","number":13666,"state":"open","locked":false,"title":"Always create 71 byte signatures with Low R values","user":{"login":"achow101","id":3782274,"node_id":"MDQ6VXNlcjM3ODIyNzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3782274?v=4","gravatar_id":"","url":"https://api.github.com/users/achow101","html_url":"https://github.com/achow101","followers_url":"https://api.github.com/users/achow101/followers","following_url":"https://api.github.com/users/achow101/following{/other_user}","gists_url":"https://api.github.com/users/achow101/gists{/gist_id}","starred_url":"https://api.github.com/users/achow101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achow101/subscriptions","organizations_url":"https://api.github.com/users/achow101/orgs","repos_url":"https://api.github.com/users/achow101/repos","events_url":"https://api.github.com/users/achow101/events{/privacy}","received_events_url":"https://api.github.com/users/achow101/received_events","type":"User","site_admin":false},"body":"When creating signatures for transactions, always make one which has a 32 byte R and 32 byte S value. This results in signatures that are always 71 bytes (32 byte R + 32 byte S + 6 bytes DER + 1 byte sighash) with low R values.\r\n\r\nBecause R is not mutable in the same way that S is, a low R value can only be found by trying different nonces. RFC 6979 for deterministic nonce generation has the option to specify additional entropy, so we simply use that and add a uin32_t counter which we increment in order to try different nonces. Nonces are sill deterministically generated as the nonce used will the be the first one where the counter results in a nonce that results in a low R value. Because different nonces need to be tried, time to produce a signature does increase. On average, it takes twice as long to make a signature as two signatures need to be created, on average, to find one with a low R.\r\n\r\nHaving a fixed size signature makes size calculations easier and also saves half a byte of transaction size, on average.\r\n\r\nDUMMY_SIGNATURE_CREATOR has been modified to produce 71 byte dummy signatures instead of 72 byte signatures.","created_at":"2018-07-15T05:10:24Z","updated_at":"2018-07-15T05:50:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6687dec1b678d447d4636ef29c561d9835d568f8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13666/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13666/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13666/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/d7be065a0b5007d9eb09f70436f13b8ba2fcc1f5","head":{"label":"achow101:low-r","ref":"low-r","sha":"d7be065a0b5007d9eb09f70436f13b8ba2fcc1f5","user":{"login":"achow101","id":3782274,"node_id":"MDQ6VXNlcjM3ODIyNzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3782274?v=4","gravatar_id":"","url":"https://api.github.com/users/achow101","html_url":"https://github.com/achow101","followers_url":"https://api.github.com/users/achow101/followers","following_url":"https://api.github.com/users/achow101/following{/other_user}","gists_url":"https://api.github.com/users/achow101/gists{/gist_id}","starred_url":"https://api.github.com/users/achow101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achow101/subscriptions","organizations_url":"https://api.github.com/users/achow101/orgs","repos_url":"https://api.github.com/users/achow101/repos","events_url":"https://api.github.com/users/achow101/events{/privacy}","received_events_url":"https://api.github.com/users/achow101/received_events","type":"User","site_admin":false},"repo":{"id":45006379,"node_id":"MDEwOlJlcG9zaXRvcnk0NTAwNjM3OQ==","name":"bitcoin","full_name":"achow101/bitcoin","owner":{"login":"achow101","id":3782274,"node_id":"MDQ6VXNlcjM3ODIyNzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3782274?v=4","gravatar_id":"","url":"https://api.github.com/users/achow101","html_url":"https://github.com/achow101","followers_url":"https://api.github.com/users/achow101/followers","following_url":"https://api.github.com/users/achow101/following{/other_user}","gists_url":"https://api.github.com/users/achow101/gists{/gist_id}","starred_url":"https://api.github.com/users/achow101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achow101/subscriptions","organizations_url":"https://api.github.com/users/achow101/orgs","repos_url":"https://api.github.com/users/achow101/repos","events_url":"https://api.github.com/users/achow101/events{/privacy}","received_events_url":"https://api.github.com/users/achow101/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/achow101/bitcoin","description":"Bitcoin Core integration/staging tree","fork":true,"url":"https://api.github.com/repos/achow101/bitcoin","forks_url":"https://api.github.com/repos/achow101/bitcoin/forks","keys_url":"https://api.github.com/repos/achow101/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/achow101/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/achow101/bitcoin/teams","hooks_url":"https://api.github.com/repos/achow101/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/achow101/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/achow101/bitcoin/events","assignees_url":"https://api.github.com/repos/achow101/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/achow101/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/achow101/bitcoin/tags","blobs_url":"https://api.github.com/repos/achow101/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/achow101/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/achow101/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/achow101/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/achow101/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/achow101/bitcoin/languages","stargazers_url":"https://api.github.com/repos/achow101/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/achow101/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/achow101/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/achow101/bitcoin/subscription","commits_url":"https://api.github.com/repos/achow101/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/achow101/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/achow101/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/achow101/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/achow101/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/achow101/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/achow101/bitcoin/merges","archive_url":"https://api.github.com/repos/achow101/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/achow101/bitcoin/downloads","issues_url":"https://api.github.com/repos/achow101/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/achow101/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/achow101/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/achow101/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/achow101/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/achow101/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/achow101/bitcoin/deployments","created_at":"2015-10-27T00:20:28Z","updated_at":"2018-07-13T02:01:45Z","pushed_at":"2018-07-15T02:20:03Z","git_url":"git://github.com/achow101/bitcoin.git","ssh_url":"git@github.com:achow101/bitcoin.git","clone_url":"https://github.com/achow101/bitcoin.git","svn_url":"https://github.com/achow101/bitcoin","homepage":"https://bitcoin.org/en/download","size":109176,"stargazers_count":6,"watchers_count":6,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":6,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"8803c9132a78d8182bd828a29f7051fc7688f934","user":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgxOTI3","name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2018-07-15T05:34:04Z","pushed_at":"2018-07-15T05:10:25Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":106317,"stargazers_count":33198,"watchers_count":33198,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":20048,"mirror_url":null,"archived":false,"open_issues_count":805,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":20048,"open_issues":805,"watchers":33198,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13666"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/13666"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13666"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13666/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13666/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13666/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/d7be065a0b5007d9eb09f70436f13b8ba2fcc1f5"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"achow101"}}