Lightning Development Tools

Gabriel Comte

Slides: gcomte.github.io/classes/ln-dev-tools.html

Bitcoin Networks

  • Mainnet
  • Testnet
  • Signet
  • Regtest

Testnet

  • testnet3
  • introduced with Bitcoin Core version 0.7
  • First block mined February 2011

Testnet details

  • Almost identical to Mainnet
  • Different ports, address types, genesis block
  • Difficulty resets if no block found for 20 minutes
  • No value by definition

Testnet tools

  • Bitcoin Core in Testnet mode
  • Faucets
  • https://mempool.space/testnet
  • blockstream.info/testnet/

Testnet challenges

  • Same PoW hashing algo as Mainnet
  • Unreliable block production
  • Current block > 2,534,810
  • 2,534,810 / 210,000 = 12 (halvings)
  • 50 / 2¹²
  • Block subsidy = 0.014 BTC
  • Testnet coins are scarce!!

Reality check

Testnet value

Initiate a new testnet

Update entire network (including services, LN channels, ...)

Signet

  • Idea: Centralize block production
  • Almost the same as Testnet
  • Blocks require PoW + signature
  • Reliable block production
  • ... or even reliably unreliable block production

Signet services

  • mempool.space/signet
  • Faucets
    • https://signetfaucet.com/
    • https://signet.bc-2.jp/
  • Web wallet: https://sw.bublina.eu.org
  • Mobile wallet: https://github.com/nbd-wtf/obw
  • Explorer: https://explorer.bc-2.jp/

Practical challenges

  • LN on Testnet is unreliable
  • LN on Signet is small (but growing)
  • Some services/solutions do not support Testnet/Signet
  • Some companies test on Mainnet!
  • Hard to find a Testnet wallet

Practical challenges

  • LN on Testnet is unreliable
  • LN on Signet is small (but growing)
  • Some services/solutions do not support Testnet/Signet
  • Some companies test on Mainnet!

Regtest

  • Regression Test Network
  • Local development
    • External connections disabled
    • Difficulty = 0
  • Usually short lived
  • You are at the wheel
  • Perfect playground

Polar

  • Regtest playground with GUI
  • Beautiful graphical feedback
  • Docker-based
  • Website: https://lightningpolar.com/
  • GitHub: https://github.com/jamaljsr/polar

Demo

Hands on!

  • Download Polar and initiate your own network
  • https://lightningpolar.com/
  • Create your own network
  • Open channels
  • Send sats back and forth
  • Try multiple channels for same node
  • Send a Multipath payment
  • What error do you get if payment is bigger than channel capacity?

Nigiri

  • Regtest playground with GUI
  • Headless
  • Docker-based
  • Programmable (int tests)
  • Website: https://nigiri.vulpem.com/
  • GitHub: https://github.com/vulpemventures/nigiri

Demo

Hands on!

  • Download Nigiri and spin up your own network
  • https://nigiri.vulpem.com/
  • Open channels
  • Send sats back and forth
  • Close channels

Helpful commands

  • nigiri start --ln
  • nigiri stop
  • nigiri rpc -generate 10
  • nigiri faucet lnd
  • nigiri lnd getinfo
  • nigiri cln getinfo

Scaling lightning

  • Testing toolkit
  • Headless
  • Kubernetes-based
  • GitHub: https://github.com/scaling-lightning/scaling-lightning

Some other tools ...

  • Invoice decoder
    • https://lightningdecoder.com/
    • https://lndecode.com/
    • https://www.bolt11.org/
  • Lightning Explorers
    • 1ml.com | 1ml.com/testnet
    • https://mempool.space/lightning
    • amboss.space
  • LNURL playground: https://lnurl.fiatjaf.com/
  • Check out Jameson Lopp's list

Thanks for listening

Questions?