From 14b0e14f0d1059d98f963e5edd9d7872069a8a65 Mon Sep 17 00:00:00 2001 From: fa706e5b83254c27135bc4b03060ed58ecc67dfa84a6597d01a6ea7c71ae1615 Date: Wed, 18 Dec 2019 15:07:17 -0500 Subject: [PATCH 1/2] Commit. --- home.md | 1 + protocol/network/messages.md | 2 +- protocol/network/node-handshake.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 protocol/network/node-handshake.md diff --git a/home.md b/home.md index 12f0ba3..1d243fc 100644 --- a/home.md +++ b/home.md @@ -106,6 +106,7 @@ - thinblock - get_xblocktx - xblocktx + - [Node Handshake](/protocol/network/node-handshake) - Simple Payment Verification (SPV) - Bloom Filters - Simple Ledger Protocol diff --git a/protocol/network/messages.md b/protocol/network/messages.md index b81b962..7fc3dd7 100644 --- a/protocol/network/messages.md +++ b/protocol/network/messages.md @@ -23,7 +23,7 @@ The P2P network has a variety of message types. All P2P messages follow a binar ### Net Magic -The `net magic` field is always `E3E1F3E8`. Any message received that does not begin with the `net magic` should be ignored. +The network identifier is used to separate blockchains and test networks. This reduces unnecessary load on peers, allowing them to rapidly ban nodes rather then forcing the peer to do a blockchain analysis before banning or disconnecting. For Bitcoin Cash main net, the `net magic` field is always `E3E1F3E8`. Any message received that does not begin with the `net magic` is invalid. The `net magic` is designed to be unlikely to occur in normal data--the characters are rarely used upper ASCII, are not valid as UTF-8, and produce a large 32-bit integer with any alignment. `E3E1F3E8` is the ASCII string, "cash", with each byte's highest bit set. diff --git a/protocol/network/node-handshake.md b/protocol/network/node-handshake.md new file mode 100644 index 0000000..f0683e0 --- /dev/null +++ b/protocol/network/node-handshake.md @@ -0,0 +1 @@ +# Node Handshake \ No newline at end of file From 165d075a65ee9ad0862649a929f1ecb78ad85e10 Mon Sep 17 00:00:00 2001 From: fa706e5b83254c27135bc4b03060ed58ecc67dfa84a6597d01a6ea7c71ae1615 Date: Wed, 18 Dec 2019 15:17:50 -0500 Subject: [PATCH 2/2] Commit. --- protocol/network/messages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/network/messages.md b/protocol/network/messages.md index 7fc3dd7..67aa340 100644 --- a/protocol/network/messages.md +++ b/protocol/network/messages.md @@ -29,7 +29,7 @@ The `net magic` is designed to be unlikely to occur in normal data--the characte ### Command String -The `command string` is a fixed-length 12 byte ASCII string. The command string is used to determine the type of message being transmitted. Messages with unknown an unrecognized `command string` are ignored. +The `command string` is a fixed-length 12 byte ASCII string. Commands may not be longer than 12 bytes. Commands that are shorter than 12-bytes are right-padded with null bytes (`0x00`). The command string is used to determine the type of message being transmitted. Messages with an unrecognized `command string` are ignored. The following messages are considered standard by all node implementations.