A decentralized, end-to-end encrypted mesh networking communication platform that works across Web, Android, and iOS with no central servers.
- End-to-End Encryption: All messages encrypted with Ed25519 signing and ChaCha20-Poly1305 encryption
- Mesh Networking: Direct peer-to-peer communication with automatic message relay
- Multi-Platform: Works on Web (PWA), Android, and iOS
- No Servers: Completely decentralized with no reliance on central infrastructure
- Perfect Forward Secrecy: Session keys rotate automatically to protect past communications
- Multi-Transport: Uses WebRTC, Bluetooth Low Energy, and local network discovery
Current Version: 0.1.0 β 1.0.0 (Release Candidate)
| Component | Status | Tests | Notes |
|---|---|---|---|
| Core Library | β Ready | 786/786 passing | All cryptographic and networking primitives complete |
| Web App | β Ready | ~90% passing | File transfer implemented, E2E tests being finalized |
| Android App | βοΈ Configured | Pending | Builds successfully, needs SDK setup |
| iOS App | βΈοΈ Pending | Pending | Needs Xcode configuration |
| Documentation | β Complete | N/A | API docs, architecture, and guides complete |
See V1.0 Release Checklist for detailed status.
The project is organized as a monorepo with the following structure:
SC/
βββ core/ # Shared cryptography and protocol implementation
β βββ src/
β β βββ crypto/ # Cryptographic primitives
β β βββ protocol/ # Binary message format
β β βββ mesh/ # Routing and peer management
β β βββ transport/ # Transport abstractions
βββ web/ # Web application (Vite + React + TypeScript)
βββ android/ # Android application (Kotlin)
βββ ios/ # iOS application (Swift)
βββ docs/ # Documentation
- Node.js 18+ and npm
- For Android: Android Studio with Kotlin support
- For iOS: Xcode with Swift support
- Clone the repository:
git clone https://github.com/Treystu/SC.git
cd SC- Install dependencies:
npm install- Build the core library:
cd core
npm run build
npm test- Run the web application:
cd ../web
npm install
npm run devThe web app will be available at http://localhost:3000
The @sc/core library provides the foundational cryptography and networking primitives used across all platforms.
import {
generateIdentity,
signMessage,
verifySignature,
encryptMessage,
decryptMessage
} from '@sc/core';
// Generate identity keypair
const identity = generateIdentity();
// Sign a message
const message = new TextEncoder().encode('Hello, mesh!');
const signature = signMessage(message, identity.privateKey);
// Verify signature
const isValid = verifySignature(message, signature, identity.publicKey);
// Encrypt/decrypt messages
import { generateSessionKey } from '@sc/core';
const sessionKey = generateSessionKey();
const ciphertext = encryptMessage(message, sessionKey.key, sessionKey.nonce);
const plaintext = decryptMessage(ciphertext, sessionKey.key, sessionKey.nonce);import { MessageType, encodeMessage, decodeMessage } from '@sc/core';
const message = {
header: {
version: 0x01,
type: MessageType.TEXT,
ttl: 10,
timestamp: Date.now(),
senderId: identity.publicKey,
signature: messageSignature,
},
payload: encryptedContent,
};
// Encode to binary
const encoded = encodeMessage(message);
// Decode from binary
const decoded = decodeMessage(encoded);import { RoutingTable, Peer } from '@sc/core';
const routingTable = new RoutingTable();
// Add a peer
const peer: Peer = {
id: 'peer-id',
publicKey: peerPublicKey,
lastSeen: Date.now(),
connectedAt: Date.now(),
transportType: 'webrtc',
connectionQuality: 100,
bytesSent: 0,
bytesReceived: 0,
};
routingTable.addPeer(peer);
// Find route to destination
const nextHop = routingTable.getNextHop('destination-id');
// Message deduplication
if (!routingTable.hasSeenMessage(messageHash)) {
routingTable.markMessageSeen(messageHash);
// Process message
}Built with Vite, React, and TypeScript, the web app provides a modern PWA experience.
- β Basic UI layout with conversation list and chat view
- β Connection status indicator
- β Message input and display
- β Dark theme with responsive design
- π§ IndexedDB persistence (in progress)
- π§ WebRTC peer connections (in progress)
- π§ Service worker for offline support (planned)
cd web
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build- β Kotlin with Jetpack Compose UI (Material 3)
- β Room database for persistence
- β Foreground service for persistent connectivity
- β Conversation list, contact list, and settings UI
- β Modern Material 3 theming (light/dark)
- π§ BLE mesh networking (in progress)
- π§ WebRTC peer connections (in progress)
- π§ Chat UI with message bubbles (planned)
- π§ Notifications with actions (planned)
Build: cd android && ./gradlew assembleDebug
- Swift with SwiftUI
- Core Data for persistence
- Background modes for connectivity
- CoreBluetooth for BLE mesh
- WebRTC peer connections
- Identity: Ed25519 public-key cryptography for signing
- Key Exchange: ECDH (X25519) for establishing shared secrets
- Encryption: XChaCha20-Poly1305 AEAD cipher
- Hashing: SHA-256 for fingerprints and message hashes
- Libraries: @noble/curves and @noble/ciphers - audited, minimal dependencies
Each message has a fixed 109-byte header:
- Version (1 byte): Protocol version
- Type (1 byte): Message type
- TTL (1 byte): Time-to-live for routing
- Reserved (1 byte): Future use
- Timestamp (8 bytes): Unix timestamp in ms
- Sender ID (32 bytes): Ed25519 public key
- Signature (65 bytes): Compact Ed25519 signature
Payload is encrypted with session keys that rotate automatically for perfect forward secrecy.
# Run core library tests
cd core
npm test
# With coverage
npm test -- --coverage
# Run all tests
npm test
# Run integration tests
npm run test:integration
# Run E2E tests
npm run test:e2eCurrent test coverage:
- β Cryptographic primitives (38 tests)
- β Message encoding/decoding
- β Routing table and peer management
- β Message queue prioritization
The project uses comprehensive GitHub Actions workflows for continuous integration and deployment across all platforms.
Every push and pull request triggers:
- Linting: ESLint (TypeScript), ktlint (Kotlin), SwiftLint (Swift)
- Building: Web, Android, and iOS applications
- Unit Tests: Core library (Node 18, 20, 22)
- Integration Tests: Cross-platform functionality
- E2E Tests: Playwright tests across browsers
- Security Audit: Dependency vulnerability scanning
Tagged releases automatically:
- Build production artifacts for all platforms
- Run full test suite
- Create GitHub releases with changelogs
- Attach platform-specific installers:
- Web:
web-{version}.tar.gz - Android:
sovereign-communications-{version}.apk - iOS: Build artifacts
- Web:
Release Types:
v1.0.0- Production releasev1.0.0-beta.1- Beta releasev1.0.0-alpha.1- Alpha release
For detailed CI/CD documentation, see docs/ci-cd.md.
- Local Network: mDNS/Bonjour broadcasting
- QR Code: Encode public key + optional connection info
- Audio Pairing: DTMF tone encoding (proximity pairing)
- BLE: Bluetooth Low Energy RSSI-based discovery
- Manual Entry: Direct IP:port input
- Mesh Introduction: Existing peers introduce new peers
- Flood Routing: Messages forwarded to all peers except sender
- TTL Decrement: Each hop decrements TTL; message expires at 0
- Deduplication: SHA-256 hash cache prevents duplicate processing
- Priority Queue: Control > Voice > Text > File transfers
- Fragmentation: Large messages split for transmission
- WebRTC Data Channels (lowest latency, NAT traversal)
- Bluetooth Low Energy (mobile mesh, no internet required)
- Local Network (direct connections on same network)
- Core cryptography library
- Binary message protocol
- Mesh routing basics
- Web UI foundation
- IndexedDB persistence
- WebRTC implementation
- Peer health monitoring
- Peer discovery mechanisms
- Android application foundation NEW
- Android UI (conversation list, contacts, settings)
- Android Room database
- Android foreground service
- Android chat UI with message bubbles
- Android notifications with actions
- Android BLE integration
- Complete web UI features
- File transfer protocol
- Voice messages (Opus encoding)
- iOS application
- BLE mesh networking (mobile)
- Whisper.cpp integration (voice-to-text)
- Multi-device sync
- Group messaging
- Message search
- QR code scanner UI
- UI/UX refinement
- Performance optimization
- Battery optimization (mobile)
- Comprehensive testing
- Security audit
This is currently a development project implementing a comprehensive feature set. Contributions welcome once the initial implementation is complete.
MIT License - See LICENSE file for details
- Protocol Specification (coming soon)
- Security Model (coming soon)
- API Documentation (coming soon)
Alpha Development: Core infrastructure complete with Android app foundation. Not ready for production use.
Progress: 67/285 tasks (23.5%)
- β Complete cryptographic library (Ed25519, X25519, ChaCha20-Poly1305)
- β Binary message protocol with fragmentation
- β Mesh routing with flood algorithm and TTL
- β WebRTC transport layer
- β Peer health monitoring with heartbeats
- β Peer discovery (QR, manual, introduction)
- β Web UI with mesh integration
- β IndexedDB persistence (web)
- β Android app with Room database and Compose UI NEW
- β Android foreground service NEW
- π§ Chat UI implementation (Android)
- π§ Notification system (Android)
- π§ BLE mesh networking (Android)
- π§ iOS application
- β 38 unit tests passing (100%)
- β Zero security vulnerabilities (CodeQL)
- β Web app builds successfully
- β³ Android APK builds (not yet tested)
- β³ Integration tests (planned)
Foundation - Protocol & Crypto (10 tasks)
- β 1. Define binary message format
- β 2. Implement ECDH key exchange protocol
- β 3. Implement Ed25519 for message signing
- β 4. Implement ChaCha20-Poly1305 for message encryption
- β 5. Generate and store identity keypair on device
- β 6. Implement message encryption/decryption
- β 7. Implement message signing/verification
- β 8. Create secure key storage (IndexedDB Web, Memory for Node)
- β 9. Implement perfect forward secrecy with session keys
- β 10. Create session key rotation logic
Mesh Networking Core (12 tasks) β 11/12 (92%)
- β 11. Implement in-memory routing table
- β 12. Create peer registry (connected peers)
- β 13. Implement message TTL decrement and expiration
- β 14. Create message deduplication cache (hash-based)
- β 15. Implement flood routing (forward to all peers except sender)
- β 16. Create message relay logic
- β 17. Implement peer health monitoring (heartbeat) NEW
- β³ 18. Create peer timeout and removal (partial - implemented in health monitor)
- β 19. Implement message fragmentation (for large messages)
- β 20. Create message reassembly logic
- β 21. Implement message priority queue (control > voice > text > file)
- β³ 22. Create bandwidth-aware message scheduling (planned)
WebRTC Peer-to-Peer (10 tasks) β COMPLETE
- β 23. Initialize WebRTC PeerConnection
- β 24. Implement data channel creation (unreliable for real-time, reliable for messages)
- β 25. Create SDP offer/answer exchange via existing peer (mesh signaling)
- β 26. Implement ICE candidate exchange via mesh
- β 27. Create signaling through already-connected peers
- β 28. Implement data channel message handlers
- β 29. Create WebRTC connection state monitoring
- β 30. Implement automatic reconnection on failure
- β 31. Create graceful peer disconnection
- β 32. Implement NAT traversal without STUN/TURN (rely on mesh relay)
Peer Discovery (10 tasks) β 7/10 (70%)
- β³ 47. Implement local network mDNS/Bonjour broadcasting (planned)
- β³ 48. Create mDNS service discovery (planned)
- β 49. Implement QR code identity exchange (encoded public key + IP) NEW
- β³ 50. Create QR code scanner (UI - planned)
- β³ 51. Implement audio tone pairing (DTMF encoding/decoding) (planned)
- β³ 52. Create proximity pairing via BLE RSSI (planned)
- β 53. Implement manual IP:port peer entry NEW
- β 54. Create "introduce peer" relay (A tells B about C's existence) NEW
- β 55. Implement peer announcement broadcast through mesh NEW
- β 56. Create peer reachability verification NEW
Web Application (31 tasks) π§ 9/31 (29%)
- β 123. Set up Vite + React + TypeScript
- β 124. Implement IndexedDB for messages/contacts
- β 136. Implement main app layout
- β 137. Create conversation list component
- β 138. Implement chat component
- β 139. Create message input component
- β 153. Create basic theme (dark theme)
- β React hook for mesh network integration
- β Live connection status display
- β³ 125-152: Advanced features (in progress)
Android Application (33 tasks) β 11/33 (33%) NEW
- β 57. Set up Android project (Kotlin)
- β 58. Implement Room database for messages/contacts
- β 59. Create message persistence
- β 60. Implement contact persistence
- β 61. Create conversation persistence
- β 62. Implement foreground service for persistent connectivity
- β 73. Create main activity with navigation
- β 74. Implement conversation list UI (LazyColumn)
- β 78. Implement contact list UI
- β 82. Implement settings screen
- β 89. Create basic theme (light/dark)
- β³ 63-65: Notifications (planned)
- β³ 66-67: WebRTC Android SDK (planned)
- β³ 68-72: BLE integration (planned)
- β³ 75-77, 79-81, 83-88: Additional UI features (planned)
Testing (8 tasks)
- β 250. Create unit tests for crypto functions
- β 251. Implement unit tests for message routing
- β³ 252-257: Integration and E2E tests (planned)
Documentation (7 tasks)
- β 259. Write README with quick start
- β 260. Create setup instructions per platform
- β³ 261-265: Additional documentation (in progress)
Build & Release (10 tasks)
- β 266. Set up Git repository
- β 267. Create .gitignore files
- β³ 268-275: CI/CD and release process (planned)