P2P Protocol
Pakit's peer-to-peer layer distributes DAG blocks across the network with cryptographic verification of every remote byte. It is purpose-built for the sovereign storage network — no dependency on external systems.
Components
| Component | Design |
|---|---|
| Kademlia DHT | 160-bit ID space, k-buckets for peer/block discovery |
| Gossip protocol | Fanout 6, TTL 10 — epidemic block propagation |
| Request/response | Batched retrieval with priority queues (up to 100 blocks per request) |
| Merkle verifier | Cryptographic validation of untrusted data |
| Reputation | 0.0–1.0 behavioral score for peer selection |
| Transport | Async TCP with connection pooling (max 50 peers) |
Design Goals
- Sovereignty — zero external backend dependencies
- Security — every remote block is hash-verified before use
- Performance — target
<100 msDHT lookups,<500 msgossip propagation - Scale — designed for 1,000+ nodes per network
- Resilience — partition tolerance and automatic peer eviction
Discovery and Retrieval Flow
Client ──▶ DHT lookup (content hash)
│
▼
Provider peers ──▶ Block request (batched)
│
▼
Merkle verification ──▶ Local DAG insert
- Look up the content hash in the DHT to find provider peers
- Request the block batch from the best-scoring peers
- Verify the Merkle proof against the requested content ID
- Store only after verification succeeds
Reputation System
Peers are scored on behavior: successful block deliveries raise a peer's score, invalid or missing responses lower it. Low-reputation peers are deprioritized and eventually evicted. This keeps content integrity enforcement decentralized.
Security Model
- All blocks are verified against their content hash — a malicious peer cannot inject altered data
- Connection pools are bounded, limiting resource exhaustion
- Peer identity is anchored to the on-chain validator registry where available
Related
- ML Optimization — peer selector model
- Storage Proofs — cryptographic verification on-chain
- DAG Architecture