Blockchain 101 for BeginnerssteemCreated with Sketch.

in #blockchain7 years ago

Introduction

There is a good chance you might have heard the word Blockchain. The last few months was crazy in the world of cryptos where many digital currencies reached all time highs beyond any imaginary zenith. Take bitcoin for example, the first decentralised cryptocurrency which runs on blockchain technology rose a soaring 290% from September (or 15,900% from July 2010) . With the recent events, there is so much focus on blockchain and it’s technologies. Don’t fret if you are new or planning on jumping into the big ocean of digital cryptocurrencies. It is important for you to understand the basics of blockchain and its working principle but it is easy at the same time.

‘Blockchain 101’ is a series of articles aimed at explaining to the readers the various concepts of this massive digital world while enabling them to make informed decisions on the different ideas that may arise in this new platform. All the concepts in this article is explained in a way a layman could understand. So buckle up for this learning journey is going to be exciting and informative.

Current Scenario — The Money Movement:

Let us first understand how money is being transacted today and see what / who are all the stakeholders responsible for the money movement.

Consider two friends, Amish and Cathy who are neighbours. Cathy has gone to an Apple retail showroom to buy the new iPhone 8 which costs 70,000 rupees. Now Cathy has only 69,000 rupees with her and she calls Amish and asks for a loan of 1,000 rupees which she says will pay back the very next day. Amish being a very close friend decides to help Cathy and transfers 1,000 rupees to her. Cathy pays the bill and gets her favourite brand new iPhone 8.
So what is happening here? How the money is instantly transferred to Cathy where there is no transaction of physical notes?

This is where the banks come in with a solution. They act as a central authority and take control of the transaction. When Amish sends the 1,000 rupees from his account, the bank updates it’s register noting down the transaction and reducing 1,000 rupees from his balance. Then it again updates the register of Cathy adding the 1,000 rupees sent by Amish.

1.png

The Money Movement:

Say Amish has 65,000 rupees in his balance and we know Cathy has 69,000 rupees in her account. The bank’s register (ledger) for the friends would look like this:

2.png

The bank in this case enters the transactions of Amish and Cathy in it’s registers and updates the new balance of both the friends. This is what happens to all the countless transactions happening around the world. There is no need for physical notes to be transferred to other people in order to send the money.

So what is the problem with this system?

Bank acts as a middleman taking the complete control of the transaction leaving no control with us on what is happening behind the scenes in the registers. There are scope for mistakes (even when computer updates the register). This also leaves a chance with individuals working in the bank to have intentional motivations to make mistakes in any scenario. The bank also charges fees for their services which in the end will contribute to a sum of unplanned spending of your finances.

This raises a question, how can we control the registers for the transactions we do? Is it possible to create a register that can be fail proof and at the same time owned by us effectively removing any middleman?

Solution — The Blockchain:

“Blockchain is a shared, public ledger of records or transactions that is open to inspection by every participant but not subject to any form of central authority” - McKinsey

Its ok if you do not understand what the above definition means. By the end of this article, you will be able to come up with your own definition of blockchain. In this section, let us understand the basics of blockchain and how it works.

Now you have an idea of what a blockchain should be. It is a record of various transactions done by different individuals on the blockchain network. A block contains a list of transactions done at a particular time. Think of it as a paper where you list down all the transactions made by the users. Once the paper is filled with enough entries and there are no new transactions that can be added due to the lack of space, the paper gets securely stored in a file and is put away in the locker. The paper contains the names of the sender and the receiver, the amount being transacted and the time at which the transaction was done. It is important not to modify the contents of the paper as it is the proof of the money movement. Once the paper is stored inside the file, another new paper is taken to write the next set of transactions. This process gets repeated and the papers are stored safely one after the another.

Similarly a ‘block’ is a proof of transaction being done. A block contains the details of all the money movement (cryptocurrency in this case) securely stored in the blockchain network along with the previous blocks.

Let us now have a look at what is inside a block:

  1. Previous Block Hash

  2. Block Number / Index

  3. Data

  4. Timeframe

There is also another element called a nonce (‘?’) which we will discuss in a later section.

Previous Block Hash:

A hash the unique identity of a block. Remember when we learnt that when a block once full will be stored securely with the other blocks in the blockchain network? This is how blockchain got its name. A block is linked together with the previous block and the next block when it is full will be linked to the current block. The linking of all the blocks in a chain like structure makes the complete blockchain. We will learn more on hashing in the next section.

4.png

Index:

An index is also known as block number.

Data:

Data is the logic of the transaction made on the blockchain network. Data also consists of ‘From’ and ‘To’ addresses, the amount which is being transferred and any addition inputs like adding a fee to the transaction, .. etc.

Timeframe:

It is the time at which the transaction is executed in the blockchain.

Working Principle:

So, if there is no central authority over the transactions, then who will own the ledger or what happens to them? Answer, Everyone in the blockchain network. The ledgers are shared to and owned by every individual using the blockchain. This is called decentralisation.

The blockchain achieves decentralisation by making it’s ledger open to everyone who uses the network. Suppose if Amish, Cathy and their friends uses blockchain for whatever purpose then everyone will have the copy of the ledgers. So how is this helpful?

Now imagine if there are a million users currently using the blockchain. That means every single person will have the distributed ledger with them associated to their account. Now when Amish sends money to Cathy through blockchain, this transaction is updated across all the ledgers across the network. This is how blockchain aims to prevents double spending and it makes difficult for users / hackers to redo or modify a transaction.

What is double spending?

Double spending is the risk of spending the same digital currency twice. Unlike physical notes where duplication of the same money is difficult, it is necessary to ensure that a digital token cannot be replicated or taken back after a transaction is made.

When someone wants to modify a transaction made, they have to change the details of the ledger in network. But since blockchain employs the ledgers universally to everyone who uses it, it is difficult for the hackers to modify the content of all the ledgers. Even if they modify one ledger in the network, all the other ledgers that have the correct version of the contracts (transaction) will outvote the modified ledger out of the system.

5.png

The above image represents interconnected Ledgers.

Imagine the ledgers 1,2,3&4 belonging to different blockchain users. The ledgers all must have the same content across the network. But we notice here that the ledger 2 has been modified by someone. Now with only one ledger modified, the other ledgers across the blockchain notices it and eliminates this ledger out of the system.

Hash:

As explained in the previous section, hash will be unique for each block and this will be the identifying factor to match the contents of the block. A new block which is created (mined) at a particular timeframe will have a hash value. Say if the hash value for a newly created block (lets say ‘block 34’ for example) is “00XF3W2ER”, then at any point of time in the future, even after six billion blocks down the lane, if you search for 00XF3W2ER, you will be directed to the block 34. So what the hash value of block 34 means is that, the contents of the 00XF3W2ER hash contains the previous block hash value, the index of the block, data and the timeframe of the block for which the block 34 is created and stored for.

Now if someone changes any content in the block, the hash value of the whole block will change which in turn changes the hash value of the next block since the blocks are linked to each other and the blockchain knows something is modified.

Let’s take an example and look at the contents of the block:

We will take ‘block 34’ and give it some random numbers for the content.

Previous block — ‘block 33’

Previous block hash: 00YVB43C9

Timeframe — 31-Dec-2017, 23:34

From Address: 3YZER42TY7

To Address: RE37YFDT4

Amount: 1,000 rupees

Hash for the ‘block 34’ — 00XF3W2ER

So the ‘block 34’ will look something like this:

6.png

When ‘block 34’ gets full — all the contents of the block will lead to a hash value.

Here, hash value, 00XF3W2ER = All four shapes inside the block. Even a minute change in the content will result to a differ hash value.

Similarly, ‘block 35’ is linked to ‘block 34’ and the previous hash of the ‘block 35’ will be 00XF3W2ER and the ‘block 36’ is linked with the hash value of ‘block 35’.

When a hacker modifies the a value in ‘block 34’, it then results in a new hash value for ‘block 34’. So now the hacker has to quickly modify the ‘previous block hash’ of ‘block 35’ which in turn affects the original hash value of ‘block 35’ resulting in a ton of work which any hacker cannot posses by any means. It is almost an impossible task added to which the hacker has to change this before the ledger updates the next set of transactions. Remember, when a ledger transaction is updated the whole shared ledger in the blockchain gets the copy of the new set? The hacker has to keep up with all the individual ledgers in the blockchain along with changing the contents of many blocks in the blockchain.

That is how blockchain aims to create a secure open decentralised network of ledgers that anyone can see but without any form of central control.

Let us look at one example of blockchain transaction:

7.png

The above is an image of transaction of Block 57043.

You can see all the contents of the block that was discussed in the previous section in the above image. This is a typical bitcoin transaction that happened on 22–05–2010 at 18:16:31 in the block #57043.

FunFact:

Those 10,000 bitcoins was used to buy two pizzas during that time valuing for $25. Today the amount of bitcoin is worth over $100 million. Ever year from this transaction, May 22nd is celebrated as bitcoin pizza day.

Nonce (‘?’):

All hashes generated in the blockchain should meet a ‘pre-set’ difficulty level.

Consider ‘block 176’ generated hash value is ‘3FR8ETRBV”.

For example, if the difficulty level set is that — the hash should start with ‘00000’ (five zeroes) characters.

The ‘block 176’ clearly does not meet the required set condition. So we have something called ‘nonce’ which helps the hash to meet the difficulty level. The nonce is defined such a way that any hash value generate will have to start with ‘00000’ (five zeroes)

Rewards:

Miners are responsible for verifying the transactions happening on the blockchain network. We will discuss on how the transactions are verified in a different article but for now it is enough to know that blockchain rewards the miners for verifying their transactions by giving them additional incentives like free cryptocurrency.

When a transaction is done, the miners in the network compete to solve a complex mathematical proof that locks the transaction into the ledgers. However only the first miner to verify the transaction will propagate the block to the network and will be eligible for the rewards. Other miners confirm the transaction and move on to mine the next block in the hope of being the first one to verify it.

With the transactions being verified, the miners rewarded and the ledgers being open to all, it is almost impossible to cheat the system.

This is how blockchain achieves consensus.

Highlights of Blockchain

In this section we will look at some of the highlights of the blockchain:

1.Immutability. Once a transaction is made, it cannot be altered in any case.

  1. Peer-to-Peer Transactions. Transactions happen between two parties with no central authority. Once the transaction is complete, the information is updated in the blockchain.

  2. Distributed Decentralised Database. Anyone and everyone can see and inspect the blockchain content leaving no room for double spending and altering of the records.

  3. Anonymity. The transaction is completely open to all but the user can choose to be completely anonymous.

We have come to the end here. I hope you all liked it. When I first learnt about blockchain, I defined it as:
“Blockchain is a decentralised platform with public records that are irreversible”
I would like to see what you come up with as a definition. Don’t mind too much on the technicals, we have just started learning :) If you like this article send me an email to anbknaga@gmail.com with your thoughts on it.

Adios.

Sort:  

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://medium.com/@anbknaga/blockchain-101-the-internet-of-value-439556bacc0d

Thanks robot, that is my content on medium. I just found steemit community and i incorporated my article here :) To everyone seeing this article, thanks for your support :D