<p>From your <code>listunspent</code>: <strong><code>"vout": 1,</code></strong></p>

<p>From your <code>createrawtransaction</code>: <strong><code>"vout":2</code></strong></p>

<p>You are trying to spend an output that doesn't exist.</p>

CC BY-SA 4.0
2019-07-22T20:36:31.343Z
negative. if i amend `createnewtransaction` so `"vout":1` and repeat process, I still get same error.
Ryan Skene
CC BY-SA 4.0
2019-07-22T23:15:48.557Z
Did you also change the `vout` parameter in `signrawtransaction` too?
Ava Chow
CC BY-SA 4.0
2019-07-22T20:28:36.953Z
2019-07-22T20:28:36.953Z
Ava Chow
<p>Working with Bitcoin-qt 0.16.3 testnet</p>

<p>Attempting to <code>sendrawtransaction</code>, however, receive following error:</p>

<pre><code>Missing inputs (code -25)
</code></pre>

<p>From what I have read, this results from attempting to use outputs in the transaction that have already been spent.</p>

<p>I am confused, however, because I am explicitly using a transaction listed by <code>listunspent</code>. Doesn't that mean the output is unspent???</p>

<p>If you could point me to where I am going wrong, it would be greatly appreciated.</p>

<p>Here's exactly my work:</p>

<p><code>listunspent</code></p>

<p>output</p>

<pre><code>[
  {
    "txid": "8d42a2db310b794ae0d75ed9a68262081fd83817a862f87a99cd176ce8743223",
    "vout": 1,
    "address": "2MtBLx3arsHFV1cBYSo5AXmX5Pf3tfcgda3",
    "account": "addy2",
    "redeemScript": "0014436faf386d5c77c575e3372a97e268a08e3f5378",
    "scriptPubKey": "a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf287",
    "amount": 0.00010000,
    "confirmations": 229,
    "spendable": true,
    "solvable": true,
    "safe": true
  }
]
</code></pre>

<p>input</p>

<pre><code>createrawtransaction '[{ "txid": "8d42a2db310b794ae0d75ed9a68262081fd83817a862f87a99cd176ce8743223", "vout":2 }]' '{ "2N8kPhdhwAYYK8rFt7Fhvm3oapsMF7vqbcB":0.00003, "2MtBLx3arsHFV1cBYSo5AXmX5Pf3tfcgda3":0.0000695}'
</code></pre>

<p>output</p>

<pre><code>0200000001233274e86c17cd997af862a81738d81f086282a6d95ed7e04a790b31dba2428d0200000000ffffffff02b80b00000000000017a914aa0e0ebe49d03dc1b79f91775aada9293179bb2387261b00000000000017a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf28700000000
</code></pre>

<p>input</p>

<pre><code>signrawtransaction '0200000001233274e86c17cd997af862a81738d81f086282a6d95ed7e04a790b31dba2428d0200000000ffffffff02b80b00000000000017a914aa0e0ebe49d03dc1b79f91775aada9293179bb2387261b00000000000017a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf28700000000' '[{"txid":"8d42a2db310b794ae0d75ed9a68262081fd83817a862f87a99cd176ce8743223","vout":2,"scriptPubKey":"a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf287","redeemScript": "0014436faf386d5c77c575e3372a97e268a08e3f5378",
"amount":0.0001}]'
</code></pre>

<p>output</p>

<pre><code>{
  "hex": "02000000000101233274e86c17cd997af862a81738d81f086282a6d95ed7e04a790b31dba2428d0200000017160014436faf386d5c77c575e3372a97e268a08e3f5378ffffffff02b80b00000000000017a914aa0e0ebe49d03dc1b79f91775aada9293179bb2387261b00000000000017a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf287024830450221009274a153ee55925681d5382fecbff723e2ec12e92dafc7188565e2ee2bef092402201133ec3545333afeacda23b63917660ed62be667508dbb5a121a4ed9aa52125401210273340ff4511f6bbcf7d9f1c1fe69f66704398e54f4cde0e0ec60313476fc92ab00000000",
  "complete": true
}
</code></pre>

<p>input</p>

<pre><code>sendrawtransaction 02000000000101233274e86c17cd997af862a81738d81f086282a6d95ed7e04a790b31dba2428d0200000017160014436faf386d5c77c575e3372a97e268a08e3f5378ffffffff02b80b00000000000017a914aa0e0ebe49d03dc1b79f91775aada9293179bb2387261b00000000000017a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf287024830450221009274a153ee55925681d5382fecbff723e2ec12e92dafc7188565e2ee2bef092402201133ec3545333afeacda23b63917660ed62be667508dbb5a121a4ed9aa52125401210273340ff4511f6bbcf7d9f1c1fe69f66704398e54f4cde0e0ec60313476fc92ab00000000
</code></pre>

<p>output</p>

<pre><code>Missing inputs (code -25)
</code></pre>

<bitcoin-core>
Issue with sendrawtransaction missing inputs error code -25
Ryan Skene
# Issue with sendrawtransaction missing inputs error code -25

(Asked by: username_0 on 2019-07-22)

Working with Bitcoin-qt 0.16.3 testnet
Attempting to sendrawtransaction, however, receive following error:
Missing inputs (code -25)

From what I have read, this results from attempting to use outputs in the transaction that have already been spent.
I am confused, however, because I am explicitly using a transaction listed by listunspent. Doesn't that mean the output is unspent???
If you could point me to where I am going wrong, it would be greatly appreciated.
Here's exactly my work:
listunspent
output
[
  {
    "txid": "8d42a2db310b794ae0d75ed9a68262081fd83817a862f87a99cd176ce8743223",
    "vout": 1,
    "address": "2MtBLx3arsHFV1cBYSo5AXmX5Pf3tfcgda3",
    "account": "addy2",
    "redeemScript": "0014436faf386d5c77c575e3372a97e268a08e3f5378",
    "scriptPubKey": "a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf287",
    "amount": 0.00010000,
    "confirmations": 229,
    "spendable": true,
    "solvable": true,
    "safe": true
  }
]

input
createrawtransaction '[{ "txid": "8d42a2db310b794ae0d75ed9a68262081fd83817a862f87a99cd176ce8743223", "vout":2 }]' '{ "2N8kPhdhwAYYK8rFt7Fhvm3oapsMF7vqbcB":0.00003, "2MtBLx3arsHFV1cBYSo5AXmX5Pf3tfcgda3":0.0000695}'

output
0200000001233274e86c17cd997af862a81738d81f086282a6d95ed7e04a790b31dba2428d0200000000ffffffff02b80b00000000000017a914aa0e0ebe49d03dc1b79f91775aada9293179bb2387261b00000000000017a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf28700000000

input
signrawtransaction '0200000001233274e86c17cd997af862a81738d81f086282a6d95ed7e04a790b31dba2428d0200000000ffffffff02b80b00000000000017a914aa0e0ebe49d03dc1b79f91775aada9293179bb2387261b00000000000017a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf28700000000' '[{"txid":"8d42a2db310b794ae0d75ed9a68262081fd83817a862f87a99cd176ce8743223","vout":2,"scriptPubKey":"a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf287","redeemScript": "0014436faf386d5c77c575e3372a97e268a08e3f5378",
"amount":0.0001}]'

output
{
  "hex": "02000000000101233274e86c17cd997af862a81738d81f086282a6d95ed7e04a790b31dba2428d0200000017160014436faf386d5c77c575e3372a97e268a08e3f5378ffffffff02b80b00000000000017a914aa0e0ebe49d03dc1b79f91775aada9293179bb2387261b00000000000017a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf287024830450221009274a153ee55925681d5382fecbff723e2ec12e92dafc7188565e2ee2bef092402201133ec3545333afeacda23b63917660ed62be667508dbb5a121a4ed9aa52125401210273340ff4511f6bbcf7d9f1c1fe69f66704398e54f4cde0e0ec60313476fc92ab00000000",
  "complete": true
}

input
sendrawtransaction 02000000000101233274e86c17cd997af862a81738d81f086282a6d95ed7e04a790b31dba2428d0200000017160014436faf386d5c77c575e3372a97e268a08e3f5378ffffffff02b80b00000000000017a914aa0e0ebe49d03dc1b79f91775aada9293179bb2387261b00000000000017a9140a3c45e4e27e98b6bf1171b4fe1bf689b9a3dbf287024830450221009274a153ee55925681d5382fecbff723e2ec12e92dafc7188565e2ee2bef092402201133ec3545333afeacda23b63917660ed62be667508dbb5a121a4ed9aa52125401210273340ff4511f6bbcf7d9f1c1fe69f66704398e54f4cde0e0ec60313476fc92ab00000000

output
Missing inputs (code -25)

**Tags:** bitcoin-core


---

## 1 answers

### Answer by username_1 on 2019-07-22. Score: 1

From your `listunspent`: **`"vout": 1,`**

From your `createrawtransaction`: **`"vout":2`**

You are trying to spend an output that doesn't exist.

> **Comments:**
> **username_0**: negative. if i amend `createnewtransaction` so `"vout":1` and repeat process, I still get same error.  
> **username_1**: Did you also change the `vout` parameter in `signrawtransaction` too?  

---

