{"id":31841566,"url":"https://github.com/dirvine/saorsa-core","last_synced_at":"2025-10-12T05:21:08.161Z","repository":{"id":310086662,"uuid":"1038458463","full_name":"dirvine/saorsa-core","owner":"dirvine","description":"Saorsa Core - P2P networking library with DHT, QUIC transport, four-word addresses, and MCP integration","archived":false,"fork":false,"pushed_at":"2025-09-30T17:23:42.000Z","size":5280,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-30T17:49:46.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/dirvine/saorsa-core-foundation","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirvine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY_MODEL.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-08-15T08:30:08.000Z","updated_at":"2025-09-30T17:23:46.000Z","dependencies_parsed_at":"2025-08-15T17:43:03.767Z","dependency_job_id":"0a3e9807-2d3e-4d48-a4fb-407b0701a377","html_url":"https://github.com/dirvine/saorsa-core","commit_stats":null,"previous_names":["dirvine/saorsa-core","dirvine/saorsa-core-foundation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dirvine/saorsa-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirvine","download_url":"https://codeload.github.com/dirvine/saorsa-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirvine%2Fsaorsa-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010341,"owners_count":26084738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-12T05:21:02.044Z","updated_at":"2025-10-12T05:21:08.154Z","avatar_url":"https://github.com/dirvine.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Saorsa Core\n\n[![CI](https://github.com/dirvine/saorsa-core-foundation/actions/workflows/rust.yml/badge.svg)](https://github.com/dirvine/saorsa-core-foundation/actions/workflows/rust.yml)\n[![Crates.io](https://img.shields.io/crates/v/saorsa-core.svg)](https://crates.io/crates/saorsa-core)\n[![Documentation](https://docs.rs/saorsa-core/badge.svg)](https://docs.rs/saorsa-core)\n\nCore P2P networking library for Saorsa platform with DHT, QUIC transport, dual-stack endpoints (IPv6+IPv4), and four-word endpoint encoding.\n\n## Guides\n\n- Contributor guide: see [AGENTS.md](AGENTS.md)\n- Architecture overview: see [ARCHITECTURE.md](ARCHITECTURE.md)\n\n## Features\n\n- **P2P NAT Traversal**: True peer-to-peer messaging with automatic NAT traversal (ant-quic 0.10.0+)\n- **DHT (Distributed Hash Table)**: Advanced DHT implementation with RSPS (Root-Scoped Provider Summaries)\n- **Placement System**: Intelligent shard placement with EigenTrust integration and Byzantine fault tolerance\n- **QUIC Transport**: High-performance networking with ant-quic\n- **Four-Word Endpoints**: Human‑readable network endpoints via `four-word-networking` (IPv4 encodes to 4 words; IPv6 word count decided by the crate); decode requires an explicit port (no defaults).\n- **Post-Quantum Cryptography**: Future-ready cryptographic algorithms\n- **WebRTC over QUIC**: Advanced WebRTC-QUIC bridge for real-time media streaming with adaptive quality\n- **Media Processing**: Image and audio processing with blurhash and symphonia\n- **Geographic Routing**: Location-aware networking\n- **Identity Management**: Post-quantum ML-DSA-65 signatures (NIST Level 3). No PoW; identities hold only required keys (no embedded word address).\n- **Secure Storage**: Database persistence with deadpool-sqlite + rusqlite\n- **Monitoring**: Prometheus metrics integration\n\n## Quick Start\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nsaorsa-core = \"0.5.0\"\n```\n\n### Basic DHT Node\n\n```rust\nuse saorsa_core::{Network, NetworkConfig, NodeId};\nuse tokio;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Create a new network node\n    let config = NetworkConfig::default();\n    let mut network = Network::new(config).await?;\n    \n    // Start the network\n    network.start().await?;\n    \n    // Store some data\n    let key = b\"example-key\";\n    let value = b\"example-value\";\n    network.store(key, value.to_vec()).await?;\n    \n    // Retrieve the data\n    if let Some(retrieved) = network.retrieve(key).await? {\n        println!(\"Retrieved: {:?}\", retrieved);\n    }\n    \n    Ok(())\n}\n```\n\n### P2P NAT Traversal\n\nsaorsa-core v0.5.0+ includes full P2P NAT traversal support, enabling direct peer-to-peer connections:\n\n```rust\nuse saorsa_core::messaging::{MessagingService, NetworkConfig, DhtClient};\nuse saorsa_core::identity::FourWordAddress;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Create two messaging service instances with P2P NAT traversal (default)\n    let config = NetworkConfig::default();  // Includes P2P NAT traversal\n\n    let service1 = MessagingService::new_with_config(\n        FourWordAddress(\"peer-one-alpha\".to_string()),\n        DhtClient::new()?,\n        config.clone(),\n    ).await?;\n\n    let service2 = MessagingService::new_with_config(\n        FourWordAddress(\"peer-two-beta\".to_string()),\n        DhtClient::new()?,\n        config,\n    ).await?;\n\n    // Connect peers directly\n    let addr2 = service2.listen_addrs().await[0];\n    service1.connect_peer(\u0026addr2).await?;\n\n    // Send P2P message\n    service1.send_direct_message(\u0026addr2, b\"Hello P2P!\").await?;\n\n    Ok(())\n}\n```\n\n**NAT Traversal Modes:**\n- **P2P Node** (default): Both send and receive path validations for symmetric P2P connections\n- **Client Only**: Outgoing connections only, minimal resource usage\n- **Disabled**: No NAT traversal for private networks\n\n**Configuration Examples:**\n```rust\n// Default P2P mode with concurrency limit of 10\nlet config = NetworkConfig::default();\n\n// High-traffic P2P node\nlet config = NetworkConfig::p2p_node(50);\n\n// Lightweight client\nlet config = NetworkConfig::client_only();\n\n// Private network (no NAT traversal)\nlet config = NetworkConfig::no_nat_traversal();\n```\n\n### Four-Word Endpoints\n\n- Endpoints are encoded/decoded using the `four-word-networking` crate's adaptive API.\n- IPv4 → 4 words; IPv6 → word count is crate‑defined; decoding requires a port (no implicit defaults).\n- Four‑words are reserved strictly for network endpoints; user identities in messaging are separate handles.\n\n## Architecture\n\n### Core Components\n\n1. **Network Layer**: QUIC-based P2P networking with automatic NAT traversal (ant-quic 0.10.0+)\n2. **DHT**: Kademlia-based DHT with RSPS optimization\n3. **Placement System**: Intelligent shard placement with weighted selection algorithms\n4. **Identity**: Post‑quantum cryptographic identities with ML‑DSA‑65 signatures (no PoW; no embedded four‑word address)\n5. **Storage**: Local and distributed content storage with audit and repair\n6. **Geographic Routing**: Location-aware message routing\n\n\n### Cryptographic Architecture\n\nSaorsa Core implements a pure post-quantum cryptographic approach for maximum security:\n\n- **Post‑quantum signatures**: ML‑DSA‑65 (FIPS 204) for quantum‑resistant digital signatures (~128‑bit quantum security)\n- **PQC Encryption**: ChaCha20-Poly1305 with quantum-resistant key derivation\n- **Key Exchange**: ML-KEM-768 (FIPS 203) for quantum-resistant key encapsulation (~128-bit quantum security)\n- **Hashing**: BLAKE3 for fast, secure content addressing\n- **Transport Security**: QUIC with TLS 1.3 and PQC cipher suites\n- **No Legacy Support**: Pure PQC implementation with no classical cryptographic fallbacks\n\n### Recent Changes\n\n- Removed all Proof‑of‑Work (PoW) usage (identity, adaptive, placement/DHT, error types, CLI).\n- Adopted `four-word-networking` adaptive API; four‑words reserved for endpoints only.\n- Implemented dual‑stack listeners (IPv6 + IPv4) and Happy Eyeballs dialing.\n- Introduced `UserHandle` for messaging identities; migrated mentions, presence, participants, search, reactions, and read/delivered receipts to use it.\n\n### Data Flow\n\n```\nApplication\n    ↓\nNetwork API\n    ↓\nPlacement Engine → DHT + Geographic Routing\n    ↓              ↓\n    ↓         Audit \u0026 Repair\n    ↓              ↓\nQUIC Transport (ant-quic)\n    ↓\nInternet\n```\n\n### Placement System\n\nSaorsa Core includes an advanced placement system for optimal distribution of erasure-coded shards across the network:\n\n```rust\nuse saorsa_core::placement::{\n    PlacementEngine, PlacementConfig, GeographicLocation, NetworkRegion\n};\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Configure placement system\n    let config = PlacementConfig {\n        replication_factor: (3, 8).into(), // Min 3, target 8 replicas\n        byzantine_tolerance: 2.into(),      // Tolerate up to 2 Byzantine nodes\n        placement_timeout: Duration::from_secs(30),\n        geographic_diversity: true,\n        weights: OptimizationWeights {\n            trust_weight: 0.4,        // EigenTrust reputation\n            performance_weight: 0.3,   // Node performance metrics\n            capacity_weight: 0.2,      // Available storage capacity\n            diversity_bonus: 0.1,      // Geographic/network diversity\n        },\n    };\n    \n    // Create placement engine\n    let mut engine = PlacementEngine::new(config);\n    \n    // Place data with optimal shard distribution\n    let data = b\"important data to store\";\n    let decision = placement_orchestrator.place_data(\n        data.to_vec(),\n        8, // replication factor\n        Some(NetworkRegion::NorthAmerica),\n    ).await?;\n    \n    println!(\"Placed {} shards across {} nodes\", \n             decision.shard_count, \n             decision.selected_nodes.len());\n    \n    Ok(())\n}\n```\n\n#### Key Features\n\n- **EigenTrust Integration**: Uses reputation scores for node selection\n- **Weighted Selection**: Balances trust, performance, capacity, and diversity\n- **Byzantine Fault Tolerance**: Configurable f-out-of-3f+1 security model\n- **Geographic Diversity**: Ensures shards are distributed across regions\n- **Continuous Monitoring**: Audit system with automatic repair\n- **DHT Record Types**: Efficient ≤512B records with cryptographic validation\n- **Hysteresis Control**: Prevents repair storms with smart cooldown\n\n## Configuration\n\n```rust\nuse saorsa_core::NetworkConfig;\n\nlet config = NetworkConfig {\n    listen_port: 9000,\n    bootstrap_nodes: vec![\n        \"bootstrap1.example.com:9000\".parse()?,\n        \"bootstrap2.example.com:9000\".parse()?,\n    ],\n    enable_four_word_addresses: true,\n    dht_replication: 20,\n    storage_capacity: 1024 * 1024 * 1024, // 1GB\n    ..Default::default()\n};\n```\n\n## Feature Flags\n\n- `default` - Metrics and Prometheus integration\n- `metrics` - Prometheus metrics and monitoring\n- `mocks` - Test/dummy helpers for development (off by default)\n- `h2_greedy` - Hyperbolic greedy routing helpers in API\n- `test-utils` - Test utilities including mock DHT for integration tests\n\nNote: DHT, ant-quic QUIC transport, and post-quantum cryptography are always enabled. Four-word networking is a core feature.\n\n## Performance\n\nSaorsa Core is designed for high performance:\n\n- **Concurrent Operations**: Tokio-based async runtime\n- **Memory Efficiency**: Zero-copy operations where possible\n- **Network Optimization**: QUIC with congestion control\n- **Caching**: Multi-level caching with Q-learning optimization\n\n### Benchmarks\n\nRun benchmarks with:\n\n```bash\ncargo bench\n```\n\nKey benchmarks:\n- DHT operations: ~10,000 ops/sec\n- Storage throughput: ~100 MB/sec\n- Geographic routing: \u003c10ms latency\n- Placement decisions: \u003c1s for 8-node selection\n- Shard repair: Automatic with \u003c1h detection\n- Cryptographic operations: Hardware-accelerated\n\n## Security\n\n- **Post-Quantum Signatures**: ML-DSA-65 (FIPS 204) for quantum-resistant digital signatures (~128-bit quantum security)\n- **PQC Encryption**: ChaCha20-Poly1305 with quantum-resistant key derivation\n- **Key Exchange**: ML-KEM-768 (FIPS 203) for quantum-resistant key encapsulation (~128-bit quantum security)\n- **BLAKE3 Hashing**: Fast and secure content addressing\n- **QUIC Encryption**: Transport-level encryption with PQC support\n- **Pure PQC**: No classical cryptographic algorithms - quantum-resistant from the ground up\n- **Secure Memory**: Platform-specific memory protection\n\n## WebRTC over QUIC Integration\n\nSaorsa Core provides a unique **WebRTC-over-QUIC bridge** that combines the real-time capabilities of WebRTC with the performance and reliability of QUIC transport. This allows for high-quality media streaming with improved NAT traversal and congestion control.\n\n### Key Features\n\n- **Seamless Integration**: Bridge WebRTC media streams over ant-quic transport\n- **Adaptive Quality**: Automatic bandwidth and quality adaptation based on network conditions\n- **Multiple Stream Types**: Support for audio, video, screen sharing, and data channels\n- **QoS Management**: Intelligent Quality of Service with stream prioritization\n- **Jitter Buffering**: Built-in jitter buffers for smooth media playback\n- **Performance Monitoring**: Real-time statistics and performance metrics\n\n### Basic WebRTC-QUIC Bridge Setup\n\n```rust\nuse saorsa_core::messaging::{\n    WebRtcQuicBridge, QuicMediaStreamManager, StreamConfig, StreamType, QosParameters\n};\nuse saorsa_core::transport::ant_quic_adapter::P2PNetworkNode;\nuse std::sync::Arc;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Create network node\n    let node = Arc::new(P2PNetworkNode::new(\"127.0.0.1:0\".parse()?).await?);\n    \n    // Create WebRTC-QUIC bridge\n    let bridge = WebRtcQuicBridge::new(node).await?;\n    \n    // Create stream manager for bandwidth management\n    let manager = QuicMediaStreamManager::new(2000); // 2 Mbps\n    manager.start_background_tasks().await?;\n    \n    // Connect to peer\n    let peer_addr = \"192.168.1.100:9000\".parse()?;\n    let peer_id = bridge.connect_peer(peer_addr).await?;\n    \n    // Configure audio stream\n    let audio_config = StreamConfig {\n        stream_type: StreamType::Audio,\n        codec: \"opus\".to_string(),\n        bitrate_kbps: 64,\n        sample_rate: Some(48000),\n        resolution: None,\n    };\n    bridge.add_stream(peer_id, StreamType::Audio, audio_config).await?;\n    \n    // Configure video stream\n    let video_config = StreamConfig {\n        stream_type: StreamType::Video,\n        codec: \"h264\".to_string(),\n        bitrate_kbps: 1000,\n        sample_rate: None,\n        resolution: Some((1280, 720)),\n    };\n    bridge.add_stream(peer_id, StreamType::Video, video_config).await?;\n    \n    // Set QoS parameters\n    manager.set_qos_params(StreamType::Audio, QosParameters::audio()).await;\n    manager.set_qos_params(StreamType::Video, QosParameters::video()).await;\n    \n    // Start receiving packets\n    let mut receiver = bridge.start_receiving().await?;\n    \n    // Handle incoming packets\n    tokio::spawn(async move {\n        while let Some((peer_id, packet)) = receiver.recv().await {\n            println!(\"Received {} packet from {}\", packet.stream_type, peer_id);\n            // Process packet...\n        }\n    });\n    \n    Ok(())\n}\n```\n\n### Media Streaming Example\n\n```rust\nuse saorsa_core::messaging::RtpPacket;\n\n// Create and send RTP packets\nasync fn send_media_packets(\n    bridge: \u0026WebRtcQuicBridge,\n    peer_id: PeerId,\n) -\u003e Result\u003c()\u003e {\n    // Audio packet (Opus codec)\n    let audio_packet = RtpPacket::new(\n        96,                    // Payload type (Opus)\n        1001,                  // Sequence number\n        48000,                 // Timestamp (48kHz sample rate)\n        0x12345678,            // SSRC identifier\n        vec![0xAA; 160],       // Opus frame data (20ms @ 48kHz)\n        StreamType::Audio,\n    );\n    bridge.send_rtp_packet(peer_id, audio_packet).await?;\n    \n    // Video packet (H.264 codec)\n    let video_packet = RtpPacket::new(\n        97,                    // Payload type (H.264)\n        2001,                  // Sequence number\n        90000,                 // Timestamp (90kHz for video)\n        0x87654321,            // SSRC identifier\n        vec![0xBB; 1200],      // H.264 NAL unit\n        StreamType::Video,\n    );\n    bridge.send_rtp_packet(peer_id, video_packet).await?;\n    \n    Ok(())\n}\n```\n\n### Quality of Service (QoS) Configuration\n\n```rust\nuse saorsa_core::messaging::QosParameters;\n\n// Configure QoS for different stream types\nlet audio_qos = QosParameters {\n    priority: 3,           // Highest priority\n    max_latency_ms: 20,    // Low latency for real-time audio\n    max_jitter_ms: 5,      // Minimal jitter tolerance\n    target_bitrate_kbps: 64,\n    max_bitrate_kbps: 128,\n    min_bitrate_kbps: 32,\n    loss_threshold: 1.0,   // 1% packet loss threshold\n};\n\nlet video_qos = QosParameters {\n    priority: 2,           // Medium priority\n    max_latency_ms: 100,   // Higher latency tolerance\n    max_jitter_ms: 20,     // More jitter tolerance\n    target_bitrate_kbps: 1000,\n    max_bitrate_kbps: 2000,\n    min_bitrate_kbps: 200,\n    loss_threshold: 3.0,   // 3% packet loss threshold\n};\n\nmanager.set_qos_params(StreamType::Audio, audio_qos).await;\nmanager.set_qos_params(StreamType::Video, video_qos).await;\n```\n\n### Bandwidth Adaptation\n\n```rust\n// Check for bandwidth adaptation recommendations\nif let Some(adjustment) = manager.check_bandwidth_adaptation().await {\n    match adjustment {\n        BandwidthAdjustment::Increase { current, recommended } =\u003e {\n            println!(\"Increase bandwidth: {} -\u003e {} kbps\", current, recommended);\n            // Adjust encoder settings...\n        }\n        BandwidthAdjustment::Decrease { current, recommended } =\u003e {\n            println!(\"Decrease bandwidth: {} -\u003e {} kbps\", current, recommended);\n            // Reduce quality or bitrate...\n        }\n    }\n}\n\n// Check transmission capacity\nlet can_send_hd = manager.can_transmit(1500).await; // 1.5KB HD frame\nif !can_send_hd {\n    // Switch to lower resolution or quality\n}\n```\n\n### Performance Monitoring\n\n```rust\n// Get peer statistics\nif let Some(stats) = bridge.get_peer_stats(peer_id).await {\n    println!(\"Packets sent: {}\", stats.packets_sent);\n    println!(\"Packets received: {}\", stats.packets_received);\n    println!(\"Bytes transferred: {}\", stats.bytes_sent);\n    println!(\"Active streams: {}\", stats.streams.len());\n}\n\n// Get stream-specific statistics\nlet stream_stats = manager.get_all_stats().await;\nfor ((peer_id, stream_type), stats) in stream_stats {\n    println!(\"{:?} stream to {}:\", stream_type, peer_id);\n    println!(\"  RTT: {}ms\", stats.rtt_ms);\n    println!(\"  Loss: {:.2}%\", stats.loss_percentage());\n    println!(\"  Throughput: {} kbps\", stats.effective_bitrate_kbps());\n}\n```\n\n### Advanced Features\n\n#### Multi-Stream Management\n```rust\n// Configure multiple streams for comprehensive communication\nbridge.add_stream(peer_id, StreamType::Audio, audio_config).await?;\nbridge.add_stream(peer_id, StreamType::Video, video_config).await?;\nbridge.add_stream(peer_id, StreamType::ScreenShare, screen_config).await?;\nbridge.add_stream(peer_id, StreamType::Data, data_config).await?;\n```\n\n#### Custom Bridge Configuration\n```rust\nuse saorsa_core::messaging::BridgeConfig;\n\nlet config = BridgeConfig {\n    jitter_buffer_size: 100,                    // 100 packets max\n    jitter_buffer_delay: Duration::from_millis(50), // 50ms buffer\n    peer_timeout: Duration::from_secs(30),      // 30s peer timeout\n    cleanup_interval: Duration::from_secs(5),   // Cleanup every 5s\n    max_packet_size: 1500,                      // MTU consideration\n    enable_adaptive_jitter: true,               // Adaptive jitter buffering\n};\n\nlet bridge = WebRtcQuicBridge::new_with_config(node, config).await?;\n```\n\n#### Error Handling and Reconnection\n```rust\n// Robust error handling\nmatch bridge.send_rtp_packet(peer_id, packet).await {\n    Ok(_) =\u003e {\n        // Packet sent successfully\n    }\n    Err(e) =\u003e {\n        eprintln!(\"Failed to send packet: {}\", e);\n        \n        // Attempt reconnection if peer disconnected\n        if e.to_string().contains(\"not connected\") {\n            match bridge.connect_peer(peer_addr).await {\n                Ok(new_peer_id) =\u003e {\n                    // Reconfigure streams for new connection\n                    configure_streams(\u0026bridge, new_peer_id).await?;\n                }\n                Err(reconnect_err) =\u003e {\n                    eprintln!(\"Reconnection failed: {}\", reconnect_err);\n                }\n            }\n        }\n    }\n}\n```\n\n### Use Cases\n\n1. **Voice Calls**: Low-latency audio streaming with Opus codec\n2. **Video Conferencing**: Adaptive video quality with H.264/VP8 codecs  \n3. **Screen Sharing**: High-quality desktop streaming\n4. **File Transfer**: Reliable data channel communication\n5. **Gaming**: Real-time game state synchronization\n6. **IoT Streaming**: Sensor data and telemetry transmission\n\n## Media Processing\n\nBuilt-in media processing capabilities:\n\n- **Images**: JPEG, PNG, WebP, GIF support with blurhash\n- **Audio**: Full codec support via symphonia\n- **Streaming**: Real-time media streaming over WebRTC\n\n## Database Integration\n\nSQLite-based persistence with migrations:\n\n```rust\nuse saorsa_core::storage::Database;\n\nlet db = Database::open(\"./data/node.db\").await?;\ndb.store_message(\u0026message).await?;\n```\n\n## Geographic Features\n\nLocation-aware networking:\n\n- Geographic distance calculations\n- Location-based routing\n- Regional content distribution\n- Privacy-preserving location services\n\n## Development\n\n### Building\n\n```bash\n# Standard build\ncargo build --release\n\n# With all features\ncargo build --all-features\n\n# Feature-specific build\ncargo build --features \"dht,quantum-resistant\"\n```\n\n### Testing\n\n```bash\n# Unit tests\ncargo test\n\n# Integration tests\ncargo test --test '*'\n\n# Property-based tests\ncargo test --features \"proptest\"\n```\n\n### Linting\n\n```bash\ncargo clippy --all-features -- -D warnings\ncargo fmt --all\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new functionality\n5. Ensure all tests pass\n6. Submit a pull request\n\n### Code Style\n\n- Follow Rust 2024 idioms\n- Use `cargo fmt` for formatting\n- Ensure `cargo clippy` passes\n- Add documentation for public APIs\n- Include tests for all new features\n\n## License\n\nThis project is dual-licensed:\n\n- **AGPL-3.0**: Open source license for open source projects\n- **Commercial**: Commercial license for proprietary projects\n\nFor commercial licensing, contact: saorsalabs@gmail.com\n\n## Dependencies\n\n### Core Dependencies\n- `tokio` - Async runtime\n- `futures` - Future utilities\n- `serde` - Serialization\n- `anyhow` - Error handling\n- `tracing` - Logging\n\n### Networking\n- `ant-quic` (0.10.0+) - QUIC transport with P2P NAT traversal\n- `four-word-networking` - Human-readable addresses\n- `rustls` - TLS support\n\n### Cryptography\n- `saorsa-pqc` - Post-quantum cryptography (ML-DSA, ML-KEM, ChaCha20-Poly1305)\n- `blake3` - Hashing\n- `rand` - Random number generation\n\n### Storage \u0026 Database\n- `sqlx` - Database operations\n- `lru` - LRU caching\n- `reed-solomon-erasure` - Error correction\n\n### Media \u0026 WebRTC\n- `webrtc` - WebRTC implementation\n- `image` - Image processing\n- `symphonia` - Audio codecs\n- `rodio` - Audio playback\n\nSee `Cargo.toml` for complete dependency list.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for version history.\n\n## Support\n\n- **Issues**: [GitHub Issues](https://github.com/dirvine/saorsa-core-foundation/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/dirvine/saorsa-core-foundation/discussions)\n- **Email**: saorsalabs@gmail.com\n\n---\n\n**Saorsa Labs Limited** - Building the decentralized future\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirvine%2Fsaorsa-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirvine%2Fsaorsa-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirvine%2Fsaorsa-core/lists"}