P2P Network

Distributed P2P network in blockchain

what is a P2P network?

it is important to understand p2p network,because blockchain technology works on this network. to know blockchain technology click here

  • before P2P lets know centralized network.

what is centralized network?

index.jpg Centralized network is like Client Server Model. there is One server and all the Clients are connected through it. where all the Data is store over the server. whenever a client require a data, it will request the server and then server respond back to the client with that data. In centralized network only server fulfills all the request to every client. the problem with centralized network is any hacker can hack,because all the data is over a server. and if server is Hacked the all the data can be leaked and our privacy will be finished. so that's why blockchain works on Distributed P2P and Not on Centralized network.

Distributed P2P network?

2index.png In Distributed P2P network there is no prime server, here we have peers, every peer has some data and whenever a peer require particular data then it communicate with any peer and get the data. same data can be at different peers so they can communicate and get the data. Now in this system if a hacker hacks a particular system and corrupt it's data, then also that system can get it's data from any another peer. and in P2P network there are thousands of systems connected to each other, so it is impossible for a hacker to hack all the systems.

How Blockchain works on P2P network?

As you know there is no client server relationship in here, all the nodes interact with each other, now lets see how P2P network works on Blockchain. maxresdefault.jpg lets assume these systems are miners and they have mined some blocks and now they have there own blockchain, which is exactly same for all. now lets see how this blockchain is maintained in all system with P2P, suppose there is a miner and he mined a block, as he mine's a block, he will insert that block to his blockchain, As soon as this miner added this block to his blockchain, he will immediately inform to other connected nodes that he has mined a block, then they other node verifies the block is its valid then they will add it in there system as well.

why we need P2P network in blockchain?

  1. to transfer the blocks across the network.
  2. as we know blockchain is immutable, if any hacker hacks any node they all the other nodes will know that this blockchain is corrupt and someone has tried to hack. so now the corrupt data will not match with other nodes then that corrupt node have to change the data to data what all the majority has. so that blockchain will be maintained.
  3. it is impossible for hacker to hack in all the system, P2P networks and immutability makes blockchain secure.