<blockquote>
  <p>Can I put common operants and operators in the P2SH unlocking script?</p>
</blockquote>

<p>No, you can not.</p>

<p>1) Unlocking script ( <code>scriptSig</code> ) should contain only push operations, yours contains OP_CHECKSIG</p>

<p>2) It has no sense to put signature <code>sig2</code> 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 <code>redeem</code> script - you can do it in other way.</p>

CC BY-SA 4.0
2018-09-15T13:49:19.507Z
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
CC BY-SA 4.0
2018-09-15T16:08:09.470Z
Trivia: If you can mine nonstandard transactions, you can put non-push operations in unlock script.
MCCCS
CC BY-SA 4.0
2018-09-15T16:39:40.860Z
theoretically yes, but do you have an tutorial of building my previous transactions?
Xiaoyang Zhu Simon Zhu
CC BY-SA 4.0
2018-09-15T19:39:34.290Z
@MCCCS Pushonly is actually consensus mandatory for P2SH and P2WSH. For non-wrapped scripts it is just a standardness rule.
Pieter Wuille
CC BY-SA 4.0
2018-09-15T09:49:46.573Z
2018-09-15T09:49:46.573Z
amaclin
<p>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?</p>

<p>e.g.</p>

<p>unlocing script: <code>&lt;sig1&gt; &lt;pk1&gt; CHECKSIG &lt;pk1&gt; &lt;redeem script&gt;</code></p>

<p>redeem script:  <code>HASH160 &lt;address&gt; EQUALVERIFY &lt;sig2&gt; &lt;pk2&gt; CHECKSIG</code></p>

<p2sh>
Does P2SH unlocking script only consist of operants?
Xiaoyang Zhu Simon Zhu
# Does P2SH unlocking script only consist of operants?

(Asked by: username_0 on 2018-09-15)

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`

**Tags:** p2sh


---

## 1 answers

### Answer by username_1 on 2018-09-15. Score: 1

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

> **Comments:**
> **username_0**: Thanks your answer. I appreciate it. But for your second point, you mean, signature values can't be included in redeem script?  
> **username_2**: Trivia: If you can mine nonstandard transactions, you can put non-push operations in unlock script.  
> **username_0**: theoretically yes, but do you have an tutorial of building my previous transactions?  
> **username_3**: @username_2 Pushonly is actually consensus mandatory for P2SH and P2WSH. For non-wrapped scripts it is just a standardness rule.  

---

