<p>A node establishes which &quot;language&quot; it will speak with other nodes per the protocol version. The protocol version defines which messages exist and what responses are deemed acceptable to those messages.
It is still up to the nodes to establish which features they support by using the available vocabulary.</p>
<p>E.g. consider a node with a complete copy of the blockchain vs a pruned node. Both nodes may speak the same version of the protocol, both will advertise the <code>NODE_NETWORK_LIMITED</code> service, but only one will advertise <code>NODE_NETWORK</code>. Asking the pruned node for an old block would be a violation because they did not advertise <code>NODE_NETWORK</code>, even though their protocol version enables them to understand perfectly what was requested.</p>

CC BY-SA 4.0
2023-12-27T18:25:39.630Z
Yes. The example that Pieter Wuille left in the comment (link is above) is also good and explains it well
Cosmos
CC BY-SA 4.0
2023-12-27T16:47:44.227Z
2023-12-27T16:47:44.227Z
Murch
<p>The purpose of version field in version messages exchanged during establishing a connection is for the nodes to see which features they can negotiate with each other. <strong>The fact that some node supports a certain version does not necessarily mean that it supports all the features related to it (all the features introduced in that version or versions before).</strong> In order to see if something is really supported, some negotiation mechanism is necessary.</p>
<p>For more information see correspondence between <em>@PieterWuille</em> and myself <a href="https://bitcoin.stackexchange.com/a/121123/146389">here</a>.</p>
<p>You can see all the methods used for negotiation <a href="https://bitcoin.stackexchange.com/questions/121128/what-methods-are-used-to-negotiate-between-nodes-about-the-features-they-support">here</a>.</p>

CC BY-SA 4.0
2023-12-23T22:33:01.673Z
2023-12-23T22:33:01.673Z
Cosmos
<p>I thought that the version messages that are exchanged when establishing a connection between two nodes and the version field within them indicate what each node supports. Each version supports some new feature and then, depending on which versions are exchanged in these messages between the nodes, a smaller version of the protocol is used and each node knows what it can &quot;ask&quot; other nodes.</p>
<p>However, based on <a href="https://bitcoin.stackexchange.com/questions/121122/why-do-we-need-sendcmpct-for-getdatacmpct-low-bandwidth-relaying">this answer</a> and comment:</p>
<blockquote>
<p>Protocol version 70014 simply means the <code>sendcmpct</code> command exists, not
that compact blocks are actually supported.</p>
</blockquote>
<p>...it seems to me that my assumptions are wrong.</p>
<p>Therefore, what is the purpose of the version field in the version message</p>

<p2p><message>
What is the purpose of version field in version messages exchanged during establishing a connection?
Cosmos
# What is the purpose of version field in version messages exchanged during establishing a connection?

(Asked by: username_0 on 2023-12-23)

I thought that the version messages that are exchanged when establishing a connection between two nodes and the version field within them indicate what each node supports. Each version supports some new feature and then, depending on which versions are exchanged in these messages between the nodes, a smaller version of the protocol is used and each node knows what it can "ask" other nodes.

However, based on [this answer](https://bitcoin.stackexchange.com/questions/121122/why-do-we-need-sendcmpct-for-getdatacmpct-low-bandwidth-relaying) and comment:

> Protocol version 70014 simply means the `sendcmpct` command exists, not
> that compact blocks are actually supported.

...it seems to me that my assumptions are wrong.

Therefore, what is the purpose of the version field in the version message

**Tags:** p2p, message


---

## 2 answers

### Answer by username_1 on 2023-12-27. Score: 3 | Accepted answer

A node establishes which "language" it will speak with other nodes per the protocol version. The protocol version defines which messages exist and what responses are deemed acceptable to those messages.
It is still up to the nodes to establish which features they support by using the available vocabulary.

E.g. consider a node with a complete copy of the blockchain vs a pruned node. Both nodes may speak the same version of the protocol, both will advertise the `NODE_NETWORK_LIMITED` service, but only one will advertise `NODE_NETWORK`. Asking the pruned node for an old block would be a violation because they did not advertise `NODE_NETWORK`, even though their protocol version enables them to understand perfectly what was requested.

> **Comments:**
> **username_0**: Yes. The example that Pieter Wuille left in the comment (link is above) is also good and explains it well  

---

### Answer by username_0 on 2023-12-23. Score: 1

The purpose of version field in version messages exchanged during establishing a connection is for the nodes to see which features they can negotiate with each other. **The fact that some node supports a certain version does not necessarily mean that it supports all the features related to it (all the features introduced in that version or versions before).** In order to see if something is really supported, some negotiation mechanism is necessary.

For more information see correspondence between *@PieterWuille* and myself [here](https://bitcoin.stackexchange.com/a/121123/146389).

You can see all the methods used for negotiation [here](https://bitcoin.stackexchange.com/questions/121128/what-methods-are-used-to-negotiate-between-nodes-about-the-features-they-support).


---

