What is Blockchain. Guide for Beginners

Blockchain is not bitcoin

Bitcoin is a cryptocurrency which proposed by `satoshi nakamoto` . Which makes e-payment without any trusted intermediate .

Blockchain Technology was used as a backend of bitcoin for maintaining distributed transaction ledger in a peer-to-peer computing.

What is cryptocurrency ?

Cryptocurrency is a currency whom we can’t see and can’t feel, it’s a virtual currency. The main motive behind this currency is not to centralized this currency like our Indian currency is centralized, it is operated by the government or some groups of people. But Cryptocurrency is not operated by any government or any group. Currently, in the market, there are lots of Cryptocurrency :

What is Blockchain ?

Blockchain is basically an idea, a concept to keep the data in the form of encrypted block where each block knows the address of its parent block and blocks are distributed over the network.

  1. Blockchain can be called the spine of the entire cryptocurrency system.

In short, Blockchain is immutable , distributed public ledger and peer-to-peer (P2P network )

Security :

  1. Blockchain is typically managed by a peer-to-peer network.

Why Blockchain ?

Issues with Current Banking System:

  1. High Transaction Fees.

How does Blockchain solve these issues?

  1. Decentralized System

Blockchain Use cases :

How a blockchain works ?

Features of Blockchain

1. SHA256 Hash Function

It is a ‘one-way’ cryptographic function, it cannot be decrypted back to the original text . fixed size for any size of source text.

2. Public Key Cryptography

Creating a set of keys referred as Public key and Private key.

3. Distributed Ledger and P2P Network

Distributed Ledger

Distributed ledger technology (DLT) is a digital system in which transaction and their details are recorded in multiple places at the same time.

Unlike traditional databases, distributed ledgers have no central data store or administration functionality.

peer to peer network :

Peer to peer network is one in which two or more PCs shares files and access to devices such as printers without require a separate server computer.

So, There is no single centralized copy.

4. Proof Of Work

A consensus algorithm is a process in computer science used to achieve agreement on a single data value among distributed systems.

Consensus algorithms are designed to achieve reliability in a network.

Proof-of-Work is the original consensus algorithm in a Blockchain network.

In Blockchain, this algorithm is used to confirm transactions and produce new blocks to the chain.

With PoW, Miners solve the puzzle, form the new block and confirm the transactions and get rewarded.

5. Incentives for Validation

The last step is to giving a reward to the person(miner) who has created the latest block. This rewards is provided for validating the transactions and maintaining the Blockchain

Block :

In Blockchain numbers of block connected to each other (like links in a chain) in a proper linear and sequential order.

Transaction data is permanently recorded in files called blocks.

Every block contains a hash of the previous block. This has the effect of creating a chain of blocks from first block to the current block.

Each network has its own defined block time ( the block time is the time needed to generate the next block in the chain ). For instance, the Bitcoin network’s block time is around 10 minutes, while the Ethereum network’s block time is around 20 seconds.

What is genesis block ?

The Genesis block is the first block in the chain, the Genesis file is a JSON file that defines the characteristics of that initial block and subsequently the rest of the blockchain.

{“config”: {“chainId”: 1994,“homesteadBlock”: 0,“eip155Block”: 0,“eip158Block”: 0,“byzantiumBlock”: 0},“difficulty”: “400”,“gasLimit”: “2000000”,“alloc”: {“7b684d27167d208c66584ece7f09d8bc8f86ffff”: {“balance”: “100000000000000000000000”},“ae13d41d66af28380c7af6d825ab557eb271ffff”: {“balance”: “120000000000000000000000”}}}

config

chainId — this is your chain’s identifier.

chainId of mainnet : 1testnet : 2ropsten testnet : 3

homesteadBlock, eip155Block, eip158Block, byzantiumBlock — these relate to chain forking and versioning, so in our case lets leave them 0 since we’re starting a new blockchain.

difficulty

This dictates how difficult it is to mine a block.

Difficulty units are basically “hash/solution” (sort of). It’s a measure of how much work is required to find a hash with some # of leading 0s

“The Ethereum mainnet Genesis file defines a difficulty of 17179869184.”

If the total hash power of miner is 17179869184 hash per sec. then it would take about 10 sec. To mine a block.

gasLimit

This is the the total amount of gas that can be used in each block.

alloc

Here you can allocate ETH to specific addresses. This won’t create the account for you, so make sure its an account you already have control of.

Nonce :

A nonce (“number only used once”) is a number added to a hashed block that, when rehashed, meets the difficulty level restrictions.

BlockHash = Hash(‘All of the transactions in the current block’)Hash(BlockHash + 0)Hash(BlockHash + 1)Hash(BlockHash + 2)Here 0, 1 and 2 is nonce.

What is double spending ?

Double spending means spending the same money twice.

How does blockchain solve it ?

Let’s suppose you have 1 BTC which you try to spend twice.

Both transactions go into the unconfirmed pool of transactions. But only your first transaction got confirmations and was verified by miners in the next block. Your second transaction could not get enough confirmations because the miners judged it as invalid, so it was pulled from the network.

Your key question is: “Is a blockchain a better choice than a well-crafted, secure database?” After that, you’re on your way!

If you want to know more please read my next article, Where I explained ethereum, solidity and smart contract.

I’m a software developer from India, currently working with blockchain.