1

I have a question about the P2SH unlocking script. Can I put common operants and operators in the P2SH unlocking script? And if yes, how can I create such script?

e.g.

unlocing script: <sig1> <pk1> CHECKSIG <pk1> <redeem script>

redeem script: HASH160 <address> EQUALVERIFY <sig2> <pk2> CHECKSIG

0

Can I put common operants and operators in the P2SH unlocking script?

No, you can not.

1) Unlocking script ( scriptSig ) should contain only push operations, yours contains OP_CHECKSIG

2) It has no sense to put signature sig2 into the redeem script and check it with OP_CHECKSIG because such script definetely fail on execution. If you want to put any data in the redeem script - you can do it in other way.

  • Thanks your answer. I appreciate it. But for your second point, you mean, signature values can't be included in redeem script? – Xiaoyang Zhu Simon Zhu Sep 15 '18 at 13:49
  • Trivia: If you can mine nonstandard transactions, you can put non-push operations in unlock script. – MCCCS Sep 15 '18 at 16:08
  • theoretically yes, but do you have an tutorial of building my previous transactions? – Xiaoyang Zhu Simon Zhu Sep 15 '18 at 16:39
  • 2
    @MCCCS Pushonly is actually consensus mandatory for P2SH and P2WSH. For non-wrapped scripts it is just a standardness rule. – Pieter Wuille Sep 15 '18 at 19:39

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.