# 0.6 UTXO based model

Now that we understand how Bitcoin transactions work, we need to explore the fundamental concept that powers Bitcoin’s accounting system: **UTXOs (Unspent Transaction Outputs).** Unlike traditional banking systems that maintain account balances, Bitcoin operates using a **UTXO model**, which keeps track of spendable outputs from previous transactions.

#### What Are UTXOs?

A UTXO is a **unit of Bitcoin that has been received but not yet spent**. Each Bitcoin transaction consists of **inputs and outputs**, and the outputs that remain unspent become UTXOs. These UTXOs act as the available balance for a Bitcoin address.

To understand UTXOs, consider the following example:

1. Alice receives **0.5 BTC** from Bob.
2. Alice receives **0.8 BTC** from Charlie.
3. Alice now has **two UTXOs** totaling **1.3 BTC**.

When Alice wants to send **0.7 BTC** to Dave:

* She must use one or more UTXOs as inputs.
* Suppose she chooses the **0.8 BTC UTXO**.
* The transaction will generate two outputs:
  * **0.7 BTC to Dave** (spent output).
  * **0.1 BTC in change** back to Alice (new UTXO).

This process ensures that no partial UTXOs exist - each transaction consumes full UTXOs and creates new ones as change.<br>

<figure><img src="https://2329510431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvhcF8MdVyA1W0ElVe7v6%2Fuploads%2FW166tfMvrNuHyoybU6zO%2Fimage.png?alt=media&#x26;token=7402cb5e-c898-41f4-b8ad-26aff69196ab" alt=""><figcaption></figcaption></figure>

#### How UTXOs Prevent Double-Spending

Bitcoin nodes maintain a **UTXO set**, a global database of all unspent transaction outputs. Before confirming a transaction, nodes check whether the inputs being used are still unspent in the UTXO set. If an input has already been spent in a previous transaction, the transaction is rejected. This mechanism ensures **double-spending** is impossible.

#### Challenges of the UTXO Model

Despite its advantages, the UTXO model also introduces challenges:

* Managing UTXOs requires users and wallets to track individual outputs instead of a single balance.
* Since each input references a previous UTXO, transactions can become large when multiple inputs are needed.
* Small leftover UTXOs, often called "dust," can accumulate over time and become uneconomical to spend due to transaction fees.

UTXOs are the foundation of Bitcoin’s transaction model. Unlike traditional account-based systems, Bitcoin’s UTXO model offers security, decentralization, and privacy benefits while preventing double-spending. However, it also requires careful management of outputs and transaction fees.

In the next chapter, we will explore how Bitcoin’s **wallets** manage UTXOs and how fee optimization strategies help users minimize transaction costs.
