Skip to main content

Release Notes: v0.1.14-alpha

Release Date: January 21, 2026
Codename: Modular Architecture + Peer Connection


๐ŸŽฏ Highlightsโ€‹

  • ๐Ÿ—๏ธ Modular Architecture โ€” Monolithic ~1800 line main.c split into 8 dedicated modules
  • ๐Ÿ”Œ Peer Connection โ€” New smp_peer.c module for connecting to peer's SMP server
  • โœ… Server Accepts Confirmation โ€” AgentConfirmation sent and acknowledged with "OK"
  • ๐Ÿ› DH Key Fix โ€” Invitation URIs use Standard Base64, not Base64URL

๐Ÿ“ New Module Structureโ€‹

FileLinesPurpose
include/smp_types.h~80Structures, constants, extern declarations
include/smp_utils.h-Base64/URL encoding headers
include/smp_crypto.h-Crypto function headers
include/smp_network.h-Network I/O headers
include/smp_contacts.h-Contact management headers
include/smp_parser.h-Agent Protocol parser headers
include/smp_peer.h-NEW: Peer connection headers
smp_globals.c~25Global variables definition
smp_utils.c~100Encoding implementation
smp_crypto.c~80Crypto implementation
smp_network.c~160TLS/TCP I/O
smp_contacts.c~380Contact + NVS management
smp_parser.c~260Agent Protocol + Auto-Connect
smp_peer.c~220NEW: Peer Connection
main.c~350Reduced from ~1800!

๐Ÿ”Œ New Module: smp_peer.cโ€‹

New peer connection functionality:

// Connect to peer's SMP server
bool peer_connect(const char *host, int port);

// Disconnect from peer server
void peer_disconnect(void);

// Send AgentConfirmation to peer's queue
bool send_agent_confirmation(contact_t *contact);

Auto-Connect Featureโ€‹

Parser automatically triggers peer connection when Invitation received:

if (pending_peer.valid && pending_peer.has_dh) {
peer_connect(pending_peer.host, pending_peer.port);
send_agent_confirmation(contact);
peer_disconnect();
}

๐Ÿ› Bug Fixesโ€‹

1. tcp_connect Naming Conflictโ€‹

Problem: multiple definition of tcp_connect (collides with lwip)

Solution: Renamed to smp_tcp_connect() everywhere

2. DH Key Extraction from Invitation URIโ€‹

Problem: DH Keys from Invitation URI were not decoded properly

Root Cause: Invitation URIs use Standard Base64 (+, /, =), NOT Base64URL (-, _)!

Solution: Convert before decode:

// Strip '=' padding
while (len > 0 && dh_clean[len - 1] == '=') dh_clean[--len] = '\0';

// Convert +/ to -_ (Standard Base64 โ†’ Base64URL)
for (int x = 0; x < len; x++) {
if (dh_clean[x] == '+') dh_clean[x] = '-';
if (dh_clean[x] == '/') dh_clean[x] = '_';
}

๐Ÿ”ฌ New Discoveriesโ€‹

#Discovery
16DH Keys in Invitation URIs use Standard Base64, NOT Base64URL
17AgentConfirmation format: (agentVersion, 'C', e2eEncryption_, Tail encConnInfo)
18Maybe Encoding: '0' = Nothing, '1' + data = Just
19Each peer has own SMP server โ†’ separate TLS connection required
20SEND to Peer: queue_id as entityId, no signature needed

๐Ÿ“‹ New Filesโ€‹

FilePurpose
.gitignorebuild/, managed_components/, sdkconfig.old, etc.
docs/ARCHITECTURE.mdModule documentation

๐Ÿ“Š Current Statusโ€‹

FeatureStatus
Modular Architectureโœ… Complete
Peer Server Connectionโœ… Working
TLS + SMP Handshake with Peerโœ… Working
AgentConfirmation Sentโœ… Server: OK
App Shows "Connected"๐Ÿ”ง Format Issue

๐Ÿ” Known Issue: App Not Showing "Connected"โ€‹

Server accepts Confirmation with "OK", but SimpleX App doesn't show "Connected".

Hypothesis: encConnInfo needs more than just our DH Key.

From Haskell source:

AgentConfirmation {agentVersion, e2eEncryption_, encConnInfo}
-- encConnInfo is possibly Ratchet-encrypted or contains profile info

Next Steps:

  1. Analyze encConnInfo format in Haskell source
  2. May need to include profile/connInfo data
  3. May need Double Ratchet initialization

๐Ÿ“ˆ Statisticsโ€‹

MetricBeforeAfter
main.c lines~1800~350
Total modules18
Header files07
Code organizationMonolithicModular

  • Previous: v0.1.13-alpha โ€” Message Type Fix + Peer Queue
  • Next: v0.1.15-alpha โ€” encConnInfo Format Fix (planned)

Part of the Sentinel Secure Messenger Suite