Last active
May 14, 2018 18:27
-
-
Save prestwich/8eeaf2ee2d55d0abc5072592a8a23444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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