| Crates.io | bitchat-qudag |
| lib.rs | bitchat-qudag |
| version | 0.1.0 |
| created_at | 2025-07-16 00:54:19.291875+00 |
| updated_at | 2025-07-16 00:54:19.291875+00 |
| description | BitChat messaging integration for QuDAG with WASM support |
| homepage | https://github.com/ruvnet/QuDAG/tree/main/bitchat-qudag-crate |
| repository | https://github.com/ruvnet/QuDAG |
| max_upload_size | |
| id | 1754497 |
| size | 734,697 |
A quantum-resistant, privacy-focused messaging layer for QuDAG that implements and extends the BitChat protocol with advanced cryptographic features and multi-transport capabilities.
BitChat-QuDAG bridges decentralized P2P messaging with quantum-resistant security, providing a future-proof communication layer that works across multiple transport protocols including Bluetooth mesh, Internet P2P, WebSocket, and local networks. This implementation not only fulfills the BitChat whitepaper specifications but extends them with quantum-resistant cryptography and WebAssembly support.
[dependencies]
bitchat-qudag = "0.1.0"
npm install bitchat-qudag
# or
yarn add bitchat-qudag
use bitchat_qudag::{BitChatMessaging, BitChatConfig, QuDAGMessaging};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create configuration
let config = BitChatConfig::default();
// Initialize messaging system
let mut messaging = BitChatMessaging::new(config).await?;
messaging.start().await?;
// Send a message
messaging.send_message("peer-id-123", b"Hello, BitChat!").await?;
// Receive messages
while let Some(message) = messaging.receive_message().await? {
println!("Received: {} bytes from {}",
message.data.len(),
message.sender
);
}
Ok(())
}
use bitchat_qudag::{BitChatConfig, TransportType, CryptoMode};
let config = BitChatConfig {
enabled: true,
transports: vec![TransportType::BluetoothMesh],
crypto_mode: CryptoMode::Hybrid, // Quantum-resistant + traditional
ephemeral_messages: true,
store_forward: true,
cover_traffic: true,
..Default::default()
};
import { BitChatWasm } from 'bitchat-qudag';
async function initializeMessaging() {
const config = {
enabled: true,
crypto_mode: "Hybrid",
ephemeral_messages: true,
compression: true
};
const bitchat = new BitChatWasm(JSON.stringify(config));
await bitchat.init();
// Set message handler
bitchat.set_message_handler((message) => {
console.log('Received:', message);
});
// Send a message
const message = new TextEncoder().encode('Hello from WASM!');
await bitchat.send_message('peer-id', message);
}
// Enable all privacy features
let config = BitChatConfig {
ephemeral_messages: true, // Self-destructing messages
cover_traffic: true, // Generate dummy traffic
cover_traffic_interval: Duration::from_secs(30),
rotating_peer_ids: true, // Change IDs every 5-15 minutes
..BitChatConfig::high_privacy() // Pre-configured privacy profile
};
// Send ephemeral message
messaging.send_ephemeral("peer-id", b"This will self-destruct",
Duration::from_mins(5)).await?;
| Feature | BitChat Original | BitChat-QuDAG |
|---|---|---|
| Encryption | Noise Protocol (X25519) | Hybrid: ML-KEM-768 + X25519 |
| Digital Signatures | Ed25519 | ML-DSA-65 + Ed25519 |
| Forward Secrecy | โ | โ Enhanced |
| Quantum Resistance | Future Goal | โ Implemented |
| Multi-Transport | Bluetooth Only | BLE + Internet + WebSocket |
| WASM Support | โ | โ |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BitChat-QuDAG API โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Messaging Layer โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Ephemeral โ โ Store & โ โ Cover Traffic โ โ
โ โ Messages โ โ Forward โ โ Generator โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Crypto Layer (Hybrid) โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ ML-KEM-768 โ โ ML-DSA-65 โ โ Traditional โ โ
โ โ (Quantum) โ โ (Quantum) โ โ (AES/X25519) โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Multi-Transport Layer โ
โ โโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โ Bluetooth โ โ Internet โ โWebSocket โ โ Local โ โ
โ โ Mesh โ โ P2P โ โ (WASM) โ โ Network โ โ
โ โโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
let config = BitChatConfig::development();
// Optimized for testing with relaxed security
let config = BitChatConfig::production();
// Balanced security and performance
let config = BitChatConfig::high_privacy();
// Maximum privacy: ephemeral messages, cover traffic, rotating IDs
let config = BitChatConfig::wasm();
// Browser-optimized with WebSocket transport
# Run all tests
cargo test
# Run with all features
cargo test --all-features
# Run WASM tests
wasm-pack test --headless --chrome
Contributions are welcome! Please read our Contributing Guidelines before submitting PRs.
This project is dual-licensed under:
You may choose either license for your use.