<p>I have been following the <a href="https://bitcoin.org/en/developer-examples#simple-raw-transaction" rel="nofollow">Bitcoin Core tutorial on creating a simple raw transaction</a> from an offline computer using the CLI.</p>

<p>The part on <a href="https://bitcoin.org/en/developer-reference#createrawtransaction" rel="nofollow"><code>createrawtransaction</code></a> indicates that the raw transaction should have a <code>vout</code> value:</p>

<blockquote>
  <p>The output index number (vout) of the outpoint; the first output in a
  transaction is index 0</p>
</blockquote>

<p>Therefore, if there is only one outpoint, its <code>vout</code> value should be 0.</p>

<p><strong>However, <a href="https://bitcoin.org/en/developer-reference#createrawtransaction" rel="nofollow"><code>createrawtransaction</code></a> only works with <code>vout=1</code>, even though I have only one <code>txid</code> in the command - what am I missing here?</strong></p>

CC BY-SA 3.0
2016-07-16T04:52:31.553Z
Can you post the transaction id of the output you are trying to use to create the transaction? If the unspent output has a vout=0, it should work just fine with `createrawtransaction '[{"txid":"6aeSomeTxId", "vout":0}]' '{"1SomeOtherAddress":0.01,"1changeAddress":0.05}'`
m1xolyd1an
CC BY-SA 3.0
2016-07-17T02:58:01.097Z
Are you using the vout of the transaction you're spending or the transaction you're creating? It should be the vout of the outpoint you're spending.
Nick ODell
<bitcoin-cli><createrawtransaction>
vout value in createrawtransaction
Adam Matan
# vout value in createrawtransaction

(Asked by: username_0 on 2016-07-16)

I have been following the [Bitcoin Core tutorial on creating a simple raw transaction](https://bitcoin.org/en/developer-examples#simple-raw-transaction) from an offline computer using the CLI.

The part on [`createrawtransaction`](https://bitcoin.org/en/developer-reference#createrawtransaction) indicates that the raw transaction should have a `vout` value:

> The output index number (vout) of the outpoint; the first output in a
> transaction is index 0

Therefore, if there is only one outpoint, its `vout` value should be 0.

**However, [`createrawtransaction`](https://bitcoin.org/en/developer-reference#createrawtransaction) only works with `vout=1`, even though I have only one `txid` in the command - what am I missing here?**

**Tags:** bitcoin-cli, createrawtransaction

> **Comments:**
> **username_1**: Can you post the transaction id of the output you are trying to use to create the transaction? If the unspent output has a vout=0, it should work just fine with `createrawtransaction '[{"txid":"6aeSomeTxId", "vout":0}]' '{"1SomeOtherAddress":0.01,"1changeAddress":0.05}'`  
> **username_2**: Are you using the vout of the transaction you're spending or the transaction you're creating? It should be the vout of the outpoint you're spending.  

---

## 0 answers

