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
| Version | 1.0 |
| Status | Design complete, pre-implementation |
| Normative sections | Layers 0–5 (transport through services) |
| Informative sections | Layer 6 (applications), hardware reference, roadmap |
Protocol Constants
| Constant | Value | Defined In |
|---|---|---|
| Gossip interval | 60 seconds | Network Protocol |
| Protocol overhead budget | ≤10% of link bandwidth | Bandwidth Budget |
| CompactPathCost size | 6 bytes (constant) | Network Protocol |
| MehrExtension magic byte | 0x4E ('N') | Network Protocol |
| Destination hash size | 16 bytes (128-bit) | Network Protocol |
| Smallest MHR unit | 1 μMHR | MHR Token |
| Supply ceiling | 2^64 μMHR (asymptotic) | MHR Token |
| Default relay lottery probability | 1/100 | Stochastic Rewards |
| Payment channel state size | 200 bytes | Payment Channels |
| Dispute challenge window | 2,880 gossip rounds (~48h) | Payment Channels |
| Channel abandonment threshold | 4 epochs | Payment Channels |
| Epoch trigger: settlement count | ≥10,000 batches | CRDT Ledger |
| Epoch trigger: GSet memory | ≥500 KB | CRDT Ledger |
| Epoch acknowledgment threshold | 67% of active set | CRDT Ledger |
| Epoch verification window | 4 epochs after activation | CRDT Ledger |
| Bloom filter FPR (epoch) | 0.01% | CRDT Ledger |
| DHT replication factor | k=3 | MHR-DHT |
| DHT XOR weight (w_xor) | 0.7 | MHR-DHT |
| Storage chunk size | 4 KB | MHR-Store |
| Presence beacon size | 20 bytes | Discovery |
| Presence beacon interval | 10 seconds | Discovery |
| Transitive credit limit | 10% per hop, max 2 hops | Trust & Neighborhoods |
| Max scopes per node | 8 | Trust & Neighborhoods |
| Max scope depth | 8 segments | Trust & Neighborhoods |
| Max scope segment length | 32 characters | Trust & Neighborhoods |
| Vouch expiry (default) | 30 epochs | Identity & Claims |
| Kickback rate range | 0–255 (u8) | MHR-Store |
| Default kickback rate | 128 (~50%) | Content Propagation |
| IdentityClaim min size | ~100 bytes | Identity & Claims |
| Vouch size | 113 bytes | Identity & Claims |
| Geo verification: min vouches | 3 (for Verified level) | Voting |
Cryptographic Primitives
| Purpose | Algorithm | Output / Key Size |
|---|---|---|
| Identity / Signing | Ed25519 | 256-bit (32-byte public key) |
| Key Exchange | X25519 (Curve25519 DH) | 256-bit |
| Identity Hashing | Blake2b | 256-bit → 128-bit truncated |
| Content Hashing | Blake3 | 256-bit |
| Symmetric Encryption | ChaCha20-Poly1305 | 256-bit key, 96-bit nonce |
| Relay Lottery (VRF) | ECVRF-ED25519-SHA512-TAI (RFC 9381) | 80-byte proof |
| Erasure Coding | Reed-Solomon | Configurable 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:
| Rule | Value |
|---|---|
| Byte order | Little-endian for all multi-byte integers (u16, u32, u64, i64) |
| Encoding | Fixed-size binary fields; no self-describing framing (not CBOR, not JSON) |
| TLV extensions | Type (u8), Length (u8, max 255), Data (variable). Used in MehrExtension only |
| Strings | UTF-8, length-prefixed with u16 (community labels, function IDs) |
| Hashes | Raw bytes, no hex encoding on the wire |
| Signatures | Raw 64-byte Ed25519 signatures, no ASN.1/DER wrapping |
| Normalized scores | Computed 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 Section | Documentation Page |
|---|---|
| 0. Design Philosophy | Introduction |
| 1. Layer 0: Physical Transport | Physical Transport |
| 2. Layer 1: Network Protocol | Network Protocol |
| 3. Layer 2: Security | Security |
| 4. Layer 3: Economic Protocol | MHR Token, Stochastic Relay Rewards, CRDT Ledger, Trust & Neighborhoods, Real-World Economics |
| 5. Layer 4: Capability Marketplace | Overview, Discovery, Agreements, Verification |
| 6. Layer 5: Service Primitives | MHR-Store, MHR-DHT, MHR-Pub, MHR-Compute |
| 7. Layer 6: Applications | Messaging, Social, Voice, Naming, Community Apps, Hosting |
| 8. Hardware Reference | Reference Designs, Device Tiers |
| 9. Implementation Roadmap | Roadmap |
| 10. Design Decisions | Design Decisions |
| 11. Open Questions | Open Questions |
Version History
| Version | Status | Description |
|---|---|---|
| v0.1-v0.5 | Superseded | Early design iterations |
| v0.8 | Superseded | Introduced explicit community zones (later replaced by trust neighborhoods) |
| v1.0 | Current | Consolidated 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.