How is lightning even Bitcoin if it's off-chain and has to be swapped back into on-chain to be useable as native BTC? These are legitimate questions. Is it just pegged to BTC or something?
Discussion
lightning channels are just plain BTC transactions. You just need to broadcast them to be included in a block to get your onchain BTC (simplified, but this is the concept)
I'm sure a lot of people don't understand this.
It’s a payment channel. When a channel is opened it is an on chain transaction and when a channel is closed it’s an on chain transaction.
In between those two events the channel is like a bar tab but instead of putting a card on file in tradfi lightning uses multisigs and htlc
I understand that it's payment channels but the going off-chain bit seems like a bad idea to me, it seems like it could open the door for some shenanigans.
The multisig, and hashed time lock contract get very close to zero shenanigans. Only when running a ln node have I run into the hiccups of always have to be online which may result in forced closed channels if your down for long and inbound/outbound liquidity management. If you don’t run a lnnode or use non custodial wallet. Custodial wallets are it’s pretty seamless but trade off is custodial wallet
Imagine like this. You have 2 transactions on chain. First one is opening a channel. Second one is closing a channel.
I open a 1mio sat channel to you.
I send you 200k sats via lightning.
Now we close the channel.
800k sats will go on chain to me and 200k sats to you. (minus the fees we pay to the miners for including our 2 transactions)
You wouldn't do this for 1 transaction but we might send sats back and forth, or we might use our other channels to forward sats to other channels. Or we might forward sats for other people through our channel to another channel until it arrives at the receiver.
No matter what we do with our channel, on second transaction (close) we both will get the balance left in our channel and the on chain transaction is finished.
There is no lightning token that needs to be swapped or pegged. Each channel is a ledger counting a balance between both parties that is permanently settled on channel closure.
A lightning channel is an on-chain utxo that you and I both control.
Off chain, we keep track of how much Bitcoin each of us owns in that channel, and if either of us want to take our side back on chain, we can close the channel into two separate utxos that have the final balance each of us had.
The lightning network forms by many people having channels in a chain, where I have a channel with you, and you have a channel with someone else. I can send Bitcoin to that someone else with you as an intermediary, and you can collect a fee for doing so.
This makes sense kinda but I still feel like going off-chain seem dangerous and like it opens the door for weird stuff.
Going off chain is dangerous. Bitcoin's security and decentralization guarantees do not scale beyond the base layer, so you're always giving up one or the other, or both, when you want to extend bitcoin's functionality. Even though the lightning white paper came out in 2016, it took years of development and experimentation to get it to work, and work securely.
In fact, lightning channels were purposely kept small because no one knew when something would break and funds would be lost.
The white paper also goes through in detail many of the risks and drawbacks that people are bringing up as FUD today, and have for years, including technical and social risks.
This was a great podcast episode where I first understood how lightning worked.