官术网_书友最值得收藏!

The Byzantine Generals Problem

In the following chapters, we will start addressing more business-oriented topics. Until then, I should provide you with some context on the whys and wherefores of blockchain and go back to where it all started, with the Byzantine Generals Problem.

The Byzantine Generals Problem is a real-life analogy for computer science that was expressed and partly answered in 1982 by Leslie Lamport, a famous American scientist and Turing Award winner, who raised the following question: how can you achieve a consensus in the presence of traitors or faults? Translated to the computer science world, this means: how can you achieve consensus in a distributed system where some computers may be malfunctioning or give conflicting information? This is how the issue came to be illustrated and known as the Byzantine Generals Problem.

The following diagram is an illustration of the Byzantine Generals Problem:

Source: L.Lamport, R.Shostak and M.Pease, The Byzantine Generals problem, ACM Transactions on Programming Languages and Systems, Vol. 4, No. 3, July 1982

Explanation—multiple byzantine generals surrounding a city must coordinate their attack to take the city. To coordinate themselves, they use messengers to indicate to each other which decision they took: attack or retreat. Since this situation happens under war circumstances, some generals could be traitors and some messengers could be captured or die trying to send the news.

If we draw a comparison with blockchain, the generals are the miners and the messengers are the communication links between them. Several researchers have concluded that the generals can't agree on a strategy if one third or more are traitors.

So how does blockchain solve it?

One instrument was introduced into the blockchain to make consensus work: incentives. A blockchain usually includes incentives for the miners who validate the transactions. In Chapter 1Basics of Blockchains and the Illustration of Village Beta, the villager who validated the transactions was rewarded with 5 Villagecoin.

In a blockchain, this is how a consensus is reached:

  1. All of the miners start constructing their local block.
  2. A random miner solves the mathematical problem of the block.
  3. The random miner sends his/her block to the other miners.
  4. The other miners receive the block of the random miner.
  5. The other miners check that the result found by the random miner is correct and that the previous hash points to the previous block's hash.
  6. If it is valid, they cancel the block they were building and add to the copy of their blockchain the new block sent by the random miner.
  7. The random miner is rewarded with an incentive.
  8. Then, the process repeats.

If a dishonest miner solved the mathematical problem and incorporated an invalid transaction in its block, the other miners would reject it because it contains an invalid transaction (the hash would totally be different). This miner would have to discard his/her block and, therefore, will not be able to receive any incentive. Let's look at how incentives work in more detail. 

主站蜘蛛池模板: 富民县| 施秉县| 揭阳市| 嘉鱼县| 晋江市| 西城区| 驻马店市| 微博| 昌乐县| 武邑县| 射阳县| 绵阳市| 彩票| 铁岭市| 石首市| 古交市| 兴文县| 龙陵县| 枝江市| 武隆县| 临桂县| 广德县| 军事| 个旧市| 来安县| 绥阳县| 连云港市| 靖州| 昌宁县| 资兴市| 宿州市| 左贡县| 陆川县| 江源县| 沾化县| 昌吉市| 衡南县| 诸城市| 从江县| 青阳县| 大荔县|