A secure, decentralized messenger built with Flutter and powered by Korium.
- End-to-end Encryption - All messages are encrypted using Ed25519 cryptography
- Decentralized - No central servers, messages travel directly between peers via QUIC
- Self-Sovereign Identity - Your identity is your cryptographic key (with PoW spam protection)
- NAT Traversal - Works behind firewalls and NATs using Korium's SmartSock
- Cross-Platform - Runs on iOS, Android, macOS, Windows, and Linux
- Offline-First - Messages queued locally, synced when peers reconnect
┌─────────────────────────────────────────────────────────┐
│ Flutter UI │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │
│ │ Chats │ │ Chat │ │ Contacts │ │
│ │ List │ │ Screen │ │ Screen │ │
│ └──────┬──────┘ └──────┬──────┘ └────────┬────────┘ │
│ └────────────────┼──────────────────┘ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐│
│ │ Riverpod State Management ││
│ │ (KoriumNodeProvider, MessageProvider, etc.) ││
│ └──────────────────────┬──────────────────────────────┘│
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐│
│ │ Platform Channel (chat.six7/korium) ││
│ └──────────────────────┬──────────────────────────────┘│
└─────────────────────────┼───────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────┐
│ Native Bridge Layer │
│ ┌────────────────────┐ ┌────────────────────────┐ │
│ │ KoriumBridge.kt │ │ KoriumBridge.swift │ │
│ │ (Android) │ │ (iOS) │ │
│ └─────────┬──────────┘ └──────────┬─────────────┘ │
│ └──────────────┬───────────┘ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐│
│ │ Korium UniFFI Bindings (korium.kt/.swift) ││
│ └──────────────────────┬──────────────────────────────┘│
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐│
│ │ Korium Native Library ││
│ │ - QUIC-based P2P networking ││
│ │ - DHT for peer discovery ││
│ │ - GossipSub for group messaging ││
│ │ - Ed25519 identities & mTLS ││
│ │ - NAT traversal (SmartSock) ││
│ └─────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────┘
- Flutter SDK >= 3.27.0
- Xcode (for iOS/macOS builds)
- Android Studio with NDK (for Android builds)
- Rust >= 1.83.0 (to build Korium from source)
Follow the Flutter installation guide for your platform.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add aarch64-linux-android # For Android arm64
git clone https://github.com/six7chat/six7.git
cd six7
flutter pub get
dart run build_runner build --delete-conflicting-outputs
flutter run
The android.sh script handles everything:
- Builds Korium from source with cross-compilation
- Copies UniFFI bindings and native library
- Generates app icons from SVG
- Builds Flutter APKs
# Set Korium source location (default: ~/git/magikrun/korium)
export KORIUM_DIR=/path/to/korium
# Build
./android.sh
Output APKs will be in release/:
six7-v{version}-arm64-v8a.apk(most devices)six7-v{version}-armeabi-v7a.apk(older devices)six7-v{version}-x86_64.apk(emulators)six7-v{version}.apk(universal, larger)
# 1. Build Korium for Android (in korium repo)
cd /path/to/korium
cargo build --release --target aarch64-linux-android
# 2. Copy native library
cp target/aarch64-linux-android/release/libkorium.so \
/path/to/six7/android/app/src/main/jniLibs/arm64-v8a/
# 3. Copy UniFFI bindings
cp bindings/kotlin/uniffi/korium/korium.kt \
/path/to/six7/android/app/src/main/kotlin/uniffi/korium/
# 4. Build APK
cd /path/to/six7
flutter build apk --release --split-per-abi
flutter build ios --release
six7/
├── lib/
│ ├── main.dart # App entry point
│ └── src/
│ ├── app.dart # MaterialApp configuration
│ ├── core/
│ │ ├── constants/ # App-wide constants
│ │ ├── notifications/ # Local notifications
│ │ ├── router/ # GoRouter configuration
│ │ ├── storage/ # Hive persistence
│ │ └── theme/ # App theming
│ ├── features/
│ │ ├── auth/ # Onboarding screens
│ │ ├── chat/ # Chat conversation UI
│ │ ├── contacts/ # Contact management
│ │ ├── groups/ # Group chat support
│ │ ├── home/ # Chat list & tabs
│ │ ├── messaging/ # Korium integration
│ │ ├── profile/ # User profile
│ │ ├── qr/ # QR code display/scanning
│ │ ├── search/ # Message search
│ │ └── settings/ # App settings
│ └── korium/
│ └── korium_bridge.dart # Platform channel interface
├── android/
│ └── app/src/main/
│ ├── kotlin/
│ │ ├── chat/six7/app/
│ │ │ ├── KoriumBridge.kt # Android native bridge
│ │ │ └── KoriumForegroundService.kt
│ │ └── uniffi/korium/
│ │ └── korium.kt # UniFFI bindings
│ └── jniLibs/
│ └── arm64-v8a/
│ └── libkorium.so # Native library
├── ios/Runner/
│ ├── KoriumBridge.swift # iOS native bridge
│ ├── korium.swift # UniFFI bindings
│ └── koriumFFI.h # FFI header
├── android.sh # Android build script
├── pubspec.yaml # Flutter dependencies
└── AGENTS.md # Security guidelines
Six7 uses Korium for all P2P communication:
- Each user has a unique Ed25519 keypair with Proof-of-Work
- The public key (64 hex chars) serves as the user's identity
- PoW prevents Sybil attacks and spam
- No phone numbers or emails required
- Direct Messages: Request-response via
send()with automatic ACK - Group Messages: GossipSub pub/sub for group chats
- All connections use mutual TLS with Ed25519 certificates
- Peers bootstrap via
bootstrapPublic()(DNS-based seed nodes) - DHT stores peer contact information
- QR codes contain identity + routable addresses for direct connection
- SmartSock handles UDP hole punching
- Relay fallback for symmetric NAT
- Works on mobile networks and behind firewalls
┌─────────┐ ┌─────────┐
│ Alice │ │ Bob │
└────┬────┘ └────┬────┘
│ │
│ 1. Alice adds Bob (QR scan or identity) │
│ ─────────────────────────────────────────────────> │
│ │
│ 2. Alice sends contactRequest │
│ ─────────────────────────────────────────────────> │
│ [Korium send()] │
│ │
│ 3. Bob auto-accepts, adds Alice │
│ 4. Bob sends contactAccepted │
│ <───────────────────────────────────────────────── │
│ [Korium send()] │
│ │
│ 5. Normal chat messages │
│ <────────────────────────────────────────────────> │
│ [Korium send() with ACK] │
│ │
Per the AGENTS.md guidelines:
- Input Validation: All network inputs validated for size and format
- Bounded Collections: Event buffers and caches have explicit limits
- Timeouts: All network operations have configurable timeouts
- Resource Bounds: Message sizes capped (64KB max)
- Error Handling: Explicit Result types, no silent failures
- Identity Verification: Sender identity verified against Korium-authenticated source
flutter test
After modifying @freezed classes or JSON models:
dart run build_runner build --delete-conflicting-outputs
flutter analyze
Android emulators use NAT (10.0.2.x network) which prevents incoming UDP connections. Options:
- Test on a real device
- Use two emulators on the same host (they can communicate locally)
- Use port forwarding:
adb forward tcp:PORT tcp:PORT
Rebuild native libraries after Rust code changes:
./android.sh # For Android
Ensure Android NDK is installed and ANDROID_NDK_HOME is set:
export ANDROID_NDK_HOME="$HOME/Library/Android/sdk/ndk/VERSION"
- Korium - Next-gen P2P networking fabric
- Flutter - Cross-platform UI framework
- Riverpod - State management
- UniFFI - Rust FFI bindings
MIT License - see LICENSE for details.