Peer to Peer (P2P)
What is a P2P network?
A P2P network is a collective group of computers which are connected together to create a network. All computers or nodes have equal power and perform the same tasks. Within the blockchain, the P2P network is also called a distributed network. There are two most important factors in a P2P network: peer discovery and data transferring between peers.
How to discover a peer?
KardiaChain uses a node discovery protocol that is similar to Kademlia protocol. The Kademlia protocol is a Distributed Hash Table for p2p network which was designed by Petar Maymounkov and David Mazieres. It provides a process for millions of computers to self-organize, communicate and share resources over their network without the use of a central server.
How to transfer data between peers?
KardiaChain uses Kardia Protobuf Message Format KPMF) to transfer data between peers. The KPMF is a cryptographic p2p protocol message suite which provides a general purpose transport and interface for applications to communicate with each other. The KPMF is designed to meet the requirements of decentralized applications, enabling nodes to transfer encrypted, serialized data with better performance. The goal of KPMF is to ensure the confidentiality and integrity of data when transferring between peers.