Lightning
โšก๏ธ
Network

Hochschule Bremen  โ€“  May 23, 2019

Dennis Reimann  โ€“  @dennisreimann

In a nutshell

  • ๐Ÿค“  Second Layer Scaling Solution (for Bitcoin)
  • ๐Ÿ™‚  Faster transactions, lower fees
  • ๐Ÿค”  Network of Bidirectional Payment Channels

Why scale?

  • ๐Ÿ“ˆ  Growing adoption and transaction rate
  • ๐Ÿ˜ฑ  Full blocks leading to high fees
  • ๐Ÿ’ฐ  Block space will be costly
  • โฑ  Increasing transaction throughput

A bit of history

Bitcoin Magazine: The History of Lightning

January 2018

The Lightning Network Graph in January 2018

February 2018

The Lightning Network Graph in February 2018

December 2018

The Lightning Network Graph in December 2018

May 2019

  • ๐Ÿ–ฅ  8,500 nodes
    • 3,400 public nodes
    • 4,300 with active channels
  • ๐Ÿงฎ  36,500 channels overall
  • ๐Ÿ’ฐ  1,000 BTC network capacity
Source: 1ML Statistics

Protocol Standard

  • ๐Ÿ“ƒ  Specification: BOLTs (Basis of Lightning Technology)
  • ๐Ÿ›   Multiple implementations:

Channels

๐Ÿ–ผ  Big Picture

  • Metaphor for state that is outside the blockchain
  • Assumption: Not every transaction needs the blockchain
  • Two parties open a channel by commiting on-chain funds
  • "Branch off the blockchain into the Lightning Network"
  • Pay each other by updating a balance sheet
    • Instant: No waiting for block confirmations
    • No fees: No mining, just updating the balance
  • Done: Final balance is broadcasted to the blockchain
The lifecycle of a payment channel
Funding Transaction
Commitment Transaction
Commitment Transaction
Mutual Closing Transaction
Forced Closing Transaction
False Closing Transaction
Breach Remedy Transaction

๐Ÿ•ต๏ธโ€โ™‚๏ธ  Preventing fraud

  • Attempt: Close with an outdated version of the balance
  • Security model different from on-chain:
    • Need to be online / Hot Wallet
    • Trust-minimization
    • 1000 block confirmation period / ~7 days
      (ensured by CSV timelock)
    • Note: Revocation does not happen automatically!
      (observe for unilateraly closed channels, watchtowers)
  • Punishment: Fraud detection results in seizure of funds

๐Ÿ”—  On-Chain Relation

  • Locking up Bitcoin UTXOs into a multisignature output
  • Incremental mutation of a future on chain transaction
  • Differences to On-Chain transactions:
    • Peers need to be online to transact / Hot Wallet
    • Invoice/payment request is needed, no addresses
  • Rely on the blockchain for final settlement of funds
    • Closing fee has to be reserved โ†’ changes balance
  • Prerequisites: SegWit (fixes malleability), CSV opcode

๐Ÿงฎ  Capacity and Liquidity

  • Channel capacity is fixed
  • Outbound and Inbound Liquidity
  • Funds are locked up in one direction:
    • To make a payment, you need outbound liquidity
      โ†’ funds on your side of the channel
    • To receive payments, you need inbound liquidity
      โ†’ funds on the remote side of the channel
    • This is a big adoption topic currently.
  • Channels can be rebalanced

๐Ÿ—บ  Routing

  • Finding a payment path for nodes that have no direct channel connection (multi hop payments)
  • Involves fees: Node operators set Base Rate and Fee Rate
    โ†’ cover the cost of locking up money in a channel
  • Constrained by capacity and liquidity along the path
    โ†’ The longer the path, the more limited you will be
  • Technically: Hash Time-Locked Contracts (HTLC)
A has to go through B to send 4 to C.
A sending through B changed the balance between B and C.
A cannot send 4 to E, because neither C-E nor D-E have the required balance.

In Practice

๐Ÿ“ฑ  Wallets, Nodes, Apps

๐Ÿ‘ป Custodial vs.    
๐Ÿฆธโ€โ™‚๏ธ Non-Custodial

  • Custodial: Someone else manages your keys and funds.
    • Easy access, fast onboarding
    • Beware: Not your keys not your coins!
  • Non-custodial: You are holding the keys and funds.
    • Currently requires tech-familiarity
    • The UX and products are improving rapidly!
Lightning.app and Zap Mobile
Joule Browser Extension
Casa Node, RaspiBlitz and Nodl
Lightning Apps

๐Ÿณ  What's Cookin'?

  • AMP: Atomic Multi-Path Payments
  • Dual Funded Channels
  • Autopilot: Automated channel creation
  • Watchtowers: Delegating channel breach detection
  • Unilateral/Push payments
  • Cross-chain Atomic Swaps

โšก๏ธ  Lightning improves โ€ฆ

  • ๐Ÿ˜Ž  Privacy: Transactions are not public
  • ๐Ÿค  Fungibility: Difficult to apply surveillance or blacklists
  • ๐ŸŽ  Speed: Transactions settle instantly
  • ๐Ÿงฉ  Granularity: Enables very small payments
  • โ˜„๏ธ  Capacity: No upper limit to number of payments

โšก๏ธ Thanks! โšก๏ธ


dennisreimann.de/talks/lightning-network.html


@dennisreimann

Resources