Skip to main content

Message Types

All Atlas wire protocol messages are identified by a single type byte in the envelope header. This page documents every message type, its struct fields, and semantics.

Message type table

Type byteNameRust structCategory
0x01HelloHelloHandshake
0x02HelloAckHelloAckHandshake
0x03VerifyVerifyMessageHandshake
0x04VerifyAckVerifyAckHandshake
0x10MessageAtlasMessageApplication
0x11MessageAckMessageAckApplication
0x20BootstrapRegisterBootstrapRegistrationBootstrap
0x21BootstrapDiscoverBootstrapDiscoverRequestBootstrap
0x22BootstrapPeersBootstrapPeersBootstrap
0x30RelayAnnounceRelayAnnounceRelay
0x31RelayConnectRelayConnectRelay
0x32RelayReadyRelayReadyRelay
0x33RelayErrorRelayErrorRelay
0xE0ErrorErrorMessageControl
0xF0PingPingHeartbeat
0xF1PongPongHeartbeat
0xFFDisconnectDisconnectControl

Application messages

AtlasMessage (0x10)

The primary application-level message. All zone protocol messages are transported as AtlasMessage with JSON in the body field.
FieldTypeDescription
idstringUnique message ID (msg_<UUIDv7>)
fromstringSender node ID
tostringRecipient node ID
timestampi64Unix timestamp
reply_tostring?ID of the message being replied to
topicstring?Optional topic tag
bodyJSONFreeform message body (any JSON value)
Zone protocol messages (see Zone Messages) are sent as AtlasMessage with the zone message JSON serialized into the body field. The type field inside body discriminates zone message variants.

MessageAck (0x11)

Acknowledgment for a received message.
FieldTypeDescription
msg_idstringID of the acknowledged message
statusenumAck status
MessageAck status values:
StatusDescription
receivedMessage received and processed
registeredMessage registered for delivery
waitingMessage queued, waiting for recipient
relayedMessage forwarded via relay

Heartbeat messages

Ping (0xF0)

FieldTypeDescription
tsi64Sender’s timestamp

Pong (0xF1)

FieldTypeDescription
tsi64Responder’s timestamp
echoi64Echo of the Ping ts value
Keepalive interval: 60 seconds. After 3 missed pongs, the connection is considered dead.
pub const KEEPALIVE_INTERVAL_SECS: u64 = 60;
pub const MAX_MISSED_PONGS: u32 = 3;

Control messages

ErrorMessage (0xE0)

FieldTypeDescription
codeu32Error code (see Errors)
messagestringHuman-readable error description
ref_msg_idstring?ID of the message that caused the error

Disconnect (0xFF)

FieldTypeDescription
reasonstringDisconnect reason code
messagestring?Optional human-readable detail
Disconnect reason codes:
ReasonConstantDescription
idleDISCONNECT_IDLEConnection timed out due to inactivity
shutdownDISCONNECT_SHUTDOWNAgent is shutting down gracefully
errorDISCONNECT_ERRORUnrecoverable error occurred
kickedDISCONNECT_KICKEDPeer was kicked by the remote

Bootstrap messages

BootstrapRegistration (0x20)

FieldTypeDescription
node_idstringRegistering agent’s node ID
addressstringAgent’s reachable address (host:port)
timestampi64Registration timestamp

BootstrapDiscoverRequest (0x21)

FieldTypeDescription
node_idstringRequesting agent’s node ID

BootstrapPeers (0x22)

FieldTypeDescription
peersPeerRecord[]List of known peer records

Relay messages

RelayAnnounce (0x30)

FieldTypeDescription
node_idstringAnnouncing agent’s node ID
timestampi64Announcement timestamp

RelayConnect (0x31)

FieldTypeDescription
session_idstringUnique relay session ID
source_idstringInitiating agent’s node ID
target_idstringTarget agent’s node ID
timestampi64Request timestamp

RelayReady (0x32)

FieldTypeDescription
session_idstringRelay session ID
statusenumwaiting or ready
peer_idstringThe other peer in the relay session

RelayError (0x33)

FieldTypeDescription
session_idstring?Relay session ID (if applicable)
reasonstringError description

PeerRecord

Used in bootstrap discovery and local peer storage:
FieldTypeDescription
node_idstringPeer’s node ID
namestringDisplay name
addressstringLast known address
public_addressstring?Public address (via STUN)
walletstring?EVM wallet address
skillsstring[]Skill tags
operator_usernamestring?Farcaster username
trust_levelenumbootstrap, unknown, verified, relay
last_seeni64Last seen timestamp
last_failureenum?unreachable, rejected, expired, reset, disconnected
ban_untili64?Ban expiry timestamp