Chapter 8. Peer-to-peer network

 

This chapter covers

  • Removing the last central authority: the shared folder
  • Following a transaction in the peer-to-peer network
  • Leaving behind the silly cookie tokens
  • Bootstrapping the peer-to-peer network

Let’s talk about the elephant in the room: the shared folder. All blocks the miners produce must pass through the shared folder on their way to other full nodes and miners. This chapter will remove the central shared folder and replace it with a decentralized peer-to-peer network (figure 8.1). The peer-to-peer network lets full nodes (including miners) send blocks directly to each other. When nodes can talk directly to each other, we no longer need a central point of authority for communication.

Figure 8.1. Bitcoin’s peer-to-peer network

Another issue we haven’t talked much about is how wallets send transactions via email to the miners. When a new miner joins the system, all wallets need to update their miner list. Not cool. With this nice peer-to-peer network of nodes, wallets can broadcast their transactions to all miners without knowing who or where they are.

We’ll follow a transaction’s path through the network, both as an unconfirmed transaction and, eventually, as part of a mined block. The transaction will start in John’s wallet and end as a confirmed transaction in the blockchain with Bob’s wallet being notified about it.

The shared folder

 
 
 
 

Let’s build a peer-to-peer network

 
 

How do peers talk?

 
 

The network protocol

 
 
 
 

Leaving the cookie token system

 
 
 
 

Bootstrapping the network

 
 
 

Running your own full node

 
 
 

Recap

 
 

Exercises

 
 
 
 

Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage