The bitcoin lightning network is a p2p network built on top of and uses the bitcoin blockchain. In order to use it you need to download and install some new software. It aims to solve the 7 transactions per second issue which, if bitcoin were to become mainstream, would never happen due to it’s low throughput rate. Theoretically the lightning network can handle millions of transactions per second. Compare that to the Visa network, which only handles 45,000 per second.
The topology of the network begins with “layer 1” – that is, the Bitcoin network itself. The blockchain has a 1 megabyte cap to prevent spam transactions from clogging the network and bogging down the ability to transmit blocks to other listening bitcoin nodes. If Bitcoin is to be all-inclusive to everyone in the world, it must be usable and work on poor internet connections. The 1 mb blocksize helps us achieve that. To scale, there must be a layer 2, and one implementation of that is the lightning network.
Layer 2 promises to lift that 7 tps restriction by keeping a “record” of transactions between the two individuals using smart contracts. The two lightning clients can end their open connection with each other at any time and only need to tell layer 1 of the ending balance between the two parties, regardless of how many times they have swapped bitcoin back and forth. Much like how bitcoin uses public/private keys to secure addresses the lightning nodes use multi-signature addresses to secure the escrow of coins locked between the two parties. If one party wants to stop, both parties settle instantly.
A lightning node can connect to multiple individual nodes at the same time. This fact opens the door for not just transferring value between two people, but if you were connected to your friend John, and John was connected to a Starbucks node – then you can buy coffee through John without needing to open a channel (a channel is what we call a connection) directly with Starbucks.
The lightning network is still in it’s infancy, with 3,000 nodes and 8,000 open channels but it is an exciting time for the bitcoin space. Anyone can open a lightning node and connect with someone. Much like layer 1, layer 2’s goals as always is to be open, censorship-resistant, and permissionless.