Blockchain reorganization (reorgs) can occur when there is a change in the longest valid chain of blocks, typically due to a conflict between two or more competing blocks. When multiple miners discover valid blocks simultaneously, for example, they propagate them through the network. As a result, different nodes may receive different versions of the blockchain, each with a different last block. This creates a temporary [[Forks|fork]] in the chain.
>[!example] Examples
>1. Bitcoin's March 2013 Reorganization: A fork occurred resulting in two competing chains after an accidental split caused by software inconsistency.
>2. Ethereum Classic's July 2016 Reorganization: Following The DAO hack incident on Ethereum, a reorg took place to reverse the theft. However, some participants disagreed with this decision and continued on the original chain as Ethereum Classic.
To resolve such a conflict and maintain a single valid chain, nodes will choose the longest chain based on the protocol's [[Consensus Mechanism|consensus algorithm]], which determines the longest chain by considering factors like the total accumulated [[Difficulty|difficulty]] or spent [[Hashpower|hashpower]]. Then, competing blocks that are not included in the longest chain become orphaned or stale blocks. Orphaned transactions are returned to the [[mempool.C|mempool]], and miners can attempt to include them in future blocks. The deeper a transaction is in the blockchain, however, the less likely it is to be affected by a reorg since it would require a significant amount of computational power to alter past blocks.