HashConnect Part 1 - Secure Signing for dApps Built on Hedera
Apr 04, 2022
by HashPack Team

What is HashConnect?

HashConnect is an open source library that is developed by the HashPack team. This library enables decentralized applications (dApps) to connect to a user’s wallet and send transactions for them to sign and submit to the Hedera network nodes.

HashConnect solves the question of how to enable a user to sign transactions without exposing their private key. An application never has access to the user’s private keys, giving the user peace of mind that their account keys won’t be exposed when they connect to dApps in the Hedera ecosystem.

HashConnect is currently under active development and is available in open beta. There are numerous projects which have already integrated HashConnect into their workflow, providing users with a great user experience. Integrators include Staderlabs, Saucer Swap, Zuse Marketplace, Turtle Moon Tools, with many more on the way.

The library currently supports most of the critical functionality in the Hedera Token Service (HTS), Hedera Consensus Service (HCS) and Hedera Smart Contract Services. If there is functionality that your project needs, please contact our team on the HashPack discord.

To get started, check out the NPM package which includes a documentation and a demo that demonstrates pairing and signing functionality.

HashConnect Basic Concepts

The main functionality of HashConnect is to send Hedera transactions to a wallet to be signed and executed by a user. It uses message relay nodes to communicate between apps, meaning that HashConnect transactions are not recorded on the ledger. This means dApps can interact with wallets without paying gas/fees, and only submit fully signed transactions to the network once ready.

To establish a connection, an application publishes a topic ID on the message relay node, which the user’s wallet can pair with via pair code or QR code. If the user is using the chrome extension then the application can also directly pair with the extension.

Once the topic ID is subscribed, the application and wallet can communicate via end-to-end encrypted messages. From the pairing process the application knows the account ID of the user. When the application requires the user to sign a transaction, it builds the transaction then sends it via HashConnect to the wallet for signing.

More detailed explanation of these concepts can be found in the documentation.

HashConnect development history and roadmap

The HashPack team has been working on HashConnect since October 2021. We saw the need for a signing solution similar to WalletConnect that was available on other chains such as Ethereum and Solana and used by popular wallets like Metamask.

We explored the possibility of using WalletConnect with Hedera’s platform, however we ran into technical barriers due to the differences between the base communication protocols used in other blockchains and Hedera. While there were steps that could be taken to bridge that gap, we eventually decided on building our own native solution.

In December 2021 we started closed beta testing with a few select projects. In January 2022 we released HTS support, followed by Smart Contract and HCS support in February 2022.

The latest HashPack feature is authentication, which allows a user to authenticate their ownership of their account ID with the application.

Coming up, HashConnect will support the Signature/Wallet Provider HIP-338. Currently only the application side of the library is open sourced, meaning only HashPack supports HashConnect. We plan to develop and release the wallet side as well to support the ecosystem once the application side has been fully developed.

Up Next

This is the first article of a series of planned articles that will go over integrating HashConnect into an application. Part two will go over pairing, part three will send our first transaction to HashPack wallet for signing, and part four will cover smart contracts as well.

Stay tuned!

May Chan
HashPack Co-Founder