Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var tx = new Bitcoin.Transaction();
- tx.addInput('4f6e1ea426c473a19498af663cae314669451678cabbb633e87b401087c7064c', 0);
- tx.addOutput('mhaTL1onPYtM3xpkXWqaA1DnNNgHYhEsDP', Wallet.toSatoshi('0.499'));
- // var signatures = privKeys.map(function(privKey) {
- privKeys = [Bitcoin.ECKey.fromWIF("91uWV4hLdpKHNFcBaD1sT5jfEFP5nujwimfARKbvkZ6L3Hmo7t6"),Bitcoin.ECKey.fromWIF("92H9tQ9oUxgGPxXVzkPhiQRVZFc2DGBbbaYx9HtSiPAnALvHvH1")];
- var signatures = privKeys.map(function(privKey) {
- return tx.signInput(0, redeemScript, privKey)
- })
- var redeemScriptSig = Bitcoin.scripts.multisigInput(signatures)
- var scriptSig = Bitcoin.scripts.scriptHashInput(redeemScriptSig, redeemScript)
- tx.setInputScript(0, scriptSig)
- console.log(tx.toHex());
- // 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