0

Reading the whitepaper of Ethereum I came up with the following questions on forks. Let me explain:
Lets say that I send 1 ETHER to an address A1 to buy something and this transaction gets logged on block 100. After a few hours more blocks have been added to the blockchain and they indirectly confirm block 100 though the PreviousHash information each block contains.
If ETH gets forked at block 99 I would have my 1 ETH back and I could spend it again. I guess this would be double-spending and this is not how forks work.

  1. How do forks happen/ how is the block that will separate the two new blockchains chosen?
  2. What is the point of separating a blockchain? I mean there is already a common consensus that the current state of the network is right, due to proof of work. Why fork it?
1

How do forks happen/ how is the block that will separate the two new blockchains chosen?

Ethereum's average block time is currently around 14 seconds. With lower block times there is a greater chance that two (or more) miners will find a solution to a given block's Proof of Work at the same time. The consensus rules mean that one of these two (or more) blocks will eventually be considered the correct one, but until that time a different chain can grow from each of the blocks.

This is a "naturally" occurring event that happens many times a day, and is why Ethereum has the idea of uncles, which help incorporate transactions from whichever chain is eventually considered invalid.


If ETH gets forked at block 99 I would have my 1 ETH back and I could spend it again. I guess this would be double-spending and this is not how forks work.

Natural forks usually occur at the chain head, on the latest block. If your transaction was incorporated in block 100, and there were multiple blocks built on top of block 100, then it's unlikely that a "natural" fork event could happen on block 99. (A couple of caveats that I [and @lungj] can think of: a) if the network had been partitioned somehow at block 99, and then reconnected later, b) if you start mining before completely syncing the chain data.)

Perhaps more likely would be an attack, whereby an attacking miner deliberately chose to fork from block 99 in an effort to double spent funds from later blocks. To do this they'd need enough hashing power to create a fork longer1 than the fork that everyone else considers correct. This is what would be considered a 51% attack.

1 By "longer" we really mean with a greater cumulative difficulty.

  • Based on some of the questions here where people sometimes mine a block before fully syncing, I think you can safely delete the "always" hedge for when forks occur :) – lungj Feb 6 '18 at 21:28
  • Ah, yes, good point - I'd not thought of that :-) Edited. Thanks! – Richard Horrocks Feb 9 '18 at 15:35
0

There are really 2 different forks to explain in this context.

Technical forks:

  1. This is when miners are all effectively mining together, but sometimes 2 different block 100s are mined by different miners, and the network sees them at the same time, they're both valid. So other miners will pick one and start mining on it. This is usually short lived and results in orphans.

  2. There is no point to this, it just happens naturally as miners try to be the fastest to get a block.

Political fork:

  1. This happens when miners decide to run rules at a block that don't match the rules of the other blockchain. The block number is usually arbitrary, it's just a block chosen for the miners to switch to new rules that are incompatible with the original blockchain.

  2. This is because of disagreement in consensus rules. Example: Bitcoin Cash forked from Bitcoin because they wanted a change to consensus that Bitcoin Core didn't want.

0

If ETH gets forked at block 99 I would have my 1 ETH back and I could spend it again. I guess this would be double-spending and this is not how forks work.

Though it is likely that a fork would be scheduled at a future block, say it did occur at block 99 and you had spent your 1 ETH on block 100. You will not be able to use the 1 ETH again on the original blockchain. You can only use it on the forked chain. This is exactly how forks work, and is not a double-spend.

When a fork occurs, e.g. when Bitcoin Cash was forked off of Bitcoin, then whatever bitcoin you had at the block where the fork occurred can now be spent on both Bitcoin Cash and Bitcoin chains. In other words, if you had 5 BTC before the fork, you would have 5 BTC and 5 BCH (Bitcoin Cash) after the fork. The BTC can only be spent on the Bitcoin chain and the BCH can only be spent on the Bitcoin Cash chain. Because both chains have a common history, it is essentially the same bitcoin that can be spent once on both chains. This is not a double-spend. They are different chains.

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.