3 ms·
Transactions are encoded into the blockchain to set up a "lightning channel" that incentivize the participants of off-chain transactions to correctly settle the
by AgentME 9y ago
Transactions are encoded into the blockchain to set up a "lightning channel" that incentivize the participants of off-chain transactions to correctly settle the net payments of the channel on the chain later. Only once it's set up on the blockchain can users use it for off-chain payments (which can be instantly confirmed and have much lower fees).
Once the channel is set up on the blockchain between two users and has some amount of bitcoin committed to it, the participants can securely transact between each other with only private communications between each other, without requiring transactions in the blockchain. When either user is done with the channel, either of them may broadcast the settlement transaction which withdraws the committed funds in the correct amounts to each participant. (Every time the participants make a transaction between each other, they create create a new settlement transaction, and a separate transaction which invalidates the previous settlement transaction. These are regular Bitcoin transactions, but they're held privately by the participants instead of being broadcast on the blockchain immediately. If either of the particpants tries to broadcast an earlier version of the settlement transaction, then the other participant can broadcast the invalidation transaction within a certain pre-agreed time, which rewards them the funds as punishment to the defector.)
Then the real fun comes from the "lightning network" part: if Alice wants to send funds to Charlie but has no open lightning channel to Charlie, but she knows that both her and Charlie have an open channel with Bob, then she can do an off-chain lightning transaction through Bob to Charlie, without any risk of Bob taking the funds for himself.
- hossbeast 9y agoImportantly, the maximum net amount that can flow from A to B over the channel is capped at the amount which A contributes to the funding transaction.