11 votes
Accepted

Closing a channel in Lightning Network

The first three scenarios are indeed possible, the last one is identical to the second. This is called a collaborative close. It has the advantage of using a lower on-chain fee since the transactions ...
user avatar
  • 8,814
6 votes
Accepted

In a Lightning Network who commits to the blockchain the final transaction?

So let's imagine a Lightning Network made up of thousand of nodes. Transactions are routed until the moment comes where all the channels need to be closed and commited I presume. Which node actually ...
user avatar
  • 62.4k
6 votes

Can a channel be closed while the funding tx is still stuck in the mempool?

I started out writing this answer while trying to do it myself, but then found out that we don't yet have tools to manually edit partially signed Bitcoin transactions (PSBTs) which is the very last ...
user avatar
  • 8,814
5 votes
Accepted

Can a channel be closed while the funding tx is still stuck in the mempool?

Technically you can double spend the output that was used for the funding TX with a higher fee. Then the channel will never be opened. Practically I don't think any of the lightning network ...
user avatar
5 votes
Accepted

Would it be possible for miners to discriminate Lightning Network transactions?

The most distinguishing feature of a LN channel-opening transaction would be an OP_OR in the scriptPubKey of the channel-funding UTXO, where one side of the OP_OR requires two signatures, and the ...
user avatar
  • 8,734
4 votes
Accepted

Lightning close-channel transaction example?

The actual script implemented on Lightning Network is a little bit different from what you quoted. This is the script below and the specification is here OP_IF # Penalty transaction <...
user avatar
  • 585
4 votes

Can funds from a LN channel be recovered if both participants suffer data loss?

I don't know exactly how static channel backups are implemented in lnd and what is being saved there but I can give you some general thoughts and at least a partial answer. If A and B both lost ...
user avatar
4 votes

Does LN require an on-chain "emergency lane" to mitigate systemic risks?

As far as I understand this is not needed. Let us assume we have an congested mempool and someone publishes an old channel state. This transaction will not be mined directly as the mempool is ...
user avatar
3 votes
Accepted

Does eltoo require trusting watchtowers not to close channels?

I was intrigued by your question and tried to figure out whether any trustless solutions have been proposed. I found a [Lightning-dev] mailing list thread positing a rough idea by ZmnSCPxj. Z-man ...
user avatar
  • 64.6k
3 votes

Lightning - Question about force-closures of channels and its impact on recovering funds

Sorry René, it seems you fell into a Bcasher trap here ;) OP phrased his question very vaguely and then proceeded to cry CENSORSHIP when you admitted there might be some truth contained in what he ...
user avatar
3 votes
Accepted

Why is my LND node closing channels?

Many! If you look at the BOLTs ( lightning RFC) you will find many situations in which nodes must fail a channel (meaning a force close) if something happens in an unexpected way while communicating ...
user avatar
3 votes
Accepted

For how long has a channel been inactive?

You can look for "last_update" field in getchaninfo output. Below I also submitted https://github.com/edouardparis/lntop console screenshot which does the same thing.
user avatar
3 votes
Accepted

Distinguishing Lightning channels on-chain

A lightning funding transaction is a P2WSH transaction, which appears on chain as paying to some random-looking script hash, but the redeemScript which can unlock and spend the money is not revealed ...
user avatar
  • 3,239
2 votes

Lightning incentive for micro-cheating?

When the total capacity of the channel is less than it costs to close the channel, neither party has an incentive to close the channel. If broadcasting an outdated commitment transaction returns some ...
user avatar
  • 64.6k
2 votes

How do Lightning channels interact with the blockchain?

Does opening a channel mean that a 2-to-2 multisig address (3xxxx) is created? Yes. But it's not always a 3... address. Such addresses must be segwit, and there are two types: nested (3... address) ...
user avatar
  • 62.4k
2 votes

How is a doublespend prevented in the Lightning Network?

Alice and Bob open a channel with a fixed balance equal to the amount in the multi-sig address. The channel opens with a balance sheet which includes proof for both Alice and Bob’s balance. Every ...
user avatar
2 votes

How is a doublespend prevented in the Lightning Network?

Based on your comments, I think one fundamental issue you're missing is that to pay with LN, the other party has to be online at the time. There's no question of "what happens if Bob is offline" ...
user avatar
2 votes

How is a doublespend prevented in the Lightning Network?

Doublespends are not possible, because a payment on LN is only considered finalized once both payment channel owners have revoked the previous state of the payment channel by handing their partner a ...
user avatar
  • 64.6k
2 votes

When running a Lightning Network hub, who pays the fees when a transaction has to be broadcast to the blockchain?

It's possible that a node in the middle either either intentionally or unintentionally does not pay the next node down the line. The recourse is for the node that did not get paid to broadcast the ...
user avatar
  • 64.6k
2 votes
Accepted

How can a closing transaction in LN have more than 2 outputs?

There are 3 ways to close a channel. The good way: mutual close The bad way: force close The ugly way: revoked close with penalty transaction In the good case the closing tx should have 2 outputs as ...
user avatar
2 votes
Accepted

How and When are lightning channels disabled?

This is a tricky question as it tackles the difference between what the protocol supports and what implementations provider as an API. On a protocol level channels are enabled / disabled via an ...
user avatar
2 votes

Can a channel be closed while the funding tx is still stuck in the mempool?

Cannot close a channel which has not been opened yet, but you can either bump the fee of the transaction by CPFP or cancel by double spending the unconfirmed input. Notes when using LND: Do not leave ...
user avatar
  • 71
1 vote

What is the exact size and weight of a 2-of-2 P2WSH input?

TL;DR: A 2-of-2 P2WSH input should be conservatively estimated with 96 vbytes. Standard 2-of-2 P2WSH inputs generally weigh 95.5, 95.75 or 96.0 vbytes, depending on whether the r-values in the ...
user avatar
  • 64.6k
1 vote
Accepted

How to migrate Lightning (LND) from local laptop to external myNodeBTC node

This sounds like the age old proverb of "Good, Cheap or Fast - Pick Two" I like your original suggestion, but you do have options: Close all channels, wait an hour, then restore the new lnd node w/ ...
user avatar
  • 161
1 vote
Accepted

How do I prevent lnd from participating in new channels?

You can set the option --maxpendingchannels=0 to disallow peers to open channels to your node.
user avatar
  • 218
1 vote

Can funds from a LN channel be recovered if both participants suffer data loss?

Short answer: No. If both nodes lost their channel state, then the balance of the channel is lost Static-channel-backups (SCBs) do not store any information on the state of the channel, instead they ...
user avatar
  • 1,379
1 vote

How to transmit fraudulent commitment transaction on lightning channel?

As far as I know the lightning clients that I know of (LND, c-lightning) do not offer this possibility through their API. So you'd be right to patch the code yourself. For LND, you should have a look ...
user avatar
  • 275
1 vote

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

You can "loop out" using loop by lightning labs. It allows you to convert offchain funds into onchain funds by doing a reverse submarine swap. You can check the fees beforehand and specify which ...
user avatar
1 vote

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

This will get easier in the future as exchanges will be implementing deposits and withdrawals via LN. At this time, if you need to deposit BTC and the exchange does not support LN deposits, I'm ...
user avatar
  • 156
1 vote

How is the recipient address for closing a Lightning Channel derived?

I will only give the answer for a mutual close. The situation for unilateral (forced) channel close should be similar only that you have too look in the commitment transactions and that you have to ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible