Easily Support Custom Derivation Paths for Ledger and Trezor Wallets

Blocknative Ethereum Web3

ℹ️ Web3Onboard has joined the thirdweb family, please contact them for any support questions.

While you can hold every private key in the palm on your hand, there are a staggering number of possible wallet addresses that can be generated from a seed phrase. And  advanced users may take advantage of these possibilities by using custom derivation paths on their hardware wallets to select new addresses. 

The ability to choose a custom derivation path is popular among developers (who need to access test nets) and whales (who have many accounts that they use to secure funds). And support for hardware wallets and custom derivation paths is a commonly requested feature for leading applications.

Having a native hardware wallet integration was the most requested feature for the 
Gnosis Safe multisig. Thanks to Blocknative, we were able to deliver an easy and trusted way to use a Ledger or Trezor device with a multisig using Onboard.js.

Lukas Schor, Product Manager For Gnosis Safe

The latest release of Onboard.js enhances our hardware support module, adding the ability to choose from common derivation paths or enter a custom derivation path. Read on to learn about what custom derivation paths are and why supporting them matters. 

What are Hierarchical Deterministic Wallet?

Hierarchical Deterministic (HD) wallets have the ability to derive many different addresses from a single seed phrase (based on BIP 32). This lets a user generate new key pairs and addresses without having to back up a private key. 

A view of Hierarchical Deterministic KeysA Diagram Of HD Keys From Web Of Trust

With a HD wallet, you only need to back up the seed phrase. And with that phrase, you can generate many different wallet addresses. 

What are Derivation Paths?

The derivation path refers to all of the possible key pairs that can be generated from the seed phrase. In the diagram above, you can see that there are many branches in which an address can be generated. 

Let's look at a typical derivation path: m/44'/1'/0'/0'/0. Each one of those numbers impacts the public/private key and address. To dig deeper into the technical aspects, read this post.

When connecting to a hardware wallet, users are given the choice of which derivation path to use. Usually, people will connect with the default path, since each branch leads to a different set of addresses. However, advanced users may use a different path. And the latest release of Onboard.js improves upon our hardware wallet support to add a new module that allows users to select a derivation path from a list of common paths or input their own custom path to access accounts on their hardware wallets:

Onboard.js Supports Custom Derivation Paths

With just a few lines of code, you can easily add support for custom derivation paths for Ledger and Trezor.

Easily Support Hardware Wallets and Custom Derivation Paths

To help developers can quickly support hardware wallets, we've filmed a quick start video for Onboard.js:

 

Once installed, users will be able to select either Ledger, Trezor, or Lattice as a wallet. When a user selects that, Onboard.js will display a web3 wallet check module that directs users to: 

  • plug in their hardware wallet
  • unlock it via the pin code
  • have the Ethereum app open on their device (Ledger)
  • select a standard or custom derivation path
  • wait while Onboard.js loads their accounts 
  • select their account

That's it. With just a few lines of code, you can add web3's most powerful connect wallet button to your DeFi or NFT Dapp and easily support hardware wallets in your project.

When you're ready, Blocknative can also help you improve UX with web3's most accurate ETH gas API or our Ethereum Simulation Platform. Contact our team today for a personalized demo!

Gas Extension

Blocknative's proven & powerful Gas API is available in a browser extension to help you quickly and accurately price transactions on 20+ chains.

Download the Extension

Want to keep reading?

Good choice! We have more articles.

tl;dr-on-gas-network-⛽
Gas

TL;DR on Gas Network ⛽

Gas Network is a decentralized oracle network that brings gas prices onchain—securely,..

exploring-the-gas-network-community-dashboard
Gas

Exploring the Gas Network Community Dashboard

The Gas Network Community Dashboard A Cross Chain Fee Analysis Tool The blockchain ecosystem has..

optimizing-uniswap-v4-swap-fees-with-gas-network
Gas

Optimizing Uniswap V4 Swap Fees With Gas Network

Optimizing Uniswap V4 Swap Fees With Gas Network This was originally published on the Gas Network..

Connect with us. Build with us.

We love to connect with teams who are building with Blocknative. Tell us about your team and what you would like to learn.

"After first building our own infrastructure, we appreciate that mempool management is a difficult, expensive problem to solve at scale. That's why we partner with Blocknative to power the transaction notifications in our next-generation wallet."

Schedule a demo