Hashgraph vs Blockchain – Hedera Hashgraph (HBAR) explained
Created by Leemon Baird, a hashgraph is a patented algorithm that provides the benefits of a distributed ledger system without compromising on scalability and speed. Described as a “blockchain on steroids.” the hashgraph is owned by the Swirlds Corporation, which was founded by Baird himself. This is how Swirlds describes itself on its website:
Swirlds is a software platform designed to build fully-distributed applications that harness the power of the cloud without servers. Now you can develop applications with fairness in decision making, speed, trust and reliability, at a fraction of the cost of traditional server-based platforms.
Ideally, the hashgraph should have the following properties:
Hashgraph isn’t exactly a closed ecosystem Developers can use its SDK Library to experiment and play around with the protocol. The SDK Library has the following:
The two features of Hashgraph’s algorithm
The Hashgraph algorithm has two special features:
Gossip about Gossip
If you are somewhat familiar with networking, then you must have heard about “gossip about gossip” or the gossip protocol. The gossip protocol works similarly to how gossip works in real-life, human interaction. Suppose we have four friends, Alice, Bob, Charlie, Dave.
So, we have these four friends hanging out with each other in the form of a hashgraph, which grows upwards over time.
Suppose, Bob decides to randomly gossip with Dave. This gossip is marked on the hashgraph by an entity called an event.
This event has the following data:
Now, consider this situation. Dave wants to interact with Bob all over again to talk about what they earlier talked about. In the process, a new event is created on Bob, which includes all the events that preceded before it – Bob’s first event, Dave’s first event, and the first gossip sessions between Bob and Dave.
This random gossip will go on and on until the hashgraph eventually looks something like this:
All four of these friends have gossiped with each other about everything. That’s pretty much how The nodes in hashgraph’s network relay information, such as transaction details, throughout the whole system.
Virtual voting will help determine if a transaction is valid or not. Every transaction needs to have at least 2/3rd of the nodes supporting it as a witness for it to be considered valid.
The voting process happens over multiple rounds. To show how it works, we will divide the hashgraph into four rounds.
Whenever a new event is created, we immediately know which round it belongs to. By dividing this up into rounds, we can make the calculations much faster.
After the rounds have been clearly demarcated, we will point out the first event created on each node’s timeline. In the diagram above, Bob, aka B, has the events – B1, B2, B3, and B4. These are the first event recorded by B in rounds 1, 2, 3, and 4, respectively, and are also called “witness.”
Determining the famous witness
For each witness, we will have to determine if it’s a “famous witness.” These famous witnesses are considered by the votes made by the witnesses in the next round. Trust us, that isn’t gibberish. Recheck the diagram given below:
Suppose we want to see if B2 is a famous witness or not. In this case, we will need to receive votes from the witnesses of the next round. In this situation, they are A3, B3, C3, and D3. So, how does the voting process works? Let’s take a look.
Part 1: The Voting
Witnesses in the third round will check if they are directly derived or descended from B2 or not.
As you can see above, A3 can directly link up with B2 making it a direct descendant. A3 will hence give its approval to qualify B2 as a famous witness.
B2 can also be directly linked to B3, C3, and D3 as well. So, all the four witnesses have given their vote and approval for B2 being a famous witness. Now that the votes have been cast, they need to be counted. The vote-counting process is done by the witnesses present in the round next to the round containing the voting witnesses i.e., A4 and B4.
Part 2: The Vote Counting
These witnesses will send over their votes to A4 and B4 and check if they can “strongly see” these witnesses. The condition of strongly seeing is as follows:
In the case above, B4 can strongly see the witnesses mentioned in the third round. Following this, B2 is declared a famous witness.
The code behind Hashgraph
LISP and Java languages were used to create the core of hashgraph.
Speaking of the applications running on top of it, Hedera hashgraph is compatible with solidity. Hence solidity-based dApps can easily be ported to hashgraph.
Blockchain vs Hashgraph
There are two big advantages that hashgraphs have over blockchains:
Hashgraph currently operates on a permissioned, private-based network. A blockchain network falls under the two categories:
Cryptocurrencies like Bitcoin and Ethereum are hosted on a public network since they are open ecosystems. It has a built-in incentive mechanism that rewards participants for working in the interest of the system. As you may already know, Bitcoin and Ethereum use the proof-of-work consensus mechanism to mine blocks. This process requires a lot of computational resources and, in return, they get rewarded with a “block reward” for successfully mining a block. This mining process itself is very inefficient and slow.
Plus, anyone can join a public network, which in itself is another detriment. Enterprises deal with a lot of sensitive data, which is why they will not want to join a public network.
As the name suggests, private networks aren’t open to everyone. As a result, people who want to participate in a private network must gain permission beforehand. This is the reason why private networks are also called “permissioned networks.”
Because of this, there are restrictions on the kind of people who can actually take part in the consensus. Access for new participants could be given by the following:
These private networks have been specifically designed for enterprise needs and offer a lot of features like:
This also explains the lower cost in contrast to public networks. Performance is much better, making it possible to conduct more than 1,000 transactions per second. This type of network is suitable for financial institutions and large companies because they can build large systems and reduce costs while improving efficiency.
Hedera hashgraph has a private, permissioned network.
Greater Degree of Fairness
Transactions in blockchain-based cryptocurrencies are not really fair. A transaction goes through only after a miner picks it up from the mempool and puts it inside the blocks that they are mining. Miners will always choose transactions that favor them financially.
Each transaction has a certain amount of transaction fee attached to them. However, many times, most users will pay extra transaction fees to get a special preference for their transactions.
Hasghgraph mitigates this via consensus time-stamping. Simply put, the moment a transaction receives validation from 2/3rd of the network, it will reach consensus. It is simple first-come-first-serve and keeps the network as fair as possible.
Hedera has gained a lot of traction and has around 100 dApps committed to building on top of its platform. More than 5000 developers are actively interacting in the Discord Channel to discuss the platform and the implications of the applications being built on top of it. So, let’s look at the five more promising Hedera dApps.
Sagewise is creating an SDK that will allow smart contracts to be stopped in the event of a dispute. A smart contract creator can include Sagewise’s SDK in the smart contracts. The moment something goes wrong, the contracting parties can trigger dispute resolution mode to pause the contract until it’s resolved. Sagewise’s Solidity Virtual Machine, SDK can be easily integrated with Hedera Hashgraph. Hashgraph’s scalability and its support for solidity smart contracts make it an ideal platform for Sagewise.
Hearo.fm is a global marketplace based on the Hedera hashgraph, which allows music artists to sell and showcase their music directly to fans. As per Andrew Antar, founder of Hearo.fm, Hedera Hashgraph is the best and only technology that enables the use of micropayments for streaming music.
There are plenty of reasons why hearo.fm is using the hashgraph:
Alto.io is a decentralized gaming platform that allows users to mint, sell and use crypto items on Hedera Hashgraph. The games running on this platform can create and use non-fungible and ownable items to generate revenue. The items generated are interoperable as they can be sold and used across various games and users. The platform has two primary users – players and item creators.
Here is why Alto.io plans on using the hashgraph:
Carbon is a stablecoin that aims to create an inclusive and efficient global economy that closely relates to USD. After investigating several smart contract platforms, Carbon selected the Hedera Hashgraph since its high speed and security can provide a reliable base for operations.
A decentralized task marketplace for freelancers, Cryptotask solves the problem of centralized marketplaces like restrictions on high-value tasks, slow dispute resolution, and high fees. Cryptotask users can be rewarded for tasks such as “review writing.” Users can also share job posts. Freelancers can apply for those jobs and reviewers can be selected to be part of a review panel proportional to their stake. Presently, Cryptotask is running on the Ethereum mainnet, but they have since migrated to Hedera Hashgraph. They feel that the lower transaction fees and higher speed and security will help them in achieving their goals.
Not only has the Hedera hashgraph provided a very viable alternative to the blockchain, but several developers have already created some promising applications on top of its platform. Its compatibility with solidity can help attract Ethereum’s considerable developer community who might be looking for a faster and more secure platform. The native token HBAR is listed on several popular exchanges like Bittrex and OKEx.