Blockchain - Resolving Conflicts
The Bitcoin network contains several miners. It is possible that two different miners solve the Proof-of-Work at the same time and add their blocks to the last known block. This is illustrated in the image below.
As a result, we have two branches after Block 3. Both are valid. Therefore, the next mined block can be added to either branch. The branch containing Block 104-A will be longer than the branch containing Block 104-B if the miner adds the newly mined block to Block 104-A. The image below illustrates this.
According to Bitcoin architecture, the longest branch always wins and the shorter branches are purged. Block 104-B must be purified. The transactions in this block will be returned to the transaction pool before purging so they can be mined and added to future blocks. As a result, conflicts are resolved and only one chain of blocks is maintained.