← Back to context

Comment by sapphicsnail

10 hours ago

How does this work? I read the wikipedia article but I don't understand how Lightning enforces the transaction.

The peers generate two sets of transactions.

One is a quick summary of the current balance in a channel. A new transaction is created each time the balance in the channel changes. It's somewhat cheap to put on the blockchain (And the main saving is that you only need to post the final update when you close the channel), but venerable to one side putting an old stale transaction onto the blockchain to profit.

The other transaction forms a chain of proof for current state, invalidating previous balance update transactions. It's somewhat expensive to post, as it will pull in the whole history.

Both peers need to continually watch the chain (or contract a 3rd party to watch) to make sure the other peer isn't cheating by posted a stale balance transaction. These special transactions are time locked, so once one is posted, you have like 24 hours to post the proof transaction and reverse it.