A high-performance, cross-platform cryptographic identity management system with post-quantum security using Dilithium signatures, deterministic key generation, and mesh networking capabilities.
- Post-Quantum Cryptography - Dilithium2 signatures for quantum-resistant security
- Hardware Entropy Collection - Physical sensors (accelerometer, microphone, timing jitter) for true randomness
- Deterministic Key Generation - Reproducible keys from mnemonic phrases
- Cross-Platform Daemon - gRPC service for all platforms including microcontrollers
- Mesh Transport Layer - BLE, WiFi Direct, and LoRa support with automatic failover
- Multi-Target Support - CLI, mobile, embedded, and node implementations
- Human-Readable Mnemonics - Natural language seed phrases for key recovery
metamesh/
βββ common/
β βββ crypto/ # Post-quantum cryptographic primitives
β βββ identity/ # Identity generation and recovery with hardware entropy
β βββ transport/ # Mesh networking (BLE, WiFi Direct, LoRa)
β βββ entropy/ # Hardware entropy collection
β βββ utils/ # Shared utilities
βββ daemon/ # gRPC background service with transport listeners
βββ cli/ # Command-line interface
βββ mobile/ # Mobile library (iOS/Android)
βββ embedded/ # Embedded systems library
βββ node/ # Network node implementation
βββ scripts/ # Installation and deployment scripts
- Rust 1.70+ (Install Rust)
- Protocol Buffers compiler (
protoc)
# macOS
brew install protobuf
# Ubuntu/Debian
sudo apt install protobuf-compiler
# Windows
choco install protocgit clone https://github.com/your-org/metamesh.git
cd metamesh
cargo build --release# Install Android NDK and add targets
rustup target add aarch64-linux-android armv7-linux-androideabi
# Build for Android
cargo build --release --target aarch64-linux-android
# Run daemon (requires root or ADB)
adb push target/aarch64-linux-android/release/metamesh-daemon /data/local/tmp/
adb shell "/data/local/tmp/metamesh-daemon --port 50051 &"
# Run client
adb shell "/data/local/tmp/metamesh-client health"# Add iOS targets
rustup target add aarch64-apple-ios x86_64-apple-ios
# Build for iOS (library only - no daemon)
cargo build --release --target aarch64-apple-ios -p metamesh-mobile
# Integration via Xcode project with FFI bindings
# See mobile/ directory for Swift integration examples# Install dependencies
sudo apt update
sudo apt install build-essential protobuf-compiler libbluetooth-dev
# Build and run
cargo build --release
./target/release/metamesh-daemon --port 50051 &
./target/release/metamesh-client health
# Install as systemd service
sudo ./scripts/install-daemon.sh
sudo systemctl start metamesh-daemon# Install dependencies
brew install protobuf
# Build and run
cargo build --release
./target/release/metamesh-daemon --port 50051 &
./target/release/metamesh-client health
# Install as LaunchAgent
./scripts/install-daemon-macos.sh
launchctl list | grep metamesh# Install dependencies (PowerShell as Administrator)
choco install protoc rust-ms
# Build and run
cargo build --release
Start-Process "target\release\metamesh-daemon.exe" -ArgumentList "--port 50051"
.\target\release\metamesh-client.exe health
# Install as Windows Service
PowerShell -ExecutionPolicy Bypass -File scripts\install-daemon-windows.ps1
Get-Service -Name MetaMeshDaemon# Install Rust and dependencies
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo apt install build-essential protobuf-compiler libbluetooth-dev
# Build (may take 30+ minutes)
cargo build --release
# Run with BLE permissions
sudo ./target/release/metamesh-daemon --port 50051 &
./target/release/metamesh-client health
# Auto-start on boot
sudo systemctl enable metamesh-daemon# Install ESP toolchain
rustup target add xtensa-esp32-espidf
# Build embedded version (no_std)
cargo build --release --target xtensa-esp32-espidf -p metamesh-embedded
# Flash to ESP32 (requires esptool)
esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash 0x1000 target/xtensa-esp32-espidf/release/metamesh-embedded
# Monitor serial output
screen /dev/ttyUSB0 115200# Install ESP-IDF and Rust ESP toolchain
rustup target add xtensa-esp32-espidf
# Configure for ESP32
export ESP_IDF_PATH=/path/to/esp-idf
export PATH="$PATH:$ESP_IDF_PATH/tools"
# Build and flash
cargo build --release --target xtensa-esp32-espidf -p metamesh-embedded
cargo espflash --target xtensa-esp32-espidf --port /dev/ttyUSB0
# Connect via serial for configuration
minicom -D /dev/ttyUSB0 -b 115200# Add ARM targets
rustup target add thumbv7em-none-eabihf thumbv6m-none-eabi
# Build for ARM Cortex-M4
cargo build --release --target thumbv7em-none-eabihf -p metamesh-embedded
# Flash using OpenOCD or similar
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c "program target/thumbv7em-none-eabihf/release/metamesh-embedded verify reset exit"MetaMesh automatically detects and uses available transport mediums:
- BLE (Bluetooth Low Energy) - Cross-platform mesh networking
- WiFi Direct - High-bandwidth peer-to-peer (planned)
- LoRa - Long-range, low-power communication (planned)
The daemon monitors transport availability and automatically switches between mediums:
π MetaMesh Daemon Starting...
π΅ Checking BLE availability...
β
BLE: Listening on UUID 6ba7b810-9dad-11d1-80b4-00c04fd430c8
π‘ BLE: Starting advertising...
π BLE: Starting scanning for MetaMesh devices...
β
1 transport medium available (BLE)
π gRPC daemon listening on 0.0.0.0:50051
β¨ MetaMesh daemon ready!
# Health check
./target/release/metamesh-client health
# Generate new identity
./target/release/metamesh-client create-address
# Recover from mnemonic
./target/release/metamesh-client recover-keys "The person named Alice lives in Boston, Mr Smith works at TechCorp, Bob walks down Main street"
# List all APIs
./target/release/metamesh-client list-apis
# Shutdown daemon
./target/release/metamesh-client shutdownThe daemon exposes the following gRPC services on port 50051:
rpc Health(HealthRequest) returns (HealthResponse);rpc CreateAddress(CreateAddressRequest) returns (CreateAddressResponse);Returns: seed_id, public_key, mnemonic
rpc RecoverKeys(RecoverKeysRequest) returns (RecoverKeysResponse);Input: mnemonic
Returns: seed_id, public_key, private_key
rpc ListAddresses(ListAddressesRequest) returns (ListAddressesResponse);
rpc DeleteAddress(DeleteAddressRequest) returns (DeleteAddressResponse);
rpc DeleteAllAddresses(DeleteAllAddressesRequest) returns (DeleteAllAddressesResponse);rpc PingCheck(PingCheckRequest) returns (PingCheckResponse);
rpc Deserialize(DeserializeRequest) returns (DeserializeResponse);
rpc PendingPackets(PendingPacketsRequest) returns (PendingPacketsResponse);rpc Shutdown(ShutdownRequest) returns (ShutdownResponse);chmod +x scripts/install-daemon.sh
sudo ./scripts/install-daemon.sh
# Control service
sudo systemctl start metamesh-daemon
sudo systemctl status metamesh-daemon
sudo systemctl stop metamesh-daemonchmod +x scripts/install-daemon-macos.sh
./scripts/install-daemon-macos.sh
# Control service
launchctl list | grep metamesh
launchctl unload ~/Library/LaunchAgents/com.metamesh.daemon.plist# Run as Administrator
PowerShell -ExecutionPolicy Bypass -File scripts/install-daemon-windows.ps1
# Control service
Get-Service -Name MetaMeshDaemon
Stop-Service -Name MetaMeshDaemon
Start-Service -Name MetaMeshDaemoncommon/crypto- Core cryptographic operations using Dilithium2common/identity- Identity generation with hardware entropy and human-readable mnemonicscommon/transport- Mesh networking transport layer (BLE, WiFi Direct, LoRa)common/entropy- Hardware entropy collection from physical sensorscommon/utils- Base64 encoding, hashing, and utilitiesdaemon- gRPC server with Protocol Buffers and transport listenerscli- Command-line interface for testingmobile- FFI bindings for mobile platformsembedded- Lightweight library for microcontrollersnode- Network node for distributed operations
# All components
cargo build --release
# Specific component
cargo build --release -p metamesh-daemon
cargo build --release -p metamesh-cli
# Mobile library
cargo build --release --target aarch64-apple-ios
cargo build --release --target armv7-linux-androideabi
# Embedded (no_std)
cargo build --release --target thumbv7em-none-eabihf# Run all tests
cargo test
# Test specific component
cargo test -p metamesh-crypto
cargo test -p metamesh-identity
# Integration tests
cargo test --test integration
# Test coverage with tarpaulin
cargo tarpaulin -p metamesh-daemon --out Html --output-dir coverage# Regenerate protobuf code
cd daemon
cargo build
# View generated code
ls target/debug/build/metamesh-daemon-*/out/- Post-Quantum Resistant - Uses NIST-standardized Dilithium2 signatures
- Hardware Entropy - True randomness from physical sensors (accelerometer, microphone, timing jitter)
- Deterministic Generation - Keys derived from BLAKE3 hash chains
- No Key Storage - Keys regenerated from mnemonic phrases
- Memory Safety - Written in Rust with zero-copy operations
- Binary Protocol - gRPC with Protocol Buffers (50% faster than JSON)
- Zero Allocations - Optimized for embedded systems
- Concurrent Operations - Async/await with Tokio runtime
- Cross-Platform - Single binary for all platforms
- Hardware Entropy - Platform-specific sensor integration
| Platform | BLE | WiFi Direct | LoRa | Hardware Entropy |
|---|---|---|---|---|
| Android | β | π | π | β (Accel, Mic, Light) |
| iOS | β | β | π | β (Accel, Mic, Light) |
| macOS | β | β | π | β (Timing, CPU temp) |
| Linux | β | β | β | β (Timing, CPU temp) |
| Windows | β | β | π | β (Timing, CPU temp) |
| Pi | β | β | β | β (Timing, CPU temp) |
| ESP32 | π | β | β | β (ADC, Timing, Temp) |
| Arduino | π | β | β | β (ADC, Timing, Temp) |
β Implemented | π Planned | β Not Supported
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
# Install development dependencies
rustup component add rustfmt clippy
# Format code
cargo fmt
# Lint code
cargo clippy
# Check all targets
cargo check --all-targetsThis project is licensed under the MIT License - see the LICENSE file for details.
- NIST Post-Quantum Cryptography for Dilithium standardization
- pqcrypto for Rust post-quantum implementations
- BLAKE3 for high-performance hashing
- btleplug for cross-platform BLE support
- π Documentation
- π Issue Tracker
- π¬ Discussions
- π§ Email Support
- Implement signature verification functions
- Add key serialization/deserialization
- Performance benchmarks for Dilithium operations
- Memory-safe key handling
- Add identity validation functions
- Implement identity backup/restore
- Add identity metadata support
- Mnemonic phrase validation
- Complete platform-specific implementations:
- Android JNI integration for sensors
- iOS Core Motion framework integration
- ESP32 ADC and temperature sensor APIs
- Arduino hardware register access
- Add entropy quality assessment
- Implement entropy pooling and mixing
- Add fallback entropy sources
- Complete BLE implementation:
- GATT service and characteristic definitions
- Packet fragmentation for large messages
- Connection management and reconnection
- Device discovery and pairing
- Implement WiFi Direct transport
- Implement LoRa transport
- Add transport layer encryption
- Implement mesh routing protocols
- Add transport quality metrics
- Add configuration management
- Implement logging framework
- Add error handling utilities
- Performance monitoring tools
- Add transport packet handling
- Implement mesh routing
- Add peer discovery and management
- Configuration file support
- Metrics and monitoring endpoints
- Add authentication for gRPC APIs
- Add mesh network commands
- Implement peer management
- Add transport status commands
- Configuration management CLI
- Add interactive mode
- Complete iOS bindings
- Complete Android bindings
- Add mobile-specific transport optimizations
- Background operation support
- Push notification integration
- Complete no_std implementation
- Add embedded-specific transport drivers
- Power management optimizations
- Memory usage optimizations
- Hardware abstraction layer
- Implement distributed consensus
- Add blockchain/ledger functionality
- Implement smart contracts
- Add token/payment systems
- Network governance mechanisms
- Integration tests for transport layer
- End-to-end mesh networking tests
- Performance benchmarks
- Security audit and penetration testing
- Cross-platform compatibility tests
- API documentation
- Architecture documentation
- Deployment guides
- Security best practices
- Developer tutorials
- Docker containers
- Kubernetes manifests
- CI/CD pipelines
- Release automation
- Package managers (Homebrew, apt, etc.)
MetaMesh - Quantum-resistant identity management for the decentralized future.