hd-wallets

Derive Ethereum accounts from BIP-39 mnemonic seed phrases in C# and .NET.

2.3k|744|Updated Nov 23, 2015
One-click install
npx skills add https://github.com/Nethereum/Nethereum --skill hd-wallets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hd-wallets
Source: https://github.com/Nethereum/Nethereum/tree/main/plugins/nethereum-skills/skills/hd-wallets
Command: npx skills add https://github.com/Nethereum/Nethereum --skill hd-wallets

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Nethereum.HDWallet, Nethereum.Accounts, NBitcoin.

What problem does it solve?

Managing many Ethereum accounts from separate private keys is error-prone and hard to back up. This Skill shows how to generate and restore hierarchical deterministic (HD) wallets in .NET, deriving unlimited accounts from a single mnemonic seed phrase using standard BIP-32/BIP-39/BIP-44 derivation paths.

Core Features & Use Cases

  • Full HD Wallet (Nethereum.HDWallet): NBitcoin-based implementation supporting mnemonic generation, restoration, custom derivation paths (MetaMask, Ledger/Electrum), extended public keys for watch-only wallets, and key caching.
  • Light HD Wallet (MinimalHDWallet): Zero-dependency implementation built into Nethereum.Accounts using only System.Security.Cryptography, targeting net6.0+ for mobile, embedded, and WASM scenarios.
  • Use Case: A wallet application needs to generate a 12-word recovery phrase for a new user, then derive their first 10 Ethereum addresses and sign transactions with account index 0 on mainnet.

Quick Start

Use the hd-wallets skill to generate a new 12-word mnemonic and derive the first five Ethereum addresses in C#.

Frequently Asked Questions about hd-wallets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I derive Ethereum accounts from a mnemonic seed phrase in C#?

Install Nethereum.HDWallet and create a Wallet object from the mnemonic string, then call GetAccount(index, chainId) to get a signing account or GetAddresses(count) to list derived addresses. The default derivation path is m/44'/60'/0'/0/x, matching MetaMask.

How to generate a 12-word BIP-39 mnemonic in .NET?

Use new Wallet(Wordlist.English, WordCount.Twelve) from Nethereum.HDWallet and read wallet.Words, or call Bip39.GenerateMnemonic(12) from the MinimalHDWallet API included in Nethereum.Accounts with no extra dependencies.

Nethereum.HDWallet vs MinimalHDWallet: which should I use?

Nethereum.HDWallet uses NBitcoin, supports extended public keys and key caching, and targets net452+, suiting full wallet applications. MinimalHDWallet has zero dependencies, targets net6.0+, and fits embedded, mobile, and WASM scenarios.

Does Nethereum support Ledger and Electrum derivation paths?

Yes. Pass Wallet.ELECTRUM_LEDGER_PATH (m/44'/60'/0'/x) when constructing the Wallet to match Ledger and Electrum derivation, or supply any custom path string. The default path matches MetaMask, TREZOR, and MEW.

Can I create a watch-only Ethereum wallet from an xPub key?

Yes. Call GetMasterExtPubKey() on a full Wallet to export the extended public key, then construct a PublicWallet from that xPub and call GetAddresses(count) to derive addresses without any private keys.

What are the limitations of MinimalHDWallet?

MinimalHDWallet does not support extended public keys (xPub) or key caching, and it requires net6.0 or later. For watch-only wallets or older frameworks like .NET Framework 4.5.2, use the NBitcoin-based Nethereum.HDWallet package instead.