Bitcoin Forum
November 06, 2024, 07:21:23 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: The longest (strongest) chain, chain reorgs and stale block(s).  (Read 190 times)
FbnGbz (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 13


View Profile
October 20, 2023, 07:32:21 PM
Last edit: October 22, 2023, 11:32:13 AM by FbnGbz
 #1

Hey there, me again: https://www.reddit.com/u/Fabs_-/s/kntRD6IAOf

Blockchain, longest chain and reorg’s

The "longest" chain refers to the blockchain which took the most energy and accumulated work to build, hence it's also referred to as the "strongest" chain.

The longest chain refers to the blockchain which individual nodes accept as the valid version of the blockchain, allowing said nodes to agree on the same blockchain and thus, the same transaction history.

Occasionally there’s a short-lived uncertainty between nodes about the longest chain, which happens when two miners mine and broadcast a new block at (almost) the same time.

Due to the propagation speed of blocks across the Bitcoin network, different parts of the network will receive one of either two blocks, leading to some nodes following Chain A, and others Chain B.

Once the next block is mined, confirmed and broadcast, it will either be linked to the blocks of Chain A, or the blocks on Chain B, creating a new longest chain, leading to the respective nodes following the other chain to perform a chain reorganization in order to catch up.

A chain reorganization refers to the process of adopting the new longest chain.

Once the chain reorganization has been finished, block(s) on the new longest chain will be activated, and block(s) that were part of the other chain will be deactivated, leading to them no longer being a part of the transaction history of the longest chain and thus, the blockchain.

The deactivated block(s) from the other chain are referred to as (a) "stale block(s)", which are block(s) that are no longer part of the longest chain. Transactions that were contained within the stale block(s) will be recycled into a node’s mempool, and propagated across the Bitcoin network once more for a chance to be mined in a future block.

Anything that should be edited?
hosseinimr93
Legendary
*
Offline Offline

Activity: 2576
Merit: 5668



View Profile
October 20, 2023, 07:53:09 PM
 #2

The deactivated block(s) from the other chain are referred to as (an) orphan block(s).
Such block is called a stale block, not an orphan block.
Orphan block is something different. Orphan blocks are blocks that are rejected because they have unknown parent.


You can click here to visit the article on Bitcoin Wiki and read about the difference between orphan blocks and stale blocks.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
FbnGbz (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 13


View Profile
October 20, 2023, 08:06:01 PM
 #3

Sharp, thanks! I've edited the summary.
satscraper
Hero Member
*****
Offline Offline

Activity: 910
Merit: 1633



View Profile
October 24, 2023, 06:13:57 AM
Last edit: October 24, 2023, 08:44:42 AM by satscraper
 #4

I like explanations on difference between orphan and stale blocksgiven by Pieter Wuille.  According to him


BTW, it seems that the last orphan block on bitcoin was created back on  June 14th, 1917 if statics shown by https://www.blockchain.com/explorer/charts/n-orphaned-blocks  is valid. Again,  Pieter Wuille credits this to improved download mechanism implemented in Bitcoin Core.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18746


View Profile
October 24, 2023, 09:04:39 AM
Merited by hosseinimr93 (2)
 #5

The "longest" chain refers to the blockchain which took the most energy and accumulated work to build, hence it's also referred to as the "strongest" chain.
We haven't used the longest chain since version 0.3.3 in July of 2010. You can see the change here: https://github.com/bitcoin/bitcoin/commit/40cd0369419323f8d7385950e20342e998c994e1#diff-623e3fd6da1a45222eeec71496747b31R420

The main chain is decided by the chain with the most accumulated chainwork, not the most number of blocks, to protect against an attack where a malicious miner could manipulate the timestamps of their blocks to rapidly drop the difficulty to one and then mine a much longer chain than the main chain.

Once the next block is mined, confirmed and broadcast, it will either be linked to the blocks of Chain A, or the blocks on Chain B, creating a new longest chain
This is also incorrect. Blocks are not mined and then linked to a chain - rather the exact opposite. Miners will all have already chosen which chain they will attempt to mine on top of, and any block that they find will only ever be valid on that chain since it will include the previous block hash in its header.

Transactions that were contained within the stale block(s) will be recycled into a node’s mempool
Usually when there is a one block re-org like this, the majority of transactions which were in the now stale block are already included in either the replacement block at the same height or the next block which has just been mined.
odolvlobo
Legendary
*
Offline Offline

Activity: 4494
Merit: 3402



View Profile
November 04, 2023, 09:18:15 PM
 #6

The "longest" chain refers to the blockchain which took the most energy and accumulated work to build, hence it's also referred to as the "strongest" chain.

Consider that the amount of energy used to create a block is not measured or recorded. So, while it might be inferred that the longest chain required the most energy, that statement is not strictly true.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
tromp
Legendary
*
Offline Offline

Activity: 990
Merit: 1110


View Profile
November 04, 2023, 09:26:12 PM
 #7

The "longest" chain refers to the blockchain which took the most energy and accumulated work to build, hence it's also referred to as the "strongest" chain.
Consider that the amount of energy used to create a block is not measured or recorded. So, while it might be inferred that the longest chain required the most energy, that statement is not strictly true.
The strongest chain is the one that takes the most energy to completely rewrite.
odolvlobo
Legendary
*
Offline Offline

Activity: 4494
Merit: 3402



View Profile
November 04, 2023, 09:28:02 PM
Last edit: November 04, 2023, 09:53:24 PM by odolvlobo
 #8

The "longest" chain refers to the blockchain which took the most energy and accumulated work to build, hence it's also referred to as the "strongest" chain.
Consider that the amount of energy used to create a block is not measured or recorded. So, while it might be inferred that the longest chain required the most energy, that statement is not strictly true.
The strongest chain is the one that takes the most energy to completely rewrite.

The energy required to create an entirely new longest chain using the same transactions would be substantially less than the energy used to create the current longest chain because current mining equipment is so much more efficient.

Without going into a more detailed analysis, miners now require about 0.02 j/GH now, while miners before 2019 required more than 0.2 j/GH. So, it can easily be assumed that creating a new chain with the first 10 years of transactions would require less than 10% of the energy. It should be apparent that the same holds for the remainder of the chain, though the difference would be much less. On the other hand, the energy required to create earlier blocks was much lower than the energy required to create later blocks. So, I can't say that creating a new chain would only take 10% of the energy, but I don't think that less than 90% would be a bad assumption.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!