Bitcoin works on top of peer-to-peer network architecture in a completely decentralized manner. It is an Adhoc network with a certain kind of random topology, and on top of that, it runs the bitcoin protocol using the well-known TCP port 8333. All nodes, the bitcoin network users, are treated equally, and new nodes can join the bitcoin network anytime. As it is a permissionless network, users need not authenticate or verify. These are the following activities need to perform for a new join node.
- Open wallet
- Wallet communicates to the seed nodes.
- Seed nodes provide a list of peer nodes addresses
- Ask for the most recent updated blockchain copy
- Accept the blockchain copy, which is received from most peers and the longest chain in the current blockchain.
- Start the transaction procedure.
Node Management
Whenever a new node joins the network in such a kind of overlay network, they need to first communicate to the seed nodes. The seed nodes are the special kind of nodes that keep a database of active peer nodes. As a response, seed nodes provide a list of peer nodes. Further, the new node will randomly select a certain number of peer nodes and peering relationships with those particular nodes.
If the old nodes are not responding for a certain duration in general, it is for three hours; then, seed nodes will remove them from their list. Later, whenever they open their wallet again, they will join the network and participate in some transaction;
The task of seed node is to provide the initial information to the new nodes who are going to join in the network.
Operations:
Once a node joins the network, the first task of a node is to get the most recent blockchain from the peer nodes and update the local copy of the blockchain. It is required as a node may be offline for a certain duration, and as time progresses, blockchain has increased with new transactions.
Once the peer nodes transfer the most recent blockchain information to the new joint node, It compares the block and accepts the block received from more than 50 percent of peer nodes. The individual nodes must follow this scheme as the entire ecosystem is decentralized, and nodes may collude for malicious intent. In simple words, accept the blockchain copy, which most peer nodes have transferred.
While accepting the blockchain copy, the node also needs to ensure that it only accepts the longest chain in the current blockchain. Once a node receives the most recent copy of the blockchain, it can start the transaction procedure.
Summary
In this note, we have seen how peer nodes communicate in the p2p network, node list update mechanism, and transaction management.
References:
- NPTEL lecture series on Blockchains Architecture, Design and Use Cases by Prof. Sandip Chakraborty, IIT Kharagpur.
322 total views, 1 views today