vout
is the 0 based output index. It can be more than just 0
or 1
, but those tend to be the most common because people don't make transactions with lots of outputs.
To understand vout
, you must understand how Bitcoin transactions actually work. A Bitcoin transaction consumes transaction outputs as inputs, and creates transaction outputs. It can consume multiple transaction outputs, and create multiple transaction outputs. Furthermore, these transaction outputs can be consumed by different transactions, so each one needs to be able to be uniquely identified. So a unique identifier contains two items: the transaction id to identify the transaction an output belongs to, and an index to point to the position in the list of outputs in that particular transaction.
That index is what the vout
is. As with many things in computer science, it is a 0 based counter so the first item is at index 0
, the second at 1
, and so on.
listsinceblock
, listtransactions
, and some other RPCs in Bitcoin Core don't actually list Bitcoin transactions. Rather they list the logical transaction - the one that humans tend to think of. This is because a single Bitcoin transaction can both send Bitcoin away from you, and allow you to receive Bitcoin.
In a single Bitcoin transaction, you can be consuming your own transaction outputs, so the transaction is sending your Bitcoin away. However not all transactions contain inputs from the same person. This transaction could involve another person who has their own transaction outputs as inputs to this transaction. And perhaps they are creating an output that you would be able to spend. So this transaction is also sending Bitcoin to you. This single Bitcoin transaction would then consist of two logical transactions - one where you are sending, and one where you are receiving.
This can often occur with change outputs, but the software should not be showing you those as it is smart enough to hide them and not consider them as a distinct logical transaction. Change outputs are when a transaction output is created by you that sends the Bitcoin back to yourself. They exist because a transaction output must be spent in full, but often the amount you are actually sending does not exactly match the exact amount of the output your are spending. So you must create an output that sends the remainder back to yourself.