Competitive Message Routing
Decentralized, compression-driven message routing
Overview
THIS PAGE IS WIP -- SERVERS ARE NOT UP YET.
Competitive Message Routing (CMR) is a decentralized protocol in which messages are routed through a peer-to-peer network using compression distance as the sole semantic signal. There are no topic labels, keyword indices, or neural embeddings. Instead, every router measures how well an incoming message compresses against its cached context from each neighbor, and forwards the message toward the peer whose context is most similar, as judged by a universal compressor.
The core distance metric from Section 3.2 of the specification is:
D(X, Y) = C(XY) - C(X) + C(YX) - C(Y)
where C(XY) is the compressed size of X concatenated with Y. A low distance means the compressor found mutual information between the message and the peer's context, indicating semantic relevance without any explicit classification.
Routing is competitive: each router independently evaluates incoming messages against its local cache and decides whether to forward, cache, or discard. Messages that carry no useful information (low intrinsic dependence) are dropped as spam. Duplicate messages are detected by ID and rejected. Flood controls cap the per-peer and global throughput to prevent exponential message explosion.
Specification
CMR is defined in Matt Mahoney's paper on distributed artificial general intelligence. The full specification is available at:
- mattmahoney.net/agi2.html - Distributed AGI design (V2.2, August 2024), defining the CMR protocol in Section 3 and Appendix A [mahoney_agi2]
- mattmahoney.net/agi.html - Earlier AGI design discussing the theoretical foundations [mahoney_agi]
The specification covers the message format (signature, routing header with strictly descending timestamps, length-prefixed body), router behavior (caching, distance-based forwarding, flood control, intrinsic-dependence spam filtering), transport methods (HTTP, HTTPS, UDP, SMTP, SSH), and key exchange (RSA, Diffie-Hellman, clear exchange over secure channels).
Our Implementation
We maintain an open-source Rust implementation of the CMR protocol:
The implementation is structured as a Cargo workspace with four crates:
- cmr-core - Protocol parser, router logic, key exchange, policy enforcement
- cmr-peer - Network peer daemon with HTTP, HTTPS, UDP, and SMTP listeners
- cmr-client - High-level client library for programmatic interaction
- cmr-compressor - Isolated compression worker backed by infotheory
Cryptographic Deviation
The V2.2 specification suggests raw SHA-256(key || message) for message authentication. This construction is vulnerable to length-extension attacks and is not a standard MAC. Our implementation deviates by using:
- RFC 2104 HMAC-SHA-256 for pairwise message authentication, with constant-time signature verification [rfc2104]
- RFC 5869 HKDF-SHA-256 for deriving symmetric keys from RSA/DH shared secrets [rfc5869]
These are strict improvements. The wire format is otherwise identical to the specification: signature line prefix 1 followed by 64 lowercase hex characters encoding the 256-bit digest.
Public Seed Peers
The following peers are operated by us and are available for anyone to connect to. Configure them in your cmr-peer.toml as initial seeds.
cmr.infotheory.tech
- HTTP: http://cmr.infotheory.tech
- HTTPS: https://cmr.infotheory.tech
cmr2.infotheory.tech
- HTTP: http://cmr2.infotheory.tech
- HTTPS: https://cmr2.infotheory.tech
SMTP
- Email: cmr@infotheory.tech
- Send CMR-formatted messages as email body
These are open, unauthenticated seed peers. Key exchange will occur automatically on first contact. See the Quick Start guide for configuration details.