RazvanBerbece / ZRD

PoW Blockchain network built in C#. Supports the ZR420 cryptocurrency. Supports decentralised storage and transaction forwarding through peer-2-peer networking.
MIT License
5 stars 0 forks source link

Implement P2P support #9

Open RazvanBerbece opened 2 years ago

RazvanBerbece commented 2 years ago

P2P is basically the idea that a node in a network is both a server and a client. It can simply use sockets.

From every node's (client) perspective the blockchain is broadcasted to peers (server) and the chains are synched between peers - depending on chain length and validity. This also implies that all nodes need a full copy of the ENTIRE blockchain stored locally.

RazvanBerbece commented 2 years ago

Researched P2P support for Blockchains. All findings here : P2P Support for ZRD Documentation

RazvanBerbece commented 1 year ago

Current State (04 Sep 2022)

Currently, out of the whole workflow, the following work :

  1. Light Nodes sending unconfirmed transactions to Full Node peers to add to mempool
  2. Light Nodes querying their balance on the Full Node peer Blockchain state
  3. Full Nodes downloading initial full Blockchain state from other Full Nodes
  4. Full Nodes broadcasting full Blockchain state to other Full Nodes
  5. Full Nodes accepting incoming new full Blockchain states from Full Nodes
  6. Miner Nodes downloading initial full Blockchain state from other Full Nodes

To Implement :

  1. Miner Nodes accepting incoming new states from Full Nodes
  2. Miner Nodes mining unconfirmed transactions in mempool
  3. Miner Nodes broadcasting new full Blockchain state to other Full Nodes