Given a channel that exist between Alice and Bob, where Alice wants to transfer 0.0001 BTC to Bob. Alice makes HTLC payment to Bob contingent to the secret for the payment hash within a timelock of say 100 blocks. So now 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 output: HTLC success and HTLC timeout. So she bears the transaction fee of the commitment transaction. Now Bob can immediately spend the HTLC success transaction by using the preimage of the payment hash and his signature. Now Bob in order to guarantee that his HTLC success transaction is prioritized, increases the transaction fee of HTLC success transaction (using Replace-by-fee). So is that Bob has to bear the cost of the increased transaction fee in order to spend his output?
- The fee for the HTLC is covered by whoever claims the output
- 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:
- 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.
- The commitment tx does not have two outputs
htlc timeout. It has 3 outputs: a) a relative timelocked
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.