Message Protocol
Message Format
┌────────────────────────────────────────────────┐
│ Magic Number (4 bytes): 0x4B594B4E ("KYKN") │
├────────────────────────────────────────────────┤
│ Version (1 byte) │
├────────────────────────────────────────────────┤
│ Message Type (1 byte) │
├────────────────────────────────────────────────┤
│ Flags (2 bytes) │
├────────────────────────────────────────────────┤
│ Sequence Number (4 bytes) │
├────────────────────────────────────────────────┤
│ Payload Length (4 bytes) │
├────────────────────────────────────────────────┤
│ Payload (variable) │
├────────────────────────────────────────────────┤
│ MAC (16 bytes) - Poly1305 │
└────────────────────────────────────────────────┘Message Types
Type
Value
Description
Handshake Protocol
Flags
Bit
Name
Description
Encoding
Numbers
Strings
Binary Data
Lists
Payload Structures
PING/PONG
DHT_FIND_NODE
DHT_FIND_NODE Response
CHAT_MESSAGE
Compression
Fragmentation
Error Handling
Error Response
Error Codes
Code
Description
Security
Authentication
Replay Protection
Nonce Management
Last updated

