Research/Bitcoin Dev Archive / lightning-dev list
Few questions
3 messages, Feb 9 to 10, 2020. Started by Cezary Dziemian.
Cezary Dziemian (2), René Pickhardt
Good morning, there are few things I'm not completely sure about, so would like to ask in order to prevent misunderstanding in Polish LN community.
1. Is this possible that by sending funds without invoice, the last hub prepares the last HTLC with small amount to the payee? In other words - Can payee detect, that the last HTLC amount is smaller that it should be?
2. Are there additional data added to the end of onion encrypted list of HTLCs in order to prevent last hub to guess, that it is the last hub in the route?
3. When payment is during confirmation, are channels locked entirely, or only for the in flight payment amount? In other words - can single channel process more that single transaction at once?
I would like to kindly pleas to reply in simple words, as my English is still far from being perfect.
Best Regards, Cezary Dziemian
Good Morning Cezary,
you might want to direct questions about understanding the lightning network protocol like yours to https://bitcoin.stackexchanage.com as this mailinglist is more devoted towards driving the development of the protocol. Anyway here are the answers to your questions 2 and 3 and probably also to the first one though I am not entirely sure if I understand exactly what you are asking for. In case I misunderstood you suggest to put follow up questions on stackexchange.
Quoted text (4 lines)
1. Is this possible that by sending funds without invoice, the last hub > prepares the last HTLC with small amount to the payee? In other words - Can > payee detect, that the last HTLC amount is smaller that it should be? >
But in general the payee will only release the preimage for an invoice if the payee is satisfied with the amount - which is usually specified in the invoice. If you talk about keysend then the payee does not expect an amount and will most likely release the preimage as the payee would consider this to be free money
Quoted text (4 lines)
> 2. Are there additional data added to the end of onion encrypted list of > HTLCs in order to prevent last hub to guess, that it is the last hub in the > route? >
yes the onions are always of constant size (20 * 65 Byte = 1300 Byte) This process of padding is well described in the Sphinx paper https://cypherpunks.ca/~iang/pubs/Sphinx_Oakland09.pdf and in BOLT 04 https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md
Quoted text (4 lines)
3. When payment is during confirmation, are channels locked entirely, or > only for the in flight payment amount? In other words - can single channel > process more that single transaction at once? >
HTLCs are additional outputs in the commitment transaction. The protocol allows for up to 483 htlcs concurrently in flight as specified in BOLT 04 (" max_accepted_htlcs is limited to 483 to ensure that, even if both sides send the maximum number of HTLCs, the commitment_signed message will still be under the maximum message size. It also ensures that a single penalty transaction can spend the entire commitment transaction, as calculated in BOLT #5 <https://github.com/lightningnetwork/lightning-rfc/blob/master/05-onchain.md#penalty-transaction-weight-calculation> .")
However the the standard of implementations and recommendation is 30. This means that a single payment is not freezing the channel. It however "locks" the amount of that payment which for the time until settlement cannot be used by either party of the channel for other payments / activities.
with kind regards Rene
Quoted text (12 lines)
> I would like to kindly pleas to reply in simple words, as my English is > still far from being perfect. > > Best Regards, > Cezary Dziemian > > > _______________________________________________ > Lightning-dev mailing list > Lightning-dev at lists.linuxfoundation.org > https://www.learnbitcoin.com/archive/lists/lightning-dev >
Thanks a lot for clarification René.
Sorry for that, next time I will not use dev list to ask such questions, but in "keysend" there are some details would like to discuss.
Do we agree, that because payee doesn't know amount that payer wants to send him, the last hub can just prepare own HTLC for one satoshi? If this is true, I think this is not correct behavior. If payer wants to pay X, payee shouldn't receive less.
Can't payer just send "preimage + amount" encrypted by payee pub key? That way payee can check what amount payer wanted to send him, and should reject if HTLC contains other value.
Best Regards, CD
niedz., 9 lut 2020 o 10:51 René Pickhardt <r.pickhardt at googlemail.com> napisał(a):
Quoted text (76 lines)
> Good Morning Cezary, > > you might want to direct questions about understanding the lightning > network protocol like yours to https://bitcoin.stackexchanage.com as this > mailinglist is more devoted towards driving the development of the > protocol. Anyway here are the answers to your questions 2 and 3 and > probably also to the first one though I am not entirely sure if I > understand exactly what you are asking for. In case I misunderstood you > suggest to put follow up questions on stackexchange. > > 1. Is this possible that by sending funds without invoice, the last hub >> prepares the last HTLC with small amount to the payee? In other words - Can >> payee detect, that the last HTLC amount is smaller that it should be? >> > > But in general the payee will only release the preimage for an invoice if > the payee is satisfied with the amount - which is usually specified in the > invoice. If you talk about keysend then the payee does not expect an amount > and will most likely release the preimage as the payee would consider this > to be free money > > >> 2. Are there additional data added to the end of onion encrypted list of >> HTLCs in order to prevent last hub to guess, that it is the last hub in the >> route? >> > > yes the onions are always of constant size (20 * 65 Byte = 1300 Byte) This > process of padding is well described in the Sphinx paper > https://cypherpunks.ca/~iang/pubs/Sphinx_Oakland09.pdf and in BOLT 04 > https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md > > 3. When payment is during confirmation, are channels locked entirely, or >> only for the in flight payment amount? In other words - can single channel >> process more that single transaction at once? >> > > HTLCs are additional outputs in the commitment transaction. The protocol > allows for up to 483 htlcs concurrently in flight as specified in BOLT 04 (" > max_accepted_htlcs is limited to 483 to ensure that, even if both sides > send the maximum number of HTLCs, the commitment_signed message will > still be under the maximum message size. It also ensures that a single > penalty transaction can spend the entire commitment transaction, as > calculated in BOLT #5 > <https://github.com/lightningnetwork/lightning-rfc/blob/master/05-onchain.md#penalty-transaction-weight-calculation> > .") > > However the the standard of implementations and recommendation is 30. This > means that a single payment is not freezing the channel. It however "locks" > the amount of that payment which for the time until settlement cannot be > used by either party of the channel for other payments / activities. > > with kind regards Rene > > >> I would like to kindly pleas to reply in simple words, as my English is >> still far from being perfect. >> >> Best Regards, >> Cezary Dziemian >> >> >> _______________________________________________ >> Lightning-dev mailing list >> Lightning-dev at lists.linuxfoundation.org >> https://www.learnbitcoin.com/archive/lists/lightning-dev >> > > > -- > https://www.rene-pickhardt.de > > Skype: rene.pickhardt > > mobile: +•• (•)••• •••• •••• >