Could a dominating chain fork actually be shorter (in blocks) than its abandoned predecessor? Under what circumstances could this happen?
- Strongest vs Longest chain and orphaned blocks
- How does a client decide which is the longest block chain if there is a fork?
- Where exactly is the "off-by-one" difficulty bug? (timewarp info)
A shorter chain could possibly be considered the correct one, but it would be very hard to make this happen in bitcoin. I can think of two ways this could happen.
1) Go back to the genesis block and use the time warp attack.
See this for information on how the timewarp attack works.
This would let the attacker create a very long chain very quickly, because the difficulty could be artificially kept low even though blocks were solved very quickly. However, this chain would not have nearly as much work as the main chain, and so even if it were longer, it would not be accepted by the network as the correct chain. It would also fail most wallets' checkpoints.
2) Two blocks are solved at the last height in a difficulty period and a network fork ensues.
If there happened to be a fork in the last block of a difficulty period, then the new difficulty for the next period would be different depending on which side of the fork you were on. In this case, blocks solved on top of one side of the fork would have precedence over the other.
This isn't a case of a shorter chain being chosen over a longer chain (unless the fork gets really long), but rather two chains of the same length and one of them being chosen by the network as the correct one even if it gets seen second.