So you are saying that even before a tx receives a confirmation, it is "added" to the UTXO set.
Even before a transation receives a confirmation, the outputs that are referenced by the inputs are REMOVED from the UTXO, and the new outputs are ADDED to the UTXO.
theory, there would be an increase of millions of new UTXOs within the UTXO set for at least 72 hours?
from the UTXO set if the spending tx was invalidated or dropped from the mempool?
The outputs that are added to the UTXO are removed from the UTXO if the transaction is invalidated OR if the transaction is dropped from the mempool OR if the outputs are spent by another transaction.
address has valid inputs that are unmoved, the address is an "unspent output". Thus the UTXO term.
So metaphorically, the input only exists to validate spent outputs that are being transformed into
unspent outputs within a new address for example. Coinbase's would be the only true input in my
thinking, since they "originate" outside of the blockchain. This was my reasoning.
I thought outputs were moving from a state of unspent to spent continuously.
Inputs were just another representation for of an unspent output.
Next, inputs never "move". They are listed in a transaction and they remain there.
Finally, coinbase transactions have outputs, but never have inputs.
Yes, I understand now.
My issue was that not only was I overall incorrect in my understanding, but also that my
termonology and vocabulary was preventing me from articulating my intention to you. For
example, which you state, "coins" and "addresses" are abstractions and do not exist within
the code for functioning, but are representations for convenience and use. The problem is
that I am aware that they do not exist, but since I am a laymen with all of this in general,
when I use "address" and "coin" it is due to me not knowing the proper terms, so I refer
to the abstraction so you can determine what I am intending to say. But ultimately, that
leads to increased confusion and misunderstandings. Majority of the time, the proper term
I should have been using was "input", and at other times, "output".
==========
Transaction A (Coinbase)
Inputs:
none
Outputs:
Value:1250000000 Encumbrance: Signature required from private key associated with public key Z
==========
("Transaction A, first output", added to UTXO)
==========
Transaction B
Inputs:
Transaction A, first output, signature from valid private key
Outputs:
Value 1000000000 Encumbrance: Signature required from private key associated with public key Y
Value 0240000000 Encumbrance: Signature required from private key associated with public key X
==========
("Transaction A, first output", removed from UTXO
"Transaction B, first output", added to UTXO
"Transaction B, second output", added to UTXO)
==========
Transaction C
Inputs:
Transaction B, first output, signature from valid private key.
Outputs:
Value 0500000000 Encumbrance: Signature required from private key associated with public key W
Value 0400000000 Encumbrance: Signature required from private key associated with public key V
==========
("Transaction B, first output", removed from UTXO
"Transaction C, first output", added to UTXO
"Transaction C, second output", added to UTXO)
==========
Invalid transaction D
Inputs:
Transaction A, first output, signature from valid private key
Outputs:
Value 0500000000 Encumbrance: Signature required from private key associated with public key U
Value 0740000000 Encumbrance: Signature required from private key associated with public key T
==========
(Transaction D rejected because Transaction A, first output is not in the UTXO, it was removed by Transaction B)
==========
Transaction E
Inputs:
Transaction B, second output, valid signature
Transaction C, first output, valid signature
Outputs:
Value 0730000000 Encumbrance: Signature required from private key associated with public key S
==========
("Transaction B, second output", removed from UTXO
"Transaction C, first output", removed to UTXO
"Transaction E, first output", added to UTXO)
So at this point the UTXO lists:
- "Transaction C, second output"
- "Transaction E, first output"
If transaction E takes too long to confirm and is removed from the mempool then "Transaction E, first output" will be removed from the UTXO list. "Transaction B, second output" and "Transaction C, first output" will both be added back into the UTXO list.
In that case, the UTXO list would revert to:
- "Transaction B, second output"
- "Transaction C, first output"
- "Transaction C, second output"
Note that the UTXO is just a list. Things are added to that list, and removed from that list, but that doesn't have any effect on what is in the transaction. They transaction remains static exactly the way it was created with its own lists of inputs and outputs.
This visual representation is great.
If you didn't create that, I would still be reading all your words very slowly over and
over attempting to understanding the procedure properly.
I can see all the different parts, their individual importance, and how it reacts to
certain events or non-events.
So when I gather multiple inputs to make a new tx with 1 output, I am really gathering
multiple unspent outputs and making a new tx to spend them to another address where the
process could begin again if I controlled that new address.
"Bitcoin doesn't work the way a lot of people expect it to, and when they are first exposed to the whole input and output concept it can be confusing."
I understand now. My original understanding was very wrong.
term "input" I am only referring to the "coins" associated with the prior tx, when in reality an
"input" contains an "outpoint", a "signature script", and a "sequence number". I assumed they
were separate and part of the full tx and not part of the input/output aspects of the tx.
I always knew that certain terms the community used didn't actually exist within the code,
but I did not understand that it essentially breaks down to the input/output specifically. I always
viewed the input/output only as the ledger's accounting for "this is where the coins originated"
and "this is where the coins are going". Its very wrong, on different levels.
from the beginning and properly.
"coins" are an abstraction for us humans. They do not actually exist at transaction and blockchain level.
"addresses" are an abstraction for us humans. They do not actually exist at transaction and blockchain level.
A transaction is really just 2 lists. There isn't much more to it. The first list is called "inputs", and is a list of outputs of other transactions along with signatures that satisfy the encumbrance of those outputs. The sum of the values of those outputs is the total value available for the transaction to use in its own outputs. The second list is called "outputs" and is a list of new unspent outputs each encumbered with a requirement (typically a signature requirement). The sum of the values of those outputs is not allowed to exceed the total value supplied by the inputs.
I fully understand now.
Thank you for taking the time to correct and explain this.
I still need to get a good book about the basics of Bitcoin and really learn about everything else properly.
My misunderstanding centered from assuming input/output was just the ledger entries' status.
Which is either due to my lack of computer programming/science or just my incorrect assumption.
It is probably time for me to start reading books by experts who write for novices.