1

How would you transmit a commitment transaction from a lightning network channel instead of closing the channel? I am working on implementing a watchtower and I first need to simulate a double spend attempt. When I close a channel with $ lncli closechannel, both nodes have the bitcoin available and neither has to wait for the time lock. Is there a command to get the node to submit a unilateral close commitment transaction where one of them has to wait for the time lock?

1

Generally it is preferable to collaboratively close a channel as it is faster for both sides and saves onchain fees and space. As far as I know implementations do not provide an api to the close command by which you can enforce a certain type of close. In order to achieve what you want you have 2 options:

  1. You Patch your lightning node to provide that api yourself
  2. You run two lightning nodes with a channel between them. Then you turn off one node and run the close command on the other. As the first node is not peered the nodes can't close collaboratively so there will happen a force close.
0

LND has an option to close a channel unilaterally as following command,

$lncli closechannel --force funding_txid output_index

I have transmitted a commitment transaction to answer this question. It might be another useful resource of your work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.