MeshKit

Core

The MeshKit engine behind SDK, runtimes, providers, and security.

Core is the shared engine behind the SDK facade, runtime packages, CLI, MCP tools, providers, identity, sharing, persistence, policies, sync, proofs, and diagnostics.

Most application features should start with SDK. Use Core when you need to own infrastructure wiring or reason about the lower-level contract.

When To Use Core

Use Core when...Stay on the SDK facade when...
You are constructing providers or loading meshkit.config.jsonYou only need files, records, sharing, messages, or sync
You need explicit identity, directory, policy, persistence, or telemetry optionsLocal development defaults are enough
You are building a runtime adapter or provider integrationYou are writing feature code
You need exact TypeScript types and advanced namespacesYou want the shortest app import

Core Mental Model

Core receives plaintext from the caller, encrypts it into a MeshKit envelope, writes encrypted bytes and metadata through a provider, and returns typed objects such as CIDs, proofs, capsules, messages, sync jobs, persistence proofs, and doctor reports.

Create A Core Client

import { createMeshkit, LocalDevProvider } from "@meshkit/core";

const mesh = await createMeshkit({
  provider: new LocalDevProvider(),
  identity: "core-demo",
});

const file = await mesh.files.put("core.txt", "encrypted by MeshKit Core");
const proof = await mesh.proofs.get(file.cid);

console.log(file.cid, proof.verified);

That example uses LocalDevProvider so the wiring is visible. Replace it with provider configuration before production.

Core Owns These Boundaries

BoundaryWhat Core coordinates
EncryptionEnvelope creation, authenticated metadata, recipient key wrapping
ProvidersByte storage, proofs, capsules, mailboxes, sync jobs, logs, health
IdentityLocal identities, export/import, publish/resolve hooks
SharingCapsules, expiry, revocation, vault checks, capability checks, policy checks
PersistenceFilecoin or long-term retention proof providers
RuntimeBrowser, Node, React Native, Ionic, and platform capability assumptions
ObservabilityDoctor reports, provider logs, telemetry sinks

Production Boundary

Core makes production setup explicit. Before shipping, centralize provider construction in one infrastructure module and document:

  • Which provider stores encrypted bytes
  • Which metadata service stores MeshKit proofs and workflow records
  • Which identity directory resolves recipient public keys
  • Which policy and persistence providers are required
  • Which validation command proves the environment works
  • Which logs and proof summaries are retained

Reading Order

  1. Core Quickstart
  2. Envelope encryption
  3. Proofs and CIDs
  4. Provider model
  5. Metadata service
  6. Identity and sharing
  7. Provider setup

On this page