DEV Community

Cover image for Blockchain in 6 minutes
Soumya Ghosh Dastidar
Soumya Ghosh Dastidar

Posted on

Blockchain in 6 minutes

The concept of blockchain was first popularised when a mysterious person (or group) named Satoshi Nakamoto published a paper on BITCOIN. Bitcoin was the first widely accepted decentralized digital currency, also known as cryptocurrency, that could operate in a trustless network. Bitcoin itself was a remarkable innovation, but the underlying technology was the real deal, this technology was later known as Blockchain.

In the paper published by Satoshi Nakamoto, he describes how financial assets(in his case, bitcoin) can be transferred without any intermediary trust body, unlike our conventional systems. In a typical day to day transaction using the conventional system, we transfer funds through some regulatory body like a bank or, in some cases, the government itself. This method of transaction is the most common and widely accepted norm, but if we take a step back and look at the bigger picture, we will see that this method has a lot of disadvantages.

The Broken System

The transactions in the conventional system are performed under the regulations of a single body whom we have to trust blindly, this leads to the Single Point of Failure problem: if by any chance this regulatory body were to go corrupt all our transactions would have no guarantee of success or completion. Even if we consider the regulatory body to be always trustworthy, there arises another common problem: all transactions we perform and our personal data are stored in the bank servers, which can be hacked and easily tampered! Last but not least, our identity is exposed; almost all regular transactions can be easily traced back to us.

The Savior - Blockchain

The above disadvantages are just a few that I can think of, but the main point of this discussion is: how blockchains can solve these problems. So let’s dive right into the revolutionary world of Blockchains.

What is a Blockchain?

Blockchains have been generally described as a “decentralized, distributed ledger”. To put it in simple terms a blockchain can be thought of as a chain of blocks (yes, that’s exactly what the name suggests), where each block is immutable(read-only) and contains a record of transactions. We can, for now, consider these transactions to be similar to the ones made through a bank, eg. “Jack paid $50 to Jill” except that there are no names or specific identities associated with these transactions.
The blocks in the chain are created by nodes/peers participating in the blockchain network using a process called mining; these miners are rewarded with cryptocurrency for their contribution. They are considered as the pillars of a blockchain network.

Where is a Blockchain stored?

We have found an efficient way to record our transactions, but we need a place to store this blockchain so that everyone can access it. The easiest way of doing so is to host it on a server and let others access it, but this would again mean that all the data is under the control of a single authority or body which we want to avoid. The next possible solution is to store the blockchain on a distributed peer to peer network. In this design, the blockchain is stored by every single participating node/peer, hence there is no sole authority controlling the data. This distributed architecture is one of the key features of blockchains.

Why Decentralization in a Blockchain Network?

The chain of blocks and the distributed P2P network forms the distributed ledger we require, now let’s talk about decentralization and its need. To understand this, we go back to the traditional system where a single body regulates everything, for example, the bank. In this case, after a transaction is initiated all the decisions regarding it are made by the bank itself, this is an example of a centralized system. A decentralized system, on the other hand, is a system where the final decision is made after a consensus or majority agreement of all the participants. This means that any decision regarding the blockchain, like adding new blocks, validating a transaction, or deciding between two competing chains, etc. are done based on the consensus of all the nodes in the network. This removes the need for a trusted authority as trust can be established by a majority decision of all the participating nodes. Though there is a possibility where the consensus decision can be rigged by attackers if they gain a majority in the network, this is also known as the 51% Attack, but this kind of attack can be mitigated as the network becomes larger and as the blockchain grows in size.

How is the Data protected from tampering?

We already know the blockchain network operates on a consensus mechanism; this not only prevents rogue attacker nodes from making fraudulent transactions but also prevents them from tampering with the pre-existing transactions. Tamper-proofing is possible because the probability of coercing a majority vote in an extensive blockchain network like Bitcoin becomes almost zero. There are different consensus algorithms available now: Bitcoin operates on the Proof of Work consensus algorithm, while Ethereum 2.0 operates on the Proof of Stake algorithm.

How is Privacy maintained?

All users in a blockchain network have public addresses, which can be thought of as account numbers in a banking system, these can be used to transfer funds. Whenever a transaction happens, it is publicly stored in the blockchain, each transaction contains data that include the public addresses of the sender and receiver(s). Exposure of the public addresses does not imply the exposure of the identities as new public addresses can be generated to perform each transaction, which practically makes one untraceable. Unlike in traditional systems where our account numbers mostly remain constant and account creation requires Identity proofs, creating a public address in a blockchain network doesn't require anyone to divulge personal details.

How are Transactions Verified?

There is no central authority or database to store the accounting details like balance and transactions in a blockchain network. All the transactions are directly written into the blockchain which is publicly available(in most cases). The transactions can be computed to calculate the balance in an account associated with a public address and also to verify whether a new transaction is feasible by the nodes/peers. For example, let's consider two users Jack and Jill and the following transactions in a blockchain :

  1. Initial $50 -> Jack
  2. Jack $30 -> Jill
  3. Jack $40 -> Jill

In the first transaction, Jack is initially provided $50, let's say, as a reward for mining a block. Jack then transfers $30 to Jill in the second transaction, we can compute the account balances for Jack and Jill at this instance of time as :

  1. Jack : $50-$30 = $20
  2. Jill : $30

Transactions 1 and 2 were verified successfully by the nodes/peers. In the third transaction, Jack tries to send $40 to Jill, but the nodes in the network observe that Jack does not have enough funds for the transfer, and hence this transaction is never mined and gets nullified. The scenario where users try to transfer money that they have already spent, in a previous transaction, is called the Double Spending problem.

There are many other verifications and checks performed on the transactions before they are added to the blockchain, these prerequisite verifications may differ from one blockchain to another.

Closing Statement

This article was a very abstract overview of blockchain technology and how it solves the problems of our conventional systems. We discussed how we can avoid the need for a single trust body with decentralization, how data/transactions become tamper-free by placing them in immutable blocks in a distributed network, and how our privacy is maintained using untraceable public addresses in the blockchain system.

Blockchains are an area of constant research and have many applications besides its predominant use in cryptocurrency. Sectors like healthcare, agriculture, supply chain, and governance have found various use cases for blockchains. The field of blockchain is very nascent, and the consideration of 'Blockchain being the Savior' is a controversial topic, but in my opinion it is a brilliant piece of technology that deserves attention.

Top comments (7)

thorstenhirsch profile image
Thorsten Hirsch

all transactions we perform and our personal data are stored in the bank servers, which can be hacked and easily tampered!

Reality check: no retail customer has ever lost money when his bank got hacked. But bitcoins worth millions of dollars are lost due to hacked crypto exchanges, lost wallets, and mistakes.

However, I'm also a fan of the technology that the bitcoin/blockchain hype has triggered some years ago. It's interesting to see how the Ethereum developers used the concept for a distributed general purpose computer. And the concept of a tangle instead of a chain, like what the IOTA guys have implemented. Unfortunately all public projects suffer scaling issues. So far it seems that only closed ("permissioned") DLT networks can currently operate productive workloads without getting hacked. But the public networks are so much more interesting - just look at all that's happening in the world of "DeFi"!

gdsoumya profile image
Soumya Ghosh Dastidar

Ethereum is trying to scale, they are adding in a lot of updates and features, PoS is just one of the steps towards scalability and productivity. I hope it'll soon become a widely accepted norm and we'll shift from centralized applications to DApps.

Surely DeFi is the new big thing, though it still a topic of controversy considering the flaws that had been exploited recently.

kj2whe profile image
Jason • Edited

Thank you for the article, may i ask a few things about the ledger I don't understand.

  1. Doesn't it grow unwieldy the more its decentralized? You mentioned that we currently we have a regulatory body which handles our transactions, and this creates a S.P.o.F. (Single Point of Failure). Completely agree, but I'm unfamiliar with how the ledger stays synchronized between nodes. If I claim I paid you X, and you say No you didn't. Then we go to the ledger to prove it. I wonder how that dispute gets resolved, cause you can't create 'one ledger to rule them all' cause that is now a SPoF.

  2. Over time as the decentralized ledger grows and grows due to transactions being added, how are those multiple ledgers stored? My limited knowledge imagines it would eventually eat all memory space.

gdsoumya profile image
Soumya Ghosh Dastidar

It's great to know that you liked the article! I'll try my best to answer your questions:

  1. The ledger grows as the blocks are added, the full ledger is stored in all the participating nodes. When a node joins/rejoins the network it looks for peers, these peers are then used by the new node to sync. the blockchain into it's memory. Transaction disputes are resolved using the ledger as you have understood, throughout the network there can be only one proper ledger or chain (even though at some instances there could be competing chains, but that's a little more advanced topic- all you need to know is that the network will eventually converge to a single consistent chain). Because there's always one consistent chain across all nodes the transactions can be easily verified to resolve disputes.

  2. There are no "multiple" ledgers in the network, it is just one single ledger where we add in those new transactions. The ledger is synced throughout the network to maintain consistency. You are correct about the ledger or blockchain becoming too large in size, for reference the current Bitcoin chain is around 15-16GB. Nodes which participate in the network need to have enough processing power and memory.

Hope I could clear your doubts, if you still have any do comment.

kj2whe profile image

Ok thank you for the response. Just to be clear, you only have one ledger per... umm.. application? Like bitcoin. Some other blockchain application would have its own ledger correct? no sense in mixing Bitcoin transactions with {Digital_Currency_X} transactions.

Thread Thread
gdsoumya profile image
Soumya Ghosh Dastidar

Yup that's a correct way to think of it.

arkajyotimukherjee profile image
Arkajyoti Mukherjee

Nicely written 👌