{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/543","repository_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib","labels_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/543/labels{/name}","comments_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/543/comments","events_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/543/events","html_url":"https://github.com/bitcoinjs/bitcoinjs-lib/issues/543","id":133802660,"number":543,"title":"Uncaught TypeError: tx.sign is not a function","user":{"login":"off-bank","id":8763996,"avatar_url":"https://avatars.githubusercontent.com/u/8763996?v=3","gravatar_id":"","url":"https://api.github.com/users/off-bank","html_url":"https://github.com/off-bank","followers_url":"https://api.github.com/users/off-bank/followers","following_url":"https://api.github.com/users/off-bank/following{/other_user}","gists_url":"https://api.github.com/users/off-bank/gists{/gist_id}","starred_url":"https://api.github.com/users/off-bank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/off-bank/subscriptions","organizations_url":"https://api.github.com/users/off-bank/orgs","repos_url":"https://api.github.com/users/off-bank/repos","events_url":"https://api.github.com/users/off-bank/events{/privacy}","received_events_url":"https://api.github.com/users/off-bank/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-02-15T19:58:35Z","updated_at":"2016-02-15T21:04:50Z","closed_at":"2016-02-15T20:27:19Z","body":"I'm trying to sign a raw transaction in browser as below, but it throws me \"Uncaught TypeError: tx.sign is not a function\". Am I doing something wrong?\r\n\r\n`var key = bitcoin.ECPair.fromWIF('correct_private_key');\r\nconsole.log(key.getAddress());  //1Fy5MmbdHMSVozmek5Wsn4EqA7NyuDry5q\r\nvar tx = bitcoin.Transaction.fromHex('010000000171575c7585d347a2d31a09973bd118ea45083592f873cc53eea42f70f816dc4b000000001976a914a42cb159f6f8be525632491980eb9315cccef20e88acffffffff02e8030000000000001976a914e8db9f4559cbaa586dab4e6d1eedd482bdc3fc9d88acd07e0100000000001976a914a42cb159f6f8be525632491980eb9315cccef20e88ac00000000');\r\ntx.sign(0, key);\r\nconsole.log(tx.build().toHex());`\r\n"},"comment":{"url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/comments/184392889","html_url":"https://github.com/bitcoinjs/bitcoinjs-lib/issues/543#issuecomment-184392889","issue_url":"https://api.github.com/repos/bitcoinjs/bitcoinjs-lib/issues/543","id":184392889,"user":{"login":"fanatid","id":2633065,"avatar_url":"https://avatars.githubusercontent.com/u/2633065?v=3","gravatar_id":"","url":"https://api.github.com/users/fanatid","html_url":"https://github.com/fanatid","followers_url":"https://api.github.com/users/fanatid/followers","following_url":"https://api.github.com/users/fanatid/following{/other_user}","gists_url":"https://api.github.com/users/fanatid/gists{/gist_id}","starred_url":"https://api.github.com/users/fanatid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanatid/subscriptions","organizations_url":"https://api.github.com/users/fanatid/orgs","repos_url":"https://api.github.com/users/fanatid/repos","events_url":"https://api.github.com/users/fanatid/events{/privacy}","received_events_url":"https://api.github.com/users/fanatid/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T21:04:50Z","updated_at":"2016-02-15T21:04:50Z","body":"@dcousens I don't see the way how two users can sign one transaction, I mean how I can serialize/deserialize instance of TransactionBuilder? Except `.buildIncomplete`, because this drop prevOutScript for inputs.\r\n\r\nIn bitcore-lib you can use toObject/fromObject, also you can extract and apply signatures (getSignatures/applySignatures) -- that is really helpful functions. Do you have plans to add something like this to bitcoinjs-lib?"}}