Skip to main content

Components

Each component sits in exactly one of three layers — decentralized, off-chain but verifiable, or on-chain — and that distinction is the subject of Decentralization & verifiability model. Don’t read “Pinaivu” as a single trust domain; read it as three different kinds of claim stitched together by the contracts:
ComponentLayerRole
CoordinatorOff-chain, verifiableAttested Nitro Enclave (the Nautilus pattern) that brokers auctions between clients and decentralized GPU nodes, settles payment, and signs routing receipts. Never runs inference itself.
NodeDecentralizedIndependent operator’s GPU machine. Runs the model, joins the open libp2p mesh, bids on inference requests, signs a ProofOfInference per completed job.
Gateway (api.pinaivu.com)Off-chainStateless OpenAI-compatible front door for developers. Per-key auth, no memory layer, not itself an enclave.
chat-relayer (chat.pinaivu.ai)Off-chain, verifiableStateful front door for end users — itself a second Nitro Enclave — adds cross-session memory via embeddings + Walrus.
Explorer (explorer.pinaivu.com)Off-chainPublic lookup for routing receipts, payments, and node activity, backed by the explorer-indexer service.
Sui contracts (pinaivu::*)On-chainThe root of trust: enclave registration, receipt verification, treasury vault. What makes the off-chain components’ claims checkable.
WalrusDecentralizedIndependent, content-addressed storage network for archived receipts and encrypted chat session history.

Component diagram

The diagram below uses the same three-way split as Decentralization & verifiability model: ON-CHAIN (Sui), OFF-CHAIN, VERIFIABLE (the Nautilus-pattern enclaves), and DECENTRALIZED (the node mesh and Walrus).
                                ┌─────────────────────────────────────┐
                                │  ON-CHAIN (Sui)                      │
                                │  pinaivu::{enclave, receipts, vault}│
                                └────────────┬───────┬────────────────┘
                                             │       │
                              register/      │       │  settle()
                              update_pcrs    │       │  (sig must verify
                                             │       │   under registered
                                             │       │   enclave key)
                  ┌──────────────────────────┴───────┴───────────────────┐
                  │  OFF-CHAIN, VERIFIABLE                               │
                  │  Coordinator — Nitro Enclave (NSM-attested)          │
                  │   HTTP API · libp2p mesh · apalis · signs receipts   │
                  └────────┬─────────────────────┬────────────┬─────────┘
                           │                      │            │
                           ▼                      ▼            ▼
                 DECENTRALIZED              Postgres + Redis   DECENTRALIZED
                 libp2p mesh (auction)      (receipts, jobs,   Walrus storage
                       │                    payments)          (archived
            ┌──────────┴──────────┐                            receipts)
            │                     │
        ┌───┴───┐            ┌────┴────┐
        │ node  │            │  node   │   independent operators,
        │       │            │         │   each bids + runs inference,
        └───────┘            └─────────┘   sends signed CompletionAck

   api.pinaivu.com ──▶ gateway (off-chain, stateless) ────┐
                                                            ├──▶ coordinator
   chat.pinaivu.ai ──▶ chat-relayer (off-chain, verifiable,─┘     (above)
                        Nitro Enclave)


                 cross-session memory: pgvector + DECENTRALIZED Walrus storage

Request lifecycle

1. client → coordinator      POST /v1/chat/completions
                              { model, messages, client_pubkey_hex }
2. coordinator               publishes InferenceRequest on gossipsub
                              "/pinaivu/inference/any/1.0.0"
3. nodes                     receive request, bid via "/pinaivu/bids/1.0.0"
                              InferenceBid { peer_id, price_per_1k,
                                             latency, reputation,
                                             http_endpoint,
                                             payout_address }
4. coordinator               ranks bids, picks winner, signs DispatchToken
5. coordinator → client      { request_id, node_url, dispatch_token }
6. client → node             POST {node_url}/v1/inference
                              { prompt, dispatch_token }
7. node                      verifies dispatch_token, runs inference,
                              returns the response directly to the client,
                              builds + signs ProofOfInference
8. node → coordinator        libp2p request-response on
                              "/pinaivu/completion/1.0.0"
                              CompletionAck { request_id, proofs[],
                                              aggregated_output_hash,
                                              signature }
9. coordinator               verifies primary sig + every embedded proof,
                              signs RoutingReceipt (BCS IntentMessage),
                              stores it, enqueues settlement
10. apalis worker            computes payouts from proofs, submits
                              vault::settle PTB(s) on Sui
11. anyone                   GET /v1/proofs/{request_id} → receipt
Two things are worth noticing in that lifecycle: the response never streams through the coordinator (step 7 goes straight node → client), and the coordinator never runs a model — it only ranks bids, signs, and verifies. Both of those properties are what keep the coordinator’s off-chain job narrow enough to fit inside an enclave and stay verifiable. See Decentralization & verifiability model for why each of these pieces (Nautilus enclave, Sui, Walrus, open node mesh) closes a specific way a naive “just trust our server” coordinator could otherwise misbehave.

Decentralization & verifiability model

Nautilus, Sui, Walrus, and the open node mesh — what each one prevents

Protocol

Wire types, signing formats, libp2p topics

On-chain contracts

pinaivu::enclave, receipts, vault

Memory layers

How chat.pinaivu.ai keeps conversations coherent across nodes and sessions