Skip to main content
Download Full Specification (PDF)

Mehr Protocol Specification v1.0

This page is the normative reference for the Mehr protocol. Individual documentation pages provide detailed explanations; this page summarizes the protocol constants, wire formats, and layer dependencies in one place.

Status

Version1.0
StatusDesign complete, pre-implementation
Normative sectionsLayers 0–5 (transport through services)
Informative sectionsLayer 6 (applications), hardware reference, roadmap

Protocol Constants

ConstantValueDefined In
Gossip interval60 secondsNetwork Protocol
Protocol overhead budget≤10% of link bandwidthBandwidth Budget
CompactPathCost size6 bytes (constant)Network Protocol
MehrExtension magic byte0x4E ('N')Network Protocol
Destination hash size16 bytes (128-bit)Network Protocol
Smallest MHR unit1 μMHRMHR Token
Supply ceiling2^64 μMHR (asymptotic)MHR Token
Default relay lottery probability1/100Stochastic Rewards
Payment channel state size200 bytesPayment Channels
Dispute challenge window2,880 gossip rounds (~48h)Payment Channels
Channel abandonment threshold4 epochsPayment Channels
Epoch trigger: settlement count≥10,000 batchesCRDT Ledger
Epoch trigger: GSet memory≥500 KBCRDT Ledger
Epoch acknowledgment threshold67% of active setCRDT Ledger
Epoch verification window4 epochs after activationCRDT Ledger
Bloom filter FPR (epoch)0.01%CRDT Ledger
DHT replication factork=3MHR-DHT
DHT XOR weight (w_xor)0.7MHR-DHT
Storage chunk size4 KBMHR-Store
Presence beacon size20 bytesDiscovery
Presence beacon interval10 secondsDiscovery
Transitive credit limit10% per hop, max 2 hopsTrust & Neighborhoods
Max scopes per node8Trust & Neighborhoods
Max scope depth8 segmentsTrust & Neighborhoods
Max scope segment length32 charactersTrust & Neighborhoods
Vouch expiry (default)30 epochsIdentity & Claims
Kickback rate range0–255 (u8)MHR-Store
Default kickback rate128 (~50%)Content Propagation
IdentityClaim min size~100 bytesIdentity & Claims
Vouch size113 bytesIdentity & Claims
Geo verification: min vouches3 (for Verified level)Voting

Cryptographic Primitives

PurposeAlgorithmOutput / Key Size
Identity / SigningEd25519256-bit (32-byte public key)
Key ExchangeX25519 (Curve25519 DH)256-bit
Identity HashingBlake2b256-bit → 128-bit truncated
Content HashingBlake3256-bit
Symmetric EncryptionChaCha20-Poly1305256-bit key, 96-bit nonce
Relay Lottery (VRF)ECVRF-ED25519-SHA512-TAI (RFC 9381)80-byte proof
Erasure CodingReed-SolomonConfigurable k,m

Layer Dependency Graph

Layer 6: Applications
├── Messaging, Social, Identity, Voice, Naming, Voting, Forums, Hosting
└── depends on ↓

Layer 5: Service Primitives
├── MHR-Store, MHR-DHT, MHR-Pub, MHR-Compute
└── depends on ↓

Layer 4: Capability Marketplace
├── Discovery, Agreements, Verification
└── depends on ↓

Layer 3: Economic Protocol
├── MHR Token, Stochastic Rewards, CRDT Ledger, Trust Neighborhoods, Propagation
└── depends on ↓

Layer 2: Security
├── Link encryption, E2E encryption, Authentication, Key management
└── depends on ↓

Layer 1: Network Protocol
├── Identity, Addressing, Routing, Gossip, Congestion Control
└── depends on ↓

Layer 0: Physical Transport
└── LoRa, WiFi, Cellular, Ethernet, BLE, Fiber, Serial

Each layer depends only on the layer directly below it. Applications never touch transport details. Payment never touches routing internals.

Serialization Rules

All Mehr wire formats use the following conventions:

RuleValue
Byte orderLittle-endian for all multi-byte integers (u16, u32, u64, i64)
EncodingFixed-size binary fields; no self-describing framing (not CBOR, not JSON)
TLV extensionsType (u8), Length (u8, max 255), Data (variable). Used in MehrExtension only
StringsUTF-8, length-prefixed with u16 (community labels, function IDs)
HashesRaw bytes, no hex encoding on the wire
SignaturesRaw 64-byte Ed25519 signatures, no ASN.1/DER wrapping
Normalized scoresComputed on decoded values, then divided by the max decoded value in the candidate set. Result is IEEE 754 f32 on nodes that support FP; 16-bit fixed-point (Q0.16, value × 65535) on constrained nodes. Both yield equivalent routing decisions within rounding tolerance

Wire Format Summary

Packet Format (Reticulum-derived)

[HEADER 2B] [DEST_HASH 16B] [CONTEXT 1B] [DATA 0-465B]
Max packet size: 484 bytes
Source address: NOT PRESENT (structural sender anonymity)

Mehr Announce Extension

[MAGIC 1B: 0x4E] [VERSION 1B] [CompactPathCost 6B] [TLV extensions...]
Minimum: 8 bytes. Carried in announce DATA field.

CompactPathCost

[cumulative_cost 2B] [worst_latency_ms 2B] [bottleneck_bps 1B] [hop_count 1B]
Total: 6 bytes (constant regardless of path length)

Payment Channel State

[channel_id 16B] [party_a 16B] [party_b 16B] [balance_a 8B]
[balance_b 8B] [sequence 8B] [sig_a 64B] [sig_b 64B]
Total: 200 bytes

Specification Sections

Spec SectionDocumentation Page
0. Design PhilosophyIntroduction
1. Layer 0: Physical TransportPhysical Transport
2. Layer 1: Network ProtocolNetwork Protocol
3. Layer 2: SecuritySecurity
4. Layer 3: Economic ProtocolMHR Token, Stochastic Relay Rewards, CRDT Ledger, Trust & Neighborhoods, Real-World Economics
5. Layer 4: Capability MarketplaceOverview, Discovery, Agreements, Verification
6. Layer 5: Service PrimitivesMHR-Store, MHR-DHT, MHR-Pub, MHR-Compute
7. Layer 6: ApplicationsMessaging, Social, Voice, Naming, Community Apps, Hosting
8. Hardware ReferenceReference Designs, Device Tiers
9. Implementation RoadmapRoadmap
10. Design DecisionsDesign Decisions
11. Open QuestionsOpen Questions

Version History

VersionStatusDescription
v0.1-v0.5SupersededEarly design iterations
v0.8SupersededIntroduced explicit community zones (later replaced by trust neighborhoods)
v1.0CurrentConsolidated specification — Reticulum foundation, stochastic relay rewards, emergent trust neighborhoods

This specification consolidates design work from v0.1 through v1.0. The foundation — Reticulum-based transport, cryptographic identity, Kleinberg small-world routing, stochastic relay rewards, CRDT settlement, epoch compaction, emergent trust neighborhoods, and the capability marketplace — is the protocol. Everything above it — storage, compute, pub/sub, naming, and applications — are services built on that foundation.