# firecloud-net
P2P networking layer for FireCloud using libp2p with metadata hiding features.
## Overview
Provides peer-to-peer networking with privacy features:
- **P2P messaging**: Direct peer-to-peer communication
- **NAT traversal**: Hole punching and relay support
- **Metadata hiding**: Fixed-size messages and timing obfuscation
- **DHT**: Kademlia for peer discovery
- **mDNS**: Local network discovery
## Usage
```rust
use firecloud_net::{FireCloudNode, NodeConfig};
// Create a node
let config = NodeConfig {
port: 0,
enable_mdns: true,
bootstrap_peers: vec![],
bootstrap_relays: vec![],
};
let mut node = FireCloudNode::new(config).await?;
// Send a friend request
node.send_friend_request(&peer_id, Some("Alice".to_string()));
// Poll for events
while let Some(event) = node.poll_event().await {
// Handle events
}
```
## Features
- **libp2p integration**: Modern P2P networking stack
- **Request-response protocol**: Reliable message delivery
- **Metadata hiding**: All messages padded to 1024 bytes
- **Friend verification**: Only accept messages from friends
- **Delivery confirmations**: Know when messages are received
## Privacy
This crate implements metadata hiding to protect communication patterns:
- Fixed 1KB message size (regardless of content length)
- Random timing delays (100-500ms)
- Content encryption
- Friend-only messaging
## License
Licensed under either of:
- Apache License, Version 2.0 ([LICENSE-APACHE](../../LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](../../LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.