Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: unsigned_long_long on August 30, 2020, 08:57:44 PM



Title: Depending on orphan blocks - abuse of the protocol ?
Post by: unsigned_long_long on August 30, 2020, 08:57:44 PM
Suppose I'm writing an app that uses the Bitcoin blockchain to store small amounts of data - eg. hashes, I write a tx to a block and later that block becomes orphaned. Ok so the tx probably will get confirmed in the forked chain, either at the same height or later, or not - if there's a fee spike or the network just forgets the tx for some reason.

In any case, is it considered an abuse of the protocol to refer to the orphan block in my app? , so if I get 1 confirmation in a orphan block, is it safe to assume that block will be remembered by the network forever? Are there any official guarantees about the availability of orphan blocks, in bitcoind or other implementations, or are they prune-able and I should expect it to be pruned sooner or later?


Title: Re: Depending on orphan blocks - abuse of the protocol ?
Post by: gmaxwell on August 30, 2020, 09:55:15 PM
Stale blocks  (the correct term for what you want) are not generally accessible.


Title: Re: Depending on orphan blocks - abuse of the protocol ?
Post by: unsigned_long_long on August 30, 2020, 10:17:15 PM
Stale blocks  (the correct term for what you want) are not generally accessible.

So no, ok cool. Thanks!


Title: Re: Depending on orphan blocks - abuse of the protocol ?
Post by: odolvlobo on September 01, 2020, 06:05:00 AM
In any case, is it considered an abuse of the protocol to refer to the orphan block in my app? , so if I get 1 confirmation in a orphan block, is it safe to assume that block will be remembered by the network forever? Are there any official guarantees about the availability of orphan blocks, in bitcoind or other implementations, or are they prune-able and I should expect it to be pruned sooner or later?

There is no guarantee that a node will see a block if it is not in the main chain because blocks are generally not propagated once they are determined to be stale.


Title: Re: Depending on orphan blocks - abuse of the protocol ?
Post by: unsigned_long_long on September 03, 2020, 12:51:33 AM
In any case, is it considered an abuse of the protocol to refer to the orphan block in my app? , so if I get 1 confirmation in a orphan block, is it safe to assume that block will be remembered by the network forever? Are there any official guarantees about the availability of orphan blocks, in bitcoind or other implementations, or are they prune-able and I should expect it to be pruned sooner or later?

There is no guarantee that a node will see a block if it is not in the main chain because blocks are generally not propagated once they are determined to be stale.

Makes sense. I think some block explorers keep them, but probably just for data analysis purposes.


Title: Re: Depending on orphan blocks - abuse of the protocol ?
Post by: HeRetiK on September 03, 2020, 12:34:47 PM
In any case, is it considered an abuse of the protocol to refer to the orphan block in my app? , so if I get 1 confirmation in a orphan block, is it safe to assume that block will be remembered by the network forever? Are there any official guarantees about the availability of orphan blocks, in bitcoind or other implementations, or are they prune-able and I should expect it to be pruned sooner or later?

There is no guarantee that a node will see a block if it is not in the main chain because blocks are generally not propagated once they are determined to be stale.

Makes sense. I think some block explorers keep them, but probably just for data analysis purposes.

Well, the ones that the nodes of those block explorers see. I'm not sure how many nodes your typical block explorers have running but some stale blocks are bound to be left unnoticed.