0

Orphan blocks were one of the problems with Bitcoin at its beginning. Do orphan blocks still exist in Bitcoin, and if not, why?

Murch
  • 75,206
  • 34
  • 186
  • 622
  • 1
    The term "orphan blocks" has been used for two very different concepts, see https://bitcoin.stackexchange.com/a/5869/208. Which of the two meanings are you referring to? – Pieter Wuille Sep 04 '23 at 14:42
  • @PieterWuille Reading the answer you posted, I see that the second type no longer exists due to the change in the download mechanism. How does this first type stand, does it still exist, and if not, how was it solved, that is, how is it being solved –  Sep 04 '23 at 14:52
  • The first one is entirely expected, inevitable, and not a problem at all, unless it happens a lot. – Pieter Wuille Sep 04 '23 at 14:53
  • @PieterWuille The explanation of the first type in you answer is not enough clear to me. Are you referencing to the same "issue" as RedGrittyBrick in his answer to my question (see below)? –  Sep 04 '23 at 14:58
  • Yes, @RedGrittyBrick is talking about the first interpretation ("extinct blocks") in my linked answer. It is inherent to proof of work that sometimes multiple blocks are created simultaneously. – Pieter Wuille Sep 04 '23 at 15:00
  • @PieterWuille How will nodes know which of two (or three, four) blocks to take when they got it at the same time? What if one group of nodes accept one block, and second group of nodes accept the second block? Won't that make a fork? –  Sep 04 '23 at 15:02
  • Well, yes, that is a fork. And the entire point of proof-of-work is to resolve those. The chain which gets extended first is the one that wins. – Pieter Wuille Sep 04 '23 at 15:04
  • @PieterWuille If two forks diverge into, say, 5 blocks, and network continue to build on one of those two forks (fork B), do all transactions from blocks belonging to fork A (all 5 blocks) go back to the mempool? –  Sep 04 '23 at 15:09
  • Yes, whenever such a switch (called a reorganisation) happens, all transactions go back to the mempool, and get a chance of being included in the other branch (without guarantees of course). – Pieter Wuille Sep 04 '23 at 15:11

1 Answers1

2

The phrase "orphan blocks" is often used for blocks that were displaced from the live blockchain by a block at the same height that had more work - That occurs when two miners produce a block at the same time. Many people refer to that as a stale block or as an extinct block.

These sorts of block occur regularly, maybe once every two weeks, and are not a problem.

Transactions in a stale block are returned to the mempool and usually appear in the next block or so.

This is why six confirmations are generally deemed safe for large transactions.

RedGrittyBrick
  • 26,841
  • 3
  • 25
  • 51
  • How will the nodes know which of the two blocks to take? What if one group of nodes takes the first block and another group of nodes takes the second block? Won't that make a fork? –  Sep 04 '23 at 15:00
  • 1
    In PoW, nodes accept among otherwise valid chains the one which (1) has the most work (so if there is a fork, and one side gets extended first, nodes will switch to that one) and (2) among equal-work chains, the one they see first. – Pieter Wuille Sep 04 '23 at 15:08