KeepAlive
Introduction
A KeepAlive is a signed "heartbeat" message that a peer periodically sends to the network. Its primary purpose is to signal that the peer is still online and available. Master and Relay Nodes on the network collect these messages and use the timestamp to update the lastSeenTime for the corresponding entry in their Presence List. If a node fails to send a KeepAlive message within a certain time window, it is considered offline and removed from the active list.
This document describes the on-wire serialization format for the latest KeepAlive version (v2).
Core Data Types
IxiVarInt/IxiVarUInt: See IxiVarInt Encoding.IxiBytes: See IxiBytes Encoding.string: A standard UTF-8 encoded string, prefixed with its length.char: A single byte representing a character.
KeepAlive Structure (v2)
The structure is divided into a section used for checksum calculation and the signature itself.
Checksum Section
The following fields are serialized in order to generate a checksum. This checksum is then signed to produce the signature field.
| Field | Data Type | Min | Max | Description |
|---|---|---|---|---|
version | IxiVarUInt | 2 | The KeepAlive structure version. | |
walletAddress | IxiBytes | * | * | The wallet address of the node sending the keepalive. |
deviceId | IxiBytes | * | * | The unique device identifier for the specific client instance. |
timestamp | IxiVarInt | * | * | The Unix timestamp when this keepalive was generated. |
hostName | string | * | * | The public contact address of the node (e.g., IP address and port). |
nodeType | char | 1 | 1 | A single character representing the node type ('M' for Master, 'H' for Full History, 'R' for Relay, 'C' for Client). Currently all M nodes are also H nodes. |
powSolution | IxiBytes | 0 | * | Optional. The serialized SignerPowSolution object, required for 'M' and 'H' type nodes. |
Signature Field
This field is appended to the full message but is not part of the checksum calculation.
| Field | Data Type | Min | Max | Description |
|---|---|---|---|---|
signature | IxiBytes | * | * | The cryptographic signature over the checksum of the fields listed above. |
Checksum & Signature
- Checksum Calculation: The
checksumis asha3_512sqTrunchash calculated over the serialized bytes of the Checksum Section. TheixianChecksumLockconstant is prepended to the byte array before hashing. - Signature: The
signatureis generated by signing the calculatedchecksumwith the private key corresponding to the node's wallet address. This proves the authenticity of the heartbeat.