Blockchain Basics: Proof of Work vs. Proof of Stake

Photo by Olya Kobruseva on Pexels.com

(Why do so many stock photos use Scrabble tiles?)

We have a great system going here: I write a post about cryptocurrency and you guys basically tell me what to write about next in the comments. Keep it coming! This will (hopefully) be a shorter post as it doesn’t take much to understand how the two models for blockchain verification work. We’re still not going to get too far into the weeds on what verification is for but, in short, verification ensures that people can’t try to spend the same money twice or nefariously alter the blockchain.

Work vs. Stake

There are two current models (the proper term is consensus mechanism) used to delegate verifiers, the people chosen (algorithmically) to create the next block in the chain and thus receive a portion of the transaction as a reward (you know, the whole reason anyone does this). Proof of work is the O.G. method baked into Bitcoin and is where the concept of “mining” came from. It’s still widely used by the Ethereum family of tokens, Dogecoin (still performing well despite being a meme), and the newer Monero1.

Proof of stake originated with Peercoin in 2012 and its consensus mechanism is based on how much of the currency individual validators have staked in the system. The most popular proof of stake currencies as of writing are Solana (my personal favorite “coin”… please don’t mistake this for financial advice, lol! It’s my favorite because it was my first), Polkadot, and Cosmos. Soon Ethereum 2.0 will probably crush all of them, value-wise, but if you don’t already own a bunch of Ether, that doesn’t matter for you.

Deep Dive: Proof of Work

Decentralization is central to cryptocurrency and blockchain technology in general. The problem with decentralization is that, if humans are involved, there will always be bias toward consolidation. One way to solve this problem, the method Bitcoin’s founder(s) devised, is to make people compete for the opportunity to validate the data in question.

Proof of Work Scenario: Bitcoin

You’re a Bitcoin miner back in the glory days of Bitcoin, when average people could still compete. You have four GTX 580s2 feverishly (quite feverishly as your bedroom is approximating a sauna by this point) brute forcing an impossible to solve cryptographic function. Computing power is all that matters here; there’s no user input or shortcuts. You have to hope that your “rig” arrives at the correct answer before every other miner in the world. If you crack it, you get a little Bitcoin sprinkled into your wallet (maybe even one whole Bitcoin if you jumped on the wagon early enough). If you don’t, your rig is notified when new work is available and moves on to the next problem without shedding a tear.

More Cons than Pros

It’s Ecologically Ridiculous

As people noted in the comments of my first post in this series, a major negative (major in bold, 40pt font) is proof of work amounts to converting electricity to cryptocurrency at a global rate which any investor would tell you is nuts, never mind an environmentalist. The problem is foundational to the model. If only one or a handful of miners can be chosen as validators, you are taking all of the energy that the other (over 1 million) miners are putting into the system and throwing it in the garbage. You might as well start up a power plant that burns coal 24/7 and not hook it up to a grid.

Proof of Work isn’t Even Close to Decentralized

You can’t blame Nakamoto for trying, but it didn’t work. When a miners ability to solve the current function is reliant solely on computing power, people and entities that can afford the most computing power will always win. If you’re an average person with a normal job and some decent I.T. chops, you have absolutely zero chance at mining Bitcoin in 2022. 82 accounts own 15% of the total Bitcoin supply, for example. That doesn’t sound like a lot, but just three of those people own more than the bottom 105 million. Sound like another economic system you might have heard of?

It’s Harder to Attack than Traditional Markets

Harder, but not impossible. The most feasible attack on a proof of work blockchain is called a 51% attack. If a threat agent manages to gain control of 51% of a networks computing power (practically impossible for Bitcoin but smaller networks have fallen prey), they can forge fake transactions or hide their own transactions, allowing them to double spend. This is because the blockchain ledger is governed by consensus: the majority of the nodes on a given network have to agree on all transactions before a block can be mined. If the threat agent controls over half of the network, it doesn’t matter how many good guys say “wait! no! this is all wrong!”, nobody is listening.

It’s possible to recover from such an attack. Due to the nature of how blockchains are managed, this corrupted chain will eventually be forked off into its own chain which becomes worthless because the legitimate nodes pretend it doesn’t exist. How much damage is done before then depends on the measures taken to rectify the situation and the infrastructure of the particular network.

For more on the 51% attack, and an interesting read, check out this Investopedia article.

Bitcoin gold is the latest crypto to suffer from a 51% attack. The Verge has reportedly suffered three 51% attacks this year. The latest one occurred yesterday. Last week, a hacker exploited a vulnerability that had caused the previous 51% attack to decamp with $35 million worth of its cryptocurrency.

Investopedia

All that said, one can’t simply “hack” a cryptocurrency the way they could a bank or e-commerce portal; the whole thing is built cryptographically, even its name. You’d have more success walking at a moderate pace from your house to the sun before you could reverse engineer a SHA-256 hash3.

Deep Dive: Proof of Stake

Proof of stake is far more environmentally friendly than proof of work, which is important for a lot of people. It also has the possibility of being more democratic depending on how the governance of the particular network is designed. “Stake” in the blockchain context is the same as other arenas, making it a fair bit easier for normal human beings to understand than proof of work.

Staking

It’s important to note that staking isn’t new despite it being popularized lately with Ethereum’s pending transition to the model. Staking also isn’t one thing but rather has various implementations, each with their own pros and cons (making it hard to come up with one pro and con list for all of PoS). At the heart of every implementation, though, staking is just putting your currency up as collateral in exchange for the opportunity to validate blocks (and potentially other perks depending on the network in question).

Some blogs I read while researching PoS seemed to incorrectly draw comparisons between staking and interest. Interest is a contractually guaranteed gain on your investment; with staking you have no guarantee that you’ll even be chosen as a validator and if you are there’s no guarantee what your return will be (we can say it’s usually a good return).

That said, there are proof of stake networks that offer interest as an incentive. Cosmos (ATOM) for example offers a 5.00% APY which rivals most every bank account I’ve seen.

Like seriously, what is this bullsh**? Does anyone under 50 have a savings account?

Validation

Choosing validators isn’t a one-size-fits-all method. Each network seems to have its own protocols and incentives for stakeholders, which is a good thing at this stage of the game. Various currencies trying different strategies will help us in the long term to decide which ones work the best.

I’m a big fan of stake value being calculated by length of time it’s been staked rather than how much you have staked, especially if we’re trying to maintain decentralization. Time-based value helps to ensure the people who believe most in the network and are willing to stick with it are rewarded rather than people or entities that can front large sums of cash to purchase and stake coins all at once. This makes investing more fun too because you can choose something you believe in to stake your finances in.

Equally… good… is that many people can be chosen as validators per block. To reference Investopedia again, when Ethereum becomes proof of stake, it will use a version of the model that has validators adding transitions to shard blocks. Once a block is full, 128 validators “mine” the block (verify it’s all correct) which relies on 2/3 consensus of those 128 validators.

Security

Proof of stake networks are still susceptible to the 51% attack but since a miner has to stake their own currency to become a validator, such an attack would result in the miner losing all of their staked coins once the attack was detected and inevitably rectified. There could still be reasons a malicious actor would want to sacrifice currency to disrupt a network but this would dissuade the majority of “casual” hackers.

Proof of Stake’s Biggest Pro: It’s Real Real Fast

One of the reasons it costs so much money to complete a transaction on Ethereum is the computational power required to do so. We haven’t talked about GAS yet and likely won’t for some time because it’s quickly becoming irrelevant, but having miners chosen from a pool of stakeholders vs. having them compete to close blocks saves a whole boat load of time and energy.

When a transaction is submitted to Ethereum, the initiator specifies how much they’re willing to pay to be “first” in line. Miners automagically choose the most lucrative transactions which means during peak periods of activity you could be waiting over a day for your transaction to process if you aren’t willing to grease some palms. Proof of stake networks have no such problem; their transactions are blazing fast because they’re served to pre-chosen validators immediately. You still need to wait for the current block on the chain to be closed for your transaction to be “processed” but that could take a whopping 5 minutes at peak times. When I created my own token, I had to wait around 2 seconds and I can’t be sure that wasn’t just the time it took my browser to refresh.

In Closing

I must mention, again, that I’m not an expert and I’m learning all of this at about the same pace I’m writing it. I find teaching to be a great way to learn (for me) but I might get some things wrong. If I do, don’t hesitate to (politely) let me know. I’ll update all of these entries as needed.

1 I mine Monero on a Raspberry Pi 3 and lose several dollars a month in power consumption costs rather than making any money whatsoever. It’s an educational project and not a get rich quick scheme, that’s for sure!

2 Referenced partly to show how powerful GPUs have gotten in ten years. The 580 was a top dog in 2010, but cards from even 4 years ago dwarf it.

3 You don’t need to know what this is and can take my word that this statement is true. If you’re interested, though, read this. It even has a fun little hash generator you can play with to see how it works. Well… to see that it works, not how.

 

2 comments

  1. “You’d have more success walking at a moderate pace from your house to the sun before you could reverse engineer a SHA-256 hash.” – I like this! To extend this analogy, does salting slow down people who have already mapped out express routes to the sun?

    I’m one of those under-50 people who has a savings account, mostly because ever since illness started interfering with the reliability of income, it’s been important to me to have a chunk of easy-access money that isn’t going anywhere beyond what I’m losing from inflating outpacing the interest rate.

    1. I’d advocate for the liquidity of some cryptocurrencies, but I’m biased. 😉 I understand having savings; I have an emergency savings account as well but its meager interest wasn’t what enticed me. If I put all my money in my checking account, I’ll spend it. It’s a given!

Leave a comment

Your email address will not be published. Required fields are marked *