Where can I find a detailed network protocol spec?

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

Posted 2019-07-19T09:33:17.273

Reputation: 1

Question was closed 2019-07-19T12:46:42.823

Possible duplicate of 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 2019-07-19T10:55:26.743

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 2019-07-19T12:41:35.070

No answers