<p>TL;DR answer:</p>
<ol>
<li>The fee for the HTLC is covered by whoever claims the output</li>
<li>The fee for the commitment transaction are always covered by the party who opened the channel</li>
</ol>
<p>Sorry to say that but I believe there are many things wrongly stated in your question:</p>
<ol>
<li>The fee for the commitment transaction is not necessarily paid by Alice even if she force closes the channel. The fee is always covered by the person who opened the channel. This is independent of who closes it and what type of close we have.</li>
<li>The commitment tx does not have two outputs <code>htlc success</code> and <code>htlc timeout</code>. It has 3 outputs: a) a relative timelocked <code>to_local</code>, b) <code>to_remote</code>, and  c) the HTLC output which has two conditions to be spent: one is the HTLC success and the other one is HTLC timeout transaction. (There could be more than one HTLC output in the commitment transaction if there are several HTLCs in flight.)</li>
</ol>
<p>The fee for claiming the HTLC output must necessarily be paid by the person who claims the output, since the funds go to them and noone else. (Of course the Lightning Network spec could have decided that they could have been taken from the commitment tx but I think this would have been a weird and unclean solution.) So yes, in your case it is paid by Bob.</p>
<p>Note that the HTLC output is again a multisig address to enable the second stage HTLC process. AFAIK this is necessary to decouple the relative timelocks of the commitment transaction from the absolute timelocks of the HTLCs. That being said as far as I understand the situation Bob isn't able to <code>replace by fee</code> the HTLC success transaction without getting signatures from Alice. (Note that in <code>commitment signed</code> message there is one signature for the commitment transaction to spend the funding transaction and then a list of signatures for each HTLC as the HTLC are in multisig addresses (this is also necessary to allow the penalty transaction in case of broadcasting an old state). Thus without Alice's help, Bob cannot create a new HTLC success transaction. In the case of a force close, we assume there is no help.</p>

CC BY-SA 4.0
2020-06-17T06:06:43.377Z
2022-12-09T18:32:03.650Z
2022-12-09T18:32:03.650Z
Rene Pickhardt
<p>Given a channel that exists between Alice and Bob, where Alice wants to transfer 0.0001 BTC to Bob, Alice makes an HTLC payment to Bob contingent on the secret for the payment hash within a timelock of say 100 blocks.</p>
<p>Alice and Bob will each have a copy of the commitment transaction.</p>
<p>Suppose Alice decides to close the channel at the 50th block height by broadcasting her copy of commitment transaction which has two outputs: <code>HTLC success</code> and <code>HTLC timeout</code>. She bears the transaction fee of the commitment transaction. As a result, Bob can immediately spend the <code>HTLC success</code> transaction by using the preimage of the payment hash and his signature. In order to guarantee his <code>HTLC success</code> transaction is prioritized, Bob increases the transaction fee of the <code>HTLC success</code> transaction (using Replace-by-Fee).</p>
<p>So does Bob have to bear the cost of the increased transaction fee in order to spend his output?</p>

<transaction-fees><lightning-network><lightning-network-daemon><replace-by-fee><hash-time-locked-contract>
Who bears the transaction fee for settling HTLC in Lightning Network?
Subhra Mazumdar
# Who bears the transaction fee for settling HTLC in Lightning Network?

(Asked by: username_0 on 2020-06-17)

Given a channel that exists between Alice and Bob, where Alice wants to transfer 0.0001 BTC to Bob, Alice makes an HTLC payment to Bob contingent on the secret for the payment hash within a timelock of say 100 blocks.

Alice and Bob will each have a copy of the commitment transaction.

Suppose Alice decides to close the channel at the 50th block height by broadcasting her copy of commitment transaction which has two outputs: `HTLC success` and `HTLC timeout`. She bears the transaction fee of the commitment transaction. As a result, Bob can immediately spend the `HTLC success` transaction by using the preimage of the payment hash and his signature. In order to guarantee his `HTLC success` transaction is prioritized, Bob increases the transaction fee of the `HTLC success` transaction (using Replace-by-Fee).

So does Bob have to bear the cost of the increased transaction fee in order to spend his output?

**Tags:** transaction-fees, lightning-network, lightning-network-daemon, replace-by-fee, hash-time-locked-contract


---

## 1 answers

### Answer by username_1 on 2020-06-17. Score: 4 | Accepted answer

TL;DR answer:

1. The fee for the HTLC is covered by whoever claims the output
2. The fee for the commitment transaction are always covered by the party who opened the channel

Sorry to say that but I believe there are many things wrongly stated in your question:

1. The fee for the commitment transaction is not necessarily paid by Alice even if she force closes the channel. The fee is always covered by the person who opened the channel. This is independent of who closes it and what type of close we have.
2. The commitment tx does not have two outputs `htlc success` and `htlc timeout`. It has 3 outputs: a) a relative timelocked `to_local`, b) `to_remote`, and c) the HTLC output which has two conditions to be spent: one is the HTLC success and the other one is HTLC timeout transaction. (There could be more than one HTLC output in the commitment transaction if there are several HTLCs in flight.)

The fee for claiming the HTLC output must necessarily be paid by the person who claims the output, since the funds go to them and noone else. (Of course the Lightning Network spec could have decided that they could have been taken from the commitment tx but I think this would have been a weird and unclean solution.) So yes, in your case it is paid by Bob.

Note that the HTLC output is again a multisig address to enable the second stage HTLC process. AFAIK this is necessary to decouple the relative timelocks of the commitment transaction from the absolute timelocks of the HTLCs. That being said as far as I understand the situation Bob isn't able to `replace by fee` the HTLC success transaction without getting signatures from Alice. (Note that in `commitment signed` message there is one signature for the commitment transaction to spend the funding transaction and then a list of signatures for each HTLC as the HTLC are in multisig addresses (this is also necessary to allow the penalty transaction in case of broadcasting an old state). Thus without Alice's help, Bob cannot create a new HTLC success transaction. In the case of a force close, we assume there is no help.


---

