Blockchain transactions and UTXOs

Many cryptocurrencies are experiencing increasing bloat of their blockchain due to UTXOs. So what are UTXOs? What is bloat? How do we prevent it?

Kyle Turnbull

May 20, 2021 · 4 min read

UTXO blockchain bloat

What is UTXO bloat?

What are UTXOs?

UTXO stands for Unspent Transaction Output. This blog is technical in nature. It is not necessary for people to understand UTXOs to use cryptocurrencies. However, if you’re interested in cryptocurrency on a technical level, feel free to read on.

UTXOs are technically the amount of cryptocurrency left over after a transaction. They are used by many cryptocurrencies to balance the ledger and keep everything correct and organized.

Divi is a fork of PIVX, which was based on the Dash blockchain, which was based on Bitcoin. UTXOs have been a part of Bitcoin since the very beginning. An inherent component of blockchain itself.

The Problem of UTXO bloat

In order for nodes to operate quickly, every single UTXO for the entire blockchain is stored not just on the hard drive, but also kept in RAM! And for a big blockchain like Bitcoin, that’s a huge number of UTXOs. (You can see how many UTXOs exist on the Bitcoin blockchain here)

Bitcoin (and most cryptocurrencies) continue to have growing UTXO sets. This happens not just from new users and more transactions, but also every UTXO since the beginning of time, if left unspent, will be stored in the RAM of thousands of nodes around the world. This huge UTXO set slows down every node in every cryptocurrency network, resulting in wasted resources. While cryptocurrencies are chasing faster transaction times and searching for scaling solutions, forces like UTXO bloat are working against them.

How Divi is tackling the problem

Our 100% proof of stake system presents us with an opportunity that’s unavailable to proof of work blockchains such as Bitcoin. It's a fairly simple idea, but one that saves our blockchain significant memory and resources. When a particular UTXO wins a stake, it will create a new UTXO that combines with as many smaller UTXOs as it can, up to 50,000 DIVI. And, it will do this without a fee. Automatic UTXO combining ensures that all of these small fragments are grouped together for the user, without costing them a cent.

Let’s look at an example of UTXO combining

For example, let’s say you have an address with 6 UTXOs in it, with 3,000, 20,000, 25,000, 30,000, 35,000 and 40,000 DIVI. They're all staking and the 20,000 UTXO wins a stake (block reward). What you are left with is the following:

Four UTXOs with values: 48,456, 30,000, 35,000 and 40,000 DIVI. This is because the winning UTXO of 20,000 will add on the stake reward (456) and the smallest UTXOs it can, up to 50,000, which would be:

456 + 3,000 + 20,000 + 25,000 = 48,456. When this combining occurs, the coin-age is reset to zero.

The system makes a sorted list of all UTXOs in that address, and will absorb them from the lowest up to the biggest, but not past 50,000. Keep in mind that winning stakes over 100,000 DIVI also split in half, so both systems are building UTXOs that trend towards 50,000 and then work their way up from there.

Benefits and tips

Doing this will mean that our nodes will keep far fewer UTXOs in RAM, freeing system resources for other tasks, and ultimately we hope will help us process more data to improve our TPS (Transactions Per Second.) We do believe a high TPS is important for the mass adoption of cryptocurrencies. For example, reducing the use of RAM in Divi's nodes may help us operate cloud-based Divi nodes on 1GB droplets instead of 2GB, which is half the cost, and more efficient.

A note on transaction fees

This also means is that you can save some fees by staking your masternode rewards. When they combine, there's no fee. But, if you want to send a transaction to someone that has dozens or hundreds of masternode rewards combined into a single transaction, then it will be far more bytes than a standard transaction, pushing the fee up to 100 DIVI, which is the maximum. If you're staking, then every time you win you'll get them combined for free and your transaction fees will stay very low.

We are currently revising the way in which our fees are calculated. Blockchains are dynamic, and our core team is constantly searching for ways to make Divi more efficient for users, whilst keeping fees as low as possible.

Stay up to date.

Don't miss the important stuff. Sign up for the Divi newsletter.

  • Bitcoin
  • Transactions

Kyle Turnbull

May 20, 2021 · 4 min read

Browse Categories

  • Bitcoin
  • Transactions

Similar read

Bitcoin and proof of work

February 15, 2021 · 4 min read

Making a living from Bitcoin

March 29, 2021 · 6 min read

Your ultimate guide to staking crypto 🔥

April 08, 2021 · 10 min read