<p>Lightning allows you to lock coins between two wallets, and then send special transactions between each wallet which only become "real" when they are added to the blockchain. But you don't do that, because on-chain costs you more fees, so you keep updating the transactions between each other.</p>

<p>Lightning not only makes it possible to send transactions off-chain from A to B, but also from A to B to C etc. Which would make it possible to create one big network, where most transactions happen off chain, you don't need to trust anyone and where all transactions are instantaneous.</p>

CC BY-SA 3.0
2016-04-12T19:27:26.830Z
2016-04-12T19:27:26.830Z
Wouter Schut
<p>Lightning Network is a layer on the top of the Bitcoin Blockchain. Le'me go in more detail.</p>

<p>It is a technology that makes bitcoin work faster, scalable and improve bitcoin in such a way that Bitcoin could handle hundreds or thousands of transactions each second, right now Bitcoin handles about seven transactions per second which is very low compared to Visa and Mastercard who handles hundreds or thousands of transactions per second. Bitcoin lightning network is a proposal which can help in moving from seven transactions per second to hundreds or thousands transactions per second without having any central entity and without losing trust among nodes.</p>

<p><strong>How Lightning Network Works ?</strong></p>

<p>It works by you and me where we can send each other bitcoins on a channel that is off the blockchain so we establish a channel between each other on the blockchain, we start communicating with each other and sending transactions to each other off the blockchain. We can do hundreds or millions of such transactions without broadcasting it back to the blockchain. When we create this channel that is outside the blockchain, we can do any number of transactions without burdening the entire network.</p>

<p>So in their whitepaper who have proposed this idea also in which I can send a transaction to some other person without creating a direct connection to that other person. Le'me explain guys...</p>

<p>Suppose Me and my friend are sending transaction to each other off the blockchain so may be my friend connects to some other person X so in the lightning network, it is possible to send funds from me to person X via my friend. I dont need to have a direct connection to person X. It's really a good way to propagate funds through the network without establishing many direct connections which also could burden the whole lightning network.
<a href="https://i.sstatic.net/wOP63.jpg" rel="noreferrer"><img src="https://i.sstatic.net/wOP63.jpg" alt="enter image description here"></a></p>

<p>This is comparable with how the internet works today When i send a packet, it can get routed through many different nodes and the nodes dont really care where the packet is coming from and where it's going, they only care where they should send it next and so the next person may send it somewhere else and then it would finally arrived at final destination. It's similar to how lightning network work if i have a connection to my friend and my friend has a connection to someone else. I could send funds from me to someone else via my friend, my friend wouldnot even know if the funds are intended to go to person X or if person X is supposed to send person Y. If the person X is recipient then transaction is finished and can be broadcasted to the original blockchain so in this way we can do millions of transactions among each other without burdening the entire network and this could really scale the Bitcoin network.</p>

<p><strong>Can you trust that middle person ?</strong></p>

<p>I want to send some funds from me to my friend Sachin and i want to send those funds to Sachin via middle person Shivam so I have a channel from me to Shivam and then Shivam has a channel to Sachin, now i want to send my funds to Sachin. How can i trust Shivam? May be Shivam takes my funds for himself and doesnot send anything to Sachin so this thing is handled cryptographically and transaction will be refunded back to me if Sachin doesnot recieve my transaction in a certain amount of time. </p>

<p><strong>Problems in Lightning Network ?</strong></p>

<p>The worst thing that could happen to me in this lightning network is that some middle person who is unfaithful would hold my funds for a number of days and so after those days passes, I would get my funds refunded by the protocol of network.
Another problem with this network is that people could do many channels, they could open and close channels instantaneously for burdening the network. In order to open a channel, we need to broadcast this information to the main blockchain and so if some malicious person tries to open and close the hundreds of channels a second, this could really burden the blockchain. They are working in it.</p>

CC BY-SA 4.0
2018-05-12T21:57:41.620Z
2018-05-12T21:57:41.620Z
Rajesh Prajapati
<p>The Lightning Network is a collection of payment channels between pairs of nodes. To create a payment channel, two users commit funds to a UTXO under shared control. The shared funds allow the users to pay each other by changing how much they will pay out to each eventually.  The state of the payment channel is stored in presigned Bitcoin transactions that spends the shared funds back to the individual users. As long as neither broadcasts the final state of the channel to the Bitcoin network, you can think of the funds in the channel like beads on an abacus—they can only go from one side to the other, but cannot leave the channel. By having multiple channels, users can forward payments from one peer to another, allowing payments between peers that don’t have direct connections. The Lightning Network allows for instant payments with a significantly compressed blockchain footprint.</p>
<p>Let’s say that you and I want to open a payment channel.</p>
<h1>1. Putting funds into Lightning</h1>
<p>We negotiate to each send 0.05 BTC into a shared 2-of-2 multisig output, the <em>channel funding output</em>.¹ This will require a transaction on the Bitcoin blockchain.</p>
<p><a href="https://i.sstatic.net/etBb8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/etBb8.png" alt="We are planning to use a 0.05 ₿ input each to open a channel" /></a></p>
<p>As a “balance sheet” and escape hatch, we negotiate a 2-of-2 multisig transaction that pays out 0.05 BTC to you and 0.05 BTC to me. We call this the <em>commitment transaction</em>.</p>
<p><a href="https://i.sstatic.net/I74u5.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/I74u5.png" alt="We add a commitment transaction to make sure that either of us can withdraw their funds" /></a></p>
<p>The commitment transaction comes actually in two variants. I sign your commitment transaction and give it to you. If you want to put it in effect, you need only add your own signature and broadcast it to the Bitcoin network. Vice versa, you sign and give me my copy of the commitment transaction. The commitment transactions are future transactions for the Bitcoin network, they're just not valid yet because we have not actually created the channel funding output yet, and because they are each missing one signature. The commitment transaction comes in two variants because the copy you and I hold are asymmetric: your commitment transaction puts a timelock on your Settlement Output, and mine locks my Settlement Output. We’ll see below why we need that.</p>
<p><a href="https://i.sstatic.net/Y768T.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Y768T.png" alt="Your output is timelocked in your commitment transaction, mine in mine" /></a></p>
<p>The commitment transaction guarantees that either of us can close the channel and return the funds to our respective controls by themselves. Now that we are confident to be able to to get back our funds, we can sign and broadcast the funding transaction:</p>
<p><a href="https://i.sstatic.net/IRM5M.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IRM5M.png" alt="After exchanging the commitment transactions we are confident to broadcast the funding transaction" /></a></p>
<p>We are later going to use the following shorthand to represent a channel and its current balances: <a href="https://i.sstatic.net/D2ldw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/D2ldw.png" alt="A line with “You” and “Me” on either side and the respective balance on top of the line on each side" /></a></p>
<h1>2. Payment</h1>
<p>Now, I want to pay you 0.01 BTC. We each create a new commitment transaction (&quot;balance sheet&quot;) as before, but this one says that you get 0.06 BTC and I get 0.04 BTC. Each of us gets a new commitment transaction signed by the other to that effect as before.</p>
<p><a href="https://i.sstatic.net/z1MCT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/z1MCT.png" alt="We add a new set of commitment transactions to update the “balance sheet”." /></a></p>
<p>To make sure that neither of us can use the old commitment transaction the other signed previously, we each create a <em>justice transaction</em> to prevent cheating. The justice transaction allows the channel partner to spend our timelocked output from our first commitment transaction to the themselves if we use the outdated commitment. If we use the correct commitment, the funds go to ourselves after the timelock passes, until then the counterparty can take the funds if we cheated.</p>
<p><em>I.e. when I try to activate the (now obsolete) 0.05 - 0.05 BTC balance sheet, my paid-out funds are locked for a number of blocks. This gives you time to broadcast the justice transaction in which I signed off on my 0.05 BTC output being sent to you.</em></p>
<p><a href="https://i.sstatic.net/0LtsA.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0LtsA.png" alt="If either of us uses the outdated commitment transaction, the other party can take their funds" /></a></p>
<p>It's safe for me to give you your justice transaction, or really to anyone, because the justice transaction will only be valid as a response to the fraudulent use of the old commitment transaction.²
With the setup as described above, I'd have to come online before the timelock expires to catch an attempt at cheating, but obviously it wouldn't be safe for me to keep payment channels open if I might be offline for extended periods. Luckily, there are <em>watchtower</em> services that take a small payment to monitor for cheating and can broadcast the justice transaction on your behalf when they detect it.</p>
<h1>3. Network payment</h1>
<p>Alright, now you and I can send money back and forth thousands of times, with almost instant effect (depending only on how fast we can communicate with each other) without adding any additional transaction to the Bitcoin blockchain. Yet, on the other hand, if one of us ever tried to defraud the other, they would be instantly taken to court by having the dispute resolved on the blockchain to their own detriment. Pretty spiffy, but not terribly useful yet.<br />
By the theory of <a href="https://en.wikipedia.org/wiki/Six_degrees_of_separation" rel="nofollow noreferrer">six degrees of separation</a>, everyone is connected to any other participant via only a few hops.
Let's say you are getting some coffee from Bob the Barista. You do not have a payment channel with Bob, but you have the channel with me, and both Bob and me each have a payment channel with Alice. Let's assume that each payment channel has 100 m₿ in it, split equally.</p>
<p>Our &quot;network&quot; now looks like this:</p>
<p><a href="https://i.sstatic.net/vT9CH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vT9CH.png" alt="A series of three payment channel: You to Me, Me to Alice, Alice to Bob. Each channel has a balance of 50 on each side." /></a></p>
<p>Now, since you don't have a direct payment channel to Bob (and it would be very inefficient if you had to create a payment channel with every business partner you ever meet), you route your payment through the network. Instead of only writing an update of the balance between Bob and you as I described above, this becomes a concerted effort: Your wallet finds a route from you to Bob that has a) sufficient liquidity, b) least fees, and c) fewest hops. To make a payment, each involved payment channel updates its balances. With a payment of 1 m₿ for the coffee, this updates our network to:</p>
<p><a href="https://i.sstatic.net/jZ8ij.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jZ8ij.png" alt="The same series of three payment channels, but now every channel has a balance of 49 on the left side and 51 on the right side." /></a></p>
<p>As you can see, the balances at the ends have shifted appropriately from you to Bob, but the other participants have the same balance (although shifted to other payment channels). It's important to realize, that the payment can only <a href="https://bitcoin.stackexchange.com/q/43184/5406">go through completely or not at all</a>. Either we all update the balances, or no one does.</p>
<p>Now, imagine that you don't have only the one payment channel with me, but you have maybe a half a dozen payment channels with other users! :)</p>
<p><a href="https://i.sstatic.net/hTTAW.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hTTAW.png" alt="A sample network with ten users" /></a></p>
<h1>4. Cooperative channel closing</h1>
<p>Other than in the above case where one side closes the channel unilaterally, one of us can request to cooperatively close a channel from the other. When we agree, we collaborate to create a final payout transaction that doesn't lock any funds and allows immediate spending after confirmation. We could even use this transaction to spend some of our balance directly to a third party on the blockchain, or to create another different payment channel. Let’s say I want to pay Carol on-chain when we close the channel after the second commitment transactions have been exchanged.</p>
<p><a href="https://i.sstatic.net/8ZPaP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8ZPaP.png" alt="A transaction with the funding output as its input and three outputs. 0.6 to you, 0.2 to me, and 0.2 to Carol" /></a></p>
<h1>5. Trade-offs</h1>
<ul>
<li>You cannot receive more money through the Lightning Network in one payment than the sum of your channel counterparties’ balances.</li>
<li>Sender and receiver have to be online for a payment to be conducted.</li>
<li>Your Lightning Network payments don't get recorded on the blockchain for eternity, (i.e. better payment privacy), but your Lightning node has a permanent identity and your announced channels’ funding outputs are publicly associated with your node’s identity (observers may guess how much funds you have deployed to the Lightning Network), or which outputs went to you when channels get closed.</li>
<li>Instant payments! But your funds are tied up in payment channels. If you need those funds for an on-chain payment, you need to close the channel or splice out a payment with the assistance of your channel partner.</li>
<li>Lower fees! Payments on Lightning don't require an on-chain transaction fee, but if you route payments through others payment channels, they will charge a proportional fee for the liquidity they provide. However, as other Lightning nodes are competing to transfer your payment for you, this costs much less than an on-chain transaction fee (unless the payment amount is huge).</li>
</ul>
<h1>6. Further reading:</h1>
<ul>
<li><a href="https://bitcoin.stackexchange.com/q/43184/5406">How is a node in the middle prohibited from keeping the money in a routed Payment in Lightning network?</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/42639/5406">What are the trade-offs between transacting on LN and Bitcoin mainchain?</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/43687/5406">How are paths found in Lightning Network?</a></li>
</ul>
<hr />
<p><sup>¹ This examples is a so-called “dual-funded” channel. Many channels are funded only by one party upon creation. Channels funded by one party start off with the entire balance on one side and therefore only capable of sending payments but not receiving. Dual funded channels were recently implemented by some Lightning Network implementations for the first time.</sup></p>
<p><sup>² The commitment transactions and justice transaction mechanism are why Lightning needed the <a href="https://bitcoin.stackexchange.com/a/21995/5406">transaction malleability</a> fix from segwit. We can only rely on this chain of half-signed, unconfirmed transactions if the transaction id’s of the prior transactions can be predicted reliably.</sup></p>

CC BY-SA 3.0
2017-06-06T11:24:20.800Z
Nice, I thought at some time that bitcoins would be a way of instant payment and be used in stores and everyday life, but in another stack exchange question someone explained to me that the delay to confirm transactions on blockchain would not aloud it. The LN brings a light to my previous thought. Nice explanation. I'll read after the article about tradeoffs between BTC and LN. I hope to understand better the implications of using SegWit and LN, if it's easy to be a general adoption, the only thing I know until now is the complain that miners won't receive fees for every transaction.
Jp_
CC BY-SA 3.0
2017-06-06T11:25:59.323Z
People would need to make a transaction with the blockchain from time to time, right?
Jp_
CC BY-SA 3.0
2017-06-07T21:31:11.607Z
@Jp_: Currently, the only way for people to do off-chain Bitcoin denominated value transfers is by using the same custodial third party platform (e.g. both sender and recipient being Coinbase wallet users). Miners have no reach at all into the instant transaction market. With Lightning Network the establishing and closing of channels must happen on the chain decentrally, so the miners reach is actually extended into a market they never had any access to before.
Murch
CC BY-SA 3.0
2017-10-25T08:05:50.367Z
0.01BTC for a coffee?! Outrageous! ;-)
Highly Irregular
CC BY-SA 3.0
2017-11-16T19:10:31.627Z
@fredsbend: You're always indistinguishable from others using your channel, because nobody knows more than the hop before and after themselves. However, the proxy nodes don't give a privacy benefit as far as I can tell. — I'd love to elaborate on this topic on a question, if you ask it.
Murch
CC BY-SA 4.0
2019-01-17T16:01:24.723Z
@Murch , When you say _"Your transactions don't get stored on the blockchain for **eternity**"_ Do you mean that **even settlement transactions** are not stored permanently in the blockchain?
Questioner
CC BY-SA 4.0
2019-01-17T18:16:35.423Z
No, just the off-chain transactions on the lightning network never hit the blockchain. When a channel is closed, this has to happen in an on-chain transaction, so that is recorded forever.
Murch
CC BY-SA 4.0
2016-04-12T15:40:31.410Z
2023-10-03T12:03:15.927Z
2023-10-03T12:03:15.927Z
Murch
<ul>
<li>Could you please describe how the Lightning network is supposed to work? </li>
<li>How does it scale better than pure blockchain transactions?  </li>
<li>What are the advantages and disadvantages of Lightning Network and blockchain transactions?</li>
</ul>

CC BY-SA 3.0
2017-11-04T03:08:15.990Z
People need to understand that graphic visualization and "scenes" are the best way to describe sequential processing and depdencies.. rather than looking at a wall of text
neaumusic
CC BY-SA 4.0
2023-10-02T14:59:20.680Z
@neaumusic: It was on my todo list for a while, but I finally came through!
Murch
<lightning-network><scalability><ln-opening-channels><ln-closing-channels>
How does the Lightning network work in simple terms?
Murch
# How does the Lightning network work in simple terms?

(Asked by: username_0 on 2016-04-12)

* Could you please describe how the Lightning network is supposed to work?
* How does it scale better than pure blockchain transactions?
* What are the advantages and disadvantages of Lightning Network and blockchain transactions?

**Tags:** lightning-network, scalability, ln-opening-channels, ln-closing-channels

> **Comments:**
> **username_1**: People need to understand that graphic visualization and "scenes" are the best way to describe sequential processing and depdencies.. rather than looking at a wall of text  
> **username_0**: @username_1: It was on my todo list for a while, but I finally came through!  

---

## 3 answers

### Answer by username_0 on 2016-04-12. Score: 76 | Accepted answer

The Lightning Network is a collection of payment channels between pairs of nodes. To create a payment channel, two users commit funds to a UTXO under shared control. The shared funds allow the users to pay each other by changing how much they will pay out to each eventually. The state of the payment channel is stored in presigned Bitcoin transactions that spends the shared funds back to the individual users. As long as neither broadcasts the final state of the channel to the Bitcoin network, you can think of the funds in the channel like beads on an abacus—they can only go from one side to the other, but cannot leave the channel. By having multiple channels, users can forward payments from one peer to another, allowing payments between peers that don’t have direct connections. The Lightning Network allows for instant payments with a significantly compressed blockchain footprint.

Let’s say that you and I want to open a payment channel.

# 1. Putting funds into Lightning

We negotiate to each send 0.05 BTC into a shared 2-of-2 multisig output, the *channel funding output*.¹ This will require a transaction on the Bitcoin blockchain.

[![We are planning to use a 0.05 ₿ input each to open a channel](https://i.sstatic.net/etBb8.png)](https://i.sstatic.net/etBb8.png)

As a “balance sheet” and escape hatch, we negotiate a 2-of-2 multisig transaction that pays out 0.05 BTC to you and 0.05 BTC to me. We call this the *commitment transaction*.

[![We add a commitment transaction to make sure that either of us can withdraw their funds](https://i.sstatic.net/I74u5.png)](https://i.sstatic.net/I74u5.png)

The commitment transaction comes actually in two variants. I sign your commitment transaction and give it to you. If you want to put it in effect, you need only add your own signature and broadcast it to the Bitcoin network. Vice versa, you sign and give me my copy of the commitment transaction. The commitment transactions are future transactions for the Bitcoin network, they're just not valid yet because we have not actually created the channel funding output yet, and because they are each missing one signature. The commitment transaction comes in two variants because the copy you and I hold are asymmetric: your commitment transaction puts a timelock on your Settlement Output, and mine locks my Settlement Output. We’ll see below why we need that.

[![Your output is timelocked in your commitment transaction, mine in mine](https://i.sstatic.net/Y768T.png)](https://i.sstatic.net/Y768T.png)

The commitment transaction guarantees that either of us can close the channel and return the funds to our respective controls by themselves. Now that we are confident to be able to to get back our funds, we can sign and broadcast the funding transaction:

[![After exchanging the commitment transactions we are confident to broadcast the funding transaction](https://i.sstatic.net/IRM5M.png)](https://i.sstatic.net/IRM5M.png)

We are later going to use the following shorthand to represent a channel and its current balances: [![A line with “You” and “Me” on either side and the respective balance on top of the line on each side](https://i.sstatic.net/D2ldw.png)](https://i.sstatic.net/D2ldw.png)

# 2. Payment

Now, I want to pay you 0.01 BTC. We each create a new commitment transaction ("balance sheet") as before, but this one says that you get 0.06 BTC and I get 0.04 BTC. Each of us gets a new commitment transaction signed by the other to that effect as before.

[![We add a new set of commitment transactions to update the “balance sheet”.](https://i.sstatic.net/z1MCT.png)](https://i.sstatic.net/z1MCT.png)

To make sure that neither of us can use the old commitment transaction the other signed previously, we each create a *justice transaction* to prevent cheating. The justice transaction allows the channel partner to spend our timelocked output from our first commitment transaction to the themselves if we use the outdated commitment. If we use the correct commitment, the funds go to ourselves after the timelock passes, until then the counterparty can take the funds if we cheated.

*I.e. when I try to activate the (now obsolete) 0.05 - 0.05 BTC balance sheet, my paid-out funds are locked for a number of blocks. This gives you time to broadcast the justice transaction in which I signed off on my 0.05 BTC output being sent to you.*

[![If either of us uses the outdated commitment transaction, the other party can take their funds](https://i.sstatic.net/0LtsA.png)](https://i.sstatic.net/0LtsA.png)

It's safe for me to give you your justice transaction, or really to anyone, because the justice transaction will only be valid as a response to the fraudulent use of the old commitment transaction.²
With the setup as described above, I'd have to come online before the timelock expires to catch an attempt at cheating, but obviously it wouldn't be safe for me to keep payment channels open if I might be offline for extended periods. Luckily, there are *watchtower* services that take a small payment to monitor for cheating and can broadcast the justice transaction on your behalf when they detect it.

# 3. Network payment

Alright, now you and I can send money back and forth thousands of times, with almost instant effect (depending only on how fast we can communicate with each other) without adding any additional transaction to the Bitcoin blockchain. Yet, on the other hand, if one of us ever tried to defraud the other, they would be instantly taken to court by having the dispute resolved on the blockchain to their own detriment. Pretty spiffy, but not terribly useful yet.  
By the theory of [six degrees of separation](https://en.wikipedia.org/wiki/Six_degrees_of_separation), everyone is connected to any other participant via only a few hops.
Let's say you are getting some coffee from Bob the Barista. You do not have a payment channel with Bob, but you have the channel with me, and both Bob and me each have a payment channel with Alice. Let's assume that each payment channel has 100 m₿ in it, split equally.

Our "network" now looks like this:

[![A series of three payment channel: You to Me, Me to Alice, Alice to Bob. Each channel has a balance of 50 on each side.](https://i.sstatic.net/vT9CH.png)](https://i.sstatic.net/vT9CH.png)

Now, since you don't have a direct payment channel to Bob (and it would be very inefficient if you had to create a payment channel with every business partner you ever meet), you route your payment through the network. Instead of only writing an update of the balance between Bob and you as I described above, this becomes a concerted effort: Your wallet finds a route from you to Bob that has a) sufficient liquidity, b) least fees, and c) fewest hops. To make a payment, each involved payment channel updates its balances. With a payment of 1 m₿ for the coffee, this updates our network to:

[![The same series of three payment channels, but now every channel has a balance of 49 on the left side and 51 on the right side.](https://i.sstatic.net/jZ8ij.png)](https://i.sstatic.net/jZ8ij.png)

As you can see, the balances at the ends have shifted appropriately from you to Bob, but the other participants have the same balance (although shifted to other payment channels). It's important to realize, that the payment can only [go through completely or not at all](https://bitcoin.stackexchange.com/q/43184/5406). Either we all update the balances, or no one does.

Now, imagine that you don't have only the one payment channel with me, but you have maybe a half a dozen payment channels with other users! :)

[![A sample network with ten users](https://i.sstatic.net/hTTAW.png)](https://i.sstatic.net/hTTAW.png)

# 4. Cooperative channel closing

Other than in the above case where one side closes the channel unilaterally, one of us can request to cooperatively close a channel from the other. When we agree, we collaborate to create a final payout transaction that doesn't lock any funds and allows immediate spending after confirmation. We could even use this transaction to spend some of our balance directly to a third party on the blockchain, or to create another different payment channel. Let’s say I want to pay Carol on-chain when we close the channel after the second commitment transactions have been exchanged.

[![A transaction with the funding output as its input and three outputs. 0.6 to you, 0.2 to me, and 0.2 to Carol](https://i.sstatic.net/8ZPaP.png)](https://i.sstatic.net/8ZPaP.png)

# 5. Trade-offs

* You cannot receive more money through the Lightning Network in one payment than the sum of your channel counterparties’ balances.
* Sender and receiver have to be online for a payment to be conducted.
* Your Lightning Network payments don't get recorded on the blockchain for eternity, (i.e. better payment privacy), but your Lightning node has a permanent identity and your announced channels’ funding outputs are publicly associated with your node’s identity (observers may guess how much funds you have deployed to the Lightning Network), or which outputs went to you when channels get closed.
* Instant payments! But your funds are tied up in payment channels. If you need those funds for an on-chain payment, you need to close the channel or splice out a payment with the assistance of your channel partner.
* Lower fees! Payments on Lightning don't require an on-chain transaction fee, but if you route payments through others payment channels, they will charge a proportional fee for the liquidity they provide. However, as other Lightning nodes are competing to transfer your payment for you, this costs much less than an on-chain transaction fee (unless the payment amount is huge).

# 6. Further reading:

* [How is a node in the middle prohibited from keeping the money in a routed Payment in Lightning network?](https://bitcoin.stackexchange.com/q/43184/5406)
* [What are the trade-offs between transacting on LN and Bitcoin mainchain?](https://bitcoin.stackexchange.com/q/42639/5406)
* [How are paths found in Lightning Network?](https://bitcoin.stackexchange.com/q/43687/5406)

---

¹ This examples is a so-called “dual-funded” channel. Many channels are funded only by one party upon creation. Channels funded by one party start off with the entire balance on one side and therefore only capable of sending payments but not receiving. Dual funded channels were recently implemented by some Lightning Network implementations for the first time.

² The commitment transactions and justice transaction mechanism are why Lightning needed the [transaction malleability](https://bitcoin.stackexchange.com/a/21995/5406) fix from segwit. We can only rely on this chain of half-signed, unconfirmed transactions if the transaction id’s of the prior transactions can be predicted reliably.

> **Comments:**
> **username_4**: Nice, I thought at some time that bitcoins would be a way of instant payment and be used in stores and everyday life, but in another stack exchange question someone explained to me that the delay to confirm transactions on blockchain would not aloud it. The LN brings a light to my previous thought. Nice explanation. I'll read after the article about tradeoffs between BTC and LN. I hope to understand better the implications of using SegWit and LN, if it's easy to be a general adoption, the only thing I know until now is the complain that miners won't receive fees for every transaction.  
> **username_4**: People would need to make a transaction with the blockchain from time to time, right?  
> **username_0**: @username_4: Currently, the only way for people to do off-chain Bitcoin denominated value transfers is by using the same custodial third party platform (e.g. both sender and recipient being Coinbase wallet users). Miners have no reach at all into the instant transaction market. With Lightning Network the establishing and closing of channels must happen on the chain decentrally, so the miners reach is actually extended into a market they never had any access to before.  
> **username_5**: 0.01BTC for a coffee?! Outrageous! ;-)  
> **username_0**: @fredsbend: You're always indistinguishable from others using your channel, because nobody knows more than the hop before and after themselves. However, the proxy nodes don't give a privacy benefit as far as I can tell. — I'd love to elaborate on this topic on a question, if you ask it.  
> **username_6**: @username_0 , When you say _"Your transactions don't get stored on the blockchain for **eternity**"_ Do you mean that **even settlement transactions** are not stored permanently in the blockchain?  
> **username_0**: No, just the off-chain transactions on the lightning network never hit the blockchain. When a channel is closed, this has to happen in an on-chain transaction, so that is recorded forever.  

---

### Answer by username_2 on 2016-04-12. Score: 11

Lightning allows you to lock coins between two wallets, and then send special transactions between each wallet which only become "real" when they are added to the blockchain. But you don't do that, because on-chain costs you more fees, so you keep updating the transactions between each other.

Lightning not only makes it possible to send transactions off-chain from A to B, but also from A to B to C etc. Which would make it possible to create one big network, where most transactions happen off chain, you don't need to trust anyone and where all transactions are instantaneous.


---

### Answer by username_3 on 2018-05-12. Score: 7

Lightning Network is a layer on the top of the Bitcoin Blockchain. Le'me go in more detail.

It is a technology that makes bitcoin work faster, scalable and improve bitcoin in such a way that Bitcoin could handle hundreds or thousands of transactions each second, right now Bitcoin handles about seven transactions per second which is very low compared to Visa and Mastercard who handles hundreds or thousands of transactions per second. Bitcoin lightning network is a proposal which can help in moving from seven transactions per second to hundreds or thousands transactions per second without having any central entity and without losing trust among nodes.

**How Lightning Network Works ?**

It works by you and me where we can send each other bitcoins on a channel that is off the blockchain so we establish a channel between each other on the blockchain, we start communicating with each other and sending transactions to each other off the blockchain. We can do hundreds or millions of such transactions without broadcasting it back to the blockchain. When we create this channel that is outside the blockchain, we can do any number of transactions without burdening the entire network.

So in their whitepaper who have proposed this idea also in which I can send a transaction to some other person without creating a direct connection to that other person. Le'me explain guys...

Suppose Me and my friend are sending transaction to each other off the blockchain so may be my friend connects to some other person X so in the lightning network, it is possible to send funds from me to person X via my friend. I dont need to have a direct connection to person X. It's really a good way to propagate funds through the network without establishing many direct connections which also could burden the whole lightning network.
[![enter image description here](https://i.sstatic.net/wOP63.jpg)](https://i.sstatic.net/wOP63.jpg)

This is comparable with how the internet works today When i send a packet, it can get routed through many different nodes and the nodes dont really care where the packet is coming from and where it's going, they only care where they should send it next and so the next person may send it somewhere else and then it would finally arrived at final destination. It's similar to how lightning network work if i have a connection to my friend and my friend has a connection to someone else. I could send funds from me to someone else via my friend, my friend wouldnot even know if the funds are intended to go to person X or if person X is supposed to send person Y. If the person X is recipient then transaction is finished and can be broadcasted to the original blockchain so in this way we can do millions of transactions among each other without burdening the entire network and this could really scale the Bitcoin network.

**Can you trust that middle person ?**

I want to send some funds from me to my friend Sachin and i want to send those funds to Sachin via middle person Shivam so I have a channel from me to Shivam and then Shivam has a channel to Sachin, now i want to send my funds to Sachin. How can i trust Shivam? May be Shivam takes my funds for himself and doesnot send anything to Sachin so this thing is handled cryptographically and transaction will be refunded back to me if Sachin doesnot recieve my transaction in a certain amount of time.

**Problems in Lightning Network ?**

The worst thing that could happen to me in this lightning network is that some middle person who is unfaithful would hold my funds for a number of days and so after those days passes, I would get my funds refunded by the protocol of network.
Another problem with this network is that people could do many channels, they could open and close channels instantaneously for burdening the network. In order to open a channel, we need to broadcast this information to the main blockchain and so if some malicious person tries to open and close the hundreds of channels a second, this could really burden the blockchain. They are working in it.


---

