Rust bindings for c-toxcore and a persistent history synchronization system.
This project is a component of the toktok-stack monorepo. It provides raw FFI bindings, a high-level safe Rust API, and a suite of libraries for Merkle-DAG based history synchronization.
The project is organized into several layers:
toxcore/: High-level, idiomatic Rust wrapper for the Tox API. Targets are defined in thers-toxcore-cpackage.toxcore/src/ffi.rs: Raw FFI bindings generated bybindgen.
A set of libraries for persistent, multi-device history synchronization:
tox-proto/: Serialization primitives using MessagePack with positional encoding for compactness.tox-sequenced/: Reliable, congestion-controlled transport layer over lossy Tox custom packets.merkle-tox-core/: Core Merkle-DAG logic, synchronization state machine, and cryptographic verification.merkle-tox-sqlite/: Persistence implementation using SQLite.merkle-tox-fs/: Simple filesystem-based persistence.
apps/groupbot/: A Tox bot for managing group chats.apps/vaultbot/: A service for secure data storage over Tox.toxxi/: A feature-rich terminal Tox client (TUI) with built-in Rhai scripting support.
doc/: Detailed design specifications for the Merkle-Tox protocol suite.
The library can be used by adding it to your deps in Bazel from the monorepo
root:
deps = ["//rs-toxcore-c:toxcore"]- Merkle-DAG History: Immutable, verifiable history sync across devices.
- Reliable Transport: ARQ-based reliability over custom lossy packets.
- Event-driven API: Efficiently handle Tox events.
- Safe Wrappers: Manages memory and resource lifetimes using Rust's ownership model.
- TUI Client: Includes
toxxi, a terminal-based client for daily use and testing.
Build the core library using Bazel from the monorepo root:
bazel build //rs-toxcore-c:toxcoreRun tests for the entire suite:
bazel test //rs-toxcore-c/...