Prem Chaitanya Prathi c9dfefa498
feat(mix): mixnet sender-anonymity for Logos Chat (static RLN, no LEZ)
Global, restart-based Required/None anonymity mode: route chat messages through the
libp2p mixnet for sender anonymity, on the logos-delivery (efafdfdc2) nwaku stack.
Static RLN spam protection; no on-chain LEZ gifter / dynamic membership.

Delivery (src/chat/delivery/waku_client.nim):
- WakuConfig.mixEnabled/mixNodes/minMixPoolSize; parseMixNodes, waitForMixPool,
  getMixPoolSize, mixReady.
- Required mode: sendBytes -> lightpushPublish(mixify=true) over the mix pool,
  fail-fast below minMixPoolSize (no relay fallback). None mode: relay publish.
  Errors propagate up to chat_send_message.
- Receive via WakuFilter (subscribe to static peers; no relay mounted), refreshed
  by a 60s keep-alive.
- Static RLN: pre-populated rln_tree.db + per-peer keystore; nodekey config to adopt
  a provisioned identity. No per-send root-convergence wait (static membership).

API / build:
- chat_get_mix_status FFI -> {mixEnabled,mixReady,mixPoolSize,minPoolSize}.
- Reproducible nix build: librln consumed as a cdylib (avoids the two-Rust-staticlib
  symbol collision); -d:libp2p_mix_experimental_exit_is_dest.
- vendor/nwaku -> efafdfdc2; vendor/nim-protobuf-serialization -> 38d24eb (0.4.0).
2026-06-25 21:45:41 +05:30
..

rust-bundle

A minimal Rust staticlib crate that bundles libchat and rln into a single archive (liblogoschat_rust_bundle.a), suitable for static linking into the Nim application.

Motivation

libchat and rln are both Rust crates. Linking them as separate static archives (.a files) causes duplicate symbol errors at link time, because each archive would embed its own copy of the Rust standard library.

By declaring both as rlib dependencies of a single staticlib crate, rustc resolves and links everything in one pass. The resulting liblogoschat_rust_bundle.a exposes all #[no_mangle] pub extern "C" symbols from both crates without any stdlib duplication.

This approach follows the guidance in the official Rust Reference: https://doc.rust-lang.org/reference/linkage.html#mixed-rust-and-foreign-codebases.

Build

cargo build --release --manifest-path rust-bundle/Cargo.toml

Output: rust-bundle/target/release/liblogoschat_rust_bundle.a

From the project root, use the build-bundle Makefile target, which handles this after building librln from the nwaku vendor tree.

Dependencies

Crate Path
libchat vendor/libchat/conversations
rln vendor/nwaku/vendor/zerokit/rln