3

I am trying to understand how UTXO works. I came up with these charts https://statoshi.info/dashboard/db/unspent-transaction-output-set

I don't understand why the 1st chart (total Tx's with unspent output). As I understand it, the UTXO represents the "change" you keep after sending some funds.

Using this logic all Tx's should have a UTXO, right? As any time I send money to someone else, it should be an output for the remaining balance.

  • all transactions have outputs. transaction without at least one output is not valid. but not each output (txo) is unspent (utxo) – amaclin Oct 30 '17 at 12:59
7

Transactions are money orders to the Bitcoin network that reassign value from one owner to another. To that end, transactions reference pieces of Bitcoin in the inputs and reassign this value to recipients in outputs. When the transaction is accepted on the network, the pieces of Bitcoin referenced in the inputs are spent and new "unspent transaction outputs" (UTXO) are created according to the transaction's outputs. UTXO are how every participant in the network keeps track of where the money in the network is. UTXO are not only created for change, but any time a transaction defines a recipient. UTXO are spent whenever they get used as a transaction input. However, even so the transaction remains part of the blockchain and everyone can look up later where the transaction output was created and (eventually) spent.

Therefore, after a UTXO is spent, it's still a transaction output (TXO), but no longer a UTXO.

Take this example:

Input(utxo1)               Recipient Output
                 ----> 
Input(utxo2)               Change Output

When the transaction is created, it spends the two UTXO referenced in the inputs. As the transaction is confirmed, every participant removes them from their UTXO database. However, the reference still exists in the blockchain as the outputs of the transactions that created those UTXOs. The transaction also creates two new UTXOs, the Recipient Output and the Change Output. Every participant in the network adds these two UTXO to their database. Let's say that the sender spends the money in the change output quickly thereafter, removing the change output from the UTXO database, but the recipient TXO remains unspent. In that case, (or any other where at least one of the two outputs remains unspent) the transaction would be counted in the "Total Transactions With Unspent Outputs".

  • your answer is correct, just lacks a detail; just for the sake of completeness: the single UTXO needed by a transaction can be 0 and the tx still won't invalidate the block containing it. – vv01f Oct 30 '17 at 13:07
  • @vv01f: Your comment is correct, but really the information that a transaction has to have at least one output and more so the special case that the amount of that output could be zero are not necessary to answer the question. I've therefore removed the first sentence. ;) – Murch Oct 30 '17 at 13:14
  • I don't get it. Maybe I need someone to explain it to me slowly and with more details. I will mark the question as answered because you guys seem to understand it. – Kibou Nov 1 '17 at 11:25
  • @Kibou: I've extended my answer a bit. I hope it is clearer now. If you have any question, please ask for clarification here in the comments. – Murch Nov 1 '17 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.