Why Proof of Work is elegant and Proof of Stake is not

Benjamin Jordan
Coinmonks
11 min readOct 5, 2021

--

The best stadium, Busch Stadium | Wikimedia

After my last crypto-related post, in which I personally offended half of the crypto community (in my defense I only need 30% of the ETH2 network on my side — THAT’S A PROOF OF STAKE JOKE, FOLKS), a few people asked me to explain why I think Proof of Work (PoW) is so darn elegant and why Proof of Stake (PoS) is so darn… not.

This 2200-word article will be to you what the book Shoeless Joe was to me. You illiterate Philistines may know this book as the movie “Field of Dreams”. I am author W. P. Kinsella and this is Shoeless Crypto. It will be full of baseball metaphors.

You see, after reading Shoeless Joe, I don’t think I fell in first-hand-love with baseball, but Shoeless Joe painted a romantic picture of how someone could fall in first-hand-love with baseball. I became genuinely open to the mysteries of the sport. A sort of… second-hand-love. That is what I’m going to do in this article — except that in this analogy, replace baseball with PoW. Is it still not clear what I’m talking about? This article is going to make you fall in second-hand love with PoW.

I don’t know how to make this any clearer, folks.

Babe Ruth, thinking about DApps.

Elegant math

Let’s start with math, because everything good in the world starts with math (this article may be a bit more ham-fisted than Canadian National Book Award-winning Shoeless Joe). What makes some math more elegant than other math? Some people think all math is incomprehensible gibberish — but hold on, remember: I am Kinsella and you are learning to love baseball.

Let’s talk about fractions.

Fractions

Fractions are elegant because, among other reasons, they are simple and succinct. If I want to divide something in seven and take one piece for myself, I can write the result as a fraction:

That is how much I have. This isn’t two numbers, this is one number: one seventh. We have a choice now and we can choose to over-complicate this number and express it as a decimal:

Now, because of our dumb choice, we’ve lost the ability to work with this number very easily. Would you recognize this number as one seventh? If you with your flour-caked hands were rummaging around in the cup-measure drawer, mid-recipe, for the decimal teaspoons, would you know which one to grab?

There’s another problem here, though, much larger than adding a sixth tablespoon of baking soda when you meant to add a seventh: this decimal value does not equal one seventh. I changed one of the digits on you — did you notice? Hecks no you didn’t. It is exceptionally difficult to tell when there’s an error with your decimals. If I hadn’t spilled the fractional beans, you would never have noticed.

Two strikes for decimals (see, I told you baseball metaphors were incoming).

Another nice property of fractions is that I can easily reason about them in my head. For instance: what if I divide something into π pieces and want to take one? Why that’s easy, I would just have this many pieces (pronounced one-pieth):

This, just like one seventh, is a single number with an exact value. Now what if I want two of these? Oh that’s simple, I just put a 2 on top. If I were to try this with decimals, there would literally not be enough atoms in the universe to write the decimal expansion on.

Checkmate, you’re out decimals.

These are all properties that makes fractions more elegant than the straw-man-decimals I’ve constructed here. These properties of elegance are not binary, of course: they each exist on a continuum (which, coincidentally, cannot be represented by rational numbers — whoops). However, I’m describing some of the things that a mathematician might use to score elegance:

  • Simplicity
  • Easy to move around in your head
  • Easy to recognize failures

I’d love to further explore elegance in math, but for the same reason that Shoeless Joe is a mere 514 / 2 pages, I must move on.

Shea Stadium | Rudi Riet

Subscribe to Coinmonks Youtube Channel to get daily crypto news.

Elegant programming

Now, I’m just an amateur mathematician ((ℂ, +, *) is my Field of Dreams), but like anyone that has ever used Excel as part of their job, I am a professional programmer. So what makes elegant code? I don’t want to steal a base here, but we’re basically going to want our code to have the same properties as our math.

This may surprise you, but the most elegant code in world is zero lines long. It is the easiest code to write and the easiest code to understand. At a glance, I know what those zero lines do. I can hand those zero lines to any programmer at any skill level with reasonable assurance that they will be able to understand it as well. Those zero lines of code will be a breeze to maintain three years from now and will easily be the most bug free lines in the entire world.

But God help the programmer adding the next line of code.

This is obviously a stupid thing to write and you’re now, unfortunately, slightly stupider for having read it. However, this is how to build an airtight case by induction: start at the trivial case and work your way up.

After we add the next line of code, we need to reevaluate our program using the criteria I described above:

  • With more code, it is highly likely (though not necessary — calm down mouth-breathers) that we have added more complexity. Thus, our simplicity score trends down.
  • We have slightly more code a programmer has to move around in her head to reckon about the problem space. This means that, unfortunately, the mental dexterity score is also going to trend down.
  • How are we doing on our failure recognition score? This has, again, most likely gone down simply from having more places a failure could hide. The more code we add, and the more complicated the specific lines of code we add, the harder it is to see failures on the surface.
I’m a man of many graphs. Three in this case.

I can hear the cacophony of a thousand pairs of eyeglasses sliding up a thousand greasy noses: “well actually, I would classify the relationship between lines of code and mental mobility with a quintic decline and here you’re clearly using a cubic regression” — yes, thank you so much for that insightful contribution, Mr ComparatorBridgeOrderIteratorInstanceBean. I am clearly painting a picture of generalities here: primary colors, no vanishing point, no nuance. However, take it from me, a professional software enthusiast, that these things are generally true.

The bigger and more complex the problem we are trying to solve, the greater the size and age of the code-base we are solving it with, the worse we score on these measures of elegance.

Fenway Park | Wikimedia

Elegant Crypto

You can see where I’m going with this. My case is so dang airtight. Have I told you how airtight it is? Dang. Brand name Tupperware, inside an extra heavy, triple seal Ziploc. Mini-Houdini himself would have a time squeezing out of this one.

I am writing about math and programming because the original bitcoin whitepaper is a mix of these two domains (by the way, have you read my fanfic short-story about the unknown inventor of Bitcoin, entitled Satoshi Nakamoto: Time Traveler???). So when I say that PoS is “not elegant”, what I mean is that it scores poorly on these three measures.

Let’s examine my baseless claims.

  1. PoS is hugely complicated. Your crypto-enthusiast friend, unless she works for the Ethereum foundation, has no idea how an actual PoS implementation actually works. Vitalik Buterin can “throw this stuff around”, but for the rest of us mortals, we have to watch a 3-part series just to understand the basics of polynomial commitments. On the other hand (as I described in my previous post), I can explain a PoW scheme in a highly accurate way to anyone by just drawing some arrows and circles. I can even design a hash function (not a great one, but a hash function nonetheless) right in front of them. Proof of Stake scores low on the simplicity scale.
  2. Can I hold the a PoW scheme in my head and figure about it? I’m going to show you a picture, then I want you to close your eyes and move your brain around on it.

Crap, wait, I forgot about committees too, so you also need this picture in your head:

The Beacon Chain Ethereum 2.0 explainer you need to read first

Wait I also forgot the coin part. Aren’t there coins somewhere? I’m sure I have it here somewhere… And yes, I also definitely understand how that 3-hour polynomial commitment explainer series fits in here.

Alternatively, and I admit this is entirely possible: perhaps I’m waaaay off and all of you kind Coinbase day-traders really do get all this stuff.

3. Provided we can hold the above in our heads, let’s look for potential hiding places for bugs. It’s honestly difficult to even find a starting point because it’s unclear where you enter and leave the system. Let me start much simpler then: encryption.

Encryption is a core part of both PoW and PoS systems. However, this is an illustration to show how complex software is built. We need encryption to start building any of this stuff, and so we take for granted that good encryption both exists and that the same brogrammers that make up funny names for joke-coins also know how to use encryption well when actually writing the software.

Encryption is so incredibly complicated and easy to screw up, that there’s a common programming adage: don’t roll your own encryption. There are only a handful of trusted encryption libraries that every programmer around the world uses. These libraries are the subject of constant research studies, code reviews, and penetration tests. Literally thousands of PhDs scour this stuff, over decades, trying to find fault. These security researchers are bred in test tubes laced with a few drops of the dangerous kinds of science, and as babies they lay awake in their cribs staring up at mobiles made of conjectured bosons and imaginary numbers.

The complexity of encryption absolutely requires this much attention — and yet, in 2014, the Heartbleed bug made it through anyway, after being undetected for years. This bug was so bad that, among other things, it allowed hackers to steal any information sent over a secure web page. You know, like how all money works? I had a friend that told me he was not worried about this because he only used his card in person at stores and never online. He was very disappointed to learn that the TJ Maxx card reader does indeed “use the Internet”.

Of course the test-tube babies fixed this encryption issue, and of course that saved the world. Sigh. I foreshadowed the rest of the story — this is what great writers like myself and Officer-of-the-Order-of-Canada-Kinsella do. Remember that people then have to actually use the software correctly, which of course they didn’t. Five years after this issue was fixed, 200,000 servers in the wild were found to have still not upgraded to the fixed version.

This is what happens to complex software solving tricky problems. And I haven’t even mentioned Spectre and Meltdown, which affect both the computer I am writing this on and the computer you are reading it on.

As I stated to begin with, both PoS and PoW use these specific encryption libraries — however, my point is that tricky, complex ideas don’t come out through human fingertips and into computers magically unscathed. They come out sweaty, heaving, broken things. The trickier the idea, the more broken the software solution is likely to be.

Wrigley Field | Wally Gobetz

Worse is better

Kinsella concludes Shoeless Joe on, I would say, a hopeful note. Most non-sociopaths are teary by the final chapter and in the same way, I assume you are now reading these words through watery eyes. Unfortunately, this mess ends on a disappointment.

Elegance is unfortunately not — to quote the meme — “all the things”.

It is incredible what Frankenstein software lives and breathes in the wild, raking in breathtaking sums of money. And it’s not just about the money either— there is a lot of terrible, bug-ridden software that’s dang useful. Have you ever tried to use Gmail? Good grief what a dumpster fire! These monsters walk among us but, much like the golems of old, are best destroyed by the backspace key. Only simple software actually works, and even then it’s just a maybe.

However, while Proof of Stake does not measure up to the elegance of Proof of Work, I remain convinced that it is still our best future. You’ll be happy to know that I’m not a complete hypocrite. I really meant what I said and sold my screaming, 2000 Watt furnace — er, GPU miner.

Sigh.

Goodbye Proof of Work, my old friend. Time to get off the field.

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also, Read

--

--

Benjamin Jordan
Coinmonks

Tech, thought, teaching. Total loser. Founder @GMM, Adjunct @SLU. Formerly VPE @N3TWORK, CTO @Big Run Studios, CTO @Enklu, Studio Tech Director @NCSOFT.