Skip to content

Instantly share code, notes, and snippets.

Last active March 21, 2018 14:24
Show Gist options
  • Save Swader/880c8eb27c38326290c842a543ec3913 to your computer and use it in GitHub Desktop.
Save Swader/880c8eb27c38326290c842a543ec3913 to your computer and use it in GitHub Desktop.

In November, I realized some Core BTC devs don't understand the LN. Other influencers agreed with me, some in private, some publicly. These questions arose from that confusion, in an attempt to clear things up once and for all.

  1. If Alice and Bob want to transact, they need to open a channel, and they need to agree on max amount to transfer through that channel. This requires a transaction. To finalize the transaction so they can spend the BTC outside of their channel, they need to close it so their on-chain balance updates and so they can send BTC onward into other channels. Closing also needs a tx. How, then, is it sensible for Alice and Bob to transact this way, instead of what they can do now - use one single transaction?

  2. A common argument against the above is "you'll have middlemen through which many channels will go and form a mesh". My question is twofold:

  • a) how is it that this does not scare you? If LN becomes super popular and all of BTC is routed through like 5 major hubs (like currently 60% of all BTC transactions are routed through only 3 ISPs) and then govt tells the hub "OK do KYC now and tell us everything" or the hub becomes so monopolistically corrupt it starts charging absurd middleman fees (because they can), how do you solve this hypercentralized network's problem then?
  • b) even a channel with a middleman has to be closed once. If you have one big mesh of LN payments, and another unconnected one, you need to close the first one fully before being able to participate with the other one. But you cannot close just one tentacle of a hub - ALL must close because everyone's balances need to be consolidated because everyone chipped into the channel's max transfer volume. So it's impossible to close and release just one node out of the system. The bank can therefore say "No, we're not ready to close yet - we close once per week and consolidate then, wait until Friday to get your BTC and have it sendable elsewhere". - turns out this is wrong, my bad, channels can now be closed individually, a hub doesn't have to close all channels. It's still expensive to close them. There is still no way to top-up a channel without a transaction.
  1. A common argument is the "I don't need coffee logged". This, too, is DOA. If I open a channel with Starbucks for 0.5 BTC, that means we both chipped in 0.25 BTC, presumably, because the transfer capacity of the channel (unless topped up, which again needs an on-chain transaction) is "fed" by both (all) parties involved. This begs the question - how many of such channels will you open? If I want to buy coffee that one time I'm in NY, do I open a channel? And for how long? Who closes it, and why would I pay the enormous closing fee? And most of all, how many of such channels can you afford to keep open? Will you open a new 0.1BTC channel with every starbucks you visit thereby locking up your money in every new city until the channel is closed? Do you keep it open forever just on the off chance you once end up there again? People say that StarBucks will be a hub and connect to all its customers, but again, no, it won't, because it can't add new ones into an existing channel without a tx, and cannot remove old ones without closing the channel. So it has to either open new channels, or close the old one completely, all the time. Every single SB has to do this separately. This is unscalable, unsustainable, and economically insane with current TX fees.

  2. How do you deal with the "offline problem"? If a node goes offline for a while, a consolidation mechanism kicks into place. How do you deal with the fact that, for example, Turkey can block all BTC protocol traffic, or USA can, under new Net-Non-Neutrality laws block p2p money traffic, and the chains across the globe can lose connection? Who pays for those enormous damages, especially when it's huge entities that lose connection, each of which is handling 100k users?

  3. How does it not worry the people who love Bitcoin that the only currently proposed scaling solution to their favorite "decentralized" currency is being implemented by a private company (Lightning labs) who have it in their best interest to never see another solution work?


  • I use the term "bank" loosely. It can be an actual bank which embraces crypto, it can be a popular exchange, it can be a powerful solo player, doesn't matter.
  • I am open to having my mind changed by objective reasoning. I'm open to the possibility of having gotten the whitepaper wrong, but in that case I would like you to point me to the exact line in the WP which refutes my theory.
  • When thinking about Bitcoin, if your answer to the hypothetical question "what proof would it take to convince you it's hopeless" is "none", then you're a maximalist and aren't interested in discussing, but want to push an agenda. These questions are objective curiosities I'm seeking answers to, so that I too can start believing in the much advertised LN, or so that others can see the problems in it and fix it before it's too late.
  • I am not anti crypto. I run a crypto company for smart contract development, enterprise consulting, and crime investigation. I also run an altcoin brokerage. I have several dozen cryptos in my folio, and that includes both BTC and BCH. I think both are terribly, terribly flawed. What I'm trying to find out here is why people don't think the LN, in its current iteration, doesn't agument these flaws even further, given what I outlined in the questions.
Copy link

robzon commented Dec 11, 2017

Here's the best I can do with my current knowledge. Feel free to ask follow up questions I'll be happy to clarify and/or discuss.

  1. You can have many transactions within a single payment channel, but you need to open and close it only once. For example you could open a LN channel and commit $1000 to it (1st btc tx), make 100 purchases for $10 each, and close the LN channel (2nd btc tx). This way you can have 100 real-life txs with only 2 btc txs. Technically you asked about a payment channel, which only connects 2 parties, but I assume you're asking about LN in general, where a single channel can be used to transact with any party within the network.

  2. a. First, on the protocol level, there really isn't a distinction between a hub and a regular user. A hub is simply a node that has more than 1 channel open at a time. Anyone can become a hub by just opening a couple of channels. Governments cannot have more influence over LN nodes than over regular Bitcoin nodes. Government could just as well tell businesses they cannot accept BTC payments from unregistered BTC addresses or tell miners they cannot mine unauthorized transactions. LN doesn't change anything here.

    b. This doesn't sound right or I don't understand your point. Every channel your node opens is independent of other channels and can be closed and settled separately at any time. You can also open as many channels as you want with any party you want. There really aren't any restrictions on this. If I missed your point please follow up on this.

  3. You don't have to have a channel open with every business you transact with. One channel (in theory) is enough to transact with any LN participant. In practice I think you'll need some degree of redundancy, but that's still probably 2 or 3 channels tops, each can live for months. I think I start to see where your confusion comes from - PC (payment channel) is not the same as LN. LN relies on a mesh of PCs through which transactions can be routed. It's much better explained visually, though. I'll try to sketch something up when I have more time.

  4. Governments blocking BTC on protocol level isn't really a LN issue. Fortunately there are ways to mitigate that risk. Bitcoin (as well as LN) could implement onion-like encrypted protocol to hide from ISP filters and hide user's IP address. Monero is already working on this. Also if the other party in your channel goes offline, you don't lose funds - you'll get them back, but it will take a while.

Worth pointing out is that there are some big improvements to LN protocol coming. Recently there were talks and proposals on payment channel funding, channel rebalancing, etc. Great topics for further discussion, but let's get the basics out of the way first :-)

Copy link

Swader commented Dec 12, 2017

  1. Yes. What I'm wondering is, why would Alice and Bob ever transact through a payment channel or the LN in general, when they need 2 transactions (for opening and for closing the channel) and a weirdly pre-defined limit of transfer in that channel for something that would usually take 1 - a direct send.

2.a) Correct. The problem I see here though is maximalists pushing for LN as the only and holy solution to every problem in the world of BTC. If this were so, huge hubs would be created, and this, whether you want it or not, adds a new layer of centralization to BTC. It's already very, very vulnerable. This will make it more so, and as such is purely negative because any non LN usage will be impossible due to fees.

2.b) You can open as many channels as you want, but you cannot change the amount going through it without a transaction, and you cannot withdraw your money without an additional tx which closes the channel. Therefore, if "ALICE" opens a channel with another user called "BANK" for 0.1 BTC on each side (a total of 0.2 BTC) and "BOB", someone who also has a 0.1 symmetrical channel open with "BANK" on the other side, has the desire to send 0.05 BTC to "ALICE", BOB needs to send 0.06 to BANK (because of added 0.01 fee imposed by BANK) which then forwards this to ALICE. But for ALICE to actually withdraw the BTC in a way that lets her store it on a paper wallet, she needs to have this channel closed. The only way to close the channel is to consolidate all THREE states: ALICE, BOB, and BANK, because they all interacted in small and fast transactions that now need to baked into the chain in the form of a final result. Therefore, the whole chain/mesh/network in that part needs to close, for all statuses to update on-chain, and for ALICE to be able to take her coins elsewhere. Please correct me if I got this wrong.

  1. This refers directly to 2.b). So yes, the whole world would be "networked" and channels could live for a long time, but the whole world WON'T be networked, we all know this. There will be network islands. And taking your money from one to the other will need the closing of one island (as per 2.b)) in order for the funds to consolidate in such a way that it lets you take your money into the other island and open a new channel with it.

Also if the other party in your channel goes offline, you don't lose funds - you'll get them back, but it will take a while.

That doesn't seem healthy. Who covers these delays and losses, these missed deals. Who stops the potential for abuse there? A couple of weeks of such downtime and enough people would miss their purchases and payment windows to give up on the nonsense and go back to PayPal or a better cryptocurrency. This offline-lockup isn't a solution, it's a hack imposed by the fact that we're no longer p2p, but p2m (mesh). This opens a world of issues on its own.

I'd be interested in finding out more about these improvements you mention. The authors of the WP haven't been very forthcoming about this, much like everyone in Core and close to it, and I'd love to know more.

Copy link

Swader commented Dec 15, 2017

A discussion is developing in an interesting direction here.

I also got this reply on reddit:

To answer those questions:
1: You wouldn't use LN unless you plan on making three or more transactions over the channel. It's also possible (expected, really) for a channel to reach more than the people at the ends. Closing a channel is only necessary if the user wants to access the Bitcoin on the mainnet.
2a: LN can function as a mesh network and is designed to route around blockages. Nodes that charge excessive fees will be avoided in favor of nodes that are cheaper. With respect to KYC, I don't think it's enforceable on LN, in the same way that it's not enforceable on Bitcoin proper.
2b: The nature of this question suggests a serious misunderstanding of how LN works. LN channels are independent, and can close at any time without any consideration to any other channel. Nothing in this question is relevant.
3: In order:
Channels can be funded by either or both of the participants.
LN channels can't be "topped up" in the usual sense. Interconnected node channels can be re-balanced, but the total amount in the channel is fixed.
Some people will only need one channel. Others will have many to maximize their fee collection. I'd expect casual users will have one to three channels. No data behind that, mind, just my opinion.
Due to the way LN routes payments, you won't need a channel to everyone you transact with. As long as one of your channels can find a route with sufficient funds, you're golden.
Channels stay open until they are closed.
A channel can be closed by either party whenever they want.
You'd pay the closing fee when you need to use the Bitcoins outside LN, or when you don't want the channel open anymore for whatever reason.
No, you won't need a 0.1 BTC channel for every Starbucks. Again, this part demonstrates a serious misunderstanding of how LN works.
4a: AFAIK channels won't close automatically, but you do have to be online to update the channel and monitor for fraud. So, practically speaking, being online is pretty much mandatory; I don't think there's much that can be done to change that.
4b: All traffic should be encrypted, so blocking specifically LN traffic wouldn't really work. Plus, there's always Tor and/or VPN services to obfuscate traffic. Even if a node goes down permanently, no money is lost. Either party can close the channel and unlock the coins by broadcasting the last transaction to the Bitcoin network.

My answers.

  1. This solves nothing then, because most transactions are between two people (p2p) - I run a crypto brokerage and am very active in the community so have testimonials of this. Sure, the mass-sending will work better, but other than that? Still pay super-expensive transactions and wait for an hour?

2a. If you read this series it's obvious that some nodes can monopolize the system and become "main". These nodes would be easy to track for the authorities, and thus easy to KYC-enforce or to shut down. This is a form of centralization that even further augments the already troubling ISP issue.

2b. I've been told this twice now, so am rethinking my understanding of channels and will look into the WP again to find and interpret more data.

  1. You are assuming that everyone will be connected. You forget that there will be serious LN islands formed. A Starbucks in EU won't be connected to a Starbucks in USA, per se, not even via many hops, or perhaps so many that the TX fee for hopping will become insanely more expensive than the coffee. In such a case, you need 0.1 BTC for one Starbucks, and 0.1 for the other. It's locked into place until closing. What am I misunderstanding?

4a. That's a non-starter then, because most of the users of the interconnected world have periodic downtimes. There is no way to guarantee reliable connection. If you're hoping to "bank the unbanked" and give India and the like a way to make cheap payments through the LN, that's DOA.

4b. DPI will detect types of even encrypted connections, so blocking just crypto won't be hard - especially with Net Neutrality broken in the USA now. So who pays for the TX fee of closing the account in case one node goes offline? The initiator? What if the one who's left online doesn't initiate a closing and the timeout happens?

Copy link

drouillard commented Jan 8, 2018

'especially with Net Neutrality broken in the USA now'. Bitcoin did fine before Net Neutrality. If Gov wants to take it down crypto, the net neutrality laws are moot. It is asking the lion that is going to attack for protection. Agreed ISPs could be an issue, but your other issues around things like KYC are far more impactful. (meaning if they nodes aren't complying, they will just go get the people, not limit their traffic)

Copy link

boorac commented Jan 24, 2018

Not really answering the questions, but would like to contribute to the discussion with a great read:

Copy link

Swader commented Jan 25, 2018

Potentially useful? Needs a look, way too long: - 1:25:00

Copy link

Swader commented Jan 25, 2018

Another very interesting discussion. Gets trolly sometimes.

Copy link

MeniRosenfeld commented Jan 26, 2018

  1. This represents a fundamental misunderstanding of how LN is supposed to work. Alice and Bob create a channel not just for direct transactions between Alice and Bob. Once they create a channel, Alice can route payments to other recipients (including those she has never met, transacted with only once, and never created a channel to) through the channel to Bob and the channels he has created. And also receive payments.

  2. LN can work either as a mesh or in a hub model.

In the mesh model, ever user opens channels to, say, 20 peers among the entire world population. The graph will be connected and there is no way for government to shut it down.

In the hub model, there will be, say, 10000 hubs connected between themselves, and each user will open a channel to 10 of them. Government will still find it difficult to shut them all down, and in case of problems the user can simply close the channels and reclaim the money. That's a huge difference from traditional banks and hosted wallets.

What you're also missing is that "Govt says you must do KYC" problem applies to raw Bitcoin too! They can go to nodes and tell them "you're broadcasting financial transactions, do KYC or shut down". The solution is to have too many Bitcoin nodes and too many Lightning hubs for this to be practical. Since starting a hub is so easy, no reason it shouldn't be this way.

  1. Again, you're not opening a channel with a coffee shop just to buy coffee from that shop. You're opening a channel to be able to route through it many, many different payments to different people.

  2. Raw Bitcoin also doesn't work if there's no internet connection, not sure how that is an argument against LN. If you are still connected but a channel peer is disconnected from the network (both Bitcoin & LN) you don't lose money, you just close the channel. Also, by taking payments off-chain, Bitcoin nodes become smaller and harder to detect and shut down.

  3. There are several independent teams working on LN implementations. It's all open source. And it uses raw Bitcoin transactions as a foundation - it's not like the implementation can somehow steal my money, force me to do things I don't want, or affect people who do not use LN. I don't see how it is in any way relevant what these teams' best interest is.

Copy link

Swader commented Jan 26, 2018

Thank you for the answers.

In most counter-arguments to the questions, the overarching idea seems to be that LN will be so ubiquitous and widespread that every user will be able to route to every other user, regardless of there being hubs or mesh or a hybrid. If this happens, then yes, there will be some utility in all this. I do not think this will happen. I believe there will be isolated islands of LN connections that will find it impossible to maintain a connection due to government or natural interference.


(new ordinal numbers, they don't refer to old questions)

  1. Why would I open channels to 20 peers? This requires me to lock up my funds (of differing amounts) with 20 channels. People won't be willing to open such a tab in so many directions when they can just not lock up their funds and actually use them. This seems incredibly impractical - opening 20 channels means 20 transactions on the main chain, and another whenever I need to top a channel up. And then there's the locked change which becomes a big problem when you want to connect to another LN island.

  2. You're assuming people will want to run nodes on their computers. Even if the nodes become super light, very few people will run them. You can see this with torrents - very little is required to give back, and yet barely anyone does it. All it takes is 10kb/s upload, not even much disk space, and yet most people kill the torrent when they're done with it. Same with BTC. People will not leave their computers or nodes or RaspPis running and their electricity bill pumping and their internet connection clogged with upload just to keep the network afloat. The casual user just doesn't do that - they rely on third part apps to manage their keys for them (often mobile wallets) and don't want anything to do with the network's architecture. In fact, 95% of the future users of BTC won't even ever know about LN or care about it. All they want is an easy "pay" and "get paid" option. I posit that no one will run nodes, just like the node count for BTC has been stalled at around 10k for months now.

  3. Raw bitcoin doesn't work without internet, technically. But it also doesn't cause irreparable damage, chargebacks, or week-long funds lockups if the connection breaks. The LN does. Making an incredible amount of financial damage to large BTC LN users across two continents is as simple as severing that connection for a short time. The LN is much more susceptible to infrastructure based attacks which are proven to be easy (see Turkey's censorship of social media).

  4. The teams argument is that any team which exists solely to solve a problem has a direct incentive to NOT solve that problem, else it disbands. Both Blockstream and Lightning are private companies with investors, and they need to turn a profit because of that. Their business model is selling workarounds of BTC's technical failings. They have a direct incentive to work against improving the core software, and for selling their workaround and creating hubs which can collect fees.

Copy link

Swader commented Mar 21, 2018

  • Interesting (successful) attack on this already flawed concept:
  • Additional unanswered question. If current LN routing is provided lists of IPs and not auto-searching (because it's impossible to solve the traveling salesman problem at scale), how is that not even more centralized and susceptible to abuse if nodes can dictate which route to take? This will lead to privatized pay-to-join routes on the LN where IPs/nodes will collaborate and collude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment