Note: This blog post is meant for beginners. If you have experience with web3 and blockchain, you might not find this as useful, but I encourage you to maybe stick around anyway.
Hello again, and welcome to Part 2 of our Blockchain series. If you haven’t read Part 1 yet, you can find it here: BEYOND BITCOIN – BLOCKCHAIN [PART #1].
I have always been fascinated by the world of open source and collaboration, and I have written about it in my blog post Security & Open Source. I believe blockchain is one of the most fascinating pieces of technology that has emerged from the world of open source. In this blogpost we are going to talk about the components of a blockchain and its working.

Let’s just start from scratch 👾
What is a Hash?
Each block in a blockchain contains a unique set of data, identified by a cryptographic signature called a hash.
A hash algorithm is a function that converts input data of any size into a fixed-size string of characters, which typically represents the data uniquely. For instance, the SHA-256 algorithm is widely used in blockchain technologies to ensure data integrity and security.
If you are new to security and don’t know about hash then below is a below good example to see hashing in action. You can head over to SHA256 Hash and enter any string and you will see a SHA256 hash for it. it is one of the Cryptographic hash algorithms among many that can be used to encrypt the data.
It uniquely represents the data and changes if the data is altered in any way. As you can try changing any alphabet and the whole hash will change and it would always be unique but there is also something called hash collisions 👀 but thats a discussion for another day.

What is a Block?
A block is a container data structure primarily consisting of three elements: a nonce (a random number used to get a desired hash), transaction data, and a hash. When mining a new block, miners modify the nonce to achieve a hash that meets the network’s requirements, which often starts with a series of zeros (0000)
For this demo, you can head to the Block and can see that the hash currently starts with 0000.

When the data is changed, the block will turn red, indicating that the data has been modified

What is Mining?
Mining involves solving a cryptographic puzzle, essentially finding a nonce that results in a hash with a specific number of leading zeros. This process secures the network and verifies transactions.
In the above example, clicking the “Mine” button will calculate a nonce that makes the hash start with 0000, effectively solving the problem. This basic example shows the mining process, but actual cryptographic puzzles miners solve are much more complex than this example.

Bitcoin uses a proof-of-work system where miners solve complex problems. Ethereum has transitioned to a proof-of-stake system where validators stake their cryptocurrency as a form of security.
What is Blockchain?
Imagine it as a chain of blocks, where each block holds batches of data(transactions). These blocks are linked to one another in a chronological order, creating a chain.
You can head over to Blockchain Demo to see how a blockchain looks like. You can see each block is named in sequencial order and you can see along with block, nonce, data and hash this hash a Prev hash field as well which includes hash of the last block.

Now changing the data of any block will result break the validity of all blocks that follow, making it necessary to recalculate the hashes and the revalidation of the entire chain.

Distributed Nature of Blockchain
A blockchain operates across a distributed network of nodes, each holding a copy of the entire blockchain. This decentralization ensures no single point of failure can corrupt or disable the system.
What is a Node?
A node is a computer connected to the blockchain network that uses its resources to verify and relay transactions and maintain a copy of the full ledger. Nodes play a crucial role in enforcing the network’s rules and security.
Each node in the network verifies the transactions independently, making the blockchain exceptionally secure against fraud and manipulation.
As you can see in the above example the Node B acted maliciously by altered the data of block 2. When this happens it changes the block’s hash code, which is a unique identifier derived from the block’s data. Since each block’s hash is linked to the previous one, changing any block disrupts the entire chain from that point forward on that node. The hash mismatch makes it evident that some data was altered.

If one node changes a block’s data, other nodes in the network will detect this because their copies of the blockchain will show a different, correct hash for the altered block. These other nodes will reject the altered block and continue using the valid version of the blockchain. This self-checking mechanism across multiple nodes ensures the integrity and security of the entire blockchain system.
If the Node B tries to re-mines all subsequent blocks, it could technically create a correct version of the blockchain. However, this process requires a lot of computational power and is not feasible for most individual nodes. Even if it is done, this new version must be accepted by the majority of the network’s nodes. Most blockchains follow the rule that the longest chain, which has the most computational effort invested in it, is considered the legitimate one. If other nodes do not accept this altered chain, the effort and resources spent in re-mining would be wasted.
What is a consensus mechanism?
A consensus mechanism is a system used in blockchain networks to achieve agreement on the ledger’s state. It ensures all transactions are valid and that all nodes maintain a consistent ledger. Common types include Proof of Work (PoW), where miners solve complex mathematical puzzles to validate transactions, and Proof of Stake (PoS), where validators stake their cryptocurrency to earn the right to validate and add new transactions.
What is a transaction?
A transaction in blockchain is a record of an asset transfer between parties, securely verified and stored within a block on the blockchain. We are going to discuss this in our next blog.
Blockchain Transactions Demo
You can head over to Coinbase Transactions, you will see a Demo Coinbase transactions across multiple nodes each maintaining a copy of transactions on the blockchain similar to a real blockchain.

These transactions involve a transfer from coinbase account to the user’s account, details such as the block number, nonce, transaction details, and the resulting hash.
Similarly to what we discussed earlier changing the value of transition amounts will result break the validity of all blocks that follow.
In the next blogpost we are going to make our first transaction on a blockchain.