Demystifying the blockchain concept – In simple English13 min read

In recent years, the concept of cryptocurrency and blockchain become more and more prevalent. Everyone may have heard about a cryptocurrency named Bitcoin or something like blockchain. With your curiosity, you might have searched some terms such as What is bitcoin and how does bitcoin actually work. As a result, you find out a jargon likes Bitcoin is a decentralized digital currency and it works without a bank system, there is no need for intermediate parties to operate transactions and there is no one or entity owns bitcoin as a matter of the fact that it works based on peer-to-peer protocol. Ahh, you start feeling perplexed, if there is no bank or intermediate third party so how bitcoin transactions operate, and is it safe to do so?

The answer to this question is all about the underlying technology of this digital currency, which is blockchain. If you understand what is a blockchain and how does it work, you will understand the heart of bitcoin and many other cryptocurrencies. 

As a reader, I know your time is precious and I will try my best to demystify the blockchain concept in the simplest way as possible. At the end of the article, there is no esoteric jargon and you will equip yourself with a fundamental understanding of what is blockchain and its relationship with many cryptocurrencies including Bitcoin.

First off, what is a blockchain?

From Wikipedia, Blockchain was invented by a person (or group of people) using the name Satoshi Nakamoto in 2008 to serve as the public transaction ledger of the cryptocurrency bitcoin

As the name it indicates, a blockchain is a “chain” of blocks, each block typically holds some data such as information about a transaction, the unique hash of this block and the hash of the previous block. It represents a sequence of immutable records that you cannot break in the middle and you just can append new blocks into it at the end in the chronological order. Each block contains the hash of the previous block, hence the name “blockchain”. 

To make each block secure and connect, a superior hash function should be implemented which is impossible to tamper with and reverse engineering. Typically, the SHA-256 hash function is used to compute the hash of a block. A hash of a block is a combination of all fields in this block, which includes a timestamp, the id of the block, data of the block, and the hash of the previous block. If you try to change some information on a block, then the hash of this function will completely be changed, then the previous block on the next block will also be changed, this happens until the end of the block. With this property, we can easily detect whether the blockchain has been modified and discern a block is valid or invalid. 

Because the first block in the blockchain has no previous block, its hash of the previous block is usually 0 and this first block in a blockchain is called “a genesis block“. For now, let’s examine how a typical blockchain looks like:

Block:
Id: 1
Timestamp: 1600217999961
Transaction: {
	from: 'userA',
        to: 'userB'
        amount: '0.5 BTC'
}
Hash of the previous block: 
0
Hash of the block: 
924d79cb0be5fef34368080a86353b9583fbdc158fb18403e8437266db270c94

Block:
Id: 2
Timestamp: 1600217999961
Transaction: {
from: 'userC',
to: 'userD'
amount: '0.00023 BTC'
}
Hash of the previous block: 
924d79cb0be5fef34368080a86353b9583fbdc158fb18403e8437266db270c94
Hash of the block: 
5ca78669e9ff97b4d03a11d34bfc1bdc7cf2a3c4218ffdc70f0bae1b221c50da

Block:
Id: 3
Time stamp: 1600217999961
Transaction: {
from: 'userE',
to: 'userF'
amount: '0.0001 BTC'
}
Hash of the previous block: 
5ca78669e9ff97b4d03a11d34bfc1bdc7cf2a3c4218ffdc70f0bae1b221c50da
Hash of the block: 
b80750afe9bfcb5b68d7187a8f9dbd5562036be416daa074569f96817c9c2517

As we can see, for each block in a blockchain, each block contains its own data and the hash of the previous block. If we change the hash of a block, for example, block 2, then block 3 also has to update the new hash block of its previous block. 

For a more precise look on how a typical bitcoin transaction is constructed by using blockchain, check out this link.

How it works if there is no one to manage it?

As aforementioned, blockchain is a chain of networks that has no fiat intermediary. Blockchain uses a peer-to-peer network, digital assets like bitcoin, music, etc… are distributed across the global ledger. Everyone is welcomed to join and once a person joins the network, he gets the full copy of blockchain about all data such as transactions. Once a transaction has been made and verified, it is now broadcasted to every computer in the network.

Here you can take a look at the Bitcoin’s blockchain, this is publicly available for anyone to view if you click on a block, you can get the transaction data, timestamp, and some other information. As you can see, the number of transactions per hour is pretty humble, typically with bitcoin’s transaction, there is only one transaction can be carried out in every 10 minutes. Why blockchain has to do so and what if a hacker tries to manipulate a block for fraudulent activities, what would happen, let’s find out right below.

Transactions using blockchain

How blockchain is secured and the concept of a “proof-of-work”

There is one classic and strenuous problem with cryptographers and many cryptocurrencies which is the “double-spending” problem. “Double-spending” means that a digital currency can be sent more than once. For example, I have sent to you 0.0005 Bitcoin and I can use this bitcoin again and send it back to myself or to someone else. If this problem usually occurs, it leads to inflation in the digital currency and makes this digital currency becomes radically worthless. How can blockchain be applied and solve this problem?

Hashing isn’t enough to tackle the “double spending” problem. Let’s presume I’d want to manipulate a block for illicit profiteering, then the hash of this block will be changed, and the hash of every following block would be invalid. To make those following blocks valid again, I need to recalculate all the hashes of all the following blocks to avoid any suspicion. This might seem tricky to do but it’s not impossible to do so, nowaday a computer can calculate a million hashes per second. If the process of creating a new block is slower than mutating the existing ones, I can effectively tamper with a block and recalculate all the hashes of the following blocks then there is no abnormality. 

To circumvent this from happening, blockchain has a mechanism called a “proof-of-work“. In this mechanism, the time to create a new block or fixing the existing ones will never be instant, but instead, a computer must “prove” that it has solved a complex computational math problem, after a computer finds a “proof-of-work”, it broadcasts the block to everyone. In bitcoin’s case, this mechanism requires approximately 10 minutes to create a new transaction – meaning a new block. If a computer can solve this problem on a block, then this block is eligible to add to the blockchain.

But it’s not so easy to solve this problem, for example, you need fo find out the hash with the first 30 bits are zeroes, because the SHA-256 hash function is applied, there is no alternative way to find out that number rather than guessing. To make it possible to generate a hash with the first 30 bits are zeros, Bitcoin uses an algorithm called “Hashcash” to calculate the hash of the block. The chance of finding a hash with the first 30 bits are zeros is 1/2^30 ~ 1/1 billion, the probability would drop exponentially if we added more zero bits. If a person wants to modify the hash of a block with first 30 bits are zeros, he needs to go through one billion possibilities for finding out this number unless he’s lucky, then he also needs to pass through 1 billion possibilities on the next block until the end to make this blockchain valid.

In bitcoin’s case, the procedure of finding a hash and adding this block to the blockchain is called “mining“, and those computers help to validate transactions are called “miners“. Because it is really challenging to solve this complex math problem and the chance to solve this problem on Bitcoin’s network is about 1/15 trillion, which means a computer has to put a lot of computational power and energy to accomplish that. To incentivize this endeavor, the first computer successfully verifies a transaction is rewarded with some bitcoins, and it also happens with the most other cryptocurrencies. Check out this link to see how enormous a typical Bitcoin miner looks like.

Again, a “proof-of-work” is a secure mechanism for verifying new blocks. If an attacker tries to “double-spending” by changing the transactions and modifying the hash, he needs to redo all the “proof-of-work” of the latter blocks and then try to catch up with and surpass the work of the honest miners, the time required would become exponentially by the number of blocks added to this blockchain. For people who just want to use blockchain to make payments, they just listen to the blocks being broadcasted and update this into their blockchain. In case there are 2 or more different copies of the same blockchain, which means there is the only one valid and all others have been tampered with, there is a blockchain’s process called “consensus” which eliminates the existence of multiple blocks and all users participate in and reach the “consensus” and take the longest chain available.  

For example, if you’re listening to the miners and an attacker is hacking a block, he finds out a proof-of-work before any miners and this can definitely happen, but again, he also needs to change all the hashes of the next blocks, at the same time, honest miners are working on a different track, they keep adding new blocks to the blockchain and make this block longer than the attacker’s blocks, once one blockchain is outnumbered to the other, you can safely choose the longer one.

In theory, an attacker still can tamper with a block and make this blockchain valid again if he has 51% the power of all the computers in the network and this setting is called “51% attack“. By controlling more than 50% of computer power, the attacker can double-spending by recalculating the hash of this block, then there is over 50% chance that he can successfully modify the hashes of the subsequent blocks.

Why you should use blockchain?

To establish trust, traditionally for a long time we need to rely on large intermediaries like banks, governments, or credit card companies to make a transaction. However, by addressing the “double-spending” problem, there are many reasons to use blockchain instead of the traditional ones. 

Intermediaries are centralized, but the blockchain isn’t

Blockchain is decentralized, which means everyone has their own copy version of the blockchain, and blockchain is secured. However, intermediaries such as banks become more and more vulnerable and increasingly being targeted by hackers.

Intermediaries slow things down, but the blockchain doesn’t

If you make a transaction in a bank, typically you have to wait for a day or even a week to settle the transaction, but if you use blockchain, for example, you’d want to send the remittance to relatives, all the procedure performed quickly in a few minutes. 

Blockchain diminishes the cost

Blockchain can be applied to minimize the cost per transaction, usually, you don’t have to pay anything for making a transaction with blockchain, but the problem arises with traditional systems when you need to add some fee by doing so.

Blockchain doesn’t capture your data

Your privacy can be undermined when the intermediaries such as a bank or government when they keep capturing all of your information when doing a transaction, even though every transaction in the blockchain is distributed globally, but there just are some limited information for each block such as id, transaction id, time, and height, your personal information is stayed secured and isn’t exposed to the world.

Blockchain and “smart contract” concept

Blockchain empowers a protocol named “smart contract”, where the verification and negotiation are directly performed and enforced without a third party. A transaction with a “smart contract” is trackable and irreversible, it provides the security outperformed the traditional systems and reduce the transaction costs.

There are many superior reasons why using blockchain which have listed above, but there are a few disadvantages of using blockchain

Summary

Blockchain is the underlying technology for cryptocurrencies such as Bitcoin and it likely to have a great impact in the next few decades. Remember, Bitcoin is a cryptocurrency and blockchain is the technology this currency use. No one there needs to manage blockchain because it’s highly distributed to everyone by the peer-to-peer protocol. It is constructed by immutable records called “blocks” and each block is linked to the others by containing the hash of this block and the previous block. When a new block is verified and added to the blockchain, this block is broadcasted to everyone in the network and each person will have their own copy of this blockchain. Many mechanisms make blockchain secured and one of them is the concept of a “proof-of-work”. In bitcoin’s case, the time to create a new block – a transaction is about 10 minutes. A computer or a “miner” need to solve a complex computational problem for verifying a block and if it reaches the consensus, this block will be added to the blockchain. There are numerous reasons for using blockchain as aforementioned, but there are still some reasons why you might not use blockchain.

P/s: I’m a novice to the blockchain, if there are some concepts in this article you feel misleading, wrong, or something that makes you confused, please consider to give me a comment and tell me the problem I’m having in this article. One article isn’t adequate to cover all blockchain’s corners, there are still many vital concepts that I haven’t mentioned, you’re still feeling interested in blockchain, you should read some supplement and further documents to learn more about this technology.

Previous Article
Next Article
Every support is much appreciated ❤️

Buy Me a Coffee