Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Receiving via unpublished channels

10 messages, Apr 26 to May 15, 2018. Started by ZmnSCPxj.

Hiroshi Ueno (5), ZmnSCPxj (4), Olaoluwa Osuntokun

Permalink First message in the Wayback Machine

ZmnSCPxj permalink original

Good morning list,

While implementing support for `r` field in invoices, I stumbled upon some issues regarding *creating* invoices with `r` fields.

In order to receive via an unpublished channel, we need to know what onLightning fees the other side of that channel wants to charge. We cannot use our own onLightning fees because our fees apply if we were forwarding to the other side.

However, in case of an unpublished channel, we do not send channel_announcement, and in that case we do not send channel_update. So the other side of the channel never informs us of the onLightning fees they want to charge if we would receive funds by this channel.

An idea we want to consider is to simply send `channel_update` as soon as we lock in the channel: https://github.com/ElementsProject/lightning/pull/1330#issuecomment-383931817

I want to ask the other LN implementations (lnd, eclair, ucoin, lit) if we should consider standardizing this behavior (i.e. send `channel_update` after lockin regardless of published/unpublished state). It seems back-compatible: software which does not expect this behavior will simply drop the `channel_update` (as they do not follow a `channel_announcement`).

In any case, what was the intended way to get the onLightning fee rates to put into invoice `r` fields for private routes?

Regards, ZmnSCPxj

Olaoluwa Osuntokun in reply to ZmnSCPxj permalink original

AFAIK, all the other implementations already do this (lnd does at least [1]). As otherwise, it wouldn't be possible to properly utilize routing hints.

Quoted text (1 line)
> I want to ask the other LN implementations (lnd, eclair, ucoin, lit)

As an side, what's "ucoin"? Searched for a bit and didn't find anything notable.

[1]: https://github.com/lightningnetwork/lnd/blob/master/discovery/gossiper.go#L1747

On Thu, Apr 26, 2018 at 4:35 PM ZmnSCPxj via Lightning-dev < lightning-dev at lists.linuxfoundation.org> wrote:

Quoted text (35 lines)
> Good morning list,
>
> While implementing support for `r` field in invoices, I stumbled upon some
> issues regarding *creating* invoices with `r` fields.
>
> In order to receive via an unpublished channel, we need to know what
> onLightning fees the other side of that channel wants to charge.  We cannot
> use our own onLightning fees because our fees apply if we were forwarding
> to the other side.
>
> However, in case of an unpublished channel, we do not send
> channel_announcement, and in that case we do not send channel_update.  So
> the other side of the channel never informs us of the onLightning fees they
> want to charge if we would receive funds by this channel.
>
> An idea we want to consider is to simply send `channel_update` as soon as
> we lock in the channel:
> https://github.com/ElementsProject/lightning/pull/1330#issuecomment-383931817
>
> I want to ask the other LN implementations (lnd, eclair, ucoin, lit) if we
> should consider standardizing this behavior (i.e. send `channel_update`
> after lockin  regardless of published/unpublished state).  It seems
> back-compatible: software which does not expect this behavior will simply
> drop the `channel_update` (as they do not follow a `channel_announcement`).
>
> In any case, what was the intended way to get the onLightning fee rates to
> put into invoice `r` fields for private routes?
>
> Regards,
> ZmnSCPxj
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
ZmnSCPxj in reply to Olaoluwa Osuntokun permalink original

Good morning Olauluwa

It is Ptarmigan Lightning Network project from Nayuta Ueno/Nayutaco: https://github.com/nayutaco/ptarmigan

Name of daemon is ucoind, CLI is ucoincli.

Regards, ZmnSCPxj

Hiroshi Ueno in reply to ZmnSCPxj permalink original

Hi, ZmnSCPxj.

Quoted text (2 lines)
> I want to ask the other LN implementations (lnd, eclair, ucoin, lit) if we should consider standardizing this behavior (i.e. send `channel_update`
> after lockin  regardless of published/unpublished state).

ucoin/ptarmigan does not support `r` field yet(just decode and discards it).

Regards, nayuta-ueno

(https://github.com/nayutaco/ptarmigan)

On 2018/04/27 8:35, ZmnSCPxj via Lightning-dev wrote:

Quoted text (28 lines)
> Good morning list,
>
> While implementing support for `r` field in invoices, I stumbled upon some issues regarding *creating* invoices with `r` fields.
>
> In order to receive via an unpublished channel, we need to know what onLightning fees the other side of that channel wants to charge.  We cannot use
> our own onLightning fees because our fees apply if we were forwarding to the other side.
>
> However, in case of an unpublished channel, we do not send channel_announcement, and in that case we do not send channel_update.  So the other side of
> the channel never informs us of the onLightning fees they want to charge if we would receive funds by this channel.
>
> An idea we want to consider is to simply send `channel_update` as soon as we lock in the channel:
> https://github.com/ElementsProject/lightning/pull/1330#issuecomment-383931817
>
> I want to ask the other LN implementations (lnd, eclair, ucoin, lit) if we should consider standardizing this behavior (i.e. send `channel_update`
> after lockin  regardless of published/unpublished state).  It seems back-compatible: software which does not expect this behavior will simply drop the
> `channel_update` (as they do not follow a `channel_announcement`).
>
> In any case, what was the intended way to get the onLightning fee rates to put into invoice `r` fields for private routes?
>
> Regards,
> ZmnSCPxj
>
>
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
Hiroshi Ueno in reply to ZmnSCPxj permalink original

Hi, ZmnSCPxj.

Quoted text (2 lines)
 > An idea we want to consider is to simply send `channel_update` as soon as we lock in the channel:
 > https://github.com/ElementsProject/lightning/pull/1330#issuecomment-383931817

Our node(ptarmigan) discard `channel_update` without `channel_announcement`. We want to implement it.

I have some questions.
   * Does `channel_update` send only for `announce_channel == 0`(in` open_channel.channel_flags`) ?
   * Does `channel_update` send every time after `funding_locked` sending(established and reconnection) ?

Regards, nayuta-ueno

On 2018/04/27 8:35, ZmnSCPxj via Lightning-dev wrote:

Quoted text (28 lines)
> Good morning list,
>
> While implementing support for `r` field in invoices, I stumbled upon some issues regarding *creating* invoices with `r` fields.
>
> In order to receive via an unpublished channel, we need to know what onLightning fees the other side of that channel wants to charge.  We cannot use
> our own onLightning fees because our fees apply if we were forwarding to the other side.
>
> However, in case of an unpublished channel, we do not send channel_announcement, and in that case we do not send channel_update.  So the other side of
> the channel never informs us of the onLightning fees they want to charge if we would receive funds by this channel.
>
> An idea we want to consider is to simply send `channel_update` as soon as we lock in the channel:
> https://github.com/ElementsProject/lightning/pull/1330#issuecomment-383931817
>
> I want to ask the other LN implementations (lnd, eclair, ucoin, lit) if we should consider standardizing this behavior (i.e. send `channel_update`
> after lockin  regardless of published/unpublished state).  It seems back-compatible: software which does not expect this behavior will simply drop the
> `channel_update` (as they do not follow a `channel_announcement`).
>
> In any case, what was the intended way to get the onLightning fee rates to put into invoice `r` fields for private routes?
>
> Regards,
> ZmnSCPxj
>
>
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
ZmnSCPxj in reply to Hiroshi Ueno permalink original

Good morning Nayuta-ueno,

Quoted text (3 lines)
> I have some questions.
>
> -   Does `channel_update` send only for `announce_channel == 0`(in`open_channel.channel_flags`) ?

No, C-lightning always send it.

Quoted text (1 line)
> -   Does `channel_update` send every time after `funding_locked` sending(established and reconnection) ?

For C-lightning, the temporary ones are sent after `funding_locked` has been sent by both sides, as well as reconnection (only if both sides have sent `funding_locked`). The only time they are not, is if the channel is shutting down (and so any fee updates would be pointless, as the channel will no longer be useable for forwarding, sending, or receiving) or the channel has already achieved the announcement depth.

After announcement depth, "normal" `channel_update` should get sent after a `channel_announcement`, and not the temporary ones.

Regards, ZmnSCPxj

Quoted text (55 lines)
>
>     Regards,
>
>     nayuta-ueno
>
>     On 2018/04/27 8:35, ZmnSCPxj via Lightning-dev wrote:
>
>
> > Good morning list,
> >
> > While implementing support for `r` field in invoices, I stumbled upon some issues regarding creating invoices with `r` fields.
> >
> > In order to receive via an unpublished channel, we need to know what onLightning fees the other side of that channel wants to charge.  We cannot use
> >
> > our own onLightning fees because our fees apply if we were forwarding to the other side.
> >
> > However, in case of an unpublished channel, we do not send channel_announcement, and in that case we do not send channel_update.  So the other side of
> >
> > the channel never informs us of the onLightning fees they want to charge if we would receive funds by this channel.
> >
> > An idea we want to consider is to simply send `channel_update` as soon as we lock in the channel:
> >
> > https://github.com/ElementsProject/lightning/pull/1330#issuecomment-383931817
> >
> > I want to ask the other LN implementations (lnd, eclair, ucoin, lit) if we should consider standardizing this behavior (i.e. send `channel_update`
> >
> > after lockin  regardless of published/unpublished state).  It seems back-compatible: software which does not expect this behavior will simply drop the
> >
> > `channel_update` (as they do not follow a `channel_announcement`).
> >
> > In any case, what was the intended way to get the onLightning fee rates to put into invoice `r` fields for private routes?
> >
> > Regards,
> >
> > ZmnSCPxj
> >
> > Lightning-dev mailing list
> >
> > Lightning-dev at lists.linuxfoundation.org
> >
> > https://www.learnbitcoin.com/archive/lists/lightning-dev
>
> --
>
> //株式会社Nayuta
>
> // 上野 寛(Hiroshi Ueno)
>
> // email: ueno at nayuta.co
>
> Lightning-dev mailing list
>
> Lightning-dev at lists.linuxfoundation.org
>
> https://www.learnbitcoin.com/archive/lists/lightning-dev
Hiroshi Ueno in reply to ZmnSCPxj permalink original

Hi, ZmnSCPxj.

Thank you for your reply and explanation. I will implement it like c-lightning to ptarmigan.

Regards, nayuta-ueno

On 2018/05/09 14:17, ZmnSCPxj wrote:

Quoted text (74 lines)
> Good morning Nayuta-ueno,
>
>> I have some questions.
>>
>> -   Does `channel_update` send only for `announce_channel == 0`(in`open_channel.channel_flags`) ?
>
> No, C-lightning always send it.
>
>> -   Does `channel_update` send every time after `funding_locked` sending(established and reconnection) ?
>
> For C-lightning, the temporary ones are sent after `funding_locked` has been sent by both sides, as well as reconnection (only if both sides have sent `funding_locked`).  The only time they are not, is if the channel is shutting down (and so any fee updates would be pointless, as the channel will no longer be useable for forwarding, sending, or receiving) or the channel has already achieved the announcement depth.
>
> After announcement depth, "normal" `channel_update` should get sent after a `channel_announcement`, and not the temporary ones.
>
> Regards,
> ZmnSCPxj
>
>>
>>      Regards,
>>
>>      nayuta-ueno
>>
>>      On 2018/04/27 8:35, ZmnSCPxj via Lightning-dev wrote:
>>
>>
>>> Good morning list,
>>>
>>> While implementing support for `r` field in invoices, I stumbled upon some issues regarding creating invoices with `r` fields.
>>>
>>> In order to receive via an unpublished channel, we need to know what onLightning fees the other side of that channel wants to charge.  We cannot use
>>>
>>> our own onLightning fees because our fees apply if we were forwarding to the other side.
>>>
>>> However, in case of an unpublished channel, we do not send channel_announcement, and in that case we do not send channel_update.  So the other side of
>>>
>>> the channel never informs us of the onLightning fees they want to charge if we would receive funds by this channel.
>>>
>>> An idea we want to consider is to simply send `channel_update` as soon as we lock in the channel:
>>>
>>> https://github.com/ElementsProject/lightning/pull/1330#issuecomment-383931817
>>>
>>> I want to ask the other LN implementations (lnd, eclair, ucoin, lit) if we should consider standardizing this behavior (i.e. send `channel_update`
>>>
>>> after lockin  regardless of published/unpublished state).  It seems back-compatible: software which does not expect this behavior will simply drop the
>>>
>>> `channel_update` (as they do not follow a `channel_announcement`).
>>>
>>> In any case, what was the intended way to get the onLightning fee rates to put into invoice `r` fields for private routes?
>>>
>>> Regards,
>>>
>>> ZmnSCPxj
>>>
>>> Lightning-dev mailing list
>>>
>>> Lightning-dev at lists.linuxfoundation.org
>>>
>>> https://www.learnbitcoin.com/archive/lists/lightning-dev
>>
>> --
>>
>> //株式会社Nayuta
>>
>> // 上野 寛(Hiroshi Ueno)
>>
>> // email: ueno at nayuta.co
>>
>> Lightning-dev mailing list
>>
>> Lightning-dev at lists.linuxfoundation.org
>>
>> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
>
Hiroshi Ueno in reply to ZmnSCPxj permalink original

Hello ZmnSCPxj,

I'm implementing `r` field now to `ptarmigan`. I have more question.

`r` field doesn't contain signature like `channel_update`. Do c-lightning check something in the `r` field from payee's invoice?

Regards, nayuta-ueno

On 2018/05/09 14:17, ZmnSCPxj wrote:

Quoted text (59 lines)
> Good morning Nayuta-ueno,
>
>> I have some questions.
>>
>> -   Does `channel_update` send only for `announce_channel == 0`(in`open_channel.channel_flags`) ?
>
> No, C-lightning always send it.
>
>> -   Does `channel_update` send every time after `funding_locked` sending(established and reconnection) ?
>
> For C-lightning, the temporary ones are sent after `funding_locked` has been sent by both sides, as well as reconnection (only if both sides have sent `funding_locked`).  The only time they are not, is if the channel is shutting down (and so any fee updates would be pointless, as the channel will no longer be useable for forwarding, sending, or receiving) or the channel has already achieved the announcement depth.
>
> After announcement depth, "normal" `channel_update` should get sent after a `channel_announcement`, and not the temporary ones.
>
> Regards,
> ZmnSCPxj
>
>>
>>      Regards,
>>
>>      nayuta-ueno
>>
>>      On 2018/04/27 8:35, ZmnSCPxj via Lightning-dev wrote:
>>
>>
>>> Good morning list,
>>>
>>> While implementing support for `r` field in invoices, I stumbled upon some issues regarding creating invoices with `r` fields.
>>>
>>> In order to receive via an unpublished channel, we need to know what onLightning fees the other side of that channel wants to charge.  We cannot use
>>>
>>> our own onLightning fees because our fees apply if we were forwarding to the other side.
>>>
>>> However, in case of an unpublished channel, we do not send channel_announcement, and in that case we do not send channel_update.  So the other side of
>>>
>>> the channel never informs us of the onLightning fees they want to charge if we would receive funds by this channel.
>>>
>>> An idea we want to consider is to simply send `channel_update` as soon as we lock in the channel:
>>>
>>> https://github.com/ElementsProject/lightning/pull/1330#issuecomment-383931817
>>>
>>> I want to ask the other LN implementations (lnd, eclair, ucoin, lit) if we should consider standardizing this behavior (i.e. send `channel_update`
>>>
>>> after lockin  regardless of published/unpublished state).  It seems back-compatible: software which does not expect this behavior will simply drop the
>>>
>>> `channel_update` (as they do not follow a `channel_announcement`).
>>>
>>> In any case, what was the intended way to get the onLightning fee rates to put into invoice `r` fields for private routes?
>>>
>>> Regards,
>>>
>>> ZmnSCPxj
>>>
>>> Lightning-dev mailing list
>>>
>>> Lightning-dev at lists.linuxfoundation.org
>>>
>>> https://www.learnbitcoin.com/archive/lists/lightning-dev
>>
ZmnSCPxj in reply to Hiroshi Ueno permalink original

Good morning nayuto-ueno,

Quoted text (4 lines)
> `r` field doesn't contain signature like `channel_update`.
>
> Do c-lightning check something in the `r` field from payee's invoice?
>

No. Invoice has signature for whole invoice. Of course, only payee signature (fee of this channel is fee from the peer of the payee, e.g. hub).

Payee has incentive to give accurate information about the channel. Otherwise payment may fail if the channel fees or CLTV-delta, is not same as wanted by the peer of the payee. So only payee signature should be enough; if payee gives bad information about this channel, payee loses on getting paid.

Regards, ZmnSCPxj

Hiroshi Ueno in reply to ZmnSCPxj permalink original

Hello ZmnSCPxj,

Quoted text (1 line)
 > Payee has incentive to give accurate information about the channel.

I understand. Thank you very much.

Regards, nayuta-ueno

On 2018/05/15 23:23, ZmnSCPxj wrote:

Quoted text (14 lines)
> Good morning nayuto-ueno,
>
>> `r` field doesn't contain signature like `channel_update`.
>>
>> Do c-lightning check something in the `r` field from payee's invoice?
>>
>
> No.  Invoice has signature for whole invoice.  Of course, only payee signature (fee of this channel is fee from the peer of the payee, e.g. hub).
>
> Payee has incentive to give accurate information about the channel.  Otherwise payment may fail if the channel fees or CLTV-delta, is not same as wanted by the peer of the payee.  So only payee signature should be enough; if payee gives bad information about this channel, payee loses on getting paid.
>
> Regards,
> ZmnSCPxj
>