Skip to main content
The LiopClient class acts as the primary dispatch coordinator for Agent Nodes in the Logic-Injection-on-Origin Protocol. It manages transport negotiation across heterogeneous topologies (direct HTTP/JSON-RPC gateways, authenticated perimeter proxies, and sovereign P2P gRPC channels), executes cryptographic handshakes, and dispatches WebAssembly or JavaScript logic modules to remote Data Nodes. Unlike traditional Model Context Protocol (MCP) clients that pull massive raw datasets across the network via polling or streaming endpoints, LiopClient packages analytical intent into isolated micro-modules and transmits them directly to where the data resides.

Constructor & Configuration

The constructor configures the transport-level TLS credentials applied to all underlying gRPC connections.

Constructor Parameters

LiopTlsOptions
Cryptographic credentials for mutual TLS (mTLS) or server verification over gRPC transport.

Connecting to the Mesh (connect)

The connect() method establishes identity, provisions machine-to-machine (M2M) OAuth 2.1 tokens, and mounts either a direct point-to-point gRPC channel or a distributed libp2p node.

Connection Options

string
Target endpoint in host:port format. When specified, creates a direct high-speed LiopRpcClient targeting that endpoint. When omitted, LiopClient routes requests dynamically through the peer-to-peer DHT.
object
Advanced connection settings covering authentication and peer-to-peer discovery.

Capability Discovery & Tool Invocations

LiopClient unifies tool discovery and execution under standard MCP schema shapes while enforcing post-quantum transport security under the hood.

In-Situ Logic Injection (WASM Bytecode)

For zero-data-movement pipelines, pass compiled WebAssembly bytecode directly via the optional second argument of callTool(). The remote enclave validates the bytecode through Guardian AST before executing it in an isolated V8 sandbox.

Mathematical Verification (ZK-Receipts)

Every analytical payload executed by a compliant LIOP Data Node generates a cryptographic ZK-Receipt. The client verifier automatically inspects receipts returned during callTool(), supporting all three protocol modes:
  • Mode 0 (Version 1): HMAC-SHA256 session commitment negotiated via ML-KEM-768.
  • Mode 2 (Version 2): Groth16 Zero-Knowledge SNARK proof over the BN254 pairing-friendly elliptic curve.
  • Mode 3 (Version 2.1): Dual-layer hybrid receipt combining a Groth16 BN254 mathematical proof with an ML-DSA-65 post-quantum digital signature.
To manually verify receipts received out-of-band:

Pre-Flight Hardware TEE Attestation

When communicating with confidential virtual machines on untrusted cloud hosts, verify hardware root-of-trust evidence before initiating cryptographic handshakes:
The pre-flight verifier validates:
  • AMD SEV-SNP: Inspects 1,184-byte snp_report_t headers, checks REPORT_DATA at byte offset 0x50 against SHA-256(publicKey || nonce), verifies VCEK certificate signatures, and ensures debug mode is disabled.
  • AWS Nitro Enclaves: Decodes CBOR-encoded COSE_Sign1 documents, checks PCR registers (PCR0, PCR1, PCR2), validates user_data binding, and verifies certificates up to AWS Nitro Root CA.

Low-Level gRPC Transport (LiopRpcClient)

For applications that need fine-grained control over gRPC channels, metadata streaming, or token injection without spawning a P2P node, use LiopRpcClient directly:

gRPC Channel Invariants

LiopRpcClient configures symmetric channel options to ensure long-running analytical queries do not drop across stateful NATs or corporate firewalls:

Public Methods Reference


Error Handling & Exception Catalog

LiopClient throws structured exceptions when security policies, authentication checks, or sandbox boundaries reject an execution.

Protocol Error Codes