<blockquote>
<p>How much time does Bitcoin Core store information about forks?</p>
</blockquote>
<p>Forever. When pruning is enabled, after some time block data is deleted regardless of whether it's in the main chain or not.</p>
<p>Note however that Bitcoin Core will only download and store blocks along chains which, at some point, have the potential to become the best known chain. If someone announces headers to you of a fork, but those headers do not have enough combined proof-of-work to beat the chain you already have, its blocks will not be downloaded. In particular, this means that during initial synchronization you will generally not see any forks.</p>
<blockquote>
<p>And what kind of information does it store?</p>
</blockquote>
<p>Block headers are stored forever. Block data is stored until it is pruned (if that is enabled, forever otherwise). The UTXO set and mempool are only maintained for the current time, at the tip. If a reorg happens, the effects of the currently-active chain are rewinded, and the effects of the new chain are applied, to both the UTXO set and mempool.</p>

CC BY-SA 4.0
2024-12-09T22:40:34.933Z
Might also be worth mentioning that information about forks is only ever stored in the first place if the node was encountering the fork in real time when it happened. A new node syncing up will not have any data about historical forks.
Lightlike
CC BY-SA 4.0
2024-12-09T15:14:44.780Z
2024-12-09T23:09:16.287Z
2024-12-09T23:09:16.287Z
Pieter Wuille
<p>If I am not wrong Bitcoin Core stores &quot;natural&quot; forks in case at some point that fork is the most PoW chain and has to set it as the new tip.</p>
<p>How much time does Bitcoin Core store information about forks? And what kind of information does it store? Blocks + a backup for the UTXO and mempool at that moment?</p>
<p>In this <a href="https://bitcoin.stackexchange.com/questions/91142/how-does-bitcoin-core-client-keep-track-of-longest-chain-strongest-pow-chains">question</a> they say all blocks, is that true? Does that make sense?</p>

<bitcoin-core><blockchain><mining-theory><blockchain-fork><storage>
How long does Bitcoin Core store forked chains?
polespinasa
# How long does Bitcoin Core store forked chains?

(Asked by: username_0 on 2024-12-09)

If I am not wrong Bitcoin Core stores "natural" forks in case at some point that fork is the most PoW chain and has to set it as the new tip.

How much time does Bitcoin Core store information about forks? And what kind of information does it store? Blocks + a backup for the UTXO and mempool at that moment?

In this [question](https://bitcoin.stackexchange.com/questions/91142/how-does-bitcoin-core-client-keep-track-of-longest-chain-strongest-pow-chains) they say all blocks, is that true? Does that make sense?

**Tags:** bitcoin-core, blockchain, mining-theory, blockchain-fork, storage


---

## 1 answers

### Answer by username_1 on 2024-12-09. Score: 8 | Accepted answer

> How much time does Bitcoin Core store information about forks?

Forever. When pruning is enabled, after some time block data is deleted regardless of whether it's in the main chain or not.

Note however that Bitcoin Core will only download and store blocks along chains which, at some point, have the potential to become the best known chain. If someone announces headers to you of a fork, but those headers do not have enough combined proof-of-work to beat the chain you already have, its blocks will not be downloaded. In particular, this means that during initial synchronization you will generally not see any forks.

> And what kind of information does it store?

Block headers are stored forever. Block data is stored until it is pruned (if that is enabled, forever otherwise). The UTXO set and mempool are only maintained for the current time, at the tip. If a reorg happens, the effects of the currently-active chain are rewinded, and the effects of the new chain are applied, to both the UTXO set and mempool.

> **Comments:**
> **username_2**: Might also be worth mentioning that information about forks is only ever stored in the first place if the node was encountering the fork in real time when it happened. A new node syncing up will not have any data about historical forks.  

---

