Architecture
Pakit is built on a DAG-based MerkleDAG with cryptographic proofs, content-addressed storage, and a peer-to-peer network powered by Kademlia DHT and gossip-based dissemination. Phase 1 is complete with benchmarks demonstrating strong performance.
Architecture Details
MerkleDAG Structure
Multi-parent directed acyclic graph with 2–5 parent blocks per node, SHA-256 content addressing, compressed Merkle proofs, and batch verification. O(1) hash lookups and depth-range queries under 100ms.
Content Addressing
ContentAddressingEngine chunks data into 256KB blocks, computes SHA-256 content IDs, and calculates Merkle roots for automatic deduplication. Every piece of data is uniquely identified by its cryptographic hash.
Kademlia DHT
160-bit ID space with k=20 bucket size and α=3 parallelism. Supports PING, STORE, FIND_NODE, and FIND_VALUE RPCs with iterative lookups and bootstrap discovery. 160 k-buckets with LRU eviction and XOR distance metric.
Gossip Protocol
Epidemic propagation with fanout=6 and TTL=10. Bloom filters with 10,000 capacity prevent duplicate forwarding. BlockAnnouncement messages disseminate new content across the network.
PakitNode Identity
Ed25519 peer identity with a maximum of 50 concurrent connections per node. Default listen port 7777 with configurable bootstrap peers for network entry.
P2P Network Stack
Application Layer → P2P Protocol Layer (Block Discovery, Gossip, Request/Response, Merkle Verifier, Reputation) → Kademlia DHT → Network Transport (TCP/WebSocket).