Tutorial: Setup a Private Lightning Node Over Tor

Excellent tutorial on how to setup a lightning node using Blockstream’s c-lightning over Tor on a Linux system.

Read the full tutorial here

Quick Summary

1. Generating your Tor .onion address

  • Install tor daemon, it can be done on Debian with the following commands:
    $ sudo apt install tor
  • Edit the /etc/tor/torrc config file to configure tor to pass traffic to the c-lightning node and generate an .onion address. Add these lines to torrc:
    HiddenServiceDir /var/lib/tor/lightningd-service_v2/
    HiddenServicePort 1234
  • This will create a tor version 2 .onion address. For a version 3 address use the following:
    HiddenServiceDir /var/lib/tor/lightningd-service_v3/
    HiddenServiceVersion 3
    HiddenServicePort 1234
  • Better crypto (replaced SHA1/DH/RSA1024 with SHA3/ed25519/curve25519)
  • Improved directory protocol, leaking much less information to directory servers.
  • Improved directory protocol, with smaller surface for targeted attacks.
  • Better onion address security against impersonation.
  • More extensible introduction/rendezvous protocol.
  • A cleaner and more modular codebase.
  • You can now enable/restart the tor service:
    sudo systemctl enable tor
    sudo systemctl restart tor
  • You caw see the generated tor addressed at /var/lib/tor/lightningd-service_v2/hostname and /var/lib/tor/lightningd-service_v3/hostname

2. Configure c-lightning:

  • You can run c-lightning over tor with the following command:
   $ ./lightningd --mainnet --bind-addr= --announce-addr=<your v2 .onion> \
   --announce-addr=<your v3 .onion> --proxy= 

Support us and the authors of this article by donating to the following address:


Comments powered by Talkyard.