Hello. What is the consensus algorithm? I heard it could be proof-of-work or proof-of-stake. What are its types and how do they differ? Could someone explain it to me step by step? Thanks to .
In every blockchain-based network, two types of messages are given: transactions (contractually speaking, money transfers) and blocks that consist of these transactions. In order to make a transaction you don't need any permission from strangers, all you need to do is know the key (password, identifying the wallet owner). This is not the case with blocks, the order of which is confirmed by consensus in the transaction log. The problem of the network is that between the nodes, it is possible to retransfer transactions at the same time.
An example of a situation that is called "double spending". James has 1 bitcoin that he wants to pass on, but he sends it simultaneously to Alexander and Annie. And if Alexandra and Anne do not agree on this transaction (that is, they do not know that it has been sent at once), then a network problem arises. Therefore, all network participants coordinate the logs, so that one of Jacob's operations will be successful and the other one will be considered as incorrect.
The essence of the problem is understandable, but how to solve it from a technical point of view? It is not a simple issue. That is why we need a consensus algorithm.
In the context of cryptography, consensus algorithms are a key element of any blockchain network because they are responsible for maintaining the integrity and security of these distributed systems. The first cryptocurrency consensus algorithm that was developed was Proof of Work (PoW), which was designed by Satoshi Nakamoto and implemented on Bitcoin as a way to overcome Byzantine errors.
The consensus algorithm can be defined as the mechanism by which the blockchain network reaches a consensus (it agrees without any doubt on a particular issue). Public (decentralized) block chains are built as distributed systems, and since they do not rely on a central authority, the distributed nodes must agree on the validity of the transaction. This is where consensus algorithms come into play. They ensure that the rules of protocol are followed and guarantee that all transactions take place in an untrusted manner, so coins can be issued only once.