What is Proof of Work – Proof of Work (PoW)?

What is Proof of Work - Proof of Work (PoW)?

Proof of Work, often abbreviated as “PoW”, is a mechanism to avoid double spending. Major cryptographic currencies use PoW as a consensus algorithm, which is a method to protect Cryptocurrencies from a distributed ledger.

Proof of work was the first consensus algorithm created and to this day it remains the main one. It was introduced by Satoshi Nakamoto in the white paper for Bitcoin in 2008, but the technology itself was conceived long before that.

Adam Back's HashCash is an early example of a Proof of Work algorithm that predates the Crypto. By requiring senders to do a little computer check before sending an email, recipients could reduce spam.

This check was quick and simple for the user who was sending the email, but it would be a problem for someone who was sending out bulk emails, as is the case with spam emails.

What is Double-Spend

A double spend occurs when the same funds are spent more than once. The term is used almost exclusively in the context of digital money — after all, it would be difficult to spend the same money twice when it's physical.

When you buy a snack, you hand the money to the cashier who probably blocks it in some way. You will not be able to go across the street and pay for another snack with the same bill.

In digital money schemes, this possibility exists. You may have duplicated a computer file before — just copy and paste. You can send the same email file to ten, twenty, fifty people.

Since digital money is simply a set of data, you have to prevent people from copying and spending the same units in different places. Otherwise, the system of the respective criptomoeda will collapse.

Why is Proof of Work Required?

If you've read about blockchains (Blockchain), you already know that users transmit transactions to the network. However, these transactions are not considered valid immediately. This only happens when they are added to the block chain.

Why is Proof of Work Required?

The blockchain is a large database that all users can see, and it is possible to check if funds were previously spent. Think about it: You and three friends have a notebook. Whenever one of you transfers any unit, you record it in the notebook—Maria paid João five units, João paid Angela two units, and so on.

There's one more thing — whenever you make a transaction, you make a reference to the transaction from which the funds came. So if John paid Carol with two units, the down payment would be as follows: John pays Carol two units from that previous transaction with Alice.

Now we will have a way to track the units. If John tries to make another transaction using the same units he just sent Carol, everyone will know immediately. The group will not allow the transaction to be entered into Notepad.

This can work well in a small group. Since everyone knows each other, they will likely come to an agreement on which friends can add transactions to the notebook. But what if we want a group of 10.000 participants? The notebook idea would not be suitable, as no one wants to trust a stranger to manage transaction records.

This is where the Proof of Work comes in. It ensures that users don't spend money they don't have the right to spend. Using a combination of game theory and cryptography, a PoW algorithm allows anyone to update the block chain according to the rules of the system.

How Does PoW Work?

Our notebook in the example above is the notebook. But we don't add transactions one by one—instead, we group them into blocks. Transactions are advertised to the network, so when creating a tile, users will add transactions to a candidate tile.

Transactions will be considered valid only when the candidate block becomes a committed block, which means that it was actually added to the Block chain (blockcaine).

However, attaching a block is not a cheap process. Proof of Work requires a miner (the user who creates the block) to use their own resources to have this privilege. This feature is computational power, used to hash the block data until a solution to the puzzle is found.

To generate a block hash, the hash process submits block data to a hash function. The block hash works like a “fingerprint” — it is an identity of the input data and is unique for each block.

It is practically impossible to reverse a block hash to get the input data. Knowing an entry, however, makes it easy to confirm that the hash is correct. Just submit the input to the function and verify that the output is the same.

In the Proof of Work, you must provide data whose hash meets certain conditions. But you don't know how to get there. Your only option is to submit your data to a hash function and verify that it meets the conditions.

Otherwise, you'll have to change your data a bit to get a different hash. Changing a single character in your data will result in an entirely different output, so there is no way to predict the output.

So if you want to create a block, you're playing a guessing game. Usually you get information about all the transactions you want to add and some other important data, and then you group everything into a hash.

However, since your dataset is fixed, you will need to add variable information. Otherwise you would always get the same hash as an output. These variable data are what we call nuncio. It's a number that you change to get a different hash each time you try. This is the process we call mining.

In short, mining is the process of collecting block chain data and hashing it, using a nonce, until you find a specific hash as an output. If you find a hash that meets the conditions established by the protocol, you have the right to transmit the new block to the network. Once this is done, the other network participants will update their block chains to include the newly created block.

For today's major crypto currencies, the conditions are incredibly difficult to meet. The higher the hash rate on the network, the harder it is to find a valid hash. The hashe rate is adjusted to ensure that valid blocks are not found too quickly.

As you can imagine, trying to abundantly guess the hashes using a computer can be a very expensive process. You would be wasting computational cycles and electricity. But if you find a valid hash, the protocol will reward you with Cryptocurrencies.

Let's recap what we've seen so far:

  • Mining is a very expensive process.
  • You are winning for producing a valid block.
  • By knowing an entry, a user can easily check its hash — non-mining users can check whether a block is valid without requiring a lot of computing power.

So far so good. But what if someone tries to cheat? What prevents a user from entering fraudulent transactions into the block and producing a valid hash?

This is where public key cryptography comes in. We won't go into more detail here, but see the article public key encryption. For a more comprehensive view of this subject. In summary, we use some cryptographic tricks that allow any user to verify that someone has the right to move the funds they are trying to spend.

When you create a transaction, you sign it. Any user on the network can compare your signature to your public key and verify that it matches.

They will also verify that you can actually spend the funds, and that the sum of your inflows is greater than the sum of your outflows—that is, that you are not spending more than you actually spent.

Any block that includes a transaction that is not valid will be automatically rejected by the network. Trying to cheat is expensive. You will waste your resources without receiving any rewards.

That's the magic of Proof of Work: It's expensive to cheat, but it's profitable to act honestly. Any rational miner seeks return on investment, ROI. In other words, the expectation is that they behave in a way that guarantees their profits.

Proof of Work vs. Proof of Stake

There are many consensus algorithms, but Proof of Stake – PoS is the one that has generated the most expectations. It is a 2011 conception and has already been implemented in several smaller protocols. However, it has not yet been adopted in any of the main block chains.

What is Proof of Work - Proof of Work (PoW)?

In Proof of Stake systems, miners are replaced by validators. There is no mining involved, nor is there competition to guess hashes. Instead, users are selected at random — if selected, they must propose (or “forge”) a block. If the block is valid, they will receive a reward consisting of the block transaction fees.

Not just any user can be selected — the protocol chooses them considering many factors. To be eligible, participants must keep locked in a stake amount, which is a predetermined amount of the native currency of the block chain.

Participation acts as a guarantee: just as defendants must spend a large amount of money to discourage them from missing judgment, validators maintain a participation value to discourage cheating. If they act dishonestly, the stake value (or part of it) will be lost.

Proof of Stake some advantages over Proof of Work. The highlight is the lower energy consumption — since in PoS, there is no need for mining farms that consume as much energy. The electricity consumed is only a fraction of what is used in PoW.

PoS doesn't even come close to PoW usage history. While this might be considered wasteful, mining is the only consensus algorithm that has proven effective on a large scale. In just over a decade, he has secured the transfer of trillions of dollars in transactions.

To be sure that PoS can compete with PoW security, Staking must be properly tested on a large scale.

Conclusion

Proof of Work was the original solution to the double-spend problem and proved to be a reliable and safe method. Bitcoin has proven that we don't need centralized entities to prevent the same funds from being spent twice.

With the intelligent use of cryptography, hashing functions and game theory, participants in a decentralized environment can reach a consensus on the state of a financial database.

5 / 5 - (5 votes)

Related Posts

error: