What is Pruning and why it’s so important for Avalanche?

Published by AVIX on

When Avalanche will launch a major upgrade called “Apricot” in late December, a main feature will be “Pruning”.

What is Pruning?

Everyone knows from Bitcoin that it takes a very long time to download the whole Bitcoin Blockchain for running a Bitcoin full node for example (like Bitcoin core). It takes a very long time because since Bitcoin was started 11 years ago, the Bitcoin Blockchain has become quite big (currently 318 GB):

Bitcoin Blockchain size

Source: https://blockchair.com/bitcoin/charts/blockchain-size

And it will keep growing because every time a transaction is confirmed, it is included in a block and getting part of the whole Blockchain.

While not many transactions were done in the beginning, the Blockchain was growing slowly, picking up numbers when Bitcoin got more attention until now, when it started growing almost in a linear way.

To understand why it’s growing linear now, we have to know that block size is limited (1 MB per block). And currently, Bitcoin is reaching this limit for most blocks what also translates to transactions queuing on the mempool (where transactions wait to be included into a block). It’s sometimes a huge issue for Bitcoin because people doing transactions are competing against each other to get their transactions confirmed first.

People just set higher fees to get a transaction added faster to a block mined in the future because miners always prefer transactions paying higher fees.

So, you see, issues are arising for people because it’s a limited and expensive procedure (“bidding war”), when many people are trying to process many Bitcoin-transactions in a short time.

Like Bitcoin, Avalanche is using also the “UTXO model” but Avalanche consensus instead of Nakamoto consensus. In detail, UTXO means “unspent transaction output” referring to all received transactions (inputs) to a specific address since Bitcoin was spent last time from that address, if even any BTC was ever spent from that address. When sending Bitcoins again, all unspent transaction outputs become spent (output), Bitcoin balance “removed” from your old address resulting in a single, new unspent transaction output on the address where you sent BTC to. Unspent transaction outputs are always spent, when Bitcoin is sent.

The procedure is still documented in the Blockchain, visible for everyone but the Bitcoin (which is in detail made up from UTXO’s) is now available on the new address; you have a new, active UTXO on your new address where BTC was sent to. (Explanation simplified)

Since Avalanche is also using an UTXO model and to understand, what pruning on Avalanche does now, we best listen to an explanation from Emin Gün Sirer on Telegram from 2 years ago:

1. An AVAX transaction is roughly the same size as a BTC transaction.

2. But an AVAX node can prune historical, spent transactions, to recount solely the utxo set and the “live edge,” which is the set of submitted but unconfirmed transactions.

That comes out to O (UTXO set size).

I’m on a plane right now so doing the BTC math is difficult, but perhaps someone can chime in with how big the BTC utxo set is divided by the BTC blockchain size.

….

I looked up the two numbers:

The Bitcoin blockchain is >=158GB.

Bitcoin UTXO set, serialized (ie full cost), is 2.7GB.

So an AVAX node, in this scenario, will need only 1.7% of Bitcoin’s storage requirements.

To sum it up: Avalanche consensus, in comparison to Nakamoto consensus, will make it possible to decrease Blockchain size for Avalanche nodes by only considering UTXO (inputs of active UTXO; also called UTXO set) as whole blockchain size.

These nodes will be called non-archival nodes for not archiving any historical transaction outputs. It will still be possible to run a full archival node where no historical data is removed but it will require to handle more data for downloading and maintaining that archival node, for example Avalanche block explorers.

Why is Avalanche implementing pruning after mainnet was already started?

No specific reasons here but implementing it now makes not much of a difference as implementing it before mainnet launch. Compared to Bitcoin, less people are using Avalanche currently and therefore, only a small fraction of transactions is transferred per day; it isn’t increasing Avalanche’s data set to critical limits (like Bitcoin’s Blockchain didn’t grow much in the early days).

Number of transactions will increase when Avalanche gets more attention and more partnerships and preparing for this is why pruning will be necessary.

Why is it so important for Avalanche to implement pruning?

Pruning could be considered as most important update for Avalanche for achieving decentralization and preparing the technical ground for decentralization and a massive daily use by normal customers.

Avalanche can handle around 4.5k transactions per second, while Bitcoin only processes 10 transactions per second. If pruning wasn’t implemented, it would get difficult very soon to run a node (where you have to download the whole data set) for a platform growing to numbers of magnitudes higher than Bitcoin.

More about Avalanche:

Upgrade “Apricot”: https://medium.com/avalabs/avalanche-to-unveil-novel-blockchain-features-with-apricot-its-first-major-upgrade-76ed092204a8

Website: https://www.avalabs.org/

Whitepapers: https://www.avalabs.org/whitepapers

Documentation to start using Avalanche: https://docs.avax.network/

Technical summary: https://medium.com/avalabs/avalanche-101-an-overview-of-the-internet-of-finance-7cdc5a2bee46

GitHub: https://github.com/ava-labs


What is Pruning and why it’s so important for Avalanche? was originally published in Avalanche Hub on Medium, where people are continuing the conversation by highlighting and responding to this story.

Categories: News