In this first piece of a series that looks into Hashgraph, I explore the different consensus algorithms utilised in distributed ledger technology (DLT) iand attempt to categorise them according to their fundamental properties. I believe this is a useful start as a build-up to understand Hashgraph’s unique value proposition.
Ok, let’s start with the boring stuff, a simple Google search of the phrase: “what is blockchain” yields over 25 700 000 pages where various content creators attempt to explain blockchain in their own slightly unique way. For the purposes of this article, we will define blockchain as:
“A public, decentralized database that keeps public records in an append-only mechanism.”
Anyone who has spent significant amount time learning about some of the building blocks of DLT will attest that the success factors of any distributed computing system lie squarely on its consensus mechanism.
In this article, I introduce four main categories of consensus algorithms:
What it is
This mechanism is used mainly in the permissioned distributed ledger world. At a high level, this category of algorithms does not use a blockchain. Instead, blockchain is replaced with a kind of leader-based algorithm represented by Paxos, Raft or Practical Byzantine Fault Tolerance algorithm [PBFT]).
How it works
Nodes on the network elect a leader. They send all their transactions to the leader. It is the leader’s responsibility to ensure that all the transactions are in order and send out all the transactions (in that order) to all the nodes of that particular network.
Scalability
This mechanism is not highly scalable as most of nodes depend on a leader (bottleneck). Tests have indicated that this system will top out at about +-1000 transactions per second.
Fairness
The fact that this model is dependent on the leader node means that it is not quite not fair in some technical sense. For example, in a distributed trading platform if the platform makes it possible for a single party to block (or influence) the flow of bids and asks into the system then that would be considered unfair .
Security
It is vulnerable to Distributed Denial of Service (DDoS) attacks as, by design, each node needs to know the IP-address of the leader. The network knows when the leader is offline and will elect a new leader — the attacker also knows this leader and this happens within seconds.
Examples
Corda, IBM Hyperledger, Stellar
What it is
This the most well-known mechanism of reaching consensus in public blockchains. In contrast to the leader-based category of consensus algorithms, PoW does not require all nodes to submit individual transactions to all parties via a pre-elected leader.
How it works
In a PoW system all the transactions flow to all the miners. Miners will collect those transactions and put them in a block. The miners then compete against each other to solve a hard crypto puzzle. Whichever miner is able to solve this puzzle first earns the right to publish that block of transactions to the rest of miners, which then appended to the top of their local copy of the chain.
Scalability
Performance of current PoW is terrible compared to leader-based systems and transactions are highly expensive.
Fairness
The miners decide (unilaterally) which transactions go into the block. This is not entirely fair since they can prevent transactions from flowing into the network and also decide on the order of transactions within a specific block.
Security
PoW is much more secure than the leader-based models since it’s not possible to predict who will solve the crypto puzzle first, making it difficult to conduct a DDoS attack.
Examples
Bitcoin, Ethereum
What it is
As a response to the current scaling shortcomings of the PoW systems, the market has come up with a new generation of consensus mechanisms that try to replace PoW with other mechanisms collectively called Economy-based solutions (e.g. Proof-of-Stake)
How it works
In economy-based solutions, a fundamental assumption is made that stakers (miners in PoW) will act rationally by maximising the amount of money they make. However, this results in a system of incentives that, when applied to all the stakers, leads to the stakers agreeing on which block goes to top of the chain (consensus) based on the relative state each node holds.
Scalability
This mechanism is much more scalable than PoW as opposed to miners investing computational resources to compete in solving the hard crypto puzzle, stakers run a process that randomly selects one of them proportionally to the stake that each possesses. This significantly reduces transaction costs.
Fairness
The stakers decide (unilaterally) which transactions go into the block. This is not fair since they can prevent transactions from flowing into the network and also decide on the order of transactions within a specific block.
Security
This mechanism functions on the fundamental assumption that stakers will act rationally but does not answer how to handle instances where a ‘staker’ node has been compromised by either a virus or a disgruntled party. This problem is called a “nothing at stake” problem. In the instance of a virus attack, the staker will not necessarily act rationally. Furthermore, the system is currently very complex and it’s impossible to write a formal proof that one compromised node will not lead to a total shutdown of the network.
Examples
Cardano
What it is
The pure voting algorithms have been around for a many years but were only recently introduced into blockchain.
How it works
If we have eight nodes in the system, and we want those nodes to agree on the order of transactions, we can ask those nodes a question related to the order. We ask each node the same question and then each node votes and sends each vote to every other node in the network. When a node receives a vote, it will send an acknowledgment to the sending node and to all nodes in the network. This can involve multiple rounds before the nodes reach consensus.
Scalability
The amount bandwidth required for this kind of system to accommodate the voting process increases by multiple orders of magnitude. Due to the number of potential transactions in this kind of network, it becomes impossible to implement at scale.
Fairness
This system offers great properties for fairness as every node is involved in the voting process.
Security
This system has phenomenal security properties. It is the only system that is able to achieve Asynchronous Byzantine Fault Tolerance (ABFT) – the gold standard in terms of security for DLTs.
Examples:
There are currently no pure voting-based systems.
The title of the article may be construed as misleading, what does hashgraph have to do with consensus algorithms? Unfortunately, I couldn’t do justice to explaining hashgraph technology without first taking a slightly formal look at the different categories of consensus mechanisms for various distributed ledgers out there.
By doing so, I hope to be able to attempt fit hashgraph into this picture. I’m well aware that there is very little body of knowledge in the public domain that attempts to categorise these consensus algorithms in the manner I have done in this article, and I hope this will spark a discussion and serve a good foundation when we take a deep dive into Hashgraph in the next article.
by Mandla Magagula