<p>Inside each <ahref="../packet_format/">MeshCore Packet</a> is a payload, identified by the payload type in the packet header. The types of payloads are:</p>
<p>This kind of payload notifies receivers that a node exists, and gives information about the node</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Size (bytes)</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>public key</td>
<td>32</td>
<td>Ed25519 public key of the node</td>
</tr>
<tr>
<td>timestamp</td>
<td>4</td>
<td>unix timestamp of advertisement</td>
</tr>
<tr>
<td>signature</td>
<td>64</td>
<td>Ed25519 signature of public key, timestamp, and app data</td>
</tr>
<tr>
<td>appdata</td>
<td>rest of payload</td>
<td>optional, see below</td>
</tr>
</tbody>
</table>
<p>Appdata</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Size (bytes)</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>flags</td>
<td>1</td>
<td>specifies which of the fields are present, see below</td>
</tr>
<tr>
<td>latitude</td>
<td>4 (optional)</td>
<td>decimal latitude multiplied by 1000000, integer</td>
</tr>
<tr>
<td>longitude</td>
<td>4 (optional)</td>
<td>decimal longitude multiplied by 1000000, integer</td>
</tr>
<tr>
<td>feature 1</td>
<td>2 (optional)</td>
<td>reserved for future use</td>
</tr>
<tr>
<td>feature 2</td>
<td>2 (optional)</td>
<td>reserved for future use</td>
</tr>
<tr>
<td>name</td>
<td>rest of appdata</td>
<td>name of the node</td>
</tr>
</tbody>
</table>
<p>Appdata Flags</p>
<table>
<thead>
<tr>
<th>Value</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>0x01</code></td>
<td>is chat node</td>
<td>advert is for a chat node</td>
</tr>
<tr>
<td><code>0x02</code></td>
<td>is repeater</td>
<td>advert is for a repeater</td>
</tr>
<tr>
<td><code>0x03</code></td>
<td>is room server</td>
<td>advert is for a room server</td>
</tr>
<tr>
<td><code>0x04</code></td>
<td>is sensor</td>
<td>advert is for a sensor server</td>
</tr>
<tr>
<td><code>0x10</code></td>
<td>has location</td>
<td>appdata contains lat/long information</td>
</tr>
<tr>
<td><code>0x20</code></td>
<td>has feature 1</td>
<td>Reserved for future use.</td>
</tr>
<tr>
<td><code>0x40</code></td>
<td>has feature 2</td>
<td>Reserved for future use.</td>
</tr>
<tr>
<td><code>0x80</code></td>
<td>has name</td>
<td>appdata contains a node name</td>
</tr>
</tbody>
</table>
<h1id="acknowledgement">Acknowledgement</h1>
<p>An acknowledgement that a message was received. Note that for returned path messages, an acknowledgement can be sent in the "extra" payload (see <ahref="#returned-path">Returned Path</a>) instead of as a separate ackowledgement packet. CLI commands do not cause acknowledgement responses, neither discrete nor extra.</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Size (bytes)</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>checksum</td>
<td>4</td>
<td>CRC checksum of message timestamp, text, and sender pubkey</td>
</tr>
</tbody>
</table>
<h1id="returned-path-request-response-and-plain-text-message">Returned path, request, response, and plain text message</h1>
<p>Returned path, request, response, and plain text messages are all formatted in the same way. See the subsection for more details about the ciphertext's associated plaintext representation.</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Size (bytes)</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>destination hash</td>
<td>1</td>
<td>first byte of destination node public key</td>
</tr>
<tr>
<td>source hash</td>
<td>1</td>
<td>first byte of source node public key</td>
</tr>
<tr>
<td>cipher MAC</td>
<td>2</td>
<td>MAC for encrypted data in next field</td>
</tr>
<tr>
<td>ciphertext</td>
<td>rest of payload</td>
<td>encrypted message, see subsections below for details</td>
</tr>
</tbody>
</table>
<h2id="returned-path">Returned path</h2>
<p>Returned path messages provide a description of the route a packet took from the original author. Receivers will send returned path messages to the author of the original message.</p>
<h2id="repeater-regions-request">Repeater - Regions request</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Size (bytes)</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>timestamp</td>
<td>4</td>
<td>sender time (unix timestamp)</td>
</tr>
<tr>
<td>req type</td>
<td>1</td>
<td>0x01 (request sub type)</td>
</tr>
<tr>
<td>reply path len</td>
<td>1</td>
<td>path len for reply</td>
</tr>
<tr>
<td>reply path</td>
<td>(variable)</td>
<td>reply path</td>
</tr>
</tbody>
</table>
<h2id="repeater-owner-info-request">Repeater - Owner info request</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Size (bytes)</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>timestamp</td>
<td>4</td>
<td>sender time (unix timestamp)</td>
</tr>
<tr>
<td>req type</td>
<td>1</td>
<td>0x02 (request sub type)</td>
</tr>
<tr>
<td>reply path len</td>
<td>1</td>
<td>path len for reply</td>
</tr>
<tr>
<td>reply path</td>
<td>(variable)</td>
<td>reply path</td>
</tr>
</tbody>
</table>
<h2id="repeater-clock-and-status-request">Repeater - Clock and status request</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Size (bytes)</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>timestamp</td>
<td>4</td>
<td>sender time (unix timestamp)</td>
</tr>
<tr>
<td>req type</td>
<td>1</td>
<td>0x03 (request sub type)</td>
</tr>
<tr>
<td>reply path len</td>
<td>1</td>
<td>path len for reply</td>
</tr>
<tr>
<td>reply path</td>
<td>(variable)</td>
<td>reply path</td>
</tr>
</tbody>
</table>
<h1id="group-text-message-datagram">Group text message / datagram</h1>
<table>
<thead>
<tr>
<th>Field</th>
<th>Size (bytes)</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>channel hash</td>
<td>1</td>
<td>first byte of SHA256 of channel's shared key</td>
</tr>
<tr>
<td>cipher MAC</td>
<td>2</td>
<td>MAC for encrypted data in next field</td>
</tr>
<tr>
<td>ciphertext</td>
<td>rest of payload</td>
<td>encrypted message, see below for details</td>
</tr>
</tbody>
</table>
<p>The plaintext contained in the ciphertext matches the format described in <ahref="#plain-text-message">plain text message</a>. Specifically, it consists of a four byte timestamp, a flags byte, and the message. The flags byte will generally be <code>0x00</code> because it is a "plain text message". The message will be of the form <code><sender name>: <message body></code> (eg., <code>user123: I'm on my way</code>).</p>
<scriptid="__config"type="application/json">{"annotate":null,"base":"..","features":["content.action.edit","content.code.copy","search.highlight","search.suggest"],"search":"../assets/javascripts/workers/search.2c215733.min.js","tags":null,"translations":{"clipboard.copied":"Copied to clipboard","clipboard.copy":"Copy to clipboard","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.placeholder":"Type to start searching","search.result.term.missing":"Missing","select.version":"Select version"},"version":null}</script>