Bitcoin: Part 5: Blocks & Nodes of Bitcoin Network.steemCreated with Sketch.

sap542.png

sap102.png

In the ongoing #steemcryptochallenge, I have already published Bitcoin: Part 1, Part 2, Part 3, Part 4. Today I will detail Part 5.

This publication will cover the Blocks & Nodes of Bitcoin Blockchain, what is the common function of each node of a Bitcoin network, how they are categorized based on the functions or combination of functions, the discovery of nodes, etc.

sap102.png

The Blocks of the Bitcoin Blockchain.

The Blockchain or the chain-of-Blocks is named so because each block contains the hash of the previous block, thereby making a sequence of Block and the hash is generated using SHA256 cryptographic hashing Algorithm.

The very first Block is known as the Genesis Block. This is also the Root-of-Trust for an application built on the top of a Blockchain.

When we visualize a Blockchain, we consider each Block placed on the top of the previous Block, forming a vertical stack. From this stack, the terminology like Block height originates, which refers to the distance of the current block to the genesis block, as a genesis Block is also called the foundation block.

screenshot (38).png

Since each Block is a sequence of the previous Block, containing the hash of the previous block, the previous Block is known as the parent Block. For each Block, there will be one Parent Block. It may so happen that temporarily a parent Block has more than one child(e.g. during the event of a hard fork), but ultimately only one child will prevail & becomes the part of the Blockchain. So each Block has one unique parent Block, that is identified by the hash of the previous Block.

bit1.png
Source

A Block header consists of:-

  • The hash of the parent Block
  • (difficulty, timestamp, nonce)-- PoW mining metadata
  • Merkle tree root-- to verify a transaction included in the Block

bit.png
Source

Any Block in the Bitcoin Blockchain is identified by the Block header hash and Block height.

A Block header hash is obtained by hashing the header twice using SHA 256 algorithm. The block height is obtained by measuring its distance from the Genesis Block.

If you know the Block height, and you go reverse, then ultimately you will reach the Genesis Block.

In the Bitcoin software, the Genesis Block is statically encoded. So when a node will run the software, it knows the starting point, it knows the root-of-trust to run the valid Blockchain. So each node locally stores the copy of the Blockchain, all the incoming Blocks are verified with the previous Block hash and validated and added to the Blockchain.

sap102.png

Nodes and different types of Nodes in Bitcoin Network

Unlike a centralized thing, in which the top-down hierarchy exists, Blockchain ideally follows a flat topology. Means all are the same, the nodes running the Blockchain are all equal. However, their role and functionality can be different from other nodes.

The functions of the nodes can be database management, wallet services, mining in Bitcoin, routing, etc.

b10.png

A node can be categorized based on the particular function it serves or the combination of functions it serves.

Please note that all the nodes by default include the routing function, which is essential for the discovery of a new node & maintain a connection to remain in sync with the p2p network. Routing is also essential to propagate validated transactions and the blocks. Without a routing function, it is impossible to construct a p2p network.

So based on the combination of functions, it is broadly categorized into the following nodes:-

  • Full Blockchain Node
  • Bitcoin Core Client
  • SPV Node
  • Solo Mining Node
  • Pool Mining Node

Full Blockchain Node

A full Blockchain node has two functions-- routing, full up-to-date copy of the Blockchain.

b11.png

A full Blockchain node is the very early development of Bitcoin Blockchain. During the early days, all the nodes happen to be the full-blockchain-nodes. The full-blockchain-nodes later evolved into Bitcoin Core Client.

Bitcoin Core Client

Bitcoin Core Client has all the four functions-- wallet, mining, routing, full up-to-date copy of Blockchain database.

b14.png

Both Full Blockchain nodes and Bitcoin core client nodes are generally autonomous in nature in the context of verifying a transaction. Since they have a full copy of the Blockchain they don't need any external reference. However, they need more than 150 GB of disk space to store a copy of the Blockchain. It also takes a certain amount of time(3 days or more) to sync to the network.

SPV Node

SPV Node has two functions-- wallet, routing.

b12.png

It is also known as lightweight Node. The full form of SPV is Simplified Payment Verification. It does not maintain a full copy of the Blockchain, maintains only a subset of it. That is why it is not an independent node. SPV nodes use Merkel path(for transactions) and Block header(for identification of the Block and to link it to the Blockchain).

SPV nodes serve the use-case of running a wallet in resource constraint devices such as a Smartphone.

Solo Mining Node

Solo mining node has three functions-- routing, mining, full copy of Blockchain.

b13.png

Pool Mining Node

Pool Mining nodes contain Pool Mining Protocol and mining function.

Mining nodes generally compete with each other solving the cryptographic puzzle using the specialized software in the PoW mechanism. There can be a solo mining node or pool mining node. A pool mining node is an effort to optimize the computing power, pooling resources together, in which the miners join the pool to have a better probability of solving the cryptographic puzzle.

A solo mining node always keeps a full copy of the Blockchain whereas the nodes joining to pool mining node can be lightweight nodes, that all depend on the pool server they are joining in.

sap102.png

Discovery of Nodes

It is obvious that in a vast decentralized network like Bitcoin which has already spent 12 long years in this domain, many nodes will come and go. So it's a dynamic thing. However, it is very important for a node in the Bitcoin network to keep discovering new nodes for two basic reasons:-

  • If it loses the old connections then it will still be able to remain in the p2p network by discovering a new node.
  • Discovery will also help a new node to join the Bitcoin network, the existing node will help a new node in the bootstrapping process.

The bootstrapping of a new node is a process to become a successful peer in the Bitcoin network. The node which bootstraps a new node is known as the bootstrapping node and that is a part of the p2p protocol to enable a new node to become a part of the network. Once bootstrapping is done, the new node automatically connects with the other peers.

A new node finds its peers by querying the DNS server seeds (a list of IP addresses of Bitcoin nodes). The peer listens and responds to the connection request of a new node. The minimum criterion for bootstrapping is that the IP address of at least one Bitcoin node is known.

introducer-optimized-1.gif
Source

Once a new node establishes a connection to the network, it will help the other new nodes(at least one) joining the network, and this process goes on, plotting the contour of a diversified network of nodes, making it more decentralized with each new nodes joining the p2p network.

It is very important for a node to remember the most recent peer in the vast p2p network because, in the event of losing the connections from the network, it can quickly reboot to establish the connection again. However, if the most recent peer does not respond after rebooting, then the node should use the seeds to bootstrap again.

Thank you.

sap102.png

Cc:-
@steemitblog
@steemcurator01
@steemcurator02

sap102.png

Unless otherwise stated, all the images, infographics, charts, tables, etc(if any) are my original works.


The post payout is set to "Power Up 100%".

Sort:  

Giving each block the hash of the previous block is the reason why the blockchain is arranged end to end. It also makes it very difficult to attack the blockchain as the attacker will have to change so many hashes of blocks from the particular block of interest till the latest block. That's classic thinking from the inventors of bitcoin.

You did justice to the technical part of blockchain's explanation. It's right to visualize each block being on top of the previous block. That gives a precise explanation to the concept of block heights.

Nice post.
#onepercent #nigeria

Thank you.

Wow this lovely. I can't wait to read the next episode

Congratulations you are one of the winners of the Steem Crypto Challenge Month...

Thank you for taking part

The Steemit Team

Thank you so much.

Steem on.

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63267.39
ETH 2572.65
USDT 1.00
SBD 2.80