| Crates.io | exo-federation |
| lib.rs | exo-federation |
| version | 0.1.0 |
| created_at | 2025-12-02 04:08:05.922348+00 |
| updated_at | 2025-12-02 04:08:05.922348+00 |
| description | Federated cognitive mesh with post-quantum cryptographic sovereignty for distributed AI consciousness |
| homepage | https://ruv.io |
| repository | https://github.com/ruvnet/ruvector |
| max_upload_size | |
| id | 1961119 |
| size | 140,920 |
Federated cognitive mesh networking for EXO-AI 2025 distributed substrate.
This crate implements a distributed federation layer for cognitive substrates with:
┌─────────────────────────────────────────┐
│ FederatedMesh (Coordinator) │
├─────────────────────────────────────────┤
│ • Local substrate instance │
│ • Consensus coordination │
│ • Federation gateway │
│ • Cryptographic identity │
└─────────────────────────────────────────┘
│ │ │
┌─────┘ │ └─────┐
▼ ▼ ▼
Handshake Onion CRDT
Protocol Router Reconciliation
crypto.rs (232 lines)Post-quantum cryptographic primitives:
PostQuantumKeypair - CRYSTALS-Kyber key pairs (placeholder implementation)EncryptedChannel - Secure communication channelsSharedSecret - Key derivation from PQ key exchangeStatus: Placeholder implementation. Real implementation will use pqcrypto-kyber.
handshake.rs (280 lines)Federation joining protocol:
join_federation() - Cryptographic handshake with peersFederationToken - Access token with negotiated capabilitiesCapability - Feature negotiation systemProtocol:
onion.rs (263 lines)Privacy-preserving query routing:
onion_query() - Multi-hop encrypted routingOnionMessage - Layered encrypted messagespeel_layer() - Relay node layer decryptionFeatures:
crdt.rs (329 lines)Conflict-free replicated data types:
GSet<T> - Grow-only set (union merge)LWWRegister<T> - Last-writer-wins register (timestamp-based)LWWMap<K,V> - Map of LWW registersreconcile_crdt() - Merge federated query responsesProperties:
consensus.rs (340 lines)Byzantine fault-tolerant consensus:
byzantine_commit() - PBFT-style consensus protocolCommitProof - Cryptographic proof of consensusPhases:
lib.rs (286 lines)Main federation coordinator:
FederatedMesh - Main coordinator structFederationScope - Query scope control (Local/Direct/Global)FederatedResult - Query results from peersuse exo_federation::*;
#[tokio::main]
async fn main() -> Result<()> {
// Create local substrate instance
let substrate = SubstrateInstance {};
// Initialize federated mesh
let mut mesh = FederatedMesh::new(substrate)?;
// Join federation
let peer = PeerAddress::new(
"peer.example.com".to_string(),
8080,
peer_public_key.to_vec()
);
let token = mesh.join_federation(&peer).await?;
// Execute federated query
let results = mesh.federated_query(
query_data,
FederationScope::Global { max_hops: 5 }
).await?;
// Commit state update with consensus
let update = StateUpdate { /* ... */ };
let proof = mesh.byzantine_commit(update).await?;
Ok(())
}
Post-quantum crypto: Currently using simplified placeholders
pqcrypto-kyber integrationNetwork layer: Simulated message passing
Consensus coordination: Single-node simulation
Real PQC Integration
pqcrypto-kyber crateNetwork Layer
Distributed Consensus
Performance Optimizations
exo-core = { path = "../exo-core" }
tokio = { version = "1.41", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
dashmap = "6.1"
rand = "0.8"
sha2 = "0.10"
hex = "0.4"
# Run all tests
cargo test
# Run specific module tests
cargo test --lib crypto
cargo test --lib handshake
cargo test --lib consensus
This crate integrates with the broader EXO-AI cognitive substrate:
MIT OR Apache-2.0