📜 ⬆️ ⬇️

The article to which you can refer: what is a blockchain

In 2017, the blockchain became the subject of scientific interest when the first blockchain research institute opened in Toronto. About 30 leading experts have begun to develop various projects related to this technology.



Blockchain is a reliable way to store data about transactions, contracts, transactions, everything that needs to be recorded and verified. Today, the blockchain has penetrated almost all spheres of life, is ready to radically change the financial system of the state and at times simplify the work of medium and large businesses. Blockchain is not a secret technology: there are a lot of articles on the network about how it works and what principle it works. We have collected the most interesting and necessary facts in one article to which you can link when you are asked: “What is a blockchain?”

This technology has begun to gain attention since 2008. At first, the blockchain was associated only with the cryptocurrency Bitcoin. But someone just saw its multifunctionality and great features.
')

Principle of operation


The essence of the blockchain's work as a chain of blocks can be compared with a puzzle. Block - an array of data, it contains information about transactions that hit the network after the previous block was created (approximately in the last 10 minutes). Each new data block is attached to the previous with the help of complex mathematical algorithms, which allows you to hold these blocks together for centuries. To create a new block, it is necessary to calculate its cryptographic imprint (hash) that satisfies certain conditions.

This process is performed by a large number of different computers operating on the same network, which solve some complex crypto task, during which it is necessary to calculate the hash (output) of the block header in the blockchain. In other words, choose a special code that will allow you to get a hash containing a certain number of zeros at the beginning of this hash. The process of finding blocks is called mining. When the problem is solved, a new block is formed, which can neither be deleted nor changed. But each user of the network can see all the information in the blockchain. As if you were collecting puzzles on the online broadcast in front of a multimillion audience.

The cryptographic hashes keep all the reliability and security of the blockchain. The hash is issued by the system in the format of a huge number. For a given dataset, the hash function gives one hash, which has two extremely important properties:


Here is the case when the medal has two sides: openness and security. In addition, with the slightest data changes, the resulting hash changes completely.

This is one of the main rules of technology. All data blockchain blocks are open to all and always. They are easy to check, easy to track any information changes. Therefore, you don’t have to guess how reliable the information you are interested in - the verification of their authenticity is simple and accessible.

The technical side is more or less clear. And what does this look like in real action for ordinary users? Everyone knows how email works. Imagine that one letter equals one monetary unit, and we can send this money to a specific addressee. Only, unlike e-mail, we have a certain limit on letters (availability of funds) and we can only send one letter to one addressee. After that, the limit of our letters will immediately decrease, and information about the sent transfer will be recorded both from the sender and from the recipient. At the same time, all letters are securely protected. Information about the transaction can not be neither deleted nor changed. In addition, it is seen by all network users - the recipients of your e-book.

Our “letter” can be not only a monetary unit, but also a security, a share. Anything you need to write and check.

The blockchain is completely decentralized, it is not worth any authority that can block transactions or block access to the blockchain. No third party is required to confirm the transfer of information. If we transfer money, the bank must confirm it, if we send the rights to the property, the participation of the notary is required. Blockchain completely eliminates the need for a third proxy.

Today, the blockchain is no longer associated with Bitcoin and becomes an independent technology, which forms the basis of new applications and systems. Experts are sure: as horse carts gave way to cars in due time, so blockchain becomes a logical evolutionary continuation of traditional accounting tools. Moreover, if earlier the blockchain was spoken of as a data storage, now its capabilities are becoming much wider, because it can also execute programs. Some blockchains allow each fact to contain a mini-program. In cryptocurrency, this can be traced when making transactions with conditions, for example: User A will transfer to user B 12 BTC if today is April 15, 13:30.

There is no magic in the blockchain, only math. Yet one important feature of this technology does not cease to amaze even the most prominent experts: the blockchain’s possibilities are limited only by human fantasy. Therefore, time will tell what else the blockchain is capable of.

Algorithms


2002 America. The US National Security Agency announces the creation of the SHA-2 hash function. Cryptography goes to a new level.

It will take six years, and the SHA-256 algorithm (one type of SHA-2) will form the basis of the world's first cryptocurrency, and to this day will remain the very same classics that will not be destroyed even by modern designs.

Hashing is necessary in order to convert the input data of any length into a bit or otherwise output string of a certain size. This conversion takes place due to the hash function or convolution function.

Hashing is applied in various applications designed to protect information. Not without a hash function in the blockchain.

To close a block, you must loop through various combinations and select the correct hash. At first glance, it seems that a hash is a random sequence of letters and numbers. But in fact, it is a reliable guarantee that, if at least one bit changes in a block, each node will quickly learn about attempting to falsify the transaction history.

Technically, the SHA-256 algorithm works like this: the original message is divided into blocks, then each block is divided into 16 words. Each message block algorithm passes through a cycle with 64 or 80 rounds. The results of processing each block are added up, the resulting amount is the value of the hash function.

This algorithm requires powerful equipment, then the process will be effective. Strong iron can compute more than 2 billion hashes per second. SHA-256 became the prototype for the most massive hashing algorithm.

In order to counteract hash computing on specialized hardware ( ASIC ), a hashing algorithm called Scrypt was invented. Its task is the same: to find the hash, only here the emphasis is not on the power of the equipment, but on the RAM and the time it takes to calculate the hash.

This algorithm stores more than one thousand different hash values ​​during the operations performed. At the output, it combines all the values ​​and gives the final result. Therefore, compared to SHA-256, a large amount of memory is needed here to compute scrypt hashes.

There is also one more rather popular type of algorithms of group X, and its versions X15, X13, X11. The number after X is the number of consecutive functions that are used to calculate the block. These algorithms often use different forks of cryptocurrency. Such cryptocurrencies are very popular with amateur miners, since these cryptocurrencies can be mined on video cards, without the cost of purchasing specialized equipment.

The following algorithm is called Blake. Like SHA-2, BLAKE has two options: the first uses 32-bit words used to compute hashes up to 256 bits long, and the second uses 64-bit words used to calculate hashes up to 512 bits long. The base unit transformation combines 16 input words with 16 operating variables, but only 8 words (256 or 512 bits) are stored between the blocks.

The algorithms do not end there, every year programmers come up with something new. Gradually, crypto 2.0: N-Scrypt, Scrypt-jane and CryptoNote are gaining popularity.

Why so much and so often? The creators of cryptocurrency seek to create algorithms that would be difficult to translate into specialized equipment, ASIC. We in this approach see at once four potentially weak points:

  1. Asiki does anyway, and asiki have already been made for Script and N-Script;
  2. It is mistakenly believed that in this way centralization can be avoided. In fact, in any business, and mining is a business, centralization is inevitable;
  3. Algorithms that run on general-purpose processors are an inexhaustible source of motivation for a botnetovod virus writer;
  4. New algorithms created "on the knee", are not seriously tested, what vulnerabilities and holes could be there, is unknown.

What is PoW and PoS?


Each of us at least once had to report on the work done. Someone does it all the time, someone occasionally, but one way or another, if you want to get paid, prove that you worked hard. Why all this demagoguery? So it's easier to understand what PoW is.

We already wrote about one amazing property of the blockchain - decentralization. To confirm a transaction or transaction, no third party is needed. But a special algorithm is needed. Proof of Work or proof of work - the principle of protecting distributed systems from hacker attacks or spam. The main purpose of Proof of Work is to check the calculations made when creating a new block. Due to the fact that the process of calculating a block is complicated and random, it is impossible to predict exactly which of the miners will solve the problem and close the block. In order for a block to be recognized as true, its hash value must be less than the current target. Thus, each block shows that work has been done to find it.

In the first part, we wrote that all blocks have a hash of the previous block. It is impossible to change any block, but it is possible to create a new one. To do this, find all previous blocks. The high complexity of this process protects the blockchain from hacker attacks and unauthorized modifications.

For a simpler understanding, let us give an example: a person performs a complex and long work, then sends the results of this work to the system for review. This system has a special "check pattern", thanks to which the correctness of the solution is established in seconds. An important feature of this algorithm is the difference in the cost of time - a long query time and a fast response rate. We calculate something for a very long time, but we quickly check it.
But besides the advantages, the algorithm has its drawbacks. The main disadvantage - the huge cost of computing power. Many prominent observers of crypto and blockchain technologies have compared PoW to a scary monster that consumes electricity day and night.

The alternative did not have to wait long. Many miners rejoiced when a new algorithm appeared, called Proof of Stake, or, alternatively, a confirmation of the share. And here it’s not the power of your equipment, not the amount of time spent, but the balance of your wallet. This is the principle when money makes money: the more money you have in your wallet, the more profit you will get. If you give examples, the PoW model is when you go to work and earn money (an employee), and the PoS system is when you put your savings in a safe bank and live on interest (rentier).

The degree of protection against attacks with PoS is much higher. Since, to conduct an attack, you need to spend a lot of money. But if you buy 51% of the coins, the market will respond with a rapid price increase. In addition, what's the point of doing an attack on the network, if most of the attacker's resources are invested in virtual coins of the same network, and the attack hits the patient himself — the wallet? If the attacker has a lot of money, and he produces it, then he himself will suffer from the attack, because it will break the stability of the cryptocurrency. Unfortunately, the Proof of Stake is also available.

Therefore, someone from the geniuses of the blockchain community came up with the idea of ​​finding a middle ground by combining the two algorithms Proof of Stake and Proof of Work.

Hybrid PoW + PoS


The resources spent on block hashing with the PoW algorithm are enormous and far exceed the capacities of the largest supercomputers. In addition, PoW-cryptocurrency can be attacked by temporarily renting a huge computing power.

PoS-cryptocurrencies are potentially vulnerable to other types of attacks. For example, an attacker wanted to create a fork of the blockchain - a longer alternative chain at the expense of wasting "non-existent" resources. In addition, he can get the support of other miners, because they also do not have to spend "genuine" resources.

With the help of a fork, an attacker can block certain transactions and produce “double flow” attacks. Such attacks can be divided into near and far. With close attacks, most of the last blocks are replaced, and at the time of long-range attacks, the attacker can replace the entire network history.

The hybrid mechanism is the safest, and therefore formed the basis of the project Emercoin and several others.

With the standard hybrid scheme, the blockchain consists of two types of blocks. At the same time, both PoW and PoS blocks are searched. "Proof of work" can be compared with the checkpoint, because basically PoW is used to distribute new coins. Confirmation of the share is necessary to protect transactions, that is, as the primary means for generating transaction blocks.
For a successful attack on a project with a hybrid mechanism, an attacker must have 51% of the total computing power of the network and 51% of the total money supply. This creates for the attacker two barriers of different nature, which protect the network from being compromised.

As we have already mentioned, Emercoin has a hybrid consensus mechanism, but in our project the emphasis is more on PoS. In fact, Emer is a PoS cryptocurrency, in which the PoW mechanism is left for security reasons, and plays an important but supporting role, and about 80% of the blocks are closed by PoS.

Source: https://habr.com/ru/post/329276/


All Articles