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 aggregator |
@enc-protocol/client | Network client — HTTP + WebSocket, sessions, wallet utilities, and a high-level SDK |
@enc-protocol/dataview | DataView SDK — push receiver, base DataView, and HTTP client |
@enc-protocol/services | Platform-agnostic protocol services — Registry, Profiles, PeerMessaging, Subscriber, EnclaveProvisioner — plus the composeSdk one-liner |
@enc-protocol/app-sdk-base | Base classes (AppSdk, AppClient, DataView) that every app SDK extends |
| Plugin framework | The four @enc-protocol/plugin-* packages — the plugin contract, the registry/runtime, and the client + DataView slot implementations |
| Confidentiality plugins | The (role, suite) encryption schemes — ratchet-pair, mls-lazy, identity-aead, ecdh-envelope — shipped as independent @enc-protocol/plugin-* packages, built on @enc-protocol/core primitives |
| App SDKs | Typed @enc-protocol/<app>-sdk SDKs for the reference apps — personal, dm, group, super, registry, node |
Installation
npm install @enc-protocol/core @enc-protocol/clientAll @enc-protocol/* packages are published to npm. @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.