Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ethersproject/hdnode

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethersproject/hdnode

BIP32 Hierarchal Deterministic Node operations.

  • 5.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
357K
decreased by-52.48%
Maintainers
1
Weekly downloads
 
Created

What is @ethersproject/hdnode?

@ethersproject/hdnode is a package from the ethers.js library that provides functionality for working with Hierarchical Deterministic (HD) wallets. It allows developers to generate and manage HD nodes, derive child keys, and perform various cryptographic operations related to HD wallets.

What are @ethersproject/hdnode's main functionalities?

Generate HD Node from Mnemonic

This feature allows you to generate an HD node from a mnemonic phrase. The code sample demonstrates how to create an HD node using a mnemonic and print its extended key.

const { HDNode } = require('@ethersproject/hdnode');
const mnemonic = 'test test test test test test test test test test test junk';
const hdNode = HDNode.fromMnemonic(mnemonic);
console.log(hdNode.extendedKey);

Derive Child Node

This feature allows you to derive a child node from a parent HD node using a specific derivation path. The code sample demonstrates how to derive a child node and print its address.

const { HDNode } = require('@ethersproject/hdnode');
const mnemonic = 'test test test test test test test test test test test junk';
const hdNode = HDNode.fromMnemonic(mnemonic);
const childNode = hdNode.derivePath("m/44'/60'/0'/0/0");
console.log(childNode.address);

Sign a Message

This feature allows you to sign a message using the private key of an HD node. The code sample demonstrates how to sign a message and print the signature.

const { HDNode } = require('@ethersproject/hdnode');
const mnemonic = 'test test test test test test test test test test test junk';
const hdNode = HDNode.fromMnemonic(mnemonic);
const message = 'Hello, world!';
const signature = hdNode.signMessage(message);
console.log(signature);

Other packages similar to @ethersproject/hdnode

Keywords

FAQs

Package last updated on 24 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc