Bitcoin 101: Lightning Watchtowers
Watchtowers are coming soon to the Lightning Network!
In this post, we’ll explain what they are and what their arrival means for the future of the Lightning Network. Before we dive in, make sure you’ve read our Bitcoin 101 on the Lightning Network.
The Lightning Network has promising implications for Bitcoin’s future. The layer two scaling solution is currently comprised of over 4,000 connected nodes and has a network capacity of nearly 90 billion satoshis. As more nodes join the network, sending Lightning payments will become even more seamless. Watchtowers make the network more resilient by providing a way to monitor and maintain channel state.
The Problem of Keeping Channel State
Every Lightning payment changes a channel balance’s state.
Once that happens, the party on either side of a channel can update that state. To steal funds from a peer, a malicious actor may take advantage of this by broadcasting a previous, invalid channel balance to the blockchain. For example:
Let’s say Bob’s and Alice’s nodes have recorded a balance of:
- Bob: .05 BTC
- Alice: .05 BTC
If Bob sends Alice .025 BTC, their nodes will eventually record a new balance of:
- Bob: .025 BTC
- Alice: .075 BTC
Alice could try to cheat the system by receiving the funds and then, some time later, force-closing the channel with a transaction from the old channel state, thus broadcasting their previous balances of .05 BTC each to the blockchain.
If Bob’s node isn’t always online, it won’t be able to verify whether the invalid state was broadcast. For someone who doesn’t have the time or technical expertise to maintain an online node, this is a considerable drawback for Lightning Network.
The Solution is Watching Channels
Watchtowers store the history of all previous channel states and work in conjunction with Lightning Network smart contracts to enforce penalties if one side tries to cheat the network by sending out an old incorrect channel state.
You can think of a Lightning Network smart contract as the rule book, and a watchtower as the referee. If the referee (watchtower) detects foul play, she knows the rule book (smart contract) and can enforce a penalty.
Here’s a quick example of how it works:
- Bob sends Alice .025 BTC.
- Bob’s node simultaneously sends a signal to a watchtower that tells it which transaction to look out for without revealing the contents of the transaction.
- If the watchtower detects malicious activity from Alice, it uses Bob’s signature to verify the most recent valid state, then signals the smart contract to create a penalty transaction and return the funds to Alice.
Implications of Watchtowers
Watchtowers have a few notable implications for Lightning Network users.
Watchtowers are run on third-party devices and will operate 24/7. It will be possible to connect to multiple watchtowers for redundancy.
That means if Alice goes on vacation and her node falls offline for a while, one or more watchtowers can monitor for and help prevent malicious activity. In this way, watchtowers will allow mobile users to feel more comfortable using the Lightning Network.
Watchtowers also make running a personal full node a little less risky. For example, if a node gets destroyed in a house fire, a watchtower's ability to protect an offline node can buy the node owner more time to replace the node and reclaim his or her funds.
We expect many companies to run Watchtower services. Casa plans to provide many options to our Casa Node owners (including a Casa-run Watchtower service included in your yearly price of Casa Gold, Platinum or Diamond membership!).
Watchtowers will arrive in version 0.7 of LND. As the prevalence of watchtowers grows, the Lightning Network’s security and usability will improve, making it easier than ever for new people to join and use the network.