1

I've just generated p2sh btc address and look in the output script:

HASH160 PUSHDATA(20)[e5c32bdc7f7fb1e6ae7aa1baf42a429803054d2c] EQUALVERIFY 

while normal (legacy btc address) transaction has signature check

DUP HASH160 PUSHDATA(20)[e5c32bdc7f7fb1e6ae7aa1baf42a429803054d2c]
EQUALVERIFY CHECKSIG

Is it safe to store bitcoins in this address with this scriptsig ?

Or it use a same key for the signature check? If yes, what a reason to check the signature ?

Thanks

1 Answer 1

2

Is it safe to store bitcoins in this address with this scriptsig ?

That is actually the scriptPubkey, and it is only safe if you use a safe redeemScript.

A P2SH script is a Pay-to-Script-Hash script, meaning when you spend the coins, you must provide the script (and the hash must match), but this script you provide, called the redeemScript must also succeed when it is executed, and can be any valid script.

Typically this is a script similar (if not exactly the same) as the one you provided, which is a P2PKH or Pay-to-Public-Key-Hash. Thus, it also requires a signature, so if you use a P2SH(P2PKH) it is still just as secure as using a P2PKH because of the signature requirement in the P2PKH, you just have to also provide the redeemScript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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