tpt-mosaic

Rust

Decentralized ambient compute fabric: unifies idle edge devices (cars, robots, phones) and datacenter spot capacity into a self-verifying P2P network using dynamic quorum consensus and heterogeneous hardware redundancy. Written in Rust.

0 stars0 forks0 watchers3 open issues

Languages

Rust99.8%Dockerfile0.2%
README

tpt-mosaic

Decentralized ambient compute fabric — unifying idle edge devices and datacenter infrastructure into a single, self-verifying peer-to-peer supercomputer.

CI

By TPT Solutions · Licensed under MIT OR Apache-2.0


Overview

tpt-mosaic transforms fragmented idle silicon — cars, robots, phones, IoT devices, and spot-capacity datacenters — into a mathematically secure, globally distributed compute network. It solves Byzantine Fault Tolerance through dynamic quorum consensus and heterogeneous hardware redundancy.

Edge Nodes (Tiles)              Anchor Nodes (Ballast)
┌─────────┐ ┌─────────┐        ┌──────────────────────┐
│  Car    │ │  Robot  │        │   Datacenter (idle)   │
│  NPU    │ │  GPU    │   ◄──► │   GPU cluster (spot)  │
└─────────┘ └─────────┘        └──────────────────────┘
         ▲          ▲                    ▲
         └──────────┴────── QUORUM ──────┘
                  3-of-5 · SHA-256/BLAKE3 hashes

Architecture

CrateRole
tpt-mosaic-coreShared types, traits, error enums (no_std)
tpt-mosaic-protoMOSA binary wire protocol, strict frame codec (FlatBuffers/zero-copy planned)
tpt-mosaic-discoveryTCP mesh + mDNS peer discovery, mesh-directory DHT, heartbeat (BLE/UWB planned)
tpt-mosaic-schedulerQuorum assembly, heterogeneous matching, straggler detection
tpt-mosaic-taskMicro-task splitting (50–100 ms chunks), checkpoint/restore
tpt-mosaic-compilerRoutes to tpt-gpu (CUDA/Metal/Vulkan) or tpt-crucible (NPU/DSP/CPU)
tpt-mosaic-sandboxtpt-archon capability confinement (current workload is an echo stub; RTOS preemption hooks planned)
tpt-mosaic-quorumK-of-N consensus, early termination, Byzantine fault detection
tpt-mosaic-verifyBLAKE3/SHA-256 hashing, ZK-ML proof stubs, tpt-eve hooks
tpt-mosaic-economyMicro-rewards, reputation, slashing — ledger-backed Solana / Base / NEAR adapters (real RPC planned)
tpt-mosaic-nodeMain daemon binary: wires all subsystems, runs on every device
tpt-mosaic-benchesCriterion suite for the hot paths (not published)

Every crate ships its own README (install, features, API tour, testing) and CHANGELOG (Keep a Changelog format) alongside its manifest keywords and categories.

Quorum Tiers

TierConfigUse Case
Best Effort1-of-1 / 2-of-3Casual inference, text summarization
Standard3-of-5Financial analysis, medical screening, autonomous lane changes
Mission Critical7-of-10+High-value smart contracts, surgical robotics

Networking Stack

  • BLE / UWB — control plane: peer discovery, heartbeat, capability advertisement (planned; the TCP mesh is the current v0 transport)
  • Wi-Fi — data plane: model shards, task payloads, result uploads; mDNS zero-config LAN discovery (mdns feature)
  • 4G / 5G — fallback: task assignments and cryptographic proofs only; raw weights never routed over cellular (the routing policy lives in tpt-mosaic-task::routing; the current TCP mesh does not yet classify link types, so the guard is structural)

Quick Start

Prerequisites: Rust 1.80+ (the workspace MSRV) and Git. No GPU or special hardware is required — the default compile/execute backends are in-tree stubs.

Build the workspace:

git clone https://github.com/tpt-solutions/tpt-mosaic.git
cd tpt-mosaic
cargo build --workspace

Watch a two-node mesh meet a signed 2-of-2 quorum over loopback TCP (no configuration needed):

cargo run -p tpt-mosaic-node --example two_node_mesh
peer discovery complete: hub sees 2 nodes
task          77b1e24d036b502876f718c048387c20
agreed hash   8f2d02fb18ba11bf383ce754b51f1408ecae80e5952a60895331eb1394b59226
confirmations 2 (hub + worker)
reward        1 micro-units (paid to each contributor)
worker paid   1 micro-units on the hub's ledger

More runnable examples live in crates/tpt-mosaic-node/examples/: hello_quorum (single-node lifecycle), submit_job (control-API client), custom_executor (the TaskExecutor extension point), and byzantine_demo (divergence detection).

Run a real daemon:

cp node.toml.example node.toml   # documented defaults; edit to taste
cargo run -p tpt-mosaic-node
# in another terminal, drive the control API:
printf 'STATUS\nSUBMIT best deadbeef\n' | nc 127.0.0.1 7331

Or start the five-node Docker demo mesh (hub + secondary anchor + three edges) and submit a 3-of-5 quorum job across it:

docker compose up --build
# in another terminal:
printf 'SUBMIT standard deadbeef\n' | nc localhost 7331

Control API

The daemon exposes a line-based control API on loopback TCP (default 127.0.0.1:7331, configurable under [control] in node.toml):

STATUS   → node identity, kind, peer count, counters
PEERS    → live peer IDs as hex
SUBMIT [best|standard|critical] <hex-payload>
         → best runs locally (1-of-1); standard/critical assemble a
           heterogeneous quorum over the mesh (3-of-5 / 7-of-10), dispatch
           the payload to every member, and collect matching BLAKE3 hashes
HELP     → command summary

Responses are prefixed OK / ERR.

Mesh Networking

With a [mesh] section in node.toml, nodes find each other and run multi-node quorums over loopback/LAN TCP (MOSA v2 frames):

  • Discovery: on every heartbeat, a node trades beacons with its configured seeds, any mDNS-discovered LAN peers (mdns = true under [mesh]), and all known peers. Each beacon carries the sender's identity, hardware profile, capabilities, and mesh address; the reply is a gossip snapshot of the responder's peer table — so listing a single well-connected seed propagates the whole view, and a pure mDNS deployment needs no seeds at all (bind the mesh to 0.0.0.0 so peers can reach your LAN address).
  • Dispatch: the coordinator assembles a heterogeneous quorum from its live peer table (tpt-mosaic-scheduler), sends TaskAssignment frames, and each worker executes in its sandboxed backend and replies with a ResultHash.
  • Early termination: once K matching hashes arrive, remaining workers get a CancellationSignal (spec §3.3).

Authentication

Every node identity is an Ed25519 keypair, and the node id is derived from it (NodeId = BLAKE3(pubkey)[..16]), so a claimed identity is bound to the key that signs for it. Beacons, task assignments, and result hashes carry the sender's public key and a signature (wire v3); receivers verify the binding and the signature before trusting a frame. Beacons additionally carry a per-sender nonce and timestamp, and replays (repeated nonce) and stale frames (outside the freshness window) are rejected. The keypair persists (seed file, 0600 on Unix) via [node] state_file; setting an explicit node.id disables signing and verification (legacy compatibility mode).

A hub-and-spoke deployment only needs every node to list the hub as its seed; gossip spreads the rest. See the multi-node integration tests in crates/tpt-mosaic-node/src/mesh_integration.rs.

Development

cargo fmt --check
cargo clippy --workspace -- -D warnings
cargo doc --workspace --no-deps

See todo.md for the full phased development checklist, CHANGELOG.md for release notes, and CONTRIBUTING.md for how to contribute.

External Dependencies

tpt-mosaic integrates with other TPT Solutions crates. All four upstream repositories are multi-crate workspaces; mosaic depends on the sub-crates below, pinned to verified revisions and gated behind cargo features (off by default — enable with --all-features or the node's real-backends feature):

Mosaic crateFeatureUpstream crateIntegration
tpt-mosaic-compilergputpt-gpu-runtimeTPTIR text compiled through the tpt-gpu device (Device::load_module)
tpt-mosaic-compilercrucibletpt-crucible-catalystModel bytes (SafeTensors/GGUF) lowered to serialized TPT-IR
tpt-mosaic-sandboxarchontpt-archon-kernelCapability-confined execution: grant-sized page pool, minted capabilities, kernel-scheduler tasks
tpt-mosaic-verifyevetpt-eve-symbolicOutput claims checked for contradictions by tpt-eve's ConsistencyChecker

Without the features, the same APIs run in-crate stubs so the workspace builds and tests with no network access.

License

Licensed under either of

at your option.

Copyright © 2026 TPT Solutions