Unorthodox problems often require unorthodox solutions, and nowhere is this more prevalent than in the still nascent world of blockchain tech. The ShapeShift team faced the issue of interfacing with wallets from a variety of vendors, as a solution we built and open-sourced it to the community.
Take a moment to read about the problem we faced that prompted this design, and how our HDWallet solution works. We hope you enjoy.
Find our developer resource page here: pages.shapeshift.com/developer-portal
The Problem
Applications that want to interface with multiple wallets need to build an integration to each wallet. This means for every call you want to make, such as getting an address or signing a transaction, you have to write new code for each wallet.
We ran into this problem while building the new ShapeShift Platform, our interface for buying, trading, tracking, and hodling crypto assets across multiple hardware wallets.
The Solution
To solve this problem, we built the HDWallet abstraction layer. We believe in following DRY (don’t repeat yourself) coding practices and simple design.
With HDWallet, your code can make one call to the HDWallet interface, and depending on the wallet you are connected to, HDWallet will translate that call to the specifications that each wallet type requires.
>>> Check out our Open-Source HD Wallet Library on GitHub <<<
How It Works
HDWallet has a separate module for each wallet it integrates with. You can see them in the code in the /packages directory. Each of those modules contains necessary submodules that allow communication with the wallet to occur. There is also a HDWallet-core module that contains functions you will need no matter what wallet you are connecting to.
How to Get Started
If you’re interested in learning more about HDWallet, take a look at our developer exercises here. We give hands-on examples for navigating the enhanced capabilities that this interface provides.
Access all of our developer resources for ShapeShift’s Open-Source HDWallet Library, ShapeShift Exchange API, and CoinCap API on our website.
At ShapeShift, we’re providing next-level tools for crypto management and we want to make it easy for you to try out our new hardware secured platform. We are offering ShapeShift members a $10 KeepKey, the premier hardware wallet of the ShapeShift Platform.