Sendrawtransaction error on Bitcoin Core Version 0.16.0

1

I updated my bitcoin core to version 0.16.0, previously I was using v0.15.1. I created an application to send some BTC using listunspent -> createrawtransaction-> signrawtransaction -> sendrawtransaction I got this error on v.0.16.0 while using sendrawtransaction :

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

But my app working normaly on version 0.15.1 What is actually going on on version 0.16.0 that makes my transaction error

I decoded my raw transaction, to see if anything is wrong, I am using BTC testnet

array:2 [
  "status" => true
  "result" => array:8 [
    "txid" => "261c30c9c167b079c45c5ea706617635eb477b9cb601b7c7addbd6fedc2c14d9"
    "hash" => "261c30c9c167b079c45c5ea706617635eb477b9cb601b7c7addbd6fedc2c14d9"
    "version" => 2
    "size" => 197
    "vsize" => 197
    "locktime" => 0
    "vin" => array:3 [
      0 => array:4 [
        "txid" => "d4fcae2238c7edde389c3e1d28ddd67570931c72982312fbae3292c6eb7b7620"
        "vout" => 0
        "scriptSig" => array:2 [
          "asm" => ""
          "hex" => ""
        ]
        "sequence" => 4294967295
      ]
      1 => array:4 [
        "txid" => "5e759bcccc5123e9fbad740b57a1571a5950e867619dfd4cbbe6786dd50ab054"
        "vout" => 0
        "scriptSig" => array:2 [
          "asm" => ""
          "hex" => ""
        ]
        "sequence" => 4294967295
      ]
      2 => array:4 [
        "txid" => "d1be0d65d5338c9bc4b51b14f6adee7f88e56d0f9625c92646e16aa86e7c6a71"
        "vout" => 1
        "scriptSig" => array:2 [
          "asm" => ""
          "hex" => ""
        ]
        "sequence" => 4294967295
      ]
    ]
    "vout" => array:2 [
      0 => array:3 [
        "value" => 1.0
        "n" => 0
        "scriptPubKey" => array:5 [
          "asm" => "OP_HASH160 7ba3562975f6203987c03b40dd84e010948af2e4 OP_EQUAL"
          "hex" => "a9147ba3562975f6203987c03b40dd84e010948af2e487"
          "reqSigs" => 1
          "type" => "scripthash"
          "addresses" => array:1 [
            0 => "2N4WxmhixnDF6x2gmJSjgoX28RMSd6oCaMr"
          ]
        ]
      ]
      1 => array:3 [
        "value" => 6.01032205
        "n" => 1
        "scriptPubKey" => array:5 [
          "asm" => "OP_HASH160 b449a4b595e856c16eba7d7168ac5fdcc552fbbf OP_EQUAL"
          "hex" => "a914b449a4b595e856c16eba7d7168ac5fdcc552fbbf87"
          "reqSigs" => 1
          "type" => "scripthash"
          "addresses" => array:1 [
            0 => "2N9gVqeSJnLKPGRJJa2gKXUPy5bT331sxNo"
          ]
        ]
      ]
    ]
  ]
]

Billy Adelphia

Posted 2018-03-27T03:05:58.000

Reputation: 165

That error just means the signature is invalid. Did signrawtransaction succeed and produce a fully signed transaction?Pieter Wuille 2018-03-27T03:10:39.653

yes it's succeed on raw transaction. And I forgot to mention, v.0.16.0 need redeemScript on signrawtransaction, on v.0.15.1 I don't need that, it's that the culprit ?Billy Adelphia 2018-03-27T03:15:05.397

If you're spending outputs on P2SH-P2WPK addresses (which are default on Bitcoin Core 0.16) you need a redeemscript to sign, yes. Are you perhaps supplying an incorrect one?Pieter Wuille 2018-03-27T03:17:38.520

I am sure I supplied the correct one, can you check my decoded rawtransaction above ? I provide one using testnet transactionBilly Adelphia 2018-03-27T03:33:56.927

The scriptSigs of your transaction are completely empty which means that no redeemScript was provided nor are there any signatures.Andrew Chow 2018-03-27T04:51:36.533

Answers

-2

I encountered the same issue, to resolve I resorted to starting the bitcoind daemon using the following flag:

-deprecatedrpc=signrawtransaction

I am now looking for a better solution.

Danny Brewster

Posted 2018-03-27T03:05:58.000

Reputation: 1

In v0.17 / master, signrawtransaction was split into signrawtransavtionwithkey and signrawtransactionwithwallet. This is not OP's problem.Pieter Wuille 2018-04-02T16:22:36.020

@peterwuille signrawtransactionwithwallet there is a typo in your comment (the v should be a c) (it won't let me suggest an edit)PW Kad 2019-01-18T19:12:33.730