Chapter 3. How the Lightning Network Works

Now that we’ve followed Alice as she set up a Lightning wallet and purchased a coffee from Bob, we’ll look under the hood and unpack the different components of the Lightning Network involved in that process. This chapter will give a high-level overview and will not delve into all the technical details. The goal is rather to help you to become aware of the most important concepts and building blocks of the Lightning Network.

If you have experience in computer science, cryptography, Bitcoin, and protocol development, then this chapter should be enough for you to be able to fill out the connecting details by yourself. If you are less experienced, this chapter will give you a good enough overview so you have an easier time understanding the formal protocol specifications, known as BOLTs (Basis of Lightning Technology). If you are a beginner, this chapter will help you better understand the technical chapters of the book.

If you need a refresher on the fundamentals of Bitcoin, you can find a summary review of the following topics in Appendix A:

  • Keys and addresses

  • Hash functions

  • Digital signatures

  • Transaction structure

  • Transaction inputs and outputs

  • Transaction chaining

  • Bitcoin Script

  • Multisignature addresses and scripts

  • Timelocks

  • Complex scripts

We’ll start with a one-sentence definition of what the Lightning Network is and break it down in the remainder of this chapter.

The Lightning Network is a peer-to-peer network ...

Get Mastering the Lightning Network now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.