This article was translated from Japanese with AI. Read the original (日本語) · Report a translation issue

Anyone learning how Bitcoin works will sooner or later run into an unfamiliar term: "UTXO." How does it relate to the balance shown in your wallet? What role does it play in Bitcoin transactions? Many people find it confusing.

The UTXO is a concept unique to Bitcoin, and it's one of the places where many beginners stumble. But I think the real barrier is just those four letters, "UTXO," which make the idea seem harder than it is.

In this article, I'll explain how UTXOs work using gift certificates as an example, so that even beginners can follow along easily. By the end, you should have a solid grasp of the fundamental reason why Bitcoin deliberately chose the seemingly complicated UTXO model instead of the "account balance" model that banks use.

What is a UTXO (Unspent Transaction Output)?

UTXO stands for Unspent Transaction Output. For now, it's fine to think of it as bitcoin that hasn't been spent yet. "Unspent" here means not yet used in a transaction. That may still sound a bit abstract.

  • What does it mean for something to be "not used" in a transaction?
  • The bitcoin I received from an exchange was already part of a transaction, so isn't it already spent?

Some of you may be wondering about questions like these. Abstract explanations only make things harder, so I'll explain UTXOs by comparing them to gift certificates.

Understanding UTXOs as gift certificates

From here on, I'll use gift certificates as the example.

Why gift certificates? Because each individual certificate maps neatly onto an individual "unspent output." Here's a concrete example.

Imagine you have the following on hand:

  • Five 10,000-yen gift certificates
  • One 5,000-yen gift certificate
  • Two 1,000-yen gift certificates

Picture that situation.

The total is 57,000 yen, but the key point is that it doesn't exist as a single number like an account balance. It exists as several separate certificates.

💡
Bitcoin looks like a single number too, just like an account balance, but inside your wallet, multiple pieces of bitcoin (a set of gift certificates) are added together and displayed as one balance.

Buying a coffee with gift certificates

Say you go to a café and want to buy a coffee using gift certificates.

If the coffee costs 400 yen, you don't have a 400-yen certificate, so you'd hand over a 1,000-yen one.

The café staff then punches a hole in the 1,000-yen certificate to invalidate it, runs it through a special machine, and issues:

  • A new 400-yen certificate for the café
  • A 600-yen certificate as your change

Those are the new certificates.

⚠ Note that gift certificates normally don't give change. For this explanation, please assume these are special certificates that do.

The 1,000-yen certificate you used now has a hole in it, so it can never be used again. On the other hand, you've received a new, unused 600-yen certificate as change.

The same thing happens in a Bitcoin transaction.

Using two gift certificates

To help build the picture a bit more, here's one more example. You liked the café so much that you decide to buy a 1,300-yen tumbler.

You don't have a certificate worth exactly 1,300 yen, so you'll use:

  • One 1,000-yen certificate
  • One 600-yen certificate (the change you got when you bought the coffee!)

That's how you pay.

Just like before, the café staff punches holes in the certificates they received and uses the special machine to issue:

  • One 1,300-yen certificate
  • A 300-yen certificate as change

Both are newly issued.

Replacing gift certificates with UTXOs

Let's get back to Bitcoin.

The blue part on the left is called the "inputs."

The green part on the right is called the "outputs."

These are the two sides of a transaction.

The mechanism is very simple: outputs are created from inputs. As the gift certificate example shows, a bitcoin output that hasn't been spent yet is what we call a "UTXO."

The difference from an account balance is that everything is tracked per UTXO. Your balance isn't displayed by subtracting from a single total, the way an account balance is.

Inputs are UTXOs created by earlier transactions

As in the examples above, a Bitcoin transaction is structured so that it uses one or more UTXOs as "transaction inputs" and creates new "outputs."

The technical term for the "change," the output that comes back to you, is the "change output." A change output looks no different from any other output. In other words, only the person who created the transaction knows which output is the change output.

Using a site called mempool.space, you can look up the history of every transaction.

mempool.space: https://mempool.space/ja/

In the image above, the red on the left shows the inputs and the green on the right shows the outputs. Just like in the gift certificate example, you can see a transaction that uses multiple inputs. And indeed, we can't tell which of the two outputs is the change output.

Why Bitcoin doesn't use the account balance model

Now that we've covered the basics of UTXOs, let's look at why Bitcoin doesn't use the "account balance" model.

The short answer: when the system is maintained by computers all over the world, balances could fall out of sync. With an account balance model, whether a balance is correct depends heavily on the order in which transactions happen.

For example, if A (balance: 10,000 yen) issues two instructions at the same time, "send 8,000 yen to B" and "send 7,000 yen to C," the bank's central server instantly decides the order and processes them.

  • 13:01 Send 8,000 yen to B. Update A's balance to 2,000 yen.
  • 13:02 Receive the request to send 7,000 yen to C. Rejected because A's balance is insufficient.

The account balance model works only because there is a central server that decides the order of every transaction.

Bitcoin has no central server. Computers around the world validate transactions and include them in blocks. That means network delays can cause ordering discrepancies: one server might receive the transaction to B first, while another receives the transaction to C first.

So getting every computer in the world to agree on a single "balance list for all of humanity" would require a complicated form of consensus.

This is where Bitcoin abandoned the idea of "balances" and chose the UTXO model instead.

How UTXOs solve the problem of balances falling out of sync

As explained above, the account balance model isn't suitable for Bitcoin because balances would fall out of sync across the world.

So how was this solved? One reason is that the UTXO concept makes it possible to verify whether a given BTC has been spent or not.

Because this can be verified, the blockchain avoids balances falling out of sync.

Suppose A holds a single "10,000-yen UTXO (an unused gift certificate)."

  • A miner validating the transaction to B
  • A miner validating the transaction to C

Suppose both of these transactions exist.

This is where the blockchain and mining come in.

There will be miners validating the transaction to B and miners validating the transaction to C, but the transaction included in the successfully mined block takes priority.

💡
From a miner's perspective
For any given block, a miner can choose
• whether to include the transaction to B
• or the transaction to C

If miner X includes the transaction to B in a block and successfully mines it, the transaction to B takes priority.

The UTXO used in the transaction to B is then recorded as spent.

Later, when the transaction to C is validated, the computers recognize that the UTXO has already been spent, and the payment is rejected.

In this way, the UTXO model doesn't need to manage "account balances." All it has to check is whether a given UTXO (gift certificate) is unspent, which makes checking for double spends simple.

Do multiple UTXOs mean higher fees?

One concern with Bitcoin transactions is that using multiple UTXOs makes fees higher.

Transaction fees on the Bitcoin blockchain are determined not by the amount sent but by the size of the data and the fee rate. In other words, it isn't "sending more BTC costs more"; it's "heavier data costs more."

The basic formula for fees is:

Fee (sats) = virtual size (vB) × fee rate (sat/vB)

Within the limited capacity of a block (roughly 1 MB equivalent), miners prioritize transactions with higher sat/vB. So the higher the fee rate, the more likely a transaction is to be included in a block quickly.

💡
Terminology
sats: a unit equal to one hundred-millionth of a BTC
vB: virtual bytes (virtual size)
Bitcoin doesn't measure transactions by raw byte count but by a system called weight; the weight divided by 4 is called the virtual size.

Let's look at an example.

Suppose there are two transactions with a fee rate of 30 sat/vB, one 200 vB in size and the other 400 vB.

  • 200 vB × 30 sat/vB = 6,000 sats
  • 400 vB × 30 sat/vB = 12,000 sats

As the formula shows, more data means a higher fee: the second transaction, which has more inputs (400 vB), costs more.

As the number of inputs in a transaction grows, the signature data grows with it, and the virtual size (vB) gets larger.

As a result, even when sending the same amount, a transaction that uses many UTXOs (that is, has many inputs) tends to cost more in fees.

What to do if your transaction isn't included in a block

If you set the fee rate too low, your transaction may not be included in a block and can sit unconfirmed for a long time. In that case, if the transaction supports RBF (Replace-By-Fee), you can replace the unconfirmed transaction with one that pays a higher fee rate (this only works while it's still unconfirmed).
This is a more technical topic, so please see the earlier article below.

Bitcoin Core 24.0からのFull RBF既定化についての議論まとめ
この1週間ほど世間の話題はFTXの信用不安問題で持ちきりですが、ビットコイン開発者の多くは全然違う論争に巻き込まれていました。Bitcoin Coreの次期リリースである24.0において、ノードのポリシーとしてFull RBF (mempoolfullrbf)というものが導入される予定のところ、これに反対する意見が出たためです。 結果的には導入継続という流れになりましたが、このように誰でも意見・議論できることがビットコイン開発における健全性維持の1つの仕組みです。 それでは議論の内容を見ていきましょう。 RBFとは RBFとはReplace-by-Feeの略で、配信したがまだブロックに取り込まれていないトランザクションを、より高い手数料を払って置換することをいいます。トランザクション作成時にそのトランザクションにRBF有効のフラグが立てられている場合、同じコインを使用する別のトランザクション、つまり相反するトランザクションを配信して古いものを置き換えることができます。(置換されるトランザクションより手数料が高いこと、置換されるトランザクションがまだブロックに取り込まれていない

I'll explain how to consolidate UTXOs in a separate article, but if you're curious, I encourage you to look into it.

Special transactions

The coinbase transaction, which has no inputs

As it turns out, some transactions have no inputs at all.

Some of you may be thinking: wait, we just learned that outputs are created from inputs, so how can a transaction have no inputs?

Try picking any transaction on the mempool site from earlier and tracing its inputs back. It's a lot of work, so I don't really recommend it, but if you keep tracing the inputs, you should eventually arrive at bitcoin that was created through mining.

When a miner successfully mines a block, they create a special transaction called a "coinbase transaction." A coinbase transaction has only outputs and no inputs.

That's because it issues new bitcoin through mining.

mempool coinbase transaction
💡
Only the coinbase transaction, the special transaction created through mining, has no inputs

If you've read this far, you're probably getting more and more comfortable with mempool and UTXOs.

Finally, I'd like to talk about the genesis block, the very first block ever mined.

The secrets of the first block: the genesis block

On January 3, 2009, the first block, known as the "genesis block," was mined. At the time, there was only one miner in the world: Bitcoin's creator, Satoshi Nakamoto.

mempool Genesis Block

For the genesis block alone, Satoshi made the 50 BTC mining reward unspendable. He never explained why, people around the world still speculate about it to this day, and my impression is that many people regard the genesis block as something special.

💡
One leading theory is that Satoshi felt it wasn't appropriate to take a reward because the genesis block wasn't actually created through mining.
「Genesis Block」サトシ・ナカモトの50BTCに隠された秘密
Genesis Blockの報酬50BTCが使えない理由を技術的に解説。Genesis Addressに関して、P2PKとP2PKHの違い、100BTC以上あると紹介される背景まで網羅します。

Even more intriguing, the text data that can be attached to a block contains a headline from the British newspaper The Times. (Image above: you can also read it in the transaction on mempool.)

Wikipedia: The Times, January 3, 2009 issue
💡
The Times 03/Jan/2009 Chancellor on brink of second bailout for banks

Why this message was included is, again, something only Satoshi Nakamoto knows.

There are many theories. It's commonly interpreted as a criticism of bank bailout policies, or as a statement about the need for a monetary system that doesn't depend on central banks or governments. Another possibility is that it was included simply to prove that the mining program had not been created before that date.

Summary: UTXOs are the core technology that lets Bitcoin prevent double spends without a central authority

A UTXO (unspent transaction output) is how Bitcoin keeps track of balances, and it's easy to understand when you compare it to gift certificates. A balance isn't a single number like an account balance; it's made up of a collection of UTXOs. A transaction consumes existing UTXOs as "inputs" and creates new UTXOs as "outputs."

To prevent double spends without a central server, Bitcoin uses this model, which verifies only whether a UTXO has been spent or not, rather than checking a "balance." The trade-off is that using multiple UTXOs increases the data size and makes transaction fees higher.

I hope understanding UTXOs has sharpened your picture of Bitcoin and shown you something new to enjoy about it. UTXOs are one of the most important concepts in Bitcoin, so I'd be glad if you took this opportunity to get comfortable with them.