Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

SDK Reference

The ENC SDKs are JavaScript/TypeScript packages generated from the Lean 4 specification — the same formally-verified source that defines the protocol. Because they're codegen output, the client-side crypto, RBAC, and proof-checking you run is byte-identical to what the node and the spec compute.

Packages

PackageWhat it is
@enc-protocol/coreProtocol primitives — crypto, events, RBAC, SMT, CT, manifest validation, snapshots, and the confidentiality plugins
@enc-protocol/clientNetwork client — HTTP + WebSocket, sessions, wallet utilities, and a high-level SDK
@enc-protocol/memoryIn-process node emulation — the full protocol in the JS heap, no network, for tests and local development
@enc-protocol/cliThe enc app CLI — install apps, mint enclaves, submit/query from the terminal
@enc-protocol/cli-sdk-baseBase classes (AppSdk, AppClient, DataView) that every app SDK extends
Plugin SDKsThe four protocol encryption plugins — ratchet-pair, mls-lazy, identity-aead, ecdh-envelope
App SDKsTyped @enc-protocol/<app>-cli SDKs for the reference apps — personal, dm, group, super, registry, node

Installation

# point the @enc-protocol scope at the ENC registry once:
npm config set @enc-protocol:registry https://npm-registry.ocrybit.workers.dev/
npm install @enc-protocol/core @enc-protocol/client

All @enc-protocol/* packages are published to the ENC registry at https://npm-registry.ocrybit.workers.dev/. Setting the scope registry (above) lets you npm install them without a per-command --registry flag. @enc-protocol/client takes @enc-protocol/core as a peer dependency.

Generated, not hand-written

Every exported function is emitted from the Lean DSL and proven equivalent to the protocol's canonical semantics — so signature checks, proof verification, and RBAC evaluation done in the SDK match exactly what the node and the spec do. The published source is regenerated from the spec on every build; don't hand-edit it.