This is an old revision of the document!
News about the launch of new cryptocurrencies have been circulating for several consequent years already. And while the core of debates is the most promising, effective and economically viable model for reaching mutual understanding of all parties, blockchain based systems have been actively developing for a number of years. Nevertheless, in the Russian-language literature, and surprisingly, on the Internet (video conferences do not count), the information on blockchain in general. And articles on examples of its application in particular boil down to a dry description of the differences between the new protocol and the most famous one - Bitcoin. Sometimes this information is inclined to advertising own product or trying to describe an individual part of a decentralized network working on blockchain. At the same time, most readers who are not familiar with the basic principles and concepts of this rather widely applied field, are often bewildered by the very talk about blockchain and the possibilities of its application outside the cryptographic currencies. Comprehensive articles aimed at explaining the principles of blockchain and its application started appearing only recently.
Using blockchain technology in IoT provides a number of advantages:
Moreover, any person could attach his sensors to the created net without any additional authentification and to share its data. This data could be bought by someone who is interested in.
Obviously, the story of blockchain development is inextricably linked with the story of cryptocurrencies’ mining. In many respects, Bitcoin is to be thanked for fundamentally new systems that started appearing and operating on blockchain. The climax of this development at the moment is the emergence of the Ethereum system, which revolutionized views on blockchain itself.
Not so long ago Habrahabr.ru (the most significant Russian online IT community - Ed.) has featured an article with a brief description of blockchain and its comparison with the usual database 1) In this series of articles we will briefly, but more thoroughly than in article attempt to describe the story of blockchain and the systems based on it, the principles on which they operate, and the possible areas of application of this technology, which, in fact, are plenty.
There were attempts to create an unregulated currency long before the appearance of Bitcoin. The first prototypes of electronic money were proposed back in the 1980’s by David Chaum. He is most famous in the world of cryptography for inventing the so-called “blind signature”, which enabled creating an electronic digital signature for a message without getting to know its contents. This was the algorithm on which the electronic currency he created was based.
Yet another huge impact on the world was made by Adam Back’s work on denial of service counter-measure. Thanks to this work the first mechanism for reaching consensus was elaborated: Proof-of-Work, which was named Hashcash. Further on we will tell about it in details.
Studies conducted by Wei Dai and Nick Szabo are just as important here. These studies aimed at identifying true information when interacting in an unreliable environment where there is no reason to trust any remote nodes with which the connection was established. The situation described above got the name “The Byzantine generals’ problem“. It was formulated by the well-known American scientist Leslie Lamport. And it was he who proposed an ad hoc solution to this problem.
The essence of this problem simmers down to the following. Once the Byzantine army was about to enter into a great battle with the enemy. The whole army was divided into N legions. A general was appointed as head of every legion. All generals are receiving commands from the commander-in-chief. The night before the battle, each of the generals receives a message from the commander-in-chief, which indicates what should be done at 10 am the next day: the order was either to attack or to retire. The problem lies in the fact that by that time Byzantium was in decline - and anyone, including the commander-in-chief, could turn out to be a traitor. In particular, if the commander-in-chief was the traitor, he could give different orders to different generals. So basically, there are three possible outcomes of the battle:
1. If all the legions attack, then Byzantium will win; 2. If all the legions retire, then Byzantium will, at least, keep its army; 3. If some part of the legions retires, and the other attacks, then the Byzantine army will be defeated - and this is exactly what the traitor was striving for.
Therefore, the generals are facing the problem of making a mutually agreeable decision. That is, reaching a consensus in an unreliable environment where it is impossible to trust unconditionally any of the interacting parties.The problem solution could be seen in Byzantine fault tolerance
The emergence of Bitcoin in 2008 signalled a full-on revolution in the field of electronic cash. Someone who uses the pseudonym Satoshi Nakamoto is the author of this system. However, his or their true identity (in case if it is a group of people) has not been established so far. By and large, as it was rightly noted, Bitcoin was built on the foundation of work done for a quarter of a century in the field of cryptography and absorbed all the best ideas it could at that time. Nevertheless, this system is extremely limited in some respects, as it will be repeatedly stipulated further. For instance, it does not allow creating complex financial transactions (contracts in Ethereum’s terminology), since its internal programming language does not allow the creation of cycles, and is rather limited in general. Later on MasterCoin system emerged on top of Bitcoin. It allowed users to create their own currencies (tokens). Nevertheless, the very idea of this system is still a subject of discussion, and besides it has not been fully implemented. However, Bitcoin’s feasibility raises many issues. The fact is that the number of this currency’s units that have ever been created (we will discuss in detail how it is done further on) is limited to 21 million. Fears of possible deflation are indeed justified: if the demand for electronic money grows, and the offer can not be increased because of the particular characteristics of the protocol itself, the cost of each unit of this crypto-currency will increase. This will lead to unwillingness of crypto-currencies’ holders to part with their savings in the hope of making even greater profits due to further rising costs of each crypto-currency unit. It will even further reduce the supply - and so on. The thoughts cited above are far from being a full-fledged economic rationale, but nevertheless, they express one of the possible ways of future developments.
In a fairly short period of time after the creation of Bitcoin, a large number of alternative cryptographic currencies were created based on its free implementation. Some cryptocurrencies have made minimal changes to the structure of Bitcoin - increasing the maximum number of coins ever created or completely removing this restriction. Others made significant changes. Peercoin, for example, went this way, creating alternative methods for protecting the internal data structure (blockchain). It started using the mechanism of Proof-of-Stake on a par with Proof-of-Work. Primecoin uses the search for Cunningham chains as Proof-of-Work, which, according to the author of the system, has exceptional scientific value. Namecoin creates a distributed database of matches “IP address - network name” (a DNS-server analogue ) based on blockchain.
There are many examples of systems based on Bitcoin. Nevertheless, the most promising system based on blockchain does not stem from Bitcoin. We are talking about the Ethereum system, proposed by Vitalik Buterin in 2013 and formally described by Gavin Wood a year later. Changes in the concept from the developer's point of view can only be described after considering a specific protocol. From the user’s point of view, the ability to embed fragments of the program code for the Ethereum virtual machine (reminiscent of the Java virtual machine) in the blockchain was the innovation. And this innovation is subsequently executed by all nodes in the network when accessing from outside (this is how contracts are created and executed). In addition to that, Ethereum allows creating DAOs (Decentralized Autonomous Organizations), which are represented by a set of contracts in the system that implements the logic of the organization in the network: starting from the creation of inner currency, fundraising through the sale of shares and ending with the work of the elected board of directors.
We should briefly mention that Ethereum developers are currently discussing the prospects of transitioning to the so-called Web3 - a new Internet, built by blockchain and implementing the interaction between non-trusted nodes in an unreliable network, as it was repeatedly stated earlier. There are some individual applications based on such a system: namely cryptographic currency, Whisper - a messenger based on such P2P network, as well as Swarm - an application for storing data in the blockchain.
We should separately focus on mechanisms of reaching consensus in an unreliable network with unfamiliar nodes. Earlier we mentioned that long before Bitcoin and any other electronic currency sustainable over time emerged, the Hashcash scheme was created, which determined the Proof-of-Work mechanism. Currently, this mechanism is the most common and widely spread one. It is used in parallel with the Proof-of-Stake mechanism in some electronic currencies (Peercoin). And we may fully switch to it in the future if it can overcome the restrictions imposed on it now and defend itself against attacks.
First of all, let us discuss Proof-of-Work because this is the mechanism used in Bitcoin. It is directly related to the mechanism of the cryptographic hash-sum, which was discussed here earlier. We have mentioned that one of the main structural principles of hash-sums was and remains as follows: there should be no computational possibility (other than a complete enumeration) to restore the original message by a certain hash-sum. Roughly speaking, this fact is used in Proof-of-Work.
Each node of the network that creates blocks (or mines them in Bitcoin and other cryptocurrencies’ terminology) creates a new block and fills its body - generally, we are not interested in how exactly it does it. The main thing is that the other nodes consider its content correct from the point of view of a particular protocol. Then the header is filled in, in which one of the fields (nonce) essentially contains a random value. The task of the node is to select such a header hash-sum value that it is less than a certain predetermined value. This value is called complexity and varies over time. For example, in Bitcoin, the complexity is maintained at the level necessary and sufficient for a new block to appear once every 10 minutes. Calculation is extremely simple: it is enough to calculate the number of new blocks appearing in a certain period of time and divide it by this time interval, thus receiving the speed of new blocks’ appearance. Comparing this value with the required one you can “adjust” the complexity in order to increase or decrease the speed. Since all nodes in the network perform such an action, the system remains consistent: blocks with an incorrect value of the achieved complexity will simply be discarded.
Further on, the work of the node is basically enumeration of hash-sums by changing the nonce field. We should mention that the drawback of the Bitcoin system and its derivatives is that the speed of computation has a significant influence on the speed of generating blocks to a great extent. At the same time, users of the system used and continue using various tricks to increase the likelihood of success. At first, they transitioned to calculating hash-sums on video-cards (thanks to technologies like NVIDIA CUDA). Next transition was to the use of specialized ASIC boards, and later on - to creating data centers. Presently, an ordinary user can not qualify for successful mining in the Bitcoin system and its derivatives, simply using his home PC.
The Ethereum system offers one obvious way to solve this problem. A special structure weighing about 2 GB called DAG is used to generate new blocks. This structure is created in advance. Its advantage is that once it is installed the use of ASIC boards becomes impossible without their significant improvement, which can not pay off if we keep in mind the current cost of RAM modules and all the required changes. It also makes no sense to create full-fledged pools consisting of “weak” machines with insufficient RAM capacity, when each node checks nonce, starting with a specific value so that the speed of calculating the hash-sum increases in proportion to the number of participants.
Proof-of-Stake is an even more promising, but still not quite safe way to abandon Proof-of-Work. It appeared as a response to the public's displeasure with the costs of electricity and equipment required for the new blocks’ mining. The idea is the following. Each node on the network (in this case, we are dealing with a cryptographic currency) has accumulated certain savings. You can reduce the cost needed to generate a new block by the node, allowing it to include a transaction that transfers its funds to its own account in blockchain. Reduction of complexity in this case depends on the “age” of the funds used (the moment when they were received) and their quantity. And as a result of all this we get the following consequences:
There is one problem that is not obvious at first sight. The attacker can purchase private keys for some UTXO (Unspent Transaction Output) from the users of the system, namely, keys used by them in the past. As a result of all this, there may arise a situation when the node will be in possession of absolutely all private keys at some point in the past. Then it will be very easy for it to quickly generate an absolutely new blockchain, which will replace the original blockchain and will be accepted by the system. And all of it can be done just by using its own means. As a protection against such an attack, a time frame is established for the age of the tools used in all systems implementing Proof-of-Stake.
Ethereum takes a special place in the array of technologies based on blockchain. Vitalik Buterin invented this system in 2013. Several important features distinguish it from all the previous systems:
Based on Ethereum, it is possible to create a new generation of Internet - Web3 in the future. It entails development of three areas: Ethereum - a cryptographic currency, Whisper - a chat based on Ethereum P2P-network and Swarm - a P2P-system of decentralised data storage. They are used to create Dapps - decentralised applications that use the Ethereum API to interact with blockchain.
Decentralized technologies are one of the most promising areas for the development of contemporary networks. And blockchain does take a special place among such technologies. As we have mentioned here more than once, Ethereum remains the most promising system based on blockchain. Perhaps it will be blockchain that will allow us create an absolutely anonymous Internet, the interaction where yet will remain safe, but protected from tracking. The Internet community strives for that. Nevertheless, the issue of security in the real world remains vital: terrorist organizations can also interact, using these technologies - and because of their resistance to hacking and absolute uncontrollability, the special services’ work aimed at preventing terrorist acts will become more complicated. Therefore, the question of applying blockchain in its original form is controversial. One thing we can be certain of, though: blockchain changed the notion of a decentralized interaction and created the basis for its future development.