diff --git a/protocol/network/messages/version.md b/protocol/network/messages/version.md index 24bfd62..c3f484a 100644 --- a/protocol/network/messages/version.md +++ b/protocol/network/messages/version.md @@ -19,8 +19,12 @@ The node connection is not considered established until both nodes have sent and | block height | 4 bytes | unsigned integer[(LE)](/protocol/misc/endian/little) | The height of the block with the highest height known to the sending node. | | relay flag | 1 byte | boolean | Indicates whether the sending node would like all broadcasted transactions relayed to it. See [BIP-37](/protocol/forks/bip-0037). This flag is sometimes referred to as "fRelay". | -Note: appending extra data after the `relay flag` is ignored. -Historically, extra data after the `relay flag` would sometimes result in the connection being banned, although this is no longer standard behavior. +Note: Protocol version `70001` introduced the optional `relay flag`. +Transmitting the `relay flag` byte to Nodes with a version less than `70001` may result in incompatibility with versions that validate the Version message for a specific byte count. + +Note: Historically, transmitting extra data after the `relay flag` would result in the connection being banned by some Nodes. +Modern Nodes ignore extra data after the `relay flag`. + ## Version Number diff --git a/protocol/network/node-handshake.md b/protocol/network/node-handshake.md index f0683e0..da0e153 100644 --- a/protocol/network/node-handshake.md +++ b/protocol/network/node-handshake.md @@ -1 +1,33 @@ -# Node Handshake \ No newline at end of file +# Node Handshake + +When nodes connect the issue a connection handshake in order to ensure compatibility between the two nodes. +The handshake informs the peer of its: + +- Network Protocol Version +- Block Height +- Supported [Network Services](/protocol/network/messages/version#services-bitmask) + +Either Node may then decide to disconnect from the peer. + +Neither Node should send any data other than a [Version](/protocol/network/messages/version) message to the peer until it has also received a Version message. +Once a node has received (and sent) a Version message, it may send a [Verack](/protocol/network/messages/verack) message. +Once each Node has sent and received a Verack message, normal node operation may begin. + +## Sequence Diagram + +When a local Node initiates a connection to a remote Node, the remote Node will remain silent it receives a version message. + +``` +# SequenceDiagram + +title Node Handshake + +Local->>Remote: Sends Version Message +note right of Remote: Version Message contains Local's Version Number. +Remote->>Local: Sends Version Message +note left of Local: Version Message contains Remote's Version Number. +Remote->>Local: Sends Verack Message +note left of Local: Local uses the lower of the two Version Numbers, if compatible. +Local->>Remote: Sends Verack Message +note right of Remote: Remote uses the lower of the two Version Numbers, if compatible. +``` \ No newline at end of file