Hey mates!
Today let's talk about the consensus Algorithms and specifically of the Proof of Work protocol PoW. Let's apply to the bitcoin use case. This concept is really important because it helps to understand how and when bitcoin is created.
What are the Consensus Algorithms?
The main problem is there are a lot of distributed nodes in the blockchain with a copy of all the transactions in units called blocks. The transactions have to be unique, we don't want to use the same bitcoin to pay for two or more things at the same time in different nodes, so we have to implement a mechanism to provide decentralized security and uniqueness. So let's apply the consensus algorithms to achieve security in a network with multiple decentralized nodes.
The two main functions:
- Ensuring that the next block in a blockchain is the only version of the truth and nothing more than the truth, that is, the next block in a blockchain is fully validated and secured.
- Avoid powerful enemies from breaking the system and successfully forking the chain to avoid duplicated payments with the same bitcoin.
Let's talk about the Proof of Work PoW protocol as a consensus algorithm.
How does the PoW protocol work?
The process can be divided into the following major four steps:
- receiving the task: The node or miner establishes a connection to the blockchain network. After that, the network assigns to the miner a computationally expensive task. This task must be solved in order to receive a financial incentive, the bitcoin. Usually, the task has to be done in 10 minutes for the bitcoin uses case.
- Begin solving the problem, the puzzle. Mainly the puzzle is to hit a given hash number using a nonce (timestamp) and another transaction hashes. This entails the use of a lot of computing power to solve the given problem. The computer power is increasing every day, so the network adapts the problem by spending 10 mins. Another point to take into account, the problem to be resolved can be resolved by a huge computer or a small computer, to hit the problem is a question of probability. This process of resolving or hit a riddle is what is called mining.
- Once when the problem is solved, the miner shares the results with the network for verification, with the others nodes. At this point, it is quickly verified that the task meets the required requirements. Resolving the task is difficult but validated is right now. Doing so provides access to network resources. Otherwise, the access and the solution presented to the problem are rejected. It is at this point, where double-spending protection checks are carried out. This protection prevents, from being presented more than once, a task already assigned and verified by the network.
- Once the task confirmation has been accomplished, the node or miner accesses the network resources. Thanks to this, he receives a profit from the computational work done. The profit is the transaction fees in the confirmed block and the bitcoin itself.
The ease of this model allows it to be transferred to a different kind of software to take advantage of its potential. But it is in the blockchains where we observe a greater utility, providing exceptional levels of security despite the low complexity of the protocol, and at the same time, allowing millions of people to participate concurrently on the network.
Mining, applying the PoW
But the mining is not only resolving the problem, is about the work of confirming a block of transactions too. So the miner has to package a block of transactions and has to use the hashes of these transactions as a part of the problem too. For the bitcoin case, the first hash in the block will be the bitcoin hash only if the block was accepted for the network and the miner wins. When the miner resolves the problem, all the members in the network confirm that the miner hits the result and he is the winner, then the miner creates a block including all the transactions and this block is chained with the previous one. The miner earns the bitcoin and the transaction fees.
So what is a bitcoin in reality?
A bitcoin hasn't got any shape, it's not round as a coin, it's not solid, it's not made of any metal. The bitcoin itself is an "accounting note" in the blockchain, or better, it's the first transaction on the confirmed block, with a specific amount (6,25 BTC at this moment) and a miner destination address into the blockchain network, created at the moment to confirm a new transaction-block by the miner into the blockchain network.
“By convention, the first transaction in the block is a special transaction that generates a new currency owned by the creator of the block. This adds an incentive for the nodes/miners to support the network, provides an initial way to distribute and circulates the coins since there is no authority to create them. This stable addition of a constant amount of new coins is analogous to gold miners who spend resources to put it into circulation. In our case, the resources are the CPU time and the electricity that are used. "
So what is a blockchain in reality?
Don't forget the blockchain is only a decentralized database where to appoint or account transactions, accounting notes. It's not magic, it's not anything new. The transactions are package into blocks. Every block has a hash identity number. Every block appoints or link to the previous block storing the hash Id of the previous one. Every node in the network has to have a perfect copy of the database.
Conclusions
The present article explains in an easy way the concepts of Consensus Algorithms, Proof of Work, blockchain, and bitcoin. I hope it can help you. Thanks for reading me!
Advantages programs:
- kuCoin create a new users account to earn: https://www.kucoin.com/ucenter/signup?rcode=rJ8UEU9
- Register in Coinsmart and Get 15$ CAD (Canadian dollars) when verifying your user account and deposit 100$ CAD.
- Try Binance here https://www.binance.com/en/register?ref=5995667 and earn a 10%
- I love pipeflare, easy and without any ads. Try Pipeflare here https://pipeflare.io/r/5uxs
- I love Globalhive, easy and without any ads. Try Globalhive here https://globalhive.io/r/93797
- Try presearch here https://presearch.org/signup?rid=2050229
- create a new coinbase account a earn 10$ when you spend 100$
Personal projects:
- visit https://estrenoscinehoy.com/en to be updated over the last premiers on the main networks or channels.