Author

Topic: Can someone please explain what causes orphans like I'm five? (Read 1560 times)

hero member
Activity: 952
Merit: 1009
When Mommy and Daddy get shot in a poorly lit alleyway by a mugger in the rain after visiting the opera, the result is an orphan. The orphan later falls down a bat-infested well and breaks his neck. The end.

Wait, that's not true. In the story I have herd the orphan survives the fall and from there on wears a ridiculous costume and brings his revenge to the muggers.

That sounds ridiculous. Like something straight from out of a comic book.
legendary
Activity: 1232
Merit: 1001
When Mommy and Daddy get shot in a poorly lit alleyway by a mugger in the rain after visiting the opera, the result is an orphan. The orphan later falls down a bat-infested well and breaks his neck. The end.

Wait, that's not true. In the story I have herd the orphan survives the fall and from there on wears a ridiculous costume and brings his revenge to the muggers.
hero member
Activity: 952
Merit: 1009
When Mommy and Daddy get shot in a poorly lit alleyway by a mugger in the rain after visiting the opera, the result is an orphan. The orphan later falls down a bat-infested well and breaks his neck. The end.
sr. member
Activity: 672
Merit: 254
"there can only be one"
sr. member
Activity: 420
Merit: 250
Very clear explanation! Thank you very much! Smiley
staff
Activity: 4284
Merit: 8808
The purpose of the bitcoin blockchain is to assign an order to all transactions that everyone can agree on. This is hard because we don't want to have a central party that coordinates the ordering.

To solve this problem Bitcoin participants called miners do a computer equivalent of rolling dice to determine when they're permitted to produce a block. The blocks form a long chain— every block with one block before it and one block after it—, and the order of the chain gives the transactions inside order.  Everyone adjusts their dice odds to keep the blocks found infrequently enough that everyone isn't finding one at the same time, and everyone (even non-miners) checks to make sure everyone else is following these rules.

Sometimes— by pure chance— two miners will produce blocks in very rapid succession, the second happening before the miner had a chance to hear about the first. The closer the blocks are found to each other the more likely it is that they are siblings rather than one the parent of the other, this is called a fork in the chain. Only one of these sibling blocks can be kept because both are marked as coming directly after the block before them and the chain must be straight if we are to use it to order transactions.

When there is a (near) tie like this Bitcoin nodes prefer the first block they heard, but some may have heard the second block first because the messages take time to relay, and we need to get all nodes to agree.  Ultimately all the Bitcoin nodes decides which of the blocks to keep based on which one ends up in the longer list of blocks because this is evidence that more participants preferred that block. Sometimes several blocks must be produced before it is clear which of two competing block forks will be the winner and during that time the final answer is unclear.  Once one fork becomes clearly longer the nodes preferring the other fork will switch to using the blocks in the longer chain, potentially undoing transactions and replacing them with other ones.

The losing block is called an orphan block. The name "orphan" is a little misleading because an orphan block has a parent.  This name became common because the transaction which generates the new coin in that block doesn't have a parent in the blockchain and so that transaction is fairly called an orphan. But the Bitcoin software only way of telling you that you'd found a block which lost was to tell you about the orphan transaction and the name stuck.

Orphans are a regular part of the Bitcoin process and cannot be avoided. They happen pretty much every day and are normally harmless.
sr. member
Activity: 420
Merit: 250
I've heard that they're caused when two block are found extremely close to each other. But I've seen block that were a minute apart and weren't orphaned.
What happens in the code that causes a block to be pegged as an orphan?
Jump to: