Part V — Blockchain 101: A Simple Introduction to the Most Groundbreaking Innovation of the 21st Century

Kiran Banakar
Coinmonks

--

Welcome to the final part of our series. In this part, we will introduce the last vital elements of the Blockchain technology: Consensus Mechanisms, Proof-of-Work and Mining. Before we resume our sandbox analogy, please make sure you have read and understood the last part of this series (Part IV, here).

Photo by Greg Rakozy on Unsplash

“Sarah, did you notice that, in our money system, nobody can ever own more than 100 Sandbox-Euros?” Laura asks you. “In the beginning, when we created our currency, we gave everybody 25 Sandbox-Euros (see Part I). Since we are four kids in our little world doing business, the total amount of Sandbox-Euros is only 100 Sandbox-Euros. This means that nobody is ever going to be wealthier than this amount. I fear that this upper ceiling in our currency will result in a somewhat limited economy. You see, we are growing our products and services. In the beginning, we only sold sand cookies and cakes. Then, services emerged and now we have a huge range of different products and services we are selling to each other. Thus, our economy enjoyed high growth since the beginning. But our currency didn’t enjoy any growth at all — the total amount is still the same as in the beginning. I am afraid that if we don’t find a solution, our economy will come to a standstill, even though we are more productive than ever. There are just not enough means to exchange value with each other. What do you think?” Laura looks at you.

Laura is right, you think to yourself. You have been observing the same problem for a while now, since you noticed that the prices in your system have been falling. In the beginning, one sand cookie cost 5 Sandbox-Euros, but now it only costs 1 Sandbox-Euro. One way of looking at it is that a sand cookie may now be cheaper in production, resulting in a lower price. The other perspective is that the buying power of the Sandbox-Euro has risen. In other words: 1 Sandbox-Euro today can buy as many products as did 5 Sandbox-Euros in the past. This might be a good thing, but if we project this development into the future, we will see the buying power of one Sandbox-Euro rising forever. Where will this lead to? We cannot predict the future, but what we can safely assume is how you and your friends are going to react to the rising value of the Sandbox-Euro: since you know that one Sandbox-Euro is more valuable tomorrow compared to today, you will stop buying things, because you could buy more things if you would just wait some time. The conclusion is: everybody is going to stop buying things today, because all of you would want to buy more things in the future. Thus, the economy would come to a standstill.

Worried, you and Laura call your friends and Mehmet’s mother to tell them your concerns. After much talking, everyone agrees that you need a mechanism to raise the total amount of Sandbox-Euros in your system to keep pace with the growth of products and services.

“Well,” starts Mehmet’s mother, “one good thing is that our money system has been developed by all of us. We have set the rules, so we can also change these rules if we all agree to these changes, right?”

“Yes, that’s right.” Daniel says.

“Okay, the first thing we need to answer is who is going to receive the freshly created Sandbox-Euros?” Mehmet’s mother asks.

“Oh, that’s clear. You should get them, since you are our organizing entity, Mom.” Mehmet says.

“But I am just the organizing entity! I don’t consume things, eat sand cookies or buy your services. I am just keeping track of everyone’s balances. If the newly created Sandbox-Euros are with me, how are they ever coming into circulation in your economy?” Making her point clear, Mehmet’s mother questions the children.

“I see, you are right. Well then…” Daniel thinks aloud. “What if we just split them evenly among all of us?”

“No, that would lead to us not trying to be productive anymore. We would just wait for the next batch of newly created Sandbox-Euros to get deposited in our account, and we would stop producing and selling stuff.” Laura says.

“You’ve got a point. Well, what if we create some activity where we can earn the newly created Sandbox-Euros? The more you invest time and energy in that activity, the more you earn.” Mehmet suggests.

“Hold on! I have got an idea!” Laura calls out.

“Nice! Tell us about it!” Mehmet’s mother says.

“Alright. When Mehmet said that we should find a way to earn the Sandbox-Euros through investing time and energy in an activity, I somehow had to think of the work Mehmet’s mother is doing for us all the time. Even though she is extremely efficient and fast, she is still investing time and energy in keeping our money system healthy and alive. Now, what if we tweak this activity into a competition?” Laura suggests, excited.

“Competition? Can you explain?” Daniel is clueless.

“Yes, of course. By competition I mean this: rather than just one person organizing our money system, all of us could participate in that process. What I have in mind is that the very act of updating our list of balance information can become a competition. The first person who manages to correctly update the list gets a reward of a pre-determined amount of Sandbox-Euros. That way, keeping our money system healthy results in raising the total amount of Sandbox-Euros in our world. What do you think?” Laura beams proudly.

“This sounds good, but I have some questions.” You are still not convinced. “If all of us can earn more Sandbox-Euros in that way, then we would stop producing goods and services and instead focus on updating the list. This results in no economic activity and thus there would not be any orders outstanding, which need to be processed to update the list. Do you see what I am afraid of?”

“Sarah, that is a very thoughtful remark you made.” Mehmet’s mother says, appreciatively. “I think I have a solution for this problem, but first I need to tell you how I arrived at this solution. When Laura proposed the competition, I immediately thought: “Oh no, I was happy that we had a pre-defined interval of 10 minutes (see Part II), because I enjoyed the free time in between updating the list. But with Laura’s solution, which, by the way, is brilliant,” Mehmet’s mother nods to Laura, “there would not be any free time left, because the competition is about who is going to be the first to update the list.”

“Ah, you’re right, I didn’t think about that point.” Laura says, thoughtful.

“Don’t worry, I already came up with a solution for this, which will also solve the problem of keeping the economic activity alive.” Mehmet’s mother explains. “We have to slow down the process. I assume that all of you are as fast in calculating the balances as I am, so therefore I cannot ask you to work more slowly if the competition is about who is going to be the fastest. Rather, let’s introduce an additional riddle you have to solve to be the winner.”

“Huh? Riddle?” Mehmet is surprised. “What do you mean?”

“Let me explain. After you update the list on your own tablet, you will have to solve a riddle, but not you personally, but rather the tablet itself. I will update your tablets with an add-on, which is a hash function (see Part IV). After you update the list, the new information will be processed by the hash function. This hash function will turn any input into a pre-determined standardized output called a hash. But — and here comes the riddle — we will set up a rule: only those hashes are valid whose first four digits are zeros.”

A schematic drawing of the generation of a valid hash by a hash function. Blockchain, Bitcoin, Hash Function.
We choose a rule to define valid hashes: the first four digits must be equal to zero (illustration by author).

“Okay, okay, wait”, Mehmet says. “Luckily, we all have read a nice introduction to hash functions and hashes before (see Part IV). Otherwise, this would be non-sense for me. What you basically say is that we should hope that the hash function on our tablet will coincidentally generate a hash whose first four digits are zeros? How should that work?”

“I didn’t tell you the most important thing yet.” Mehmet’s mother is excited about her idea. “First of all, great that you know the basics of the hash function. You might then also know that changing just one character in the input generates a fundamentally different hash, do you?”

“Yes, I remember”, Daniel says, curious about what comes next.

“Great. Now, besides the updated list you have calculated yourself, we will introduce a run variable X. This variable has a starting value of, say, 0. We input the updated list including the run variable into the hash function and see if the first four digits of the output — the hash — equal zero. If not, however, we increase the run variable by 1, so now X equals 1. Then, we input the list with the new value of X (being 1) again into the hash function and check if the generated hash will be valid. We repeat this procedure until at one point, a valid hash will be generated. The first one of you who finds a valid hash will be the winner of the competition!” Mehmet’s mother finishes her lecture, and the kids are impressed. “And by the way, this whole process of incrementally increasing the run variable will be done automatically by your tablet, so no need of doing all by yourself manually.” She adds.

A schematic drawing of the generation of a valid hash by a hash function. Blockchain, Bitcoin, Hash Function.
Incrementally increasing the run variable will generate a fundamentally different hash every iteration (illustration by author).

“Whoa, this was high-level. I think I have understood your concept, and it is brilliant, I agree.” Laura says. “But there is still one thing that confuses me. We are almost equally fast in calculating the updated list. The tablets are identical, so they will be equally fast as well. How can we make sure that there is a clear winner? An undisputed first place?”

“Sharply observed, Laura.” Mehmet’s mother says. “I forgot to tell you this: the speed of processing will be equal, but you can individually set the starting value and the steps by which the run variable shall be incremented automatically. In my explanation above, I set the starting value at 0 and the incremental step at 1. But you can choose these two elements individually. For example, you can set the starting value at 1,597,578 and the incremental step at 15, so now the run variable will start at 1,597,578 and will increase by 15 every iteration.”

A schematic drawing of the generation of a valid hash by a hash function. Blockchain, Bitcoin, Hash Function.
The starting value and the increment of the run variable can be set individually, because the generation of a valid hash is random (illustration by author).

“Ohh…I get it!” You say excitedly. “Because the generation of a hash is kind of random, anyone of us could land on a valid hash, regardless of the starting point and the incremental step. That means the pace of processing will be same for all tablets, but every tablet’s “journey” will be highly individual because we choose different starting values and incremental steps. Is that right?”

A schematic drawing of the generation of a valid hash by a hash function. Blockchain, Bitcoin, Hash Function.
Based on the run variable, everyone in the system can land on a valid hash — it is just about who is going to be the first to find it (illustration by author).

“Yes, Sarah, you got it.” Mehmet’s mother says, smiling.

“Puh, another innovation in our system. If I hadn’t been a part of this from the beginning on, I think I wouldn’t have understood anything!” Daniel says.

“True, this is pretty sophisticated now. But I have another question. What happens when we have a clear winner of the competition? How can we know if there are no mistakes? And, more importantly, how big is the reward?” Mehmet asks.

“Good point. I’d suggest that after we have a clear winner, we all take a look at the winner’s updated list and the run variable and see if everything is correct and valid. As a reward, I’d say 5 Sandbox-Euros per competition is a good amount, what do you all think?” Laura proposes.

“Sounds reasonable. 5 Sandbox-Euros is a good amount.” Daniel agrees, and the rest of you nod affirmatively.

“Well, then, let’s get going!” You say, and off you go.

Fast forward: after testing the new system, it turns out as a massive success. No one emerges as the only winner after multiple rounds of competition, but rather an even distribution of the newly created Sandbox-Euros is achieved. Everyone is getting their fair share of rewards, and furthermore, the economy stabilizes due to the new liquidity. Business flourishes, and everyone is better off.

To prevent this part from getting unnecessarily longer, we will quickly introduce the official names for the concepts discussed.

  • The run variable is called a Nonce (short for “Number used once”).
  • The act of finding a valid Nonce-Blockchain-match is called Mining, because the final result is that the winner (the Miner) will be rewarded a certain number of Digital Tokens. Think of a gold miner, who digs for gold and finds it after investing time and effort into the mining process.
  • After finding a Nonce which, together with the updated Blockchain, generates a valid hash, we have proven that we have invested time and energy (the tablet’s computing power) into keeping our money system healthy. Thus, we have a proof of the work invested — in other words, we have a Proof-of-Work.
  • The final evaluation step is called a Consensus Mechanism because other Stakeholders (Miners) will look at the winner’s result and check if everything is computed correctly, and the final hash is valid. When all agree and there is no objection, the reward will be deposited into the winner’s account.

Congratulations — you now officially have a deep understanding of the Blockchain technology, of the various subsystems and how everything fits together. I hope that things are more clearly for you now and that you are equipped with a new perspective on this simple yet brilliant technology.

In case you want to restart the series, here are the links to the previous parts:

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

Also, Read

--

--

Kiran Banakar
Coinmonks

Financially broke but philosophically rich. 30-something living in rural Spain to focus on personal projects. Books. Music. Flamenco. Ideas. Mindfulness.