Lightning for Builders Nodes

Lightning node software

LND, c-lightning and Eclair all speak the same protocol but feel different to use. Ask all three the same question.

30 minIntermediate4 / 17

Draft: this lesson is still waiting for review.

What you'll learn

  • Name the three main Lightning implementations and their languages
  • Explain why different implementations can still pay each other
  • Run the same query on LND, c-lightning and Eclair

Key terms

node (nodi)
A computer running Bitcoin or Lightning software that checks every rule for itself.
open source (programu huria)
Software whose code anyone can read, check and improve.

A Lightning node is a program. Three open source programs run most of the network:

ImplementationMade byWritten inIts CLI
LNDLightning LabsGolncli
c-lightning (Core Lightning)BlockstreamClightning-cli
EclairACINQScalaeclair-cli

They can pay each other because they all follow the same specifications, the BOLTs (Basis of Lightning Technology). A message from an LND node means exactly the same thing to an Eclair node.

Different tools, same network

Each implementation makes its own choices: how amounts are shown (sats or millisats), what the commands are called, how plugins work. In your lab you already met two of them. Alice and Dina are LND; Bob and Chan are c-lightning.

Step 1: Start the full profile

The book runs Chan on Eclair. In this lab, Eclair runs as a fifth node, Erin, so the routing lessons stay stable. Start it once:

./lab up --full

Step 2: One question, three answers

Ask each node for its alias. The commands differ; the answers come from the same protocol.

One question, three node programs--full

This exercise needs the full profile: ./lab up --full

These exercises need a laptop with the lab running. You can read the lesson on your phone.

Compare the full JSON of each getinfo if you like: all three report a public key, a network (regtest), a block height and channel counts, just under different names.

When you're done, ./lab up (without --full) stops Erin and frees about 1.5 GB of memory.

Reflect

Write your answer down, or talk it over with a friend or your chama.

  1. Why is it healthy for a network to have several independent implementations?
  2. Which implementation would you pick for a chama's node, and what would you want to know first?

Check yourself

Question 1 of 4Which implementation is written in Go?

Further reading

Adapted from Mastering the Lightning Network. Andreas M. Antonopoulos, Olaoluwa Osuntokun and René Pickhardt. Licence: CC BY-SA 4.0.