<p>Your transaction is not being signed.</p>

<p>First of all, the hex string that <code>createrawtransaction</code> gives you is not the txid, it is the transaction itself. That transaction is not stored in your wallet. </p>

<p>When you pass it to <code>signrawtransaction</code>, the raw transaction will be signed and returned to you (it will be the thing under the <code>hex</code> field in the returned object. Again, this transaction is not stored in your wallet. That signed transaction is what you pass to <code>sendrawtransaction</code>, not the thing that <code>createrawtransaction</code> gives you.</p>

CC BY-SA 3.0
2018-04-20T20:30:35.837Z
2018-04-20T20:30:35.837Z
Ava Chow
<p>I smashed my head over the table trying to send raw transaction and every time get the same error <code>bad-txns-nonstandard-inputs</code>.</p>

<hr>

<h2>So, here is what I do:</h2>

<ol>
<li><p>Get unspent transactions </p>

<pre><code>bitcoin-cli listunspent
[
  {
    "txid": "txid_number_1",
    "vout": 1,
    "address": "address_1",
    "redeemScript": "redeemScript_1",
    "scriptPubKey": "scriptPubKey_1",
    "amount": 0.00024972,
    "confirmations": 31,
    "spendable": true,
    "solvable": true,
    "safe": true
  }
]
</code></pre></li>
<li><p>Create raw transaction with tx_id and vout taken above </p>

<pre><code>bitcoin-cli createrawtransaction '[{"txid":"txid_number_1","vout":1}]' '{"address_to_sent":0.00002000}'
</code></pre></li>
</ol>

<p>tx_id_as_hexstring = </p>

<pre><code>02000000016affa8a874987f66be3ab4791b57042cbf0912088352ba0e3931b7b8b8f374c80100000000ffffffff01d0070000000000001976a9147c99343bb9cba8699e7f7b4f5552357e477dc76188ac00000000
</code></pre>

<ol start="3">
<li><p>Sign raw transaction</p>

<pre><code>bitcoin-cli signrawtransaction tx_id_as_hexstring
</code></pre></li>
<li><p>Send raw transaction</p>

<pre><code>bitcoin-cli sendrawtransaction tx_id_as_hexstring

error code: -26
error message:
64: bad-txns-nonstandard-inputs
</code></pre></li>
</ol>

<hr>

<p>I tried to create same transaction with <a href="https://coinb.in" rel="nofollow noreferrer">coinb.in</a>, but result is the same.</p>

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

<hr>

<h2>Also</h2>

<p><code>bitcoin-cli decoderawtransaction tx_id_as_hexstring</code></p>

<p>returns </p>

<pre><code>{
  "txid": "txid_number_2",
  "hash": "txid_number_2",
  "version": 2,
  "size": 85,
  "vsize": 85,
  "locktime": 0,
  "vin": [
    {
      "txid": "txid_number_3",
      "vout": 1,
      "scriptSig": {
        "asm": "",
        "hex": ""
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00002000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 7c99343bb9cba8699e7f7b4f5552357e477dc761 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9147c99343bb9cba8699e7f7b4f5552357e477dc76188ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "address_to_sent"
        ]
      }
    }
  ]
}
</code></pre>

CC BY-SA 3.0
2018-04-20T20:37:24.543Z
I had the same issue when using some kind of P2SH tx. I could get best results using all parameters to the signrawtransaction command:  <hexstring> {"txid":txid,"vout":n,"scriptPubKey":hex} <privkey>. I had to fiddle a lot with the brackets though :-( What is your redeemscript? Is it a multisig?
pebwindkraft
<raw-transaction><bitcoin-cli><createrawtransaction><sendrawtransaction>
bad-txns-nonstandard-inputs error after sendrawtransaction
Patrick Mil
# bad-txns-nonstandard-inputs error after sendrawtransaction

(Asked by: username_0 on 2018-04-20)

I smashed my head over the table trying to send raw transaction and every time get the same error `bad-txns-nonstandard-inputs`.

---

## So, here is what I do:

1. Get unspent transactions

   ```
   bitcoin-cli listunspent
   [
     {
       "txid": "txid_number_1",
       "vout": 1,
       "address": "address_1",
       "redeemScript": "redeemScript_1",
       "scriptPubKey": "scriptPubKey_1",
       "amount": 0.00024972,
       "confirmations": 31,
       "spendable": true,
       "solvable": true,
       "safe": true
     }
   ]

   ```
2. Create raw transaction with tx\_id and vout taken above

   ```
   bitcoin-cli createrawtransaction '[{"txid":"txid_number_1","vout":1}]' '{"address_to_sent":0.00002000}'

   ```

tx\_id\_as\_hexstring =

```
02000000016affa8a874987f66be3ab4791b57042cbf0912088352ba0e3931b7b8b8f374c80100000000ffffffff01d0070000000000001976a9147c99343bb9cba8699e7f7b4f5552357e477dc76188ac00000000

```

3. Sign raw transaction

   ```
   bitcoin-cli signrawtransaction tx_id_as_hexstring

   ```
4. Send raw transaction

   ```
   bitcoin-cli sendrawtransaction tx_id_as_hexstring

   error code: -26
   error message:
   64: bad-txns-nonstandard-inputs

   ```

---

I tried to create same transaction with [coinb.in](https://coinb.in), but result is the same.

What am I doing wrong?

---

## Also

`bitcoin-cli decoderawtransaction tx_id_as_hexstring`

returns

```
{
  "txid": "txid_number_2",
  "hash": "txid_number_2",
  "version": 2,
  "size": 85,
  "vsize": 85,
  "locktime": 0,
  "vin": [
    {
      "txid": "txid_number_3",
      "vout": 1,
      "scriptSig": {
        "asm": "",
        "hex": ""
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00002000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 7c99343bb9cba8699e7f7b4f5552357e477dc761 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9147c99343bb9cba8699e7f7b4f5552357e477dc76188ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "address_to_sent"
        ]
      }
    }
  ]
}

```

**Tags:** raw-transaction, bitcoin-cli, createrawtransaction, sendrawtransaction

> **Comments:**
> **username_1**: I had the same issue when using some kind of P2SH tx. I could get best results using all parameters to the signrawtransaction command:  <hexstring> {"txid":txid,"vout":n,"scriptPubKey":hex} <privkey>. I had to fiddle a lot with the brackets though :-( What is your redeemscript? Is it a multisig?  

---

## 1 answers

### Answer by username_2 on 2018-04-20. Score: 0 | Accepted answer

Your transaction is not being signed.

First of all, the hex string that `createrawtransaction` gives you is not the txid, it is the transaction itself. That transaction is not stored in your wallet.

When you pass it to `signrawtransaction`, the raw transaction will be signed and returned to you (it will be the thing under the `hex` field in the returned object. Again, this transaction is not stored in your wallet. That signed transaction is what you pass to `sendrawtransaction`, not the thing that `createrawtransaction` gives you.


---

