Skip to main content

Synapse Lifecycle Specification

Version: 0.1.0-draft

Overview

This document specifies the lifecycle of NTL synapses — the persistent, weighted connections between nodes that form the network topology.

Synapse States

A synapse MUST be in one of the following states:
StateDescription
FORMINGHandshake in progress
ACTIVETransmitting signals
WEAKENINGWeight below active threshold, still connected
DORMANTWeight below dormancy threshold, connection idle
PRUNEDConnection terminated, state archived

State Transitions

FORMING ──▶ ACTIVE ──▶ WEAKENING ──▶ DORMANT ──▶ PRUNED
               ▲            │           │
               └────────────┘           │
               ▲                        │
               └────────────────────────┘
                    (Reactivation)

Formation Handshake

Two nodes form a synapse through a three-step handshake:
  1. SYN — Initiating node sends identity, capabilities, and supported crypto modules
  2. SYN-ACK — Responding node confirms, sends its own identity and selects crypto module
  3. ACK — Initiating node confirms, synapse enters ACTIVE state
The handshake MUST complete within 30 seconds or be abandoned.

Weight Management

Initial Weight

New synapses MUST start with weight ≤ 0.1. This prevents new or unknown nodes from immediately gaining high propagation priority.

Weight Adjustment

Weight increases when:
  • A signal is successfully transmitted and acknowledged: w += signal.weight * 0.01
  • Weight MUST NOT exceed the configured max_weight (default: 1.0)
Weight decreases when:
  • Time passes without activity: w *= (1.0 - decay_rate) per decay interval
  • A signal transmission fails: w *= 0.9
  • An invalid signal is received: w *= 0.5

Thresholds

ThresholdDefaultTransition
Active → Weakening0.1Weight drops below
Weakening → Dormant0.01Weight drops below
Dormant → Pruned0.01 for 168 hoursDuration in dormant
Dormant → Active0.1Signal received, weight restored

Transport Negotiation

During handshake, nodes negotiate transport:
  1. Both nodes advertise supported transports (QUIC, TCP, Unix, Bluetooth LE)
  2. The highest-priority mutually supported transport is selected
  3. QUIC is the RECOMMENDED default

Synapse Limits

Nodes SHOULD enforce a maximum synapse count to prevent resource exhaustion. The RECOMMENDED default is 1,000 active synapses per node. When the limit is reached, the node MUST reject new synapse requests or prune the weakest existing synapse.