0

I have been trying for a while to understand how the bitcoin network works, which I (kind of) do on a high level. However, all of the sources I read don't go into the details of the protocol that nodes use in order to communicate with each other.

I'm trying to make a client that directly asks other nodes for the last few blocks in the blockchain and displays it to the user. I know this isn't nearly as secure tracing all the blocks back to the genesis block, but I'm doing this mostly for fun and education. So I don't care that much about security.

I can't find any clear specifications for the protocol. There must be something obvious I'm missing, but I don't know what it is.

Where can I start, or how do I know what should be sent to other nodes in order to request a block?

Thanks in advance.


Sorry if sound too stupid, it's just that I'm new to programming blockchain nodes and I don't know where to start...

dejavie21
  • 1
  • 1
  • Possible duplicate of [What happens if a miner receives a block but not its previous?](https://bitcoin.stackexchange.com/questions/87521/what-happens-if-a-miner-receives-a-block-but-not-its-previous). Although the linked question does not seem to be same as this question asked, but the answer contains detailed spec of how block syncing takes place. – Ugam Kamat Jul 19 '19 at 10:55
  • Actually, that seems pretty helpful. Also, when I googled the format of a version message, I got to this site that explains the protocol quite extensively: https://bitcoin.org/en/p2p-network-guide#connecting-to-peers Thanks @UgamKamat – dejavie21 Jul 19 '19 at 12:41

0 Answers0