docs.rs failed to build bitchat-qudag-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
BitChat-QuDAG Integration
A quantum-resistant, privacy-focused messaging layer for QuDAG that implements and extends the BitChat protocol with advanced cryptographic features and multi-transport capabilities.
๐ Overview
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.
โจ Key Features
Core BitChat Protocol Compliance
- Bluetooth Mesh Networking: Full support for BLE mesh with automatic message hopping
- Store & Forward: 12-hour message cache with configurable retention
- Privacy by Design: No phone numbers, emails, or account registration required
- Ephemeral Messages: Self-destructing messages with configurable TTL
- Cover Traffic: Adaptive dummy message generation to prevent traffic analysis
Enhanced Security Features
- Quantum-Resistant Cryptography:
- ML-KEM-768 for key exchange (NIST-approved)
- ML-DSA-65 for digital signatures
- Hybrid mode combining quantum-resistant and traditional crypto
- Forward Secrecy: Automatic key rotation and ephemeral key exchanges
- Multi-Layer Encryption: Support for both traditional (AES-256-GCM) and quantum-resistant algorithms
Advanced Capabilities
- Multi-Transport Architecture:
- Internet P2P (via libp2p integration)
- Bluetooth Low Energy mesh
- WebSocket (for WASM environments)
- Local network discovery
- Relay/bridge support
- WASM Support: Full browser compatibility with TypeScript bindings
- Compression: Automatic message compression with LZ4/Zstd
- Adaptive Routing: Intelligent path selection across transports
๐ฆ Installation
Rust (Native)
[]
= "0.1.0"
JavaScript/TypeScript (WASM)
# or
๐ง Usage
Basic Messaging (Rust)
use ;
async
Bluetooth Mesh Setup
use ;
let config = BitChatConfig ;
WASM Usage (JavaScript/TypeScript)
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);
}
Privacy Features
// Enable all privacy features
let config = BitChatConfig ;
// Send ephemeral message
messaging.send_ephemeral.await?;
๐ก๏ธ Security Comparison
| 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 | โ | โ |
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 โ โ
โ โโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Configuration Profiles
Development
let config = development;
// Optimized for testing with relaxed security
Production
let config = production;
// Balanced security and performance
High Privacy
let config = high_privacy;
// Maximum privacy: ephemeral messages, cover traffic, rotating IDs
WASM
let config = wasm;
// Browser-optimized with WebSocket transport
๐ Performance
- Message Latency: <50ms (local), <200ms (mesh hop)
- Throughput: 10,000+ msg/sec (native), 5,000+ msg/sec (WASM)
- Memory Usage: ~10MB base + 1KB per peer
- Compression Ratio: 40-60% for text messages
- Crypto Overhead: ~5% for hybrid mode
๐งช Testing
# Run all tests
# Run with all features
# Run WASM tests
๐ค Contributing
Contributions are welcome! Please read our Contributing Guidelines before submitting PRs.
๐ License
This project is dual-licensed under:
- MIT License
- Apache License 2.0
You may choose either license for your use.
๐ Links
๐ Acknowledgments
- BitChat team for the original protocol design
- QuDAG community for quantum-resistant implementations
- NIST for ML-KEM and ML-DSA standardization