Blockchain Tutorial for Beginners

Facebooktwitterredditpinterestlinkedinmailby feather

This tutorial will provide you the basic knowledge of blockchain. It is basically for beginners who want to enhance their understanding of blockchain.

In this Blockchain tutorial, we will discuss the following topics:

  • Introduction of blockchain
  • History of blockchain
  • Blockchain Architecture
  • Features of blockchain
  • Blockchain Cryptocurrency
  • How does a blockchain transaction work?
  • Need of blockchain
  • Blockchain Double-spending
  • Blockchain Versions
  • Limitations of blockchain
  • Blockchain Variants
  • Myths and Realities about blockchain
  • Blockchain Key Areas

Blockchain Introduction

  • Blockchain is a decentralized, distributed, and frequently public, and a digital ledger which used for recording the transactions across many computers. Because of it, any involved record cannot be altered, without the alteration of all consequent blocks. It applies for the secure transferring of items without any requirement of third party intermediaries like government or bank.
  • It is challenging to change the data once it is recorded inside the blockchain. Blockchain is known to be a software protocol (like SMTP for email). If there is no internet connection, then blockchain cannot run.
  • Because blockchain affects other technologies, that’s why it termed as meta-technology. It includes several pieces like a database, software applications, some of the connected computers, etc.
  • Some people understand that bitcoin is blockchain, but it is not valid. Blockchain is not the bitcoin but the technology behind bitcoin. Bitcoins are the digital tokens, but the blockchain is the ledger for keeping track of those who own the digital tokens (bitcoins). Bitcoins without blockchain is not possible, but the blockchains are possible without bitcoins.

History of Blockchain Cryptocurrency

The first work in the cryptographically secured chain of blocks was described in 1991 by Stuart Haber and W. Scott Storneta. They wanted to implement the system by which no one can tamper with document timestamps.

Satoshi Nakamoto was the person who has developed the first thought of blockchain in 2008. Nakamoto helps to improve the design by using a Hash-Cash (proof of work system which is used to control email, spam, and denial of service attacks) method to timestamp the blocks without any need to be signed by a trusted party and to reduce the speed by which blocks added to the chain.

Around August 2014, the size of the blockchain file, containing records of all transactions that have occurred on the network and reached 20GB (gigabytes). Around January 2015, the size grew to almost 30 GB, and from January 2016 to January 2017, the blockchain had grown up from 50 GB to 100 GB in size.

Both of the words that are Block and Chain were used separately in the original paper of Satoshi Nakamoto but were popularized by a single word, blockchain, by 2016.

Blockchain Architecture

Now Study the architecture of blockchain:

Block

What is Block?

Blockchain defines as a chain of blocks that contains the data. The block is a file that permanently records transaction data. The stored data in the block depends on the blockchain type.

The first block of the chain is referred to be as Genesis Block. Every new block in the chain links to its previous block.

Blockchain Architecture

Features of Blockchain

The features of blockchain are as follows:

  • SHA256 Hash Function
  • Proof of Work
  • Distributed Ledger and Peer to Peer Network
  • Public Key cryptography
  • Incentives for Validation

Let us study these features in detail:

  1. SHA256 Hash Function: A block is also a hash. It can be understood by the fingerprints that are unique for each block. Hash represents the uniqueness so, once it is (block) created, any change inside it will cause the block to change.
Features of Blockchain

So, the hash is very helpful when we want to detect changes to intersections. Whenever the fingerprints of the block changes, then that block will not remain the same as it was previously because its uniqueness has changed.

Each block includes the following things:

  • Data
    • Hash
    • Hash of the previous block.

Let’s understand the following example in which we have three blocks in which the 1st block do not have any of its predecessor and other two blocks contain their previous block as their predecessor, i.e., block 2 contains the hash of block one and block 3 contains the hash of block 2.

all blocks are containing the hash of their immediate previous block

As shown in the above image, all blocks are containing the hash of their immediate previous block. This technique makes the blockchain so secure. Let us understand this sentence by this example:

Suppose, if an attacker changes the data in any block, then the hash of the block also changes. But the next block still contains the old hash of that block. So, this makes the next block and all of its chronological blocks invalid as they do not have the correct hash of their previous block. The following image explains it more clearly:

the correct hash of their previous block

So the change in any of the single block makes its other succeeding blocks invalid.

  • Proof of Work: As the Hash method is secure, but still it is vulnerable, so the method Proof of Work is used to provide more security than the Hash method. The mechanism of hashing is excellent against tempering, but, nowadays there is a high-speed computer that can calculate hundreds or thousands of hashes per second. Within a few minutes, an attacker can tamper a block, and will be able to calculate the hashes of other blocks by which blockchain will again be valid.

The blockchain uses the concept of proof of work to get rid of hashing. This mechanism helps to slow down new block creations.

The proof of work is nothing but a problem of computation, which requires individual efforts to solve. The provided time is very less for verifying the result of the computational problem as compared to the efforts needed to address the computation problem.

In Bitcoin, the given time is 10 minutes for calculating the proof of work to add a new block in the chain. Let us understand it with an example:

Suppose that if a hacker changes the data of any block, he will also require to calculate the proof of work only in 10 minutes, and then the hacker will be able to make changes in immediate next block and other succeeding blocks.

this phenomenon makes it challenging to temper the blocks and in case

So, this phenomenon makes it challenging to temper the blocks and in case, if you tamper a block, then you will always be required to perform the calculation of the proof of work for all of the succeeding blocks. So, the mechanism of hashing and proof of work makes the blockchain more secure.

  • Distributed ledger and peer to peer network: It is another method to make the concept of blockchain more secure. This method has a distributed peer to peer network, which is allowed for everyone to join it. The computer is said to be a node. When anyone enters the network of another person, then that person gets the full copy of the blockchain.

When a new block creates, it is send to all the users on the network. Every node requires the verification of the block to make sure that it has not been altered. Once the verification gets completed, each node add that block to their blockchain.

All the nodes together in the network create an agreement; they agree about which block is valid and which is not. The tampered blocks will be rejected by the nodes in the network.

  • Public Key Cryptography:

 It is also called as Asymmetric Cryptography and uses key pairs that are public and private. A key is nothing but a large binary number. The public key, as its name implies, is distributed worldwide. The private key, as its name suggests, needs to be held strictly private.

In Bitcoin, if you lost the private key of your bitcoin wallet, the entire data of your wallets will be immediately vulnerable to theft, and before you understand it, entire money (contents of the wallet) would be gone. And there is not any phenomenon in the system by which it can be traced out who stole it. There are two functions of the public key cryptography that are as follows:

  • Authentication.
  • Message Privacy (by using Encryption and decryption).

Blockchain Cryptocurrency

Cryptocurrency is one of the types of a digital asset which is used for exchanging the values between the parties. It uses the strong cryptographical concept for securing the financial transactions and controls the new unit creation of that currency and verifies the transfer of assets.

There is no any physical existence of Cryptocurrency as we know that different countries’ governments print different currencies such as Dollar, Rupees, Yen, etc. It means that there is a centralized institution exists which creates thousands or millions or billions more of that currency. The currency, like bitcoin, uses the same mathematical formulas, on which Cryptocurrency work.

There are various types of cryptocurrencies that are as follows:

various types of cryptocurrencies
  1. Bitcoin:

 Bitcoins are the first decentralized cryptocurrencies. These are created by the thousand of specific nodes network that are called miners. The miners can process the transactions of bitcoin in the blockchain network. At the release of the bitcoin, there are more than 4000 alternative variants of bitcoin are now available.

Bitcoin

2. Litecoin: These cryptocurrencies work very similar to bitcoin. As we know, the bitcoin waits for ten minutes for the processing of the transaction block, but Litecoin takes maximum of two and half minutes. Litecoin does not have a high value in the market. Its price is lesser than the bitcoin; still, it is a useful process, and it also has some variations from bitcoin.

Litecoin

3. Z-Cash: It is a privacy-protecting digital currency which is based on robust science in cryptography. As compared to other cryptocurrencies such as bitcoin,  z-cash has enhanced privacy for its users.

In Z-Cash, transactional data is kept confidential, which can be made through zero-knowledge proofs. It allows the verification of transaction without taking any information about the sender, receiver, and the transacted amount.

Z cash

There are two features of Z-Cash that are viewing keys and payment disclosure. These features make Z-Cash possible to disclose some of the transactional data of the user. It makes z-cash transactions regulation-compliant and auditable.

4. Monero: This is the open-source Cryptocurrency. It is digital cash, which is private and operated by the users of network. It can be used for buying and selling things and also for exchanging other coins or tokens.

Monero

There is a special kind of cryptographical mechanism in it that ensures the transactions are 100% untraceable.

5. Dash: Dash stands for “Digital Cash.” It is also an open-source Cryptocurrency and a decentralized autonomous generation that is run by the subset of users, called as master nodes. It allows speedy transactions that are untraceable.

Dash

How Blockchain Transaction Works?

          Let’s understand the working of the blockchain transactions:

How Blockchain Transaction Works

Step 1: First, someone requests a transaction that involves Cryptocurrency, contracts, records, or other information.

Step 2:  Second, the requested transaction broadcast to a P2P network by using nodes.

Step 3: Third, in this step, the network nodes apply the algorithm for validating the transaction and the user’s status.

Step 4: After the completion of the transaction, the existing blockchain gets increased by adding a new block in it.

Need of Blockchain

Below are several reasons which make blockchain valuable to use:

  1. Reliable: Blockchain is stable as it checks and certifies the identities of the interested parties. It removes duplicity in records, reduces the rates, and accelerates the transaction.
  2. Unchangeable Transactions: Blockchain provides the inalterability of all operations, which means whenever any new block is added to the chain; it cannot be modified or removed.
  3. Fraud Prevention: The concept of a distributed p2p network prevents possible losses due to fraud or speculation.
  4. Security: With the help of a distributed ledger, each party contains a copy of the original chain, so the system remains operative, even at the time of failure of a large number of other nodes.
  5. Time Reduction: Blockchain plays a vital role in the financial industries as it allows the quicker settlement of trades and does not require any lengthy process verification, arrangement, and clearance.
  6. Transparency: The blockchain is transparent because any change in the public blockchain is publicly viewable. All the transactions in the blockchain are immutable.
  7. Collaboration: Without any need to mediate the third party, blockchain allows parties to transact with each other directly.
  8. Decentralized: Some rules specify how every node exchanges the blockchain information. This method ensures that all validated transactions are added one by one.

Blockchain Double Spending

Double spending, as its name implies it stands to spend something twice. As we already know, every transaction can be processed online or offline.

In an offline transaction, there is a use of physical currency or cash; while online transaction involves the digital cash. In a physical currency, the concept of double spending is not accepted. But, in Digital cash, it is allowed to spend the money twice.

Let us try to understand the double-spending by the following example:

Suppose you are going to a restaurant and place an order; then, you will get your order, and you have to pay some amount. If you are not using digital cash, then you will pay this amount by your physical currency, and there is no any other way remains to re-use this money for some another transaction.

Blockchain Double Spending

Now suppose the situation of paying the amount by using digital cash, it is shown in the image below:

situation of paying the amount by using digital cash

If the money exchanges digitally, it is essential to store the binary digital file in the sender’s device. After the sender sends this file (digital cash) to receiver1, he can also give the file’s copy to the receiver2. Now, both receivers’ understand that they receive the money and provide the requested goods to the sender. This process is termed as double-spending in which the sender spends the same money at more than one place.

Blockchain Versions

The details about the blockchain versions from 1.0 to 3.0 are elaborated as follows:

Blockchain Versions

Blockchain 1.0: Currency

In 2005, Hal Finney introduced the idea of creating money through solving computational puzzles. He has created the first concept of cryptocurrencies (distributed ledger technology). Bitcoin is a suitable example in this segment. It uses cash for the internet.

Blockchain 2.0: Smart Contracts

The main problems that arose in bitcoin was wasteful mining and lack of network scalability. To resolve such issues, this version of blockchain introduces the concept of bitcoin beyond currency. The concept of the new key is smart contracts. They are computer programs that are free and can be executed automatically. These programs also check the conditions that are defined earlier, like enforcement, verification, and facilitation.

Blockchain 3.0: DApps

DApps are the decentralized application that uses decentralized storage and communication. Its backend code runs on a decentralized peer to peer network. It can have frontend code and the user interfaces which are written in any language that helps to make a call to its backend like traditional apps.

Blockchain Limitations

As we know, blockchain has several advantages that make it essential. But it has specific barriers like lack of awareness, scalability, key management, immutability, etc. which stops blockchain technology unusable for mainstream applications.

Following image illustrating the limitations of blockchain:

Blockchain Limitations

Let’s understand these limitations in detail. The elaboration of these limitations is as follows:

Lack of Awareness: As we know, there are lots of discussions on blockchain, but still, people don’t know the value and the implementation of blockchain in different situations. 

Limited Availability of  Technical Talent: In blockchain technology, there is a lack of developers who are not expert in blockchain technology. That’s why it is a hindrance to developing anything in the blockchain.

Immutable: Immutability means there are no modifications in any record. It is useful to keep integrity and sure that nobody can tamper it. Sometimes it acts as a drawback like if we have made the payments and want to go back to make an edit in the payment, then it will not be possible.

Scalability: Scalability means the capacity to change in the size or scale. As we know, blockchain has a consensus mechanism that requires every participating node to verify the transaction. It limits the processed number of transactions. So bitcoin is not able to do the large scale volumes of transactions. At present, there is a maximum of seven transactions per second that bitcoin can process.

Blockchain Variants

Public

In this type of blockchain, the ledger is noticeable to everybody on the internet. It allows anyone to validate and enhance a block of transaction in the blockchain. Everyone can use public networks.

Private

It is within an organization type blockchain. It allows only certain people of the organization to validate and enhance the transaction blocks.

Consortium

Consortium stands for a group of people. In this variant, it allows for only a group of people to validate and add transactions. In this variant, ledgers can restrict or open for selected groups. This blockchain uses cross-organizations.

Myths about Blockchain

Myths Reality
It can solve each problem. No, It is only a database.
It is not a trustworthy technology. It is trustworthy and spreads trust.
It is secure. It does not focus on confidentiality. It ensures integrity.
It is immutable. Offer only probabilistic immutability.
Wastage of Electricity. The emerging blockchain is efficient.

Blockchain Key Areas

The blockchain technology fixes the things for that internet was not designed to do. These things are as:

  • Value
  • Trust
  • Reliability
  1. Value: By blockchain, the value of a digital asset can be created. This value is controlled by the person who owns it. It has a unique asset that is transfer over the internet without any centralized agent.
  2. Trust: Blockchain creates a record of owners, which is permanent, secure, and unalterable. In the blockchain, there is advanced hash cryptography, which is used for preserving the information’s integrity.
  3. Reliability: The workload of blockchain is distributed over the thousands of digital computers worldwide. It is reliable because of its decentralized network structure, which ensures that there is no single point failure that brings down the entire system.
Facebooktwitterredditpinterestlinkedinmailby feather