0

Most transaction outputs to P2SH addresses have the following scriptPubKey:

HASH160 f45d94733d430261962932e0c847075195916a04 OP_EQUAL

As I understand it, this transaction do not need to be signed. Is it true?

The user just needs to provide a redeemScript whose HASH160 is equal to f45d94733d430261962932e0c847075195916a04.

So, if we know that:

HASH160(data1) = hash1
HASH160(data2) = hash2

and the user creates two transaction outputs to P2SH addresses with the scriptPubKeys:

HASH160 f45d94733d430261962932e0c847075195916a04 OP_EQUAL

then the scriptPubKey is the same for both transaction outputs, but why is the redeemScript is always different?

HASH160(data1) = hash1
HASH160(data2) = hash1
....
????
  • 3
    Can you provide an example of two different redeem scripts with the same hash? – Mike D Nov 15 '18 at 20:25
0

A P2SH transaction will execute whatever redeemScript you provide, which must be a standard transaction:

Transactions that redeem these pay-to-script outpoints are only considered standard if the serialized script - also referred to as the redeemScript - is, itself, one of the other standard transaction types. See BIP16

Those standard transactions, like a P2PKH does require a signature, so even though you provide the right redeemScript, if it doesn't execute successfully, the entire tx will become invalid.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.