Skip to main content

What is Proof Of Work in Blockchain?

Proof of Work

This is in continuation  of what is blockchain ....
Now we understand miner needs to solve a puzzle before they get to add new block in the network. This puzzle is called Proof of Work.
What is Proof of Work?



Yes you have guessed it right, it’s like a rolling a dice. If we (ultra) simplify it, proof of work is similar to rolling a dice. Here it goes.

Let’s say only you and I are the only 2 miners in the network. To add a new block, we need a get a number say 5 by rolling a dice.

Now let’s say I have 1 dice and you have 1 dice.

I roll the dice got 3 (No luck )

You roll the dice, you got 1 (no luck).

I tried again, I got 6, again no luck.
You tried again and you got 5! .  Wow lady luck smiles upon you and you get to put the block in the network and you got rewarded for the same.

Ok… I felt, I need more processing power, I bought one more dice. So let’s solve the puzzle again. Now I have 2 dice and you have got 1.
Let’s assume we will need to get 5 to put block into the n/w.

You roll dice , you got 3 (No Luck).
In the same time, I managed to roll both the dices, I got 2 & 5. Wow I solved the puzzle and now I can put the block in the network and get the reward.
This is why compute power of miner play a big role on this.

Now let’s suppose 8 other members come to join the party , now we have 10 miners including you and me.
If 10 people are throwing a dice, there is a very good chance that one or more people will get the lucky number in the 1st go only.  Not much fun in the game now?  So what we can do to keep the complexity level same as when you and I were playing. One thing we can do is select the target number between 1 and 12, rather than from between 1 to 6.
Well bitcoin also does the same, manage the complexity of the puzzle based on the network capacity.


Like I said, it’s an ultra-simplified version to get the point through.
Now let’s see how the real world looks like.
♦♦♦

Bitcoin uses the hashcash  function to implement Proof Of Work. Again to simplify it a bit, networks set a hash target. To add a block on the network miner has to generate a hash which is lower than the network target hash number.  To achieve this, miners add a number (called nounce) along with pervious hash, transaction data to generate the hash. They keep on changing nounce until they get the hash which is lower than the network target hash.

The process of finding the correct number (nounce) that makes a valid hash is a random game of chance. Also the complexity of the puzzle is dynamic, it’s based on the network difficulty level. The Bitcoin network is designed to add a block to the blockchain every 10 minutes. As more computers are added to the network, there is more processing power on the network making more guesses for the possible correct value of nounce. To ensure block time remains at approximately 10 minutes, the difficulty target is adjusted after certain interval, adjusting the minimum and maximum numbers to add a valid block.

It’s a complex process, it’s perfectly ok if you don’t get it, and we will come back to this again and try to understand this with practical exercise in the coming chapter.

Why do we need Proof of Work?
There is no way to trust that everyone in the network is honest, so there has to be some way to prevent miners from creating new blocks that benefit themselves for example change the from address to their personal address in a transaction. . The way it works is that you have a bunch of people all trying to guess the answer to the math problem and no one knows who is going to get the correct answer first. Whoever does get the right answer first gets a reward, but only if all the other miners agree to accept that transactional record (If it becomes apparent that a certain miner is creating fraudulent transactions then the other miners can collectively refuse to accept their contributions). This is why the process of creating a new block is designed to be energy intensive, so that there is a cost associated with creating each new block. This prevents miners from simply creating a whole bunch of new fraudulent blocks with the hopes that maybe they’ll get accepted, because the cost of doing so offsets the potential reward.

How Secure is the blockchain network?


How secure is the blockchain network, can it be hacked? Well there is nothing impossible in the world, blockchain data can only be manipulated if hackers own 51% of the miners in the network. Since new block can only be accepted if there is a consensus among 51% or more miners. This means, yes technically it’s possible to hack but it’s extremely difficult to do that, the cost of doing the hack may offsets the potential reward.

Investing resources for solving puzzle, isn’t a waste of electricity and compute POWER?

Well this is the cost blockchain network is paying for the safety and soundness of the transactions over the network. But yes the electricity , compute power and any other resources that we are using for solving puzzle  here is not doing any productive work. Here comes Proof of Stake.

Proof of Stake


Proof of Stake is an alternative to the proof of work.

Proof of stake is a process where the amount held in a cryptocurrency determines the amount that can be mined by the holder. A person that’s holds 5% of a cryptocurrency can mine 5% of the blocks.

Proof of stake goes with the assumption that people with a stake in the cryptocurrency will not want to devalue their holdings so will act in their best interests of the network while saving computing power and resources.


This is being evaluated by major blockchain, but so far at the time of writing most of the major blockchain like Ethereum, Bitcoin are still using Proof of Work.

***************************************************************************
If you are looking to get started with blockchain or want to build basic concepts on blockchain, you may like to review this book.
Building Blocks Of Blockchain

****************************************************************************



Comments

Popular posts from this blog

Fake media - Can blockchain help ?

Fake media - A potential solution using Blockchain ? Media is an important pillar of democracy but this pillar is loosing trust and getting weaker due to TRP focused approach. This is a big risk for the democratic fabric of  any country. News channel /media industry needs a refinement to remain responsible and trustworthy.  What is the problem ? - Media is loosing trust due to fake or misrepresented facts. - There is no effective regulating body for media. - U nreliable information going viral online (aka fake news) is one of the biggest threats faced by society. What is the solution ? - Need an effective regulating body to control fake news. There is no central agency which can be trusted today.   - Need a central agency which is unbiased , run automatically and transparently without any human  interaction. How Blockchain can help ? Step 1:  Create an open community controlled by bloc...

What is Bitcoin ?

Bitcoin - Explained  with a simple use case      →????? Let’s imagine it’s a great evening and we are sitting in a pub. I have one 100 dollar note* with me. I give it to you. You now have one 100 dollar note and I have zero. That was simple, right? Note * : Here 100 dollar note is a banknote (often known as a bill , paper money or simply a note ).  I will refer it as note , please read it as note or bill based on your local convention. Let’s take a closer look at what happened. My 100 dollar note was physically put into your hand. You know it happened. I was there. You were there. You touched it. We didn’t need a third person there to help us do the transfer. We didn’t need to pull in a judge to sit with us and confirm that the 100 dollar note went from me to you. The note is your now, you can do anything you like, you can use it to buy something for you or you can give it to someone else. You have the full ownership of the no...

Around the Web

Around the Web IBM Is Betting Big on Blockchain Technology. Is It Worth the Risk? Money.CNN.com 3 Startups That Can Turn Blockchain Tech into an Everyday Tool for Asian Users News.Yahoo.com Appraising the Luxury Goods Market With Blockchain Technology Forbes.com The Promise of the Blockchain Technology Economist.com Blockchain Jobs Are Booming in Asia, Even as Cryptocurrency Prices Struggle CNBC.com