Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesleyfsmith/761560666aaf039c61fbaee1f45dea38 to your computer and use it in GitHub Desktop.
Save wesleyfsmith/761560666aaf039c61fbaee1f45dea38 to your computer and use it in GitHub Desktop.
Redeem script sig
var hashType = bitcoin.Transaction.SIGHASH_ALL;
var signatureHash = tx.hashForSignature(0, redeemScript, hashType);
console.log('Sig hash: ', signatureHash.toString('hex'));
const redeemScriptSig = bitcoin.script.scriptHash.input.encode([
seller.sign(signatureHash).toScriptSignature(hashType),
buyer.sign(signatureHash).toScriptSignature(hashType),
bitcoin.opcodes.OP_FLASE
], redeemScript)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment