The latest in the tech world is a raging debate between blockchain and hashgraph, a relatively new entrant to the world of distributed ledger system.
There are many enthusiasts who believe that hashgraph addresses many of the problems in blockchain while others contend that comparing blockchain with hashgraph is like comparing apples to oranges.
So, which of these two groups are right? Well, let’s start by understanding the drawbacks of blockchain, so we can know if hashgraph is really the solution for these problems.
Here’s a look at some of blockchain’s downsides.
- Scalability: One of the biggest drawbacks of blockchain is its scalability. Since every node has to process every transaction for the system to be truly decentralized, it is not scalable. In fact, blockchain becomes weaker when more nodes are added to it.
- Environmental cost: Blockchain depends on complex algorithms to give the necessary security for users. Such complex algorithms require huge computing power that in turn consumes high amounts of electricity. According to a study conducted by a UK-based company called PowerCompare, the average electricity used to mine bitcoin in 2017 was way more than the annual energy use of 159 countries. That’s the magnitude of environmental impact we’re talking about here.
- Regulation: There’s a lot of skepticism about blockchain applications like bitcoin, especially in the legal and government policy-making circles. Most governments are wary of blockchain, and this creates a risky environment for investors and users.
- Not always fair : Blockchain uses Proof of Work (PoW) or Proof of Stake (PoS) protocols, and the order of transactions is not guaranteed in both these protocols. In many cases, miners determine which transactions should go in first based on the value of transaction fees. So, blockchain is not always a fair system.
- Centralized at times: In many blockchain networks, consensus comes only from miners, and not from users. A study shows that in the UK, the top three bitcoin mining pools control 54 percent of the total pool distribution, so blockchain is not really decentralized.
- Synchronous: In blockchain, blocks are bunched together and added to the network. This means users may have to wait for their transactions to be added to the network.
- Existing consensus technologies: Blockchain’s consensus technologies are divided into public networks and private networks — both of which have their own shortcomings.
- Stale block: When two miners create a block at the same time, the community decides which block should be included and which should be discarded. This results in a wastage of time and resources.
Now that we understand that blockchain is not perfect, what’s the solution? Should we move away from blockchain completely or address these drawbacks?
There is no straight answer, as it depends to a large extent on your business goals, needs, and other factors.
Some groups, though, are taking a proactive approach in developing technologies that would address many of these blockchain drawbacks, and one such technology is hashgraph.
What is hashgraph?
Simply put, a hashgraph is a mathematical algorithm for the distributed ledger system. Created by a company called Swirlds, hashgraph aims to overcome the problems in blockchain using two technologies called “gossip protocol” and “virtual voting.”
Currently, blockchain uses one of the two algorithms, namely, proof of work (PoW) or proof of stake (PoS). However, both these algorithms come with their own problems. A better algorithm is voting, where every node communicates information to all the other nodes in the network. This protocol will be truly decentralized and secure, as no malicious blocks can enter the chain.
At the same time, this voting protocol consumes way too much bandwidth, especially if there are thousands of nodes. This makes the voting algorithm impractical in the real world.
Swirlds, the company that developed hashgraph, decided to implement the voting protocol minus the bandwidth issues. To do that, they created a new protocol called the gossip protocol. In this protocol, every node in the network picks another random node and passes all its information to it. The second node again picks a random node and sends all the information to it.
This way, every node is randomly and repeatedly picking another node and passing information. Soon, all nodes within the network will have the same information.
When a node sends information, it not just sends the details, but also includes who sent the message and when it was sent. This way, there is a timestamp that gives a specific order to the transactions.
Let’s understand how hashgraph works with a simple example.
There are three nodes, A, L and X. Each member starts a hashgraph by creating a data structure in memory called an event. Each event is simply a container for zero or more transactions.
Next, A randomly picks L and sends details of all the events it knows including the member who created it and the date and time when it was created. L creates a new event to record all the information given by A. This new event is connected to both L and A to have a record of how information was communicated and between whom.
This new event has two hashes from its two parents (self-parent and other-parent). In this case, self-parent is L’s event while the other-parent is A’s event. Also, this event has a timestamp of when it was created and then, L digitally signs the event. When this event is sent through the gossip protocol, it contains five pieces of information, namely,
- Hash of self-parent
- Hash of other-parent
- Details of transactions
- Digital signature
Next, L picks A to give this information. So, A will create an event to record this event and will link it with the new event that L created as well as to itself.
Next, let’s say A picks X to send all information to it. So, X creates another node to record this information. This pattern continues until an acyclic graph is created. Since this graph is connected through cryptographic hashes, it’s called a hashgraph
So, how does this model score over blockchain?
Hashgraph vs. blockchain
Best of voting algorithm
Hashgraph uses a system called virtual voting. It is based on the belief that when one node knows all the information of a second node, it can vote on behalf of the second node. In other words, it uses the voting algorithm without the bandwidth problem. As a result, the problems that come with blockchain’s PoS and PoW protocols are eliminated.
Blockchain is a chain of blocks, where every node is added one after the other in a chronological order. Since every node has to process a transaction, public blockchain networks such as bitcoin can process only around seven transactions per second. Also, transactions are bunched together and added synchronously to the block, and this causes delays as well.
Hashgraph uses the gossip protocol, which means, two computers communicate to two other computers, and this rate of communication grows exponentially when more nodes are added. Transactions are added asynchronously, so there’s no waiting time. This is why hashgraph can process 250,000 transactions per second.
Currently, blockchain depends on miners, so micropayment transactions are not really that easy to get through because the fees on such transactions are low. This means, miners do not feel incentivized to process these transactions.
Hashgraph, on the other hand, doesn’t need miners because it doesn’t use PoW or PoS. Also, all the nodes in a hashgraph are involved, so there’s not much to incentivize through fees. Both these factors make hashgraph ideal for micropayments.
Blockchain is open source, but hashgraph is not. This means Swirlds decides who can use hashgraph and who can’t. Though hashgraph is working on a public ledger cryptocurrency (no technical details are available on it yet), there is still a ton of skepticism in the community about hashgraph’s patent. In fact, many experts opine that it negates the very idea of a decentralized system itself.
Hashgraph allows a high degree of fairness because no one can influence the transaction order. But in blockchain, miners can determine the order of transactions, most often depending on the value of transaction fees.
In blockchain, there is always a tradeoff between decentralization and the rate of transactions. When the size of a blockchain network grows, the storage, bandwidth, and computing power increases. After a point it becomes unwieldy, so only a few nodes can process a block. And this defeats the idea of decentralization.
Hashgraph overcomes this trade-off because nodes send messages using gossip protocol. But the fact that it is not open source could make it centralized in the future.
So with all this, hashgraph is a promising technology. But is it really going to be the successor to blockchain?
It’s hard to tell at this point because hashgraph is at a nascent stage compared to blockchain. No major application ia available for hashgraph yet, so we don’t know how it will work and what problems will come with it. Though Hashgraph founders are working on a project called CULedger to create a distributed ledger for all credit unions in the U.S., it’s not available yet.
Secondly, hashgraph is a patented technology, which means one or more entities will have complete control over it at any point in time. Considering these two aspects, it’s hard to say if hashgraph is really the next version of blockchain.
We will stay on top of events in the hashgraph world and will update as and when something interesting happens to give you a better answer to this daunting comparison between hashgraph and blockchain.
In the meantime, do let us know what you think of hashgraph and your take on whether it will replace blockchain.
Photo credit: Shutterstock