A gentle introduction to blockchain
Published: 2023-03-20 03:00:23

---
title: A gentle introduction to blockchain
published: true
date: 2023-03-19 23:39:21 UTC
tags: 
canonical_url: https://dataroots.io/research/contributions/a-gentle-introduction-to-blockchain
---

 **People often see blockchain technology as black boxes that might make them money. While this might be true, they are also technologically intriguing and are worth taking the time to understand how they function. In a nutshell, a blockchain is a decentralised, distributed ledger used to record transactions across a network of computers. It provides a secure, transparent way to record and verify transactions without requiring a central authority or middleman. This article will explore how the blockchain works, from key concepts such as blocks, and transactions to the proof-of-work algorithm. The purpose of this article is to present these concepts as clearly as possible without going too much into technical details. However, this article covers only the proof-of-work consensus algorithm. Other articles will explore additional consensus mechanisms.**

At its most basic level, the blockchain is a series of blocks linked together to form a chain. Each block contains a list of transactions that have been validated by the network and added to the blockchain. The blocks connect in a specific order, with each block containing a reference to the previous block in the chain.

![](https://dataroots.ghost.io/content/images/2023/02/basic-chain.drawio.png)
_A rudimentary chain of blocks, each referencing its previous block._

When a new transaction is made on the blockchain, it is broadcasted to the network and collected into a block. The network then validates the block, which consists of a group of computers known as nodes or miners. Each node in the network has a copy of the blockchain, and they work together to validate transactions and add new blocks to the chain.

![https://www.craiyon.com/](https://dataroots.ghost.io/content/images/2023/02/craiyon_173630_illustration_of_a_network_of_interconnected_nodes.png)
_craiyon.com representation of an interconnected network of nodes._

Typically, each block can only contain up to a certain amount of transactions. For example, Bitcoin blocks can only have 1 MB of information, which is about 2000 transactions. With a current rate of one block of transactions every 10 min, the Bitcoin blockchain can process three transactions per second (before the [segwit update](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki?ref=dataroots)). When a large number of users try to submit new transactions simultaneously, it results in problems related to scalability. Now, this article will not go into the details of the [scalability trilemma](https://www.ledger.com/academy/what-is-the-blockchain-trilemma?ref=dataroots), but it is difficult to increase the performance of a blockchain without impacting the decentralization or the security aspect of it.

[![Scalability/Blockchain Trilemma](https://www.researchgate.net/profile/Enis-Karaarslan/publication/347444005/figure/fig5/AS:970006812708873@1608279054946/Scalability-Blockchain-Trilemma.png)](https://www.researchgate.net/figure/Scalability-Blockchain-Trilemma_fig5_347444005?ref=dataroots)
_Data Storage in the Decentralized World: Blockchain and Derivatives - Scientific Figure on ResearchGate. Available from: https://www.researchgate.net/figure/Scalability-Blockchain-Trilemma_fig5_347444005 [accessed 28 Feb, 2023]_

One of the key components of the blockchain is the consensus algorithm, which ensures the security and integrity of the network. This article only covers the proof-of-work consensus algorithm, which involves solving a _complex_ mathematical puzzle to add a block to the chain. The puzzle requires a significant amount of computing power to solve, and it serves as a way to ensure that the blockchain only adds legitimate transactions. More and more blockchains are moving towards other algorithms like proof-of-stake or proof-of-authority, which don't require as many resources as the proof-of-work algorithm.

The concept of nonce constitutes the basis of the _work_ in the proof-of-work. A nonce is a random number added to the block data before producing a hash value. The hash value is a fixed-size string of characters generated by applying a mathematical function to the block data and the nonce. For the block to be considered valid, the hash value must meet a set of requirements, [such as having a certain number of leading zeros](https://www.investopedia.com/terms/p/proof-work.asp?ref=dataroots). This video snippet starting at 2'18'' illustrates the concept very well:

<iframe width="200" height="113" src="https://www.youtube.com/embed/_160oMzblY8?start=138&amp;feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen title="Blockchain 101 - A Visual Demo"></iframe>

Because the data in the block is fixed, the only way to produce a valid hash value is to try different nonce values and see if the resulting hash meets the requirements. This process can be computationally intensive and requires a significant amount of computing power to solve. Once a miner finds a valid nonce and generates the correct hash, they can broadcast the puzzle's solution to the network, and the other miners can verify it relatively quickly.

The use of the proof-of-work algorithm in the blockchain serves several purposes. It makes it difficult for an attacker to manipulate the blockchain because they would need to be able to solve the hash puzzle consistently to add fraudulent blocks to the chain. This process is also called the [51% attack](https://www.investopedia.com/terms/1/51-attack.asp?ref=dataroots). It also ensures that only the first miner to find a solution can add a block to the blockchain, preventing double-spending and other forms of fraud. Finally, it serves as a way to distribute new units of the cryptocurrency, as miners are rewarded for their efforts with a certain number of units for each block they add to the chain.

One of the main advantages of the blockchain is its transparency and immutability. Once the blockchain adds a transaction, it cannot be altered or deleted. This provides a high level of security and eliminates the need for a trusted intermediary, such as a bank or government, to oversee transactions.

To ensure the security of users on the blockchain, many cryptocurrencies use a system of public and private keys to protect user assets. A public key is a unique identifier visible to other users on the network, while a private key is a secret code used to access the user's digital assets and sign transactions. This ensures that only the owner of the private key can access and control their assets.

The benefit of [public and private keys](https://www.gemini.com/cryptopedia/public-private-keys-cryptography?ref=dataroots) is to help protect user privacy on the blockchain, but it also means that users must be careful to keep their private keys secure. If a user's private key is lost or stolen, they can lose access to their digital assets forever.

![](https://dataroots.ghost.io/content/images/2023/02/authentication-block.jpeg)
_Illustration of the usage of a private and public key. Available from: https://www.tutorialspoint.com/blockchain/blockchain_public_key_cryptography.htm [accessed 28 Feb, 2023]_

In addition to cryptocurrencies, the blockchain has many other potential applications, including supply chain management, voting systems, and digital identity management. The transparent and secure nature of the blockchain makes it well-suited for any application that requires trusted transactions or data storage.

Despite its many benefits, the blockchain is not without its challenges. The proof-of-work algorithm, while effective at securing the network, consumes a significant amount of energy, which has led to concerns about its environmental impact. Moreover, the blockchain trilemma is still an unsolved issue. In response, many developers are exploring alternative consensus mechanisms, such as proof-of-stake, that are less energy-intensive.

Overall, the blockchain is a powerful technology with the potential to transform the way we think about digital transactions and data storage. By using a decentralised, distributed ledger to record and verify transactions, the blockchain provides a level of security and transparency that is unmatched by traditional systems. As the technology continues to evolve, we can expect to see more industries and applications adopt the blockchain, driving innovation and creating new opportunities for businesses and individuals alike.

Thanks for reading this bit. I hope you enjoyed it as much as I enjoyed writing it!