[Lightning-dev] Probing final receiver with refund timeout

Rusty Russell rusty at rustcorp.com.au
Tue Mar 22 01:14:15 UTC 2016


Mats Jerratsch <mats at blockchain.com> writes:
>> OK, let me get the proposal straight:
>> 
>> 1.  Each node will publish its MIN_TIMEOUT (along
>>    with its other info as per Option 2 in
>>    http://lists.linuxfoundation.org/pipermail/lightning-dev/2015-October/000262.html )
>> 
>> 2.  The payer sums the MIN_TIMEOUT to the payee, adds some random value
>>    (keeping it under the max value allowed by protocol) to give the
>>    initial HTLC timeout.
>> 
>> 3.  The payer puts the 'expected_timeout' in each layer of the onion, by
>>    subtracting the last hops' MIN_TIMEOUT from the initial timeout.
>> 
>> eg.  Say maximum allowed timeout is 20 * 12 hours, and route is:
>> 
>>        A (12 hours) -> B (6 hours) -> C (6 hours) -> D (4 hours)
>> 
>>     Initial timeout has to be at least 12 + 6 + 6 + 4 == 28 hours, plus
>>     some padding for transmission delays, say 29 hours.
>
> I take a multiply of the MIN_TIMEOUT, a factor around 2, but yes, that sounds about right
>
>> 
>>     It picks a random timeout between 29 and 240 hours, say now+100 hours,
>>     and onion looks like:
>> 
>>     [ A: now+100 [ B: now+88 [ C: now+82 [ D: now+76 ] ] ] ]
>
> I would not use the MIN_TIMEOUT here, but use it as the minimum time I deduct each hop and add some randomness into it.
> It also means that you need two values in the onion object:
>
> (1) the value you expect to receive
> (2) the value you should use for the next hop (and therefore the (1) value of the next hop))
>
> So somewhere along this:
>     [ A: now+100;now+80 [ B: now+80;now+65 [ C: now+65;now+54 [ D: now+54;now+40 ] ] ] ]
> which can obviously be saved in a less redundant way

OK, does that randomness add anything useful?  Maybe I need another
coffee to see it?

Thanks,
Rusty.


More information about the Lightning-dev mailing list