1

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.

2

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.

  • 1
    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? – ystark Jan 30 '18 at 8:50
  • 1
    Yes. But in their modified daemon, they also have code that handles the pre-fork rules so that too can sync. – Andrew Chow Jan 30 '18 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.