Watchtower

From Bitcoin Wiki
Jump to navigation Jump to search

A watchtower is a service that watches the Bitcoin blockchain for a revoked Lightning Network channel state and, if one appears, broadcasts a justice (penalty) transaction on behalf of an offline node. Watchtowers exist because a Lightning participant that is offline cannot react in time when a counterparty publishes an old commitment transaction before the to-self delay on that commitment expires.

Lightning penalty channels give each party a revocation secret for the other's previous commitment. If a party broadcasts an old commitment, the counterparty can spend the revoked outputs immediately with that secret and claim the cheater's funds. The claim window is bounded by the relative timelock on the cheater's to-self output. A node that stays offline longer than that delay can be cheated. A watchtower stores enough data to detect the revoked commitment and assemble the justice transaction without necessarily holding the victim's main wallet keys.

Encrypted appointments

In the common encrypted-blob design, after each channel update the client sends the tower a hint derived from the revoked commitment transaction id and an encrypted blob with the justice transaction (or data to build it). The tower indexes blobs by hint and scans new blocks for matching transaction ids. On a match it decrypts the blob with a key derived from the published commitment and broadcasts the justice transaction. An honest tower cannot spend the justice output before the revoked commitment is public. A dishonest tower can refuse to act, so clients often use several towers or keep their own always-on node. Plaintext justice storage is simpler and weaker on privacy.

Clients usually send a new appointment after every channel state update so the tower's latest blob matches the newest revoked commitment. Older appointments for the same channel can be discarded once a newer state is acknowledged. Towers may charge per appointment, require a prepaid balance, or run as altruistic infrastructure. Because justice broadcasts compete for fees, some designs allow the client to attach fee-bumping policy or rely on anchor outputs when the commitment format supports them.

Appointments expire. Clients that stop updating a tower after a channel closes should cancel leftover appointments so the tower does not retain unnecessary justice blobs.

Limits

Watchtowers do not replace channel backups. Static channel backups help recover a channel after data loss so it can be closed; they do not by themselves punish a cheat while the victim is offline. Commitment formats that use anchors or TRUC change the shape of justice transactions but not the need for a watcher. Eltoo-style designs replace penalty with later-state replacement and would change what a tower stores; they are not the default Lightning penalty protocol.

Implementations

Implementations differ in wire format and storage. LND ships a watchtower client and server that use encrypted blobs keyed by revoked commitment hints. Independent towers such as The Eye of Satoshi follow a similar appointment model with their own protocol documents. A mobile wallet that only wakes intermittently still needs at least one always-on watcher covering its channels for the full to-self delay window.

Running several independent towers reduces reliance on any single operator's uptime and honesty, at the cost of sending each state update to every tower in the set.


See also

External links