If you’re in the crypto space, you’ve heard Proof of Something.
Maybe you recently heared Ethereum is moving away from Proof of Work to Proof of Stake for ETH 2.0, or you heard about Solana’s Proof of History that allows the blockchain to process transactions 30 times faster than VISA.
The proof of whatevers are consensus mechanisms, that means they help us agree on the state of the blockchain.
(In Newscaster voice)
All that and more explained, right here, right now.
In July 2021 (after the China Mining Ban), I set off on a super deep thought exercise (3 minutes on the toilet).
How can I create a blockchain that consumes less energy, with the same level of security?
I care about the environment, but shit, I thought I’d make a billion dollars if I solved the Proof of Work energy problem.
So, for a long time (3 minutes ish), I was in deep thought. Then I decided to check the internet, imagine my sadness when I discovered that a solution already existed since 2011.
In retrospect, it’s not that sad, stick around and you’ll find out why.
Why does crypto consume so much energy?
The reason, which I explain in more detail here, is if it doesn’t, the blockchain can’t be trusted.
A summary of the article I linked above is,
a block (a group of transactions in the same time frame), can only be added to the blockchain (the chain of blocks) by solving a complex problem.
The problem is complex to ensure security of the blockchain.
Since the blockchain is decentralized, anyone can create and add a block. The block is only valid when 51% of the network agree the block is valid.
If the block creation requirements aren’t difficult enough, anyone can create fake blocks.
Usually miners ignore blockchains containing a fraudulent block but the rule is the longest chain tells the truth. If mining is cheap, fraudulent blockchains can continue to grow at the same rate or even faster than the valid blockchain.
To prevent this, Satoshi Nakamoto invented Proof of Work and applied it to blockchain technology.
Proof of Work (PoW)
PoW is the OG, it’s the consensus system – Bitcoin and Ethereum 1.0 use PoW.
In Proof of Work, block miners race against each other to solve the complex problem first.
So this guy, and that guy, and that other guy, all do the exact same work, for one reward. The worst part is if multiple miners get the solution at the same time, only one of them gets the full reward (on the Bitcoin network, the other miners get nothing).
Needless to say, creating fraudulent blocks is pointless and you lose a shit ton of money doing it. The flip side is PoW wastes a lot of energy. So in 2011, someone by the alias ‘Quantum Mechanic’ told the world about his idea – Proof of Stake.
Proof of Stake (PoS)
In 2011, Quantum Mechanic proposed a system where, instead of having multiple miners racing against each other, we instead have just one validator (notice the change in terminology) per block.
This block validator is chosen pseudo-randomly. It’s pseudorandom because your chances of getting selected increase with the amount of crypto staked.
Hence the name Proof of Stake.
The stake also serves as a deterrent to attempt authorizing fake transactions. If a validator attempts to add an invalid block, the other validators reject the block and the bad actor loses part or all of his stake.
And, yes PoS isn’t proving your stake. We just wanted the name to be similar to PoW. Deal with it.
Moving on, the first coin to use PoS was PeerCoin, created waaay back in 2012.
Never heard of it? Neither have I.
Safe to say, I probably won’t have become a crypto billionaire if I invented PoS.
To wrap this section up, PoS is a greener replacement for PoW and it’s gaining popularity (Cardano and Solana use it). It’s the consensus system we’ll use going forward.
Proof of History
You’ve heard of Solana, if you’re deaf, you’ve seen it. It is the most capable ‘Ethereum Killer’.
Chances are you’ve heard about it’s Proof of History, but you’ve also heard Solana uses PoS. Now you’re more than a little confused.
I shall explain as a bonus. You’re welcome.
First, PoH isn’t a consensus system. Proof of History is a way to represent time as data.
In Proof of History, we use Verifiable Delay Functions (VDFs).
VDFs are functions that require multiple sequential steps to compute, but verification is independent of the number of steps.
In PoH, we use SHA-256, it’s a hashing algorithm.
A hashing algorithm takes any type of data as input but the output size is fixed. That means whether you hash anatoly or a 35 GB porno, their hashes will be the same size. In SHA-256, that’s 256 bits usually shorthanded in hexadecimal.
A hash looks like this; b5b4d037874c630bacc6c6617fbc10b53cfcc8d404825b2a77718be238838ccc. The hash for anatoly.
In PoH, we start from any random text, hash it and then hash the hash and so on.
This means a processor can only do it one step at at time (one one core).
But verifying is faster, just put all the steps on different cores, and check for an error by hashing and comparing. If there aren’t any, it’s a valid sequence.
The fun part is Solana uses this VDF as a clock.
Because we’re around the max possible speed for generating SHA 256 hashes, nobody’s ‘clock’ is significantly faster.
So we can agree on the amount of wall clock time without communicating or concencus.
Essentially, Decentralized ‘time’.
This ‘time’ is used to timestamp transactions.
So we know for sure that A happened before B, and B before C.
Because of the nature of VDFs, we can verify that the time-stamping is legitimate much faster than the amount of time it takes to stamp.
This way we can reduce block verification time.
Instead of having to individually check the transaction order, we can do it all at once and save time.
That is how Solana uses PoH to speed things up.
That wraps up this piece. Cue epic outro.
Wait, a TL;DR.
Block creation has to be difficult, if it isn’t, the blockchain becomes less secure. To improve energy consumption, instead of reducing block difficulty, reduce the redundant work – That’s Proof of Stake.
Proof of History creates decentralized time thereby reducing communication overhead.