Bitcoin
$61,649.69+1.54%
Ethereum
$4,337.19+0.84%
XRP
$1.09+3.08%
Solana
$196.76-0.07%
Cardano
$1.99-0.04%
Crypto Prices Top Assets

What is Proof of Work (PoW)?

lnhngn 17/11/2021 12:47 446 views

Proof of Work (Proof of Work, commonly abbreviated as PoW) is a mechanism to prevent double spending. Most cryptocurrencies use it as their consensus algorithm, which is used as a method to secure the cryptographic ledger. Proof of Work was the first consensus algorithm to emerge and is by far the dominant algorithm. It was introduced by Satoshi Nakamoto in the 2008 Bitcoin white paper, but the technology itself was conceived long before that.

Adam Back’s HashCash is an early example of a Proof of Work algorithm before the advent of cryptocurrencies. By asking the sender to do a little math before sending an email, recipients can reduce spam. This calculation will cost a legitimate sender almost nothing, but will add up to a large number for someone sending a large number of emails.

What is double spending?

Double spending occurs when the same amount is spent multiple times. The term is used almost exclusively in the context of digital currency – after all, you would have a hard time spending twice the same amount. For example, today, when you pay for a coffee, you pay cash to a cashier who can lock it in the book. You can’t go to the coffee shop across the street and pay for another coffee with the same bill.

In digital currency mechanisms, enforceability is possible. You only need to clone a previous computer file – by copying and pasting. You can email the same file to ten, twenty, fifty people.

Since digital currency is just data, you need to prevent others from copying and spending the same currency in different places. Otherwise, your coin will collapse quickly.

Why is Proof of Work necessary?

If you’ve read the beginner’s guide to blockchain technology, you’ll know that users broadcast transactions online. However, such transactions will not be considered valid immediately. That only happens when they are added to the blockchain. Blockchain is a large database that is visible to all users, so they can check if funds have been used before. Illustrate through an example like this: you and three friends have a notebook. Anytime one of the three wants to make a transfer of whatever unit the group is using, he or she writes it down – Alice pays Bob five units, Bob pays Carol two, etc. There’s a problem here. here – every time you make a transaction, you only lead to the transaction with the source of the funds. So, if Bob pays Carol two units, the actual entry will be as follows: Bob pays Carol two units from the previous transaction with Alice.

Now we have a way to track units. If Bob tries to make another transaction using the same units he just sent Carol, everyone will know immediately. The team will not allow transactions to be added to the book.

This can work well in a small group. Everyone knows each other, so they’ll likely agree on which friends should add transactions to the ledger. But what if we want a group of 10,000 participants? The idea of ​​a notebook is not practical, as no one wants to trust a stranger to manage it. This is the reason for the birth of Proof of Work. It ensures that users won’t spend money they don’t have the right to spend it on. Using a combination of game theory and cryptographic techniques, the PoW algorithm allows anyone to update the blockchain according to the system’s rules.

How does PoW work?

Our notebook in the above example is the blockchain. But we don’t add transactions one by one – instead, we aggregate them into blocks. We announce transactions to the network, and then users who create a block include them as a candidate block. Transactions will only be considered valid when the candidate block becomes a confirmed block, which means it has been added to the blockchain. However, adding a block is not cheap. Proof of Work requires a miner (block-making user) to use some of their own resources in order to enjoy privileges. That resource is computing power, which is used to hash block data until a solution to the puzzle is found. Hashing block data means you pass it through a hash function to generate a block hash. The block hash acts like a “fingerprint” – it is an identifier for your input and is unique to each block.

It is almost impossible to reverse a block hash to get the input data. However, once an input is known, it is easy to confirm that the hash is correct. You just need to send the input through the function and check if the output is the same.

In Proof of Work, you must provide data whose hash matches certain conditions. But you don’t know how to do it. Your only option is to pass your data through a hash and check if it matches the conditions. Otherwise you will have to change your data a bit to get a different hash. Changing even one character in your data will result in a completely different result, so there’s no way to predict what the output might be. As a result, if you want to create a block, you are playing a guessing game. You take information about all the transactions you want to add and some other important data, and then hash them all together. But since your data set won’t change, you need to add a variable piece of information. Otherwise you will always get the same hash as the output. This variable data is named a Nonce. It’s a number that you’ll change after each attempt, so you’ll get a different hash each time. And this is what we call peaches.

In a nutshell, mining is the process of collecting blockchain data and hashing it along with a nonce until you find a specific hash. If you find a hash that meets the conditions set forth by the protocol, you have the right to broadcast the new block to the network. At this point, the other participants of the network will update their blockchain to include the new block. For today’s major cryptocurrencies, the conditions are difficult to satisfy. The higher the hash rate on the network, the harder it is to find a valid hash. This is done to ensure that new blocks are not discovered too quickly. As you can imagine, trying to guess a large number of hashes can be costly on your computer’s resources. You are consuming computational cycles and power. But the protocol will reward you with cryptocurrency if you find a valid hash.

Let’s recap what we know so far:

  • Digging is expensive.
  • You will be rewarded if you generate a valid block.
  • Knowing an input, users can easily check their hashes – non-mining users can verify that a block is valid without consuming much computing power.

Everything is still going well. But what if you try to cheat? What would stop you from putting a bunch of fraudulent transactions into the block and generating a valid hash? That was the case that led to the advent of public key cryptography. We won’t go into depth in this article, but you can learn through What is Public Key Cryptography? for a complete overview of it. In short, we use some neat cryptographic tricks that allow any user to verify if someone has permission to transfer the money they are trying to spend. When you create a transaction, you sign it. Anyone on the network can compare your signature with your public key, and check if they match. They will also check to see if you can actually spend your money and whether your total input is higher than your total output (i.e. you are not spending more than your total output). money you have).

Any block that includes an invalid transaction will be automatically rejected by the network. Trying to cheat will be very costly for you. You will be wasting your resources without any reward. In this regard, Proof of Work shows the advantage: It makes cheating expensive, but it is beneficial to act in the right way. honest. Any rational miner will be looking for ROI, so they can be expected to behave in a way that guarantees revenue.

Proof of Work vs. Proof of Stake

There are many consensus algorithms, but one of the most anticipated is Proof of Stake (PoS). The concept dates back to 2011 and has been implemented in a number of smaller protocols. But it has yet to be seen in any major blockchain. In Proof of Stake systems, miners are replaced by validators. There is no mining and no hash race. Instead, users are chosen at random – if chosen, they must propose (or “forge”) a block. If the block is valid, they will receive a reward made up of fees from the block’s transactions. However, not any user can be chosen – the protocol chooses them based on a number element. To qualify, participants must lock a stake, which is a predetermined amount of the blockchain’s native coin. Stakes work like bail: just as defendants must deposit large sums of money to discourage them from skipping trial, validators lock a stake to discourage fraud. If they act dishonestly, their stake (or part of it) will be taken. Proof of Stake has several benefits over Proof of Work. What is most remarkable is the smaller carbon footprint – since PoS does not require high power mining farms, the power consumption is only a fraction of that of PoW.

That said, nothing comes close to PoW. While PoW can be considered wasteful, mining is the only consensus algorithm that is proven at scale. In just over a decade, it has secured transactions worth trillions of dollars. To say for sure whether PoS can compete with PoW in terms of security, PoS needs to be satisfactorily tested in practice.


Don’t forget to subscribe and join Kenhbit’s channel groups below to discuss with admins and many other members of the community.

Telegram gossip: https://t.me/kenhbit

Insight channel https://t.me/kenhbit_news

Let’s discuss at Vietnam Crypto Investment Community

Fanpage for quick news updates Vietnam Crypto Community฿


lnhngn

"Don't invest in what you don't know. Learn first then invest"