Hd wallets

From Nethereum/Nethereum · View interactive version

Hd wallets is an AI agent skill from the GitHub repository Nethereum/Nethereum. Derive multiple Ethereum accounts from a mnemonic seed phrase using Nethereum HD wallets. Use this skill whenever the user asks about mnemonic phrases, seed phrases, BIP-39, BIP-32, BIP-44, HD wallets, deriving accounts from a seed, wallet recovery, 12-word or 24-word phrases, derivation paths, or g

How to use this skill

Skill file

HD Wallets with Nethereum

Two implementations available:

Full HD Wallet (NBitcoin-based)

NuGet: Nethereum.HDWallet

dotnet add package Nethereum.HDWallet

Generate New Wallet

using Nethereum.HdWallet;
using NBitcoin;

var wallet = new Wallet(Wordlist.English, WordCount.Twelve);
var mnemonic = string.Join(" ", wallet.Words);

Restore from Mnemonic

var wallet = new Wallet("rapid squeeze excess salute ...", seedPassword: null);
var account = wallet.GetAccount(0, chainId: 1);
var web3 = new Web3(account, "https://your-rpc-url");

Derivation Paths

// Default: m/44'/60'/0'/0/x (MetaMask, TREZOR, MEW)
var wallet = new Wallet(words, null, Wallet.DEFAULT_PATH);

// Ledger/Electrum: m/44'/60'/0'/x
var wallet = new Wallet(words, null, Wallet.ELECTRUM_LEDGER_PATH);

Key Methods

var addresses = wallet.GetAddresses(10);     // First 10 addresses
var privateKey = wallet.GetPrivateKey(0);     // Private key bytes
var ethKey = wallet.GetEthereumKey(0);        // EthECKey for signing
var account = wallet.GetAccount(0, chainId: 1); // Account for Web3

Watch-Only (Public Wallet)

var xPub = wallet.GetMasterExtPubKey();
var publicWallet = new PublicWallet(xPub);
var addresses = publicWallet.GetAddresses(10);

Light HD Wallet (Zero Dependencies)

Included in Nethereum.Accounts — no extra package needed. Uses only System.Security.Cryptography. Modern .NET only (net6.0+).

using Nethereum.Accounts.Bip32;

// Generate mnemonic
var mnemonic = Bip39.GenerateMnemonic(12);

// Create wallet
var wallet = new MinimalHDWallet(mnemonic);

// Derive keys (m/44'/60'/0'/0/{index})
var key = wallet.GetEthereumKey(0);
var address = wallet.GetEthereumAddress(0);

// Custom path
var key = wallet.GetKeyFromPath("m/44'/60'/0'/0/5");

When to Use Which

| Feature | Nethereum.HDWallet | MinimalHDWallet |

|---|---|---|

| Dependencies | NBitcoin | None |

| Frameworks | net452+ | net6.0+ |

| Extended keys (xPub) | Yes | No |

| Key caching | Yes | No |

| Best for | Full wallet apps | Embedded, mobile, WASM |

For full documentation, see: https://docs.nethereum.com/docs/signing-and-key-management/guide-hd-wallets

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.