Skip to content

TokTok/rs-toxcore-c

Repository files navigation

rs-toxcore-c

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.

Project Structure

The project is organized into several layers:

Core Tox Bindings

  • toxcore/: High-level, idiomatic Rust wrapper for the Tox API. Targets are defined in the rs-toxcore-c package.
  • toxcore/src/ffi.rs: Raw FFI bindings generated by bindgen.

Merkle-Tox Synchronization Suite

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.

Applications & Bots

  • 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.

Documentation

  • doc/: Detailed design specifications for the Merkle-Tox protocol suite.

Usage

The library can be used by adding it to your deps in Bazel from the monorepo root:

deps = ["//rs-toxcore-c:toxcore"]

Features

  • 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.

Building

Build the core library using Bazel from the monorepo root:

bazel build //rs-toxcore-c:toxcore

Run tests for the entire suite:

bazel test //rs-toxcore-c/...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages