Bitcoin Forum

Other => Beginners & Help => Topic started by: element72 on June 04, 2017, 05:51:50 AM



Title: Need help understanding what happens in a natural Bitcoin fork
Post by: element72 on June 04, 2017, 05:51:50 AM
Hi Bitcointalk community!

I am trying very hard to understand the technical details of how the blockchain is created.

Lets imagine 2 nodes solve the current block puzzle at nearly the same time. I guess now we have 2 chains. How do the nodes determine which chain is the longest? If I understood correctly, the longest chain is used when the next block is added.

How do the nodes determine which of the 2 chains is the longest chain == 'has the most effort put into it'?

P.S. I did learn some of the very deep technical parts, such as the prefix of 0's required in proof-of-work, and that more required 0's basically implies more work needed.


Title: Re: Need help understanding what happens in a natural Bitcoin fork
Post by: Lauda on June 04, 2017, 09:06:17 AM
Lets imagine 2 nodes solve the current block puzzle at nearly the same time. I guess now we have 2 chains. How do the nodes determine which chain is the longest? If I understood correctly, the longest chain is used when the next block is added.
If you have 2 nodes, of which both create 1 new block at the same time, then neither chain is the longest one. In this case, they are both likely to be of the same length and amount of work. Now, consider this as a block building race. Eventually one becomes longer/has more proof of work and the other one reorganizes (thus becoming an orphaned chain). Read these two links:
1) What's the longest chain of orphan blocks? (How many confirmations have been necessary?) (https://bitcoin.stackexchange.com/questions/4082/whats-the-longest-chain-of-orphan-blocks-how-many-confirmations-have-been-nec)
2) What are orphaned and stale blocks? (https://bitcoin.stackexchange.com/questions/5859/what-are-orphaned-and-stale-blocks)

Bitcoin is very large, with several competing miners and thousands of non-mining nodes. Because of this, it is extremely unlikely that half the network is on block A and the other half of the network is on block B (same block number). "My own understanding is that orphaned blocks are initially accepted by the majority of the network, but are later rejected when proof of a longer blockchain is received that doesn't include that particular block."

How do the nodes determine which of the 2 chains is the longest chain == 'has the most effort put into it'?
It's usually referred to as "most proof of work" or the "longest valid chain with the most amount of work" and not "most effort" as that is too vague.

P.S. I did learn some of the very deep technical parts, such as the prefix of 0's required in proof-of-work, and that more required 0's basically implies more work needed.
That is not knowledge about "very deep technical parts". Those are just some details of the underlying technology.


Title: Re: Need help understanding what happens in a natural Bitcoin fork
Post by: fhireman on June 05, 2017, 02:52:22 PM
Thanks for the awesome explanation Lauda, cleared some things up for me :)
Do you have some more resources to learn about blockchain technology?


Title: Re: Need help understanding what happens in a natural Bitcoin fork
Post by: Lauda on June 05, 2017, 04:46:39 PM
Thanks for the awesome explanation Lauda, cleared some things up for me :)
Do you have some more resources to learn about blockchain technology?
These are all you need:
1) Bitcoin Wiki: https://en.bitcoin.it/wiki/Main_Page.
2) Bitcoin Stack Exchange: https://bitcoin.stackexchange.com/.
3) Mastering Bitcoin book: https://www.bitcoinbook.info/