<p>When I send a raw transaction I get an error:</p>

<pre><code>16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)
</code></pre>

<p>Raw transaction that I send:</p>

<pre><code>0200000001d18e181dc31f713573785c4434b70c415b407e200959f10d24a5eee72a4bae3401000000da00473044022038b7aaf811db578a0b62b1ff69f7b2a6054cd9b770275b292ff63bb6b6faa96902202ffa91a950c8976722284a0bcd3ad9c54e11e441f9f632c3dd76f9174f1d0c0a01483045022100a3c48312f94652269b6e23b3e48ead21b788a2d162205d9ba4c01c9cddfc9ea70220772828f03307eaf90cc17f12f2f97e8424ff5f5311839b4095f775813cb2dada014752210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552aeffffffff01962af4050000000017a9146fb7855fc9f0fcad63dacb27103f3ee6089b65408700000000
</code></pre>

<p>This raw transaction decoded:</p>

<pre><code>{
  "txid": "e63230d2b56bec46ab1273f0962f0fce43248fb1acbd7214be5a319b53fc170e",
  "hash": "e63230d2b56bec46ab1273f0962f0fce43248fb1acbd7214be5a319b53fc170e",
  "version": 2,
  "size": 301,
  "vsize": 301,
  "locktime": 0,
  "vin": [
    {
      "txid": "34ae4b2ae7eea5240df15909207e405b410cb734445c787335711fc31d188ed1",
      "vout": 1,
      "scriptSig": {
        "asm": "0 3044022038b7aaf811db578a0b62b1ff69f7b2a6054cd9b770275b292ff63bb6b6faa96902202ffa91a950c8976722284a0bcd3ad9c54e11e441f9f632c3dd76f9174f1d0c0a[ALL] 3045022100a3c48312f94652269b6e23b3e48ead21b788a2d162205d9ba4c01c9cddfc9ea70220772828f03307eaf90cc17f12f2f97e8424ff5f5311839b4095f775813cb2dada[ALL] 52210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552ae",
        "hex": "00473044022038b7aaf811db578a0b62b1ff69f7b2a6054cd9b770275b292ff63bb6b6faa96902202ffa91a950c8976722284a0bcd3ad9c54e11e441f9f632c3dd76f9174f1d0c0a01483045022100a3c48312f94652269b6e23b3e48ead21b788a2d162205d9ba4c01c9cddfc9ea70220772828f03307eaf90cc17f12f2f97e8424ff5f5311839b4095f775813cb2dada014752210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552ae"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.99887766,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_HASH160 6fb7855fc9f0fcad63dacb27103f3ee6089b6540 OP_EQUAL",
        "hex": "a9146fb7855fc9f0fcad63dacb27103f3ee6089b654087",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2N3RvqqdX1ou9brMRThsr9hdJpHXPkDGXt9"
        ]
      }
    }
  ]
}
</code></pre>

<p>UTX that raw transaction tries to spend:</p>

<pre><code>34ae4b2ae7eea5240df15909207e405b410cb734445c787335711fc31d188ed1
</code></pre>

<p>UTX pubKey script section:</p>

<pre><code>a9146fb7855fc9f0fcad63dacb27103f3ee6089b654087
</code></pre>

<p>ScriptSig:</p>

<pre><code>00473044022038b7aaf811db578a0b62b1ff69f7b2a6054cd9b770275b292ff63bb6b6faa96902202ffa91a950c8976722284a0bcd3ad9c54e11e441f9f632c3dd76f9174f1d0c0a01483045022100a3c48312f94652269b6e23b3e48ead21b788a2d162205d9ba4c01c9cddfc9ea70220772828f03307eaf90cc17f12f2f97e8424ff5f5311839b4095f775813cb2dada014752210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552ae
</code></pre>

<p>When I debug a script with <a href="http://paulkernfeld.com/bse/" rel="nofollow noreferrer">online debugger</a> it executes well.
Online debugger is unhappy about last opcode 0x87 OP_EQUAL, but it may be the debugger limitation only:</p>

<pre><code>a9146fb7855fc9f0fcad63dacb27103f3ee6089b654087
</code></pre>

<p>What is wrong with my raw transaction that I try to broadcast? 
Why does <code>OP_CHECKMULTISIG</code> fail?</p>

<p>I think that OP_CHECKMULTISIG comes from redeemScript:</p>

<pre><code>52210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552ae
</code></pre>

<p>The redeemScript decoded:</p>

<pre><code>2 0283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e 03e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a9455 2 OP_CHECKMULTISIG
</code></pre>

<p>I played with signatures order but it didn't help.</p>

CC BY-SA 3.0
2017-12-07T12:36:14.857Z
are you manually composing tx, or using a tool? What is the raw tx? I tried to decompose to the unsigned raw tx (020000000134AE4B2AE7EEA5240DF15909207E405B410CB734445C787335711FC31D188ED1010000004752210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552aeFFFFFFFF01962AF4050000000017A9146FB7855FC9F0FCAD63DACB27103F3EE6089B65408700000000), double sha256 it, but then the signature  verification would fail in each case. btw: why is it using version 02000000?
pebwindkraft
CC BY-SA 3.0
2017-12-07T17:17:27.860Z
version 02 is a testnet, I am composing a tx with hardware wallet (ledger nano) btchip-python framework.
Sasha Zezulinsky
<bitcoind><multi-signature><hardware-wallet>
Unable to send raw transaction: mandatory-script-verify-flag-failed
Sasha Zezulinsky
# Unable to send raw transaction: mandatory-script-verify-flag-failed

(Asked by: username_0 on 2017-12-07)

When I send a raw transaction I get an error:
16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)

Raw transaction that I send:
0200000001d18e181dc31f713573785c4434b70c415b407e200959f10d24a5eee72a4bae3401000000da00473044022038b7aaf811db578a0b62b1ff69f7b2a6054cd9b770275b292ff63bb6b6faa96902202ffa91a950c8976722284a0bcd3ad9c54e11e441f9f632c3dd76f9174f1d0c0a01483045022100a3c48312f94652269b6e23b3e48ead21b788a2d162205d9ba4c01c9cddfc9ea70220772828f03307eaf90cc17f12f2f97e8424ff5f5311839b4095f775813cb2dada014752210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552aeffffffff01962af4050000000017a9146fb7855fc9f0fcad63dacb27103f3ee6089b65408700000000

This raw transaction decoded:
{
  "txid": "e63230d2b56bec46ab1273f0962f0fce43248fb1acbd7214be5a319b53fc170e",
  "hash": "e63230d2b56bec46ab1273f0962f0fce43248fb1acbd7214be5a319b53fc170e",
  "version": 2,
  "size": 301,
  "vsize": 301,
  "locktime": 0,
  "vin": [
    {
      "txid": "34ae4b2ae7eea5240df15909207e405b410cb734445c787335711fc31d188ed1",
      "vout": 1,
      "scriptSig": {
        "asm": "0 3044022038b7aaf811db578a0b62b1ff69f7b2a6054cd9b770275b292ff63bb6b6faa96902202ffa91a950c8976722284a0bcd3ad9c54e11e441f9f632c3dd76f9174f1d0c0a[ALL] 3045022100a3c48312f94652269b6e23b3e48ead21b788a2d162205d9ba4c01c9cddfc9ea70220772828f03307eaf90cc17f12f2f97e8424ff5f5311839b4095f775813cb2dada[ALL] 52210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552ae",
        "hex": "00473044022038b7aaf811db578a0b62b1ff69f7b2a6054cd9b770275b292ff63bb6b6faa96902202ffa91a950c8976722284a0bcd3ad9c54e11e441f9f632c3dd76f9174f1d0c0a01483045022100a3c48312f94652269b6e23b3e48ead21b788a2d162205d9ba4c01c9cddfc9ea70220772828f03307eaf90cc17f12f2f97e8424ff5f5311839b4095f775813cb2dada014752210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552ae"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.99887766,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_HASH160 6fb7855fc9f0fcad63dacb27103f3ee6089b6540 OP_EQUAL",
        "hex": "a9146fb7855fc9f0fcad63dacb27103f3ee6089b654087",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2N3RvqqdX1ou9brMRThsr9hdJpHXPkDGXt9"
        ]
      }
    }
  ]
}

UTX that raw transaction tries to spend:
34ae4b2ae7eea5240df15909207e405b410cb734445c787335711fc31d188ed1

UTX pubKey script section:
a9146fb7855fc9f0fcad63dacb27103f3ee6089b654087

ScriptSig:
00473044022038b7aaf811db578a0b62b1ff69f7b2a6054cd9b770275b292ff63bb6b6faa96902202ffa91a950c8976722284a0bcd3ad9c54e11e441f9f632c3dd76f9174f1d0c0a01483045022100a3c48312f94652269b6e23b3e48ead21b788a2d162205d9ba4c01c9cddfc9ea70220772828f03307eaf90cc17f12f2f97e8424ff5f5311839b4095f775813cb2dada014752210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552ae

When I debug a script with online debugger it executes well.
Online debugger is unhappy about last opcode 0x87 OP_EQUAL, but it may be the debugger limitation only:
a9146fb7855fc9f0fcad63dacb27103f3ee6089b654087

What is wrong with my raw transaction that I try to broadcast? 
Why does OP_CHECKMULTISIG fail?
I think that OP_CHECKMULTISIG comes from redeemScript:
52210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552ae

The redeemScript decoded:
2 0283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e 03e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a9455 2 OP_CHECKMULTISIG

I played with signatures order but it didn't help.

**Tags:** bitcoind, multi-signature, hardware-wallet

> **Comments:**
> **username_1**: are you manually composing tx, or using a tool? What is the raw tx? I tried to decompose to the unsigned raw tx (020000000134AE4B2AE7EEA5240DF15909207E405B410CB734445C787335711FC31D188ED1010000004752210283910b39cc9fab5ca7ad622dbe4a09e13ce53232b8695f96315c6e90c64c526e2103e88f91c7e130cc2f760d82b8135af8ec493860b0943649c65e0daf8b3b5a945552aeFFFFFFFF01962AF4050000000017A9146FB7855FC9F0FCAD63DACB27103F3EE6089B65408700000000), double sha256 it, but then the signature  verification would fail in each case. btw: why is it using version 02000000?  
> **username_0**: version 02 is a testnet, I am composing a tx with hardware wallet (ledger nano) btchip-python framework.  

---

## 0 answers

