From fba255d1b2fcbbe98975455946bf13ae3adc15a9 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 15 Dec 2025 23:21:11 -0600 Subject: [PATCH] Add Store and Forward PlusPlus --- meshtastic/mesh.options | 5 +++ meshtastic/mesh.proto | 85 +++++++++++++++++++++++++++++++++++++++ meshtastic/portnums.proto | 8 ++++ 3 files changed, 98 insertions(+) diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index 37c9341..77479ce 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -69,6 +69,11 @@ *KeyVerification.hash1 max_size:32 *KeyVerification.hash2 max_size:32 +*StoreForwardPlusPlus.message_hash max_size:32 +*StoreForwardPlusPlus.commit_hash max_size:32 +*StoreForwardPlusPlus.root_hash max_size:32 +*StoreForwardPlusPlus.message max_size:240 + # MyMessage.name max_size:40 # or fixed_length or fixed_count, or max_count diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 468231f..fa24fa3 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1154,6 +1154,91 @@ message KeyVerification { bytes hash2 = 3; } +/* + * The actual over-the-mesh message doing store and forward++ + */ +message StoreForwardPlusPlus { + /* + * Enum of message types + */ + enum SFPP_message_type { + /* + * Send an announcement of the canonical tip of a chain + */ + CANON_ANNOUNCE = 0; + + /* + * Query whether a specific link is on the chain + */ + CHAIN_QUERY = 1; + + /* + * Request the next link in the chain + */ + LINK_REQUEST = 3; + + /* + * Provide a link to add to the chain + */ + LINK_PROVIDE = 4; + + /* + * If we must fragment, send the first half + */ + LINK_PROVIDE_FIRSTHALF = 5; + + /* + * If we must fragment, send the second half + */ + LINK_PROVIDE_SECONDHALF = 6; + } + + /* + * Which message type is this + */ + SFPP_message_type sfpp_message_type = 1; + + /* + * The hash of the specific message + */ + bytes message_hash = 2; + + /* + * The hash of a link on a chain + */ + bytes commit_hash = 3; + + /* + * the root hash of a chain + */ + bytes root_hash = 4; + + /* + * The encrypted bytes from a message + */ + bytes message = 5; + + /* + * Message ID of the contained message + */ + uint32 encapsulated_id = 6; + + /* + * Destination of the contained message + */ + uint32 encapsulated_to = 7; + + /* + * Sender of the contained message + */ + uint32 encapsulated_from = 8; + + /* + * The receive time of the message in question + */ + uint32 encapsulated_rxtime = 9; +} + /* * Waypoint message, used to share arbitrary locations across the mesh */ diff --git a/meshtastic/portnums.proto b/meshtastic/portnums.proto index 24f0b16..221f113 100644 --- a/meshtastic/portnums.proto +++ b/meshtastic/portnums.proto @@ -134,6 +134,14 @@ enum PortNum { */ PAXCOUNTER_APP = 34; + /* + * Store and Forward++ module included in the firmware + * ENCODING: protobuf + * This module is specifically for Native Linux nodes, and provides a Git-style + * chain of messages. + */ + STORE_FORWARD_PLUSPLUS_APP = 35; + /* * Provides a hardware serial interface to send and receive from the Meshtastic network. * Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic