Free Bitcoin Transaction


SUBMITTED BY: bitminter

DATE: Sept. 14, 2016, 10:26 a.m.

FORMAT: Text only

SIZE: 509 Bytes

HITS: 4012

  1. // first we create a transaction
  2. var tx = new Transaction()
  3. .from(utxo)
  4. .to(toAddress, 100000)
  5. .sign(privateKey);
  6. // we then extract the signature from the first input
  7. var inputIndex = 0;
  8. var signature = tx.getSignatures(privateKey)[inputIndex].signature;
  9. var scriptSig = Script.buildPublicKeyHashIn(publicKey, signature);
  10. var flags = Interpreter.SCRIPT_VERIFY_P2SH | Interpreter.SCRIPT_VERIFY_STRICTENC;
  11. var verified = Interpreter().verify(scriptSig, scriptPubkey, tx, inputIndex, flags);

comments powered by Disqus