how to transmit commitment transaction (unilateral close) from lightning network channel

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 lmcli 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?

Lightning: Why would Bitcoin Network Accept a Breach Remedy?

The Lightning Network Whitepaper discusses a situation in which one party of a payment channel broadcasts an outdated commitment transaction. The other party through a breach remedy transaction will get the cheating party’s coins.

How does this work though? If the dishonest party broadcasts a transaction to the Bitcoin network, isn’t that transaction more likely to be accepted (since it was first) than a subsequent (up to date and legit) transaction?

Why do lightning invoices expire?

I’m considering the development of a lightning app, and I’m trying to make it non custodial.

I was thinking on pre-generating invoices for all users every x time to make things simpler. To do that I’d need to extend the expiry date.

I tried to look up why do lightning invoices expire, and I couldn’t find a clear answer.

Why do lightning invoices have an expiry date?

Is it to ensure that they are not kept forever in the receivers DB? or is there another reason?

Hosting lightning node and non-custodial

In Bitcoin we can have a light wallet where we are connected to a full node, by doing this, we have to trust that the full node is feeding correct information, but at least we can store our keys in the light wallet itself.

I’ve been looking around for a similar solution in lightning and the closest I found are some lightning wallets which host a node in their clouds and an app which controls the node.

Unlike layer 1, keys are not needed in order to perform transactions, which means that you are not only trusting the information the node is providing, also they could perform transactions without your knowledge.

Am I missing something here? Why are those wallets called non-custodial?

I know you can run a full lightning node on you phone like acinq does, but a safe cloud-based solution would lower the barrier of entry for some users

How can “Lightning Loop Out” help me to receive more payments?

In his blogpost, Alex Bosworth describes that “emptying of the channel allows them to receive more payment” (https://blog.lightning.engineering/posts/2019/03/20/loop.html). But how can I allow more inbound payments by withdrawing funds from an active channel? From my understanding, the only way to get inbound capacity is a connected node that provides funds on its side of the channel?

How to “cash out” of the Lightning Network without closing channels?

I am working on an ecommerce site that accepts lightning payments and was curious about how to “cash out” to pay vendors without closing channels to customers. I was planning to run two LN LND nodes and have two channels between them. One node for personal use highly connected and one running on BTCPay Server. Since not all my vendors accept bitcoin, I was working through the best way to be able to “cash out” my bitcoin to fiat (by closing one of my channels between my personal node and my BTCPay Server business node) to pay my vendors while still having an open channel to the world through which individuals who did not have an open channel with me could route payment. Rather than having my store (BTCPay Server business node) close channels to customers to “cash out” to pay vendors, I thought I would send LN payments from my store node to my personal node and close one of the two channels between my store node and my personal node. My thoughts may be convoluted and unnecessary and I would welcome any suggestions.

Lightning scheduler module sets scheduling date back to 1970 if form validation fails

I’m using Lightning module and Lightning scheduler submodule. Every time the form validation fails, the scheduled time changes to 1970s eg January 1, 1970 at 1:00. After debugging in the validation hook, I found that the code below:

$  input = $  form_state->getUserInput();  $  scheduled_transitions = json_decode($  input['moderation_state'][0]['scheduled_transitions']['data']); var_dump($  scheduled_transitions) 

Returns:

[{"when":1553514473.895,"state":"published"}]

The when is defined as a float number that causes the 1970 issue. I tried to set another value (round the initial value) by using $ form_state->setUserInput() but didn’t work.

Any ideas how I could fix that problem?

Thanks in advance!

Lightning node on a Bitcoin SPV

is there a way to run a Lightning node on a Bitcoin SPV node at the moment? I’ve read that both lnd and c-lightning need a Bitcoin Fullnode at this time. This might seem ignorant but i don’t want to go through the hassle of syncing the whole chain for a small test setup right now. The Bitcoin Lightning Wallet for Android for example claims to run on a Bitcoin SPV so there has to be a way.

Thanks, any help is appreciated.

How to backup seed in lightning and give your channel to watchtower

this is followup on question #85475:

I have learned in previous question that there is an automatic refund mechanism in case of force closure of a channel, except for some very rare circumstances. I would like to ask about two of those circumstances: ,

1-how to “back up your channel state” or how to back up your seed in lightning? (is “channel state” here a synonym for “seed”?)

And why do people say the “seed” works differently in lightning compared to btc – differently how? ,

2-how can you “give your channel to a watchtower” ? IN practical terms, if you use a current lightning wallet

thanks