End-to-end encrypted, local-first CRDT collaboration engine and zero-knowledge relay in Rust — powering live household collaboration and offline sync in Homeberry.
homeberry-sync lets peers edit rich block documents offline inside a local yrs (Yjs) CRDT and converge seamlessly over a zero-knowledge relay that never sees plaintext documents, cursors, or encryption keys. It is extracted directly from and used in production inside Homeberry.
SHA-256(capability_secret). Mailbox authorization tokens and ChaCha20-Poly1305 content keys are domain-separated via HKDF-SHA256 so the relay can authenticate writes without ever being able to decrypt a single byte.RootKey and ChannelKeys automatically wipe key material from memory on drop via zeroize.yrs (Yjs v1 binary format) with ordered UUID blocks, character-level concurrent text merging, state-vector diffs, and bounded payload limits.homeberry_sync_relay::router(state) inside any Axum server (as Homeberry Hub does in production), or run homeberry-sync-relay as a single self-hosted binary alongside homeberry-relay.homeberry-sync-core: RootKey, HKDF-SHA256 capability derivation, HBSYNC01 ChaCha20-Poly1305 envelopes, and wire DTOs.homeberry-sync-crdt: Generic block-oriented CRDT document engine built on yrs.homeberry-sync-relay: Embeddable Axum zero-knowledge relay, SQLite mailbox store, PresenceHub, and standalone CLI server.homeberry-sync-client: Async Rust client for encrypted mailbox sync, long-poll wakeups, and live encrypted presence.Run the bundled two-peer encrypted collaboration example (spins up an in-process zero-knowledge relay, pairs two peers with a shared 256-bit RootKey, performs concurrent offline edits, syncs HBSYNC01 envelopes, exchanges encrypted cursor presence, and verifies convergence):
cargo run -p homeberry-sync-client --example two_peer_collab
Or run the standalone self-hosted relay server:
cargo run --release -p homeberry-sync-relay -- --bind 0.0.0.0:8787 --db ./relay.sqlite
For an interactive browser-side introduction to local-first causal clocks and conflict handling, explore the illustrative Local-First Sync & Conflict Simulator in the Interactive Lab.