Emerald Blockchain Course: 9. How Proof of Work (PoW) Works

And how it enables a high degree of security in a blockchain.

Image of Donald McIntyre

By Donald McIntyre

August 8th, 2022

post image

Emerald Blockchain Course class 9 about Proof of Work (PoW).

You can watch this class here:

In the following sections we will explain how proof of work based Nakamoto Consensus works and what are its security benefits.

1. What Is Nakamoto Consensus?

As explained in the class about Bitcoin, Nakamoto Consensus starts with the blockchain network that constantly receives new transactions from users.

Each transaction goes through full transmission, which means that it is sent to all machines participating in the network globally so all can have a copy of it.

The above means that there is full replication of all the data in all the nodes of the blockchain. All machines have the exact same history of transactions (and smart contracts in the case of programmable networks).

Nakamoto Consensus.

As seen in the diagram above, to add transactions to the database, a subset of machines called miners do what is called a proof of work hash or cryptographic stamp to seal each block of transactions.

Once each block of transactions is finished and stamped, then it is sent to all the other nodes in the network for verification and inclusion in the database. Because the database is formed by adding these blocks of transactions, then it is called a "blockchain".

Proof of work blockchains such as Bitcoin and Ethereum Classic have fixed supply of coins because as they go paying the rewards per block to the miners, these go diminishing in time and eventually will stop, so there will be a fixed amount of coins ever in each of these chains.

For example, Bitcoin will have only 21 million coins and Ethereum Classic will have 210 million coins in its entire history.

2. What is the "work" miners do in Proof of Work?

As shown in the diagram below, the actual "work" that miners do is basically generate millions of cryptographic stamps or hashes per second of the current set of transactions, together with a timestamp, the stamp or hash of the previous block, and an arbitrary number (technically called nonce).

Proof of work.

If the cryptographic stamp does not hit a very small target within all the possible outcomes, then they have to discard that hash and try again by using the same set of transactions, together with a timestamp, the stamp or hash of the previous block, but changing the arbitrary number.

This constant trial and error, millions of times per second, requires a lot of capital in computing power and electricity.

Once one of the miners in the global network hits the specified target by the protocol, then they send it immediately to the rest of the network for verification so they can earn the reward.

3. Benefits of Proof of Work

The process of proof of work explained above has 4 key advantages:

3.1. Enables consensus between all the machines participating in the network: The information of the proof of work is that the majority of the miners participated in creating it, spending enormous amounts of energy and capital. When all the nodes in the network receive this information with a block of transactions, they know this is the right block because any other block sent by imposters who did not do the work would be easily rejected. As all the nodes know exactly which is the right block every 10 minutes Bitcoin or 15 seconds in Ethereum Classic, then they all have exactly the same copy of the database, also known as blockchain, therefore all have absolute consensus on the history of transactions, accounts, balances, property, agreements, and state of dapps.

This is done without the need of any centralized or coordinating authority, therefore produces an unprecedented level of decentralization.

3.2. It is a focal point or chain selection point for exit and entry: The same information that enables global consensus of the database between machines run by strangers worldwide enables any machine who is running the protocol to join, leave, and join again the network whenever they want with no need of central control or anyone telling them which is the correct chain.

This enables an unprecedented level of permissionlessness never achieved before.

3.3. It protects the history of transactions: As proof of work is cumulative in a chain of blocks, because they all hash the header of the previous block, then the work done and difficulty are accumulated making it practically impossible to reorganize transactions of the past. And, the more time passes (more blocks) the more difficult it becomes to delete or reorganize transactions and states of the past.

Any malicious computing base who would want to reorganize a transaction that happened 100,000 blocks in the past would have to spend all the electricity and capital all over again for 100,000 blocks to be able to to it.

This is an enormous barrier and makes proof of work blockchain truly immutable.

3.4. The cost of creating blocks is equal to the cost of creating the money: This gives it the hard money quality analogous to gold in the real world and this is why it is called "digital gold".

4. Summary

In summary, the above benefits allow for proof of work blockchains to be truly decentralized, permissionless, immutable, and hence censorship resistant.

Thank you for following this class!

Please download and start using Emerald here: