Skip to content
ENC Protocol

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 aggregator
@enc-protocol/clientNetwork client — HTTP + WebSocket, sessions, wallet utilities, and a high-level SDK
@enc-protocol/dataviewDataView SDK — push receiver, base DataView, and HTTP client
@enc-protocol/servicesPlatform-agnostic protocol services — Registry, Profiles, PeerMessaging, Subscriber, EnclaveProvisioner — plus the composeSdk one-liner
@enc-protocol/app-sdk-baseBase classes (AppSdk, AppClient, DataView) that every app SDK extends
Plugin frameworkThe four @enc-protocol/plugin-* packages — the plugin contract, the registry/runtime, and the client + DataView slot implementations
Confidentiality pluginsThe (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 SDKsTyped @enc-protocol/<app>-sdk SDKs for the reference apps — personal, dm, group, super, registry, node

Installation

npm install @enc-protocol/core @enc-protocol/client

All @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.