A discussion at the bar between Paolo and Mario - bitcoin, blockchain and Libra topic

Paolo: Mario, you who are a computer scientist, explain to me how bitcoin production works, but I recommend you, don't use technical terms, you know that I understand very little

Mario: OK, I'll try to use simple language

Paolo: I start immediately with a trivial question, because those who produce bitcoins are called "miner" and not, for example "coiner". I wonder why, given the value to which bitcoin has come, I associate this term with the California gold rush

Mario: In fact, the extraction of bitcoin has very similarities with that of gold and the period of feverish migration of workers to areas in which the discovery of considerable quantities of gold occurred can be compared to the current migration of companies and computer experts of the whole world towards this sector. The term miner was taken directly from the document from which it all started (https://bitcoin.org/bitcoin.pdf) in which, in a paragraph: "The steady addition of the number of coins is analogous to gold miners expending resources to add gold to circulation ", the author (or authors) since it is not known who actually wrote that document, compares the production of new coins to gold mining

Paolo: Is it true that even I, with my PC, can "mine" bitcoins? I searched the internet but didn't understand much

Mario: On the internet there is a lot of material, a lot of instructions, advice, explanations but you have to be careful about the period in which they were written because, as I will explain later, the extraction of bitcoins, a bit like that of gold, initially it was simpler, now it is almost impossible to produce anything with your own hardware.

Paolo: Well, since I can't produce bitcoins, who can do it?

Mario: Only large companies or pools, ie PC networks. Currently the bulk of the production is done by Chinese companies or pools (in this video the "miners" of the future)

Paolo: I have read that these companies move their servers to places where electricity is cheaper, explain this to me, what does the cost of electricity have to do with bitcon?

Mario: OK, we're getting to the heart of the matter, how is bitcoin produced or extracted? To answer this question I will endeavor to use examples of the real world and not digital. Have you ever played lotto or superenalotto or other similar games?

Paolo: Yes

Mario: Have you ever heard of combinations and probability calculations?

Paolo: I have school memories, but, let's say yes, I remember something, go ahead

Mario: The probability of making 6 superenalotto points is 1 on 622614630, or how many are all the possible combinations of sestines of numbers from 1 to 90, the first sestina will be 1,2,3,4,5,6 the second 1 , 2,3,4,5,7 up to 85,86,87,88,89,90

Paolo: Sorry if I interrupt you, but you're not taking it very far, what does the game have to do with bitcoin?

Mario: Trust me, that's a game too ...

Paolo: OK, continue

Mario: Let's say you want to challenge computers

Paolo: A challenge?

Mario: Yes, I extract 6 random numbers, put 2.12.51,71,74,83 and I press start on two computers programmed to calculate all the 622614630 combinations, the first that finds the combination 2,12,51,71, 74.83 wins

Paolo: In short, a challenge of computational power, who is more powerful, with a faster CPU, will calculate the combinations in less time and win the challenge

Mario: Bravo, but there is a problem, the current computers make 600 million combinations in a fraction of a second, we need to raise the level of complexity

Paolo: Remember the initial promise, don't go too much on the technical otherwise I won't follow you anymore

Mario: No, no, we always remain in the game, in making computers play but this time with more serious challenges ... for them. Let's introduce just another concept, prime numbers, do you remember what they are?

Paolo: Prime numbers are all natural numbers divisible only by 1 and by themselves

Mario: Exactly, now let's do this test, I'll tell you a number, which is the result of a multiplication and you answer me with its factors

Paolo: I see you want to test my math skills, ok tell me

Mario: 55

Paolo: 5 x 11 or 11 x 5

Mario: OK, now 86

Paolo: 2 x 43 or 43 x 2

Mario: OK, 8616460799?

Paolo: But jokes, you make fun of me, how can I find the factors of such a long number in mind?

Mario: In 1874 William Stanley Jevons wrote in his book "The Principles of Science": "Can the reader say which are the two numbers multiplied between them that will produce the number 8616460799? I think it is unlikely that anyone will succeed, apart from myself . "

Paolo: A juggler this Jevons, he took two big prime numbers and multiplied them

Mario: Exactly, today it is enough to insert them in a small PC program or use this web page on Blia.it to find that the two factors are 89681 and 96079

Paolo: So where do you want to go?

Mario: That wasn't easy even for the computer, in fact, to date, an algorithm to quickly calculate the product factors of two prime numbers, with the number of Jevons, of only 9 digits, does not exist, the pc / server took a fraction of a second, but if the number were was 200 digits we would have to wait for years for the result

Paolo: OK, all this to tell me that there are calculations that not even the fastest computer can do quickly but I still don't connect everything with bitcoin

Mario: They are not "simple" calculations, it is the factorization of prime numbers that is the basis of modern cryptography and, therefore, also of the "heart" of bitcoin

Paolo: Well, you can continue

Mario: You know what IBAN, Tax ID and VAT number have in common

Paolo: No, what?

Mario: They are numeric or alphanumeric codes that have within them, usually at the end or the beginning, one or more control characters. Let's take a random tax code (in this page you will find invented tax codes), the code is made up of 16 characters, the last of which is a control character of the previous 15. This means that if I fail to communicate a tax code, for example to a public administration, because maybe I exchanged a ZERO with an O, then the software, thanks to the control code, will tell me immediately that it is wrong. Same thing for the VAT number or for the IBAN, in this last case, for example in an IBAN of the kind, IT09D0760116600932112345678 the control characters are even three, the third, the fourth and the fifth

Paolo: All clear, continue

Mario: Having only one control character does not protect you from errors, I'll give you an example, let's take this tax code: DSDBVN55R02C715Q and I am wrong to write it, exchanging the ZERO with the O, then it becomes DSDBVN55RO2C715Q, the control software calculates the last character and answers us that it is wrong, because it should be E and not Q. But if, due to an excess of bad luck, I had to err in two of the characters, for example the ZERO and the next 2, exchanging them with O and 7, then the control code would return to being Q (DSDBVN55RO7C715Q) and therefore for the control software that fiscal code could be fine

Paolo: And the guy is ruined, eheheheh

Mario: What I have just done, in technical jargon is called "collision", that is, I have reshuffled the first 15 characters so as to have a control character identical to that sought, you understand well that a single control character may not even be sufficient for a "word" of 15 characters, let alone for longer texts

Paolo: So how do you do it, do you choose more control characters?

Mario: Exactly, while remaining within a limited code of characters to avoid overloading the final code, we need to find the right compromise

Paolo: Aren't we moving too far away from the bitcoin topic?

Mario: Quiet, now let's go back. Speaking of control characters, starting in the 1960s, with the increase in digital communications, there was a need to check that the data transmitted reached the other end of the line intact. We have studied and put into practice different systems, one of these provides a "control code" (it is not called in technical terms but the idea is the same, of 32 characters

Paolo: Give me an example, I'm losing myself

Mario: More than an example of giving the link of a site where there is a tool, a small program, which calculates this famous control code online, called hash

Paolo: Finally this hash came out, I read in a lot of places but I never understood what it actually was, thanks Mario

Mario: To be precise, it is the functionality, the action, in fact in English it means chopping, shredding, messing. The code, the result of the hash operation instead is called digest, always in English derives from digesting, should therefore be translated as "digested" but in our case we can say that it is a "summary"

Paolo: Hello 61c8e16ad90d4e6da317180fa445e262e9313bbf21fd4d30b3b9b4425886b2f5

Mario: Eh?

Paolo: I followed your suggestion, I went to the site you indicated to me, I wrote Mario and selected sha256, I got the series of numbers and letters I told you before

Mario: And you also noticed that by changing a single letter, the result varies completely

Paolo: Already, at this point, I imagine this is the "game" that all those machines are doing all the time, 24 hours a day, incessantly, until they break

Mario: Yes, but do you know what digest they have to get?

Paolo: No, which one?

Mario: A digest that has 18 zeros in front, and in a while those 18 zeros will become 19 and then 20, and so on, that is, the difficulty of finding that code will increase more and more (for the most curious the first block had 10 zeros )

Paolo: Everything here? Powerful computers turned on night and day and can't find this code?

Mario: Do ​​we make a bet?

Paolo: I'm not a gambler, but tell me me

Mario: Go to the site that I told you and write random letters, continuously, you will see that the digest changes accordingly, well, if you find one with 3 zeros in front of you.

Paolo: I offer you a beer, or, write Hello, world ! 4250 sets, as usual, sha256, you will see a hash with four zeros in front, try to increase by one that number 4250 until you reach a hash of 5 zeros. I offer you the beer the same, without the need for a bet, because you have finally clarified many doubts I had, but explain one more thing to me, this of the "play" with the zeros in front is a mechanism born, created with Bitcoin?

Mario: No, what you call play is actually a modified version of Hashcash, a so-called proof-of-work algorithm (I don't go into details because we are at the bar and not in a university classroom), invented over twenty years before Bitcoin to combat email spamming

Paolo: I mean all those "junk" emails that I often get

Mario: Yes, but back to Bitcoin, unfortunately (or fortunately it depends on your point of view) most people always keep at a safe distance from mathematics, they have a reverential fear of complex formulas and calculations. And a small group of people took advantage of it and continues to take advantage of it. This, in my opinion, is not innovation, it is not the future. Because innovation must be, above all, sustainable. And it's not sustainable a technology based on the crazy game of burning thousands of megawatts to find a needle in a haystack as big as the whole Earth

Paolo: Well, you can continue

Mario: Do ​​you know what the padlock in the address bar means before the name of this site?

Paolo: I guess he's certifying that this is a secure site

Mario: Exactly, the s that follows the term http stands for secure and security is given by cryptography and, in particular, by public key cryptography, also called asymmetric

Paolo: Mario, but you know that I'm not a computer scientist or even a mathematician, these are very technical things

Mario: The principle and the basic mechanism are much simpler than you can believe, and an average culture is enough to understand them

Paolo: OK, I trust you. But in addition to making websites work safely as you say, what is this public key cryptography for?

Mario: You are Sicilian, right?

Paolo: Yes, why?

Mario: Because the Sicilian Region sends all its citizens an electronic card, which has the functions of a health card, tax code, etc.

Paolo: Yes, here it is, I have it in my wallet

Mario: If you look carefully, in the middle there is a golden square, that is a tiny computer

Paolo: Come on, really, and what's the use?

Mario: To carry out cryptographic operations and, therefore, authenticate yourself to public internet sites

Paolo: And the paper that Giuseppe, my lawyer friend and Claudia have, my consultant who, they say, need them to sign digitally contains a computer as well?

Mario: Yes, even the digital signature works with public key cryptography

Paolo: Well, then go, I want to know more

Mario: Let's start with a practical test press the button on the right:

 you will see some boxes filled, like this one with a random prime number and this one with another prime number we will call, respectively (p) and (q)

Paolo: Again the prime numbers referred to in the previous installments, these numbers are really super stars

Mario: And now we multiply them together (Jevons, of which we spoke above would have exclaimed: "I told you, sooner or later the multiplication of prime numbers will lead to something very interesting")

Paolo: In the series, a hundred years ahead of its time

Mario: The result of multiplication (p * q) we will call it (N) we calculate another value PHI = (P-1) * (Q-1) and then (E), a random number, less than N and which is prime with respect to PHI, let's say

the two numbers (N) and (E) form your public key. We continue with calculate (D) as inverse of E modulo PHI the two numbers (N) and (D) form the private key, THE END.

Paolo: I should review some math done in high school but I thought it was worse

Mario: The brilliant invention of the cryptologists Ronald Rivest, Adi Shamir and Leonard Adleman is all here and the RSA algorithm formed by the initials of their surnames will be remembered for many years to come Paul: When one says the egg of Columbus

Mario: With hindsight it seems a trivial thing but in those years there were many working to study secure algorithms and cryptographic systems that were both easy to implement. But back to cryptography, try entering a text below: and then press the key to and then to

Paolo: Uau, and is it the Bitcoin protocol that works with this system?

Mario: It is a similar system, it is not RSA but another type of public key cryptography, the so-called elliptical cryptography

Paolo: OK, the RSA is enough, thanks

Paolo: I guess you simplified the mathematical process a lot, for example you told me that prime numbers must be very large

Mario: Yes, in fact, precisely to make the key pair forcing very complicated

Paolo: Can you show me a real pair of keys?

Mario: Yes, on this page you can see a digital certificate, in which I could see the public key (Public Key)

Paolo: Tell me about blockchain? I'll tell you right away what I know or, at least, what I understood from the sites and television broadcasts, and already, because now the television also speaks about it. And that is that it represents the information revolution of the coming years.

Mario: And who made you believe this?

Paolo: I read it from all sides, bitcoin is indeed an innovative technology but what will change, which will have the impact that the internet has had will be the blockchain.

Mario: Ah, do they write this? Perhaps remaining vague when asked how

Paolo: I notice a certain skepticism in your words, it's not like that, won't it?

Mario: I can't foresee the future but for me it's not the technology that will change the world, or at least it won't change it for the better

Paolo: But a Luddite computer scientist had to happen to me

Mario: No, I'm not a Luddite but a prudent one. You see, there is a vision of the world, obviously touted by many Silicon Valley gurus and companies, which sees digital technology as the answer to every problem. In this vision, through a reorganization of the existence that passes from new technologies, it is possible to monitor and improve every behavior. I, on the other hand, think that these instruments are not neutral, that their effects should be examined in a political and ethical key. That we must reflect on who, and how, makes them available to us. But this is a "philosophy" that starts from afar, a brief historical excursus. Sir Francis Bacon (we are at the beginning of the 17th century), considered the philosopher who first codified the modern scientific method, openly despised what he called "the innate depravity and the evil character of ordinary people" and saw in science a way to teach people how to submit to laws and authorities, and repress their ungovernable attitudes. Over the centuries, science has acquired, with respect to political power (be it an authoritarian or democratic regime), a unique and often contradictory role. Some "heretical" scientists, I think of Galileo Galilei, have led the rebellions of science against the guardians of society, but others have diligently served the royal courts, sometimes even imagining that their specialized knowledge would have brought them to power. At the end of the eighteenth century, another philosopher, this time French, Henri de Saint-Simon believed that science and technology would solve much of the social problems but that for the experts to govern society, the "ignorant masses" had to be controlled. This in turn implied the "need to abound democracy and, therefore, mass politics" and in its place he proposed the establishment of a new science that would govern all others, the "science of organization". To close, let's jump to the twenties of the last century, to Edward Bernays, American, of Austrian origin, grandson of Sigmund Freud and known as the "father of public relations", author of the book "Propaganda". Bernays had a hallucinatory vision of democracy. A class of strategists highly trained in mental manipulation constantly at work that, analyzing the social physiognomy determined the mental scenario from which people, with its "limited intellect", drew their opinions. After this digression on my thinking, it is true, pessimistic (but look at the case of Cambridge Analytica and Facebook) ... back to the blockchain.

Paolo: OK, let's hear these criticisms

Mario: Number one, it is not sustainable. Do you remember the production of bitcoins? the amount of electricity literally thrown away to solve a mathematical quiz? The absolute most inefficient and idiotic way of using electricity (this last sentence is not mine but by Dario Faccini, one who knows much more about energy efficiency than I do). Well, something similar applies to the blockchain. The blockchain is a distributed database, indeed, better, a database technology with more users that do not trust each other (the term trust will often be used in our speeches because it is the bearing wall of bitcoin and blockchain), a gigantic file to simplify, containing the history of all the transactions, which is replicated in many computers, network nodes

Paolo: And what's the point of replicating it?

Mario: To do without a central server, a central structure

Paolo: And this is bad?

Mario: Surely it is not sustainable, what is the point of creating thousands of copies of something.

Paolo: Maybe you don't notice because in digital and on the internet, transfers and file management are cheap

Mario: Yes, but not at zero cost. And that minimum multiply it by thousands, by millions.

Paolo: But does each node have to contain the entire blockchain?

Mario: With the passage of time (and in part it is already happening) and the ever larger blockchain not all the nodes will be able to memorize the whole chronology, To overcome this, big problem, we studied some tricks, one is to have two types of nodes, the complete node and the "light" one. But doing so returns to centralization because low-capacity nodes will have to rely on complete, high-capacity nodes that can afford to archive the entire blockchain. And centralization involves reliability problems, since light nodes having to trust complete nodes can become victims of a complete "rogue" node

Paolo: Did you hear that Facebook presented its cryptocurrency to the world?

Mario: Yeah, la Lira, ops, Libra :)

Paolo: Did he convince you?

Mario: Not at all, I looked at the " whitepaper". There is nothing interesting and innovative. One of the things that worries me most is what is it?

Paolo: No, what?

Mario: The "structure" of the transaction, read on page 9. "A transaction is signed message containing the following data" and then continues listing the "fields": Sender address, Sender public key, Program, Gas price, Maximum gas amount , Sequence number

Paolo: Well?

Mario: The "Program" field may contain "Move by script transaction script to execute, an optional list of inputs to the script, and an optional list of Move by code modules to publish". And I, frankly, of a field with executable code, which may not be easily interpretable, I would not trust at all

Paolo: What do you mean by "not easily interpretable"? Explain yourself

Mario: Have you ever seen a Trojan?

Paolo: Eh? It's fine that I am no longer young, but from here to giving me 3000 years

Mario: A "trojan" that, as you will have understood, derives from the Trojan Horse, is a computer program that, properly obfuscated and hidden inside other apparently useful and harmless code, executes an operation without the user's knowledge.

Paolo: In short, other risks for the user were not enough malware, ransomware of all kinds

Mario: To tell the truth there will be a difference between the blockchain of Libra and that of bitcoins. The Libra blockchain will be private, and this already makes you think about how senseless the idea of ​​the public blockchain has been. To update the data, it will be necessary to have the permission of the central validation node, indeed validation nodes, because, apparently, they have set up an association with big names such as Visa, Mastercard, PayPal, Stripe, Uber, Lyft, eBay, Spotify , Booking.com, all interested in tapping as much money as users or consumers, be it real or "invented" money

Paolo: I seem to be in the game of goose, are we back to the starting point?

Mario: Practically yes, here we are again at the centralized database or at the most shared among the nodes of a very restricted network ... business. In the future we will still hear of blockchain because it has now become a brand, but that of the original blockchain will have nothing

Paolo: And who will gain all this?

Mario: Ah, I can give you an endless list of subjects (see above), only one category will lose us , (little or a lot, even if it was just the time to read or listen to this nonsense), the end user

Paolo: So I can't trust those who tell me that the blockchain is an innovative technology based on complex algorithms?

Mario: It is neither complex, as we have seen on this page, nor much less, innovative, is ... a trojan horse that will be brought into homes, companies, institutions by the "smart" Ulysses of this millennium with support of the "naive" who will open their doors to them.