Courier Protocol v2 (CP2)

Courier Protocol v2 (CP2)

Status: Draft specification (Phase P0, 2026-11-22; revised 2026-11-24 and 2026-11-25 after review) · Conformance vectors: docs/vectors/cp2-vectors.json · Reference checker: tools/cp2_vectors.py

This document defines Courier Protocol v2 (CP2): a bearer-independent wire protocol for reliable, authenticated, per-recipient tracked small-group messaging across heterogeneous links (LoRa/MeshCore, IP, Matrix, amateur VHF/HF radio, email, and bridges). It is self-contained: an implementation can be built from this specification and its conformance vectors without reading any other repository document.

CP2 is a strict superset of Courier v1 on MeshCore. Every valid v1 MeshCore envelope remains byte-for-byte valid under CP2 compact encoding.


1. Conventions and Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

1.1 Alphabets and Byte Order

1.2 Design Principles

  1. One message, two encodings. Full encoding F is self-describing binary. Compact encoding C omits fields already known to both endpoints from the signed admin config and stream state (analogous to SCHC, RFC 8724). Both encodings authenticate over the same canonical signing input, so compact and full copies of one message carry the same tag.
  2. MeshCore v1 wire compatibility. On MeshCore, compact encoding C without CP2 extension blocks is byte-for-byte identical to Courier v1. All new compact fields ride inside the existing has-extension (flag bit 5, value 32) block list.
  3. Honest status. No delivery status MAY be stronger than the evidence observed, and every status record MUST identify the bearer that produced its evidence.
  4. No obscurity on amateur radio. Bearers subject to amateur radio regulations forbid obscuring message meaning; CP2 separates authentication (auth = 1 or 2) from encryption (auth = 3).

2. Identity, Admin Config, and Keys

2.1 Node Key

Every CP2 node MUST generate and persist a 32-byte random seed defining an Ed25519 key pair (RFC 8032 pure Ed25519, no context, no pre-hash).

2.2 Signed Admin Config and Member Bindings

Group membership, roster identities, bearer addresses, codebook, and policy are distributed out of band in a single signed JSON file:

{
  "payload": "<exact UTF-8 JSON payload text>",
  "sig": "<128 lowercase hex chars: RFC 8032 Ed25519 signature over UTF-8 bytes of payload>",
  "admin_key": "<64 lowercase hex chars: 32-byte Ed25519 admin public key>"
}

2.3 Admin Fingerprint and Conversation ID

2.4 Member Tag

A member tag is 2 base64url characters representing the top 12 bits of a 32-byte public key:

top12 = (pub[0] << 4) | (pub[1] >> 4)
tag   = _B64[top12 >> 6] + _B64[top12 & 63]

2.5 Pair Key and Subkey Derivation

Given nodes A (with Ed25519 seed seed_A, public key pub_A) and B (public key pub_B):

  1. Compute X25519 shared secret: shared = X25519(ed25519_seed_to_x25519_priv(seed_A), ed25519_pub_to_x25519_pub(pub_B)) (32 bytes). Implementations MUST reject the derivation if shared == 0x00 * 32 (RFC 7748 §6.1 low-order point check).
  2. Order the two Ed25519 public keys lexicographically: salt_pair = (pub_A || pub_B) if pub_A <= pub_B else (pub_B || pub_A) (64 bytes). (Choice: binding sorted Ed25519 public keys in the HKDF salt prevents unknown-key-share ambiguity while keeping pair_key(A, B) == pair_key(B, A); listed in §9.)
  3. Derive the 32-byte symmetric pair key via HKDF-SHA256 (RFC 5869): pair_key = HKDF-SHA256(ikm=shared, salt=salt_pair, info="courier pair", L=32)
  4. Derive domain-separated 32-byte algorithm keys via HKDF-SHA256 (choice: separates HMAC and AEAD keys and gives A→B and B→A independent ChaCha20 keys, preventing reflection and giving each direction its own 2^32 random-nonce budget under §5.5; listed in §9):

(Optional broadcast group MAC key, pending group decision Q6 in §9: if enabled by admin config, group_mac_key = HKDF-SHA256(ikm=group_secret, salt=admin_fp || conv, info="courier group mac", L=32).)


3. Full Encoding (F)

3.1 Binary Header Layout

A Full encoding (F) frame consists of a fixed 64-byte big-endian header, followed by options_len bytes of TLV options, body_len bytes of body, and tag_len bytes of auth tag.

Offset Size Field Description
0 2 magic ASCII 0x43 0x32 ("C2"). Receivers MUST reject any other value.
2 1 ver_flags High nibble (b >> 4): protocol version, MUST be 2. Low nibble (b & 0x0F): header flags — bit 0 (0x01) relayed, bit 1 (0x02) lossy, bit 2 (0x04) encrypted, bit 3 (0x08) reserved (MUST be 0).
3 1 type ASCII message type: M (0x4D), K (0x4B), R (0x52), Q (0x51), P (0x50), G (0x47).
4 1 msg_flags Message flags — bit 0 (0x01) reply_required, bit 1 (0x02) urgent, bit 2 (0x04) more_parts, bits 3..7 (0xF8) reserved (MUST be 0).
5 1 auth Auth algorithm: 0 = none (0 B tag), 1 = HMAC-SHA256-48 (6 B tag), 2 = Ed25519 (64 B tag), 3 = ChaCha20-Poly1305 (16 B tag). Values 4..255 MUST be rejected.
6 2 body_len uint16 big-endian byte length of body (0..65535).
8 32 author_id Author's 32-byte raw Ed25519 node public key.
40 10 admin_fp Active admin config's 10-byte fingerprint (SHA-256(admin_pub)[:10]).
50 1 conv ASCII conversation character ('0', 'A'..'Z', 'a'..'z').
51 1 options_len uint8 total byte length of the options TLV block (0..255).
52 8 seq64 uint64 big-endian stream sequence number, epoch·2^32 + n (§6.3), always below 2^53. Low 12 bits equal the compact 12-bit seq. Data streams (M, K) start at n = 1; control types use 0.
60 4 ts uint32 big-endian Unix timestamp (seconds) on the author's clock; 0 if unknown.
64 options_len options Zero or more TLV entries (§3.2).
64+options_len body_len body Message body (§6); encrypted in place when auth == 3.
64+options_len+body_len 0, 6, 64, 16 auth_tag Authentication tag or signature per auth (§5).

Header invariants (MUST be enforced on decode and encode):

  1. Total frame length MUST equal 64 + options_len + body_len + tag_len(auth). Trailing or missing bytes MUST be rejected.
  2. encrypted (byte 2, bit 2) MUST equal 1 if and only if auth == 3.
  3. Reserved bits (byte 2 bit 3, byte 4 bits 3..7) MUST be 0.

3.2 Options TLV

Each option in the options section is encoded as:

opt_type (1 byte uint8) || opt_len (1 byte uint8) || opt_val (opt_len bytes)

Options are partitioned by the high bit of opt_type:

Type Scope Name Length Layout and Rules
0x01 Signed recipient 32 Final recipient's raw Ed25519 node public key. MUST NOT appear when conv != '0'. REQUIRED on direct messages (conv == '0') when authenticated (auth != 0) or relayed.
0x02 Signed answers 41 orig_author_id (32 B) || orig_conv (1 B ASCII) || orig_seq64 (8 B u64 BE). For Full-native replies. MUST be omitted when targeting C↔︎F tag equality for compact K replies (whose body already encodes the target; choice noted in §9).
0x03 Signed attachment 2 kind (1 B ASCII in P/F/V/D/U) || size_class (1 B u8 in 0..15 or 63). Maps 1-to-1 with compact block A.
0x04 Signed nonce 12 ChaCha20-Poly1305 nonce, random per encryption (§5.5). REQUIRED when auth == 3; MUST NOT appear otherwise.
0x05 Signed stream_author 32 Node key of the author of the stream an R or Q is about. REQUIRED on R and Q in Full encoding; MUST NOT appear on other types.
0x06 Signed receipt64 16 rwm64 (u64 BE) || base64 (u64 BE). R only; REQUIRED on every Full R. Claim: the R's author holds every seq of the stream in [base64, rwm64]. rwm64 = base64 = 0 means "no 64-bit claim". Otherwise 1 <= base64 <= rwm64 + 1, both in one epoch (§6.3), and the body's rwm MUST equal rwm64 & 0xFFF. A decoder MUST reject any other combination.
0x80 Unsigned piggyback 4 received_wm (u16 BE, 0..4095) || read_wm (u16 BE, 0..4095). 12-bit watermarks matching R receipts so C↔︎F is stateless (choice noted in §9). Hop claim (§3.5).
0x81 Unsigned position 8 lat24 (3 B u24 BE) || lon24 (3 B u24 BE) || time_src12 (2 B u16 BE, top 4 bits = 0). Exact binary form of the 60-bit v1 position block (§4.2). Hop claim (§3.5).
0x82 Unsigned relayed_by 32 Relaying node's raw Ed25519 public key. Informational (§3.5).
0x83 Unsigned age 2 age_code (u16 BE, 0..511, top 7 bits = 0). Uses the v1 9-bit piecewise age table (§4.2). Places ts only (§3.5, §6.2).

3.3 Canonical Signing Input

To compute or verify auth = 1 (HMAC-SHA256-48), auth = 2 (Ed25519), or the AAD for auth = 3 (ChaCha20-Poly1305), construct header' as a copy of header bytes 0..63 with three transport/hop-dependent fields zeroed:

  1. header'[2] = header[2] & 0xFE — clears bit 0 (relayed), so a relay can pass the author's auth tag untouched while setting relayed = 1 on its relayed frame.
  2. header'[51] = 0x00 — zeroes options_len, because unsigned hop options vary in length.
  3. header'[60:64] = 0x00 0x00 0x00 0x00 — zeroes ts, because compact frames on bearers without frame timestamps carry only a quantized T age without a shared clock, and relayed O frames carry only a quantized 9-bit age. (Deviation from proposal §3.3, proposed in decisions.md and §9: without zeroing ts and relayed, C↔︎F and relayed O+S tag equality would fail on any 1-second clock skew or age quantization.)

Let signed_options be the exact concatenation of all TLV entries with opt_type < 0x80 in strictly ascending opt_type order. Then:

Because body_len is committed inside header'[6:8] and each TLV is self-delimiting, the boundary between signed_options and body is unambiguous even with header'[51] == 0.

3.4 JSON / Matrix Representation

On JSON bearers (Matrix com.chee3e.courier room event field, email between nodes), v REMAINS 1 and four CP2 fields (node, seq64, sig, bsig) are added to the existing object (all hex strings are lowercase):

"com.chee3e.courier": {
  "v": 1,
  "from": "<64 lowercase hex MeshCore radio key (optional if radio-less)>",
  "node": "<64 lowercase hex Ed25519 node public key>",
  "conv": "G",
  "seqs": [200, 201],
  "seq64": 200,
  "ts": 1795034500,
  "kind": "M",
  "flags": ["urgent"],
  "parts": ["Part one text. ", "Part two text."],
  "attachment": {"kind": "photo", "size_class": 11},
  "msg": "vec-m8",
  "sig": "<128 lowercase hex Ed25519 signature>",
  "bsig": "<128 lowercase hex Ed25519 binding signature>"
}

Vectors: category matrix_bsig.

3.4.1 Matrix Encrypted Direct Messages (com.chee3e.courier.dm)

Direct conversations (conv = '0') are NEVER posted to any Matrix room. Over Matrix, direct messages (M, K) and their receipts (R) travel as end-to-end encrypted Matrix to-device events of type com.chee3e.courier.dm, addressed to the recipient's bound Matrix account (its fresh Courier device ID, or * otherwise).

Wire JSON:

{
  "v": 1,
  "node": "<64 lowercase hex Ed25519 sender node key>",
  "frame": "<unpadded base64url of sealed_bytes>"
}

Vectors: category matrix_dm (and neg-matrix-dm-* in negative).

3.5 Hop Claims: Piggyback and Position

0x80 piggyback and 0x81 position (compact wwww and pppppppppp, §4.1) are hop claims: statements by the node that transmitted the frame, about itself. The piggyback is that node's watermarks for the reverse stream with the frame's recipient; the position is that node's location. Neither is part of the message. The frame sender sets them at each transmission, so they differ between retries and between bearers of one message, and on a relayed frame they are the relay's, not the author's.

For that reason they are not in the author's signing input: a relay could no longer pass the author's tag on untouched, and copies of one message would stop carrying the same tag (§5.4). A second tag per hop would cost 9 more characters of a 67-character APRS frame. The rule is instead on who is believed:

  1. A receiver MUST use a hop claim only when the frame arrived on a bearer declaring authenticates_sender == "yes" (§8.1), and MUST attribute it to the sender that bearer authenticated: never to the author_id of a relayed message, and never to the node named in 0x82.
  2. On every other bearer ("by_binding" or "no") a receiver MUST ignore hop claims: they change no watermark, delivery status, bearer health or position. The rest of the frame is processed as if they were absent. A valid auth tag does not change this, because the tag does not cover them.
  3. A sender MUST NOT emit hop claims on a bearer that does not declare authenticates_sender == "yes". On those bearers watermarks travel only in R frames, whose body is inside the signing input, and position is not carried.
  4. The JSON representation (§3.4) carries no hop claims.

Cost: on APRS or JS8 a receipt is its own R frame (23 characters with T and S, plus the compact form of 0x06 once defined, §9.2 item 16) instead of 4 piggyback characters. Position stays on MeshCore, where it is today.

The other unsigned options decide nothing: 0x82 relayed_by is informational and MUST NOT feed any status or trust decision, and 0x83 age only places ts (§6.2).

Vectors: category hop_claims.


4. Compact Encoding (C)

4.1 Wire Layout (MeshCore v1 Compatible)

Compact encoding C is a printable UTF-8 text string with no NUL bytes:

^ T C SS F [wwww] [pppppppppp] [n blocks...] body
Field Chars Encoding
^ 1 Literal marker 0x5E.
T 1 Message type: M, K, R, Q, P, G.
C 1 Conversation: 0 (direct) or A..Z, a..z (group).
SS 2 12-bit seq (0..4095), big-endian _B64.
F 1 6-bit flags in _B64: bit 0 (1) reply_required, bit 1 (2) urgent, bit 2 (4) more_parts, bit 3 (8) has_piggyback, bit 4 (16) has_position, bit 5 (32) has_extension.
wwww 4 Present iff has_piggyback (bit 3): received_wm (2 _B64) + read_wm (2 _B64) for the reverse stream. Hop claim: outside the S tag, used only per §3.5.
pppppppppp 10 Present iff has_position (bit 4): 60-bit position block in _B64 (§4.2). Hop claim: outside the S tag, used only per §3.5.
n blocks... 1 + ... Present iff has_extension (bit 5): 1-char _B64 block count n, followed by n extension blocks (§4.3).
body variable Remaining UTF-8 bytes (§6).

MeshCore size budget: hard cap 158 UTF-8 bytes total (including header, piggyback, position, and extension blocks), because MeshCore companion firmware caps DMs at 160 bytes for attempts 0..3 and 158 bytes for attempts >= 4. Usable body without extensions: 152 B (header only), 148 B (with piggyback), 142 B (with position), 138 B (with both).

4.2 Position Block and Piecewise Age Table

When has_position is set, 10 _B64 characters pack 60 bits big-endian:

Code range Count Seconds covered Step
0..119 120 0..119 s 1 s
120..239 120 120..1905 s 15 s
240..359 120 1920..16200 s 120 s (2 min)
360..510 151 16320..151320 s 900 s (15 min, ~42 h)
511 1 > 151320 s ("older than table") 900 s (value 151320 s)

For age_s >= 0 (used by O, E, T), age_code(age_s) selects the smallest index i in 0..510 with value(i) >= age_s, or 511 if age_s > 151320.

4.3 Extension Blocks (has_extension, Flag Bit 5)

The byte immediately after header / piggyback / position is a 1-char _B64 count n:

Block Length Status Wire Layout
O 8 chars v1 (extended in CP2) 'O' + original conv (1) + author member tag (2 _B64) + author first seq (2 _B64) + age_flags (2 _B64: bit 11 urgent, bit 10 reply_required, bit 9 = 0, bits 8..0 age_code). In v1 MeshCore conv != '0'; CP2 permits conv == '0' when paired with D for relayed direct messages.
E 9 + nb bytes v1 'E' + group conv (1, != '0') + event digest (4 _B64 = top 24 bits of SHA-256(event_id)) + age_flags (2 _B64: bit 11 guest, bits 10..9 = 0, bits 8..0 age_code) + nb (1 _B64, 0..16) + UTF-8 display name (nb bytes). Bridge/Matrix-origin only; no CP2 Full equivalent.
A 3 chars v1 'A' + kind (1: P photo, F file, V voice, D video, U audio) + size_class (1 _B64: 0..15 meaning <= 2^c KiB, or 63 unknown).
S 9 chars CP2 new 'S' + 8 _B64 chars encoding the 48-bit (6-byte) big-endian HMAC-SHA256-48 tag. REQUIRED on bearers that do not natively authenticate the sender.
T 3 chars CP2 new 'T' + 2 _B64 chars encoding (0 << 9) | age_code (bits 11..9 MUST be 0; bits 8..0 = 9-bit age_code). REQUIRED on bearers without a frame timestamp.
D 3 chars CP2 new 'D' + 2 _B64 chars encoding the final recipient's member tag (top 12 bits of recipient's node key). Allowed ONLY alongside an O block with conv == '0'.
X 1 char v1 (reserved in CP2) 'X' alone: the author's no-mirror marker on part 0 of a v1 MeshCore group message (docs/radio-mirror-design.md, decisions 2026-11-26). The letter is reserved: no CP2 block may use it. A CP2 encoder never emits it (a mirror_ok=false message never goes on a CP2 bearer), so a CP2 decoder still rejects it as an unknown block.
N 5 chars CP2 new 'N' + 4 _B64 chars: the sender's stream epoch (§6.3; 24 bits, top 3 bits 0, value >= 1). Allowed on P, M, K. Used only from an unrelayed frame on a bearer with authenticates_sender == "yes"; ignored elsewhere. Not part of the signing input and dropped in C → F. A node sends it on its return hello and heartbeat P, and on every M/K until the recipient has receipted a message of the current epoch.

Note (2026-11-27): v1 adds block Y, the reply reference: 5 chars, 'Y' + author member tag (2 _B64, the radio-key tag as in v1 O) + the answered message's first seq (2 _B64), on part 0 of a v1 MeshCore group M only (docs/functional-spec.md 5). The letter is reserved: no CP2 block may use it; a CP2 decoder rejects it as an unknown block, and a CP2 encoder never emits it (a text reply's reference on CP2 bearers travels on Matrix only, §3.4). A v1 decoder before 2026-11-27 rejects it too, so every member updates before replies are used.

Validation rules: CP2 encoders SHOULD emit blocks in canonical order (O/E, D, A, N, T, S). Decoders MUST accept blocks in any order, MUST reject duplicate block types within one frame, MUST reject unknown block types, MUST reject reserved non-zero bits in O, E, T, N, MUST reject N with value 0 or on a type other than P, M, K, and MUST reject D unless paired with O(conv='0'). Vectors for N: category epoch_block.

4.4 Case-Folding Rendering (C32)

Bearers that fold character case (e.g., JS8, (unverified, needs bench)) cannot distinguish mixed-case _B64. CP2 defines an uppercase Base32 (_B32) rendering C32:


5. Exact C ↔︎ F Mapping, seq64 Expansion, and Authentication

5.1 seq64 Expansion from 12-Bit seq

Let ref_seq64 be the stream's mark (§6.3): the highest accepted seq64 on stream (author_id, conv) (0 if no message has yet been accepted on that stream), and let seq12 be the 12-bit sequence number (0..4095) from a compact frame:

d = (seq12 - (ref_seq64 & 0xFFF)) mod 4096
if d >= 2048:
    d -= 4096                    # signed difference in [-2048, +2047]
candidate = ref_seq64 + d

Bounds and rejection rules:

  1. If candidate < 0 or candidate >= 2^64, the receiver MUST reject the frame.
  2. For data streams (type in {'M', 'K'}), streams start at n = 1 of their epoch (§6.3) and increment monotonically (4095 -> 4096, where 4096 & 0xFFF == 0). Therefore candidate == 0 MUST be rejected for M and K.
  3. For control frames (R, Q, P, G), seq64 = seq12 (normally 0, no window expansion).
  4. Replay protection across 12-bit wrap: the receiver MUST verify the auth tag against ONLY this unique candidate (never brute-force past epochs). A compact frame originally signed at seq64 = 5 and replayed once ref_seq64 = 4100 expands to 4101, which fails authentication.
  5. candidate MUST have the same epoch as ref_seq64 and n >= 1 (§6.3); otherwise reject. On a stream that is not anchored the result is an estimate and MUST NOT be used for 0x06.

5.2 Compact to Full (C → F)

A compact R or Q has no Full form in this version: a Full R needs 0x05 and 0x06 and a Full Q needs 0x05 (§3.2), which compact encoding does not carry yet (§9.2 item 16).

Given a decoded compact frame C (or C32), active config admin_fp, roster map, transport sender_node_id, optional transport recipient_node_id, stream ref_seq64, optional frame_ts (on MeshCore, after subtracting the P17 per-recipient offset), arrival_ts, and hop_authenticated (true iff the bearer declares authenticates_sender == "yes"):

  1. Identity & routing:
  2. Sequence: expand seq12 to seq64 per §5.1.
  3. Signed options (< 0x80):
  4. Unsigned options (>= 0x80):
  5. Auth & body:

5.3 Full to Compact (F → C)

  1. Reject if F.auth not in {0, 1}, or F.encrypted == 1, or any signed option other than 0x01 (recipient) and 0x03 (attachment) is present, or F.body is not valid NUL-free UTF-8. A Full R carries 0x05 and 0x06 and therefore has no compact form in this version; see §6.2.
  2. If the outgoing bearer declares authenticates_sender == "yes" and F.relayed == 0, map 0x80 → piggyback and 0x81 → position; otherwise omit both hop claims (on a relayed copy, F's 0x80 and 0x81 belong to an earlier hop and MUST NOT be forwarded; any piggyback or position a relay sends on an authenticating bearer is set fresh by the relay at transmission, §3.5). Map 0x03 → A block, 0x83 → T block (when not relayed and bearer needs age), F.auth == 1 → S block.
  3. If F.relayed == 1: outer conv = '0', outer seq = relay_seq & 0xFFF, outer urgent = reply_required = 0; emit O block with F.conv, key_tag(F.author_id), F.seq64 & 0xFFF, age from 0x83, and F.urgent/F.reply_required; if F.conv == '0', also emit D block with key_tag(0x01 recipient).
  4. Otherwise: C.conv = F.conv, C.seq = F.seq64 & 0xFFF, C.urgent = F.urgent, C.reply_required = F.reply_required.

5.4 Authentication Algorithms

auth Algorithm Tag Size Computation & Verification
0 None 0 B Permitted ONLY on bearers declaring authenticates_sender == "yes" (MeshCore pairwise encrypted DM) or legacy unverified v1 frames.
1 HMAC-SHA256-48 6 B tag = HMAC-SHA256(mac_key, signing_input)[:6]. MUST verify in constant time. Online guessing is bounded by §5.6.
2 Ed25519 64 B Pure RFC 8032 Ed25519.Sign(author_seed, signing_input). Verify against author_id, which MUST belong to the active signed admin config roster.
3 ChaCha20-Poly1305 16 B RFC 8439 AEAD with key = aead_key(pair_key, author_id, admin_fp), aad = canonical_signing_input(F) (without body), nonce = the 12 bytes of option 0x04 (§5.5). MUST NOT be transmitted on any bearer declaring confidentiality == "encryption_forbidden".

Tag equality invariant: for any message with auth = 1, canonical_signing_input(F) and canonical_signing_input(compact_to_full(C)) MUST be byte-for-byte identical, yielding the exact same 48-bit tag regardless of clock skew, quantized T/O age, piggyback/position options, or relayed status. The same property means the tag says nothing about piggyback or position; §3.5 governs those.

5.5 AEAD Nonce (auth = 3)

Every auth = 3 frame MUST carry signed option 0x04, and its 12 bytes are the nonce. A decoder MUST reject an auth = 3 frame without it. The sender MUST draw the 12 bytes from a cryptographically secure random source for each encryption. A nonce is never derived from type, conv, seq64 or any stored counter.

Reason: a derived nonce repeats when a node loses stream state (restore from backup, reset, reinstall with the same node key) and allocates a seq64 again for different text. With ChaCha20-Poly1305 one repeat under one key reveals the XOR of the two plaintexts and lets an attacker forge frames. A random nonce depends on no state that can be lost, so restore and reset need no special handling.

5.6 Bad Tags: Limit Verification Work, Never Block a Source

On a bearer that does not declare authenticates_sender == "yes", the source address of a frame is only a claim. On APRS-IS anyone can send under any callsign. A rule that mutes a source after bad tags would let anyone silence a member with a handful of forged frames, so:

  1. A receiver MUST NOT mute, block, delay or deprioritise a claimed source address, member or author because frames claiming it failed authentication, and MUST NOT change any delivery status or bearer health on such a failure. A frame with a bad tag is dropped and counted; nothing else follows from it.
  2. A receiver MUST limit tag and signature verifications per bearer instance, regardless of claimed source (RECOMMENDED: a token bucket of 10 verifications per second, burst 100). Frames that fail to parse or whose claimed source is bound to no roster member are dropped before the limit and do not count against it.
  3. Frames over the limit are dropped unverified. A genuine frame lost this way is recovered like any lost frame (retry, Q, the next bearer on the ladder).

This is enough against guessing: at 10 tries per second a 48-bit tag takes about 450,000 years on average. A flood can still crowd out genuine frames on that one bearer while it lasts, which is true of any open bearer; it cannot be aimed at one member and it leaves no state behind.


6. Message Types, Receipts, Ordering, and Mismatch Precedence

6.1 Message Types (M K R Q P G)

Type Sequenced Body Format Semantics
M Yes (seq64 >= 1) UTF-8 text (no NUL in compact) User text message (or caption when paired with A / 0x03 attachment stub). Long texts split across 1..4 consecutive seqs with more_parts = 1 on all but the last part.
K Yes (seq64 >= 1) <ver 1><code 1..8>[ <param>...] Codebook macro or built-in reply (W WILCO, N NEG, S STBY). Version mismatches or unknown codes MUST show raw with a warning (never guessed). Direct reply param (3 chars): <conv><seq2>. Group reply param (4 chars): <orig_tag2><seq2>.
R No (seq = 0) <rwm 2><dwm 2>[<bitmap 2>] Cumulative, idempotent app receipt for reverse stream: received watermark, read watermark, optional 12-bit bitmap (bit i = rwm + 1 + i held). Never itself receipted. In Full encoding the claim is option 0x06; the bitmap is relative to rwm64. The read watermark is dwm64 = rwm64 - ((rwm - dwm) mod 4096) when dwm != 0; a receiver whose read position is 4096 or more below rwm64, or below base64, sends dwm = 0.
Q No (seq = 0) 0..8 × <seq 2> Re-request missing seqs (empty body = "send me your receipt"). Mandatory after Unconfirmed grace period.
P No (seq = 0) 2-char nonce, 1-char tracking time left (2 min units), or <nonce2>M<mxid|-> Link probe / return hello / heartbeat / live tracking update / Matrix binding claim (max 139 B mxid on MeshCore). Never receipted; counts as peer heard.
G No (seq = 0) <role 1> + 1..37 × <first 2><last 2> Gap closure: role 'S' (skip from sender) or 'L' (lost from receiver). Each inclusive range MUST span < 2048 seqs.

6.2 Receipts, Ordering, Dedup, and Status

6.3 Stream Epochs, the Mark, and Stale Frames (all bearers)

epoch(s) = s >> 32, n(s) = s & 0xFFFFFFFF.

Sender.

  1. A node has one epoch for all its streams, 1..2^21-1. It is stored outside the stream-state database, beside the node key, and written durably before it is first used. It is never derived from a clock.
  2. A new node key starts at epoch 1. A restart with intact stream state keeps the epoch and every counter.
  3. The epoch increases by one when the node starts with its key and stored epoch but no stream state, or with stream state from an earlier epoch. It becomes e + 1 when the node verifies a frame signed by its own key with epoch e above its own, or when the operator sets it.
  4. A node that has its key but neither a stored epoch nor stream state MUST NOT author M or K until its epoch is set; it still receives.
  5. In a new epoch every stream restarts at n = 1 (compact seq 1). Messages of the earlier epoch that are not yet Received are closed as Expired; a seq is never reissued or renumbered.

Evidence. Signed: the author's tag or signature verified (§5.4; on Matrix sig and bsig), relayed or not. Author-direct: signed, not relayed, and received from the author itself: on the author's own Direct IP link, as the author's own post from its bound Matrix account, or unrelayed on a bearer with authenticates_sender == "yes".

Receiver state. Per author node key: epoch_A (0 = unknown). Per stream: the 12-bit window, and one mark: the highest accepted seq64. The mark is the ref_seq64 of §5.1; there is no second high-water value. A stream is anchored when its mark is a real seq64 tied to the window; base is the lowest seq of its 64-bit claim.

A signed 64-bit arrival a, in this order:

  1. epoch(a) < epoch_A: stale. Dropped (provisional on Matrix), counted, shown in bearer status.
  2. epoch_A == 0: set epoch_A = epoch(a). Nothing is reset.
  3. epoch(a) > epoch_A: set epoch_A = epoch(a) and reset every stream of that author to its initial state (empty window, mark epoch·2^32, anchored, base = mark + 1). Any signed frame may do this: a replay cannot carry an epoch above the author's current one.
  4. Stream anchored: if a + 2048 < mark, stale as in 1. If a >= wm64 + 2048 (2048 or more past the 64-bit window watermark wm64, keeping mark - wm64 < 2048 invariant), the window is rebuilt at a (mark = a, base = a, wm64 = a); the seqs skipped are shown as a gap and are not claimed. Otherwise a goes through the window and the mark becomes max(mark, a).
  5. Stream not anchored (its window was built from 12-bit arrivals, or is unused): a goes through the 12-bit window. If a is author-direct and the window accepts it as new, the stream becomes anchored with mark = a, wm64 = a - seq_diff(a & 0xFFF, wm_before) (advancing with the window), and base = wm64_before + 1; the window is not reset. If a is author-direct and cannot fit in the existing 12-bit window because it is 2048 or more ahead of the unanchored window (including a fresh/unused stream receiving (a & 0xFFF) in {0, 2048..4095}), the window is rebuilt and anchored at a (mark = a, base = a, wm64 = a). If a is author-direct and the window takes it for a duplicate (at or below its watermark, or held), it is the author's restarted stream (sender 5) when its signed content (body and more_parts) differs from every copy the window keeps for that 12-bit seq, or, when the window keeps none and is not empty, when epoch_A was learned from a itself under rule 2 and a is not a catch-up or resend copy: that stream alone is reset as in rule 3 (mark epoch(a)·2^32, anchored, base = mark + 1) and a then goes through rule 4, so it is new and the epoch's seqs below it are a gap. ts is not evidence (§6.2). A seq whose gap was closed keeps the late-arrival path. A relayed a never anchors, never resets and never sets the mark.

A 12-bit arrival expands per §5.1 against the mark when the stream is anchored, and moves the mark once accepted by the window. On a stream that is not anchored it uses the window alone.

The author's epoch from a hello (epoch, §8.4) counts as signed evidence for rules 2 and 3. So does compact block N (§4.3) on an unrelayed frame on an authenticating bearer.

Receipts sent. Anchored: rwm64 is the 64-bit window watermark wm64, not below base - 1; base64 = base. Not anchored: after accepting a signed frame a as new, rwm64 = base64 = a; otherwise rwm64 = base64 = 0.

Node key change. A new node key has no state on receivers and starts at rule 2.

Limitations. (i) A receiver with no state for a stream accepts the first signed frame it is given, which may be an old one; the next newer frame corrects the mark. (ii) Until a stream is anchored, a relaying member or the homeserver can present an old signed message once per 12-bit position; it is shown as new and can shadow one later message at that position. Nothing is falsely credited, and the first author-direct frame ends the exposure. (iii) Restoring an older copy of the whole data directory reissues seqs in the same epoch; see §9.2 item 13.

Vectors: categories stream_epoch (receiver rules) and receipt64 (§6.2 credit).


7. Fragmentation

CP2 uses two distinct layers so the reliability engine only tracks application-level envelopes:

7.1 Layer 1: Application Parts (Engine Layer)

Long M text is split on UTF-8 character boundaries into 1..4 consecutive seq64 values with more_parts = 1 on parts 0..k-2 and more_parts = 0 on part k-1. On MeshCore, part budgets follow §4.1 (152 B base, 148 B with piggyback on part 0, minus any extension prefix). Bearers with large MTUs (Direct IP, Matrix, Winlink) send all parts in a single message.

For bearers whose mtu_bytes is smaller than a single serialized envelope (e.g., APRS at 67 chars for a 158-byte compact envelope), the bearer plugin MUST fragment on transmit and reassemble on receive transparently before handing whole envelopes to the engine.


8. Bearer Capability Declaration and Plugin Contract

Every bearer and bridge plugin lives behind a uniform contract (in-process Python asyncio class, or out-of-process JSON-lines over stdio/WebSocket). CLAUDE.md Rule 2 extends to all plugins: nothing reaches a bearer except through its plugin, and the plugin ALWAYS enforces that bearer's airtime/rate budget.

8.1 Capability Declaration Schema

Every plugin MUST return a static capability object from capabilities() before opening traffic:

Field Type / Allowed Values Meaning and Protocol Consequence
name str Unique plugin identifier (e.g., meshcore, matrix, direct_ip, aprs, js8, winlink, email, discord, irc, imessage).
kind "bearer" | "bridge" "bearer" carries CP2 between Courier nodes. "bridge" reaches non-Courier users as guests; status ceiling is Handed off and messages MUST NEVER loop back to their origin service.
mtu_bytes int >= 5 Maximum payload bytes in a single bearer frame.
alphabet "binary" | "utf8" | "ascii" | "aprs_ascii" | "upper_base32" Allowed wire character set. "aprs_ascii" = printable ASCII 0x20..0x7E excluding |, ~, {. Plugins MUST refuse frames violating their alphabet rather than corrupting signed bytes.
encoding "full" | "compact" | "compact32" | "json" Wire encoding carried by the plugin.
link_fragmentation bool Whether the plugin implements Layer 2 % fragmentation/reassembly (§7.2).
native_ack "none" | "next_hop" | "end_to_end" Whether the bearer emits a transport ACK. Only "next_hop" or "end_to_end" may advance status to At bearer (At radio); NEVER Received.
authenticates_sender "yes" | "by_binding" | "no" If "no", the engine MUST attach auth = 1 (S tag), auth = 2 (Ed25519) or auth = 3 on every frame and reject unauthenticated inbound frames. Unless "yes", hop claims are neither sent nor used (§3.5) and bad tags are handled per §5.6.
confidentiality "end_to_end" | "hop" | "none" | "encryption_forbidden" If "encryption_forbidden" (amateur radio), the plugin MUST refuse any encrypted frame (auth = 3), and the engine MUST transmit clear text ONLY if the conversation's signed admin config explicitly opts in (default: codes and receipts only).
has_frame_timestamp bool If false, compact frames MUST include the T (age) extension block.
addressing "unicast" | "broadcast" | "room" Delivery topology (determines fan-out and whether pairwise or group auth tags apply).
cost_class 0 | 1 | 2 | 3 Delivery ladder rung: 0 free/IP, 1 unlicensed shared RF, 2 amateur VHF, 3 amateur HF.
latency_class "seconds" | "minutes" | "hours" Expected one-way delivery timescale.
hold_before_next_rung_s float | null Default hold waiting for an app receipt before escalating to the next cost class (null = manual/urgent only).
airtime_rules object Mandatory budget rules: budget_kind ("rate_limit" | "duty_cycle" | "frames_per_hour" | "tx_seconds_per_hour"), window_s, ceiling value (max_duty_fraction / max_frames / max_tx_s), optional max_single_tx_s, optional flood_multiplier, and requires_licence (bool: amateur bearers MUST refuse TX unless the local node declares a valid licence for the band and mode).

8.2 Plugin Calls and Events

8.3 Reference Bearer Profiles

Values for APRS and JS8 are provisional (unverified, needs bench); see docs/protocol-findings.md §17.

Capability MeshCore Direct IP Matrix APRS (unverified) JS8 (unverified)
kind bearer bearer bearer (+ bridge) bearer bearer
mtu_bytes 158 65535 65536 67 ~12–18 chars/frame
alphabet utf8 (no NUL) binary utf8 aprs_ascii upper_base32
encoding compact full json compact compact32
link_fragmentation false false false true true (or codes/R only)
native_ack end_to_end (DM) none none end_to_end (ack) end_to_end (ACK)
authenticates_sender yes no (uses auth=2) by_binding (+ sig, bsig) no (S required) no (S required)
confidentiality end_to_end hop (link sealed per §8.4) none (rooms) / end_to_end (DM to-device) encryption_forbidden encryption_forbidden
has_frame_timestamp true true (F.ts) true false (T required) false (T required)
cost_class 1 0 0 2 3
airtime_rules.budget_kind duty_cycle (10%/10m, 6 floods) rate_limit rate_limit frames_per_hour tx_seconds_per_hour
airtime_rules.requires_licence false false false true true

A Direct IP link is a WebSocket between two nodes. One node dials (role = "initiator"), the other accepts (role = "responder"). Both frames of the handshake and the key-confirmation frames are WebSocket text frames carrying JSON; after key confirmation every frame is a binary sealed frame. Node identities are the Ed25519 keys of §2.1; pair_key is §2.5. Direct IP declares authenticates_sender: "no" (so hop claims, §3.5, are neither sent nor used even though the link is mutually authenticated) and confidentiality: "hop", and carries auth = 2 (Ed25519) Full frames only (never auth = 3). All hex values in §8.4 are lowercase; senders MUST emit lowercase hex, and receivers MUST reject non-hex or wrong-length strings.

  1. Hello. The initiator sends exactly these ten keys: admin_fp (20 hex), config_version (int), eph (64 hex, fresh X25519 public key), epoch (int), mac (64 hex), node_id (64 hex initiator node key), nonce (32 hex, 16 random bytes), role ("initiator"), seen (int), to (64 hex responder node key). epoch is the sender's own stream epoch (§6.3); seen is the highest epoch for which the sender holds signed evidence from the peer (0 if none). There is no timestamp, and no step of the handshake reads a wall clock.
  2. Transcript. H = SHA-256("courier link transcript" || u32be(len(h1)) || u32be(len(h2)) || h1 || h2), where h1 and h2 are the exact UTF-8 bytes of the two hello text frames as sent (the initiator's includes to, epoch, seen and mac; the responder's includes epoch and seen), h1 from the node with the lower node_id (byte-wise) and h2 from the other. Both nonces, both roles, both ephemeral keys, admin_fp, config_version, both epoch and seen values, and the initiator's to and mac are therefore bound into everything below.
  3. Keys. Compute eph_shared = X25519(eph_priv, peer_eph); implementations MUST reject the handshake if eph_shared == 0x00 * 32 (same RFC 7748 §6.1 low-order point check as §2.5). ikm = pair_key || eph_shared. For a label L and a node key P (raw 32 bytes, not hex): key(L, P) = HKDF-SHA256(ikm, length 32, salt = H, info = L || P). The sealing key for frames we send is key("courier link ", own_node_key), for frames we receive key("courier link ", peer_node_key). Confirm keys are key("courier link confirm ", sender_node_key). Both HKDF labels end with a trailing ASCII space (0x20). The ephemeral private key is discarded after the handshake (forward secrecy against a later compromise of node keys).
  4. Key confirmation. The whole exchange (hellos and confirms) has a 5 s deadline. Each side sends {"confirm": hex(HMAC-SHA256(confirm_key_of_sender, "courier link confirm" || H))} (lowercase hex; note no trailing space in the HMAC label) and verifies the peer's in constant time with the peer's confirm key. Either side that does not receive a valid confirm in time closes the socket. A link exists only after both confirmations verify and the responder has accepted it (item 6).
  5. Sealed frames. Binary frame = counter (u64 BE) || ChaCha20-Poly1305(key, nonce = 0x00000000 || counter, plaintext) || tag (16 B). The counter starts at 0 per direction and increases by one; a receiver rejects any counter below the next one it expects. A frame that fails authentication or is replayed is dropped without moving any counter; 20 of them within 60 s close the link. Plaintexts shorter than a Full frame (under 64 bytes) are link control frames, never delivered: empty = accepted, 0x01 || id (8 B) = ping, 0x02 || id (8 B) = pong echoing that id (so overlapping probes cannot answer each other), and 0x03 = refused.
  6. Acceptance and one link per peer. The responder installs the link and sends the sealed accepted frame (counter 0). The initiator, on receiving it (5 s), installs the link and sends its own accepted. Each side treats the link as up (outbox flush, link-up) only after both accepted frames have been seen; if the initiator refuses the link it closes the socket and the responder drops it unannounced. One link per peer is decided on local state, not clocks: when a confirmed newcomer arrives for a peer that already has a link,
  7. Unauthenticated work is bounded. A newly connected socket MUST deliver its initiator hello within 2 s of connect, or the responder closes it. At most 64 sockets may be unconfirmed at once (awaiting a hello, or between hello and key confirmation); at the ceiling the oldest is closed. Because the responder verifies the initiator hello MAC before allocating any link state or sending anything, there are no per-address limits, no IPv6 /64 keying, no global in-flight handshake cap, and no unconfirmed-handshake eviction; running behind a reverse proxy (all clients sharing one TCP peer address) changes nothing, and a valid hello is never refused by a limiter.
  8. Frame acceptance. On a Direct IP link a node accepts only Full frames with auth = 2 (Ed25519) whose author_id is a node key of its signed admin config, whose admin_fp matches, and which are not relayed unless authored by a third member; an unrelayed frame MUST be authored by the link's peer. Hop claims (0x80, 0x81) are ignored (§3.5). A direct message (conv = 0) MUST carry 0x01 recipient equal to the receiver and is never relayed. An R is accepted, direct or relayed, when its auth = 2 signature verifies, its author is a member of conv, and 0x05 stream_author is present. It feeds delivery status only per §6.2. Only an R received directly from the link's peer triggers serving (§8.5). A DM R is never relayed. A DM is served from a store-and-forward cache only to its recipient, a group frame only to members of that group.
  9. Dial outcome. A dialer records and shows, per peer, the last outcome: unreachable (no connection), no answer to hello (closed before a responder hello: wrong key, wrong admin_fp, or not in the peer's roster), confirmation failed, refused (0x03), or linked. A node also shows epoch behind when a peer's seen exceeds its own epoch. No status depends on a clock.

Vectors: category direct_ip_handshake.

8.5 Catch-up Serving

A holder serves cached frames of stream S to requester P only on an R received directly from P on a live link. With a 64-bit claim, it serves frames with seq64 > rwm64 in the same epoch that the bitmap does not cover, oldest first; if the cache holds frames from a higher epoch than epoch(rwm64), it serves the newest cached epoch's frames above cursor, oldest first (ignoring the lower-epoch bitmap). With rwm64 = 0 and rwm = 0 (a fresh or wiped peer with no state), it serves the newest cached epoch's frames above cursor, oldest first; otherwise with rwm64 = 0, it serves only frames within 2048 of its newest cached seq that are ahead of the body's 12-bit rwm. It keeps a cursor per link and stream, and serves only above max(cursor, rwm64) (or cursor when serving a higher epoch); the cursor is forgotten when the link drops or is replaced. Served frames use at most half the link's rate limit and wait while live frames are pending. A frame the limiter holds is retried, not dropped. Frames of an epoch below the author's current one are discarded from the cache.


9. Open Questions for the Group

9.1 Carried Forward from docs/protocol-v2-proposal.md §9

These questions remain open for group decision and are NOT silently decided by this specification:

# Question Proposal Recommendation
Q1 Which git remote is primary: one of the two hosted copies? Pick one; mirror the other.
Q2 What do we publish publicly so amateur radio use is permitted (47 CFR §97.309(a)(4)): the whole repo, or only this protocol document? At least docs/protocol-v2.md, before Phase P3.
Q3 Are node keys required from one admin config version, with all nodes upgrading together? Yes.
Q4 The N-bearer seam touches the engine while user testing is live. Which branch, and when does it merge? Its own branch; merge after the Phase 5 gate.
Q5 Keep today's envelope bytes on MeshCore (12-bit seq, 4 parts), or redesign them? Keep (this spec assumes Keep).
Q6 Auth tag on a broadcast bearer (APRS/JS8): pairwise tags (1 frame per recipient) or a group tag (1 frame, but any member can forge another)? Pairwise default; group tag as an admin opt-in.
Q7 Which conversations may send free text in clear on amateur bands? None by default; codes and receipts only.
Q8 A member with several nodes: does any one of them holding a message make it Received? Yes.
Q9 Must a phone ever be a standalone node with a BLE radio and no Raspberry Pi? Decides whether to build a Rust core.
Q10 Who sends APNs pushes (shared key per node vs small relay), and how is the iOS app distributed? Open.
Q11 CarPlay: widget and Live Activity only, or apply for Apple's communication entitlement? Widget first.

9.2 Spec-Level Choices Made in P0 (Awaiting Group Confirmation)

Where the proposal left wire-level mechanics unspecified, this document chose concrete defaults (and vectored them in docs/vectors/cp2-vectors.json) so implementers have an unambiguous spec. None of them is decided: they are listed under "Proposed" in docs/decisions.md and bind nobody until the group moves them up.

  1. Canonical signing input zeroes ts (bytes 60..63) and relayed (byte 2 bit 0) alongside options_len (byte 51), so compact T (age) without a shared clock and relayed O+S copies produce the exact same tag as Full F.
  2. Pair key HKDF salt and domain-separated subkeys: salt = min(pub_a, pub_b) || max(pub_a, pub_b) for pair_key, plus HKDF subkeys "courier mac" (auth = 1) and directional "courier aead" with salt = author_id || admin_fp (auth = 3).
  3. AEAD (auth = 3) nonce: random 12 bytes per encryption, always carried in signed option 0x04; no derived nonce (§5.5).
  4. Member tag source: radio key on MeshCore v1 O blocks and v1 group replies; node key on CP2-native blocks (D and non-v1 O), with first-byte uniqueness enforced on node keys too.
  5. EXT_MAX_BLOCKS raised from 3 to 6 in CP2, and O relaxed to permit conv = '0' when paired with D for relayed direct messages.
  6. Link fragment header: frag_tag = top 12 bits of SHA-256(envelope_bytes) (deterministic integrity check), and 3-bit count - 1 supporting 1..8 fragments.
  7. C32 uppercase Base32 layout for case-folding bearers, normalizing control bodies back to _B64 for cross-bearer tag equality and setting lossy = 1 on uppercased M text.
  8. Option 0x02 answers omitted when targeting C↔︎F tag equality on K replies (whose body already encodes the target).
  9. Option 0x80 piggyback uses 12-bit watermarks (4 B) so C↔︎F stays stateless for per-hop piggybacks.
  10. Matrix JSON sig and bsig (§3.4): sig signs the single assembled Full message (more_parts = 0, seq64 = seqs[0] expanded) for multi-part posts; bsig signs "courier matrix bind v1" || 0x00 || sig_bytes || M where M is Matrix canonical JSON of {answers, from, kind, msg, part_bytes, seqs}, binding part splits, reply target, radio key, message id, and every seq across all Matrix ingress paths (room timeline, re-feed, to-device resend/relay_request). Media file bytes are not covered by sig/bsig (accepted limitation).
  11. Hop claims (piggyback, position) stay outside the signing input and are sent and used only on bearers with authenticates_sender == "yes" (§3.5). Still open: whether position should also travel on other bearers, which would need a signed carrier (a signed option and a compact block of about 11 characters).
  12. Bad tags never block a claimed source; verification work is limited per bearer instead (§5.6). This replaces proposal §3.7 "stops listening to a source after a few bad tags".
  13. Stream epochs, the mark and stale frames (§6.3): seq64 = epoch·2^32 + n below 2^53; the epoch is stored beside the node key and never taken from a clock; a wipe, or stream state from an earlier epoch, starts a new epoch with every stream at n = 1; one mark per stream (the §5.1 reference); any signed frame may raise an author's epoch, which resets that author's 12-bit windows; only an author-direct frame anchors a window built from radio seqs; a jump of 2048 or more past an anchored mark rebuilds the window and is never claimed in a receipt. Open: restoring an older copy of the whole data directory is not detected locally (the node reissues seqs in the same epoch; an old receipt can then credit a reissued seq, and peers drop the new message as a duplicate). The node shows a warning when a peer's R claims a seq above anything it allocated, and the operator sets a new epoch. Open: a radio-only receiver learns a new epoch only from block N, which no bearer transmits before the MeshCore plugin moves to CP2 compact.
  14. Direct IP bearer profile and link handshake (§8.3, §8.4): authenticates_sender: "no" (hop claims ignored), confidentiality: "hop", auth = 2 Full frames only; initiator-MAC'd hello (hk, C, mac, to, 120 s (node_id, nonce) replay set, ASCII-only, lowercase hex; no timestamp in the hello; exact key sets and byte-exact canonical form; epoch and seen) verified before allocating state or replying; 2 s hello deadline and 64 unconfirmed sockets with no per-address limits or /64 keying; config_version mismatch allowed and bound into H; ephemeral X25519 all-zero check, raw 32-byte P in HKDF info, ChaCha20-Poly1305 link sealing and control frames (accepted, ping, pong, 0x03 refused); local-state one-link-per-peer rule (probe accepted link / tiebreak unaccepted simultaneous dial / same-initiator newest wins) and 1 s–30 s backoff (reset after 60 s); dial outcomes distinguishable in status.
  15. Signed 64-bit receipts (§3.2 0x05, 0x06; §6.2): an R claims the absolute range [base64, rwm64]; credit is by exact seq64; relayed and late receipts are accepted. Catch-up serving uses rwm64 (§8.5).
  16. Compact carriage of 0x06 (and of 0x05 on R and Q) for bearers that do not authenticate the sender (APRS, JS8) is not defined. Until it is, an R on those bearers credits nothing. Needed before P3.
  17. Matrix encrypted DM seal format (§3.4.1): com.chee3e.courier.dm to-device event {"v": 1, "node": "<64 lowercase hex>", "frame": "<unpadded base64url>"} outer-sealing a complete auth = 2 Ed25519 Full frame (conv = '0', 0x01 recipient; 0x05/0x06 on R) with ChaCha20-Poly1305 under static pair_key-derived dm_seal_key = HKDF-SHA256(pair_key, salt = sender_pub || admin_fp, info = "courier matrix dm", L = 32), aad = "courier matrix dm v1\x00" || sender_pub || recipient_pub || admin_fp, and a random 12-byte nonce from an injected RNG. Direct messages cascade direct_ip (15 s DM hold) -> matrix (matrix_confirm_wait_s, 60 s) -> radio, with no Matrix Q/resend for DM gaps in this version.