<div><p>The Lightning Network (LN) is a rapidly growing second-layer payment protocol that works on top of Bitcoin to provide near-instantaneous transactions between two parties. With this practical guide, authors Andreas M. Antonopoulos, Olaoluwa Osuntokun, and Rene Pickhardt explain how this advan
Mastering the Lightning Network: A Second Layer Blockchain Protocol for Instant Bitcoin Payments
β Scribed by Andreas M. Antonopoulos, Olaoluwa Osuntokun, RenΓ© Pickhardt
- Publisher
- O'Reilly Media
- Year
- 2021
- Tongue
- English
- Leaves
- 393
- Edition
- 1
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
The Lightning Network (LN) is a rapidly growing second-layer payment protocol that works on top of Bitcoin to provide near-instantaneous transactions between two parties. With this practical guide, authors Andreas M. Antonopoulos, Olaoluwa Osuntokun, and Rene Pickhardt explain how this advancement will enable the next level of scale for Bitcoin, increasing speed and privacy while reducing fees.
Ideal for developers, systems architects, investors, and entrepreneurs looking to gain a better understanding of LN, this book demonstrates why experts consider LN a critical solution to Bitcoin's scalability problem. You'll learn how LN has the potential to support far more transactions than today's financial networks.
This book examines:
- How the Lightning Network addresses the challenge of blockchain scaling
- The Basis of Lightning Technology (BOLT) standards documents
- The five layers of the Lightning Network Protocol Suite
- LN basics, including wallets, nodes, and how to operate one
- Lightning payment channels, onion routing, and gossip protocol
- Finding paths across payment channels to transport Bitcoin off-chain from sender to recipient
β¦ Table of Contents
Mastering Lightning
Mastering the Lightning Network
A Second Layer Blockchain Protocol for Instant Bitcoin Payments
Revision History for the First Edition
About the Authors
Preface
How to Use This Book
Intended Audience
Conventions Used in This Book
Code Examples
Using Code Examples
References to Companies and Products
Addresses and Transactions in This Book
OβReilly Online Learning
How to Contact Us
Acknowledgments By Andreas
Acknowledgments By RenΓ©
Acknowledgments by Olaoluwa Osuntokun
Contributions
Sources
Glossary
Understanding the Lightning Network
Introduction
Lightning Network Basic Concepts
Trust in Decentralized Networks
Fairness Without Central Authority
Motivation for the Lightning Network
The Lightning Networkβs Defining Features
Lightning Network Use Cases, Users, and Their Stories
Chapter Summary
Getting Started
Aliceβs First Lightning Wallet
Lightning Nodes
Lightning Explorers
Lightning Wallets
Balancing Complexity and Control
Downloading and Installing a Lightning Wallet
Creating a New Wallet
Loading Bitcoin onto the Wallet
From Bitcoin to Lightning Network
Buying a Cup of Coffee Using the Lightning Network
Conclusion
How the Lightning Network Works
What Is a Payment Channel?
Payment Channel Basics
Routing Payments Across Channels
Payment Channels
Invoices
Delivering the Payment
Source-Based Pathfinding
Peer-to-Peer Communication Encryption
Thoughts About Trust
Comparison with Bitcoin
Commonality of Bitcoin and Lightning
Conclusion
Lightning Node Software
Lightning Development Environment
Docker Containers
Bitcoin Core and Regtest
The c-lightning Lightning Node Project
The Lightning Network Daemon (LND) Node Project
The Eclair Lightning Node Project
Building a Complete Network of Diverse Lightning Nodes
Conclusion
Operating a Lightning Network Node
Choosing Your Platform
Using an Installer or Helper
Choose Your Lightning Node Implementation
Installing a Bitcoin or Lightning Node
Security of Your Node
Node and Channel Backups
Lightning Node Uptime and Availability
Channel Management
Routing Fees
Node Management
Conclusion
The Lightning Network in Detail
Lightning Network Architecture
The Lightning Network Protocol Suite
Lightning in Detail
Payment Channels
A Different Way of Using the Bitcoin System
Bitcoin Ownership and Control
Constructing a Payment Channel
Constructing the Channel
Sending Payments Across the Channel
The Commitment Transaction
Advancing the Channel State
Closing the Channel (Cooperative Close)
Conclusion
Routing on a Network of Payment Channels
Routing a Payment
Routing versus Pathfinding
Creating a Network of Payment Channels
Fairness Protocol
Revisiting the Tipping Example
Hash Time-Locked Contracts
Conclusion
Channel Operation and Payment Forwarding
Local (Single Channel) versus Routed (Multiple Channels)
Forwarding Payments and Updating Commitments with HTLCs
Forwarding Payments with HTLCs
Multiple HTLCs
HTLC Fulfillment
Removing an HTLC Due to Error or Expiry
Making a Local Payment
Conclusion
Onion Routing
A Physical Example Illustrating Onion Routing
Introduction to Onion Routing of HTLCs
Wrapping the Onion Layers
Sending the Onion
Returning Errors
Onion Error Failure Types
Stuck payments
Keysend Spontaneous Payments
Conclusion
Gossip and the Channel Graph
Peer Discovery
The Channel Graph
Gossip Protocol Messages
Ongoing Channel Graph Maintenance
Conclusion
Pathfinding and Payment Delivery
Pathfinding in the Lightning Protocol Suite
Pathfinding: What Problem Are We Solving?
Pathfinding and Payment Delivery Process
Channel Graph Construction
Finding Candidate Paths
Payment Delivery (Trial-and-Error Loop)
Multipart Payments (MPP)
Conclusion
Wire Protocol: Framing and Extensibility
Messaging Layer in the Lightning Protocol Suite
Wire Framing
Type-Length-Value (TLV) Message Extensions
Type-Length-Value (TLV) Format
Feature Bits and Protocol Extensibility
Conclusion
Lightningβs Encrypted Message Transport
Encrypted Transport in the Lightning Protocol Suite
Introduction
The Channel Graph as Decentralized Public Key Infrastructure
Why Not TLS?
The Noise Protocol Framework
Lightning Encrypted Transport in Detail
Conclusion
Lightning Payment Requests
Invoices in the Lightning Protocol Suite
Introduction
Lightning Payment Requests versus Bitcoin Addresses
BOLT #11: Lightning Payment Request Serialization and Interpretation
Conclusion
Security and Privacy of the Lightning Network
Why Is Privacy Important?
Definitions of Privacy
Anonymity Set
Differences Between the Lightning Network and Bitcoin in Terms of Privacy
Attacks on Lightning
Cross-Layer De-Anonymization
Lightning Graph
Centralization in the Lightning Network
Economic Incentives and Graph Structure
Practical Advice for Users to Protect Their Privacy
Unannounced Channels
Routing Considerations
Conclusion
References and Further Reading
Conclusion
Decentralized and Asynchronous Innovation
Lightning Applications (LApps)
Ready, Set, Go!
Appendix A: Bitcoin Fundamentals Review
Keys and Digital Signatures
Bitcoin Transactions
Bitcoin Script
Appendix B: Docker Basic Installation and Use
Installing Docker
Basic Docker Commands
Conclusion
Appendix C: Wire Protocol Messages
Message Types
Message Structure
Appendix D: Sources and License Notices
Sources
BTCPay Server
Lamassu Industries AG
Onion Error Failure Types
Colophon
π SIMILAR VOLUMES
The Lightning Network (LN) is a rapidly growing second-layer payment protocol that works on top of Bitcoin to provide near-instantaneous transactions between two parties. With this practical guide, authors Andreas M. Antonopoulos, Olaoluwa Osuntokun, and Rene Pickhardt explain how this advancement w
<p><span>The Lightning Network (LN) is a rapidly growing second-layer payment protocol that works on top of Bitcoin to provide near-instantaneous transactions between two parties. With this practical guide, authors Andreas M. Antonopoulos, Olaoluwa Osuntokun, and Rene Pickhardt explain how this adva
Join the technological revolution that's taking the world of finance by storm. <i>Mastering Bitcoin</i> is your guide through the seemingly complex world of bitcoin, providing the knowledge you need to participate in the internet of money. Whether you're building the next killer app, investing in a
<p>Join the technological revolution that's taking the financial world by storm. <i>Mastering Bitcoin</i> is your guide through the seemingly complex world of bitcoin, providing the knowledge you need to participate in the internet of money. Whether you're building the next killer app, investing in