<blockquote>
  <p>What happens to the 'old' version of a blockchain and related transactions/data in case of a fork. Can they still be deleted</p>
</blockquote>

<p>In the case of a soft fork, historic data must be kept.  In the case of a hard fork, it's not strictly necessary to keep historic data but it is almost always retained.</p>

<p>Going in to a bit more detail: a soft fork changes the rules everyone follows in a backwards-compatible way by only making the rules more strict.  For example, miners have access to a field called the "coinbase" into which they used to be able to put any arbitrary series of 2 to 100 bytes; later a rule was added that specified in the BIP34 soft fork that the first few bytes of that field had to be the current block's height (distance from the first block).  This is more strict, so everyone who follows the new rule also automatically follows the old rules.  This is backwards compatible because anyone who followed the old rules and isn't already violating the new rules can continue to use their software as normal.</p>

<p>However, for that backwards compatibility to hold true, the data available in the block chain has to not only remain available but stay in basically the same format.  You can sometimes do tricks with that, as segwit did by moving signatures to a new field in transactions, but there's a limit to the scope of changes you can reasonably make.</p>

<p>For hard forks, there rules are changed in a backwards-incompatible way so everyone needs to upgrade anyway.  This gives you a blank slate upon which to make any change to the system you want.  Regarding old block chain history, what you can do is commit to the current state of the system and throw out all history used to arrive at that state.</p>

<p>For example, imagine Alice mines a bitcoin and then pays that bitcoin to Bob.  The block chain will include both the mining transaction and the payment transaction, but if everyone is upgrading anyway, it's simple to just say "Bob starts with 1 bitcoin" and throw away Alice's mining transaction.</p>

<p>If you were to throw away historic data and keep just the current state after a Bitcoin hard fork, you could reduce the current block chain size by about 98%, down to just a few gigabytes.</p>

<p>However, I'm not aware of any hard fork of Bitcoin or an altcoin that ever threw out the historic data and simply committed to the current state.  I don't know why that's the case.</p>

CC BY-SA 4.0
2018-06-12T10:14:42.030Z
If you discard the earlier transactoin and start with new state, wouldnt that effect the 1:1 coin distribution scheme that comes with each hard fork.
Parishilan Rayamajhi
CC BY-SA 4.0
2018-06-07T10:59:58.973Z
2018-06-07T10:59:58.973Z
David A. Harding
<p>"What happens to old transactions in case of a fork?" nothing. the "old" transactions will still be available. otherwise it is not a fork. both branches of the fork will have the same history until the moment of the fork.</p>

<p>"Can they still be deleted or does the new branch still depend on them to ensure continuity?" today's state is that transactions will not be deleted in general. the old transactions are required to ensure integrity because you need them to track the history of your bitcoins and to re-validate the hash-values of all blocks.</p>

CC BY-SA 4.0
2018-06-06T13:23:09.647Z
2018-06-06T13:23:09.647Z
anion
<p>I'm confused about forking. What happens to the 'old' version of a blockchain and related transactions/data in case of a fork. Can they still be deleted or does the new branch still depend on them to ensure continuity?</p>

CC BY-SA 4.0
2018-06-06T15:11:22.460Z
What type of fork are you asking about?  There are short-lived forks where some blocks are orphaned (made stale) either accidentally or on purpose; there are soft forks that change the consensus rules in a backwards compatible way; and there are hard forks that change the consensus rules in a backwards-incompatible way.
David A. Harding
CC BY-SA 4.0
2018-06-07T09:43:58.967Z
I'm curious about this in relation to both soft and hard forks. Thanks!
Michele Mistral
<blockchain-fork><soft-fork>
What happens to old transactions in case of a fork?
Michele Mistral
# What happens to old transactions in case of a fork?

(Asked by: username_0 on 2018-06-06)

I'm confused about forking. What happens to the 'old' version of a blockchain and related transactions/data in case of a fork. Can they still be deleted or does the new branch still depend on them to ensure continuity?

**Tags:** blockchain-fork, soft-fork

> **Comments:**
> **username_1**: What type of fork are you asking about?  There are short-lived forks where some blocks are orphaned (made stale) either accidentally or on purpose; there are soft forks that change the consensus rules in a backwards compatible way; and there are hard forks that change the consensus rules in a backwards-incompatible way.  
> **username_0**: I'm curious about this in relation to both soft and hard forks. Thanks!  

---

## 2 answers

### Answer by username_1 on 2018-06-07. Score: 1

> What happens to the 'old' version of a blockchain and related transactions/data in case of a fork. Can they still be deleted

In the case of a soft fork, historic data must be kept. In the case of a hard fork, it's not strictly necessary to keep historic data but it is almost always retained.

Going in to a bit more detail: a soft fork changes the rules everyone follows in a backwards-compatible way by only making the rules more strict. For example, miners have access to a field called the "coinbase" into which they used to be able to put any arbitrary series of 2 to 100 bytes; later a rule was added that specified in the BIP34 soft fork that the first few bytes of that field had to be the current block's height (distance from the first block). This is more strict, so everyone who follows the new rule also automatically follows the old rules. This is backwards compatible because anyone who followed the old rules and isn't already violating the new rules can continue to use their software as normal.

However, for that backwards compatibility to hold true, the data available in the block chain has to not only remain available but stay in basically the same format. You can sometimes do tricks with that, as segwit did by moving signatures to a new field in transactions, but there's a limit to the scope of changes you can reasonably make.

For hard forks, there rules are changed in a backwards-incompatible way so everyone needs to upgrade anyway. This gives you a blank slate upon which to make any change to the system you want. Regarding old block chain history, what you can do is commit to the current state of the system and throw out all history used to arrive at that state.

For example, imagine Alice mines a bitcoin and then pays that bitcoin to Bob. The block chain will include both the mining transaction and the payment transaction, but if everyone is upgrading anyway, it's simple to just say "Bob starts with 1 bitcoin" and throw away Alice's mining transaction.

If you were to throw away historic data and keep just the current state after a Bitcoin hard fork, you could reduce the current block chain size by about 98%, down to just a few gigabytes.

However, I'm not aware of any hard fork of Bitcoin or an altcoin that ever threw out the historic data and simply committed to the current state. I don't know why that's the case.

> **Comments:**
> **username_2**: If you discard the earlier transactoin and start with new state, wouldnt that effect the 1:1 coin distribution scheme that comes with each hard fork.  

---

### Answer by username_3 on 2018-06-06. Score: 0

"What happens to old transactions in case of a fork?" nothing. the "old" transactions will still be available. otherwise it is not a fork. both branches of the fork will have the same history until the moment of the fork.

"Can they still be deleted or does the new branch still depend on them to ensure continuity?" today's state is that transactions will not be deleted in general. the old transactions are required to ensure integrity because you need them to track the history of your bitcoins and to re-validate the hash-values of all blocks.


---

