<p>Hard forks are simply extensions of a blockchain where the new blocks follow different consensus rules that are not compatible with the original blockchain. There is no actual snapshotting in a true hard fork. The hard fork software simply syncs up to a certain point with the original blockchain, and after that point, a new consensus rule is enforced which conflicts with the original chain and thus causes a blockchain fork. This is simply governed by an <code>if</code> statement in the block validation code.</p>

<p>The fork is simply activated by a miner who mines a block after a certain block or point in time that follows different consensus rules from the original chain.</p>

<p>For example, with Bitcoin Cash, their software enforced that the first block created after August 1st at 12:00 UTC must be larger than 1 MB and also follows the Bitcoin Cash consensus rules (larger block size, new signature hashing algorithm, etc.). This is encoded as an <code>if</code> statement in the block validation logic which checked the time of a block before executing different consensus rule checks. There is no actual snapshot that is taken; their blockchain up until that forking block is exactly identical to Bitcoin's and can be synced off a Bitcoin node.</p>

CC BY-SA 3.0
2018-01-30T08:50:24.467Z
`There is no actual snapshot that is taken; their blockchain up until that forking block is exactly identical to Bitcoin's and can be synced off a Bitcoin node.` - I get that, so you mean this syncing doesn't have to be a part of the code for the fork, per se. They can just have it synced upto their forked height using bitcoind and then run their own modified daemon?
ygh
CC BY-SA 3.0
2018-01-30T17:09:38.313Z
Yes. But in their modified daemon, they also have code that handles the pre-fork rules so that too can sync.
Ava Chow
CC BY-SA 3.0
2018-01-29T19:31:22.787Z
2018-01-29T19:31:22.787Z
Ava Chow
<p>I've done source forks (altcoins) and I understand how those work. But I'm a little stuck on how forks are activated? I need to know how blockchain snapshots are created and how the wallets know to distribute the initial fork offerings? If anyone could point me to a particular commit and/or PR of Bitcoin Cash or Gold where this logic is, I'd be very grateful.</p>

<bitcoin-core><bitcoind><bitcoin-cash><bitcoin-core-development><bitcoin-gold>
How to create a blockchain snapshot for a hardfork?
ygh
# How to create a blockchain snapshot for a hardfork?

(Asked by: username_0 on 2018-01-29)

I've done source forks (altcoins) and I understand how those work. But I'm a little stuck on how forks are activated? I need to know how blockchain snapshots are created and how the wallets know to distribute the initial fork offerings? If anyone could point me to a particular commit and/or PR of Bitcoin Cash or Gold where this logic is, I'd be very grateful.

**Tags:** bitcoin-core, bitcoind, bitcoin-cash, bitcoin-core-development, bitcoin-gold


---

## 1 answers

### Answer by username_1 on 2018-01-29. Score: 2 | Accepted answer

Hard forks are simply extensions of a blockchain where the new blocks follow different consensus rules that are not compatible with the original blockchain. There is no actual snapshotting in a true hard fork. The hard fork software simply syncs up to a certain point with the original blockchain, and after that point, a new consensus rule is enforced which conflicts with the original chain and thus causes a blockchain fork. This is simply governed by an `if` statement in the block validation code.

The fork is simply activated by a miner who mines a block after a certain block or point in time that follows different consensus rules from the original chain.

For example, with Bitcoin Cash, their software enforced that the first block created after August 1st at 12:00 UTC must be larger than 1 MB and also follows the Bitcoin Cash consensus rules (larger block size, new signature hashing algorithm, etc.). This is encoded as an `if` statement in the block validation logic which checked the time of a block before executing different consensus rule checks. There is no actual snapshot that is taken; their blockchain up until that forking block is exactly identical to Bitcoin's and can be synced off a Bitcoin node.

> **Comments:**
> **username_0**: `There is no actual snapshot that is taken; their blockchain up until that forking block is exactly identical to Bitcoin's and can be synced off a Bitcoin node.` - I get that, so you mean this syncing doesn't have to be a part of the code for the fork, per se. They can just have it synced upto their forked height using bitcoind and then run their own modified daemon?  
> **username_1**: Yes. But in their modified daemon, they also have code that handles the pre-fork rules so that too can sync.  

---

