Raj Bandi's Blog

Raj Bandi's Blog

Blockchain overview

In this post, I'll try to explain Blockchain overview and its uses.

Before this, I suggest to familiarize yourself with the following terms. You may hear them numerous times often when dealing with Blockchain based technologies.

Lets take an example of bank cheque. A bank cheque contains important information like date, from account number, payable to, and amount to pay. This is not enough for clearance. The bank clerk checks the current balance and validates the signature before allowing clearance. Bank clerk rejects the cheque If anyone of this information is missing or balance not available. If its valid, he will record this cheque information in bank ledger and updates the balance remaining. Transactions once recorded cannot be removed or updated. It means all are forward transactions. Bank use several ledger books every year as the transactions grow.

Just imagine the cheque as transaction. Bank ledger book as Blockchain. Bank clerk as node. A page in the bank ledger as block (only hold maximum records that can fit in page). Bank account as wallet. Account number as public key (address). ATM card with pin as private key. Similar to bank ledger book, blockchain size grows as the transactions grow and transactions cannot be updated or removed.

Transaction: A transaction is simply an exchange of some value between two parties.

Every transaction contains the following information.

  1. Date & Time of exchange
  2. Sender identity ( Exam
  3. Receiver identity
  4. Value exchanged
  5. Signature (see wallet below for example)

This information is useful for tracking and other purposes.

Wallet: A wallet is like a personal digital vault with a key. This key guarding your wallet is called as private key. Private key should be kept as secret and not exposed to public. If someone gets this key, he'll be able to clear the vault. If you lost this private key, its impossible to recover information stored in the wallet. This wallet is known to others with another key which is called as public key. Public key is recorded as sender or receiver identity in the transaction. Every transaction is locked (signed) with the private key and can be verified with the public key. The locked info otherwise called as signature is always attached to the transaction.

Public key used as identity which is a called as address. If someone wants to send crypto funds, you need a public key (address) and private key to withdraw funds from the wallet.

For example, imagine a private key is like an ATM card with pin and personal bank account as wallet. Account number as public key i,e address which is known to others. If someone knows your account number, no one can withdraw funds but can send money to it. If someone gets your ATM and pin, he can withdraw funds from your account. Bank tracks your money using your account number. It retrieves all the past transactions (debits and credits), calculate balance as of now.

Blockchain: A Blockchain is a digital ledger of the transactions. The size of the blockchain is determined by number of transactions it holds. As the transactions grow, blockchain size too grow. All the transactions once recorded are irreversible. It means they cannot be edited or removed from blockchain.

Blockchain is stored in several database files on the computer disk. Blockchain is managed by a special software that runs on a computer which is called as node. Each copy of this node run by several computers across the world and synchronize each other by forming a network. The main role of each node is to receive transaction information, validate it and store in blockchain and send it to other nodes. The other nodes will do the same until it reached to all the nodes in the network.

Same copy of blockchain is stored in hundreds of computers. The node running on the computer is responsible to validate and add transactions as it receives from other nodes. All the nodes form a consensus which govern the rules for each node.

Just imagine consensus as traders association. Each trader who is in the association has to follow the rules. if any trader break the rules, he will be excluded from association.

For example, A customer creates a transaction with his identity (sender) and the identity to which he wants to send (receiver) with some value to be exchanged. Then sends to the nearest blockchain node. This nearest node validates the transaction by verifying his identity and funds associated with it. After successful validation, node will store this transaction in its blockchain and sends to other node for update. The other node will do same thing, validates and stores in its blockchain and sends to other node. This will be repeated until it reaches all the nodes in a network.

Blockchain categorizes transactions into groups. These are called as blocks. The size of the block determines how many transactions it can hold. The blocks are created by some algorithm doing some calculations. Every transaction needs a block to store. The customer who created this transaction must pay some fee to be included in the block. This fee also called as gas. The new transactions just created wait for the block to be created by node software. Once block created, the node will reward some value to the block creator. The one who specializes in creating the block is called as miner and the reward for creating the block is called as miner reward. All the transactions waiting to store in block are called pending transactions.

Miner can include only the maximum transactions that can fit into the block. Miner will decide which transaction to include in the created block depending on the transaction fee. Blocks are created at inconsistent timings. There is no guarantee the block can be created at the same time.

Once a transaction is included in a block, it is treated as 1 confirmation. The confirmation number increases as number of new blocks created on top of this block. A transaction with 3 confirmations means transaction was included in 3rd block from top. Lets say Block number 85, transaction is with 3 confirmations then transaction was included in (85-3)+1=83. Three blocks 83, 84 and 85.

Lets imagine, You and others are waiting at the bus station to board a bus travelling from A to B. Every one has to pay some fee to board the bus. There are several buses available every half an hour and so. Lets say the bus carries 72 people only. If you are in queue at position 40 or 50 (<72), you can board the bus otherwise you need to wait for the next bus. If you pay higher fee, the driver may choose you even if you are not in the first 72 people. In that case, he would replace the person from the first 72 people who paid less with you. For operating bus, the travel company pays a reward or compensation for the driver. So the driver collects reward from travel company as well as the fees from the people. Some time the bus come may late or early depending upon the traffic.

Imagine driver as miner, travel company as node, bus as block and people as transactions. Bus entering station as block creation. Bus size as block size. All the remaining people still waiting in queue are called as pending transactions. If person X boards 3rd bus and left, it will be 1 confirmation. After 2 more buses arrive after person X left, his confirmations will 3 like so on...

The first block is called as genesis block.

Every transaction is linked to the previous transaction except the first one.

Think of central bank doing first transaction by minting money and doing transactions with all the banks by transferring and banks doing transactions with people. So central bank is the initiator. If we get first transaction, it is possible to know all the transactions done from first transaction by tracking sender and receiver identity and vice versa. It means if you know a transaction, you can get all the previous ones linked to this one and next ones if any. Its like a linked list where the receiver in previous transaction becomes sender in the next transaction.

There are several Blockchain technologies available in the market. Users decide which blockchain to use based on the features and convenience it offers.

For example, if you are buying a television, you'll compare all the features offered by each brand and decide based on your requirements.

The first blockchain is Bitcoin, introduced in 2009 by Satoshi Nakamoto, a pseudo name used by unknown person. Then followed by Litecoin, a clone of Bitcoin.

In 2015, Vitalik Buterin proposed a new Blockchain Ethereum with advanced features such as Smart contracts. This became a hit due to its ability to execute logic based on a condition when validating and adding transaction to block. Ethereum is an extended version of Bitcoin with additional useful features for financial transactions.

Smart contract is a self-executing code stored in blockchain. These smart contracts are stored as transaction in blockchain along with normal transactions. They can be identified by certain value such as Transaction Type. These contracts can be used by businesses to implement their products on the blockchain. You can write smart contract for anything. For example financial , distribution, even banking products etc.

To add a transaction to Ethereum, you have to pay a gas (fee) to the miners. This gas amount varies based on the traffic.

Several new and clones of existing blockchains were created after Ethereum.

Please visit https://coinmarketcap.com to view the status of blockchains.

 
Share this