MultiversX Tracker is Live!

Unilateral close because of HTLC in remote commitment

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 196 Views

Thanks a lot to Rene Pickhardt, who spent some time with me digging into this.

When my node A sends out an HTLC to my peer B, this is done using the update_add_htlc message defined in Bolt 02. Following this message, my node signs the remote's new commitment transaction (which contains the HTLC) and sends it to B as part of the commitment_signed message.

As soon as node B has access to this signed transaction, it could (in theory) broadcast the transaction including the HTLC output and, using the secret hash, spend the HTLC output.

Note that B may do this at any time, possibly long after the HTLC timeout.

If the outgoing HTLC corresponds to an incoming HTLC (i.e., my node forwarded funds from some other node X towards B), my node needs to fail the outgoing HTLC with absolute certainty before the incoming HTLC times out. If the incoming HTLC times out first, the incoming HTLC fails (and my node doesn't get the incoming funds from X), but the outgoing HTLC may still succeed if node B decides to broadcast the signed transaction (and, thus, my node would give away funds for free, as it won't get the amount back from node X).

In order to avoid this kind of situation, lnd force-closes the channel as described in the question so that the outgoing HTLC fails with absolute certainty, i.e. depriving node B of the chance to claim the HTLC output in the future.

Usually node B acknowledges the signed transaction and sends a signed transaction in return. In the situation described above, however, node B does not respond. The logs show failing link: unable to complete dance with error: remote unresponsive, indicating that node B didn't continue answering as expected.

It might help to check node B's health before sending update_add_htlc and commitment_signed, which apparently isn't something lnd currently does (see https://github.com/lightningnetwork/lnd/issues/6482).

As you can see in the lnd source code, this whole process is very similar to the case where node B also sends a new signed transaction (which contains the HTLC), and then lets the HTLC time out.


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments