Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Lightning in the setting of blockchain hardforks

3 messages, Aug 17 to 21, 2017. Started by Martin Schwarz.

Martin Schwarz, Christian Decker, Rusty Russell

Permalink First message in the Wayback Machine

Martin Schwarz permalink original

Dear all,

currently the chain_id allows to distinguish blockchains by the hash of their genesis block.

With hardforks branching off of the Bitcoin blockchain, how can Lightning work on (or across) distinct, permanent forks of a parent blockchain that share the same genesis block?

I suppose changing the definition of chain_id to the hash of the first block of the new branch and requiring replay and wipe-out protection should be sufficient. But can we relax these requirements? Are slow block times an issue? Can we use Lightning to transact on "almost frozen" block chains suffering from a sudden loss of hashpower?

Has there been any previous discussion or study of Lightning in the setting of hardforks? (Is this the right place to discuss this? If not, where would be the right place?)

thanks, Martin

Christian Decker in reply to Martin Schwarz permalink original

Hi Martin,

this is the perfect venue to discuss this, welcome to the mailing list :-) Like you I think that using the first forked block as the forkchain's genesis block is the way to go, keeping the non-forked blockchain on the original genesis hash, to avoid disruption. It may become more difficult in the case one chain doesn't declare itself to be the forked chain.

Even more interesting are channels that are open during the fork. In these cases we open a single channel, and will have to settle two. If no replay protection was implemented on the fork, then we can use the last commitment to close the channel (updates should be avoided since they now double any intended effect), if replay protection was implemented then commitments become invalid on the fork, and people will lose money.

Fun times ahead :-)

Cheers, Christian

On Thu, Aug 17, 2017 at 10:53 AM Martin Schwarz <martin.schwarz at gmail.com> wrote:

Quoted text (30 lines)
> Dear all,
>
> currently the chain_id allows to distinguish blockchains by the hash of
> their genesis block.
>
> With hardforks branching off of the Bitcoin blockchain, how can Lightning
> work on (or across)
> distinct, permanent forks of a parent blockchain that share the same
> genesis block?
>
> I suppose changing the definition of chain_id to the hash of the first
> block of the new
> branch and requiring replay and wipe-out protection should be sufficient.
> But can we
> relax these requirements? Are slow block times an issue? Can we use
> Lightning to transact
> on "almost frozen" block chains suffering from a sudden loss of hashpower?
>
> Has there been any previous discussion or study of Lightning in the
> setting of hardforks?
> (Is this the right place to discuss this? If not, where would be the right
> place?)
>
> thanks,
> Martin
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
Rusty Russell in reply to Christian Decker permalink original

Christian Decker <decker.christian at gmail.com> writes:

Quoted text (14 lines)
> Hi Martin,
>
> this is the perfect venue to discuss this, welcome to the mailing list :-)
> Like you I think that using the first forked block as the forkchain's
> genesis block is the way to go, keeping the non-forked blockchain on the
> original genesis hash, to avoid disruption. It may become more difficult in
> the case one chain doesn't declare itself to be the forked chain.
>
> Even more interesting are channels that are open during the fork. In these
> cases we open a single channel, and will have to settle two. If no replay
> protection was implemented on the fork, then we can use the last commitment
> to close the channel (updates should be avoided since they now double any
> intended effect), if replay protection was implemented then commitments
> become invalid on the fork, and people will lose money.

I don't think 2x will have 2-way replay protection; if it gets anything it will be opt-in.

But yes, closing the channel on the fork is the Right Thing. There's been discussion of a standalone "salvage" utility, which you'd supply all the keys and information you have and a connection to a full node, and it would try to get your money back. Ideally, it would work with any of the implementations.

Perhaps this is something to work on? Christian, are you bored? :)

Cheers, Rusty.