Advertisement
Guest User

Untitled

a guest
Jul 26th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1.  
  2. var tx = new Bitcoin.Transaction();
  3. tx.addInput('4f6e1ea426c473a19498af663cae314669451678cabbb633e87b401087c7064c', 0);
  4. tx.addOutput('mhaTL1onPYtM3xpkXWqaA1DnNNgHYhEsDP', Wallet.toSatoshi('0.499'));
  5.  
  6. // var signatures = privKeys.map(function(privKey) {
  7. privKeys = [Bitcoin.ECKey.fromWIF("91uWV4hLdpKHNFcBaD1sT5jfEFP5nujwimfARKbvkZ6L3Hmo7t6"),Bitcoin.ECKey.fromWIF("92H9tQ9oUxgGPxXVzkPhiQRVZFc2DGBbbaYx9HtSiPAnALvHvH1")];
  8.  
  9. var signatures = privKeys.map(function(privKey) {
  10. return tx.signInput(0, redeemScript, privKey)
  11. })
  12.  
  13. var redeemScriptSig = Bitcoin.scripts.multisigInput(signatures)
  14. var scriptSig = Bitcoin.scripts.scriptHashInput(redeemScriptSig, redeemScript)
  15. tx.setInputScript(0, scriptSig)
  16.  
  17. console.log(tx.toHex());
  18.  
  19. // This basically signs something with both private keys at once.. but how can I sign with one private key, store the output, then sign with another private key.. before finally then pushing the tx ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement