Home

Awesome

Lightning Network Curriculum

What Is This?

While planning the Chaincode Residency, we put considerable effort into finding the best resources and creating a curriculum around Lightning protocol development. You can find all of our published materials on our resources page.

Lightning is still a nascent technology, and so we expect maintenance of this document to be an ongoing task. We could use your help. Please consider opening a pull-request to keep this document relevant.

There are two portions to this curriculum:

  1. Study Groups designed to provide bite-sized grouped subjects that you can either complete bookclub style or alone.
  2. Lightning Syllabus a collection of resources grouped by subjects.

Lightning Syllabus

SubjectsTopicsSub-topicsSources
What is Lightning?The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments, What is the Lightning Network and how can it help Bitcoin scale?, The Lightning Network Evolving Bitcoin into a layered system, Understanding the Lightning Network, Part 1: Building a Bidirectional Bitcoin Payment Channel, Understanding the Lightning Network, Part 2: Creating the Network, Understanding the Lightning Network, Part 3: Completing the Puzzle and Closing the Channel, Reaching The Ground With Lightning, Scaling Bitcoin to Billions of Transactions Per Day, 2015, Lightning Network Deep Dive with Laolu "Roasbeef" Osuntokun, The #Bitcoin #Lightning Spec, Lightning Network Glossary
What is Lightning?IntroductionLightning LayersHow the Lightning Layers Fit Together, A Lightning Application Design Perspective
What is Lightning?IntroductionHistory of LNHistory of the Lightning Network, The Future of Bitcoin: What Lightning Could Look Like, The History of Lightning: From Brainstorm to Beta
What is Lightning?Lightning ≈ BitcoinLightning ≈ Bitcoin
What is Lightning?Lightning ≈ BitcoinRevisting tx malleabilitySF Bitcoin Devs Seminar: Transaction Malleability: Threats and Solutions
How Layers fit togetherOverviewHow the layers of Lightning Fit Together Seminar Video
How Layers fit togetherUpdateThe Update Layer Seminar Video
How Layers fit togetherTransferThe Transfer Layer Seminar Video
How Layers fit togetherMultihopThe Multihop Layer Seminar Video
How Layers fit togetherOthersThe Base an Transport Layers Seminar Video
TransferPayment channelGeneral ConceptPayment Channel Overview
TransferPayment channelPublic channelDo the channel balances get publicly announced in real-time on Lightning Network?, The open_channel Message
TransferPayment channelImbalance measure and proactive channel rebalancingImbalance measure and proactive channel rebalancing video, Imbalance measure and proactive channel rebalancing algorithm paper
TransferPayment channelExhausted channels
TransferPayment channelChannel reserveopen_channel Message Rationale
TransferTransactionsBOLTBOLT #3: Bitcoin Transaction and Script Formats
TransferTransactionsFunding TransactionFunding Transactions as a Generalized Design Pattern for Offchain Protocols, Funding Transaction Output, The funding_created Message
TransferTransactionsCommitment TransactionCommitment transactions - wiki, Commitment Transaction - Bolt#3
TransferTransactionsClosing TransactionClosing a Channel in Lighting Network, Closing Transaction
TransferTransactionsPenalty TransactionRevoked Transaction Close Handling
TransferTransactionsMutual CloseDistinguishing mutual and unilateral channel closing in the Bitcoin blockchain, Mutual Close Handling
TransferTransactionsUnilateral CloseUnilateral Close Handling: Local Commitment Transaction
TransferTransactionsFee negotiationBOLT #2: Peer Protocol for Channel Management
TransferHTLCOverviewWhat Are Hashed Timelock Contracts (HTLCs)? Application In Lightning Network & Payment Channels, Lightning Networks Part II: Hashed Timelock Contracts (HTLCs)
TransferHTLCHashlockHTLC implementation Bitcoin Core
TransferHTLCTimelocksBitcoin’s Time Locks, Timelock - wiki, Bitcoin Timelocks in a nutshell
TransferHTLCRevocation KeyLightning Networks Part I: Revocable Transactions
TransferHTLCRelative Locktime/CLTVBIP 65
TransferHTLCHash Pre-imageWhat is a hash pre-image as it is used for the breach remedy?, Offered HTLC Outputs
TransferHTLCpayment basepoint/revocation basepointKey Derivation
TransferHTLCPer-commit secret/Commitment numberKey Derivation
TransferHTLCHTLC fulfillment/failureRemoving an HTLC: update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc
TransferPaymentInvoice
TransferPaymentPayment Request
UpdateInvoicesBolt11 encodingBOLT #11: Invoice Protocol for Lightning Payments
UpdateGossipGossip ProtocolBOLT #7: P2P Node and Channel Discovery, Gossip Protocol/Path Finding seminar video
UpdateTransactionsLN-Penalty
UpdateTransactionsEltoo payment channelseltoo: A Simple Layer2 Protocol for Bitcoin, Eltoo and the far future with Christian Decker
UpdateTrampoline PaymentsOverviewTrampoline Payments Seminar Video
MultihopSphinxOverviewUsing Sphinx to Improve Onion Routing Circuit Construction (short paper)⋆, Sphinx: A Compact and Provably Secure Mix Format, Security Analysis of the Lightning Network
MultihopOnion RoutingOverviewOnion routing seminar video, Sphinx and Onion routing, Onion Routing with HTLCs on the Lightning Network explained! - Beginner / Experts
MultihopOnion RoutingPublic vs. Private channelDo the channel balances get publicly announced in real-time on Lightning Network?
MultihopOnion RoutingChannel announcementsBOLT #2: Peer Protocol for Channel Management
MultihopOnion RoutingRouting feesThe Lightning Network (Part 2) – Routing Fee Economics
MultihopOnion RoutingExpiry deltacltv_expiry_delta Selection
MultihopOnion RoutingRoute hintsExploring Lightning Network Routing
MultihopOnion RoutingKeysend (formally known as spontaneous payments)Keysend seminar video
BaseFraming and feature negotiation
TransportNoise Protocol FrameworkOverviewThe Noise Protocol Framework, The Noise Protocol Framework (video)
TransportNoise Protocol FrameworkNoise XKHandshake patterns, Noise Explorer
Atomic SwapsIntroductionOverviewWhat are Atomic Swaps? A Beginner’s Guide, Atomic Swaps: How the Lightning Network Extends to Altcoins, Atomic Swaps - Jimmy Song, Atomic Swaps on the Lightning Network - video
Atomic SwapsSubmarine swaps vs. reverse swapsOverviewSubmarine swaps seminar video (first 25:30), Onboarding the Masses: Submarine Swaps, Submarine Swaps on the Lightning Network
Atomic SwapsLoopsOverviewLoops seminar video (starting at 25:52), Announcing Lightning Loop Alpha: An Easier Way to Receive on Lightning, Loop Out In-depth
LimitationsOverviewLightning Network 2.0, Major Limitations of the Lightning Network
LimitationsUpdate layerIncentive problems in the networkIncentive problems in the network seminar video
LimitationsUpdate layerFee managementFee management seminar video
LimitationsOnion RoutingRouting failuresRouting failures seminar video
LimitationsPayment UXPayment UX seminar video
LimitationsLightweight clientsLimitations of lightweight clients seminar video
LimitationsRunning Lightning in ProductionRunning Lightning in Production seminar video
LimitationsFailure modes in actionFailure modes in action repo
BOLTs 1.1 and the futureProposal StatesLightning Specification 1.1 Proposal States, Lightning User Experience: A Day in the Life of Carol
BOLTs 1.1 and the futureLiquiditySplicingSplicing seminar video, Channel top-up, Splicing Proposal
BOLTs 1.1 and the futureLiquidityDual Funded channelsDual funded channels seminar video, Proposal for Advertising Channel Liquidity
BOLTs 1.1 and the futurePaymentsAtomic Multi-Path Payments over LightningAMP: Atomic Multi-Path Payments mailing list post, Atomic Multi-Path Payments seminar video, Base AMP, Specific fee routing for multi-path payments
BOLTs 1.1 and the futureRoutingRendezvous routingRendezvous mechanism on top of Sphinx, Rendezvous Routing seminar video
The Far FutureRoutingJust in time routingJust in Time Routing (JIT-Routing) and a channel rebalancing heuristic as an add on for improved routing success in BOLT 1.0
The Far FutureOnboardingMultiparty channels / channel factoriesWhat are Channel Factories and how do they work?, Multi-party channels/Channel factories seminar video, Onboarding the Masses: Channel Factories
The Far FuturePaymentsDecorelationPayment Decorrelation
The Far FuturePaymentsStreaming PaymentsBOLT 11, real time micro payments, and route redundancy
The Far FuturePaymentsRefunds
The Far FuturePaymentsFast Failure
The Far FutureScriptsScriptless Scripts with ECDSAScriptless Scripts with ECDSA
Privacy considerationsHow the Lightning Network Layers Privacy on Top of Bitcoin
Privacy considerationsWatchtowersIncentivizing payment channel watchtower, Trustless Watchtowers, Architecture of LND Watchtowers Incentivizing Payment Channel Watchtowers
Privacy considerationsChannel probing attack for channel balanceOn the Difficulty of Hiding the Balance of Lightning Network Channels
Privacy considerationsChannel probing attack for channel balance code exerciseCode exercise seminar introduction, Channel probing attack code exercise repo
Privacy considerationsPayment decorrelationDecorrelation of Lightning Payments
Privacy considerationsSNARKsBetter privacy with SNARKs
Privacy considerationsOpen ended questionsDiscussion questions
Security/Attack vectorsAttack vector introAttack vector intro seminar video
Security/Attack VectorsDenial of Service attacksPayment channel congestion via spam-attack
ConsiderationsDesired topology of a high functional networkOverviewNetwork Topology creation/maintenance seminar video
ConsiderationsDesired topology of a high functional networkAutopilotImproving the autopilot of bitcoin’s lightning network, Autopilot PR in c-lightning
ConsiderationsDesired topology of a high functional networkChannel managementLightning network topology Considerations, Rebalancing in the lightning network: Analysis and implications
ConsiderationsDesired topology of a high functional networkCyclic SuperhubsCyclic Superhubs as Solution Towards Reasonable Lightning Network Topology
ConsiderationsNeutrinoNeutrino: The Lighter Side of Lightning
ConsiderationsPitfalls of concurrent requests
ConsiderationsBroadcasting channel updatesWhat is the status of the Lightning Network?
ImplementationsLNDLightning Network Daemon
ImplementationsptarmiganPtarmigan
ImplementationselectrumElectrum Implementation in Python, see electrum/ln*.py
Implementationsrust-lightningIncomplete implementationRust-Lightning
Implementationsc-lightningc-lightning — a Lightning Network implementation in C
ImplementationsEclairEclair - A scala implementation of the Lightning Network
ImplementationsDotNetLightningIncomplete implementationLightning network daemon with F#
ImplementationsgeelightningIncomplete implementationgeelightning in Rust
Setting up a nodeBitcoin Lightning Network #1: Can I compile and run a node?, Beginner’s Guide to Lightning️ on a Raspberry Pi, My Lightning Node setup with c-lightning, Fastest and cheapest way to get your own Lightning Node running - on a RaspberryPi with a nice LCD

CVEs

IdentifiersTypeSources
CVE-2019-12998 / CVE-2019-12999 / CVE-2019-13000CVE DisclosureFull Disclosure, Video Explanation

Acknowledgements

Special thanks to Carla Kirk-Cohen, Giancarlo Giuffra, Fabian Jahr, Christian Decker, Fabrice Drouin, René Pickhardt, and Alex Bosworth for their help in putting together the above resources.