Byzantine Generals Problem
Byzantine Generals Problem
Byzantine Generals Problem
2
Objectives of Session 2
Recognize centralized asset & transaction ledgers
Understand the Byzantine Generals’ Problem
Understand how Bitcoin addresses the Byzantine Generals’ Problem
Review some key Bitcoin metrics and developments in practice
Thousands of cryptocurrencies/tokens exist out there. This session will provide the basis for understanding
the theoretical underpinnings of Blockchain technology and Bitcoin – as the paradigm, thinking about their
broader implications and the practical exercises that will follow in the later sessions.
Students new to this technology will find this the most challenging session of the course. It is important to
invest as much time as is needed in understanding this part and to not be discouraged. It took most of us
many hours/days/weeks to understand this part!
SHA-256: A cryptographic hash acts like a 'signature' for a text or a data file. Can be used to
confirm file integrity and authenticity. The SHA-256 cryptographic hash generates
an almost-unique 256-bit (32-byte) signature for a text or data file
Use an online hash converter such as https://hash.online-convert.com/ and enter the text you want to convert.
Then, try changing just a letter to see how the hash generated significantly varies each time a change is made.
e.g. try to see the difference between the words “Bitcoin” and “bitcoin”
*Cannot be changed or interfered
If we let any untrusted party enter transactions in an important traditional ledger, chaos is likely to
ensue (would you, for example, let strangers keep track of your checking account balance?)
Given this, a trusted party is in charge of all ledgers of importance in modern society, whether it is the
bank which “stores” your funds, or your local land registry office for the title deeds for your house
Centralized ledgers, however, are not perfect because record-keepers are not always trustworthy, act as
gatekeepers and represent a Single Point of Failure
Record-keepers might not be trustworthy in practice. They may, for example, take a bribe to transfer a piece of
land illegally
Record-keepers might exclude parties that they disapprove of (e.g. banks which do not allow transactions
from/to cryptocurrency exchanges)
Record-keepers might lose important transaction records, even if they are well-intentioned, due to
carelessness, natural disaster and so on
Accounting
Are centralized record-keepers indeed
Ledgers trustworthy?
Academic Bank
Certificates Accounts
One of the reasons for the excitement of technologists about Blockchain is that they believe Bitcoin is the
first practical use case of this technology that could allow for the decentralization of all business ledgers
The practical consequence of solving this problem is that Bitcoin gives us, for the first time, a way for one Internet user
to transfer a unique piece of digital property to another Internet user, such that the transfer is guaranteed to be safe
and secure, everyone knows that the transfer has taken place, and nobody can challenge the legitimacy of the transfer.
The consequences of this breakthrough are hard to overstate.
What kinds of digital property might be transferred in this way? Think about digital signatures, digital contracts, digital
keys (to physical locks, or to online lockers), digital ownership of physical assets such as cars and houses, digital stocks
and bonds … and digital money.”
The Byzantine Generals’ Problem, first proposed by Marshall Pease, Robert Shostak and Leslie Lamport in
1982, provides a stylized description of this problem
Past attempts at solving the currency side of the problem include the following research :
Chaum, D., 1984. Blind Signature System, in: Chaum, D. (Ed.), Advances in Cryptology. Springer US, pp. 153–153.
Chaum, D., Fiat, A., Naor, M., 1990. Untraceable Electronic Cash, in: Proceedings of the 8th Annual International
Cryptology Conference on Advances in Cryptology, CRYPTO ’88. Springer-Verlag, London, UK, UK, pp. 319–327.
Okamoto, T., Ohta, K., 1992. Universal Electronic Cash, in: Proceedings of the 11th Annual International
Cryptology Conference on Advances in Cryptology, CRYPTO ’91. Springer-Verlag, London, UK, UK, pp. 324–337.
Wei Dai’s B-Money - Wei Dai, 1998, http://www.weidai.com/bmoney.txt
Bitcoin, however, a system proposed in a white paper released in November 2008, under the pseudonym
Satoshi Nakamoto, is the best solution to this problem that has been proposed to date and has had, by far,
the broadest adoption. October 31 st 2018 marked the 10 year anniversary of Bitcoin’s whitepaper release so
we already 11 years beyond this significant milestone.
Image Source: Wikimedia Commons. Text: The Byzantine Generals’ Problem, Lamport, Shostak, Pease, 1982
In this case, 1 traitor (either Lieutenant 2 or the Commander in the cases above) could cause the attack to fail
A traitor prevents the group from reaching consensus. Now think of a traitor, as a malicious party within a ledger
that aims to facilitate fraudulent transactions. The rest of this presentation will show how Satoshi solves this
Image Source: The Byzantine Generals’ Problem, Lamport, Shostak, Pease, 1982 issue.
Image Source: Wikimedia Commons
Image Source: The Byzantine Generals’ Problem, Lamport, Shostak, Pease, 1982
Bitcoin: with capitalization, is used to describe the concept of Bitcoin, or the entire network itself
Bitcoin address: a location that bitcoins have been sent to and reside at. It is a participant’s unique identifier
on the Bitcoin network and it is public
Transaction: A record informing the network of a transfer of bitcoins from one bitcoin address to another.
Think of it as a single line in a text book
Blockchain*: The complete transaction ledger of the Bitcoin network, showing how bitcoins have been
transferred from one address to another over time. The blockchain is a public record of all bitcoin
transactions in chronological order.
*All Bitcoin transactions are stored in blocks (think of them as pages of the text book), which are linked (or
“chained”) together in sequence to form the blockchain (think of it as the whole text book)
By now, you should realize that keeping the blockchain copies in sync is a manifestation of the Byzantine
Generals’ Problem
Have in mind that downloading the Bitcoin client software is not mandatory in order to become a
Bitcoin/cryptocurrency user. It is recommended for users wishing to see how the blockchain network
operates in more detail.
2. At this point, however, the transaction is considered “unconfirmed” because it suffers from the Byzantine
Generals’ Problem. E.g., what if a dishonest Bitcoin client sent out two transactions moving the same bitcoin to
two different addresses? Which one should the clients accept?
3. The mechanism that Bitcoin uses to confirm transactions and resolve the Byzantine Generals’ Problem is a
process called “mining”
Mining:
Creation of new bitcoins in each block, almost like a central bank printing new money. Remember though, that the amount of bitcoins to
be created is fixed (21 million)
Creation of trust by ensuring that transactions are confirmed only when enough computational power was devoted to the block t hat
contains them.
If the process seems too complicated do not worry! The system can operate the steps below by itself i.e. no heavy manual work is
required
1st Step
2nd Step
3rd Step
Miners collect and Apply a cryptographic Try to solve the “Proof-
broadcast their hash function of the of-Work” Problem
transactions in a block header of the previous
and verify they are valid block to the new block
Proof-of-Work Problem:
Step 1: Hash of Last Block Header + Block of New Transactions + Random Number (Nonce=32-bit number)
Step 2: Apply Cryptographic Function (SHA-256) to the above data
Step 3: Hash reviewed against a predetermined value(a desired pattern). Less than this value=Prize. Not less=Guess Nonce Again & Repeat
- Winning Block Verified by Nodes as a Block and broadcasted to the network
Block reward started from 50 bitcoins per block and is halving every 210,000 blocks, approximately every 4
years
In September 2019, the block reward is 12.5 bitcoins. This amount far outweighs the reward from transaction
fees. The next halving will take place in 2020. Block rewards will stop once the network reaches Block
6.930.000 (sometime around the year 2140). The total number of bitcoins issued by then will be about 21
million - https://en.bitcoin.it/wiki/Controlled_supply
Fortunately, the prizes (new blocks) auto-adjust their difficulty (leading zeros) to account for how much
computing power is in the Bitcoin network.
The difficulty of guessing the correct random number (nonce) that produces the desired number of leading 0s
in the block hash, is adjusted every 2016 blocks (approximately two weeks) so that the network produces one
successful block every 10 minutes or so.
While any given block might take less time or more time to create due to luck, if blocks start being produced
too often or not often enough, the prize puzzle gets more difficult or less difficult so that blocks are formed
every ten minutes or so again
This means that, whether the Bitcoin network just has 20 old laptops doing mining or millions of super-
computers mining, blocks will still be created approximately every 10 minutes and anyone’s expected
reward from mining is their % of the total network’s computing (mining) power. And since anyone can
setup a mining node, if it is very profitable to mine because, say, the price of a bitcoin has gone up, more
miners will come into the system (and vice-versa, if it is unprofitable, miners will drop out)
The answer is that when a client is trying to decide which blockchain version to accept, it must choose the
one that is “longest” (In Bitcoin terms), aka the one that has the “greatest combined difficulty” (of the hashes
used to create it). In other words, the chain that took the most computation power to create will be chosen
The shorter blockchain is discarded (as an “orphan block” and those transactions have to be re-processed if
they were not in the longer blockchain)
Given this, a traitor cannot keep entering bad signals into the blockchain (aka, spend money in one block,
then erase the transaction in the next block) unless he or she can keep producing the longest blockchain (the
one with the most computation associated with it) which, statistically, the traitor can’t do, given the
essentially random nature of block creation (unless he has enough hashing power and can sustain mining the
majority of new blocks). More on this on the next slides.
Random Work
Select The “Longest”
(Guessing of the Nonce) To
(Most Difficult) Chain
Produce A Chain
They often consider it (a) wasted effort or (b) an indication of poor system design (“why do they need to do
so much work to enter a transaction when my database can just do it instantly?”)
In fact, it is the *key* aspect of providing ledger security, in that it prevents any one party from hijacking the
ledger
One useful mental model is to think of it as a lottery relating to who gets to enter the next transactions in the
system to prevent one person from taking control of the ledger
If one miner controls more than 50% of the hash power, it can always produce a “longer” chain than all the
other miners combined and therefore it can reverse its own past transactions and/or refuse to enter
transactions from others. (It still can’t spend the bitcoins of others, but it can prevent them from being
spent).
This is known as a “51% attack”
In other words, a 51% miner becomes a centralized ledger-keeper like a bank or credit card company,
eliminating the advantages of a decentralized system
So, it is important for the ecosystem of any cryptocurrency that honest miners maintain 50% of the
computational power in the system (alternatively, that no single dishonest miner, or coalition of miners, gains
more than 50% of the computational power in the network).
Fun facts:
• At times, some mining pools (groups of miners) in Bitcoin have gained over 40% of the hashing power in the network,
something that has raised concerns. These major pool members backed off from the 50% mark voluntarily in order to
preserve confidence in the system)
• The largest mining pool currently has more hash rate than Bitcoin’s entire hash rate in November 2017
For this session however, direct your attention primarily to understanding the underlying mechanics as well
as possible, because it will strengthen your ability to participate in the rest of the course
Source: https://blockchain.info/markets
Think of the total network hash rate as the total computing power
dedicated at the network, by users all around the world.
Introduction to Digital Currencies
MSc in Digital Currency 38
5. Conclusions
Historically, all ledgers of importance have been centralized. While giving a measure of security, central
record-keepers have weaknesses in the areas of:
Corruption
Inclusion
Technical failures
The Byzantine Generals’ Problem, a matter of study in the area of fault tolerance, describes why
decentralized ledgers have historically been infeasible
Bitcoin has presented the best solution to-date for solving the Byzantine Generals’ Problem and, subject to
certain conditions, has made widespread decentralized asset and transaction ledgers possible
Leading technologists believe that the implications of this technical breakthrough will be far-reaching,
extending far beyond digital currency
Twitter: @mscdigital
Course Support: [email protected]
IT & Live Session support: [email protected]