Learning-Bitcoin-from-the-C.../8_5_Spending_a_Transaction_with_a_Bitcoin_script.md

1.3 KiB

WARNING: The lack of any code Script interpretors is currently halting this section.

8.5: Spending a Transaction with a Bitcoin Script

Before we close out an overview of P2SH transactions, it's worth briefly discussing how to spend them!

Use the Redeem Script

As we saw in §6.2: Spending a Transaction to a Multisig, spending a P2SH transaction is all about having that serialized version of the locking script, the so-called redeemScript. So, the first step to being able to spend a P2SH transaction is ensuring that you save the redeemScript before you give out the P2SH address to everyone.

Because P2SH addresses aren't integrated into bitcoin-cli there will be no short-cuts as you saw in §6.3: Sending an Automated Multisig. You're going to need to collect all the more complex variables on your own!

Create the Transaction

PENDING

[Notes: I think this is just the same as what we did in chapter 6.2, but I need to actually receive a P2SH transaction to test it, and that requires first getting to the APIs, then using one to send myself a P2SH transaction, then writing up how to respend that.]

Summary: Spending a Transaction with a Bitcoin Script

PENDING

[Notes: Say it's just like respending that multisig, the hard way]