[Lightning-dev] BOLT #3: Shouldn't timeout be included in the script of "Offered HTLC Outputs" for the local node?

Ugam Kamat ugamkamat1 at gmail.com
Wed Jun 5 16:45:18 UTC 2019


Hey Nadav, that’s a good call as it’s not particularly intuitive when you try to read it. I’ll try to add to it if I can. Thanks!

 

Ugam

 

From: Nadav Kohen <nadav at suredbits.com> 
Sent: Wednesday, June 5, 2019 10:08 PM
To: Ugam Kamat <ugamkamat1 at gmail.com>
Cc: Pierre <pm+lists at acinq.fr>; lightning-dev <lightning-dev at lists.linuxfoundation.org>
Subject: Re: [Lightning-dev] BOLT #3: Shouldn't timeout be included in the script of "Offered HTLC Outputs" for the local node?

 

Hi Ugam,

 

I also ran into an issue understanding this a while back, here's a PR I opened to try and make things more clear: https://github.com/lightningnetwork/lightning-rfc/pull/601

Feel free to add to it or comment if you think things could be improved :)

 

Best,

Nadav

 

On Wed, Jun 5, 2019 at 11:33 AM Ugam Kamat <ugamkamat1 at gmail.com <mailto:ugamkamat1 at gmail.com> > wrote:

Ah, now I see what you mean, it is locked with absolute timelock and hence I cannot broadcast that transaction. My apologies and thanks for the help!

 

Ugam

 

From: Ugam Kamat <ugamkamat1 at gmail.com <mailto:ugamkamat1 at gmail.com> > 
Sent: Wednesday, June 5, 2019 10:00 PM
To: 'Pierre' <pm+lists at acinq.fr <mailto:pm%2Blists at acinq.fr> >
Cc: 'lightning-dev' <lightning-dev at lists.linuxfoundation.org <mailto:lightning-dev at lists.linuxfoundation.org> >
Subject: RE: [Lightning-dev] BOLT #3: Shouldn't timeout be included in the script of "Offered HTLC Outputs" for the local node?

 

Hey Pierre, 

 

That’s what I am having a hard time understanding. Although it is timelocked in the second stage HTLC-timeout, I can still spend the original commitment transaction although after some time. This is what my thought process is:

 

*	Offer the Htlc output and sign the commitment transactions
*	Broadcast the commitment transaction containing the offered HTLC outputs to the main chain. The outputs of commitment tx are: (1) to remote; (2) to local with to_self_delay and (3) to P2WSH (the script I pasted earlier)
*	Commitment transaction gets mined
*	Spend the third output using 0 <remotehtlcsig> <localhtlcsig> 0 in the witness stack which will send the outputs to <local_delayed_pubkey> using to_self_delay

Now I think when you say the HTLC time out transaction is timelocked, you are referring the to the to_self_delay when spending the htlc-timeout. But although there is that timeout, the commitment transaction is already broadcasted, and the P2WSH output is already sent to my public key (although with a delay I can still spend that without my counterparty’s assent). Now, my counterparty on the other hand  when he gets the pre-image, does not have the P2WSH output to claim his bitcoins with the pre-image because it has been already locked with my <local_delayed_pubkey> which I can spend when the to_senf_delay` is over

 

Ugam

 

From: Pierre <pm+lists at acinq.fr <mailto:pm+lists at acinq.fr> > 
Sent: Wednesday, June 5, 2019 9:35 PM
To: Ugam Kamat <ugamkamat1 at gmail.com <mailto:ugamkamat1 at gmail.com> >
Cc: lightning-dev <lightning-dev at lists.linuxfoundation.org <mailto:lightning-dev at lists.linuxfoundation.org> >
Subject: Re: [Lightning-dev] BOLT #3: Shouldn't timeout be included in the script of "Offered HTLC Outputs" for the local node?

 

Hello Ugam,

 

The HTLC-Timeout transaction <https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md#htlc-timeout-and-htlc-success-transactions>  is timelocked (with locktime=cltv_expiry).

 

Cheers,

 

Pierre

 

_______________________________________________
Lightning-dev mailing list
Lightning-dev at lists.linuxfoundation.org <mailto:Lightning-dev at lists.linuxfoundation.org> 
https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190605/6aa78160/attachment-0001.html>


More information about the Lightning-dev mailing list