The Byzantine Generals’ Problem by humanjets

View this thread on steempeak.com
· @humanjets · (edited)
$0.02
The Byzantine Generals’ Problem
Developing a system like Bitcoin that is both distributed and reliable is incredibly difficult. This applies to any form of distributed system however, not just crypto currencies, where there is no central control enforcing trust. This issue has become known as the Byzantine Generals’ Problem (BGP).

<h2>Definition</h2>

The BGP was first proposed in 1982 relating to computer science fault tolerance and describes it as the following:

>"We imagine that several divisions of the Byzantine army are camped outside an enemy city, each division commanded by its own general. The generals can communicate with one another only by messenger. After observing the enemy, they must decide upon a common plan of action. However, some of the generals may be traitors, trying to prevent the loyal generals from reaching agreement. The generals must have an algorithm to guarantee that (A) All loyal generals decide upon the same plan of action and (B) A small number of traitors cannot cause the loyal generals to adopt a bad plan.”
>
><h6>Marshall Pease, Robert Shostak & Leslie Lamport</h6>

![The_Byzantine_Generals'_Problem_1.jpg](https://cdn.steemitimages.com/DQmfBToRDdQnB8w9zBhAhHFY8QnFDJ8Mbcbz4FZ1DgktK1S/The_Byzantine_Generals'_Problem_1.jpg)

<h2>What does this mean?</h2>

Taking a look at the diagram, we can see that traitors can prevent a group from arriving at consensus. Whilst in the Byzantine army, this could be a commander relaying false information, or a rogue lieutenant not passing on messages correctly, within distributed ledger technology this would be a malicious player seeking to process fraudulent transactions.

![The_Byzantine_Generals'_Problem_2.png](https://cdn.steemitimages.com/DQmQ55enyqK4VTfd5GqpeGEPu5crUvGwXtFhvL5bydJr58H/The_Byzantine_Generals'_Problem_2.png)

<h2>Send in Satoshi!</h2>

Our diagram is a simplistic one, so as you can imagine as a network grows and new users and connections develop, complexity increases exponentially and reaching consensus is far more difficult. This therefore explains why before Bitcoin, decentralised ledgers were not feasible.

The pseudonym Satoshi Nakamoto penned the famous Bitcoin whitepaper on 31st October 2008. It contained arguably the best solution to the BGP developed so far, and now enjoys the broadest adoption.

![The_Byzantine_Generals'_Problem_3.jpg](https://cdn.steemitimages.com/DQmXH2QQQRbRxCBGPvxYdYuCQdXktPb3ZZTu4oxf4MZfCaY/The_Byzantine_Generals'_Problem_3.jpg)

<h2>So how does Bitcoin actually solve this?</h2>

The BGP manifests itself within the issue of blockchain synchronisation. How does everyone’s ledger remain in sync and reach consensus in a distributed way? When a transaction is sent across the network, it is broadcast to all users. It is unconfirmed initially however due to the BGP. Users don’t know if a dishonest player has attempted to double spend the same Bitcoin for example, therefore which transaction do they accept? Bitcoin resolves the BGP and is able to confirm transactions through mining.

![The_Byzantine_Generals'_Problem_4.png](https://cdn.steemitimages.com/DQmddZHbJdiCib28MuDA2dRPefqhm9dnEyJzQLC5bdtGLLF/The_Byzantine_Generals'_Problem_4.png)

Mining solves the BGP by ensuring that transactions can only be confirmed if enough computational power was used to solve the block that contained them. This process can be generalised in 3 steps:

1. Compile Input Data - Miners collate a new block of broadcasted transactions and verify they are valid. The hash of the last blockchain block is added to this along with a random number (called a “nonce”).

2. Perform a cryptographic calculation (SHA-256 in Bitcoin’s case) to the data from step 1, producing an output hash (a series of characters).

3. This hash is checked against a desired pattern. If it matches this pattern, the “puzzle” is solved and that miner wins the prize for that block (currently 12.5 BTC, plus the transaction fees from the block). If not, another nonce is tried and the steps are repeated (until someone successfully mines that block and therefore solves the “proof-of-work” problem). The mining difficulty of solving this puzzle is automatically adjusted according to the overall computing power on the network. This way the amount of time it takes to solve a block remains at 10 minutes on average.

The winning block is then verified by nodes and broadcast to the network. In this way it acts like a lottery for who gets to enter the next transactions in the chain, preventing one party from controlling the ledger.

Some may suggest doesn’t this just shift the BGP to the miners however? What if two miners produce blocks at similar times or an attacker is attempting to reverse transactions, how do nodes choose which block to include? In reality it doesn’t shift the problem as nodes must always choose the chain that is the “longest”, therefore the chain that took the most computational power to create. The shorter blockchain is subsequently discarded as an orphan block and its transactions must be processed again if they weren’t already part of the successful block. A traitor cannot statistically act maliciously (such as spending BTC in one block and erasing that transaction in the next) as block creation is random, unless they have enough hash power to produce the majority of new blocks (a 51% attack). The costs and risk of such an attack are so severe in the Bitcoin blockchain that it is highly unlikely. Although mining pools can be made up of many thousands of separate entities working together (for the time being - there is no fixed coalition here) to solve blocks and are therefore unlikely to collude, some have concerns over the combined hashing power of certain pools or related pools. Whenever these percentages have risen too high in the past however, members of these pools have moved voluntarily in order to preserve confidence in the system.

Therefore the process of randomly selecting a nonce to produce a chain, combined with always selecting the longest (most difficult) chain, and provided honest miners have at least 50% of the overall hash power, Bitcoin solves the BGP.

![The_Byzantine_Generals'_Problem_5.jpg](https://cdn.steemitimages.com/DQmaBjmM4wywxBeEDLGPREKxGEdKghqyyHyiHNj2DxcGbn6/The_Byzantine_Generals'_Problem_5.jpg)

<h2>Conclusion</h2>

There are certainly caveats, though for the first time in our history, Bitcoin presented a feasible means of creating decentralised ledgers and reaching distributed consensus. As a result it currently enjoys the highest adaption of any such solution. Whilst this may or may not last in the future, it was the zero to one innovation breakthrough in solving the BGP and the implications of this will no doubt extend beyond its initial use case.

<p><img src="https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmUGwMmRdRNmUeD4TGiUmwtmbANQd4DzyR2XAZuUBbf3Wk/steemit_avatar_posts_circle.png" alt="steemit_avatar_posts_circle.png" /> By James Hunt (<a href="/@humanjets">@humanjets</a>)</p>
<p><a href="https://twitter.com/humanjets" rel="nofollow noopener" title="This link will take you away from steemit.com"><img src="https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmWYMJK6KUTaZJkaGTTdz7WS6XvQ9RPb3sztjx596Bm39o/steemit_twitter.png" alt="steemit_twitter.png" /></a>  <a href="https://medium.com/@humanjets" rel="nofollow noopener" title="This link will take you away from steemit.com"><img src="https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmaSiQuCh9gqxP4CenSc2iDdpbW5Sb8H9NHf3p84S23DsP/steemit_medium.png" alt="steemit_medium.png" /></a>  <a href="https://reddit.com/user/humanjets" rel="nofollow noopener" title="This link will take you away from steemit.com"><img src="https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmeiEKTcGT6kvVJk6ZfBbd4QBtW9KVsHj4RxR2GLKdrwi2/steemit_reddit.png" alt="steemit_reddit.png" /></a>  <a href="https://t.me/humanjets" rel="nofollow noopener" title="This link will take you away from steemit.com"> <img src="https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmduAK6pic3znB24etU9Pyf6PRYykU8c1eekx8BaboFmPx/steemit_telegram.png" alt="steemit_telegram.png" /></a></p>
👍  , ,
properties (23)
post_id64,543,713
authorhumanjets
permlinkthe-byzantine-generals-problem
categorybitcoin
json_metadata{"app":"steemit\/0.1","image":["https:\/\/cdn.steemitimages.com\/DQmfBToRDdQnB8w9zBhAhHFY8QnFDJ8Mbcbz4FZ1DgktK1S\/The_Byzantine_Generals'_Problem_1.jpg"],"tags":["bitcoin","crypto","mining","pow","byzantine"],"links":["\/@humanjets","https:\/\/twitter.com\/humanjets","https:\/\/medium.com\/@humanjets","https:\/\/reddit.com\/user\/humanjets","https:\/\/t.me\/humanjets"],"format":"markdown"}
created2018-10-19 15:16:33
last_update2018-10-19 16:08:33
depth0
children3
net_rshares20,991,784,284
last_payout2018-10-26 15:16:33
cashout_time1969-12-31 23:59:59
total_payout_value0.019 SBD
curator_payout_value0.004 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length8,161
author_reputation3,058,831,511
root_title"The Byzantine Generals’ Problem"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars0
author_curate_reward""
vote details (3)
@vados ·
I agree with the author, @humanjets!
👍  
properties (23)
post_id64,562,448
authorvados
permlinkre-humanjets-the-byzantine-generals-problem-20181019t215326609z
categorybitcoin
json_metadata{"users":["humanjets"],"app":"steemit\/0.1","tags":["bitcoin"]}
created2018-10-19 21:53:27
last_update2018-10-19 21:53:27
depth1
children1
net_rshares555,800,896
last_payout2018-10-26 21:53:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length36
author_reputation0
root_title"The Byzantine Generals’ Problem"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@humanjets ·
Thanks @vados
properties (22)
post_id64,590,342
authorhumanjets
permlinkre-vados-re-humanjets-the-byzantine-generals-problem-20181020t103529615z
categorybitcoin
json_metadata{"app":"steemit\/0.1","users":["vados"],"tags":["bitcoin"]}
created2018-10-20 10:35:36
last_update2018-10-20 10:35:36
depth2
children0
net_rshares0
last_payout2018-10-27 10:35:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length13
author_reputation3,058,831,511
root_title"The Byzantine Generals’ Problem"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars0
@gregario ·
Very noble effort, James. But I still don't get it. And, of course, I still do not  understand the difference between POW and POS. Does POS solve the BGP also?
properties (22)
post_id65,020,733
authorgregario
permlinkre-humanjets-the-byzantine-generals-problem-20181027t152442982z
categorybitcoin
json_metadata{"tags":["bitcoin"],"app":"steemit\/0.1"}
created2018-10-27 15:24:42
last_update2018-10-27 15:24:42
depth1
children0
net_rshares0
last_payout2018-11-03 15:24:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length159
author_reputation2,754,228,703,338
root_title"The Byzantine Generals’ Problem"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000