Different redeemScript for the same scriptPubKey?

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
....
????

Andrew

Posted 2018-11-15T19:42:11.947

Reputation: 161

3Can you provide an example of two different redeem scripts with the same hash?Mike D 2018-11-15T20:25:54.437

Answers

1

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.

JBaczuk

Posted 2018-11-15T19:42:11.947

Reputation: 6 172

1

Just to note, Bitcoin Core 0.10.0 and later no longer require that the redeemScript is one of the standard transaction types. See https://github.com/bitcoin/bitcoin/pull/4365.

Martin Harrigan 2019-09-04T12:12:29.063