Understanding outputs and inputs
Blockchain transactions can have one or multiple inputs, and one or multiple outputs. The concepts of inputs and outputs must be understood, if one wants to understand how a transaction works, and how it relates to the Unspent Transaction Output (UTXO) accounting model. In abstract terms, think of a transaction as the action that unlocks previous outputs, and creates new ones.
A transaction output includes an address (that you can think of as a lock) and a value. In keeping with this analogy, the signature that belongs to the address is the key to unlock the output. Once unlocked, an output can be used as input. New transactions spend outputs of previous transactions, and produce new outputs that can be consumed by future transactions. Each UTXO can only be consumed once, and as a whole. Each output can be spent by exactly one input, and one input only.
A transaction input is the output of a previous transaction. Transaction inputs include a pointer and a cryptographic signature that acts as the unlocking key. The pointer points back to a previous transaction output, and the key unlocks this output. When an output is unlocked by an input, the blockchain marks the unlocked output as “spent”. New outputs created by a given transaction can then be pointed to by new inputs, and so the chain continues. These new outputs (which have not yet been unlocked, i.e., spent) are the UTXOs. Unspent outputs are simply that, outputs that have not yet been spent.