Part III: The Nakamoto Consensus
The third and final episode of a three-part article on bitcoin mining that deals with the Byzantine Generals’ Problem
Riddle me this:
Army generals from far and wide have come in to lay siege upon the great city of Byzantium. Now, they must decide when to attack. If they all attack together, they will win. If they do not, they will all lose out to the might of Byzantium one by one. But of course, there’s a caveat.
The challenge is that the generals have no way of communicating with each other as there are no secure lines that they can be sure will not be intercepted by Byzantine defenders. Also, they all have different ideas as to when the attack should be carried out.
How should the generals coordinate an attack?
The Byzantine Fault
The answer to the above question is rather simple, really: by developing an algorithm by which those looking to intercept are unable to disrupt communication.
It was around 1980 when American computer scientist Robert Shostak first conceived what is today known as the Byzantine fault. Though there are several variations to the initial story, it is essentially a math problem rooted in concepts of game theory; describing the difficulty that decentralised agents without a trusted central party have in reaching a consensus. Today, the Byzantine generals’ problem is a widely-used analogy in the field of computer science to help visualise the challenge of establishing and maintaining security on a distributed network.
To solve this, “honest nodes (e.g. computers or other physical devices) need to be able to reach consensus despite the presence of dishonest nodes. This means a majority of nodes must establish a set of rules and come to an agreement on how to enforce those rules on the network”, according to researchers from open-source technology workshop Komodo Blockchain Solutions.
In bitcoin mining, a distributed timestamp server is what is used to store minor coded data in each different block – almost akin to a serial number – whose main job is to determine the exact time of mining and verification of the block.
Now consider this: Just as you create the new block to be added to the existing chain, several competing blocks from other miners try to add the block at the exact same time – many even with dissimilar transactions.
How does this decentralised system thus authenticate the real block of transactions to enter the blockchain?
A solution to the Byzantine Generals’ Problem is achieved through what is called the Nakamoto Consensus, or the Proof-of-Work (PoW) mechanism. The method establishes a clear and objective ruleset for the blockchain intended for “fault tolerance in a trustless and permissionless environment.”
Hashcash, for example, is one such PoW algorithm being used as a denial-of-service counter-measure technique. “A hashcash stamp constitutes a proof-of-work which takes a parameterizable amount of work to compute for the sender. The recipient (and indeed anyone as it is publicly auditable) can verify received hashcash stamps efficiently.”
Once a miner has publicly broadcast their solution to the rest of the network, at least 51% of the network – or the Nakamoto Consensus – needs to accept the solution in order to verify the transaction and enter the new block. Cryptocurrency finance firm River Financial writes:
“Thus, at all times, members of the Bitcoin network can agree on the state of the blockchain and all transactions therein. Each node verifies for itself whether blocks are valid based on the Proof-of-Work requirement and whether transactions are valid based on other requirements.
If any member of the network attempts to broadcast false information, all nodes on the network will immediately recognize it as objectively invalid and ignore it. Because each node can verify all information on the Bitcoin network itself, there is no need to trust other members of the network, making Bitcoin a trustless system.”
Coinformant writes, that while it is very difficult to forge the Bitcoin blockchain, “hackers are trying to avoid the verification system of Bitcoin using methods like out-computing the security mechanism of the blockchain or double-spending method which involves sending a deceitful transaction log to the seller and a totally different one to the Bitcoin network.”
Consider a 51% attack, for example. A majority attack by which a single person/group gains authority of over half of a blockchain’s total hashing power, successful attackers not only block new transactions from being confirmed but also change the existing order of transactions. Malicious agents thereby essentially rewrite sections of the blockchain and reverse their own transactions leading to the problem of double-spending.
The double spending problem isn’t one you’d encounter with regular currency. Once you pay someone in fiat currency, you cannot receive that particular money back to re-spend again. This isn’t, however, the case with digital currencies such as bitcoin, owing to the fact that digital data is reproducible by similar computing power.
The solution to this, however, comes rather simply. Given the fact that BTC is based on blockchain technology under a PoW mechanism, each and every transaction in the cryptocurrency is stored on a public ledger distributed to every member of the network in internally-connected sequential blocks on the blockchain. Every time-stamped transaction is thus visible to everyone on the network at all times; and fraudulent transactions are inspected and rejected.
Additionally, as cryptocurrency exchange Coindesknotes: a 51% attack is theoretically limited in the amount of disruption it can cause. While the attacker could trigger the double-spending problem, they cannot reverse others’ transactions on the network or prevent users from broadcasting their transactions to the network. Additionally, a 51% attack is incapable of creating new assets, stealing assets from unrelated parties or altering the functionality of block rewards.”