<p>That error message is irrelevant.<br>
SegWit introduced a new way of producing the hash digest for signing which requires the "amount" being spent to be included during hashing. This "amount" is the value of the output that is being spent not the amount of the new output you create. In your it is <code>0.02641617</code> or the actual value <code>2641617</code> in satoshi.<br>
Your step 4 should become:  </p>

<pre><code>signrawtransactionwithkey '0200000001ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e0000000000ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968700000000' '[" $privKey "]' '[{"txid":"8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff","vout":0,"scriptPubKey":"a91429c3d920cd18e34db9035c4322474aae4465792187","redeemScript":"00143b88811e01b3efaa0bcd9da16ef85ef3a1583349","amount":0.02641617}]'
</code></pre>

CC BY-SA 4.0
2020-03-28T13:32:00.077Z
Thanks a lot! It worked :) I just misunderstood the documentation. Have a nice day and I wish You good health!
M A
CC BY-SA 4.0
2020-03-28T13:24:22.820Z
2020-03-28T13:24:22.820Z
Coding Enthusiast
<p>I wanted to send a raw testnet transaction and I was doing it like in the bitcoin documentation, but I still get this error:</p>

<p><strong>non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 64) (code -26)</strong>.</p>

<p>What am I doing wrong?</p>

<ol>
<li>I take one transaction from my <strong>listunspent</strong> </li>
</ol>

<pre><code>{
    "txid": "8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff",
    "vout": 0,
    "address": "2Mw44JvAhBs4hgh5bT3gP2NgbhTbVwngW1m",
    "label": "",
    "redeemScript": "00143b88811e01b3efaa0bcd9da16ef85ef3a1583349",
    "scriptPubKey": "a91429c3d920cd18e34db9035c4322474aae4465792187",
    "amount": 0.02641617,
    "confirmations": 16197,
    "spendable": true,
    "solvable": true,
    "desc": "sh(wpkh([8939dfa5/0'/0'/8']02a44b3dd2f0964048265982156f668c037dfabc140eb98f292dbb723d28b85261))#husuy9tw",
    "safe": true
}
</code></pre>

<ol start="2">
<li>Then I create raw transaction from this:</li>
</ol>

<pre><code>createrawtransaction '[{"txid":"8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff","vout":0}]' '{"2NCH5HXBwfHegFEUTNrkSKzyYTnTYQKDUjU":0.02}'
</code></pre>

<ol start="3">
<li><p><strong>dumpprivkey</strong></p></li>
<li><p>And signs the transaction like this </p></li>
</ol>

<pre><code>signrawtransactionwithkey '0200000001ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e0000000000ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968700000000' '[" $privKey "]' '[{"txid":"8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff","vout":0,"scriptPubKey":"a91429c3d920cd18e34db9035c4322474aae4465792187","redeemScript":"00143b88811e01b3efaa0bcd9da16ef85ef3a1583349","amount":0.02}]'

{
  "hex": "02000000000101ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e00000000171600143b88811e01b3efaa0bcd9da16ef85ef3a1583349ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968702473044022010c174b3306cac5ca8ddbb6eadf0de2299c2a216ade25088290c17880aa5bd60022017bc9de608e7ff59ffa09a6a60d848875d37edfc4a4b687f0eb94d4c2cd11b4f012102a44b3dd2f0964048265982156f668c037dfabc140eb98f292dbb723d28b8526100000000",
  "complete": true
}
</code></pre>

<p>But when I want to send raw transaction </p>

<pre><code>sendrawtransaction 02000000000101ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e00000000171600143b88811e01b3efaa0bcd9da16ef85ef3a1583349ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968702473044022010c174b3306cac5ca8ddbb6eadf0de2299c2a216ade25088290c17880aa5bd60022017bc9de608e7ff59ffa09a6a60d848875d37edfc4a4b687f0eb94d4c2cd11b4f012102a44b3dd2f0964048265982156f668c037dfabc140eb98f292dbb723d28b8526100000000

non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 64) (code -26)

</code></pre>

<p>I tried with a lot of transactions but I can't send it and can't see what I'm doing wrong. Normally, the Bitcoin Core send button works fine. </p>

<bitcoin-core><raw-transaction><createrawtransaction><signrawtransaction><sendrawtransaction>
Can't send raw transaction Bitcoin Core 0.19.1 - non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation)
M A
# Can't send raw transaction Bitcoin Core 0.19.1 - non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation)

(Asked by: username_0 on 2020-03-28)

I wanted to send a raw testnet transaction and I was doing it like in the bitcoin documentation, but I still get this error:

**non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 64) (code -26)**.

What am I doing wrong?

1. I take one transaction from my **listunspent**

```
{
    "txid": "8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff",
    "vout": 0,
    "address": "2Mw44JvAhBs4hgh5bT3gP2NgbhTbVwngW1m",
    "label": "",
    "redeemScript": "00143b88811e01b3efaa0bcd9da16ef85ef3a1583349",
    "scriptPubKey": "a91429c3d920cd18e34db9035c4322474aae4465792187",
    "amount": 0.02641617,
    "confirmations": 16197,
    "spendable": true,
    "solvable": true,
    "desc": "sh(wpkh([8939dfa5/0'/0'/8']02a44b3dd2f0964048265982156f668c037dfabc140eb98f292dbb723d28b85261))#husuy9tw",
    "safe": true
}

```

2. Then I create raw transaction from this:

```
createrawtransaction '[{"txid":"8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff","vout":0}]' '{"2NCH5HXBwfHegFEUTNrkSKzyYTnTYQKDUjU":0.02}'

```

3. **dumpprivkey**
4. And signs the transaction like this

```
signrawtransactionwithkey '0200000001ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e0000000000ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968700000000' '[" $privKey "]' '[{"txid":"8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff","vout":0,"scriptPubKey":"a91429c3d920cd18e34db9035c4322474aae4465792187","redeemScript":"00143b88811e01b3efaa0bcd9da16ef85ef3a1583349","amount":0.02}]'

{
  "hex": "02000000000101ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e00000000171600143b88811e01b3efaa0bcd9da16ef85ef3a1583349ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968702473044022010c174b3306cac5ca8ddbb6eadf0de2299c2a216ade25088290c17880aa5bd60022017bc9de608e7ff59ffa09a6a60d848875d37edfc4a4b687f0eb94d4c2cd11b4f012102a44b3dd2f0964048265982156f668c037dfabc140eb98f292dbb723d28b8526100000000",
  "complete": true
}

```

But when I want to send raw transaction

```
sendrawtransaction 02000000000101ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e00000000171600143b88811e01b3efaa0bcd9da16ef85ef3a1583349ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968702473044022010c174b3306cac5ca8ddbb6eadf0de2299c2a216ade25088290c17880aa5bd60022017bc9de608e7ff59ffa09a6a60d848875d37edfc4a4b687f0eb94d4c2cd11b4f012102a44b3dd2f0964048265982156f668c037dfabc140eb98f292dbb723d28b8526100000000

non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 64) (code -26)

```

I tried with a lot of transactions but I can't send it and can't see what I'm doing wrong. Normally, the Bitcoin Core send button works fine.

**Tags:** bitcoin-core, raw-transaction, createrawtransaction, signrawtransaction, sendrawtransaction


---

## 1 answers

### Answer by username_1 on 2020-03-28. Score: 2 | Accepted answer

That error message is irrelevant.  
SegWit introduced a new way of producing the hash digest for signing which requires the "amount" being spent to be included during hashing. This "amount" is the value of the output that is being spent not the amount of the new output you create. In your it is `0.02641617` or the actual value `2641617` in satoshi.  
Your step 4 should become:

```
signrawtransactionwithkey '0200000001ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e0000000000ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968700000000' '[" $privKey "]' '[{"txid":"8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff","vout":0,"scriptPubKey":"a91429c3d920cd18e34db9035c4322474aae4465792187","redeemScript":"00143b88811e01b3efaa0bcd9da16ef85ef3a1583349","amount":0.02641617}]'

```

> **Comments:**
> **username_0**: Thanks a lot! It worked :) I just misunderstood the documentation. Have a nice day and I wish You good health!  

---

