L{CORE} Platform

A TypeScript + Rust stack that brings the Cartesi Rollup VM to life on their Orbit Chai.n

A clear, section-by-section guide to the repository that connects edge devices, the Cartesi Rollup VM and KC-Chain.


1 Role in the Four-Repo Stack

Repo
Primary job
Where the code runs

lcore-device-sdk

Create DIDs, sign sensor data

Micro-controllers & gateways

lcore-platform ← THIS REPO

• Verify each device message • Forward inputs to the Rollup • Publish VM proofs & analytics on-chain

KC-Chain + one small Node service

lcore-node

Dual-encryption, zk-proof generation, SQLite storage (in VM)

Cartesi VM

lcore-shared

Common TypeScript, ABI & GraphQL helpers

Imported everywhere


2 High-Level Data Path

graph TD
    subgraph "Off-chain"
        DEV[IoT Device<br/>(signed JSON)]
        GATE[Gateway API<br/>(Node 18)]
        ROLL[rollups-node]
        VM[Cartesi VM<br/>(lcore-node)]
    end

    subgraph "KC-Chain"
        IB[InputBox (system)]
        DAPP[DApp proxy]
        REG[DeviceRegistry (Stylus)]
        VER[CartesiVerifier (Stylus)]
        PROC[IoTDataProcessor (Stylus)]
        INTEL[IntelligenceHub (Stylus)]
    end

    DEV --> GATE
    GATE -- addInput --> IB
    IB --> ROLL
    ROLL --> VM
    VM -- voucher --> VER
    VM -- notice --> PROC
    VM -- notice --> INTEL
    GATE -- register --> REG

Devices → Gateway → InputBox → VM for ingestion. VM → Stylus contracts for immutable, query-friendly results.


3 Two Core Assets Inside the Repo

3.1 Gateway Service

  • Path: src/gateway/

  • Tech: Node 18, Express, Ethers v6, dotenv, winston

  • Key endpoints

    • POST /device/register store DID & public key

    • POST /device/data submit signed sensor payload

    • GET /gateway/status operational metrics

    • GET /health liveness probe

  • Reads one env file (env.gateway) that lists RPC URL, signer key and every contract address.

3.2 Stylus Contract Suite

Location stylus_contracts/ (one Rust crate per concern)

Crate
Purpose
Notable functions

device_registry

Authorise sensors & store metadata

register_device, pause, set_processing_flags

cartesi_verifier

Anchor VM proofs on-chain

submitCartesiResult(bytes)

iot_data_processor

Hold per-device metrics

update_metric, get_metric

verified_iot_intelligence

Aggregate results for dashboards

get_processor, get_verifier

Each crate compiles to WASM with cargo stylus, auto-exports its ABI, and is deployed as a proxy contract on KC-Chain.

Why the Platform Matters

  • Security gatekeeper – rejects bad signatures before data reaches the Rollup.

  • Privacy preserver – forwards only clean JSON; encryption happens inside the VM.

  • Single source of truth – Stylus contracts expose final, proof-anchored state; dApps query KC-Chain instead of hitting the VM directly.

  • Operational simplicity – one Node container + four small proxies per city; everything else lives in lcore-node snapshots.

In a sentence

The L {CORE} Platform repo is the public bridge: it lets a sensor talk to KC-Chain in seconds and lets any dApp read tamper-proof city data without touching Cartesi internals.

Last updated