Understanding orphan blocks

10 replies 237 views
WildChainFull Member
Posts: 37 · Reputation: 323
#1Feb 1, 2023, 01:23 PM
I was reading a paper on Bitcoin from ens.press and came across something that kinda confused me. My previous knowledge tells me that everything in the network happens in parts or steps, not all at once. But then there's this concept of an orphan block that gets ignored after the network picks the block with the most proof of work. So, when does this orphan block actually happen? Is it during the mining process? It seems weird to think that a block with transactions could just get tossed aside.
6 Reply Quote Share
hash_bossLegendary
Posts: 1166 · Reputation: 5261
#2Feb 1, 2023, 02:47 PM
I would recommend you to read https://learnmeabitcoin.com/technical/blockchain/chain-reorganization/ instead, which should be easier than reading (more technical/scientific) paper. It's not stated by the quote, but those two blocks actually have same block height. As stated on the quote, it's when another block have a mined block on top of it. It means another block with same block height no longer used by nodes and miners since it's no longer part of longest chain.
5 Reply Quote Share
pixel2014Hero Member
Posts: 857 · Reputation: 4132
#3Feb 1, 2023, 08:27 PM
Orphan block can occur at any block height. When two miners mine the same block, the two blocks will be valid but later there must be chain reorganisation in which the block with the longest chain will be valid while the other one will become invalid so that only the block with the longest chain will the new blocks will build upon.
5 Reply Quote Share
WildChainFull Member
Posts: 37 · Reputation: 323
#4Feb 2, 2023, 01:37 AM
It’s actually easier and explains terms in detailed forms. It’s what I should be reading really. It states here that, this occurrences is rare but very possible as these blocks could be mined at the same time with both carrying similar or same transactions of which, the parent block would be determined by the mining of the next block which would attach to either of the chains, making one of them the longest node and trigger a reorganization where, a staled block would be discarded and transactions within it as well which is indeed similar to the adopted transactions on the longest node. In this way, there wouldn’t be room for double spending as well. I appreciate you for this material, would get along with it.
1 Reply Quote Share
byte2019Senior Member
Posts: 270 · Reputation: 1836
#5Feb 2, 2023, 04:31 AM
It is called "stale", instead of "orphan" in other places. Because "orphan" has no parents, and the only block meeting this definition, is the Genesis Block, where its previous block hash is set to zero. I think you should try mining something with signet-like difficulty on CPU, to see that in practice. In general, when hashes are grinded, then from time to time, you can get a close match. And then, you have two pieces of Proof of Work, which are equally valid. The first-seen block header is the one, which miners will work on, but both are valid, until someone will share a new block, which would be created on top of it. See: https://en.bitcoin.it/wiki/Proof_of_work Here, some miner successfully grinded "Hello, world!" data, with "nonce", equal to "4250". At the same time, a different miner could find a different text, with a different nonce, but also with 16 leading zero bits. And then, you have two valid blocks: one contains "Hello, world!" with nonce "4250", and another one contains "Foo, bar!" with nonce "9764". Which one is valid? Both of them are, and then, the next miner produces the next valid block, and then, everyone switches to the stronger chain, with more Proof of Work. Some Bash scripts for testing things:
5 Reply Quote Share
silentchainHero Member
Posts: 473 · Reputation: 2317
#6Feb 4, 2023, 03:30 PM
Looks like this is not technically correct. What are you describing is the "stale" block rather than "orphan" one. To clarify, an orphan block refers to the block that has no valid parent according to the node’s perspective, i.e. it's disconnected from the main chain. Additionally, according to blockchain.com statistics, no orphan blocks have been found since July 2018:
0 Reply Quote Share
fox100Senior Member
Posts: 165 · Reputation: 1050
#7Feb 4, 2023, 10:01 PM
Indeed they are. That site is just broken. It was always an indicator of stale blocks and there continue to be stale blocks today.
0 Reply Quote Share
byte_protoFull Member
Posts: 84 · Reputation: 625
#8Feb 5, 2023, 01:57 AM
There is a different between the orphan and stale block, although sometimes others use them interchangeably but there is still a difference. Orphan blocks are good blocks placed on hold temporarily because their parent block hasn't been mined/validated and they can be replaced by another longer block  later on. I remember asking this few years back: https://bitcointalk.org/index.php?topic=5472812.msg63103061#msg63103061 Looking at the last reply in an old thread here: https://bitcointalk.org/index.php?topic=5200116.msg53032362#msg53032362, I think this is the  reason they may not be occurring again
3 Reply Quote Share
fox100Senior Member
Posts: 165 · Reputation: 1050
#9Feb 5, 2023, 02:51 AM
Amphenomenon, I think you've managed to confuse the thread. In Bitcoin sometimes a block is created that doesn't make it into the longest chain.  This is unavoidable and has always occurred and cannot be avoided unless mining becomes completely centralized.  At the very least it happens when two miners find a block at close enough to the same time that they couldn't have heard each other's announcement. Early in Bitcoin users called these things "orphan blocks" because when they were the miner of the blocks the coinbase payment to them would show as "orphan" in the wallet.  But it wasn't the block that was orphan, it was the transaction-- the transactions parent block no longer existed in the wallet's view of the chain.  Some people complained about the use of the term "orphan block" because that term was already in use in side the software for blocks whose parent wasn't yet fetched, because when bitcoin saw a new block it fetched backwards along the chain until it got to the genesis block.  Instead, they suggested people should use the term "stale block".  But the 'missing parent' usage of the term "orphan block" isn't something anything but developers were aware of because the parents always (eventually) got fetched and so users were never aware of these temporary "orphans".   Stale blocks however are common and are of some interest to users (particularly miners).   The term orphan block continued to be used to refer to stale blocks by users.  And whenever you hear someone say "orphan block" they are just referring to stale blocks. This is especially true because the Bitcoin software was changed long ago so that 'orphan blocks' (ones where the parent isn't known) are just completely impossible:  Nodes now only fetch blocks when they're part of a header chain, and so the parents are *always* known. Sites like BC.i were always plotting stale blocks, as "orphan blocks" would never have made sense to plot (as they were a purely local, transitory thing that mostly happened during initial download when a new block was found while you were still catching up).  Finding stales is hard because they have never propagated well, since the deployment of compact blocks in 2016 they propagated even worse.   Bc.i used to connect to thousands of nodes which would let them see many stale (which they called orphan) blocks but not all of them... but in more recent years bc.i seems to be largely abandoned and this statistic is not maintained anymore, unsurprising since it was always difficult to collect. Probably at this point people should stop correcting on the difference between orphan and stale.  Now that orphan blocks (the not stale blocks) aren't even a thing anymore and haven't been for a long time,  the correction is probably adding much more confusion than it solves.
4 Reply Quote Share
byte_protoFull Member
Posts: 84 · Reputation: 625
#10Feb 6, 2023, 06:16 PM
Thanks for the clarification, I understand better now. In the current time, orphan and stale blocks are the same.
1 Reply Quote Share
WildChainFull Member
Posts: 37 · Reputation: 323
#11Feb 6, 2023, 10:11 PM
This makes a lot of sense now as it explains why the term seems the same in its definition because and can be used interchangeably because, they are indeed the same as suspected when going through the link provided by ABCbits and it’s indeed confirmed in the link provided by Satscraper. The simplified visual diagram explains it quite well.
3 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics