/lightning-curriculum

Lightning Network Protocol Development 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.

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 three portions to this curriculum:

  1. Study Groups designed to provide bite-sized grouped subjects that you can either complete bookclub style or alone.
  2. Seminar Videos recorded during the Summer 2019 Chaincode Residency.
  3. Lightning Syllabus a collection of resources grouped by subjects.

Seminar Videos

Session Topic Link
How pieces fit together Overall picture https://youtu.be/krux2v0jt4E
How pieces fit together Update https://youtu.be/SoFlRCNdqDg
How pieces fit together Transfer https://youtu.be/CGE8I8L7BAc
How pieces fit together Multihop https://youtu.be/P7I-C0_sijg
How pieces fit together And the others that are worth mentioning but not exploring (base and transport) https://youtu.be/wyri7cc83kQ
Update layer Trampoline Payments https://youtu.be/1WmIjHrjFsg
Update layer Eltoo and the Far Future https://youtu.be/3ZjymCOmn_A
Onion Routing Atomic multi-path payments (AMP) https://youtu.be/Og4TGERPZMY
Onion Routing Keysend (formally known as spontaneous payments) https://youtu.be/zaBY9_eEQWE
Update layer - limitations Fee management https://youtu.be/r8S3iELg9_U
Onion Routing Deep Dive https://youtu.be/D4kX0gR-H0Y
Update layer - limitations Incentive problems in the network https://youtu.be/lByQUr7zPr0
Onion Routing- limitations Routing failures https://youtu.be/z5vEyvc2vrE
Update layer Gossip Protocol/Path Finding https://youtu.be/MeEFUaRnMak
Limitations Payment UX https://youtu.be/rVgAHMgMCzk
Limitations Limitations of lightweight clients https://youtu.be/ULVItljEiFE
Limitations Running Lightning in Production https://youtu.be/fhmeNWczeUg
Limitations Failure modes in action https://github.com/sstone/ln-in-action
Submarine swaps/ Loops https://youtu.be/qixhNBIHDyE
Attack vectors Attack vector intro https://youtu.be/R5cSrftd8nc
Privacy Gossip protocol and privacy/How much do watchtowers need to know?/ Minimizing what is broadcasted to the base layer https://gist.github.com/adamjonas/8da156886ffa414541eaa43c0c5074ca
Privacy Channel probing attack for channel balance https://youtu.be/A7rp7bLbZoo, https://github.com/wbobeirne/channel-probing-attack
1.1 and the far future Network Topology creation/maintenance https://youtu.be/N7rlHCnaBf8
1.1 and the far future Splicing https://youtu.be/ZzSveBMtUGI
1.1 and the far future Multi-party channels/Channel factories https://youtu.be/PUDWGH_MvmQ
1.1 and the far future Rendezvous Routing https://youtu.be/Ms2WwRzBdkM
1.1 and the far future Dual funded channels https://youtu.be/5wQUMtgsnPs

Lightning Syllabus

Subjects Topics Sub-topics Sources
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? Introduction Lightning Layers How the Lightning Layers Fit Together, A Lightning Application Design Perspective
What is Lightning? Introduction History of LN History 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 ≈ Bitcoin Lightning ≈ Bitcoin
What is Lightning? Lightning ≈ Bitcoin Revisting tx malleability SF Bitcoin Devs Seminar: Transaction Malleability: Threats and Solutions
Transfer Payment channel General concept Payment Channel
Transfer Payment channel Public channel Do the channel balances get publicly announced in real-time on Lightning Network?, The open_channel Message
Transfer Payment channel Private channel Exploring Lightning Network Routing
Transfer Payment channel Channel balance (local/remote)
Transfer Payment channel Exhausted channels
Transfer Payment channel Channel reserve Rationale
Transfer Transactions BOLT BOLT #3: Bitcoin Transaction and Script Formats
Transfer Transactions Funding Transaction Funding Transactions as a Generalized Design Pattern for Offchain Protocols, Funding Transaction Output, The funding_created Message
Transfer Transactions Commitment Transaction Commitment transactions, Commitment Transaction
Transfer Transactions Closing Transaction Closing a Channel in Lighting Network, Closing Transaction
Transfer Transactions Penalty Transaction Lightning Network ‘Penalty Scenario’ Works in Old State Channel Incident, Revoked Transaction Close Handling
Transfer Transactions Mutual Close Distinguishing mutual and unilateral channel closing in the Bitcoin blockchain, Mutual Close Handling
Transfer Transactions Unilateral Close Unilateral Close Handling: Local Commitment Transaction
Transfer Transactions Fee negotiation BOLT #2: Peer Protocol for Channel Management
Transfer HTLC Overview What Are Hashed Timelock Contracts (HTLCs)? Application In Lightning Network & Payment Channels,Lightning Networks Part II: Hashed Timelock Contracts (HTLCs)
Transfer HTLC Hashlock HTLC implementation Bitcoin Core
Transfer HTLC Timelocks Bitcoin’s Time Locks, Timelock,Bitcoin Timelocks in a nutshell
Transfer HTLC Revocation Key Lightning Networks Part I: Revocable Transactions
Transfer HTLC Relative Locktime/CLTV BIP 65
Transfer HTLC Hash Pre-image What is a hash pre-image as it is used for the breach remedy?,Offered HTLC Outputs
Transfer HTLC payment basepoint/revocation basepoint Key Derivation
Transfer HTLC Per-commit secret/Commitment number Key Derivation
Transfer HTLC HTLC fulfillment/failure Removing an HTLC: update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc
Transfer Payment Invoice
Transfer Payment Payment Request
Update Invoices Bolt11 encoding BOLT #11: Invoice Protocol for Lightning Payments
Update Gossip Gossip Protocol BOLT #7: P2P Node and Channel Discovery
Update Transactions LN-Penalty
Update Transactions Eltoo payment channels eltoo: A Simple Layer2 Protocol for Bitcoin
Multihop Sphinx Overview Sphinx Packet, Using Sphinx to Improve Onion Routing Circuit Construction (short paper)⋆, Sphinx: A Compact and Provably Secure Mix Format, Security Analysis of the Lightning Network
Multihop Onion Routing Overview Sphinx and Onion routing, Onion Routing with HTLCs on the Lightning Network explained! - Beginner / Experts
Multihop Onion Routing Public vs. Private channel Do the channel balances get publicly announced in real-time on Lightning Network?,Exploring Lightning Network Routing
Multihop Onion Routing Channel announcements BOLT #2: Peer Protocol for Channel Management
Multihop Onion Routing Routing fees The Lightning Network (Part 2) – Routing Fee Economics
Multihop Onion Routing Expiry delta cltv_expiry_delta Selection
Multihop Onion Routing Route hints Exploring Lightning Network Routing
Base Framing and feature negotiation
Transport Noise Protocol Framework Overview The Noise Protocol Framework, The Noise Protocol Framework (video)
Transport Noise Protocol Framework Noise XK Handshake patterns, Noise Explorer
Atomic Swaps Introduction Overview What are Atomic Swaps? A Beginner’s Guide,Atomic Swaps: How the Lightning Network Extends to Altcoins, Atomic Swaps, Atomic Swaps on the Lightning Network
Atomic Swaps Submarine swaps vs. reverse swaps Overview Onboarding the Masses: Submarine Swaps, Submarine Swaps on the Lightning Network
Atomic Swaps Loops Overview Announcing Lightning Loop Alpha: An Easier Way to Receive on Lightning,Loop Out In-depth
Current Limitations Lightning Network 2.0, Major Limitations of the Lightning Network
BOLTs 1.1 and the future Proposal States Lightning Specification 1.1 Proposal States, Lightning User Experience: A Day in the Life of Carol
BOLTs 1.1 and the future Liquidity Splicing Channel top-up, Splicing Proposal
BOLTs 1.1 and the future Liquidity Dual Funded channels Proposal for Advertising Channel Liquidity
BOLTs 1.1 and the future Payments AMP AMP: Atomic Multi-Path Payments over Lightning, Base AMP
BOLTs 1.1 and the future Routing Rendezvous routing Rendez vous mechanism on top of Sphinx
The Far Future Routing Just in time routing Just in Time Routing (JIT-Routing) and a channel rebalancing heuristic as an add on for improved routing success in BOLT 1.0
The Far Future Onboarding Multiparty channels / channel factories What are Channel Factories and how do they work?, Onboarding the Masses: Channel Factories
The Far Future Payments Decorelation Payment Decorrelation
The Far Future Payments Streaming Payments BOLT 11, real time micro payments, and route redundancy
The Far Future Payments Refunds
The Far Future Payments Fast Failure
The Far Future Scripts Scriptless Scripts with ECDSA Scriptless Scripts with ECDSA
Privacy considerations How the Lightning Network Layers Privacy on Top of Bitcoin
Privacy considerations Watchtowers Incentivizing payment channel watchtower,Trustless Watchtowers, Architecture of LND Watchtowers Incentivizing Payment Channel Watchtowers
Privacy considerations Channel probing attack for channel balance On the Difficulty of Hiding the Balance of Lightning Network Channels
Privacy considerations Decorrelation of lightning payments Decorrelation of Lightning Payments
Privacy considerations SNARKs Better privacy with SNARKs
Security/Attack Vectors Denial of Service attacks State of the Crypto: Lightning Network DDoS’d, Payment channel congestion via spam-attack
Considerations Desired topology of a high functional network Autopilot Improving the autopilot of bitcoin’s lightning network, Autopilot PR in c-lightning
Considerations Desired topology of a high functional network Channel management Lightning network topology Considerations, Rebalancing in the lightning network: Analysis and implications
Considerations Desired topology of a high functional network Cyclic Superhubs Cyclic Superhubs as Solution Towards Reasonable Lightning Network Topology
Considerations Neutrino Exploring Neutrino, Neutrino: The Lighter Side of Lightning
Considerations Pitfalls of concurrent requests
Considerations Broadcasting channel updates What is the status of the Lightning Network?
Implementations LND Lightning Network Daemon
Implementations ptarmigan Ptarmigan
Implementations electrum Electrum Implementation in Python, see electrum/ln*.py
Implementations rust-lightning Incomplete implementation Rust-Lightning
Implementations c-lightning c-lightning — a Lightning Network implementation in C
Implementations Eclair Eclair - A scala implementation of the Lightning Network
Implementations DotNetLightning Incomplete implementation Lightning network daemon with F#
Implementations geelightning Incomplete implementation geelightning in Rust
Setting up a node Bitcoin 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

Acknowledgements

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