Force close of channel with unresolved htlc [combined summary]



Individual post summaries: Click here to read the original discussion on the lightning-dev mailing list

Published on: 2020-05-05T18:40:46+00:00


Summary:

In the given context, the conversation between Subhra and Rene Pickhardt revolves around a scenario involving the force closure of a channel in the Lightning Network protocol. The scenario assumes that parties A and B have established a channel with different token balances. A offers an HTLC (Hashed Time Lock Contract) of 2 tokens to B, which B accepts. In this case, both parties have negotiated the HTLC output in their most recent commitment transaction.However, if A becomes unresponsive and B needs to force close the channel, a commitment transaction with three Unspent Transaction Outputs (UTXOs) will be broadcasted to the blockchain. These UTXOs include one spendable by A with 2 tokens, another spendable by B with 6 tokens, and the received HTLC output with 2 tokens.To spend the HTLC output, there are two conditions depending on the timing. Before the timelock of the HTLC expires, B can spend the output if B knows the to_local HTLC secret and the preimage associated with it. On the other hand, after the timelock has passed, A can spend the output if A knows the to_remote HTLC secret.The mechanism of HTLCs can be further studied in BOLT 2, which is a specification document for the Lightning Network protocol. Additionally, detailed information about the scripts involved in the Lightning Network can be found in BOLT 3. It's worth noting that a less technical summary, focused on explaining these concepts, is currently being developed in the routing chapter of the book "Mastering the Lightning Network. "Based on this information, it is clear that the user's query pertains to the possibility of force closing a channel even when there is no way to resolve the HTLC. However, in such cases, where an HTLC remains unresolved due to the lack of a witness, it is not advisable for B to force close the channel. This is because the funds involved in the HTLC will remain locked until the timeout period expires, resulting in a loss of funds.Therefore, it is recommended that parties seek to resolve any outstanding HTLCs before proceeding with the closure of a channel in the Lightning Network protocol.


Updated on: 2023-07-31T22:55:31.742137+00:00