Proof of Work vs. Proof of Stake

proof of work versus proof of stake
 

Proof of Work and Proof of Stake are two methods for keeping the blockchain in agreement and running properly. Proof of Work is the older model, and due to cost and speed concerns, Proof of Stake is quickly gaining in popularity.

Proof of Work vs Proof of Stake

Blockchains are distributed platforms, meaning that the ledger, which contains all the data flowing through the platform, is hosted on all the computers (or nodes) of a given blockchain, simultaneously. This is a deceptively hard thing to do, since all of the computers hosting the blockchain must be kept in so-called “consensus.” This means they must all agree at all times about the contents of the blockchain they’re hosting.

How do they achieve this, in the context of a constantly updated list of content like a blockchain? A special software algorithm called a consensus algorithm.

Hashing

At a basic level, blockchain validation algorithms are based on the concept of “hashing.” A “hash” is just a mathematically scrambled version of a message -- in this case, the message is the contents of the blockchain in question, AKA the ledger. The hash function is relatively easy to run, reducing the whole message to just a 64-character string of letters and numbers -- and the function can create a unique 64-character hash even from gigabytes of starting information! This output string, referred to as the “hash” of the original message, can never be used to derive the original message, not even by the same person or machine that did the hash-scrambling in the first place.

So why are hashes useful? Two reasons.

The first reason is that, because they can never be used to regenerate the original message, hashes of sensitive information can be freely shared without fear of compromising the information itself. Hash functions are very sensitive to changes in the input string, meaning that if we hash two 10,000-word messages that contain just a single changed character, they will still produce completely different output strings. This means that any similarity between two hashes means nothing about the similarity between the two starting messages they represent.

The second reason hashes are useful is that, although hash outputs between similar messages will vary widely, any two identical messages will always produce identical hash outputs. This is reliable, meaning that if we see two identical hashes, we know for sure that they are a hash of the same starting text.

So these two factors make hash functions freely shareable codes that can be used to check identicality between hidden pieces of information. If two hash outputs match, you know the input strings match as well -- even if you don’t know the input strings, themselves.

Ethereum based blockchain services

In the blockchain, this ability is used to check that the hidden contents of a blockchain have not been tampered with. If the hash from a particular part of a blockchain is identical to the hash it produced before, then the contents of that block are the same as they were the last time they were hashed. We can know this without having to know anything at all about the actual contents in question.

There are several ways of using hash outputs from the blockchain to ensure that the ledger remains consistent with agreed-upon contents -- the concept of consensus, from earlier.

The oldest and most popular overall types are called Proof of Work and Proof of Stake.

Proof of Work (PoW)

In a proof of work system, a record of each new transaction gets added to the latest “block” of transactions until that block reaches a critical file size. Now “full,” the block is hashed -- but the hash output string is kept secret. The blockchain’s “miners” then begin to try to guess this hash without knowing the original text that went into it, which is a vastly more difficult and time-consuming process than creating that hash in the first place. When the hash has been revealed, the contents of the blockchain can be checked without being revealed. In a Proof of Work setup, users who pay to mine with the most computing power will, on average, be more likely to correctly guess the hash before anyone else. The first miner to correctly guess the hash for each block is rewarded with a new token within the particular blockchain, thus creating an incentive to do the hard and expensive work of mining.

So, we have a system in which miners can recoup profits, and which uses the difficulty of hash-guessing as a reliable limiting factor on the pace of new token creation. The Proof of Work consensus algorithm, which essentially exists to check hash strings against one another, thus also dictates the rate of new token creation.

proof of work

Proof of Stake (PoS)

In a proof of stake model, the chance of validating a block and receiving a token is proportional to the user’s level of “stake” in the blockchain. Users who “stake” tokens in a blockchain have locked those tokens away, temporarily waiving their right to withdraw them. This helps keep the token’s value stable, and it makes any people with a large amount of staked value dependent on the validity and stability of the blockchain that secures that value. The more tokens a user stakes, the more of a voice they get within the system, on the assumption that their incentives align with those of the blockchain itself, and that they can thus be trusted with its care more than users who have less at “stake” in the system. New coins are handed out a little bit like interest on an investment -- staking (investing) more tokens leads to a greater influx of new tokens, over time.

This all functionally removes the need for mining, the energy- and funding-intensive process that is responsible for Bitcoin’s legendary electricity draw. That’s great, though some are still leery of giving certain users greater power to dictate consensus -- regardless of any incentives at play, they view it as a fundamental breaking of the decentralized security of the blockchain. Defenders of Proof of Stake point out that a Proof of Work model can be compromised if a single group controls more than 50% of all the nodes.

proof of stake

Beyond Proof of Stake

There are other, potentially more advanced versions of consensus algorithms, notably one called Delegated Proof of Stake (DPoS). However, the basic shape of the idea is defined by the historical Proof of Work and more modern Proof of Stake models. With these concepts in hand, it will be much easier to appraise any more nuanced models you encounter.