Manually create a transaction to spend the output of a P2SH tx I want to manually create a transaction to spend the output of a P2SH tx, but I don't know where the redeem script should be placed in the new transaction?  I followed an online tutorial Building a Transaction By Hand

In order to sign the transaction, you need to build this tx message as the picture shows. But when there is a redeem script, where should i put this redeem script?
The redeem script is part of the scriptSig for the input you are trying to spend. Here is the format for a P2SH transaction:

scriptPubKey: OP_HASH160 &lt;scriptHash&gt; OP_EQUAL 
scriptSig: ..signatures... &lt;serialized script&gt;


The script is hashed and compared with the script hash in the scriptPubKey.