Bitcoin Universe · Model 18

The Lightning security machine

Why both sides of a Lightning channel must protect the latest agreement, and what happens when someone tries to close with an old one.

Simulated · LN-penalty channel model
ALICELATEST STATETO_SELF_DELAYBLOCKS SINCE BROADCASTOUTCOMEBOB
Update the channel:
Close it:

Monitoring and timing

Time-lock delay (to_self_delay)

Protecting the latest state

A watchtower is optional. It helps only if it is running, sees the old state and gets its transaction confirmed in time, and it does not remove every risk.

Compare states

CommitmentAlice (sat)Bob (sat)
The valid (latest) commitment and Alice's coins Revocation keys held by the other side

What is simulated. One channel under the LN-penalty construction used by today's Lightning implementations (BOLT #2, #3): revocable commitment transactions, a relative time lock on the broadcaster's own output, and a penalty that gives the honest side the whole channel if a revoked state is published and the revocation key is used in time. Other designs (for example LN-Symmetry, also called eltoo) replace penalties with different mechanisms and are not shown. Left out: commitment and penalty transaction fees, anchor outputs, payments in flight (HTLCs), fee spikes and congestion that can delay a penalty, and channel reserves. Bob reacts the block after he comes back online; the watchtower reacts after 6 blocks. Demonstration amounts only.