Cryptocurrencies gradually revolutionize the world of finance, forcing many to look at the web more seriously, and it is believed that this is largely due to the blockchain technology, which is directly associated with Bitcoin. And thus, the blockchain itself has faded in the light of the glory of its own "heir." In this article I will try to explain one of the most significant computer technologies on my fingers and put an end to the misconception that the blockchain is a cryptocurrency or a financial database. Looking ahead, I will say that you most likely are already working with the blockchain, even if you have never encountered cryptocurrency.
In order to understand why the blockchain is not equal to cryptocurrency, it is enough at least that the blockchain was invented and used before cryptocurrency. But the purpose of the article is to give an understanding of the technology itself, and for this you need to highlight common signs for all existing currencies: each invariably includes three elements - a chain of blocks (the blockchain itself), a digital signature and CRDT. Consider them in more detail.
I deliberately exclude the network structure (decentralized, federated) and mining methods, as they differ from system to system.
Blockchain is a chronological database, i.e. such a database, in which the time when the record was made is inextricably linked with the data itself. What makes it non-commutative (a + b b + a). Example:
Let's add two records to the usual relational database with the Name and City fields:
, , -
Now, if we remove Ivan Ivanov and then add it again, the database before and the database after will be the same, in other words, the database will return to its previous state. With the blockchain, everything is wrong, even if we delete and then re-add the record, the state will not recover, despite the fact that the data are the same. If it is quite simple, then the current state of the blockchain is the sum of all previous actions.
First of all, this is necessary in order to protect the database from being recorded "backdating". For this purpose, functions are used that convert any data into a unique number of a fixed length (hash-functions). In the form of pseudo-code, the blockchain can be expressed as:
block0 = hash(data0) block1 = hash(data1 + block0) block2 = hash(data2 + block1) block3 = hash(data3 + block2) ...
So we get four unique numbers that we will distribute to independent users (the more the better). Now, if we change the values in data1, then the values of block1, block2 and block3 will change, so that users can compare their blockN values and understand that a substitution has occurred.
All operations in the cryptocurrency must be authorized and the only way to authorize is to use a digital signature - all participants in the system can verify the data source without using central servers with hidden verification mechanisms. Authentication can occur on your machine, according to a familiar algorithm.
I could not concisely translate this term into Russian. CRDT or Conflict-Free replicated Data Types are types of data that are not subject to collisions with simultaneous distributed access, and most importantly - reproducible. In other words, from the sequence of operations, you can restore the value at any time.
Cryptocurrencies are nothing more than accounting entries, which are a sequence of actions written off and credited. The simplest example of how this looks is:
13:00 +7.5 # 12.5 12:00 -5 # 5 11:00 +10 # 10 10:00 0 # 0 ( )
Knowing the current state of 12.5, we can restore the state of the account at 12 o'clock by canceling the deposit operation +7.5, replacing it with subtraction. It also saves time when changes are propagated: you only send the delta itself, not all of the value.
These types of data can be not only numbers, but also strings, lists, or dates.
If we take the blockchain and CRDT, then we get a well-known git. Yes, the very git that revolutionized software development and that developers use every day. Perhaps you also know that with the help of git, you can not only develop programs, but also blog, and put csv in it, get a database that remembers all changes and has a rewind function.
Based on the foregoing, the conclusion is: a blockchain is used to maintain data integrity. Thus, it does not matter at all what you put on the blockchain - all copy owners will be able to verify that the data is correct. Even if only you write to the blockchain, the outsider will always be able to make sure that you have not changed something in hindsight. In other words, it is a mechanism for maintaining trust in data.
But trust in data is necessary in document circulation, voting systems, for storing shareholder information, in medicine and notarial matters, and can be used to conduct business in government institutions. This technology will make the figures legally valid and completely abandon paper carriers and manual signatures. So there is still a blockchain where to express themselves and in the coming years we will only watch how it captures the technological world.
Source: https://habr.com/ru/post/313212/
All Articles