For the complete documentation index, see llms.txt. This page is also available as Markdown.

Repository Map

A tour of the lib-derec monorepo. Use this when you are looking for a particular trait, flow, or worked example and want to know which directory owns it.

Layout

Path
What it is

library/

The Rust library crate itself (derec-library). library/src/lib.rs re-exports the public surface.

library/src/primitives/

Stateless produce / extract / process helpers per flow — pairing, sharing, verification, discovery, recovery, unpairing, update_channel_info. Used directly when you want a stateless integration.

library/src/protocol/

The stateful DeRecProtocol orchestrator plus DeRecProtocolBuilder, the four store traits, the DeRecTransport trait, and the DeRecEvent / DeRecFlow / PendingAction types.

library/src/ffi/

The C ABI surface used by the .NET binding. Internal — not exposed via the crate's Rust API.

library/src/wasm/

The wasm-bindgen surface used by the TypeScript bindings (Node.js and Web). Also internal.

protobufs/

The protobuf schemas. Single source of truth for the wire format — every binding generates its types from here.

cryptography/

The cryptographic primitives the library composes — pairing handshake (ML-KEM-768 + ECIES), channel encryption (AES-256-GCM), VSS, fingerprinting, etc.

bindings/rust/

A complete in-process Rust example that pairs an Owner with Helpers and a Replica, protects a Secret (fanning out shares to Helpers and the full Secret to the Replica), verifies, recovers, and unpairs — all driven through the orchestrator. The best starting point for understanding DeRecProtocol and how the replica feature fits into a full integration.

bindings/sqlite/, bindings/postgres/

Reference persistence implementations of the four store traits. Good templates for building your own.

bindings/nodejs/, bindings/web/, bindings/dotnet/

Smoke-test consumers of the respective language SDKs. They exercise the same flows as bindings/rust/ through the WASM / FFI bridges.

packages/dotnet/, packages/nodejs/, packages/web/

Packaging configuration for the three published SDKs (NuGet, npm). Not source code — build manifests, README files, and bundler config.

Start with bindings/rust/. It is the recommended entry point for understanding the orchestrator and the store traits — it shows a complete working integration in a single process: in-memory stores, an in-process transport, and every flow driven end-to-end. The two-actor pattern in bindings/rust/src/protocol.rs is what the Minimal integration example is built from.

Source-of-truth ordering

If two places appear to disagree, this is the priority order:

  1. protobufs/ — wire format.

  2. library/src/ — Rust API and protocol semantics.

  3. bindings/rust/ — runnable confirmation of how the API is meant to be wired.

  4. bindings/{nodejs,web,dotnet}/ — language-specific surface; mirrors Rust by construction.

When in doubt, run the smoke tests (see Dev environment setup) — they cover every flow and fail loudly when the Rust source and the bindings drift.

Last updated