• About
  • FAQ
  • Earn Bitcoin while Surfing the net
  • Buy & Sell Crypto on Paxful
Newsletter
Approx Foundation
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
Approx Foundation
No Result
View All Result
Home Bitcoin

Is this how a reorganization and fork works in Bitcoin?

approx by approx
January 3, 2024
in Bitcoin
0
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


I am trying to understand how reorganization and forks related to them work in Bitcoin. I have reviewed all the questions (around 80/90 of them) related to the chain-reorganization tag, and I think I have gained some insight into how everything works, but I still have some uncertainties, which I will outline below. First, I will start with how I understand reorganization and forks, and then I will pose the questions.

Answers that have helped me the most in understanding how everything works (Big Thanks to this great people!):

Murch:

Pieter Wuille:

Ava Chow:

Thank you all in advance for your understanding and assistance and truly apologize for the excessive text. Any help would be appreciated

I am considering a situation where we are synchronized, haven’t been offline and then reconnect.

Forks occur when two miners create the next block (block A and block B) at approximately the same time. In this situation, block A is accepted by one part of the network, while block B is accepted by another part of the network. Depending on which block a node first receives (via header or cmpct message), the node will first validate that block (let’s say A), and if everything is fine, declare its branch as the main/canonical branch, leaving it in place. Block A is then propagated to all its peers. As for the second block (block B), regardless of whether it only received the header or the entire block due to cmpct, it will only perform validation to check if it has a valid PoW and a known parent (all other details are irrelevant; whether the transactions are correct or not). Also, we will only forward block A to all our peers since it is part of our main chain, while we keep B only locally as one of the chain tips. At this point, we have two chains (main and “side”), waiting to see which of these two will be extended next (block C). If the chain with block A is extended, everything is fine; we perform regular validation, and that’s it. However, if the chain with block B is extended, a reorganization is necessary. In this case, all transactions from block A are returned to the mempool, and all spent UTXOs are returned to the UTXO set. After that, a complete validation is performed on the other fields of the header and transactions of block B (if we only had the header, it is necessary to also send a getdata request for the entire block or a getblocktxn request for the remaining missing transactions). If everything is fine, block C is validated. If C is also fine, it is forwarded to all peers, and that branch becomes the new canonical/main branch.

My questions are:

  1. Is everything written above correct?
  2. I know that a node only accepts blocks for which it knows the parent (if it doesn’t know, they are orphan blocks). However, does that parent have to be exclusively one of the branch tips, or does it just need to be one of the blocks from any of the branches (either main or one of the forks)? For example, if the main chain has 100,000 blocks and there are two forks on the side: the first split at 20,000 blocks with the main and has an additional 5 blocks, and the second split at 60,000 blocks with an additional 30 blocks. Will a block be accepted only if a block comes whose parent is the 100,000th block of the main chain, the 20,005th block of the first fork, or the 60,030th block of the second fork? Or will blocks whose parents are not branch tips also be accepted (for example, the 86,004th block of the main chain, the 20,002nd block of the first fork, etc.)? When I say accepted, I mean validation of PoW and checking if it might have become the new main chain. If it does become the main chain, then other validation checks follow.
  3. What happens to the blocks that remain in that stale fork during reorganization? Do they stay as they are, or are transactions discarded, leaving only the header?
  4. If the chain with the B block is extended with the C block, for me, that becomes the main chain, so in this case, I forward block C to all my peers. However, since it was previously the chain with block A, I didn’t propagate block B to my peers, so block C will be discarded as an orphan block. What happens if such peers have never heard of block B? They will never accept this branch…
  5. Is all that I have written just the way Bitcoin Core implements blockchain management, and nothing here is part of the consensus except for tracking the chain with the most work, or is that not even part of the consensus? Is it only important to follow the chain with the most work, and how we implement it is irrelevant?



Source link

Related articles

‘Bull Trap Forming’ – Willy Woo Says Bottom Not In for Bitcoin

‘Bull Trap Forming’ – Willy Woo Says Bottom Not In for Bitcoin

March 9, 2026
How do Bitcoin mining pools typically handle payout frequency versus thresholds?

Can you help me identify a bitcoin wallet backup format from 2013?

March 9, 2026
Share76Tweet47

Related Posts

‘Bull Trap Forming’ – Willy Woo Says Bottom Not In for Bitcoin

‘Bull Trap Forming’ – Willy Woo Says Bottom Not In for Bitcoin

by Moussa
March 9, 2026
0

Bitcoin’s bounce to the mid $70,000s had traders eyeing a bullish comeback, but one veteran on-chain analyst is urging caution,...

How do Bitcoin mining pools typically handle payout frequency versus thresholds?

Can you help me identify a bitcoin wallet backup format from 2013?

by Moussa
March 9, 2026
0

I'm sweeping some old bitcoin wallets and I have two files named "Bitcoin Wallet backup" from 2020 "bitcoin-wallet" from 2013...

Is Bitcoin Dominance Back? Altcoin Social Media Interest Falls to 2-Year Low

Is Bitcoin Dominance Back? Altcoin Social Media Interest Falls to 2-Year Low

by Moussa
March 9, 2026
0

Bitcoin just pulled off a massive, nearly 10% rally, briefly touching $74,000 yesterday before settling around its current trading price...

Ethereum Price Extends Pullback, $1,920 Support Now Under Threat

Ethereum Price Extends Pullback, $1,920 Support Now Under Threat

by Moussa
March 9, 2026
0

Ethereum price started a fresh decline below $2,000. ETH is now correcting gains above $1,920 and might decline further in...

US Dollar Climbs to Multi-Month Highs as Iran Conflict and Oil Spike Rattle Markets

US Dollar Climbs to Multi-Month Highs as Iran Conflict and Oil Spike Rattle Markets

by Moussa
March 9, 2026
0

The U.S. dollar is flexing its muscles in early March as geopolitical tensions and rising energy prices have been sending...

Load More

youssufi.com

sephina.com

[vc_row full_width="stretch_row" parallax="content-moving" vc_row_background="" background_repeat="no-repeat" background_position="center center" footer_scheme="dark" css=".vc_custom_1517813231908{padding-top: 60px !important;padding-bottom: 30px !important;background-color: #191818 !important;background-position: center;background-repeat: no-repeat !important;background-size: cover !important;}" footer_widget_title_color="#fcbf46" footer_button_bg="#fcb11e"][vc_column width="1/4"]

We bring you the latest in Crypto News

[/vc_column][vc_column width="1/4"][vc_wp_categories]
[/vc_column][vc_column width="1/4"][vc_wp_tagcloud taxonomy="post_tag"][/vc_column][vc_column width="1/4"]

Newsletter

[vc_raw_html]JTNDcCUzRSUzQ2RpdiUyMGNsYXNzJTNEJTIydG5wJTIwdG5wLXN1YnNjcmlwdGlvbiUyMiUzRSUwQSUzQ2Zvcm0lMjBtZXRob2QlM0QlMjJwb3N0JTIyJTIwYWN0aW9uJTNEJTIyaHR0cHMlM0ElMkYlMkZhcHByb3gub3JnJTJGJTNGbmElM0RzJTIyJTNFJTBBJTBBJTND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wcG9saWN5JTNDJTJGbGFiZWwlM0UlM0MlMkZkaXYlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1idXR0b24lMjIlM0UlM0NpbnB1dCUyMGNsYXNzJTNEJTIydG5wLXN1Ym1pdCUyMiUyMHR5cGUlM0QlMjJzdWJtaXQlMjIlMjB2YWx1ZSUzRCUyMlN1YnNjcmliZSUyMiUyMCUzRSUwQSUzQyUyRmRpdiUzRSUwQSUzQyUyRmZvcm0lM0UlMEElM0MlMkZkaXYlM0UlM0NiciUyRiUzRSUzQyUyRnAlM0U=[/vc_raw_html][/vc_column][/vc_row]
No Result
View All Result
  • Contact Us
  • Homepages
  • Business
  • Guide

© 2024 APPROX FOUNDATION - The Crypto Currency News