<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 14 Jul 2020 at 16:42, ZmnSCPxj via bitcoin-dev <<a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Good morning Mr. Lee,<br>
<br>
> Sorry. Re-sending with correction to CC bitcoin-dev<br>
><br>
> I am sorry if this was already brought up in previous threads. If I know<br>
> lightning network correctly then HTLC is used to enforce settlements on<br>
> blockchain if there is a dispute. Could a person lose money if their HTLC<br>
> does not get confirmed in the timeframe or if an older HTLC gets<br>
> confirmed first? I see different ways this could happen.<br>
><br>
> One, if the blockchain is very saturated with other transactions. The<br>
> reason we need lightning network is why it might have troubles with<br>
> settlements?<br>
<br>
This could happen, but the entire exercise is to move transactions off the blockchain, precisely to lower this risk.<br>
<br>
Otherwise, transfers onchain will take a long time.<br>
In practice, a long time to settle a payment will invalidate many real-world economic exchanges anyway (consider paying for food at a restaurant --- if your payments take days to settle, the food has gotten stale before the restaurant receives payment and releases your food).<br>
Thus, if an onchain transfer takes a long time to settle, there is already risk of economic loss present.<br>
<br>
By moving activity offchain, we reduce pressure onchain and improve settlement speeds on both offchain and onchain, reducing risk of economic loss due to delay.<br>
<br>
<br>
> Two, competition from a different conflicting HTLC. A newer<br>
> HTLC might not get confirmed before an older HTL.<br>
<br>
I cannot make sense of this.<br>
<br>
You cannot create conflicting HTLCs.<br></blockquote><div><br></div><div>Correct.  Removing or Creating an HTLC is something that both channel partners need to agree on.  They may create multiple pending HTLCs as long as there are enough funds, but creating conflicting HTLCs is not possible.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">><br>
> I found out about a recent attack technique that sounds like it might be<br>
> similar called "flood and loot".<br>
<br>
Roughly, my understanding of Flood and Loot is to make a lot of uneconomically tiny HTLCs going through a target victim forwarding node.<br>
You make circular routes going from your own node back to yourself.<br>
Then you refuse to actually claim the HTLCs sent back to yourself.<br></blockquote><div><br></div><div>No, the way I understand it is that an attacker, say Malleroy, routes a lot of medium sized HTLC payments from his node to his node via a victim node, say Alice's, and possibly other nodes. </div><div>Then Malleroy *accepts* the payments by publishing the hash on the receiving end, so he gets all the sent funds on his receiving channel.  Malleroy's receiving node behaves completely honestly, and nobody can prove that it belongs to the attacker.</div><div>Finally when Alice claims her HTLC by presenting the hash, Malleroy just ignores the claim.  Now Alice, the victim, is forced to close the channel to prevent the HTLC to timeout. If Malleroy does it with multiple victims at exactly the same time, they will all compete with each other.  The victims cannot increase the fee for the HTLC claiming transaction, because they are the ones who force-closed the channel.  CPFP doesn't work, because their ultimate output is CLTV'd.  As soon as the HTLC timeouts Malleroy can claim the still pending HTLCs using an RBF transaction.</div><div><br></div><div>So it is Alice who has to force close, which puts her at a big disadvantage.</div><div><br></div><div>Malleroy will have to pay the lightning fees, but they are negligible.  The fee for the on-chain force-close transaction (with the HTLC outputs) is paid by whoever opened the channel. AFAIK the fee for the HTLC resolving transactions is paid by whoever claims the HTLC.  In this scenario it is paid from Alice's money.  If Malleroy opened the channel, he risks losing some funds to on-chain fees.  On the other hand the one who pays the fee controls the fee.  He could negotiate a very low fee (say a cent per HTLC), when the network is idle and then wait for a natural congestion before starting the attack, giving him a low risk with high success probability.  Every HTLC he can claim after timeout is profit.</div><div><br></div><div>Regards,</div><div>  Jochen</div><div><br></div></div></div>