Signal Format Specification
Version: 0.1.0-draftOverview
An NTL signal is the atomic unit of data transfer. This document specifies the binary format, field definitions, encoding rules, and validation requirements for signals.Wire Format
Signals are encoded in CBOR (RFC 8949) by default. The wire format consists of a fixed header followed by a CBOR-encoded body.Header (8 bytes)
| Field | Bits | Description |
|---|---|---|
| Magic | 24 | 0x4E544C (“NTL” in ASCII) |
| Version | 4 | Protocol version (0-15) |
| Type | 4 | Signal type enum |
| Flags | 8 | Bitfield (see below) |
| Body Length | 24 | CBOR body length in bytes |
Flags
| Bit | Name | Description |
|---|---|---|
| 0 | ENCRYPTED | Payload is encrypted |
| 1 | COMPRESSED | Body is compressed (LZ4) |
| 2 | TRACE | Signal carries a propagation trace |
| 3 | CORRELATION | Signal has a correlation ID |
| 4 | PRIORITY | Signal has elevated priority |
| 5-7 | Reserved | Must be 0 |
Body (CBOR)
The body is a CBOR map with the following fields:Field Definitions
id (Signal Identifier)
- Type: ULID (16 bytes)
- Requirement: REQUIRED
- Description: Universally unique, lexicographically sortable identifier. Generated by the emitting node. MUST be unique across the network.
origin (Origin Node)
- Type: 32 bytes (BLAKE3 hash of node public key)
- Requirement: REQUIRED
- Description: Identifies the node that originally emitted this signal. Used for signature verification and trust scoring.
sig (Signature)
- Type: Variable-length bytes
- Requirement: REQUIRED
- Description: Cryptographic signature over the signal body (excluding the signature field itself). Generated using the active crypto module. Receiving nodes MUST verify the signature before processing.
ts (Timestamp)
- Type: Unsigned 64-bit integer
- Requirement: REQUIRED
- Description: Nanoseconds since Unix epoch (1970-01-01T00:00:00Z). Used for ordering, deduplication, and TTL expiry.
w (Weight)
- Type: 32-bit float
- Requirement: REQUIRED
- Constraints: MUST be in range [0.0, 1.0]
- Description: Signal priority and intensity. Affects activation thresholds and propagation priority.
ttl (Time-to-Live)
- Type: Unsigned 16-bit integer
- Requirement: REQUIRED
- Constraints: MUST be > 0 on emission. Decremented at each hop.
- Description: Maximum number of hops this signal may traverse. When TTL reaches 0, the signal MUST NOT be propagated further.
p (Payload)
- Type: Variable-length bytes
- Requirement: REQUIRED (may be empty)
- Description: The actual data carried by the signal. Encoding determined by the
encfield.
enc (Encoding)
- Type: Unsigned 8-bit integer
- Requirement: OPTIONAL (default: 0 = CBOR)
- Values:
| Value | Encoding |
|---|---|
| 0 | CBOR |
| 1 | Protobuf |
| 2 | Raw bytes |
| 3-127 | Reserved |
| 128-255 | Custom (application-defined) |
scope (Propagation Scope)
- Type: Unsigned 8-bit integer
- Requirement: OPTIONAL (default: 1 = Weighted)
- Values:
| Value | Scope |
|---|---|
| 0 | Flood |
| 1 | Weighted |
| 2 | Targeted |
| 3 | Gradient |
| 4-127 | Reserved |
| 128-255 | Custom |
Signal Types
| Value | Type | Description |
|---|---|---|
| 0 | Data | Carries a data payload |
| 1 | Query | Requests data from the network |
| 2 | Event | Notifies of a state change |
| 3 | Command | Requests an action |
| 4 | Heartbeat | Maintains synapse liveness |
| 5 | Discovery | Announces node capability |
| 6 | Ack | Confirms signal receipt |
| 7-14 | Reserved | Future protocol use |
| 15 | Custom | Application-defined |
Validation Rules
A signal is valid if and only if:- The magic bytes are
0x4E544C - The version is supported by the receiving node
- The body length matches the actual CBOR body size
- All REQUIRED fields are present
- The
idis a valid ULID - The
w(weight) is in range [0.0, 1.0] - The
ttlis > 0 - The
sig(signature) verifies against theoriginnode’s public key - The
ts(timestamp) is not in the future (with 30-second tolerance) - The signal
idhas not been seen before (deduplication)