<p>Note that transaction history is not stored in a tree nor is there a Merkle tree for all of the transactions in the blockchain. Merkle trees are only used for constructing the merkle root in blocks and constructing transaction inclusion proofs for SPV nodes.</p>
<p>If you reduce the blockchain to only the data absolutely needed for a node to verify new transactions, you end up with a node that just has the UTXO set. The state of the blockchain boils down to simply the set of all Unspent Transaction Outputs. This is because in addition to spent transactions, it is unnecessary for nodes to store transaction inputs (they are only needed for validation, so after validation, they can be discarded), other outputs in a transaction that have been spent, and transaction overhead data (such as version number and locktime).</p>
<p>As of block 688004, my node has a UTXO set size of approximately 4.5 GB. Note that there may be optimizations in the way this is serialized so that it is more compressed that it would be if you extracted them directly from transactions, but these optimizations should not cause a significant reduction.</p>
<p>Storing the UTXO set and using that for validation is actually an optimization that Bitcoin Core and some other node software do today. This enables faster validation and a more efficient way to prune the blockchain. By having the UTXO set separate from the blockchain, a pruned node can just delete the majority of previous blocks and still be able validate new transactions through the UTXO set.</p>
<p>Of course it is not safe to only have a node store just the UTXO set and discard all blocks after validation. If there is a blockchain reorganization, the node will need to be able to rollback the UTXO set changes made by the block being removed from the main chain. As such, it is necessary for pruned nodes to store some blocks so that it can perform this undo operation when necessary. Because blockchain reorgs tend to be short (there have not been reorgs of 2 or more blocks in a very long time) and rare, Bitcoin Core's default is to store 1 days worth of blocks.</p>

CC BY-SA 4.0
2021-06-18T01:41:18.997Z
2021-06-18T01:41:18.997Z
Ava Chow
<p>If the transaction history's Merkle tree were pruned to remove all transactions that have been completely spent, what would be the size of the transaction history in comparison to its current size?  (In percent of total size.)</p>

<merkle-tree><pruning><storage-footprint>
How big would the transaction history be if all spent transactions were pruned?
Eyal
# How big would the transaction history be if all spent transactions were pruned?

(Asked by: username_0 on 2013-04-01)

If the transaction history's Merkle tree were pruned to remove all transactions that have been completely spent, what would be the size of the transaction history in comparison to its current size? (In percent of total size.)

**Tags:** merkle-tree, pruning, storage-footprint


---

## 1 answers

### Answer by username_1 on 2021-06-18. Score: 2

Note that transaction history is not stored in a tree nor is there a Merkle tree for all of the transactions in the blockchain. Merkle trees are only used for constructing the merkle root in blocks and constructing transaction inclusion proofs for SPV nodes.

If you reduce the blockchain to only the data absolutely needed for a node to verify new transactions, you end up with a node that just has the UTXO set. The state of the blockchain boils down to simply the set of all Unspent Transaction Outputs. This is because in addition to spent transactions, it is unnecessary for nodes to store transaction inputs (they are only needed for validation, so after validation, they can be discarded), other outputs in a transaction that have been spent, and transaction overhead data (such as version number and locktime).

As of block 688004, my node has a UTXO set size of approximately 4.5 GB. Note that there may be optimizations in the way this is serialized so that it is more compressed that it would be if you extracted them directly from transactions, but these optimizations should not cause a significant reduction.

Storing the UTXO set and using that for validation is actually an optimization that Bitcoin Core and some other node software do today. This enables faster validation and a more efficient way to prune the blockchain. By having the UTXO set separate from the blockchain, a pruned node can just delete the majority of previous blocks and still be able validate new transactions through the UTXO set.

Of course it is not safe to only have a node store just the UTXO set and discard all blocks after validation. If there is a blockchain reorganization, the node will need to be able to rollback the UTXO set changes made by the block being removed from the main chain. As such, it is necessary for pruned nodes to store some blocks so that it can perform this undo operation when necessary. Because blockchain reorgs tend to be short (there have not been reorgs of 2 or more blocks in a very long time) and rare, Bitcoin Core's default is to store 1 days worth of blocks.


---

