1. What happens in the bitcoin network when two miners solve a block at the same time?
Both blocks are added to the blockchain, creating a temporary split of the blockchain.
This split occurs at node level, meaning that the different nodes are group together
based on the block they received and added. This temporary split of the blockchain will
continue to exist until such time that there is a longer blockchain that will be used as
the truth. All of the blocks in the shorter blockchains will be discarded by the networks
and all transactions in these blocks will be returned to the mempool.
2. What is a stale block?
In the event of a temporary split as explained in point 1, a block on the blockchain becomes
a stale block when the version of the blockchain in which it exists is no longer the longest.
All of the blocks in the shorter blockchain version since the split are discarded, ergo. stale block.
3. How do stale blocks occur?
When the version of the blockchain in which it exists is no longer the longest blockchain. (see point 1)
4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
Due to the unlikelihood of a blockchain split to occur, having at least 6 blocks appended to the
block that your transaction exists in, ensures a 99.999% probability that your transaction is
in the longest blockchain on the network, thus ensuring that your transaction is complete.