Explaining How Proof of Stake, Proof of Work, Hashing and Blockchain Work Together

Many of you may have heard about Proof of Stake, specifically that Ethereum is moving toward a hybrid model using Proof of Stake and Proof of Work.

But of course, the same lot of you probably asked, “What the heck is Proof of Stake really?” Let’s dive into that.

There are, currently, two main Blockchain systems that the larger crypto-networks utilize:

  1. Proof of Work
  2. Proof of Stake

Both of these Blockchain systems govern how transactions are verified on the decentralized network. So before we explain what Proof of Stake is, we need to explain how Blockchains are formed.

Hashes, Blocks, and Blockchains

Take a look at this video to better explain the fundamental parts of a Blockchain. You can play around with making (conceptual) hashes, blocks, and blockchains here.

  • What is a Hash? A hash is the result of a hash function — or a function that simply takes data and converts it to an almost-unique, fixed size 256-bit (32-byte) string of numbers and letters. Here’s an example:

SHA256 + “Hello World” = a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e

Try this here. As you can see, even a small change in the initial data will completely change the hash!

SHA256 + “Hello Worl” = 12fec4c65dd4455c48aff8977a7cd8ccb97539ad4cd7c37f13cf71ba8bee9a98

  • What is a Block? A block is a group of transactions in chronological order (or the best chronological order that the miner nodes can agree and organize the transactions in). Every block has, as its data, the hash of the previous block. Each block is made of a Block Header and a “Block Body.”
The information in a Block Header

Here’s a few crucial “Block” facts:

  1. The main way of identifying a block in the blockchain is via its block header hash.
  2. The block header hash is calculated by running the block header through the SHA256 algorithm twice.
  3. A block header hash is not sent through the network but instead is calculated by each node as part of the verification process of each block.
  • What is a Blockchain? A chain of Blocks, where each Block references the previous Block’s hash (as seen below)

Getting to the Point — Proof of Work and Proof of Stake

Since each Blockchain is a system of decentralized “nodes” (or computers confirming transactions occurring on the network and maintaining a decentralized consensus across the system) it is important for these nodes, also known as “miners” in the Proof of Work system, or “Validators” in the Proof of Stake system, to be incentivized to keep confirming transactions.

The way in which “miner” or “validator” nodes confirm transactions and how those nodes are incentivized to do so is the main distinction between Proof of Work and Proof of Stake.

So….what the heck are Miners? Here’s a good explanation in terms of Bitcoin — NOTE, Miners only exist in Proof of Work:

Let’s take a look of a few illustrations to get a better idea of each of these systems via the following explanation:

A system comparison via a graphic breakdown as well:

Proof of Work vs. Proof of Stake

And, lastly, a feature comparison:

Simply put, here are some concise definitions:

Proof of Work: A Proof-of-Work system requires its users to perform some form of work to participate. The work must be difficult for the client but easy for the server/network to verify. In Bitcoin and Ethereum, PoW exists in the form of Miner nodes competing to “solve a Block,” or group transactions together in (potential) chronological order and have that block accepted onto the global Blockchain of that system.

The only way to have it’s block accepted is to correctly guess the nonce, or a pseudo-random number generated by the network to be solved in a certain amount of time. Those Miner nodes that don’t guess the nonce before another must start over and try to guess the new nonce. Here’s a breakdown of the PoW System.

Proof of Stake: Proof of stake is a different way to validate transactions based and achieve the distributed consensus. It is still an algorithm, and the purpose is the same of the proof of work, but the process to reach the goal is quite different.

Unlike the proof-of-Work, where the algorithm rewards miners who solve mathematical problems with the goal of validating transactions and creating new blocks, with the proof of stake, the creator of a new block is chosen in a deterministic way, depending on its wealth, also defined as stake. This means that in the PoS system there is no block reward, so, the miners take the transaction fees. (Source)

And that’s it! Let me know if you have any questions, as I’d love to attend to any questions you might have!