Shardy: Decentralized Physical Infrastructure Network
Technical Architecture Specification
Version: 2.0 (Draft)
Target Architecture: Cross-Platform Consumer Web Environment (Browser + WebAssembly)
1. Product Definition
Shardy is a next-generation decentralized physical infrastructure network that dynamically transforms standard consumer browsers into an untethered, super-scalable AI computing mesh. Rather than building centralized data warehouses, Shardy rents highly optimized CPU/GPU compute power directly through the untethered internet connection of the average, internet-connected citizen.
The system is fundamentally composed of three incredibly optimized runtime protocols:
Bun+Libp2pOrchestration: Provides instantaneous peering, gossip-sub validation, and low-latency API delivery limits.Rust -> WebAssembly (WASM): Enforces zero-copy mathematical array transformations and mathematical bounding logic. Circumvents JavaScript memory leak constraints entirely.TypeGPU (WebGPU) + Circom ZK: Enables bare-metal hardware mapping for massive neural matrices while rendering a subsequent Groth16 cryptographic proof enforcing untethered trust schemas mathematically.
2. Technology Stack (The Core Execution Primitives)
| Execution Domain | Tooling Implemented | Architectural Responsibility |
|---|---|---|
| Backend Validation Layer | Bun + ElysiaJS | High-frequency router that determines Node routing. Binds directly to SQLite maintaining localized delivery timeouts and execution Queues (Dead-Letter Queues). |
| Logic Mesh Network | Libp2p / GossipSub | Replaces centralized broadcasting. Validated executions are gossiped recursively across sibling peers eliminating bandwidth bottlenecks. |
| CPU Pre-Execution | Rust -> WASM | Maps massive incoming streams down to immutable alloc_bytes. Pre-executes Finite Clamping bounds guaranteeing calculation precision ahead of execution. |
| GPU Compute Architecture | TypeGPU / WebGPU | Converts browser tabs into AI compute hardware mapping tensors sequentially using strictly structured WGSL components natively. |
| Settlement Encryption | Circom 2.0 / SnarkJS | Translates the outputs of an untrusted machine into deterministic algebraic polynomials (ZK-Proofs) rendering fraudulent manipulation literally impossible mathematically. |
3. High-Level Architectural Flow Diagram
4. Deep Core Mechanics
A. Intelligent Sub-Routing & Matchmaking
The system cannot dispatch complex LLM structures to standard mobile devices. Through the WebSocket stream (/ws/worker-join), node hardware executes an aggressive probing session calculating memory footprint allocations and GFLOPS limits. The system defines precise WorkerTiers, mathematically mapping computational requirements sequentially.
B. The Rust WASM Engine & Zero-Copy Tensors
Through the wasm-node-engine pipeline, raw matrix streams generated from chunker.ts inside the Orchestrator circumvent basic JavaScript constraints. Data allocates into unmeasured memory chunks exposing highly fluid mutation structures allowing mathematical EMA (Exponential Moving Average) limits. The payload integrates flawlessly into TypeGPU GPUBuffer mapping segments rendering data execution continuous and immediate.
C. Byzantine Fault Tolerance & Checksums
For computational guarantees the system employs REDUNDANCY_FACTOR = 2. The same seed limits and complexity variables route blindly to independent device footprints. If device instances compute manipulated algorithms via bad configurations, the backend quorum detects the mismatch logic instantaneously. The malicious task cascades downwards executing the Dead-Letter pipeline logging fraud.
D. Zero-Knowledge Cryptographic Execution Maps
To definitively prove computations actually transpired, Shardy executes its computations utilizing a trusted constraint mapping inside shardy_task_proof_v2.circom.
- Inputs: The specific TaskID, Algorithm Output Lengths, Data Seed Matrix.
- Compilation: Result Digests are cryptographically verified against the input matrix confirming absolute matching.
- Upload:
SnarkJSreturns a highly compact verification JSON that takes< 10msto check server side, removing trust models from the network layer entirety.
5. Security Enclaves & Complete Isolation Properties
- WGSL Sandbox Restraints: Code execution arrays are forcibly constrained via standard browser WebGPU regulations. Unchecked local machine reading or malicious breakout via the Worker nodes is permanently impossible.
- PTau / ZKey Rotation Constraints: Network administration rotates initialization manifolds (
rotateActiveVerifierVersion) protecting the decentralized architecture from compromised or leaked ZK vectors by simply issuing modern setup iterations over live traffic endpoints. - Node Network Resilience: Via
@chainsafe/libp2p-gossipsub, even if primary gateways cycle or crash, node siblings are aware of network hashes circumventing the failure footprint mathematically.