stacks-network / stacks-core

The Stacks blockchain implementation
https://docs.stacks.co
GNU General Public License v3.0
3.01k stars 668 forks source link

[chainstate] Do not reward orphaning #3657

Open jcnelson opened 1 year ago

jcnelson commented 1 year ago

It has been suggested that some of the block orphaning behavior we are currently seeing is deliberate. A coalition of miners would subsequently orphan blocks off of the chain tip. Because the coalition has the majority of mining power, they do not lose any money by doing this.

If this is indeed what is happening (I have my doubts), then one straightforward but consensus-breaking way to address it could be to not grant a miner a STX coinbase if it mines a sibling. That is, if a Stacks block's block-commit has a sibling block-commit -- a block-commit of the same Stacks height -- then the Stacks block's miner receives only transaction fees. This way, orphaning a block would be more expensive than confirming it.

The downside to doing this is that it would weaponize block-withholding. If the orphaning coalition wanted, it could mine blocks and never broadcast them until its fork is no longer the canonical fork. This way, honest miners are forced to mine siblings. However, since the existence of such an entity is still an open question, the act of withholding blocks and then disclosing them later would conclusively reveal its existence (as well as which nodes are participating in it).

I think we should think more about this. The high-level bit in this issue is that we should figure out a way to discourage orphaning blocks (or alternatively, ensuring that blocks that were mined on the canonical chain tip receive STX on the canonical chain even if they were orphaned later).

igorsyl commented 1 year ago

How would you prioritize this initiative within the context of taking mining off-chain? https://forum.stacks.org/t/rfc-lift-mining-off-of-bitcoin/14705/2

jcnelson commented 1 year ago

I think that if we're going to ship a Stacks 2.2 prior to Nakamoto, then we should address this in some form. Right now, there's no economic consequence to orphaning blocks (besides delaying the orphaner's block rewards), and it appears that some miners deliberately orphan others, leading to longer confirmation times for users and significantly raising the barrier to entry for new miners.


Thinking more about this:

That is, if a Stacks block's block-commit has a sibling block-commit -- a block-commit of the same Stacks height -- then the Stacks block's miner receives only transaction fees

I think it would be better to instead decrease the coinbase as a function of how many prior sibling block-commits got mined. For example, if a miner produces the _N_th sibling of Stacks block S, then their coinbase is reduced by a factor of 2^N. So, if you mine the first sibling, your coinbase gets cut in half. If you mine the second sibling, it's cut down by 75%. Third sibling, 87.5%. And so on.


Thinking more about this:

or alternatively, ensuring that blocks that were mined on the canonical chain tip receive STX on the canonical chain even if they were orphaned later

Short of lifting mining off of Bitcoin altogether, the trick to ensuring that miners get a STX coinbase for producing a Stacks block on what was the canonical tip at the time it was mined is to ensure that all Stacks forks acknowledge that this Stacks block (1) exists and (2) may be orphaned. This is tricky because it's tantamount to forcing the majority coalition to acknowledge an orphaned block's existence. Not sure what the best way to do this is, but throwing it out there so others can think about it as well.

friedger commented 1 year ago

More discussions at https://forum.stacks.org/t/orphan-mev/14806