<p>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. </p>

<p>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.</p>

<p>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.</p>

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

<p>Thanks in advance.</p>

<hr>

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

CC BY-SA 4.0
2019-07-19T10:55:26.743Z
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
CC BY-SA 4.0
2019-07-19T12:41:35.070Z
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
<block><development><protocol><nodes>
Where can I find a detailed network protocol spec?
dejavie21
# Where can I find a detailed network protocol spec?

(Asked by: username_0 on 2019-07-19)

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...*

**Tags:** block, development, protocol, nodes

> **Comments:**
> **username_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.  
> **username_0**: 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 @username_1  

---

## 0 answers

