What Is Hashgraph? A Beginner’s Guide

Hashgraph
Getting your Trinity Audio player ready...

What Is Hashgraph? A Beginner’s Guide

Hashgraph

Introduction

Blockchains are transforming the process we solve problems. Companies are already learning about the importance of DLTs (Decentralized Ledger Technologies) and are integrating them into their workspaces. So, do these blockchains solve all their problems? Not really, and that is why in this article we are going to discuss Blockchain’s alternatives like Hashgraph technology and explore Hashgraph’s public implementation, Hedera Hashgraph.

What Is Blockchain Technology

Prior to getting deep into the concept of Hashgraph, let us briefly talk about blockchain technology and how it works.

Blockchain technology is a distributed ledger technology (DLT), which means that it enables peer-to-peer transactions without any authority managing the network. Furthermore, trust is achieved by using consensus algorithms and replications of databases.

We need to understand that the important part here is how data is saved or stored, in blocks. They are usually linked together in a chain and they can never be altered or tempered in any way. That’s why blockchain technology is ideal for asset management, storing records, voting, etc.

The Drawback of Blockchain

Blockchain technology has seen tremendous evolution in the last decade or so. With bitcoin, it all began, which introduced the idea of a  DLT (decentralized ledger technology). This made blockchain fascinating but still limited in its capabilities.

One of the serious problems with present-day blockchain-based solutions is their slow transaction speeds, both in terms of throughput/ total transactions per second (TPS) as well as time taken in each individual transaction propagation in the network. Ethereum, a newer blockchain technology, is much faster than bitcoin but still not impressive compared to traditional payment methods like credit cards or online banking transfers.

What Is a Hashgraph?

Hashgraph is a DLT created by Leemon Baird, the CTO, and co-founder of Swirlds. If you’re new to DLTs, Hashgraph may seem like a confusing term. But if you already know about blockchains and how they work, you might notice some similarities between them and Hashgraph.

Hashgraph is a new data structure that provides decentralization and security with speed. Due to its private nature, it does not suffer from speed/ TPS (Transaction Per Second) issues.

Unlike blockchain technology, it can process thousands of transactions in a second, hence, there are various use cases of Hashgraph that include cryptocurrency.

One of the Hashgraph applications is called Hedera Hashgraph and it is a public version. We will know more about Hedera in the second half of this article.

Hashgraph whitepaper was published in May 2016, which mentions that Hashgraph was intended to be a consensus mechanism or algorithm and not an entire DLT.

Based on its description in the whitepaper, we can say that it is a kind of data structure, or low-level component and not a full-fledged system in itself. Nonetheless, later in this article, we are going to discuss Hedera Hashgraph, and we will witness that it appears to be an absolute solution.

Technology Overview of Hashgraph

Hashgraph is a type of distributed ledger technology (DLT) but it does not operate based on the concept of “blocks” and “chains”, so it is not a blockchain. In Hashgraph, each transaction has its own block, and it is linked to other transactions through two algorithms: Gossip about Gossip, and Virtual Voting. This type of linking is more efficient than the one in the blockchain.

The Hashgraph algorithm, Gossip about Gossip (Gost), is a form of distributed consensus. It is used to verify transactions and assign them to peers that can verify them.

The Virtual Voting (Vot) algorithm is also used to verify transactions. It’s responsible for electing a leader among the peers that can verify transactions; this helps eliminate the need for waiting for all of them to come together in order to confirm a transaction.

Gossip About Gossip

When it comes to Hashgraph Technology, there is one key factor, communication. Any node in the network requires to be able to communicate with other nodes. This premise is what allows for consensus within the platform. Let’s take an example of five nodes into consideration—Alpha, Beta, Gamma, Charlie, and Bravo.  Each node initiates a transaction that triggers an “event” in the network.

When the event occurs, every node calls two other nodes and shares the details of the transaction. Please note that these two nodes are chosen at random, with no predetermined order of who will call whom first. For instance, A calls B and C, whereas the D node calls E and C. After the event, all the nodes have called each other in a chain of events, creating a kind of network where each node is having the hash of the previous block, thus creating a system that looks like a tree with its leaves connected together.

A different example: If I were a node named Carol, under Hashgraph technology I might randomly choose two of my neighbors, David and Earl. Then I would send messages to these neighbors, who would then send messages to their neighbors, and so on until all the nodes in the network were informed about each other.

Virtual Voting

Virtual Voting functions differently than gossiping. This voting is employed to reach a consensus for determining the order of transactions. The voting only begins after a “certain number” of transactions have been processed by the nodes. For example, let’s say that 20 events occurred before the voting started.

When virtual voting begins, each node looks for a specific event that matches the network as a “famous witness.” The selected events hold information about the old events that are recorded by the participating nodes. If a new event fits with an old one, then it is voted “Yes,” otherwise it is voted “No.” In this manner, one event gets more votes and becomes known as the “famous” witness for that round. The event then provides ordering information for transactions.

Whitepaper of Hashgraph

In the white paper, you can notice that the Hashgraph team defines their technology as a data structure or consensus algorithm. They do not call it a full-grown system. It is basically a low-level component or building block that offers better security, speed, and fairness over older systems like Blockchain.

Hashgraph is taking the world of blockchain by storm. It offers a new way to solve complex problems, but it remains proprietary, and maybe it will never become an open source. However, it has already begun to gain traction and one of its latest partnerships is with a company named CULedger.

This company is a credit union service organization, and it will use Hyperledger technology to build a distributed transaction processing solution for credit unions. This shows how the better speed of Hyperledger is aiding in improving financial systems.

However, it is not a completely closed system. The Hashgraph team provides an SDK library for developers to create applications with their consensus algorithm.

Programming language of Hashgraph

The core code of Hashgraph is developed in LISP and Java programming languages. Besides this Hashgraph also offers an SDK (Software Development Kit) for developers who want to use other JVM languages like Scala or Java.

The open-source community has been working on improving the Hashgraph platform and has its own implementations of it in other programming languages. You can look into those implementations here:

JavaScript

Python

Go

How Does Hashgraph Consensus Work?

It is a special type of algorithm that deals with the problem of consensus in a novel way. It uses Byzantine fault tolerance(BFT) for replicating state machines. BFT is also considered an “atomic broadcast” algorithm because first it creates a link between the unordered transactions and then orders them accordingly. This process is continuing, and the nodes can submit their transactions.

Once this process is done, then each node receives an ordered transaction output, containing all submitted transactions. In this manner, all the nodes are connected and have copies of the “total order”, considering that each node has been ordered relative to other nodes on the chain. This makes it optimal for implementing different cryptocurrency projects, systems, and solutions.

The Role of Clients in Hashgraph

In a network, each node needs to do a lot of things. Each node runs the Hashgraph algorithm and stores the whole Hashgraph data structure. When you download a full copy of the Hashgraph from any node, it will be able to verify transactions on its own. Nodes also download data from other nodes in order to see if any new transaction is committed or not.

It is the same as a totally decentralized blockchain where each node has its own copy of the ledger. But there is one big difference: In Hashgraph, nodes only need to download 128 bytes (everything else is stored inside their own memory) while in Bitcoin they have to download block headers and proof for every single transaction validation.

A Deeper Dive Into Hashgraph Algorithm

Hashgraph presents a solution to the problem of consensus. The base algorithm makes it possible, and we will now go through this algorithm to learn and comprehend how it functions.

Consider a network with X number of nodes. If the consensus has to be successful, then it should ensure that it functions even when there are bad or malicious actors/nodes in the network. For example, some nodes may function together to support a false transaction or delay packets deliberately, hence the consensus algorithm should have adequate inbuilt protection to thwart any such activities.

The Byzantine setup protects against malicious attacks or collaboration between nodes that would otherwise cause failure in reaching consensus.

Before we move forward, let’s talk about some terms that are related to the algorithm.

Directed Acyclic Graph(DAG)

It is a data structure used in Hashgraph, where each node (or vertex) is connected to other nodes in a directed way and there are no cycles.

Events

An event is a set of transactions, represented by vertices in the Hashgraph. Each transaction has information including its parents, a signature created at the node where it originated, and a timestamp.

Timestamp

The event timestamp is the date and time at which the event occurred. It also determines where in the sequence of events a node will appear.

Collision Resistant Hash Function

It is utilized to make sure that other nodes cannot alter an event’s information during gossiping. This guarantees that the event is encoded without any error.

When an event occurs, it is broadcast to other nodes. These nodes can find out about old events by verifying them with the consensus algorithm. This process relies on localized analysis and making good utilization of gossip events.

Hashgraph Whitepaper

Hashgraph Image Source: Hashgraph whitepaper

Look at the image above which shows five clients or nodes: Alice, Bob, Carol, Dave, and Ed. These clients regularly connect (gossip) with others, which produces events. When a client hears gossip about someone new, the gossip is added to the graph and signed with a valid signature plus a hash value. The graph exclusively includes or appends events that were not previously recorded, to ensure that no duplicate information is added.

When the synchronization completes, any node receiving the event obtains any transactions from the dispatcher node and signs off on it for creating a new event. This process makes sure that each new event delivered to a receiving node has at least one new piece of information for the receiving node. Furthermore, this information should be unique information about the graph.

In this manner, the Hashgraph is able to grow consistently by using the collision-resistant property. A node that adds an event agrees with the past information and makes Hashgraph important.

Key Properties of Hashgraph

During the whole process, a couple of key properties determine whether Hashgraph is possible or not. The first property is the round number, which increases in order. The second key property is a binary value that determines if a client has witnessed an event or not. This value holds true for only one round; it changes for each round.

As soon as an event occurs, the Hashgraph generates binary values. However, it is not as straightforward as it may appear. For instance, the binary value can be any of three states: “definitely yes“, “definitely no“, and “undecided”. These states are there because it takes a while to decide if the client has witnessed the event or not. In case of indecision, the value is set to “undecided.”

Key Features of Hashgraph

Three salient features indicate that Hashgraph is an outstanding choice for a variety of decentralized projects. Hashgraph whitepaper mentions these three features (1) Secure, (2) Fair, (3) Fast.

Let us deep dive to know more about these features in the following sections.

Secure

The hashgraph consensus mechanism offers a secure method to process transactions and make sure that an event is covered accurately. The order of events is very important in Hashgraph, and the network makes sure that no bad actor can tamper with either the transaction data or the order in which they are connected to each other. In this manner, it safeguards the network from a double spending problem and a 51% attack.

Because Hashgraph uses (1) aBFT (Asynchronous Byzantine Fault Tolerant) algorithm, (2) temper-resistant hash functions, and (3) digital signatures, therefore, a transaction cannot be modified or reversed once it has been committed.

Fair

Fairness, as defined by the Hashgraph team, is ensuring that a bad actor cannot find out which two transactions are going to be included in the consensus order. Still, it is unclear how this thing can render fairness or impartiality to the Hashgraph network if most of the nodes do not know about a transaction. The Hashgraph team has also confirmed that the fairness feature works accurately provided the majority of nodes are aware of the transactions.

This may create a serious problem if a bad actor manages to control 2/3rd of the nodes. This person could simply re-order events without affecting fairness in any way.

Nonetheless, in addition, there is no requirement for mining on the Hashgraph platform which eliminates the possibility of a few rich minors having undue control of the network with their higher-specification mining rigs.

Fast

Gossip methods are regarded as comparatively fast, and the gossip protocol of Hashgraph is no exception. The events spread quickly through the network, due to its nature as “gossip-about-gossip. “ This also implies that less information is needed to be relayed over time. The Hashgraph also uses virtual voting, which renders it more efficient.

However, if we consider that each node requires the entire Hashgraph to perform its operations, then the size of the incoming data should grow over time. We do not know yet whether Hashgraph will have a positive effect on the performance of our network. In theory, its TPS could reach 5,00,000.

What Is Hedera Hashgraph?

Hedera Hashgraph

In the first half of this article, we have seen how Hashgraph works, its technical functioning, and the ways it promises to be secure, fair, and fast. But we have also learned that it is a proprietary technology, and this is the roadblock for Hashgraph. This private nature discourages the public adoption of Hashgraph.

Meet and greet Hedera Hashgraph! It is a public network that exploits the Hashgraph consensus algorithm. Hedera takes full advantage of the aBFT. It provides a guarantee that Byzantine faults can be tolerated in replicated state machines.

Hedera Hashgraph is based on Byzantine Fault Tolerant consensus, which was created to ensure businesses can create value for their customers by using Hedera Hashgraph technology. The company also has a council, known as Hedera Hashgraph Council, that manages the Hedera network. The goal is to make Hashgraph’s capabilities available to the public and encourage widespread use of a secure and fast distributed ledger system.

At their cores, both Hashgraph and the Hedera Hashgraph use a variation on the “gossip about gossip” protocol that utilizes aBFT for reaching consensus. They both also use virtual voting, that implies it arrives at a consensus without needing a central authority. Thus, we can confidently say that Hedera Hashgraph provides a totally decentralized and trustless environment for its applications or use cases.

Hedera Hashgraph uses the aBFT model to ensure fairness in every condition, including when bad actors are present in the network. Hedera Hashgraph utilizes all the properties of Hashgraph under the hood. However, the Hedera Hashgraph consensus mechanism does not employ a leader format, making it resilient to distributed denial-of-service attacks aimed at individual nodes or small subsets of nodes.

Hedera Hashgraph is a public distributed ledger that lets you build on trust. You can use it to create file services, cryptocurrencies, and smart contracts.

Services Offered by Hedera Platform

Users of the platform can use the network to make cryptocurrency payments and take advantage of lower costs and simplified design.

You can also build smart contracts on the Hedera platform. To develop smart contracts, you need to use Solidity. As a developer, you can do atomic swaps (exchange one digital asset for another without using an intermediate currency), create assets (such as collectibles or tokens), and deploy completely new applications (such as games or social networks).

You can use Hedera’s file services, which are compliant with GDPR regulations.

Governance

Hedera Hashgraph governance is a hybrid system that includes both centralized and decentralized elements.

The Governing Board is responsible for maintaining the stability and growth of the network. But since it maintains centralized control over Hedera Hashgraph, is a significant drawback for a system that aims to offer distributed ledger services. Users are not thrilled with this aspect of the platform, and it remains one of the most common criticisms of Hedera Hashgraph.

The Open Consensus is a consensus algorithm that manages how new nodes join the network and participate in its maintenance. Unlike Governing Board, Open Consensus makes the Hedera network more decentralized. It works by utilizing Proof-of-Stake, which ensures that there is an appropriate weighted voting model and collision is sufficiently mitigated.

Nodes can join the network if they have a certain amount of Hedera tokens (HDT) and the participants receive an appropriate incentive to run those nodes.

The Architecture of Hedera Hashgraph

The Hedera Hashgraph platform architecture can be divided into three layers: the Internet Layer at the bottom,  Hashgraph Consensus Layer in the middle, and the Services Layer at the top.

Internet Layer

This bottom layer ensures that computers on the Internet can communicate with each other. It uses the Transmission Control Protocol and Internet Protocol to establish connections between computers, as well as Transport Layer Security encryption to secure those communications.

Hashgraph Consensus Layer

This middle layer consists of nodes that participate in the network using a consensus method known as Hashgraph and a gossip protocol.

Services Layer

This topmost layer has three subgroups: Cryptocurrency, File Storage, and Hashgraph Smart Contracts.

The nodes receive a native cryptocurrency (HBAR) for taking part in the network. This is to make sure that the users get their rewards for their participation.

For file storage, Hedera uses Merkle Trees. As a developer, you can use Solidity if you want to build apps on top of Hedera’s decentralized storage system.

Last but not least, it supports smart contracts on top of the network thus providing you with the ability to develop scalable DApps.

The DApps of Hedera Hashgraph

Hedera Hashgraph has inspired several companies to create decentralized applications (dApps). Examples include Carbon, Sagewise, , Cryptotask, Hearo.fm, and Arbit.

The Tools of Hedera Hashgraph

There are several amazing Hashgraph tools available on the internet. The following list includes a few notable ones of them.

  1. Hedera Java SDK : Hedera LLC maintains it.
  2. Hedera Rust SDK : Open-source community maintains it.
  3. Hedera Go SDK : Open-source community maintains it.
  4. Hedera Test – Hedera Testnet Account.
  5. Hedera Java Keygen tool: A command line utility for managing ED25519 key pairs in Hedera  Hashgraph.

Social Media Communities of Hedera Hashgraph

You can join one or more of the Hedera communities to learn more about Hashgraph and participate in the project. You can access the Hedera Developer Chat here.

Conclusion

In conclusion, even though it has some drawbacks, as it uses a centralized governance model, Hashgraph is a promising technology that has great potential in the future. It is faster than conventional DLTs, including blockchain. It’s fair to everyone who uses it and there is no mining involved.

The Hedera Hashgraph network fully exploits the Hashgraph technology and is more decentralized than other Hashgraph implementations.

The technology behind Hashgraph is complex and difficult to understand at first. However, once you learn how it works, you’ll see that it’s one of the most promising technologies currently in development.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *