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?

Top Answer/Comment:
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 <scriptHash> OP_EQUAL
scriptSig: ..signatures... <serialized script>
The script is hashed and compared with the script hash in the scriptPubKey.
상단 광고의 [X] 버튼을 누르면 내용이 보입니다