Hashgraph vs Blockchain: Which is better?
The Hashgraph and Blockchain are two competing technologies that solve the same problem of providing trust in a trustless environment, such as the Internet.
Both technologies help in storing and retrieving information over a decentralized network, but they approach the problem in different ways.
Blockchain groups data records into a block, timestamps that block, and hashes its contents to make it immutable. Hashgraph, on the other hand, records individual transactions. But it uses a virtual voting method to reach a consensus on which transactions are valid.
This post looks behind the scenes at these two technologies. To see what they bring to the table and what they mean for the future of cryptocurrencies and the crypto industry.
How it all started
In 1976, Steve Wozniak and Steve Jobs decided to rebel against the establishment by starting Apple Computer. By the 1980s, the personal computer and the Internet were spreading like wildfire. And by the 1990s, they had become part of the mainstream culture around the world.
However, parts of the establishment still had lots of say on the web, especially when it came to e-commerce and finance. The reason being that only established brands could be trusted with payment processing and similar activities on the web.
To counter that, a group of crypto researchers and computer programmers developed a system that could let people transact safely on the web, without needing a third party from the establishment, such as banks.
That group began under the “Satoshi Nakamoto” pseudonym. And the base of their ingenious Bitcoin invention is the Blockchain.
Understanding Distributed Ledger Technologies
The problem with banks and other transaction 3rd parties is that they have full control of their databases. And as such, it is easy to manipulate the records without anyone’s knowledge.
Distributed ledger technologies solve this problem by having multiple computers run the same copies of the database. Each networked computer is called a node. And the more nodes you have on the network is the more trustworthy the database is.
In addition to such a decentralized data-banking approach, DLT or Distributed Ledger Technologies also use specific protocols, algorithms, and other conventions to create the complete package. Such as the Blockchain or Hashgraph.
Let us take a look at each.
The Blockchain
The Blockchain is a database system that groups data together in blocks and links those blocks using cryptography.
A block can contain any type of data, from financial transactions to images, videos, software, ebooks, and so on. After the block data is grouped, a timestamp and the hash of the preceding block are added to it. Then the contents are hashed to create a unique identifier that makes the record immutable.
The goal of this approach is that if you change anything in the block, the resulting hash will be different from that widely accepted hash of that block. Consequently, if you change anything in the preceding block, its resulting hash will be different as well, making the current block’s hash also different.
This immutability gives the technology the Blockchain name, as the blocks are cryptographically chained, so to say. Bitcoin uses the SHA-256 hash function to generate a random string that is 256 bits in length, irrespective of the input data length.
The Bitcoin Blockchain currently exceeds 200 GB in size, with the average block about 1 MB large. Given that each block contains simple financial transactions, 1 MB, therefore, is a lot of transactions to process.
In addition, the miners that process the transaction have to keep running the hash function over and over until it produces a unique SHA-256 hash with pre-defined specifications, such as the current 19 leading zeros. This requirement has created a situation where the Bitcoin network performs 150 exahashes (1018 hashes) per second.
To put that number in perspective, the global Bitcoin mining network uses up to 800 kWh of electricity per transaction. That comes to about 3 MWh per second (4 transactions/second), 190 MWh per minute, and so on, till you arrive at 50 – 100 TWh per year. That is enough energy to power the entire Cayman Islands for a full month.
The Hashgraph
To curb the electricity waste associated with blockchain maintenance, different groups have come up with different approaches. And this includes the Hashgraph.
You should note that there is the patented Hashgraph technology, which is owned by its inventor. And then, there is the Hedera Hashgraph, which is a permissioned, public network that runs a live implementation of the Hashgraph.
The Hashgraph system tries to create a fast and energy-efficient environment by using directed acrylic graphs and two protocols:
- Gossip about gossip
- Virtual voting
1. Gossip about Gossip
To start a transaction on the Hashgraph, you need to transmit the details of that transaction to a node on the network. This node will then re-transmit the details to a few random nodes, who in turn, re-transmit the transaction details to other random nodes.
These random nodes are called neighbors and each transaction detail is called an event. Each event contains information from the previous two events before it, and hence the name “gossip about gossip”.
The effect of transmitting information this way is that the gossip spreads as fast as wildfire, and within just a few seconds, a majority (66%) of the nodes should have a copy of that transaction, leading to a consensus.
The event must now be added to the distributed ledgers using its time stamp for chronological sorting.
2. Virtual Voting
The other impressive part of Hashgraph is the virtual voting protocol. Since each event carries information about two previous events before it, the nodes use this information to cast votes about which events occurred before them and should get priority handling.
The goal of virtual voting is to prevent a situation where a node fails to pass on information because it is malicious or Byzantine. And this failure to pass on the information can stop that transaction from reaching a 2/3 majority and eventual consensus.
To solve this problem, each event then votes on previous events that it can trace its ancestry to. And this helps in making sure that earlier transactions that failed to reach a majority because of faulty nodes, will still get timely processing.
This voting process spans different rounds or communication time-frames, making it asynchronous. So, this algorithm is said to be asynchronous Byzantine Fault Tolerant (aBFT).
Hashgraph vs Blockchain
While the Hashgraph and Blockchain systems try to securely and reliably manage data in distributed networks, they both go about it in different ways, leading to stark differences.
Here is a tabular look at those differences.
Hashgraph | Blockchain | |
---|---|---|
Launch Date: | 2017 | 2008 |
License: | Patented technology | Open source |
Consensus: | Virtual voting | Proof of work, stake, etc |
Speed: | 10,000+ TPS | 4-15 TPS |
Fairness: | 100% | N/A |
Security: | ABFT | Crypto hashing |
Energy Efficiency: | High | Low |
KWh per Transaction: | ~0.0002 | ~100 – 900 |
Transaction Fees: | $0.0001+ | $15+ |
Transaction Validation: | Consensus | By Miner |
Permissioning: | Permissioned | Permissionless |
Network Access: | Private/Public | Public |
1. Licensing
Bitcoin and its underlying Blockchain technology were released under the MIT License, making it a highly permissive free and open-source software. This freedom of use has helped in boosting the popularity of the Blockchain. As well as its different forks and competing approaches.
Hashgraph, on the other hand, is patented technology belonging to Swirlds, a company founded by its inventor, Leemon Baird. Swirlds then licensed the technology to the Hedera Foundation for a 10% stake in the Hedera network’s revenue.
2. Consensus
Hedera Hashgraph uses virtual voting as its consensus mechanism. All it needs is for 2/3 of the nodes to agree and that decision is final. Blockchains, on the other hand, use different protocols.
Bitcoin uses the Proof-of-Work protocol, a very energy-intensive and wasteful system. Ethereum uses the Proof-of-Stake protocol, which simply means that the miner stakes some of his cryptocurrencies before mining. And if he succeeds, he wins exactly the amount that he staked.
Other Blockchain consensus protocols include Proof-of-Space, which uses hard disk space as a staking mechanism. And Proof-of-Elapsed-time, which uses specialized hardware to assign each miner a minimum waiting time.
3. Speed
According to this press release from September 2020, the Hedera Hashgraph surpassed 1.5 million transactions per day, doubling that of Ethereum, and about 7x that of Bitcoin. By March 2021, Hedera had surpassed 200 million transactions per month, and in April, it crossed the 1-billion total transactions threshold.
It should be noted that the reason behind this success is the low and predictable transaction costs on Hedera hashgraph. This opposes the unreliable costs of blockchain systems, which tend to increase with more concurrent transactions.
4. Fairness
Blockchain miners choose which transactions to process and this gives a higher priority to those that offer higher fees for the miners. The result is longer confirmation times for some transactions, and increasing costs with higher network usage.
Hashgraph does away with this unfairness by time-stamping transactions and adding them to the ledger once there is a 66% consensus. And by using virtual voting as well, all events are guaranteed speedy processing.
5. Energy Consumption & Efficiency
Bitcoin uses hundreds of kWh per transaction, often reaching 800 kWh. Ethereum is more conservative, but it can still use up to 100 kWh per transaction. This is due to the hashing process that miners must undergo to find a specified string.
Hashgraph uses just 0.0002 kWh of electric power per transaction, an infinitely smaller quantity compared to blockchains. And this also makes it an environmental-friendly option for nature lovers.
6. Transaction Costs
Blockchain costs are variable and transactions with higher fees get priority treatment. Coupled with their limited speeds of 4 to 15 transactions per second, transaction costs are often above $15 today. Even reaching $25 and $30+ with high activity.
For the Hashgraph, all costs are kept equal and charged in USD fiat money. The prices vary, of course, depending on what you want to do. But you can always figure out how much a transaction is going to cost, starting from as low as $0.0001.
7. Network Access
Bitcoin has always been a public and permission-less network. This means that anyone with a computer can see the transactions and anyone with good enough hardware can download the client and join the network. No permission is required. Other Blockchain projects may have different but similar requirements.
Hedera Hashgraph is also public like Bitcoin, but it is permissioned. This means that you will need an invitation to get accepted into the network.
Conclusion
We have come to the end of this Hashgraph vs Blockchain post and you have seen their underlying technologies laid bare.
Blockchain has its strengths and weaknesses. But so does Hashgraph as well. It is your current needs, therefore, that will determine what is the better option for you.