What is the meaning of the term "unspent output" in the Bitcoin protocol?
An unspent output is simply an output of a transaction which isn't yet an input of another transaction.
To take the example from ripper234's answer (in which generated coins are immediately spendable, and we don't have to wait 100 blocks for them to mature), where:
- The first block contained 50 mined BTC in address A (A = 50)
- The second block contained 50 mined BTC in address A, a transaction sending 20 BTC to address B, and putting the change in address C (A = 50, B = 20, C = 30)
- The third block contained 50 mined BTC in address A, a transaction sending the 20 BTC from address B to address D (A = 50 + 50, C = 30, D = 20)
So, after three blocks, there are four unspent outputs:
- A has two unspent outputs worth 50 BTC each
- C has a single unspent output worth 30 BTC
- D has a single unspent output worth 20 BTC
And there are two spent outputs:
- the 50 BTC generated in the first block, spent in the 2nd block
- the 20 BTC output created in the 2nd block and spent in the 3rd block
Note that unspent outputs don't merge together. The two unspent 50 BTC outputs at address A are separate, and will remain separate at least until they are spent in a transaction
It means "Bitcoins that were not spent".
Imagine the early days, when the blockchain was of length 3 (imaginary chain of events):
- The first block contained 50 mined BTC in address A
- The second block contained 50 mined BTC in address A, a TX sending 20 BTC to address B, and putting the change in address C
- The third block contained 50 mined BTC in address A, a tx sending the 20 BTC from address B to address D
So, after 3 blocks, this is the "sum total":
- A has 100 BTC
- C has 30 BTC
- D has 20 BTC
Total 150 BTC in unspent outputs. These are the "unspent coins" - all the generated BTC, without counting transactions that moved BTC twice.
Bitcoin is a distributed system that enables users to receive, store, and send money. Value is transmitted by submitting a payment order to the network called a transaction. Transactions are cryptographically attested statements instructing each network participant to update their copy of the network's ledger of spendable balances which they independently maintain.
All funds in Bitcoin exist in the form of unspent transaction outputs (UTXOs): when users wish to spend bitcoins, their transaction explicitly states which UTXOs are being spent and define how their funds are to be assigned to new UTXOs. UTXOs cannot be partially spent, they are created once and then spent in full by another transaction. (You can think of bitcoins as a substance that is melted and recast every time it's spent.) Only while they are available to be spent, we refer to them as "unspent" transaction outputs, although the blockchain keeps the records of all past transaction outputs. UTXOs are denominated in satoshis, the native unit of the bitcoin protocol. 100,000,000 satoshis are one bitcoin.
Each UTXO is uniquely identified by its outpoint, the combination of the transaction that created it and its position in the transaction's list of outputs. Incidentally, "addresses" are proxies for the locking script the receiver must fulfill to spend the funds later and sending to the same address multiple times will create separate UTXOs.
For example the transaction
f4272d...a70f2e depicted here, (1) spends the two UTXOs
7be1b7...7c8378:0, and reassigns the funds to two new transaction outputs, (2) the zeroth output of the transaction
f4272d...a70f2e:0, paying to the addresses
1GxJtQ7...mee8bg, and (3) the first outputs of the transaction
f4272d...a70f2e:1, paying to the address
As you notice, these mechanics do not align with the common intuition that Bitcoin balances function like bank accounts. We refer to this model of tracking funds as the "UTXO model". You can read a bit more about the benefits of the UTXO model here: UTXO model vs. account/balance model