Protocol Specification

Lattice Architecture

Peer-to-peer decentralized network built in native Rust. No cloud. No chain. Just sovereign nodes.

The Lattice is a heterogeneous mesh network enforcing strict separation between high-compute coordination nodes and resource-constrained edge infrastructure. Every mechanism described below is running code — traceable in the public repository.

Core Networking & Substrate

Identity, Transport, and Multiplexing

Cryptographic Identity

Every node generates and maintains a unique, persistent identity anchored by an Ed25519 keypair. The key survives system restarts (persisted to disk with 0o600 permissions), preventing identity spoofing and Sybil attacks. One keypair = one reputation = one economic actor.

identity::Keypair::generate_ed25519()
→ to_protobuf_encoding() → ~/.lattice/identity.key

Secure Transport Layer

All peer-to-peer traffic is end-to-end encrypted using the Noise XX handshake protocol. Mutually authenticated channels are established before any application data is exchanged — no plaintext ever touches the wire.

noise::Config::new
→ authenticated channel → yamux stream

Stream Multiplexing

A single TCP socket is multiplexed into multiple independent, concurrent logical substreams using Yamux. This keeps connection overhead exceptionally low on edge hardware like the Raspberry Pi 5 — one socket, many conversations.

yamux::Config::default
→ N substreams over 1 TCP connection

Wire Integrity & Defense

Bounded Frames, No Exceptions

Resource-constrained edge nodes are vulnerable to memory exhaustion (OOM) exploits. The Lattice enforces a strict, bounded data frame at the protocol level — every packet must conform, or the connection is dropped.

Serialization

Payloads are serialized using CBOR (Concise Binary Object Representation — RFC 8949). Schema-flexible, self-describing, and parsed at near-instantaneous binary speeds. Significantly more compact than JSON on the wire.

Length-Prefix Framing

Every packet is bound by a mandatory 4-byte big-endian length prefix. The stream reader knows exactly where each framed message ends before parsing begins — no ambiguity, no buffering attacks.

1 MiB Buffer Guard

A hard 1 MiB guard ceiling is enforced at the codec level. Any frame exceeding this boundary is instantly discarded and the offending socket is dropped before it can impact the main thread pool. No allocation, no OOM.

const MAX_FRAME_BYTES: u32 = 1024 * 1024;

Discovery & Routing Topology

Local and Global, Without a Directory

Local Area Mesh

Nodes ambiently discover adjacent peers on local segments using network-isolated mDNS multicasting. Zero-configuration deployments — nodes on the same LAN find each other automatically within seconds. No bootstrap server required.

Wide Area Network

Past the local gateway, the network translates cryptographic identities into a global Kademlia DHT keyspace. Nodes maintain local k-buckets to calculate routing paths deterministically via XOR mathematical distance. The mesh grows beyond LAN without a routing table.

Trustless Storage Verification

Adversarial Interrogation, Not Optimistic Trust

The lattice does not ask nodes whether they hold data. It challenges them to prove it — cryptographically, on every epoch tick. The verification pipeline is asynchronous, non-blocking, and runs entirely on Thread 0.

[Validator Clock] ──→ Derive Challenge (Blake3) ──→ Outbound RPC

                                                                       │
[Ledger Updated] ←── Verify Merkle Inclusion Path ←── MPSC Bridge ←──┘

1. Deterministic Interrogation

At every epoch tick, validators derive a pseudo-random chunk_index and a unique salt using Blake3 hashing. The hash input is resource_id || epoch_be_bytes. Every validator on the network arrives at the identical challenge independently — zero coordination overhead.

2. Thread-Isolated Proof Generation

The target node receives the challenge and isolates disk I/O from the network state machine by spawning a background blocking task. It extracts the requested raw data chunk and computes the salted hash:

salted_hash = blake3(chunk_bytes + salt)

3. Merkle Path Attestation

The node constructs a binary Merkle inclusion tree from all stored chunks. Odd-leaf alignment boundaries are handled cleanly (last leaf duplicated for pairing). The sibling hashes tracing the targeted chunk back to its root resource_id form the inclusion proof.

4. The Async Bridge

The resulting proof payload is funneled through an internal multi-producer, single-consumer (mpsc) channel back to the main event loop (Thread 0). The libp2p Swarm — which is !Send — never leaves the main thread. Memory isolation is preserved; network responsiveness is never compromised.

Deployment Target

From Workstation to Raspberry Pi

The lattice cross-compiles to aarch64-unknown-linux-gnu for deployment on Raspberry Pi 5 hardware. The same binary runs on x86_64 Linux workstations for development and testing. No container runtime required — a single static binary with no runtime dependencies beyond the kernel.

# Cross-compile for Raspberry Pi 5
cargo build --release --target aarch64-unknown-linux-gnu
# Verify the artifact
file target/aarch64-unknown-linux-gnu/release/lattice-node
→ ELF 64-bit LSB executable, ARM aarch64

One-Page Reference

Need the engineering card?

Everything on this page — plus the Georgist economic model — delivered as a single zero-dependency HTML file. Terminal aesthetic. No site chrome. Designed to be handed to someone who wants to know what the lattice is made of.

Read the Protocol Spec →
The Emergence Institute: Collective Charter Community Gallery Engine Room Applied Verification Updates