Processing the blockchain
The wall that displays the valid pages will not let any villager put his/her page on it. After a page is completed with 10 transactions recorded, only one villager gets to put his/her page on it. To do so, all of the villagers will have to compete to find the result of a mathematical problem.
Here is the delicate part that makes a blockchain immutable and unalterable.
There is a section on the wall that has two small screens that will display some information every time a page is completed:
- On Screen A, a number is displayed that we will call the reference number.
- On Screen B, the date and time are displayed.
Under these two screens, there are two other screens where the villagers will input data:
- On Screen C, the villagers will input the 10 transactions of the completed page.
- On Screen D, the villagers will input a random number we will call number X.
Finally, a final screen displays a rule that must be respected when solving the mathematical problem, as shown in the following diagram:
To keep this chapter's consistency and help you to understand everything, we will further define the rule, the reference number, and number X. Everything will make sense by the end of this chapter. For now, just move on with how pages are completed and displayed on the wall.
When page #1 is completed, all of the villagers gather before the wall to take notice of the information provided in the two first screens. In our example, we have the following:
- Screen A: Reference number: 0
- Screen B: Date and time: 2018/06/25, 03:25 PM
The rule given on the wall is as follows:
"The output number to be found when solving the mathematical problem must start with two leading zeros."
Do you remember that, for a page to be accepted on the wall, the villagers will have to solve a mathematical problem?
Well, this problem is set like this:
Screen A's reference number + Screen B's date and time + Screen C's transactions of the page + Screen D's random number input by the villager (number X) = an output number following the rule given by the wall (a number that starts will two leading zeros)
In this equation, we actually know four out of the five variables:
- Data from Screen A (the reference number) is given by the wall: 0.
- Data from Screen B (the date and time) is given by the wall: 2018/06/25, 03:25 PM.
- Data from Screen C (the transactions) are to be filled by the villagers. They are written on the pages of their books.
- Data from Screen D (the rule) is given by the wall: The output number to be found when solving the mathematical problem must start with two leading zeros
The equation can be pictured like this:
Now, the hard part for the villagers is to find the correct number to enter on Screen D for the equation to return a number that respects the rule of the wall: a number starting with two leading zeros.
To help you to visualize the mathematical problem, it can roughly be represented like this:
For this equation, the answer would be easy because we know that we have to add the numbers together and number X to find an output lower than 10. Here, number X would be equal to 1 or 2:
However, in Village Beta, no one knows the wall's algorithm. No one knows the logic of it and how the problem should be computed. They will have to try a lot of different number X solutions to find the correct output.