chie
CHIE Protocol - Decentralized, privacy-preserving file sharing with zero-knowledge proofs.
Overview
CHIE (Collective Hybrid Intelligence Ecosystem / 知恵) is a next-generation decentralized content distribution protocol combining IPFS-based storage with innovative incentive mechanisms.
This is the meta crate that re-exports all CHIE Protocol components for convenient access:
| Module | Crate | Description |
|---|---|---|
[shared] |
chie-shared |
Common types, errors, validation, and utilities |
[crypto] |
chie-crypto |
Cryptographic primitives (encryption, signatures, ZK proofs) |
[core] |
chie-core |
Node implementation, storage, and content management |
[p2p] |
chie-p2p |
P2P networking layer using rust-libp2p |
Installation
Add this to your Cargo.toml:
[]
= "0.1"
Quick Start
use *;
use PathBuf;
async
Features
Cryptography (chie::crypto)
use ;
// Generate keys
let keypair = generate;
let encryption_key = generate_key;
let nonce = generate_nonce;
// Encrypt/decrypt data
let plaintext = b"Hello, CHIE!";
let ciphertext = encrypt.unwrap;
let decrypted = decrypt.unwrap;
assert_eq!;
Capabilities:
- Core: Ed25519 signatures, ChaCha20-Poly1305 AEAD, BLAKE3 hashing, HKDF key derivation
- Advanced: Threshold signatures (FROST), BLS aggregation, Schnorr signatures
- Post-Quantum: Kyber KEM, Dilithium signatures, SPHINCS+ hash-based signatures
- Privacy: Ring signatures, BBS+ selective disclosure, zero-knowledge range proofs
Content Management (chie::shared)
use ;
use Uuid;
let metadata = new
.cid
.title
.description
.category
.size_bytes
.price
.creator_id
.status
.build
.expect;
P2P Networking (chie::p2p)
use ;
let manager = new;
let data = b"Data to compress";
let compressed = manager.compress.unwrap;
let decompressed = manager.decompress.unwrap;
assert_eq!;
Capabilities:
- Transport: TCP, QUIC, WebRTC support with NAT traversal and relay
- Discovery: Kademlia DHT, mDNS, bootstrap nodes, peer exchange (PEX)
- Protocol: Custom bandwidth proof codec, Gossipsub for announcements
- Resilience: Circuit breaker, erasure coding, network partition detection
Core Protocol (chie::core)
use ;
use *;
// Create bandwidth proof for verified transfers
let proof = create_bandwidth_proof?;
Capabilities:
- Storage: Chunk encryption, tiered storage (SSD/HDD), deduplication
- Content: Selective pinning optimizer, popularity tracking, prefetching
- Network: Peer selection, content routing, adaptive rate limiting
- Monitoring: Metrics (Prometheus), profiling, network diagnostics
Prelude
For convenience, import commonly used types with the prelude:
use *;
This includes:
| Category | Types |
|---|---|
| Types | BandwidthProof, ChunkRequest, ChunkResponse, ContentMetadata, ContentCategory |
| Errors | ChieError, ChieResult |
| Crypto | KeyPair, PublicKey, SecretKey, encrypt, decrypt, hash |
| Node | ContentNode, NodeConfig, ChunkStorage |
| P2P | CompressionManager, BootstrapManager, ContentRouter, GossipConfig |
Bandwidth Proof Protocol
The core innovation is the cryptographically verifiable bandwidth proof:
1. Requester → Provider: ChunkRequest
- content_cid, chunk_index, challenge_nonce, timestamp
2. Provider → Requester: ChunkResponse
- encrypted_chunk, chunk_hash, provider_signature, challenge_echo
3. Both parties generate BandwidthProof:
- Dual signatures (provider + requester)
- session_id, bytes_transferred, latency_ms
- Submitted to coordinator for verification
Technology Stack
| Component | Library | Purpose |
|---|---|---|
| P2P Networking | libp2p 0.54 | Swarm, Kademlia DHT, Gossipsub |
| Encryption | chacha20poly1305 | AEAD content encryption |
| Signing | ed25519-dalek | Digital signatures |
| Hashing | blake3 | Fast cryptographic hashing |
| Key Derivation | hkdf | HKDF-SHA256 |
| Async Runtime | Tokio 1.x | Full-featured async runtime |
Minimum Supported Rust Version (MSRV)
Rust 1.83 or later is required.
Related Crates
chie-shared- Shared types and utilitieschie-crypto- Cryptographic primitiveschie-core- Core protocol logicchie-p2p- P2P networking layerchie-coordinator- Central coordinator server
License
UNLICENSED - All Rights Reserved
Author
COOLJAPAN OU