Version Handshake

From Bitcoin Wiki
Jump to navigation Jump to search

On connect, version and verack messages are exchanged, in order to ensure compatibility between peers.

Version Handshake

When the local peer (L) connects to a remote peer (R), the remote peer will not send any data until it receives a version message.

L -> R: Send version message with the local peer's version
R -> L: Send version message back
R -> L: Send verack message
R:      Sets version to the minimum of the 2 versions
L -> R: Send verack message after receiving version message from R
L:      Sets version to the minimum of the 2 versions

Note: Versions below 31800 are no longer supported.[1]

Feature negotiation

Some newer messages are sent during the handshake, after the peer's version message arrives and before the verack message is sent:

  • wtxidrelay: the node wants transactions announced by their wtxid. It is sent only to peers with protocol version 70016 or higher.[2]
  • sendaddrv2: the node understands the addrv2 address format.[3]

References