<p>Since i'm sure others will encounter the same problem, the solution is that BCC requires you to put in the amount-tag when signing a transaction. You have to put in the full amount that is shown on the listunspent-command though, else you won't be able to send the transaction.</p>

CC BY-SA 3.0
2017-10-17T22:32:36.323Z
2017-10-17T22:32:36.323Z
Thorka Mae
<p>I had the same error, but perhaps different problem. See:
<a href="https://bitcoin.stackexchange.com/questions/65971/trying-rawtransaction-bcc-bch-with-failed-checkmultisig-what-is-wrong">Trying rawtransaction BCC/BCH with failed CHECK(MULTI)SIG. What is wrong?</a></p>

<p>It is important that the hash used for signing is based on the same data actualy send + sigscript. Any difference will result in a different signature. Also for the signature the amounts of the outpoints need to be used and some differences compared to BTC like AND'ing the sighash used with 0x40 and Bip143SignatureHash.</p>

CC BY-SA 3.0
2017-12-21T00:57:37.857Z
2017-12-21T00:57:37.857Z
atam
<p>A quick review of your steps tell me that you are doing it right. But the inputs you are trying to spend is already spent (Testnet / <a href="https://www.blocktrail.com/tBTC/tx/0cb0c97c206bf2229fac8800fe05410d23bbc5afe2b243ff921ef2065b210b34" rel="nofollow noreferrer">https://www.blocktrail.com/tBTC/tx/0cb0c97c206bf2229fac8800fe05410d23bbc5afe2b243ff921ef2065b210b34</a>).</p>

<p>The error you are encountering is not very precise but will eventually mean that your are trying to spend and already spent coin.</p>

<p>Try regtest (your own local bitcoin network) by starting Bitcoin-Core in <code>-regtest</code> mode. There you can get some coins to play with by calling <code>generate 101</code> (mine 100 blocks == get 50 BTC available balance) in your console (or by RPC).</p>

CC BY-SA 3.0
2017-10-17T09:27:33.223Z
Those inputs there are just an example from the reddit link, not my actual transaction. I didn't want to risk exposing any infos about the private key i was using, therefor i just showed the steps with an example transaction. Have to try with regtest then. Could the error be because i have imported the address, that i'm trying to send from as watch-only? Or would that not matter?
Thorka Mae
CC BY-SA 3.0
2017-10-17T21:15:05.220Z
Ok, so i downloaded bitcoin abc now and startet it in -regtest mode. Did all the steps to create a transaction and send it and got the same error after sendrawtransaction: **16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code -26)**. What am i missing?
Thorka Mae
CC BY-SA 3.0
2017-10-17T05:22:59.927Z
2017-10-17T05:22:59.927Z
Jonas Schnelli
<p>I'm trying to use the method <a href="https://www.reddit.com/r/Bitcoin/comments/2ebaow/how_to_create_a_raw_transaction_in_bitcoin_qt/" rel="nofollow noreferrer">from this reddit link</a> to send a raw transaction to the bcc-network, but keep getting the error: "16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) (code -26)"</p>

<p>Is there anything different to that method when sending a transaction to the bcc network? Everything works fine until i try to do the sendrawtransaction.</p>

<p>To quote from the link above, these are the steps i'm doing:</p>

<p><strong>createrawtransaction:</strong></p>

<pre><code>createrawtransaction '[{"txid":"0cb0c97c206bf2229fac8800fe05410d23bbc5afe2b243ff921ef2065b210b34","vout":1,"scriptPubKey":"76a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac"}]' '{"mtRWdkBpAyz8pUoCYobABvnEe1xFPqvkJN":0.36972432}'
</code></pre>

<p><strong>result:</strong> </p>

<pre><code>0100000001340b215b06f21e92ff43b2e2afc5bb230d4105fe0088ac9f22f26b207cc9b00c0100000000ffffffff0280969800000000001976a9148d9222948aff2a22c6c0fe7a05f7edd3c1b0ab9f88ac10919b01000000001976a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac00000000
</code></pre>

<p><strong>then signrawtransaction:</strong></p>

<pre><code>signrawtransaction '0100000001340b215b06f21e92ff43b2e2afc5bb230d4105fe0088ac9f22f26b207cc9b00c0100000000ffffffff0280969800000000001976a9148d9222948aff2a22c6c0fe7a05f7edd3c1b0ab9f88ac10919b01000000001976a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac00000000' '[{"txid":"0cb0c97c206bf2229fac8800fe05410d23bbc5afe2b243ff921ef2065b210b34","vout":1,"scriptPubKey":"76a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac"}]' '["cUhHXQLPaNSPNh2rRiWSarn5jEoJ26HvrAYjLCfxnDsAYZenTthe"]'
</code></pre>

<p><strong>result:</strong> </p>

<pre><code>{ "hex" : "0100000001340b215b06f21e92ff43b2e2afc5bb230d4105fe0088ac9f22f26b207cc9b00c010000006a47304402200d3f8a6430f952199d7f4550328ae980f9926b13f7c78f8a5640ecd445aa20bf022074a7e1ec5d27d83da6bb19a8fe9ef9757e40fa86a9b1437c27031be015d82db40121032effa843ad1052540de3ae323a165101bc2e980c76b69bdc69444e3ef599054effffffff0280969800000000001976a9148d9222948aff2a22c6c0fe7a05f7edd3c1b0ab9f88ac10919b01000000001976a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac00000000", "complete" : true }
</code></pre>

<p><strong>then sendrawtransaction:</strong> </p>

<pre><code>sendrawtransaction '0100000001340b215b06f21e92ff43b2e2afc5bb230d4105fe0088ac9f22f26b207cc9b00c010000006a47304402200d3f8a6430f952199d7f4550328ae980f9926b13f7c78f8a5640ecd445aa20bf022074a7e1ec5d27d83da6bb19a8fe9ef9757e40fa86a9b1437c27031be015d82db40121032effa843ad1052540de3ae323a165101bc2e980c76b69bdc69444e3ef599054effffffff0280969800000000001976a9148d9222948aff2a22c6c0fe7a05f7edd3c1b0ab9f88ac10919b01000000001976a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac00000000'
</code></pre>

<p><strong>result:</strong> </p>

<pre><code>16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) (code -26)
</code></pre>

<bitcoin-core><bitcoin-cash><signrawtransaction><sendrawtransaction>
Trying to send bcc with bitcoin-qt but getting "16: mandatory-script-verify-flag-failed" - error
Thorka Mae
# Trying to send bcc with bitcoin-qt but getting "16: mandatory-script-verify-flag-failed" - error

(Asked by: username_0 on 2017-10-16)

I'm trying to use the method from this reddit link to send a raw transaction to the bcc-network, but keep getting the error: "16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) (code -26)"
Is there anything different to that method when sending a transaction to the bcc network? Everything works fine until i try to do the sendrawtransaction.
To quote from the link above, these are the steps i'm doing:
createrawtransaction:
createrawtransaction '[{"txid":"0cb0c97c206bf2229fac8800fe05410d23bbc5afe2b243ff921ef2065b210b34","vout":1,"scriptPubKey":"76a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac"}]' '{"mtRWdkBpAyz8pUoCYobABvnEe1xFPqvkJN":0.36972432}'

result: 
0100000001340b215b06f21e92ff43b2e2afc5bb230d4105fe0088ac9f22f26b207cc9b00c0100000000ffffffff0280969800000000001976a9148d9222948aff2a22c6c0fe7a05f7edd3c1b0ab9f88ac10919b01000000001976a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac00000000

then signrawtransaction:
signrawtransaction '0100000001340b215b06f21e92ff43b2e2afc5bb230d4105fe0088ac9f22f26b207cc9b00c0100000000ffffffff0280969800000000001976a9148d9222948aff2a22c6c0fe7a05f7edd3c1b0ab9f88ac10919b01000000001976a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac00000000' '[{"txid":"0cb0c97c206bf2229fac8800fe05410d23bbc5afe2b243ff921ef2065b210b34","vout":1,"scriptPubKey":"76a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac"}]' '["cUhHXQLPaNSPNh2rRiWSarn5jEoJ26HvrAYjLCfxnDsAYZenTthe"]'

result: 
{ "hex" : "0100000001340b215b06f21e92ff43b2e2afc5bb230d4105fe0088ac9f22f26b207cc9b00c010000006a47304402200d3f8a6430f952199d7f4550328ae980f9926b13f7c78f8a5640ecd445aa20bf022074a7e1ec5d27d83da6bb19a8fe9ef9757e40fa86a9b1437c27031be015d82db40121032effa843ad1052540de3ae323a165101bc2e980c76b69bdc69444e3ef599054effffffff0280969800000000001976a9148d9222948aff2a22c6c0fe7a05f7edd3c1b0ab9f88ac10919b01000000001976a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac00000000", "complete" : true }

then sendrawtransaction: 
sendrawtransaction '0100000001340b215b06f21e92ff43b2e2afc5bb230d4105fe0088ac9f22f26b207cc9b00c010000006a47304402200d3f8a6430f952199d7f4550328ae980f9926b13f7c78f8a5640ecd445aa20bf022074a7e1ec5d27d83da6bb19a8fe9ef9757e40fa86a9b1437c27031be015d82db40121032effa843ad1052540de3ae323a165101bc2e980c76b69bdc69444e3ef599054effffffff0280969800000000001976a9148d9222948aff2a22c6c0fe7a05f7edd3c1b0ab9f88ac10919b01000000001976a9144e03fd2b3eff32ee90d29524eb6f058719f3b50f88ac00000000'

result: 
16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) (code -26)

**Tags:** bitcoin-core, bitcoin-cash, signrawtransaction, sendrawtransaction


---

## 3 answers

### Answer by username_0 on 2017-10-17. Score: 1 | Accepted answer

Since i'm sure others will encounter the same problem, the solution is that BCC requires you to put in the amount-tag when signing a transaction. You have to put in the full amount that is shown on the listunspent-command though, else you won't be able to send the transaction.


---

### Answer by username_1 on 2017-12-21. Score: 1

I had the same error, but perhaps different problem. See:
[Trying rawtransaction BCC/BCH with failed CHECK(MULTI)SIG. What is wrong?](https://bitcoin.stackexchange.com/questions/65971/trying-rawtransaction-bcc-bch-with-failed-checkmultisig-what-is-wrong)

It is important that the hash used for signing is based on the same data actualy send + sigscript. Any difference will result in a different signature. Also for the signature the amounts of the outpoints need to be used and some differences compared to BTC like AND'ing the sighash used with 0x40 and Bip143SignatureHash.


---

### Answer by username_2 on 2017-10-17. Score: 0

A quick review of your steps tell me that you are doing it right. But the inputs you are trying to spend is already spent (Testnet / <https://www.blocktrail.com/tBTC/tx/0cb0c97c206bf2229fac8800fe05410d23bbc5afe2b243ff921ef2065b210b34>).

The error you are encountering is not very precise but will eventually mean that your are trying to spend and already spent coin.

Try regtest (your own local bitcoin network) by starting Bitcoin-Core in `-regtest` mode. There you can get some coins to play with by calling `generate 101` (mine 100 blocks == get 50 BTC available balance) in your console (or by RPC).

> **Comments:**
> **username_0**: Those inputs there are just an example from the reddit link, not my actual transaction. I didn't want to risk exposing any infos about the private key i was using, therefor i just showed the steps with an example transaction. Have to try with regtest then. Could the error be because i have imported the address, that i'm trying to send from as watch-only? Or would that not matter?  
> **username_0**: Ok, so i downloaded bitcoin abc now and startet it in -regtest mode. Did all the steps to create a transaction and send it and got the same error after sendrawtransaction: **16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code -26)**. What am i missing?  

---

