<p>The <code>signrawtransaction</code> RPC will verify the input scripts of the transaction after it signs it. If the transaction has not been fully signed (i.e. it isn't complete), then the script verification will fail and produce this error.</p>

<p>This also happens with multisig transactions. When you don't have enough signatures, the script will fail to verify with the error that you see.</p>

<p>See also: <a href="https://github.com/bitcoin/bitcoin/issues/9988" rel="noreferrer">https://github.com/bitcoin/bitcoin/issues/9988</a></p>

CC BY-SA 3.0
2017-06-14T03:59:56.177Z
2017-06-14T03:59:56.177Z
Ava Chow
<p>I have faced the same issue 
i was trying to creat a raw transaction with erronerous Vout (1 instead 0)</p>

<pre><code>bitcoin-cli  createrawtransaction "[{\"txid\": \"cd32cc233298662131dab1c2f5fa7b0407879b51bfaa7e26afa4abf453951b09\", \"vout\": 1}]" "{\"data\":\"68656c6c6f20776f726c64\",\"mpCALgNebBXBJByCG7W5XPXe2NvuQCD8au\":1.10000000}"
</code></pre>

<p>so by fixing the vout i've got it signing perfectly</p>

CC BY-SA 3.0
2017-08-12T11:40:05.643Z
2017-08-12T11:40:05.643Z
Badr Bellaj
<p>If you use a private key that is for an address different from those from the TxOuts that you want to spend, you can get this error.  I suppose there are other possible causes, but that is the one that got me.</p>

CC BY-SA 3.0
2017-06-13T21:02:15.763Z
2017-06-13T21:02:15.763Z
Dave Scotese
<p>I'm asking this question to help others who run into the same problem I ran into.  The error is, at least sometimes, misleading and might not be accurate.</p>

<p>The context in which this error is relevant is signing a raw transaction that you created with bitcoin software.  This is a common practice for those who are paranoid, like me.  Here's the basic procedure:</p>

<ol>
<li>Identify the TxOuts (txid and vout pairs) that you want to spend.</li>
<li>Use <a href="https://chainquery.com/bitcoin-api/createrawtransaction" rel="nofollow noreferrer">https://chainquery.com/bitcoin-api/createrawtransaction</a> or something similar to create a hex string.</li>
<li>Use <a href="https://chainquery.com/bitcoin-api/signrawtransaction" rel="nofollow noreferrer">https://chainquery.com/bitcoin-api/signrawtransaction</a> along with the private keys required to spend those unspent TxOuts.</li>
</ol>

<p>In that third step, you might get this "operation not valid with the current stack size" error. </p>

<createrawtransaction><signrawtransaction>
What does "operation not valid with the current stack size" mean?
Dave Scotese
# What does "operation not valid with the current stack size" mean?

(Asked by: username_0 on 2017-06-13)

I'm asking this question to help others who run into the same problem I ran into. The error is, at least sometimes, misleading and might not be accurate.

The context in which this error is relevant is signing a raw transaction that you created with bitcoin software. This is a common practice for those who are paranoid, like me. Here's the basic procedure:

1. Identify the TxOuts (txid and vout pairs) that you want to spend.
2. Use <https://chainquery.com/bitcoin-api/createrawtransaction> or something similar to create a hex string.
3. Use <https://chainquery.com/bitcoin-api/signrawtransaction> along with the private keys required to spend those unspent TxOuts.

In that third step, you might get this "operation not valid with the current stack size" error.

**Tags:** createrawtransaction, signrawtransaction


---

## 3 answers

### Answer by username_1 on 2017-06-14. Score: 7

The `signrawtransaction` RPC will verify the input scripts of the transaction after it signs it. If the transaction has not been fully signed (i.e. it isn't complete), then the script verification will fail and produce this error.

This also happens with multisig transactions. When you don't have enough signatures, the script will fail to verify with the error that you see.

See also: <https://github.com/bitcoin/bitcoin/issues/9988>


---

### Answer by username_2 on 2017-08-12. Score: 3

I have faced the same issue
i was trying to creat a raw transaction with erronerous Vout (1 instead 0)

```
bitcoin-cli  createrawtransaction "[{\"txid\": \"cd32cc233298662131dab1c2f5fa7b0407879b51bfaa7e26afa4abf453951b09\", \"vout\": 1}]" "{\"data\":\"68656c6c6f20776f726c64\",\"mpCALgNebBXBJByCG7W5XPXe2NvuQCD8au\":1.10000000}"

```

so by fixing the vout i've got it signing perfectly


---

### Answer by username_0 on 2017-06-13. Score: 0

If you use a private key that is for an address different from those from the TxOuts that you want to spend, you can get this error. I suppose there are other possible causes, but that is the one that got me.


---

