The Lightning Network (LN) is a layer 2 scaling solution for Bitcoin. Specifically, Lightning Network is a payment channel.
Layer 2s are strategies that scale a network without making any changes to its core protocol.
Cost to users
Scalability, Transactions Per Day
Instant Finality
On-chain Memory Usage
Incentives for light nodes / LN nodes
Understanding channels in general is necessary to understand how LN works
Channels are P2P protocols that allow two users to communicate and transact with each other off chain. An initial state is preserved on chain before they move to a channel. When the users are finished communicating, they can post the final state to the blockchain and both cryptographically sign the state.
There could be any number of transactions occurring on the channel, but now only the initial and final states have to be recorded on chain. As long as the net input equals the net output, all is valid.
A payment channel is a two-way ledger with which two parties can complete any number of payments between each other with instant finality. This eliminates wait times due to block times as well as individual network fees required for each ‘state change.’
Payment channels allow for instant and feeless transactions between two parties.
LN is a network of many payment channels. Since payment channels are bidirectional and only offer a 1:1 relationship, nodes have multiple channels.
This does not mean there are n^2 channels. Each node does not need to connect directly to every other node to transact. Nodes can use each other as intermediaries to reach their intended correspondent, similar to onion routing.
Microtransactions: the fees for a very small transaction could end up costing more than the value of the transaction. An example of this looks like arbitrage on exchanges.
Cross chain exchanges / atomic swaps: payment channels are used to link accounts used for the swaps
Dapps and games with many transactions: many games involve a high number of transactions between two parties where LN can help avoid paying fees at every step.
Flooding: using network congestion to bypass dispute time periods
Grief attacks: spamming a network to freeze funds
References:
https://lightning.network/lightning-network-summary.pdf
https://lightning.network/lightning-network-paper.pdf