← Back to list

Fundamentals of Blockchain

In this article I will briefly explain the different parts of Blockchain and go deeper into consensus mechanisms.

Kashvi Kumar · 2022-11-08 15:29 · 20 claps · 6.8 min read
#blockchain #consensus-algorithm #consensus-mechanism #cryptocurrency #crypto
Open on Medium ↗
Wiki topics: CRY · Crypto & Web3 💻 · Programming

Fundamentals of Blockchain

In this article, I will briefly explain the different parts of Blockchain and go deeper into consensus mechanisms.

Blockchain is simply a decentralized collection of information-filled blocks linked together. Decentralized means that there is no one central authority and that anyone can contribute to it. The blocks are like a record of everything happening in the blockchain. For example, In finance, this can be information about transactions like the amount of money, who is sending it, and who is receiving it. These blocks are linked together using cryptography. Blockchains are distributed ledgers, meaning everyone has an identical copy of the data. In contrast to a centralized database, a distributed ledger does not require a central administrator (bank). Although digital finance is one of the most common applications of blockchain, many applications exist outside of it.

Visual of a blockchain

Visual of a blockchain

Key Principles

Hashing

As discussed before, blocks store data in them. Once data is put in a block, you can’t change it. Each block contains data, the block’s hash, and the previous block’s hash. This way, you can’t change the order of the chain either. Anyone can add to the blockchain (adding a block), but no one can change it. This makes it nearly impossible for someone to hack into it. A hash is similar to a fingerprint. Each block has a unique hash. The first block is called the genesis block, which has data and only one hash compared to other blocks with two hashes (their hash and the hash of the block before). These hashes are created by passing the data through a hash function. The hash function used in bitcoin to generate hashes is called SHA-256.

Hashing example

Hashing example

Merkle Tree A Merkle tree is an even more complex way to encode data using hashes. It takes two hashes, passes them through the hash function, and outputs one hash. You can continue to do this multiple times to get a root hash.

Infographic of a Merkle tree

Infographic of a Merkle tree

The Blockchain Trilemma and Its Solutions

The Blockchain Trilemma The blockchain trilemma details that three things are constantly trying to be increased in a blockchain — decentralization, security, and scalability. However, if you try to improve one of these, another will worsen. For example, by making it decentralized, we are trying to have multiple people validate transactions. But this slows down the number of transactions we can do per second. But we are still trying to find solutions to keep improving the blockchain. A solution for the scalability aspect that doesn’t degrade security and decentralization is the concept of Layer two. Similarly, consensus mechanisms are a solution for the decentralization aspect that doesn’t degrade the other two aspects.

Infographic of blockchain trilemma showing that when you improve 2 sides, 1 gets worse

Infographic of blockchain trilemma showing that when you improve 2 sides, 1 gets worse

Layer Two Right now, blockchains can only do 7–15 transactions per second, while traditional backs can do about 100,000 transactions per second. People are constantly trying to increase the number of transactions per second that blockchain can do to compete with conventional finance systems. There are two options for that. You can scale the base layer or make a new layer to do some of the work. The only problem is that it is nearly impossible to scale the base layer. So, we are going with the second option. The new layer we create to do some of the work is called layer two because it is a layer we are adding that doesn’t affect the base layer.

Different Layer Two Options: The first option is Rollups. There are two different types of rollups. ZKrollups & optimistic rollups. ZKrollups are faster but can’t use smart contracts, a key feature of blockchains (I will explain further in the article). Optimistic rollups can use smart contracts but are slower. Rollups are trying to roll up multiple transactions into one, and then they can push that to the main blockchain. Another layer two option is Sidechain. This is a secondary blockchain that runs parallel to the main chain.

A type of Layer 2 solution

A type of Layer 2 solution

Mining/Consensus Mechanisms In a blockchain, creating a new block and filling it with data is called mining. Every new block added has to be validated. This is done by using consensus mechanisms. Think of this as everyone agreeing that the new block is genuine. Everybody who is part of the system can validate a new block.

A new block being mined and validated

A new block being mined and validated

There are multiple different consensus mechanisms used in blockchain. Some of the most common consensus mechanisms are Proof of Work, Proof of Weight, Proof of Stake, Proof of Authority, Byzantine Fault Tolerance, and Proof of Zero Knowledge. Many mechanisms work by having miners, or validators, solve complex math problems. I will go into a few of these mechanisms in detail.

Proof of Work: This is the first consensus mechanism that was developed. It was first created in 1993 but officially called “Proof of Work” in 1997. It went unused for a long time until Satoshi Nakamoto used it in Bitcoin. The way it works is that each block is validated by having miners solve a math problem attached to the block. Many miners race to solve the math problem first and whoever wins gets a reward in the form of cryptocurrency. Here’s an analogy to help understand better: Say a group of people find a treasure chest with a combination lock. Everyone races to figure out the combination and whoever figures it out first gets the treasure.

We’ve been using Proof of Work for a long time, so we know it works well. However, there is one problem. Proof of Work uses lots of energy. Computers usually solve the math problems. Many computers are constantly trying to solve these problems. This uses up lots of energy. Bitcoin miners alone use enough energy to power the entire country of New Zealand or Hungary. This is why many newer blockchains do not use this consensus mechanism.

Proof of Stake: Proof of Stake also works on the basis of solving a math problem attached to a block. However, the person solving it is chosen rather than people competing to solve the problem. A validator is randomly chosen based on how much stake they put up. Let’s look at an example. You become the validator based on a lottery system. The more lottery tickets you buy, the higher your chance of becoming a validator. Examples of cryptocurrencies that use Proof of Stake are EOS & Cardano Ouroboros.

Proof of authority: Proof of Authority is a modified version of Proof of Stake. The only difference is that only approved parties, selected based on their reputation, can become validators. A downside of this is that it goes against one of the blockchains’ most significant points, which is to be decentralized. By choosing someone based on reputation, the blockchain will become more centralized. Examples of cryptocurrencies that use Proof of Authority are IBM’s Hyperledger & Ethereum’s Kovan Testnet.

Proof of Zero Knowledge: It is a way to prove something without revealing what we are proving. Here’s an example of the different colored balls tests: Let’s say you have a colorblind friend who wants to know if two balls are different colors. You can prove that the balls are different without saying what color the balls are. A Zero Knowledge Proof doesn’t prove something 100%. However, it decreases the possibility that it isn’t true. There are two types of this proof: interactive and non-interactive. The colored balls test is interactive. In interactive, you must perform a series of actions with someone else to prove it. While in non-interactive, someone can prove it by themself. A downside of the interactive option is that it is limited transferability. The process of proving something isn’t easily repeatable. We have to use a non-interactive method for blockchains because everyone has to prove a new block. An example of a non-interactive method is called zk-SNARKS.

Applications

DeFi DeFi stands for decentralized finance. This is the most prominent application of blockchain currently. It is a new financial system that is open to everyone and doesn’t require you to trust an intermediary like a bank. DeFi can help low-income bankless communities. There are multiple currencies in DeFi. These currencies are called cryptocurrencies/ The most common example is bitcoin. Ethereum is a DeFi blockchain that mainly uses the cryptocurrency called Ether. A stablecoin is a currency that is fixed to a “stable” physical asset like the U.S. dollar or gold.

NFTs NFT stands for non-fungible tokens. Non-fungible means each one is different from the others. These are non-interchangeable tokens. The properties of each NFT are stored in its metadata. NFTs are proven to be rare in quantity. This means that there are only a few of each NFT. NFTs are indivisible. Meaning that you can’t buy or sell part of an NFT. Some other characteristics of NFTs are as follows. They are transferable and fraud-proof, and they guarantee ownership of an asset.

Smart Contracts A smart contract, or a distributed app, is a digital contract without a third party/central authority. They work exactly like contracts in real life. It is immutable (meaning the code can’t be changed once it is written) and distributive (meaning that it is validated by people that are part of the blockchain).

I hope you now have a better understanding of some basics of blockchain and how consensus mechanisms work.


메타데이터
post_id
fdc4fead99c7
slug
blockchain-basics-and-consensus-mechanisms-fdc4fead99c7
url
https://medium.com/@kashvi08/blockchain-basics-and-consensus-mechanisms-fdc4fead99c7
canonical_url
https://medium.com/@kashvi08/blockchain-basics-and-consensus-mechanisms-fdc4fead99c7
author_url
https://medium.com/@kashvi08
status
ok
fetched_at
2026-06-29 22:44:20