The Bitcoin block chain is the transaction database that is built by nodes participating in the mining process on the Bitcoin network. The block chain contains transactions validated and processed by nodes on the network. Using the block chain anyone can calculate and build a record of all of the confirmed transactions that have taken place on ledger up until the most recent block was found.
Every block contains a reference to the block it builds upon. This has the effect of creating a chain of blocks from the genesis block to the current block. Blocks become computationally impractical to modify once they have been built upon for a period of time due to the amount of work that would need to be regenerated.
Nodes extend the blockchain by building on what they consider to be the most recent valid block in the longest chain of proof of work. Nodes can dispute blocks by choosing not to build upon them and any block that does not become part of the longest chain of work is referred to as an Orphan Block.
For any block on the chain, there is only one path back to the genesis block. Coming from the genesis block, however, there can be divergence in the chain. Forks are created from time to time when two valid blocks are created just a few seconds apart sparking what's known as an orphan race. When this occurs, each node will attempt to build a new block upon whichever of the competing blocks they received first. This has the effect of creating a very strong incentive for nodes to form a Nearly Complete Graph as a means to minimise the propagation time of blocks. When a new block is found, the block it was built upon has a much greater chance of becoming part of the longest chain and orphaning its competitor.
Forks can also occur when nodes disagree on network rules. Two notable forks have occurred on Bitcoin as a result of disagreements between node operators. The first occurred in 2017 when Bitcoin was forked onto the BCH network after Bitcoin Core nodes elected to adopt Segregated Witness into the BTC network rules and again in November 2018 when BitcoinABC nodes elected to implement new opcodes and consensus rules that were unaligned with the original protocol.
Blocks in shorter or invalid chains cannot be used for anything and any proof of work that went into their creation is discarded. If a node detects the creation of a longer chain than the one it is working on, all valid transactions of the block template inside the shorter chain are re-added to the pool of queued transactions to be included in a new block. The reward for the blocks on the shorter chain will not be present in the longest chain, so they will be practically lost, which is why a network-enforced 100-block maturation time for spending coinbase transactions exists.
Because the protocol specifies that a block must only reference one previous block, it is impossible for two forked chains to merge.
Blocks are broadcast to all nodes on the networking using the Bitcoin Network protocol.
This content is based on content sourced from https://en.bitcoin.it/wiki/Block_chain under Creative Commons Attribution 3.0. Although it may have been extensively revised and updated we acknowledge the original authors.