Commonly, we are able to see the account balance in Bitcoin wallets. However, there is no “balance” concept in the Bitcoin system designed by Satoshi Nakamoto. So how do you know how much Bitcoin you have?

 

The transactions of Bitcoin are based on the scheme of UTXO, which is a unique account structure of Bitcoin. It is used to query how much spendable Bitcoin there is in the user's account.

 

The full name of UTXO is Unspent Transaction Output. It is a core concept of the generation and validation of Bitcoin transactions.

 

Bitcoin transactions are linked up into a chain structure, in which every legit Bitcoin transaction can be traced back to the output of one or more transactions before it. The start of each transaction chain is the mining reward and the end is the current UTXO.

 

  1. Traditional Account Structure

 

When we make transactions in real life, the process is usually like:
When Eric has 10 dollars on his account and transfers 2 dollars to William, 2 dollars will be deducted from Eric’s account while William’s account will be added with 2 dollars correspondingly. After that, each one of Eric and William transfers 1 dollar to Peter, which will result in decrease of 1 dollar from each of Eric and William’s accounts and increase of 2 dollars on Peter’s account.

The whole process is as follows:

 


(Traditional account-based transactions)

 

  1. Bitcoin UTXO Scheme

In Bitcoin transactions are entirely different. Let’s say Eric gained 10 BTC by mining. He transferred 2 BTC to William, then each of them transferred 1 BTC to Peter.

The whole process would be like:

 

 (Transactions between Bitcoin addresses)

 

 

Only the flows of transactions are recorded in their Bitcoin addresses, and there is no “balance” concept here. Let’s look at the tables below:

 

 

 

 

(Transaction records of Eric, William and Peter)

 

 

Every Bitcoin transaction is composed of several inputs and outputs. Simply speaking, the input is the transaction record which records how you got the Bitcoins. This is also the proof that you actually own sufficient amount of Bitcoins when you make a transaction.

 

There are two types of transactions in Eric’s Bitcoin address, of which “Coinbase” is a special type of transaction. It means his mining reward which only has output but no input. The output in this Coinbase transaction is Eric’s Bitcoin address. In this case, Eric transferred 2 BTC to William. The input here would be the previous transaction that contains Eric’s 10 BTC mining reward. The output of 2 BTC is to William, while the other 8 BTC is transferred back to Eric.

 

The output amount should be no larger than the input. If the remaining Bitcoins are not transferred back to the sender, they would be very likely rewarded to the miner as a gas fee.

 

The subsequent processes are quite similar. The input of William’s 1 BTC transaction to Peter is the 2 BTC he received from Eric. This transaction structure that contains several inputs and outputs is called UTXO (Unspent Transaction Output). There is a certain area in the database to record the UTXOs. Once the UTXO turns into outputs as an input, the input transaction will be deleted from the UTXO records.