{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/comments/35489798","id":35489798,"diff_hunk":"@@ -13,50 +12,55 @@ function findScriptTypeByVersion (version) {\n   }\n }\n \n-function Address (hash, version) {\n-  typeForce('Buffer', hash)\n-\n-  assert.strictEqual(hash.length, 20, 'Invalid hash length')\n-  assert.strictEqual(version & 0xff, version, 'Invalid version byte')\n-\n-  this.hash = hash\n-  this.version = version\n-}\n-\n-Address.fromBase58Check = function (string) {\n+function fromBase58Check (string) {\n   var payload = base58check.decode(string)\n+  if (payload.length !== 21) throw new TypeError('Invalid address length')\n+\n   var version = payload.readUInt8(0)\n   var hash = payload.slice(1)\n \n-  return new Address(hash, version)\n+  return { hash: hash, version: version }\n }\n \n-Address.fromOutputScript = function (script, network) {\n+function fromOutputScript (script, network) {\n   network = network || networks.bitcoin\n \n-  if (scripts.isPubKeyHashOutput(script)) return new Address(script.chunks[2], network.pubKeyHash)\n-  if (scripts.isScriptHashOutput(script)) return new Address(script.chunks[1], network.scriptHash)\n+  if (scripts.isPubKeyHashOutput(script)) return toBase58Check(script.chunks[2], network.pubKeyHash)\n+  if (scripts.isScriptHashOutput(script)) return toBase58Check(script.chunks[1], network.scriptHash)","path":"src/address.js","position":38,"original_position":38,"commit_id":"1a4000cc98a23cf77705333a98bc99a89948276d","original_commit_id":"1a4000cc98a23cf77705333a98bc99a89948276d","user":{"login":"weilu","id":412533,"avatar_url":"https://avatars.githubusercontent.com/u/412533?v=3","gravatar_id":"","url":"https://api.github.com/users/weilu","html_url":"https://github.com/weilu","followers_url":"https://api.github.com/users/weilu/followers","following_url":"https://api.github.com/users/weilu/following{/other_user}","gists_url":"https://api.github.com/users/weilu/gists{/gist_id}","starred_url":"https://api.github.com/users/weilu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weilu/subscriptions","organizations_url":"https://api.github.com/users/weilu/orgs","repos_url":"https://api.github.com/users/weilu/repos","events_url":"https://api.github.com/users/weilu/events{/privacy}","received_events_url":"https://api.github.com/users/weilu/received_events","type":"User","site_admin":false},"body":"Similarly here, an object with `hash` and `version` seems like a half backed internal representation. I'd rather this returning a base58 encoded string instead.","created_at":"2015-07-26T06:22:10Z","updated_at":"2015-07-26T06:22:10Z","html_url":"https://github.com/bitcoinjs/bitcoinjs-lib/pull/401#discussion_r35489798","pull_request_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/401","_links":{"self":{"href":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/comments/35489798"},"html":{"href":"https://github.com/bitcoinjs/bitcoinjs-lib/pull/401#discussion_r35489798"},"pull_request":{"href":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/401"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/401","id":34227965,"html_url":"https://github.com/bitcoinjs/bitcoinjs-lib/pull/401","diff_url":"https://github.com/bitcoinjs/bitcoinjs-lib/pull/401.diff","patch_url":"https://github.com/bitcoinjs/bitcoinjs-lib/pull/401.patch","issue_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/401","number":401,"state":"open","locked":false,"title":"Remove instantiable Address","user":{"login":"dcousens","id":413395,"avatar_url":"https://avatars.githubusercontent.com/u/413395?v=3","gravatar_id":"","url":"https://api.github.com/users/dcousens","html_url":"https://github.com/dcousens","followers_url":"https://api.github.com/users/dcousens/followers","following_url":"https://api.github.com/users/dcousens/following{/other_user}","gists_url":"https://api.github.com/users/dcousens/gists{/gist_id}","starred_url":"https://api.github.com/users/dcousens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcousens/subscriptions","organizations_url":"https://api.github.com/users/dcousens/orgs","repos_url":"https://api.github.com/users/dcousens/repos","events_url":"https://api.github.com/users/dcousens/events{/privacy}","received_events_url":"https://api.github.com/users/dcousens/received_events","type":"User","site_admin":false},"body":"~~WIP pull request.~~ Ready to merge","created_at":"2015-04-28T02:07:15Z","updated_at":"2015-07-26T06:22:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e43b5e2a78aa74a2161597ae855e5a7ec8f8bf96","assignee":{"login":"dcousens","id":413395,"avatar_url":"https://avatars.githubusercontent.com/u/413395?v=3","gravatar_id":"","url":"https://api.github.com/users/dcousens","html_url":"https://github.com/dcousens","followers_url":"https://api.github.com/users/dcousens/followers","following_url":"https://api.github.com/users/dcousens/following{/other_user}","gists_url":"https://api.github.com/users/dcousens/gists{/gist_id}","starred_url":"https://api.github.com/users/dcousens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcousens/subscriptions","organizations_url":"https://api.github.com/users/dcousens/orgs","repos_url":"https://api.github.com/users/dcousens/repos","events_url":"https://api.github.com/users/dcousens/events{/privacy}","received_events_url":"https://api.github.com/users/dcousens/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/milestones/1","html_url":"https://github.com/bitcoinjs/bitcoinjs-lib/milestones/2.0.0","labels_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/milestones/1/labels","id":778601,"number":1,"title":"2.0.0","description":null,"creator":{"login":"dcousens","id":413395,"avatar_url":"https://avatars.githubusercontent.com/u/413395?v=3","gravatar_id":"","url":"https://api.github.com/users/dcousens","html_url":"https://github.com/dcousens","followers_url":"https://api.github.com/users/dcousens/followers","following_url":"https://api.github.com/users/dcousens/following{/other_user}","gists_url":"https://api.github.com/users/dcousens/gists{/gist_id}","starred_url":"https://api.github.com/users/dcousens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcousens/subscriptions","organizations_url":"https://api.github.com/users/dcousens/orgs","repos_url":"https://api.github.com/users/dcousens/repos","events_url":"https://api.github.com/users/dcousens/events{/privacy}","received_events_url":"https://api.github.com/users/dcousens/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":26,"state":"open","created_at":"2014-09-04T15:37:23Z","updated_at":"2015-07-24T02:24:56Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/401/commits","review_comments_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/401/comments","review_comment_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/401/comments","statuses_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/statuses/1a4000cc98a23cf77705333a98bc99a89948276d","head":{"label":"bitcoinjs:noaddr","ref":"noaddr","sha":"1a4000cc98a23cf77705333a98bc99a89948276d","user":{"login":"bitcoinjs","id":756696,"avatar_url":"https://avatars.githubusercontent.com/u/756696?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoinjs","html_url":"https://github.com/bitcoinjs","followers_url":"https://api.github.com/users/bitcoinjs/followers","following_url":"https://api.github.com/users/bitcoinjs/following{/other_user}","gists_url":"https://api.github.com/users/bitcoinjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoinjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoinjs/subscriptions","organizations_url":"https://api.github.com/users/bitcoinjs/orgs","repos_url":"https://api.github.com/users/bitcoinjs/repos","events_url":"https://api.github.com/users/bitcoinjs/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoinjs/received_events","type":"Organization","site_admin":false},"repo":{"id":1701968,"name":"bitcoinjs-lib","full_name":"bitcoinjs/bitcoinjs-lib","owner":{"login":"bitcoinjs","id":756696,"avatar_url":"https://avatars.githubusercontent.com/u/756696?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoinjs","html_url":"https://github.com/bitcoinjs","followers_url":"https://api.github.com/users/bitcoinjs/followers","following_url":"https://api.github.com/users/bitcoinjs/following{/other_user}","gists_url":"https://api.github.com/users/bitcoinjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoinjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoinjs/subscriptions","organizations_url":"https://api.github.com/users/bitcoinjs/orgs","repos_url":"https://api.github.com/users/bitcoinjs/repos","events_url":"https://api.github.com/users/bitcoinjs/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoinjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoinjs/bitcoinjs-lib","description":"Bitcoin-related functions implemented in pure JavaScript","fork":false,"url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib","forks_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/forks","keys_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/teams","hooks_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/hooks","issue_events_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/events","assignees_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/tags","blobs_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/languages","stargazers_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/stargazers","contributors_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/contributors","subscribers_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/subscribers","subscription_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/subscription","commits_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/merges","archive_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/downloads","issues_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/labels{/name}","releases_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/releases{/id}","created_at":"2011-05-04T16:03:45Z","updated_at":"2015-07-26T06:14:06Z","pushed_at":"2015-07-24T03:55:28Z","git_url":"git://github.com/bitcoinjs/bitcoinjs-lib.git","ssh_url":"git@github.com:bitcoinjs/bitcoinjs-lib.git","clone_url":"https://github.com/bitcoinjs/bitcoinjs-lib.git","svn_url":"https://github.com/bitcoinjs/bitcoinjs-lib","homepage":"http://bitcoinjs.org","size":5587,"stargazers_count":872,"watchers_count":872,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":267,"mirror_url":null,"open_issues_count":17,"forks":267,"open_issues":17,"watchers":872,"default_branch":"master"}},"base":{"label":"bitcoinjs:master","ref":"master","sha":"5ce093739eea892ddff79ce33235c31f6fa0f95f","user":{"login":"bitcoinjs","id":756696,"avatar_url":"https://avatars.githubusercontent.com/u/756696?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoinjs","html_url":"https://github.com/bitcoinjs","followers_url":"https://api.github.com/users/bitcoinjs/followers","following_url":"https://api.github.com/users/bitcoinjs/following{/other_user}","gists_url":"https://api.github.com/users/bitcoinjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoinjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoinjs/subscriptions","organizations_url":"https://api.github.com/users/bitcoinjs/orgs","repos_url":"https://api.github.com/users/bitcoinjs/repos","events_url":"https://api.github.com/users/bitcoinjs/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoinjs/received_events","type":"Organization","site_admin":false},"repo":{"id":1701968,"name":"bitcoinjs-lib","full_name":"bitcoinjs/bitcoinjs-lib","owner":{"login":"bitcoinjs","id":756696,"avatar_url":"https://avatars.githubusercontent.com/u/756696?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoinjs","html_url":"https://github.com/bitcoinjs","followers_url":"https://api.github.com/users/bitcoinjs/followers","following_url":"https://api.github.com/users/bitcoinjs/following{/other_user}","gists_url":"https://api.github.com/users/bitcoinjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoinjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoinjs/subscriptions","organizations_url":"https://api.github.com/users/bitcoinjs/orgs","repos_url":"https://api.github.com/users/bitcoinjs/repos","events_url":"https://api.github.com/users/bitcoinjs/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoinjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoinjs/bitcoinjs-lib","description":"Bitcoin-related functions implemented in pure JavaScript","fork":false,"url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib","forks_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/forks","keys_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/teams","hooks_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/hooks","issue_events_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/events","assignees_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/tags","blobs_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/languages","stargazers_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/stargazers","contributors_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/contributors","subscribers_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/subscribers","subscription_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/subscription","commits_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/merges","archive_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/downloads","issues_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/labels{/name}","releases_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/releases{/id}","created_at":"2011-05-04T16:03:45Z","updated_at":"2015-07-26T06:14:06Z","pushed_at":"2015-07-24T03:55:28Z","git_url":"git://github.com/bitcoinjs/bitcoinjs-lib.git","ssh_url":"git@github.com:bitcoinjs/bitcoinjs-lib.git","clone_url":"https://github.com/bitcoinjs/bitcoinjs-lib.git","svn_url":"https://github.com/bitcoinjs/bitcoinjs-lib","homepage":"http://bitcoinjs.org","size":5587,"stargazers_count":872,"watchers_count":872,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":267,"mirror_url":null,"open_issues_count":17,"forks":267,"open_issues":17,"watchers":872,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/401"},"html":{"href":"https://github.com/bitcoinjs/bitcoinjs-lib/pull/401"},"issue":{"href":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/401"},"comments":{"href":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/401/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/401/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/pulls/401/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/statuses/1a4000cc98a23cf77705333a98bc99a89948276d"}}}}