Mastering the Lightning Network: A Second Layer Blockchain Protocol for Instant Bitcoin Payments
Book information
Description
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 scalingThe Basis of Lightning Technology (BOLT) standards documentsThe five layers of the Lightning Network Protocol SuiteLN basics, including wallets, nodes, and how to operate oneLightning payment channels, onion routing, and gossip protocolFinding paths across payment channels to transport Bitcoin off-chain from sender to recipient 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 books
Mastering the Lightning Network: A Second Layer Blockchain Protocol for Instant Bitcoin Payments
2021 · EPUB
Mastering the Lightning Network: A Second Layer Blockchain Protocol for Instant Bitcoin Payments
2022 · AZW3
Mastering the Lightning Network: A Second Layer Blockchain Protocol for Instant Bitcoin Payments
2021 · PDF
Mastering Bitcoin
2023 · EPUB
Bitcoin dla zaawansowanych. Programowanie z użyciem otwartego łańcucha bloków. Wydanie II
2018 · EPUB
Bitcoin dla zaawansowanych. Programowanie z użyciem otwartego łańcucha bloków. Wydanie II
2018 · PDF
Mastering Bitcoin: Programming the Open Blockchain
2023 · PDF
Mastering Bitcoin: Programming the Open Blockchain
2023 · EPUB