In earlier chapters, a shared folder acted as a central authority controlling block publication. This chapter replaces that folder with a fully decentralized peer-to-peer (P2P) network. Once the shared folder is gone, there’s no single point of authority to decide which blocks can be published, improving censorship resistance.
Q: How does a P2P network help remove the final central authority?
In a P2P network, all full nodes and miners connect directly with each other instead of relying on a single shared folder. This way, no single party can block or censor blocks/transactions because information can travel across alternate paths in the network.
Nodes communicate over TCP (Transmission Control Protocol) connections, speaking the “Bitcoin network protocol.” Key message types include:
inv: “I have these transaction or block IDs”getdata: “Send me the data for these IDs”tx: “Here’s the full transaction data”block: “Here’s the full block data”headers: “Here are block headers”inv message listing two transactions and one block ID.
Q: Why do nodes first send inv before tx (or block)?
Sending inv allows the receiving peer to decide if it wants the data
(maybe it already has it). This saves bandwidth.
Let’s see how a single transaction propagates. Scenario: John buys a cookie from the cafe:
inv with the txid. Tom replies with getdata,
and John’s wallet sends tx.inv to his peers (Lisa, Qi, Rashid, cafe, etc.). Each peer that
doesn’t have the transaction will getdata and receive tx.invs the cafe’s
lightweight wallet. The cafe’s wallet getdata, and receives
tx. The cafe sees a new pending transaction.headers first, peers reply
with getdata, and he sends block. The block propagates
network-wide.merkleblock) for that block, showing the transaction
is included. They display “1 confirmation.”A new full node needs to:
Q: Where does the node get peer addresses?
Possible sources:
getaddr) for more addresses.Q: How does the node synchronize the chain?
getheaders / headers exchange).getdata / block exchanges.inv, letting them request
the data if needed.End of Study Notes for Chapter 8. The last piece of centralization (the shared folder) is gone, replaced by a robust P2P network ensuring true decentralization and censorship resistance.