6

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 takes care of this? No, that is not how lightning works. All channels are not created and closed at the same time. They are created individually and closed ...


6

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 are not time critical and the users get their coins back immediately (no dispute time). If the other node is unresponsive (offline or doesn't sign a ...


4

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 congested. The timelock during which this transaction can be revoked via the penalty mechanism is a relative one and starts as soon as the transaction is mined. So, ...


3

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 with a channel partner. This could be even as easy as an unresponsive channel partner while settling an htlc in which case you have to settle the htlc onchain. ...


3

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.


3

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 on chain until the transaction gets spent (which is when the channel gets closed in Lightning's case). You can recreate the redeemScript if you know the funding ...


3

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 their channel state but still have their master key / mnemonic seed they can probably derive the key that was used in the 2-2 multisig wallet that is used to encode ...


2

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 funds to the cheating party, the cheated party can create a transaction to claim all funds from the cheater. In the worst case, the justice transaction can ...


2

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 <revocationpubkey> OP_ELSE `to_self_delay` OP_CSV OP_DROP <local_delayedpubkey> OP_ENDIF OP_CHECKSIG I've created that transaction on ...


2

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) and native (bech32 addresses, bc1..). And then both parties put money into the address? For now, only one party puts money into the address. But ideally both ...


2

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" because if he is offline, no payment is possible. The other thing you need to know - especially if you meant that Bob is offline after the payment was completed - ...


2

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 breach remedy that invalidates the previous state. Thus, Bob should not hand over whatever service Alice was purchasing until the payment is finalized. Once the ...


2

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 transaction to the blockchain (and close the channel?). No, that's not accurate. If a node in the middle of a multi-hop payment rejects a payment request, the ...


2

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 alluded to. In reality, the case OP is alluding to is a very rare edge case that could ONLY occur, if the following things are ALL true: 1. You don't back up ...


1

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 update message on the gossip Protocol. Nodes SHOULD set the disabled flag and send such a message if they are shutting down or turning (shortly) off for maintenance....


1

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/ your mnemonic seed and password. Close all channels, wait an hour, send an on-chain transaction from your original lnd node to the new lnd node. Dont close ...


1

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 at the ForceClose, which is the code that handles unilateral closing of a channel. It uses a CloseTx which it get's from the wire. If you could change that Tx ...


1

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 afraid you are stuck with closing channels for now. Perhaps there will be a way soon to rebalance the channels to minimize the number of closures required. ...


1

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 look for local_delayedpubkey instead of localpubkey. You can look at BOLT 03: Transactions where it is specified. In particular the section closing transaction. ...


1

A network fee in Bitcoin is simply the leftover between sum of the inputs and the sum of the outputs. The lightning network can be viewed as a protocol for updating the value split between the outputs. Therefore, any closing transaction that is broadcast will already have the fee set in place. If Alice has a channel open with Bob, and for whatever reason ...


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