All messages sent between nodes have headers. The initial handshake messages are sent unencrypted, and all other messages are encrypted and authenticated using the keys that are generated during the initial handshake.
All messages payloads are serialized using Protocol Buffers.
To develop with protocol buffers you will need to install the protocol buffer compiler (to compile .proto files) and the protocol buffer runtime for your chosen programming language.
Protocol buffers currently support development in Java, Python, Go, Rust, C, C++, Objective-C, C#, Dart, Ruby, Perl, Haskell, Javascript, and more.
The unencrypted message
Size (bytes)
Name
Data Type
Description
4
magic
uint32
Magic value to specify the message's network
4
length
uint32
Payload length
4
type
uint32
Message type
4
checksum
uint32
First 4 bytes of sha256 hash of JSON-serialized message