UTXO
Bitcoin's UTXO model is one of the hardest concepts to grasp for those new to the space or those coming from other chains. UTXO is an acronym that stands for Unspent Transaction Output and is the scheme by which Bitcoin tracks ownership and transferring of funds. The UTXO model is also the reason why we are able to track and index the atomic units (satoshis) of Bitcoin, which in turn facilitates the Ordinals ecosystem. Before we dive in below, be aware that many wallets today abstract away the complexities of UTXOs for the end user.
To explain how the UTXO model works, let's look at how other chains do it first. Ethereum uses an accounts model when each address has a balance. When you receive or send ETH, the address balance is updated to reflect this change by simply adding or subtracting from the current balance, much like how a bank account might work.
Contrastingly, Bitcoin's UTXO model deals in tracking individual units rather than establishing a singular balance. An address balance is not a single number, but rather a collection of outputs "leftover" from past transactions that are tracked and summed to find your total balance.
Let's look at an example:
Alice has a new address that has no BTC in it. Charlie sends 100 BTC to Alice at this new address: Alice's address now has 1 UTXO with a balance of 100 BTC.
Alice now wants to send 75 bitcoin to Bob to make a payment for a product. She would use her 100 BTC UTXO to send a transaction for 75 BTC to Bob and would receive a new 25 BTC UTXO back from the transaction as "change". The total value of this transaction is 100 BTC, even if only 75 BTC is being sent. Alice now has a new UTXO with 25 BTC and Bob now has a new UTXO with 75 BTC.
As it turns out, Alice accidentally overpaid for the product so now Bob needs to send her 30 BTC back. When Bob sends 30 BTC back to Alice, the total value of the transaction is 75 BTC. The two outputs of the transaction would be 45 BTC sent back to Bob as change in a new UTXO and Alice would receive a new UTXO for 30 BTC. Alice now has 2 UTXOs in her wallet: a UTXO for 25 BTC from the original transaction and a new UTXO for the 30 BTC sent from Bob. Alice's two UTXOs are summed to find her total balance of 55 BTC.
Alice now has two UTXOs with a summed value of 55 BTC (her balance) and let's say Alice wants to send 40 BTC back to Charlie. Because 40 BTC is greater than the balance of either UTXO, both would be utilized to make this transaction. The transaction would involve the 30 BTC UTXO plus 10 BTC from the second 25 BTC UTXO being sent as a new 40 BTC UTXO to Charlie and Alice would receive back a new 15 BTC UTXO.
The above is an oversimplified version and doesn't take things like transaction fees into account. In reality, a total balance of 100 BTC can be made up of 1, 5, 20, 100, or more UTXOs based on transactions. UTXOs cannot be split in your wallet; at least one full UTXO will be utilized in all transactions and the remaining amount leftover will be sent back as change in a new UTXO.
UTXOs and Ordinals
As mentioned above, Bitcoin's UTXO model is how we're able to isolate and track individual satoshis; accounts-model based chain are not able to do this. Ordinal inscriptions live on satoshis that are in their own UTXO. This mean that sending someone an inscription in reality is sending them the satoshi in its own UTXO that is associated with on-chain data.
Last updated