Blockchain Nodes and their types

A node is a computer that runs blockchain software and helps transmit the information across the blockchain network. Laptop, phone, router, etc., are all nodes. Anyone can download blockchain software and run it for free. Nodes are classified into different types based on their role in the blockchain.

Once a transaction is created, the node in which transaction originated sends the information to all the nodes that it knows and those nodes will in-turn send the information to all the nodes they know thereby sharing the data with all the nodes in the blockchain network rather quickly. The blockchain data is stored in the nodes in a flat file or in a database.

Who can add transactions to blockchain?

Every node has an option to "mine" and add transactions to a blockchain. But why would the nodes want to mine transactions? What's in it for them to do this work? It is because the miners get rewarded for successfully adding transactions to blockchain.

Because of numerous mining nodes competing against each other for the reward, blockchain must have a solid method for selection of a mining node that adds transactions to the blockchain. Bitcoin blockchain software provides a mathematical puzzle to all the miners and the node that succeeds in solving this puzzle gets to add the block to the blockchain and with the reward.

How can a miner solve the puzzle?

As illustrated in the picture below, a block in a blockchain has the following key components: header, data, nonce, previous hash, and hash. Data is a set of transactions, hash is a unique identifier for a block and is analogous to a fingerprint for a human, previous hash is the hash value of the previous block in the blockchain, nonce, and header has the details such as block number, timestamp, etc.

Nonce is the only field in a blockchain that can be changed by a miner. All the data fields in a block except nonce are predetermined and cannot be altered.