Why do lightning nodes need channels? Why can a node not just send and receive without a channel? I wonder what the benefit it serves other than making running a node difficult or making it cost to open one?
I remember asking a similar question at a BitDevs a few years ago as a thought experiment; "How do we get rid of lightning channels? They're the worst." It appeared glib, but I wanted someone to explain why they needed to exist else devise something better.
To understand lightning channels, it helps use metaphors.
Let's imagine you and I:
have accounts at the same bank
want trade goods and services with each other for money
the bank is closed for several weeks
To do this we might record all the transactions between us in spreadsheet, recording what each of us is owed at any point in time, then when the bank opens if I owe you money I send it to you and if you owe me money you send it to me.
If you and I don't know each other well, before we agree to start trading, we might sign a contract:
enforcing you have $10 and I have $10 to start
enforcing that if I give you $10, I'm not also giving $10 to someone else (because I only have $10 total)
The bank is bitcoin's blockchain and our spreadsheet is a lightning channel. A lightning channel exists to:
record the transactions between us
prove we own the bitcoin we started the lightning channel with
enforce that we don't spend the same bitcoin used in the lightning channel, outside of the channel
Why can a node not just send and receive without a channel?
If you want to pay fees to bitcoin miners every time you transfer money, you don't need a lightning channel!
Channel creation: To create a payment channel, two users deposit an agreed upon amount of Bitcoin into a channel. This initial transaction creates a ledger on the Lightning network to log the following transactions between the two users, away from Bitcoin’s chain.
Off-chain transactions: Once the channel is created, the two users can transact with each other, at low cost. Each transaction is recorded in the ledger, which doubles as a balance sheet to keep track of the movement of funds. As long as the channel remains open, they can send unlimited transactions to each other.
Channel closure: The channel can be closed at any time by either party. When this happens, all transactions are calculated and consolidated into a single transaction that is posted to and finalised on the Bitcoin chain. At this point, the correct balances are credited to each user's respective wallet on the Bitcoin network.
The only Lightning-related transactions that are broadcast to the Bitcoin network are the opening and closing of channels.
The channel is the vehicle by which the bitcoin is sent on the Lightning Network. It is quintessential to the "network" aspect.
Channels serve the purpose of condensing an unlimited number of "payments" between two individuals into just two onchain "transactions". One to fund the channel and one to close it. Payments over channels also circumvent the ten minute blocktime (although one does have to wait for the channel to open).
It is as if you are asking the question of Why do Bitcoin Miners need a Bitcoin Wallet? It is being presumed that you are running a node due to fact that you don't trust other nodes. Your node is the only node you trust and since you trust that node you relay whatever it is that you want to relay through it. But the node is just a node which is why there is a specialization called "channels".
I think of nodes in a lightning transaction like mini banks in a Venmo, Cashapp, or Zelle transaction. Basically, when I send you money, our banks (our nodes) agree to change the amount of credit owed to each other by the amount I send you. Channels are just a miniature version of the credit owed agreed upon number between banks, and in a lightning transaction, there are multiple nodes, each with a single channel in between. I’ll leave it at that.
I liked how @niftynei described in this interview on WBD that lightning is like scaling consensus down to two peers from global consensus in a blockchain.
So this means lightning channels exist to replace the expensive and slow consensus of a blockchain with consensus between only two peers which is faster and cheaper (but more complicated).
Without going into technical details, channels are used because the lightning network was designed that way. Channels are created between two nodes, the nodes are like two banks and the channel is the interbank network. Here it is important to mention that the bitcoins that are part of that channel are blocked in the Bitcoin network.
A payment channel is a means of transaction outside the blockchain, in which two people commit funds to an address and pay each other by issuing payment commitments signed by the parties, avoiding having to wait for confirmations from the underlying blockchain. .
Answer to the third question, why is it difficult to open a channel?
The parties open a payment channel between themselves by sending funds in an initial transaction (Funding Transaction) to a 2-of-2 multi-signature address, which is managed by both parties and requires the signatures of both parties to generate new transactions. This first transaction is then propagated to the blockchain, leaving the channel effectively open.