
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@ethersproject/hdnode
Advanced tools
@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.
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);
The bip32 package provides similar functionality for working with HD wallets, including generating HD nodes and deriving child keys. It is a lower-level library compared to @ethersproject/hdnode and is often used in conjunction with other libraries for full wallet functionality.
The hdkey package is another library for working with HD wallets. It offers similar features such as generating HD nodes and deriving child keys. It is a lightweight and straightforward library, making it a good choice for projects that require basic HD wallet functionality.
The bitcoinjs-lib package is a comprehensive library for Bitcoin-related operations, including HD wallet functionality. It provides a wide range of features beyond HD wallets, such as transaction creation and signing. It is more feature-rich compared to @ethersproject/hdnode but is specific to Bitcoin.
This sub-module is part of the ethers project.
It is responsible computing, deriving, encoding and decoding Hierarchal-Deterministic private keys.
For more information, see the documentation.
Most users will prefer to use the umbrella package, but for those with more specific needs, individual components can be imported.
const {
HDNode,
defaultPath,
mnemonicToSeed,
mnemonicToEntropy,
entropyToMnemonic,
isValidMnemonic,
// Types
Mnemonic
} = require("@ethersproject/hdnode");
MIT License
FAQs
BIP32 Hierarchal Deterministic Node operations.
The npm package @ethersproject/hdnode receives a total of 777,281 weekly downloads. As such, @ethersproject/hdnode popularity was classified as popular.
We found that @ethersproject/hdnode demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.