Skip to content

Commit

Permalink
watchtower documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ecdsa committed Jul 1, 2020
1 parent fbcd056 commit 9f70216
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 10 deletions.
Binary file added png/watchtower_settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/watchtower_window.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 53 additions & 10 deletions watchtower.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,59 @@ How to setup a watchtower
=========================

This tutorial will show you how to configure your Electrum daemon as a
watchtower for your lightning wallet. It is written for Electrum 4.0
(currently in development_)
watchtower for your lightning wallet. It is written for Electrum 4.0.

.. _development:
https://github.com/spesmilo/electrum#development-version-git-clone

Add your SSL certificate to Electrum
Local and remote watchtower
---------------------------

There are two ways a watchtower can be configured in Electrum: Local
or Remote.

A local watchtower runs in the same process as your Electrum client,
and can be activated in the preferences dialog of the Qt GUI. A local
watchtower creates a database of pre-signed breach remedy
transactions, and it watches the funding addresses of your
channels. When your lightning wallet is open, breach remedy
transactions will be signed and added to the watchtower database.
Once you your wallet is closed, assuming Electrum is still running,
the local watchtower will watch your channels, and it will broadcast
pre-signed breach remedy transactions if needed.

A remote watchtower is a separate Electrum process, that runs on
another computer. To setup a remote watchtower, you need to configure
an Electrum daemon, and to enter its URL in your preferences.


How to configure a local watchtower
------------------------------------

To protect against MITM attacks, add a SSL certificate:
In your preferences, check 'Run a local watchtower'

.. image:: png/watchtower_settings.png


The second option ensures that Electrum keeps running on your computer
after you have closed your wallet file. If you click it, the Electrum
icon should persist in your taskbar after you have closed all your
Electrum windows.


If you have open channels and a local watchtower, Electrum will
populate the watchtower database. You can view the database size and
number of transactions per channel if you open the watchtower window:

.. image:: png/watchtower_window.png


How to configure a remote watchtower
------------------------------------

You want to run your watchtower on a machine that is regularly
connected to the internet.

First install Electrum, and add a SSL certificate to your Electrum
configuration:

.. code-block:: bash
Expand All @@ -21,10 +64,7 @@ To protect against MITM attacks, add a SSL certificate:
For details see `How to add SSL <ssl.html>`_


Configure your Watchtower
-------------------------

Configure your watchtower address and password:
Second, configure your watchtower with an address, username and password:

.. code-block:: bash
Expand All @@ -44,6 +84,9 @@ The watchtower database contains presigned transactions, and is in
~/.electrum/watchtower_db If you open the GUI you can see hown many
channels and transactions are in the database.

Note that the daemon does not need to contain a wallet, nor to have
Lightning enabled; the watchtower is only about watching onchain
addresses and broadcasting onchain transactions.

Configure the watchtower in your client
---------------------------------------
Expand Down

0 comments on commit 9f70216

Please sign in to comment.