## What is UTXO?

UTXO stands for unspent transaction output (UTXO). It’s basically the amount of remaining crypto that you get from each transaction. However, to explain further, we should first learn how typical trading works. Take Bitcoin as an example as it is the most famous cryptocurrency that uses UTXOs.

## UTXO . transaction example

The wallet has a balance of 100 Bitcoins. Although you only see a single balance, it actually includes several UTXO numbers. You can have 4 UTXOs, each worth 25 Bitcoins, 2 UTXOs worth 50, or a set of UTXOs worth 37, 18, 40 and 5 Bitcoins. The specific amounts don’t matter, but they should add up to your total balance, in this case 100.

Let’s say you buy a new car and Porsche for 35 Bitcoins is your choice. Your wallet contains only UTXO equivalents of 15, 17, 28 and 40 Bitcoins each. You cannot have exactly 35 Bitcoins worth.

UTXOs cannot be split, so there’s no way to pay exactly 35 Bitcoins to buy a car.

Instead, you have to spend 40 Bitcoin UTXOs. With such a problem, the network suggests 2 new UTXOs: 35 Bitcoins and 5 Bitcoins. Car dealership gets 35 Bitcoin UTXO while you get 5 Bitcoin UTXO as conversion.

You can also spend 17, 28 Bitcoin UTXOs and get 10 Bitcoins when you convert. A transaction can use any combination of UTXOs; however, there is no control over which type.

Just as you can split UTXOs into separate instances, you can also combine them in larger transactions, generating less on the network.

## UTXO . transaction fee

Transaction fees are also included in transactions and subtracted from the UTXO you receive as a change. The equation looks something like this:

New UTXO = (Total UTXO in transaction) – (Transaction count) – (Transaction fee)

Continuing the example with 1 Bitcoin transaction fee:

New UTXO = (17 + 18) – (35) – (1) = 9 Bitcoin

## Importance of UTXOs and potential problems

The UTXO implementation greatly simplifies the accounting methods of the blockchain. Instead of having to track and store every single transaction, we only need to keep track of the unspent coins, also known as UTXOs.

As is known, each coin in the Bitcoin ecosystem can only be spent once. So every Bitcoin in the wallet right now is unspent because:

1. Miner received it as a mining reward, or
2. Was minted in a transaction. (like the example above)

UTXOs are important in preventing double spend attacks and preventing you from spending coins that don’t exist. Network nodes record and maintain a database containing any UTXOs (i.e. unused coins) available for spending. If you try to send a transaction with a coin that is not in that database, the nodes will reject it.

## Storage problem

Nodes store UTXO databases in RAM, so it’s important that the data is set to a manageable size. As it grows, the cost of running a full node will increase with it. If running a full node becomes too expensive, the Bitcoin network will become more concentrated in the hands of the few rich people who can afford to run them.

Bitcoin UTXO Database Size Over Time | Source: Blockchain

This danger of centralization is one of the main arguments for increasing Bitcoin block sizes. Bitcoin developer Gavin Andresen addressed this in his UTXO post:

“A 1-megabyte block contains about 100 million 500-byte transactions per year. If each one of them increments the set UTXO by 500 bytes, the UTXO will grow by 50 gigabytes per year.”

The 1 megabyte block size places an upper limit on how much the UTXO database can grow each year. He continued:

“Allowing more transactions with no other changes will most likely accelerate the growth of the UTXO setup, making it more expensive, faster, to run a full validating node.”

His article is actually in favor of increasing the block size. He argues that the impact on the UTXO set size is not as decisive as others think. And considering the complexity of second layer scaling solutions, we need to deploy larger blocks in the short term before those solutions are available in the long term.

## Solutions

Thankfully, there are a few solutions to potential hosting problems. First, nodes do not have to store the entire UTXO database in RAM. They can choose to store the part in a less expensive SSD drive or a hard disk. While these types of storage lead to slower validation times per node, that shouldn’t be an issue as long as they’re still well below the 10 minute average block time.

In addition, Bitcoin developers are continuously improving the transaction mechanisms to optimize the UTXO database.

Finally, Segregated Witness (Segwit) and similar scaling solutions indirectly slow down the growth of UTXO databases. The Bitcoin Core documentation says:

“Segwit improves the situation here by generating signature data, which does not affect the UTXO set size, which costs 75% less than data that affects the UTXO set size. This is supposed to incentivize users in favor of using transactions that minimize the impact on the UTXO suite to limit fees, and incentivize developers to design smart contracts and new features in a way that reduces minimal impact on the UTXO kit”.

## Conclusion: UTXO alternatives?

Although this article uses Bitcoin as an example, there are many other cryptocurrencies that implement UTXO such as BCH, LTC, KMD, etc.

There are also many other cryptocurrencies that use other accounting mechanisms. For example, Ethereum has an account-based transaction model. This mechanism is generally better at saving space and providing simpler code to operate; however, you lose some of your transaction privacy and run into potential scalability issues.

If you ask 10 crypto developers about the best calculation methods, you will probably get 10 different answers. This topic is still hotly debated throughout the community, and there is still no perfect solution. And, given the complexity, there will likely never be an exact answer.

Disclaimer: This information is provided as a personal blog, not general information or investment advice. We are not responsible for your investment decisions.