<div dir="ltr"><div>Dear Subhra, <br></div><div><br></div><div>as discussed bilaterally and after clarification of your question the situation is as follows:<br></div><div><br></div><div>Let us assume A and B have a channel in which A has 4 tokens and B has 6 tokens</div><div><br></div><div>Now A offers an HTLC with the amount of 2 tokens and B accepts (receives) the offer then A and B both have negotiated the HTLC output in the most recent commitment transaction. <br></div><div><br></div><div>If A stops responding and B has to force close the channel a commitment transaction with 3 UTXOs will hit the chain. One UTXO with 2 tokens spendable by A, another one with 6 tokens spendable by B and the received HTLC output with 2 tokens. This one can be spend by two different conditions as in the offchain protocol<br></div><div><br></div><div>1.) Before the timelock of the HTLC has passed B can spend the output if B knows his to_local HTLC secret AND the preimage. OR</div><div>2.) after the timelock A can spend the output if A knows the to_remote HTLC secret. <br></div><div><br></div><div>the mechanism with HTLCs can be read upon in BOLT 2 (channel operation <a href="https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md">https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md</a>) and the scripts can be seen in BOLT 3: <a href="https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md">https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md</a></div><div><br></div><div>A less technical summary that is more focused on explaining the concepts is currently being developed in the routing chapter of mastering the lightning network: <a href="https://github.com/lnbook/lnbook/blob/43ce57298b4da345286ae3b53c42ea3eb9d9b056/routing.asciidoc">https://github.com/lnbook/lnbook/blob/43ce57298b4da345286ae3b53c42ea3eb9d9b056/routing.asciidoc</a></div><div><br></div><div>With kind regards Rene Pickhardt<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 5, 2020 at 8:06 PM Subhra Mazumdar <<a href="mailto:subhra.mazumdar1993@gmail.com">subhra.mazumdar1993@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hi,<div dir="auto">     I am having a doubt regarding force closure of channel. Suppose A->B there is an htlc which has been established for transfering fund. Now suppose for some unfortunate reason B doesnt have the witness to resolve htlc and the mean time A suffers crash fault. Then can B close the channel given that it has no way out of resolving the htlc due to lack of witness?</div></div>
_______________________________________________<br>
Lightning-dev mailing list<br>
<a href="mailto:Lightning-dev@lists.linuxfoundation.org" target="_blank">Lightning-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><a href="https://www.rene-pickhardt.de" target="_blank">https://www.rene-pickhardt.de</a></div><div><br></div><div>Skype: rene.pickhardt <br></div><div><br></div><div>mobile: +49 (0)176 5762 3618   </div></div></div></div></div></div></div>