A transaction- UTXO’s, new output(s), input(s) and previous output(s).
A transaction locks value (bitcoin) to an address or a script, it does this by creating new output(s) (also referred to as (UTXO’s, Unspent Transaction Outputs), by creating input(s) onto the receiving address.
Complex huh ? It is, let’s have a closer look: An address “holds” value (bitcoin) to be spent, say, a given address receives five deposits, consisting of : 0.1, 0.2, 0.3, 0.4 and 0.5 BTC. The address now holds a combined value of 1.5 BTC, made up of the five individual deposits. These individual deposits are UTXO’s, which means that the owner of the address in question now has five UTXO’s at his disposal. UTXO’s are Bitcoin’s version of available balance to be spent.
● UTXO’s are able to be poured into new UTXO’s with bigger or smaller values.
● Each UTXO requires its own signature.
The owner of the address above, which received five individual UTXO’s with a combined value of 1.5 BTC, decides to deposit 0.65 BTC onto another address. Since there are no UTXO’s available that precisely match the needed value, some have to be poured into new values, which looks like this : The UTXO’s with a value of 0.5 BTC and 0.2 BTC are close to the needed value, but not quite right, they are poured into two new UTXO’s, with one receiving a value of 0.65 BTC, and one receiving a value of 0.05 BTC, the latter being returned to the sender's address as change. If there were fees (e.g 0.01 BTC) to be deducted, the sender's change would be reduced to 0.04 BTC.
The owner of the address above now decides to deposit his bitcoin onto another address, thus creating a new output through an input onto the receiving address, but what is, or does, an input do ?
An input refers to the process of creating a new output, that includes specifying which of the available UTXO’s are to be spent on new outputs, creating a chain-of-ownership, and authorizing the transaction with the owner’s digital signature, thus providing proof-of-ownership as well as signing the new output with the input’s specific script signature, ensuring that the new output can’t be changed on a later stage.
● Each transaction is signed by the owner through a digital signature, which is achieved by applying the private key to the transaction data, which produces a numerical signature, this numerical signature is referred to as a “digital signature”.
The UTXO’s spent in the above transaction are now referred to as previous outputs, since they don’t hold any spendable value anymore.
Transactions also receive an identification number, referred to as a TXID (Transaction ID), which is created through hashing a transaction’s transaction data (the respective inputs and outputs) twice through the SHA256-function.