Blockchain: What it is, What it isn’t and Why You Should Care — Pt. 2

Sabio Coding Bootcamp
Sabio Coding Bootcamp
7 min readJul 12, 2018

--

Written by Sabio Instructors, Steven Hernandez & Hector Arias

Achieving Consensus without Central Governance

Steven Hernandez, Sabio Instructor and Blockchain Developer

Mining/Proof of Work consensus is an incredibly clever governance solution based on game theory that rewards the nodes of a network for truthful and productive behavior, while making it prohibitively expensive to be dishonest. The benefit gained by good behavior far outweighs the benefit gained by bad behavior, so much so that you can count on good behavior to happen far more frequently than any bad behavior. To illustrate the key points of this protocol, I’ve developed an analogy that I hope helps to demystify this oft-misunderstood concept.

Blockchain: What it is, What is isn’t and Why You Should Care

You can think of the Proof of Work consensus protocol underlying cryptocurrencies such as Bitcoin as a game played in a room full of accountants. Let’s call this the “Game of Accountants”. The rules of the game are simple: during each new round, try to be the first accountant to gather together a page of client transactions, and attach a valid solution to the Sudoku puzzle that was provided for that round. Shout out “SUDOKU!” when this task is complete, and if you’re the first one to provide the page of transactions and a valid Sudoku solution, you win 100,000 SudoDollars,

The Rules of the Game

which gets added to your account on that newly minted page of transactions. The Sudoku puzzles being generated each round are designed to be just difficult enough for a solution to be found within 10 minutes, so even if people start to get really good at solving the puzzles, the puzzles will get gradually more difficult to ensure that a new page is still added to the binder roughly every 10 minutes.

You, as one of the accountants, have a binder full of pages that contains the signed, timestamped transaction receipts of anonymous clients from all around the world. In the center of the room is a pile of envelopes containing the transaction receipts that have been signed by those clients, with new envelopes being delivered into the room all the time. Every 10 minutes or so, just after the previous Sudoku puzzle prize was distributed, a new round starts immediately. You and the other accountants gather together these receipts as quickly as possible.

Since only a certain number of entries can fit onto a page, you prioritize adding the transactions that include the biggest tips from clients first. After all, an accountant’s got to eat! You and the other accountants race to write down the transactions onto the current page, and once completed, undergo the task of solving the round’s random sudoku puzzle to be able to submit your page for the grand prize.

You work at a frenzied pace, filling in a 1 here and a 5 there, until after 10 stressful minutes, you finally fill in the last block. “SUDOKU!” You scream out with sweat dripping from your brow. Because you’re the first to submit a valid solution for the round, that round’s prize money goes to you! You happily include the amount of 100,000 SudoDollars onto the page, and all other accountants must accept it because one of the game’s rules is to accept the earliest valid Sudoku solution for the round. The next round starts immediately, and the game continues on with renewed vigor as the accountants trade their time and effort for a chance at the prize money.

Over time, one of the accountants decides he wants to try and game the system by spending his SudoDollars in one place, and then immediately racing to finish the Sudoku puzzle faster than everyone else in the room in order to submit a page of transactions reflecting he still has all of his SudoDollars. He gets lucky and finishes the puzzle first, submitting his page of transactions to be added as the new history. There are now two versions of the binder: one version where he has all his SudoDollars still, and one where he has spent them. This would be devastating if not for the fact that built into the rules of the game is a clause stating that competing versions of the binder will be resolved by choosing to adopt the binder that is at least 6 pages ahead of the nearest competing version.

Blockchain Explained

This relies on the assumption that the majority of accountants are working in their own best interest by spending their resources to generate truthful pages. If so, the truthful version of the binder will always eventually fill up faster, outpacing the dishonest version of the binder and discarding the hard work and earned Sudoku rewards included in the falsified pages of the lying accountant. Therefore, in order for this dishonest accountant to keep up his version of history as the one everyone accepts, he must continue winning the Sudoku puzzle race 6 times in a row. Perhaps he will get lucky a few times, but 6 in a row would be considered mathematically impossible. Therefore, as long as the majority of the accountants playing the game are playing to win, the game will always self-correct to the honest version of the transaction history.

Nodes

Now, I realize this is not a perfect analogy, but I hope it helps you to visualize some of the basic features of the protocol and demonstrate how aligning incentives using game theory makes self-governance possible even among untrusted parties. You may have noticed that I highlighted a few words in that analogy. They are directly connected to blockchain terms you may have come across in your own research. The accountants in this analogy represent the specialized computers, called nodes, of the blockchain network that are spending their computing resources to gather up the signed transaction receipts of users (clients in the analogy) from the mempool (the pile of receipts in the center of the room), prioritizing the transactions that have attached the highest miner’s fee (tip from the client), into a block of transactions (a single page in the analogy) and be the first to submit a valid Proof of Work (the valid Sudoku puzzle solution) in order to win the 12.5 Bitcoin block reward (100,000 SudoDollar prize). This new block, including the newly minted 12.5 Bitcoin reward, gets added to the blockchain (the accountant’s binder full of pages). Over time, the amount of computing power required on average to generate a valid Proof of Work (the difficulty level) will automatically adjust every predetermined number of blocks, referred to as a difficulty adjustment, so that it always takes roughly 10 minutes to solve, a time period known as the block interval.

Blockchain Explained

There are also some mechanisms in place that allow nodes in the network to reach an agreement about which chain should be the active chain that everyone accepts, even in the face of many varying versions of chains, by choosing the chain with the most work attached to it (similar to the situation where the lying accountant has to win the puzzle prize an unrealistic number of times for his version to be chosen as the active binder).

Blockchain Explained

This may seem like an arbitrary game with no real purpose, but this act of tying real resources to digital ones is essential to preventing counterfeiting in the digital world. This consensus algorithm, this “Proof of Sudoku”, if you will, is what incentivizes people all around the world, whom you don’t know and have no reason to trust, to expend their resources and ensure the validity of your transactions. This is not the only version of the game, however. There are many blockchains other than the Bitcoin blockchain. Bitcoin just happens to be the most widely known and accepted blockchain. Other blockchains may choose to specialize for different use cases, leading to an explosion of new blockchains with their own versions of the game that satisfy the demands of their niche. In the next article of this series, we will explore some of these alternatives and what they can do. See you then!

For more information on Sabio’s Blockchain class check out: https://sabio.la/training/blockchain

To Read Part 1 of this article click here.

To Read Part 3 of this article click here.

To Read Part 4 of this article click here.

To Read Part 5 of this article click here.

--

--

Lead by the most senior coding bootcamp staff in the industry, we are the premier Software Engineering program in Southern California. #CodingBootcamp