Skip to content

Instantly share code, notes, and snippets.

@prestwich
Last active May 14, 2018 18:27
Show Gist options
  • Save prestwich/8eeaf2ee2d55d0abc5072592a8a23444 to your computer and use it in GitHub Desktop.
Save prestwich/8eeaf2ee2d55d0abc5072592a8a23444 to your computer and use it in GitHub Desktop.
from riemann import simple
outpoint = simple.outpoint(tx_id, index)
# Spend a P2PKH output:
tx_ins = [simple.unsigned_input(outpoint)]
# Spend a P2SH output
tx_ins += [simple.unsigned_input(
outpoint=outpoint,
redeem_script=redeem_script)]
# Make an output
tx_outs = [simple.output(value, address)]
# Build the transaction
tx = simple.unsigned_tx(tx_ins, tx_outs)
# Make Sighashes for signing
tx.sighash_single(0, p2pkh_pk_script)
tx.sighash_all(1, redeem_script, anyone_can_pay=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment