BIP16 P2SH defines special rules to apply on scripts with a specific pattern, namely: OP_HASH160 <scriptHash> OP_EQUAL.

My question is: Can a P2SH be used within a script? So can I e.g. make a scriptPubKey: <420000> OP_CHECKLOCKTIMEVERIFY OP_DROP OP_HASH160 <scriptHash> OP_EQUAL? Or must all additional opcodes be in the redeemScript so that the whole scriptPubKey follows the pattern mentioned in the BIP16 above?


No, P2SH can only be invoked using the exact magic pattern described in BIP16 in the scriptPubKey and not using any variant of it, nor recursively inside the P2SH redeemScript itself.

Earlier proposals (see OP_EVAL) existed that did allow much more flexibility, but it was hard to give strong guarantees about execution time and memory in such a model.

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.