Difference between revisions of "VOUT"

Line 1: Line 1:
A VOUT is a '''transaction outpoint''' or '''transaction output number'''. It is a 4-byte integer value indicating the position of an output within a bitcoin transaction.
+
"vout" has two interpretations in a transaction.  
  
Each VOUT contains a piece of script which can be used to contain a piece of data, hold a token or lock a quantity of Satoshis. As the VOUT index is a 4 byte number, this gives users the effective ability to include a maximum of 2<sup>32</sup> outpoints in a Bitcoin transaction.  
+
When it appears in an input of a transaction, it is an index of 4 bytes. It is concatenated with a transaction ID (TxID || vout) to form an outpoint that is used to uniquely identify a particular output of a transaction. As the index is a 4 byte number, this gives users the effective ability to include a maximum of 2<sup>32</sup> outputs in a Bitcoin transaction.
 +
 
 +
When it is not part of the input, it refers to a vector of outputs of the transactions. That is, "vout" is the set of all outputs of the transaction, where each output contains output value (the amount of BSV) and scriptPubKey (a script that locks the output value). Note that the order within the set matters.  
  
 
==Unspent Transaction Outputs==
 
==Unspent Transaction Outputs==
If a VOUT has not been spent, it is referred to as an Unspent Transaction Output or [[UTXO]] and can be used in the creation of a new transaction. Once a VOUT has been used as an input to a [[Bitcoin Transactions|transaction]] that has been validated by the mining network it is considered spent and can no longer be used in a new transaction (see [[Double-spending]]).  
+
If an outpoint has not been spent, it is referred to as an Unspent Transaction Output or [[UTXO]] and can be used in the creation of a new transaction. Once an outpoint has been used as an input to a [[Bitcoin Transactions|transaction]] that has been validated by the mining network it is considered spent and can no longer be used in a new transaction (see [[Double-spending]]).  
  
 
==Zero value outputs==
 
==Zero value outputs==
VOUTS that do not contain a value in [[Satoshis]] are often used to hold scripts that carry large data items or tokens. Provably unspendable zero-value [[False Return]] outputs are predominantly used as a means to attach data to bitcoin transactions. False return transaction outputs are not stored in the UTXO set kept by miners.
+
Outputs that do not contain a value in [[Satoshis]] are often used to hold scripts that carry large data items or tokens. Provably unspendable zero-value [[False Return]] outputs are predominantly used as a means to attach data to bitcoin transactions. False return transaction outputs are not stored in the UTXO set derived by miners.
  
Non-[[False Return|false return]] zero value outputs are still valid UTXOs and can be used as inputs in a transaction, with locking conditions being applied as normal. The dust rules implemented early on in Bitcoin's history preclude the creation of complicated scripts using zero value outputs until miners remove the limits on minimum values for outputs using complex scripts.
+
Non-[[False Return|false return]] zero value outputs are still valid UTXOs and can be used as inputs in a transaction, with locking conditions being applied as normal.
  
 
==See Also==
 
==See Also==
Line 16: Line 18:
  
 
==References==
 
==References==
[1] - https://github.com/bitcoin-sv/bitcoin-sv/blob/master/src/policy/policy.h
+
[1] - https://github.com/bitcoin-sv/bitcoin-sv/blob/7fd177c7c443ff7723d88c5465fbf39285388e30/src/primitives/transaction.h
 
 
[2] - https://github.com/bitcoin-sv/bitcoin-sv/blob/dev-Genesis-beta/src/policy/policy.h
 

Revision as of 12:02, 31 January 2020

"vout" has two interpretations in a transaction.

When it appears in an input of a transaction, it is an index of 4 bytes. It is concatenated with a transaction ID (TxID || vout) to form an outpoint that is used to uniquely identify a particular output of a transaction. As the index is a 4 byte number, this gives users the effective ability to include a maximum of 232 outputs in a Bitcoin transaction.

When it is not part of the input, it refers to a vector of outputs of the transactions. That is, "vout" is the set of all outputs of the transaction, where each output contains output value (the amount of BSV) and scriptPubKey (a script that locks the output value). Note that the order within the set matters.

Unspent Transaction Outputs

If an outpoint has not been spent, it is referred to as an Unspent Transaction Output or UTXO and can be used in the creation of a new transaction. Once an outpoint has been used as an input to a transaction that has been validated by the mining network it is considered spent and can no longer be used in a new transaction (see Double-spending).

Zero value outputs

Outputs that do not contain a value in Satoshis are often used to hold scripts that carry large data items or tokens. Provably unspendable zero-value False Return outputs are predominantly used as a means to attach data to bitcoin transactions. False return transaction outputs are not stored in the UTXO set derived by miners.

Non-false return zero value outputs are still valid UTXOs and can be used as inputs in a transaction, with locking conditions being applied as normal.

See Also

References

[1] - https://github.com/bitcoin-sv/bitcoin-sv/blob/7fd177c7c443ff7723d88c5465fbf39285388e30/src/primitives/transaction.h