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
| Package | What it is |
|---|---|
@enc-protocol/core | Protocol primitives — crypto, events, RBAC, SMT, CT, manifest validation, snapshots, and the confidentiality plugins |
@enc-protocol/client | Network client — HTTP + WebSocket, sessions, wallet utilities, and a high-level SDK |
@enc-protocol/memory | In-process node emulation — the full protocol in the JS heap, no network, for tests and local development |
@enc-protocol/cli | The enc app CLI — install apps, mint enclaves, submit/query from the terminal |
@enc-protocol/cli-sdk-base | Base classes (AppSdk, AppClient, DataView) that every app SDK extends |
| Plugin SDKs | The four protocol encryption plugins — ratchet-pair, mls-lazy, identity-aead, ecdh-envelope |
| App SDKs | Typed @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/clientAll @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.