Skip to main content

Architecture

Lucid is a verifiable AI inference protocol with three layers:

System Overview

┌─────────────────────────────────────────────────────────────┐
│                      YOUR APPLICATION                        │
│  TypeScript SDK  │  REST API  │  MCP Server  │  n8n Nodes   │
└────────────────────────┬────────────────────────────────────┘

┌────────────────────────▼────────────────────────────────────┐
│                    LUCID API LAYER                            │
│                                                              │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐   │
│  │Passports │  │ Matching │  │ Routing  │  │ Receipts │   │
│  │ Registry │  │  Engine  │  │  Engine  │  │  (MMR)   │   │
│  └──────────┘  └──────────┘  └──────────┘  └──────────┘   │
│                                                              │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐   │
│  │  Epochs  │  │ Payouts  │  │  Agents  │  │ Compute  │   │
│  │Anchoring │  │  Engine  │  │Orchestr. │  │  Nodes   │   │
│  └──────────┘  └──────────┘  └──────────┘  └──────────┘   │
└────────────────────────┬────────────────────────────────────┘

┌────────────────────────▼────────────────────────────────────┐
│                    ON-CHAIN LAYER                             │
│                                                              │
│  ┌────────────────┐  ┌────────────────┐                     │
│  │ lucid-receipts │  │ lucid-registry │  ← Solana Programs  │
│  │  (Rust/BPF)    │  │  (Rust/BPF)    │                     │
│  └────────────────┘  └────────────────┘                     │
│                                                              │
│  Solana Mainnet — Immutable receipt anchors                  │
└─────────────────────────────────────────────────────────────┘

Request Flow

  1. Client sends inference request via SDK or REST
  2. Matching Engine selects optimal model based on policy
  3. Routing Engine dispatches to the selected LLM provider
  4. LLM processes the request and returns response
  5. Receipt Service creates cryptographic receipt with MMR proof
  6. Epoch Service batches receipts for on-chain anchoring
  7. Anchor Worker commits epoch to Solana

Key Components

Passports

Universal identity for everything in the network: models, compute nodes, tools, datasets, agents. Each passport has metadata, tags, capabilities, and an on-chain representation.

Merkle Mountain Range (MMR)

An append-only data structure used for receipt proofs. Each receipt is a leaf in the MMR tree. Inclusion proofs allow verification without downloading the entire tree.

Epoch Anchoring

Receipts are batched into epochs. Each epoch’s MMR root is anchored on Solana, creating an immutable proof that the receipts existed at a specific point in time.

Agent Orchestrator

Autonomous agents follow a plan → accomplish → execute → validate lifecycle. Each step generates receipts, creating a full audit trail of agent behavior.

Repositories

RepoPurpose
Lucid-L2Backend protocol (offchain API + Solana programs)
LucidMergedFrontend platform + AI studio
lucid-plateform-corePlatform infrastructure (billing, keys, metering)
lucid-ai-sdkTypeScript SDK (Speakeasy-generated)
docsThis documentation site