Bitcoin in Practice: Pruning and Other Duties

By Kurt Wuckert Jr.

Pruning transactions and other duties of a node

What pruning is, and why nodes do it

A node is not required to keep every old piece of transaction data forever. The core requirement is to maintain the current spendable set, meaning the UTXOs that still exist and can be spent. Anything that has already been spent, and is unlikely to be needed again, can be pruned.

That matters because storage is expensive, and blockchain history grows without stopping. So nodes can minimize storage by deleting transaction data that has little or no chance of being required later. A common case is a transaction whose outputs were all spent by later transactions. Once everything it created is spent, that old transaction data becomes redundant for day to day node operation.

How pruning works using the Merkle tree

Pruning is possible because blocks commit to their transactions through a Merkle tree.

Imagine a block Bn with transactions tx1 through tx4. By the time the chain tip has moved forward to Bn+m, every UTXO created by tx1 to tx4 has been spent. The full transaction contents are no longer useful for managing the current UTXO set.

A node can delete the raw transaction data for tx1 through tx4, keep only their transaction hashes (TXIDs), and still have what it needs to validate the block’s Merkle root later.

It can even prune further up the tree. Instead of storing every TXID and every intermediate hash, it can discard lower layers and keep higher level hashes that still allow the node to reconstruct or verify what it needs for future proofs. The idea is simple: you keep enough of the Merkle tree so you can still prove membership for a transaction when needed, without keeping every original payload.

The same logic applies to later transactions too. If a transaction’s raw payload is not needed, a miner can choose to delete that payload and keep only the TXID to save space.

Pruning for harmful or illegal data

Pruning also gives nodes a way to remove stored copies of transaction data that contains illegal content, malicious content, or content that the legal system requires to be removed from node storage.

The key point is that pruning is about what a node chooses to store locally. It is an operational decision that helps nodes reduce storage requirements and manage risk.

What pruning means for data heavy applications

Pruning can break the assumptions of applications that use transactions mainly to store data, especially when those data transactions have outputs that are not meant to be spent, like OP_RETURN outputs with zero satoshi value.

If an application plans to rely on those data transactions later, it should plan for reality:

  • Store backups of its own transaction data.

  • Store the supporting Merkle proofs needed to verify inclusion later.

  • Use SPV style verification, which relies on block headers plus proofs, not on a node keeping every old payload.

There is also room for a market of archival nodes, businesses that keep full history and sell access to it for people who want old data later.

Duties of a node

Enforcing rules, not writing them

Nodes enforce the rules of the network on the transactions they receive. Transactions that pass the rules get into blocks, and those blocks become immutable recorded history. Nodes do not invent new rules, and they do not arbitrate what a transaction “should mean.” They validate against the ruleset and either accept or reject.

Nodes as businesses

In practice, nodes are businesses. They run expensive hardware, and they upgrade it as the network grows and competitors improve. They may also invest in software improvements and offer additional blockchain services as a revenue stream.

Because of the infrastructure requirements, especially for proof of work and large block storage, node operators typically end up using data centers or significant cloud infrastructure. Either way, that forces real world operational visibility, legal identity, taxation, and accountability.

In this framing, that public and accountable nature is not an accident. It is part of what makes nodes answerable to the jurisdiction they operate in, including requirements around freezing and recovery of stolen coins, and around pruning or censorship actions required by law.

ELI5(ish...)

Think of a node like a big warehouse that tracks who currently owns which sealed envelopes of cash.

  • The only envelopes the warehouse truly needs on hand are the ones that are still spendable, the UTXOs.

  • Old envelopes that were already opened and replaced by new envelopes are not useful for running the warehouse day to day.

Pruning is like shredding old receipts and paperwork once the sale is finalized, while still keeping a strong fingerprint of the records so you can prove later that something happened.

That fingerprint is the Merkle tree hashes. You can throw away a lot of the old paperwork, keep the right hashes, and still prove that a specific transaction was included in a specific block if someone asks.

If you are building an app that stores important data in those old receipts, you should keep your own copies, plus the proof that it was included, because not every warehouse is going to keep every scrap of paper forever.

Finally, nodes are not anonymous magic boxes. They are businesses with big equipment bills. They follow a ruleset, enforce it, and they operate in the real world where laws apply and accountability exists.