Everything You Need To Know About Blockchain Technology

Hasnain
12 min readMar 5, 2021

Ever wondered if there’s an easier way to complete transactions without having to deal with online wallets, banks, and third-party applications. Well there is, today we’ll take an extensive look into the blockchain, how it works and everything there is to know about blockchain.

For the non-technical folks, who are not really familiar with the terms cryptographic signatures, smart contracts, transactions, asset, and consensus, here’s a really popular example used to describe these terms by Kim Kulp.

Imagine a school lunch table with a bunch of kids sitting at it. Two kids want to trade lunches. Kid A says: ‘I’ll trade you lunch if you have a cookie’ to Kid B. Kid B states that he does have a cookie and the two trade lunch. As the kid's trade lunches, the Principal comes over and asks: ‘What’s going on here.’ At which point all the kids at the table speak up and say Kid A traded lunch with Kid B.

This simple story outlines the basics of blockchain. Kid A and B are ‘participants,’ also known as actors, in the blockchain. Lunch is an asset. Trading lunch is the transaction. Whether Kid A’s lunch contains a cookie is a smart contract. Finally, the Principal’s review is the consensus to approve/validate the transaction.

In a nutshell, Blockchain is the process of participants engaging in transactions around assets. The consensus is used to validate the transaction and smart contracts are used to set parameters around the transaction.”

What is Blockchain?

Blockchain can be defined as a chain of blocks that contains information. The technique is intended to timestamp digital documents so that it’s not possible to backdate them or temper them. The purpose of blockchain is to solve the double records problem without the need for a central server.

The blockchain is used for the secure transfer of items like money, property, contracts, etc. without requiring a third-party intermediary like a bank or government. Once data is recorded inside a blockchain, it is very difficult to change it.

The blockchain is a software protocol (like SMTP is for email). It consists of several pieces: a database, software application, some connected computers, etc.

What is Blockchain Technology?

Blockchain, which began to emerge as a real-world technology option in 2016 and 2017, is poised to change IT in much the same way as open-source software did a quarter-century ago. And in the same way, Linux took more than a decade to become a cornerstone in modern application development, Blockchain will likely take years to become a lower cost, more efficient way to share information and data between open and private business networks.

Blockchain, sometimes referred to as Distributed Ledger Technology (DLT), makes the history of any digital asset unalterable and transparent through the use of decentralization and cryptographic hashing.

A simple analogy for understanding blockchain technology is a Google Doc. When we create a document and share it with a group of people, the document is distributed instead of copied or transferred. This creates a decentralized distribution chain that gives everyone access to the doc is being recorded in real-time, making changes completely transparent.

Of course, blockchain is more complicated than a Google Doc, but the analogy is apt because it illustrates three critical ideas of the technology:

Blockchain is an especially promising and revolutionary technology because it helps reduce risk, stamps out fraud, and brings transparency in a scalable way for myriad uses.

The whole point of using a blockchain is to let people — in particular, people who don’t trust one another — share valuable data in a secure, tamper-proof way.

o the document at the same time. No one is locked out awaiting changes from another party, while all modification

How Does Blockchain Works?

Blockchain consists of three important concepts: blocks, nodes, and miners.

Blocks:

Since a block in every chain contains information, so the data which is stored inside a block depends on the type of blockchain. The first block in the chain is called the Genesis block. Each new block in the chain is linked to the previous block.

Here’s an example of a Bitcoin Block which contains information about the sender, receiver, and the number of bitcoins to be transferred.

The block also consists of two other basic elements :

  • A 32-bit whole number called a nonce. The nonce is randomly generated when a block is created, which then generates a block header hash.
  • The hash is a 256-bit number wedded to the nonce. It must start with a huge number of zeroes (i.e., be extremely small).

Miners:

Miners create new blocks on the chain through a process called mining.

Since in a blockchain, every block has its own unique nonce and hash, but also references the hash of the previous block in the chain, so mining a block isn’t easy, especially on large chains.

Miners use special software like CGMiner, BFGMiner to solve the incredibly complex math problem of finding a nonce that generates an accepted hash. Because the nonce is only 32 bits and the hash is 256, there are roughly four billion possible nonce-hash combinations that must be mined before the right one is found. When that happens miners are said to have found the “golden nonce” and their block is added to the chain.

Making a change to any block earlier in the chain requires re-mining not just the block with the change, but all of the blocks that come after. This is why it’s extremely difficult to manipulate blockchain technology. Think of it as “safety in math” since finding golden nonces requires an enormous amount of time and computing power.

When a block is successfully mined, the change is accepted by all of the nodes on the network and the miner is rewarded financially.

Nodes:

One of the most important concepts in blockchain technology is decentralization i-e no one computer or organization can own the chain. Instead, it is a distributed ledger via the nodes connected to the chain. Nodes can be any kind of electronic device that maintains copies of the blockchain and keeps the network functioning.

Every node has its own copy of the blockchain and the network must algorithmically approve any newly mined block for the chain to be updated, trusted and verified. Since blockchains are transparent, every action in the ledger can be easily checked and viewed. Each participant is given a unique alphanumeric identification number that shows their transactions.

Combining public information with a system of checks-and-balances helps the blockchain maintain the integrity and creates trust among users. Essentially, blockchains can be thought of as the scalability of trust via technology.

What Makes Blockchains So Secure?

Blockchains are secured through a variety of mechanisms that include advanced cryptographic techniques and mathematical models of behavior and decision-making.

Blockchains rely heavily on cryptography to achieve their data security. In this context, the so-called cryptographic hashing functions are of fundamental importance.

However, blockchain security is far from being a simple subject. Therefore, it is important to understand the basic concepts and mechanisms that grant robust protection to these innovative systems.

Understanding the Hash — SHA256

By this point, you might have concluded that a hash is an essential part of the block, which makes it an important aspect of blockchain. A hash can be understood as a fingerprint that is unique to each block. It identifies a block and all of its contents, and it’s always unique, just like a fingerprint. So once a block is created, any change inside the block will cause the hash to change.

Therefore, the hash is very useful when you want to detect changes to intersections. If the fingerprint of a block changes, it does not remain the same block.

Since we have already established that a block consists of Data, Hash, and Hash of the previous block, let’s take a closer look at these parts.

Consider that we have a chain of 3 blocks. The 1st block has no predecessor. So, it does not contain the previous block. Block 2 contains a hash of block 1. While block 3 contains the Hash of block 2.

This technique of blocks containing hashes of the previous blocks is what actually makes blockchains so secure. Here’s why.

Assume an attacker is able to change the data present in Block 2. Correspondingly, the Hash of the Block also changes. But, Block 3 still contains the old Hash of Block 2. This makes Block 3, and all succeeding blocks invalid as they do not have the correct hash of the previous block.

Therefore, changing a single block is really risky and can quickly render all the following blocks invalid.

Proof of Work

Hashes are an excellent mechanism to prevent tampering with blocks but high-speed modern days computers can calculate hundreds of thousands of hashes per second. In a matter of a few minutes, an attacker can tamper with a block, and then recalculate all the hashes of other blocks to make the blockchain valid again.

To avoid the issue, blockchains use the concept of Proof-of-Work. It is a mechanism that slows down the creation of the new blocks.

Proof-of-work is a necessary part of adding new blocks to the Bitcoin blockchain. Blocks are summoned to live by miners, the players in the ecosystem who execute proof-of-work. A new block is accepted by the network each time a miner comes up with a new winning proof-of-work, which happens roughly every 10 minutes.

Finding the winning proof-of-work is so difficult the only way to provide the proof-of-work miners need to win bitcoin with expensive, specialized computers. Miners will earn bitcoin if they guess a matching computation. The more computations they churn out, the more bitcoin they are likely to earn.

In the case of Bitcoin, it also takes almost 10 minutes to calculate the required proof-of-work to add a new block to the chain. Considering our example, if a hacker would to change data in Block 2, he would need to perform proof of work (which would take 10 minutes) and only then make changes in Block 3 and all the succeeding blocks.

Distributed P2P Network

There is one more method that is used by blockchains to secure themselves, and that’s by being distributed. Instead of using a central entity to manage the chain, Blockchains use a distributed peer-peer network, and everyone is allowed to join. When someone enters this network, he will get a full copy of the blockchain. Each computer is called a node.

When any user creates a new block. This new block is sent to all the users on the network. Each node needs to verify the block to make sure that it hasn’t been altered. After complete checking, each node adds this block to their blockchain.

All these nodes in this network create a consensus. They agree about what blocks are valid and which are not. Nodes in the network will reject blocks that are tampered with.

How Blockchain Transaction Works?

  • Some person requests a transaction. The transaction could involve cryptocurrency, contracts, records, or other information.
  • The requested transaction is broadcasted to a P2P network with the help of nodes.
  • The network of nodes validates the transaction and the user’s status with the help of known algorithms.
  • Once the transaction is complete the new block is then added to the existing blockchain. In such a way that is permanent and unalterable.

Blockchain vs. Banks — Are Bitcoins Better Than Banks?

For the purpose of understanding blockchain versus banking systems, it is instructive to view it in the context of how it has been implemented by Bitcoin. Like a database, Bitcoin needs a collection of computers to store its blockchain. For Bitcoin, this blockchain is just a specific type of database that stores every Bitcoin transaction ever made. In Bitcoin’s case, and unlike most databases, these computers are not all under one roof, and each computer or group of computers is operated by a unique individual or group of individuals.

So banks and decentralized blockchains are vastly different. To see how a bank differs from blockchain, let’s compare the banking system to Bitcoin’s implementation of blockchain.

Important Real-Life Use Cases of Blockchain

1.Dubai: The Smart City

In the year 2016, the smart Dubai office introduced the Blockchain strategy. Using this technology entrepreneurs and developers will be able to connect with investors and leading companies. The objective is to implement blockchain base system which favors the development of various kind of industries to make Dubai ‘the happiest city in the world.’

2. Incent Customer retention

Incent is CRaaS (Consumer retention as a service) based on Blockchain technology. It is a loyalty program which is based on generating token for business affiliated with its related network. In this system, blockchain is exchanged instantaneously, and it can be stored in digital portfolios of the user’s phone or accessing through the browser.

3. Blockchain for Humanitarian Aid

In January 2017 the United Nations world food program started a project called humanitarian aid. The project was developed in rural areas of the Sindh region of Pakistan. By using the Blockchain technology, beneficiaries receive money, food, and all types of transactions are registered on a blockchain to ensure security and transparency of this process.

4. Cryptocurrency: Most Popular Application

A cryptocurrency is a form of payment that can be exchanged online for goods and services. They work using the technology of blockchain. Many companies have issued their own currencies, often called tokens, and these can be traded specifically for the good or service that the company provides. Think of them as you would arcade tokens or casino chips. You’ll need to exchange real currency for the cryptocurrency to access the goods or services.

More than 6,700 different cryptocurrencies are traded publicly, according to CoinMarketCap.com, a market research website. And cryptocurrencies continue to proliferate, raising money through initial coin offerings, or ICOs. The total value of all cryptocurrencies on Feb. 18, 2021, was more than $1.6 trillion, according to CoinMarketCap, and the total value of all bitcoins, the most popular digital currency, was pegged at about $969.6billion.

Best Cryptocurrencies by Market Capitalization

These are the 10 largest trading cryptocurrencies by market capitalization as tracked by CoinMarketCap, a cryptocurrency data, and analytics provider.

Summary

Through the use of cryptography, blockchains are able to attain high levels of security as distributed systems. As with nearly all systems, however, it is critical that these two fields of knowledge are properly applied. A careful balance between decentralization and security is vital to building a reliable and effective cryptocurrency network.

So to recap the whole article in a few points:

  • A Blockchain is a chain of blocks that contain information
  • The blockchain is not Bitcoin, but it is the technology behind Bitcoin
  • Every block contains a hash.
  • Each block has a hash of the previous block
  • Blockchain require Proof of Work before a new block is added

In the meantime, If you have any questions or suggestions, feel free to drop them in the comments. Cheers!✌

--

--

Hasnain
0 Followers

I’ve been a code-aholic for the past 4 years, dabbling with web/mobile development. As a technical writer, I get to share interesting things that I come across.