We are so grateful to have #[0] continue his series B4B, that explains difficult concepts that many of us struggle with when learning about #Bitcoin. Please enjoy!
—————————
BITCOIN FOR BUNNIES 🐰🕳️
B4B Issue 2: WTF Is A UTXO?
The other day, a #Nostr pleb by the name of #[3] messaged me with a question he felt ashamed to ask publicly. (Don’t worry, I’ve obtained permission to say this!) He wanted to know why when he sent an on-chain transaction from one wallet to another, he could only see the amount of the transaction displayed on mempool.space, and couldn’t figure out where to find the remaining balance from the original wallet. He was having heart palpitations trying to uncover where the rest of his satoshis had run off to.
It quickly occurred to me that he was asking about the change address, and I realized that most people who are fairly new to bitcoin—especially those who have only used the Lightning Network, or heaven forbid, have come to bitcoin from Planet Crypto—aren’t familiar with the way the bitcoin protocol manages unspent transaction outputs, or UTXOs.
So, here’s a primer to help make this easier to understand.
First of all, bitcoins don’t actually exist. Yes, you read that right. The only thing that has actual monetary value within the bitcoin network is the UTXO, which is the product of a verified bitcoin transaction, mathematically bound to a private key.
When our old friends Alice and Bob send each other magic internet money across Wonderland, what actually happens is this: Alice has a specific number attached to a private key that gives her the ability to spend the output value of a transaction she received in the past. For our purposes, her wallet has a balance of 0.0005 BTC, or 50,000 satoshis. In reality, her balance is actually the sum of TWO different UTXOs, one for 30,000 sats and another for 20,000 sats. Bob bakes cakes with the words “EAT ME” on them that cost 40,000 sats each. Naturally, Alice has to have one. When Alice creates a transaction paid to Bob’s public key, her wallet sees that there is no single UTXO that can be spent, so it creates a transaction with two inputs, which contain both UTXOs. The outputs of this transaction will be:
• Output 0: The payment to Bob’s public key
• Output 1: The change output sent to a new address created by Alice’s wallet
• The transaction fee
The 40,000 satoshi payment to Bob is currently pending, and both of Alice’s UTXOs have been spent. The remaining 10,000 sats have been split between the mining fee (a relatively small amount) and the change output, which will be returned to Alice’s wallet as a brand new UTXO. This balance is still in the mempool waiting to be included in a block, so she won’t be able to spend it until it’s confirmed, but she can see the balance in her wallet has been updated.
When Alice looks up her transaction ID on the block explorer mempool.space, she will see that it contains two inputs and two outputs. The inputs are the entire previous balance of her wallet, since the amount she sent required both UTXOs to be spent. The outputs are the amount she sent to Bob, and the remainder returned to her as change. Some wallets may not include unconfirmed funds in the total balance right away, so it’s possible that Alice won’t see it for a little while, but she can see that the address her wallet created for the brand new UTXO is part of the transaction, and once confirmed, it will be spendable again.
Unfortunately for Alice, once she has eaten the cake, she will need to spend the rest of her sats to buy a potion to return her back to normal size again.
In the book Inventing Bitcoin, #[4] (Yan Pritzker) makes this analogy about combining and splitting UTXOs to create new transactions: “Think of it like sending a bunch of coins into a machine that melts them down and mints new coins of any denomination you want.”
So there you have it. Bitcoin is a machine for turning magic internet money into irresistible cakes that turn you into a giant, and now you have a better idea of how it all works.
Thanks for stepping through the looking glass. Never be afraid to ask a question. We’re all learning together. Writing this post was an excellent refresher for me, and I appreciate all the help I got from my proofreaders. This is also my journey!
Keep burrowing, friends! 🐰🕳️

