tothemoon-org / extension-blocks

Extension blocks soft-fork specification
40 stars 6 forks source link

Deactivation and LN #1

Closed josephpoon closed 7 years ago

josephpoon commented 7 years ago

Added stuff on clean soft-forkable deactivation and reducing the attack surface of systemic attacks on LN (the purpose isn't to solve it 100, but it significantly reduces systemic attacks without significant miner coordination/finney-attacks).

josephpoon commented 7 years ago

Note that a lot of the wording is messy, and definitely change it around/edit/cleanup wherever possible.

The big delay was figuring out how to make deactivation soft-forkable. Using the same pool of funds represented in the main-chain for both the new and old (and accounting for it separately by the nodes) is in retrospect the obvious optimal answer.

TODO: Specify that the funds can be redeemed on the main chain any way after 4 years to ensure that it's a soft-fork (too tired to figure out how to word it carefully). If there's pushback, it's possible to make it only allow redemption on the main-chain which prevents the issue with "anyonecanspend" outputs after 4 years if new consensus rules (along with the new extension block) don't end up happening. Not sure which is better, might just push for the anyonecanspend-after-4-years and then walk back from it to main-chain only if people complain?...

josephpoon commented 7 years ago

The other thing I forgot to add (this is a mental note for myself to add it later) is that for the LN stuff, in the data structure it needs to add a blockheight field to the UTXO if it doesn't have it already (and possibly a bool indicating that this it is an unspent output which has the 30th bit set if the blockheight being populated isn't sufficient). Rename second highest to just 30th bit.

Will cleanup and make corrections upon confirmation that the general idea looks good...

josephpoon commented 7 years ago

Actually, I just came up with a super cute solution.

After 4 years:

  1. the transaction can be redeemed on-chain via normal exit plus the addition of merkle proofs (but no further txes in the deactivated extension block).
  2. if a specific designated bit via BIP9 activation occurs after 4 years, then the outputs automatically become anyonecanspend! This works because then any future rules become a soft-fork ^_^ before the activation, they can only redeem via point 1 above. this allows for reversing/removing a soft-fork constraint to be replaced by another via overloading that bit with further activation rules in later versions.

Cute, huh?

chjj commented 7 years ago

The other thing I forgot to add (this is a mental note for myself to add it later) is that for the LN stuff, in the data structure it needs to add a blockheight field to the UTXO if it doesn't have it already (and possibly a bool indicating that this it is an unspent output which has the 30th bit set if the blockheight being populated isn't sufficient). Rename second highest to just 30th bit.

I'm pretty sure bcoin, btcd, and bitcoin core currently store both the height and version on the utxos. So no problem there.

chjj commented 7 years ago

Merging this. Can clean up later.