 Can you explain the lightning network and how payment channels and locked funds work? Yes. Let's start with payment channels. What payment channels are are transactions on the Bitcoin network that lock funds into a two-of-two... multi-signature address? If I have a payment channel with Alice, and that payment channel has... funds locked so that I commit a certain number of funds in the balance of the channel, let's say I put in... one Bitcoin, and Alice puts in one Bitcoin, and we both commit those into a two-of-two... multi-sig, where both of us have to sign to release these funds. Once we have those, what we can do is we can sign a transaction that changes that balance, so that we can sign a transaction whereby I reduce my balance in the channel to 0.9 Bitcoin, and I increase Alice's transaction balance to 1.1. We do that by simply updating that multi-signature with a new transaction that is signed, that updates the balance in the channel. That is a payment channel, because we don't actually transmit that transaction to anyone else. We just hold on to it. Once we have locked the funds into the payment channel, we can now write a transaction to each other. This is a real Bitcoin transaction. What this transaction does is it is like a final closing transaction with a new updated balance. I say, okay, great, I used to own one Bitcoin in this channel, and Alice used to own one, but I am going to sign a transaction that Alice could cash in the future, that actually gives her 1.1 Bitcoin and returns 0.9 to me from this multi-signature address. I am going to sign it and give it to Alice. Alice could sign it and cash it, at which point she gets 1.1 Bitcoin and I get 0.9, or she can just hold on to it, and then wait. Now, if I want to do another transaction, I could sign another transaction that reduces my balance to 0.8, and increases Alice's to 1.2. I sign it, I give it to Alice. Now, Alice has a new balance. If she took that transaction and actually cashed it, she would get 1.2 Bitcoin. I would get 0.8 Bitcoin, and we have now transferred 0.2 Bitcoin total to Alice. But what if Alice now wants to pay me back some money? Alice writes a transaction that changes the balance back to 0.9 to me, 1.1 to Alice. Now, Alice has sent me 0.1 Bitcoin in the opposite direction, Alice to me, and I just hold on to it. Back and forth we go, signing and sending each other these transactions. Any time we want one of us, or both of us collaboratively, could sign the last transaction we have, which is the accurate up-to-date balance of our tab, in the meaning of how you keep track of a credit, like you would when you are buying drinks from a bar and you don't sign the credit card until the end of the night. You just keep track of how many drinks you have, and that would effectively close the channel, when we sign the last transaction, commit it, and update the balance. There are a few complexities in there, which are security reasons. Obviously, I want to have some protection so that Alice can't sign an older transaction, which gives her a better balance. There are a couple of ways to get around that. There is a mechanism that has a penalty built in, where if Alice tries to cheat by signing an older transaction, that transaction also contains a script within it that allows me to take back all of the money from the channel. Because that is the only transaction I have signed and given to her, the one that has the penalty for misuse, she can't sign it prematurely without my agreement, because I will penalize her by taking all of the money in the channel. That tit-for-tat, as it is called, game theory mechanism, is one of the security mechanisms. There are other mechanisms that could be used in Lightning Networks. One of them is called L2, which uses a different formulation, but that is the basic idea. Great, that is a payment channel. Effectively, we lock some funds into a common credit amount, into a multi-sig address. Then we exchange signed transactions that we don't transmit to the Bitcoin network, updating the balance between us in order to reflect payments that we are sending to each other. At the end, when we are done sending payments to each other, or maybe never, we can then take the last transaction, sign it, and close the channel. That is one payment channel. What is interesting is when you can take lots of payment channels and link them together. Effectively, the Lightning Network is taking that bi-directional payment channel that I have with Alice, linking it to another bi-directional payment channel that Alice has with Carol, so that I make a commitment to pay Alice only if Alice pays Carol. As a result, I have paid Carol through Alice. That is done through the exchange of a series of transactions that are called hash-time-lock contracts, or HTLCs. It is rather complicated, but basically, we use Alice as an intermediary. If I commit funds to Alice and Alice commits funds to Carol, that is as if I committed funds to Carol. These payment channels can be of quite significant length. You can have multiple hops of commitments. As soon as Carol is satisfied that she has a commitment from Alice, she can signal that back to me. I release my commitment to Alice. Alice releases her commitment to Carol, and everybody gets paid. Most importantly, in all of these formulations, the system is designed so that no one can cheat, so that Alice doesn't get paid unless Carol has already been paid. It is only once her commitment to Carol has been made that my commitment to her will be made. That way, we have security. We don't have to trust each other. If anybody disappears from the network, we can all get refunds of all of the funds that we have locked up into these commitments. Of course, because this isn't transmitted to the Bitcoin network, even though it is a Bitcoin transaction, the only time you use it as a live Bitcoin transaction on the network is if there is a breakdown in the channel, whereby somebody disappears or tries to cheat. Then you take the last valid transaction you have, and you send that to the Bitcoin network. It is a valid Bitcoin transaction, and that way you get your money back, or you punish the cheater, or you close the channel, and you can't be cheated. Effectively, you are using the Bitcoin blockchain to provide the security. You are using the Bitcoin blockchain to be almost like a court. You don't take every contract you ever made to court. You only take a contract to court if there has been an attempt to cheat you. In the Lightning network, the vast majority, hundreds of thousands of transactions, can happen without any problems, because everybody knows that if they attempt to cheat, if they disappear from the network, or if anything goes wrong in the Lightning channel, any one of the participants can take one of these already signed, valid Bitcoin transactions, cash it in the court of the Bitcoin blockchain, and become whole. If you know that someone can cash this transaction if you cheat, you don't cheat, especially if there is a penalty included in the transaction that will cost you. That is how the Lightning network works. There is another question, which is, is the Lightning network a sidechain? The answer is no, it is not a sidechain. The Lightning network is an overlay network. It is basically a series of smart contracts that operate within Bitcoin, that allow you to do hundreds of thousands of offline transactions that nobody sees other than you and the other recipients, in a way that is very private, very, very fast, with very, very low cost. The capacity of the Bitcoin network is only used to open and close channels, which doesn't need to happen very often, and therefore you can scale the core Bitcoin blockchain to a much greater degree. It is only used as the judge. Do these payment channels face scaling problems if they are heavily loaded with transactions? Not really. The amount of computation you need to do to calculate what is called a hash-time-locked contract, and to route that over the Internet, is such that if you put two Lightning nodes on a well-connected network and you start exchanging transactions between them as fast as possible, you can literally do hundreds of thousands of transactions per second. Because those transactions are only seen by those two nodes, there could be another two nodes right next to them doing a hundred thousand transactions per second, and there could be another hundred thousand nodes each doing a hundred thousand transactions per second to each other, and all of this doesn't really affect the rest of the network. It decentralizes the scaling in a way that makes Lightning network not only much more private, because these transactions on these payment channels are not seen by anyone other than the participating node, much harder to censor because you don't need to get it to a minor, and also much, much faster and lower cost. I guess that in order to be Lightning-compatible, each chain must execute SegWit, correct? Not really. You could do Lightning without SegWit. It's just a hell of a lot more complicated because of the transaction malleability bug. Both chains have to have a transaction malleability fix. It doesn't have to be SegWit, however. It could be a different transaction malleability fix, but it's very, very difficult to implement Lightning securely on a chain that has a transaction malleability problem, and that needs to be fixed. SegWit fixes it on Bitcoin and Litecoin. On another chain, you might have a different fix, and that would make it possible. Is Lightning network also for altcoins? That's a great, great question. Yes, Lightning network can run on any blockchain system that has certain fundamental capabilities. It must have the ability to do multi-sig. It must have the ability to do time locks. If it has the ability to do those two things, you can probably set up a Lightning node that's in compliance with the current Lightning network specifications, which are called BOLT, basics of Lightning transactions, and the BOLT specifications are not specific to Bitcoin. In fact, already the Lightning network operates on both Bitcoin and Litecoin simultaneously. Here's the really amazing thing. You can send a Lightning payment in Bitcoin, have it transmitted across the Lightning network, have a node intermediate node somewhere in the middle, simply exchange it so that one payment channel comes in on Bitcoin, the other payment channel through that node goes out on, say, Litecoin, and the recipient gets Litecoin, USENT, Bitcoin. Effectively, Lightning network is not just portable to all the blockchains, but it can run multiple currencies simultaneously, where even a single payment can involve exchanging for other currencies, and not just once. You could exchange three different currencies in a single payment and route them across the Lightning network. Who keeps Lightning nodes? I'm running a Lightning node, you can run a Lightning node. The requirements to run a Lightning node are fairly light. In fact, if you're already running a Bitcoin node, adding a Lightning node to it is very easy. It takes very few additional resources. The incentives are that if you decide to route payments, you make a tiny fee for each payment you route. If you run a Lightning node full-time, you will probably make a few cents per month. It is very cheap, but also very easy to run. It is usable across the borderless global internet, which means that these payments can be transmitted all around the world. The Lightning payment channels cross network boundaries. There is no limitation as to where geographically a Lightning node can be. A payment can be routed globally in a matter of seconds or even milliseconds across the internet. Finally, at this stage, we are beginning to track and look at the size of the Lightning network growing. As nodes are added, they advertise their presence, the channels they have open, and how much capacity those channels have. But some nodes don't advertise their presence, and some nodes don't advertise their channels to anyone other than the other part of that channel. You can have secret channels on Lightning. The bigger the Lightning network gets, the harder it is for us to see how big it is. It becomes more and more invisible. Because on the Lightning network, all transactions are encrypted through this onion-routed topology, where each node doesn't know where the payment is coming or where it is going, the bigger it grows, the more private it gets, the less we know about where payments are going, the less we know about how many payments are happening, and gradually it becomes harder and harder to collect statistics. The funny thing is that over time, we will gain less visibility into Lightning. We will know it is out there, and lots of things are happening on it, but the level of privacy is such that we will know less and less about it.