Skip to main content
While @nekzus/liop provides the developer experience in Node.js and TypeScript, the protocol foundation is anchored in the Rust Backend located at servers/liop-node/. This workspace implements the hyper-optimized binary protocol buffers, the Wasmtime engine execution boundary with instruction fuel metering, and the native rust-libp2p peer-to-peer transport stack. Interact with the Rust Core directly when:
  • Building an LIOP SDK for a compiled language (e.g., Go, C++, Python native extensions).
  • Customizing the Wasmtime memory trap handler or WASI capability pre-opens.
  • Modifying Kademlia DHT routing policies or Noise handshake implementations.

Workspace Architecture

The Cargo workspace divides protocol responsibilities into specialized crates:

liop-core

The binary protocol definition. Contains compiled Protobuf definitions (liop_core.proto) generated via tonic and prost. Defines the unalterable binary wire framing for all network intents.

liop-node

The Data Node bastion. Leverages wasmtime to create the WASI execution boundary for incoming WebAssembly logic. Incorporates interfaces for Hardware Security Modules (HSM) and ZK-Receipt computation.

liop-client

The native Agent Node. Dispatches logic payloads across the mesh securely utilizing rust-libp2p with Kademlia DHT routing and Noise protocol authentication.

wasm-filters

Pre-compiled logic modules targeting wasm32-wasip1. Houses optimized statistical filtering, aggregation, and anomaly detection algorithms for in-situ deployment.

Network Transport Stack

LIOP requires low-latency, bidirectional streaming to support dynamic capability execution and real-time telemetry:
  1. Tonic (gRPC over HTTP/2): Tonic manages message framing, streaming flow control, and backpressure asynchronously on top of the tokio multi-threaded runtime. All payloads serialize to binary Protobuf, eliminating JSON encoding overhead.
  2. rust-libp2p (Noise & Kademlia): Nodes authenticate using cryptographic Ed25519 identities via the Noise Protocol Framework (XX handshake pattern). Peers locate content and capabilities dynamically using the standard Kademlia DHT protocol identifier (/ipfs/kad/1.0.0), eliminating dependence on centralized DNS or PKI certificate authorities.

Execution Boundary & Fuel Metering

The core execution path resides in servers/liop-node/src/executor.rs:

Sandbox Security Invariants

  • Instruction Fuel Traps: Every instruction decrements the CPU fuel counter. Payloads attempting infinite loops trigger a deterministic Trap::OutOfFuel before consuming host CPU threads.
  • Linear Memory Bounds: Memory allocations are bounded to strict 64 KB WebAssembly pages. Attempting to read or write outside the allocated sandbox memory triggers an immediate segmentation fault isolated within the thread.
  • WASI Capability Pre-Opens: Sandboxed modules cannot traverse the host filesystem. Only explicitly designated subdirectories mounted through WasiCtxBuilder::preopened_dir() are visible to the guest bytecode.

Empirical Performance Benchmarks

The table below contrasts the native Rust node against traditional containerized REST and Node.js execution environments: