<oembed><type>rich</type><version>1.0</version><author_name>npub1g5zswf6y48f7fy90jf3tlcuwdmjn8znhzaa4vkmtxaeskca8hpss23ms3l</author_name><author_url>https://nostr.ae/npub1g5zswf6y48f7fy90jf3tlcuwdmjn8znhzaa4vkmtxaeskca8hpss23ms3l</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2020-10-05&#xA;📝 Original message:&#xA;Good morning Bastien,&#xA;&#xA;&gt; Good morning list,&#xA;&gt;&#xA;&gt; It seems to me that the &#34;funder pays all the commit tx fees&#34; rule exists solely for simplicity&#xA;&gt; (which was totally reasonable). I haven&#39;t been able to find much discussion about this decision&#xA;&gt; on the mailing list nor in the spec commits.&#xA;&#xA;&#xA;This indeed seems to be one of those &#34;unwritten rules&#34;, like the unwritten rule that SCRIPT opcodes can only look at the transaction they are in and cannot look at the block it got confirmed in, or previous blocks.&#xA;&#xA;My rough understanding is that it prevents this kind of griefing attack:&#xA;&#xA;* You have a node with channels balanced just as you like it, very lucrative, earning entire satoshis of routing fees per week.&#xA;* I have a bunch of funds lying around, much larger than your liquidity.&#xA;* I create a temporary throwaway node and have it make a large channel to you about equal to your liquidity.&#xA;* I send out all of the funds on the new large channel, preferably to offchain-to-onchain swaps like Loop or Boltz.&#xA;  * This shrinks the outgoing liquidity you have available on your existing channels, making it difficult for you to route and earn routing fees -- in order to route, you need to have *both* incoming and outgoing liquidity.&#xA;  * If I do not make another channel with my new node, then you cannot rebalance offchain.&#xA;* Since my new large channel is now exhausted, I can delete the throwaway node forever.&#xA;  * The `close_to` feature also allows me to arrange the funds to be closed to a cold-storage funds.&#xA;  * Or I can just keep the necessary keys to recover funds from the unilateral channel close broadcast by you later.&#xA;  * There is a reserve, but that is tiny, and if so I can probably afford to wait --- this is a game of chicken on who closes the channel, and since most of the channel is on your end, you are at a serious disadvantage.&#xA;* You are now forced to unilateral close the channel so you can send it to an onchain-to-offchain swap and reload your channels into the proper balance it had before I attacked you.&#xA;&#xA;If the unilateral close on the channel were paid by you, then that is adding insult to injury.&#xA;Thus, it is better if the unilateral close were paid by me, even if ultimately the unilateral close is performed by you.&#xA;This is &#34;initiator pays&#34; principle.&#xA;&#xA;--&#xA;&#xA;On the other hand, a quick skim of your proposal suggests that it still respects the &#34;initiator pays&#34; principle.&#xA;Basically, the fundee only pays fees for HTLCs they initiated, which is not relevant to the above attack (since in the above attack, my node is a dead end, you will never send out an HTLC through my channel to rebalance).&#xA;So it should still be acceptable.&#xA;&#xA;Regards,&#xA;ZmnSCPxj&#xA;&#xA;&#xA;&gt;&#xA;&gt; At first glance, it&#39;s true that at the beginning of the channel lifetime, the funder should be&#xA;&gt; responsible for the fee (it&#39;s his decision to open a channel after all). But as time goes by and&#xA;&gt; both peers earn value from this channel, this rule becomes questionable. We&#39;ve discovered since&#xA;&gt; then that there is some risk associated with having pending HTLCs (flood-and-loot type of attacks,&#xA;&gt; pinning, channel jamming, etc).&#xA;&gt;&#xA;&gt; I think that *in some cases*, fundees should be paying a portion of the commit-tx on-chain fees,&#xA;&gt; otherwise we may end up with a web-of-trust network where channels would only exist between peers&#xA;&gt; that trust each other, which is quite limiting (I&#39;m hoping we can do better).&#xA;&gt;&#xA;&gt; Routing nodes may be at risk when they *receive* HTLCs. All the attacks that steal funds come from&#xA;&gt; the fact that a routing node has paid downstream but cannot claim the upstream HTLCs (correct me&#xA;&gt; if that&#39;s incorrect). Thus I&#39;d like nodes to pay for the on-chain fees of the HTLCs they offer&#xA;&gt; while they&#39;re pending in the commit-tx, regardless of whether they&#39;re funder or fundee.&#xA;&gt;&#xA;&gt; The simplest way to do this would be to deduce the HTLC cost (172 * feerate) from the offerer&#39;s&#xA;&gt; main output (instead of the funder&#39;s main output, while keeping the base commit tx weight paid&#xA;&gt; by the funder).&#xA;&gt;&#xA;&gt; A more extreme proposal would be to tie the *total* commit-tx fee to the channel usage:&#xA;&gt;&#xA;&gt; * if there are no pending HTLCs, the funder pays all the fee&#xA;&gt; * if there are pending HTLCs, each node pays a proportion of the fee proportional to the number of&#xA;&gt; HTLCs they offered. If Alice offered 1 HTLC and Bob offered 3 HTLCs, Bob pays 75% of the&#xA;&gt; commit-tx fee and Alice pays 25%. When the HTLCs settle, the fee is redistributed.&#xA;&gt;&#xA;&gt; This model uses the on-chain fee as collateral for usage of the channel. If Alice wants to forward&#xA;&gt; HTLCs through this channel (because she has something to gain - routing fees), she should be taking&#xA;&gt; on some of the associated risk, not Bob. Bob will be taking the same risk downstream if he chooses&#xA;&gt; to forward.&#xA;&gt;&#xA;&gt; I believe it also forces the fundee to care about on-chain feerates, which is a healthy incentive.&#xA;&gt; It may create a feedback loop between on-chain feerates and routing fees, which I believe is also&#xA;&gt; a good long-term thing (but it&#39;s hard to predict as there may be negative side-effects as well).&#xA;&gt;&#xA;&gt; What do you all think? Is this a terrible idea? Is it okay-ish, but not worth the additional&#xA;&gt; complexity? Is it an amazing idea worth a lightning nobel? Please don&#39;t take any of my claims&#xA;&gt; for granted and challenge them, there may be negative side-effects I&#39;m completely missing, this is&#xA;&gt; a fragile game of incentives...&#xA;&gt;&#xA;&gt; Side-note: don&#39;t forget to take into account that the fees for HTLC transactions (second-level txs)&#xA;&gt; are always paid by the party that broadcasts them (which makes sense). I still think this is not&#xA;&gt; enough and can even be abused by fundees in some setups.&#xA;&gt;&#xA;&gt; Thanks,&#xA;&gt; Bastien</html></oembed>