To recap, last week we deep-dived into consensus and understood a bit about nodes in a blockchain network. Nodes perform various functions in a blockchain. The main goal of a node is to provide reliable data storage in the blockchain network.
At a high level, when a transaction is initiated (could be a transfer of bitcoin from person A to B), the processing nodes within the blockchain
a. take these transactions,
b. check their integrity and
c. record them on the ledger.
In addition to the above, they are also a point of communication in the blockchain network which is called the network routing function. When you open up an application, your phone or laptop connects to the server of that application which is centralized. In a blockchain, when a new node boots up, it must discover other nodes on the network in order to participate in the blockchain network. To start this process, a new node must discover at least one existing node on the network and connect to it to be part of the decentralized network.
There are different types of nodes depending on the roles they are assigned within the blockchain network. The different roles played by nodes in a blockchain network are defined by the requirements of that network. The purpose of defining different roles is to allow the network to operate in a seamless fashion as each node performs the tasks assigned. In other words, although nodes in a blockchain network are equal, they may take on different roles depending on the role assigned or functionality they are supporting.
This is similar to what happens in nature. Let us take the example of an ant colony. An ant colony is defined as the basic unit around which ants organize their lifecycle. The typical colony consists of one or more egg-laying queens, numerous sterile females (workers, soldiers) and, seasonally, many winged sexual males and females. (Source: wikipedia). Each type of ant have distinctive roles assigned to them by nature which helps to maintain the colony and keep it thriving.
Photo by Jimmy Chan from Pexels
It is to be noted that all nodes include the network routing function to participate in the blockchain network. All nodes also validate and propagate transactions & blocks (more on this later!!), & discover and maintain connection to peers.
Depending on the functions carried out, there are two major types of nodes in a blockchain :
- Full Nodes
- Light Nodes
Full Nodes
Full Nodes maintain a complete and up-to date copy of the blockchain. Since they maintain all the debits and credits from the initial or genesis transaction till the latest transaction, they do not need to refer to anyone else when checking or verifying a transaction. Full nodes can autonomously and authoritatively verify any transaction without external reference. Since Full nodes are nodes that maintain a full blockchain with all transactions, each full node can be considered as equivalent to a server in a centralized application.
Light Nodes
Some nodes maintain only a subset of the blockchain and verify transactions using a method called Simplified Payment Verification (SPV). These nodes are known as SPV Nodes or Light Nodes.
Many light nodes are designed to run on space & power constrained devices such as smartphones, tablets or embedded systems. For such devices, this method (SPV) allows them to operate without storing the full blockchain. SPV nodes download only the block headers (which we will discuss later!!) and DO NOT download the full transactions included in each block.
There are some more node classifications as given below but will get into more details at a later stage after we understand how transactions are processed in a blockchain.