{"id":610,"date":"2026-10-02T09:30:47","date_gmt":"2026-10-02T09:30:47","guid":{"rendered":"https:\/\/nownodes.io\/blog\/?p=610"},"modified":"2026-10-15T13:10:45","modified_gmt":"2026-10-15T13:10:45","slug":"bitcoin-hierarchical-deterministic-wallet-python","status":"publish","type":"post","link":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/","title":{"rendered":"How to Create a Bitcoin Hierarchical Deterministic Wallet in Python"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A hierarchical deterministic (HD) wallet generates every key and address it will ever need from a single starting value called a seed. Write down that seed once, and you can rebuild the entire wallet on any device. <a href=\"https:\/\/github.com\/bitcoin\/bips\/blob\/master\/bip-0032.mediawiki\" rel=\"nofollow noopener noreferrer\">BIP-32<\/a> defined the idea in 2012, and nearly every modern Bitcoin wallet is built on it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide shows how to create a Bitcoin HD wallet in Python. You will generate a seed phrase, derive legacy, SegWit, and Taproot addresses, and import an existing mnemonic to restore a wallet \u2014 all with a few lines of code and a maintained library.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-hierarchical-deterministic-hd-wallet\">What Is a Hierarchical Deterministic (HD) Wallet?<\/h2>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-3-1024x683.png\" alt=\"\" class=\"wp-image-3693\" srcset=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-3-1024x683.png 1024w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-3-300x200.png 300w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-3-768x512.png 768w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-3.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">An HD wallet is a wallet whose keys all descend from one seed, arranged in a tree. <em>Deterministic<\/em> means the same seed always produces the same keys in the same order. <em>Hierarchical<\/em> means those keys branch into parent and child levels that you can organize into separate accounts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before HD wallets, software stored a fresh, unrelated private key for every address, so each new address meant another thing to back up. An HD wallet replaces that pile of keys with one secret. Wallets have worked this way since around 2013, which is why restoring a modern wallet usually means typing 12 or 24 words rather than importing a key file.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"seeds-master-keys-and-child-keys\">Seeds, Master Keys, and Child Keys<\/h3>\n\n\n<p class=\"wp-block-paragraph\">The process runs in one direction. A seed phrase is turned into a 512-bit seed, that seed is hashed with HMAC-SHA512 to produce a master private key and a chain code, and child keys are derived from there by feeding in an index number (<a href=\"https:\/\/github.com\/bitcoin\/bips\/blob\/master\/bip-0032.mediawiki\" rel=\"nofollow noopener noreferrer\">BIP-32<\/a>). Change the index, and you get a completely different child key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each key can have children of its own, which is the hierarchy part. A wallet uses different branches of the tree for different jobs \u2014 one branch for receiving addresses, another for change.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"what-are-extended-keys-xprv-and-xpub\">What Are Extended Keys (xprv and xpub)?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">An extended key is a key bundled with its chain code, and together they can derive child keys. There are two kinds. An extended private key (xprv) can derive both private and public children. An extended public key (xpub) can derive only public children \u2014 addresses \u2014 without ever touching a private key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That split is useful. A shop can load an xpub on its web server to generate a new receiving address per customer while the private keys stay offline. The trade-off is privacy: anyone holding your xpub can see every address in that branch, so an xpub protects your coins but not your anonymity.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"why-use-an-hd-wallet-instead-of-single-keys\">Why Use an HD Wallet Instead of Single Keys?<\/h2>\n\n\n<p class=\"wp-block-paragraph\">The short answer: one backup covers everything, permanently. A few concrete benefits follow from that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>One seed to back up.<\/strong> Those 12\u201324 words restore every address, including ones you create years later.<\/li>\n\n\n\n<li><strong>A fresh address per payment.<\/strong> Reusing an address links your transactions on a public ledger. HD wallets make new addresses cheap, which helps privacy.<\/li>\n\n\n\n<li><strong>Many coins from one phrase.<\/strong> The same seed can derive keys for Bitcoin, Ethereum, and other chains, each on its own branch.<\/li>\n\n\n\n<li><strong>Watch-only setups.<\/strong> Share an xpub to monitor balances or hand out addresses without exposing spending keys.<\/li>\n<\/ul>\n\n\n<h2 class=\"wp-block-heading\" id=\"who-relies-on-hd-wallets\">Who Relies on HD Wallets?<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Practically every current Bitcoin wallet is HD, from mobile apps to hardware devices like Ledger and Trezor. Exchanges and custodians use the tree structure to give each user a dedicated branch. Developers building wallets, payment processors, or block explorers lean on the same standards, so a seed created in one tool restores correctly in another. Merchants use xpubs to generate receiving addresses on a server that never stores a private key.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-bip39-turns-entropy-into-a-mnemonic-phrase\">How BIP-39 Turns Entropy Into a Mnemonic Phrase<\/h2>\n\n\n<p class=\"wp-block-paragraph\">The readable word list comes from <a href=\"https:\/\/github.com\/bitcoin\/bips\/blob\/master\/bip-0039.mediawiki\" rel=\"nofollow noopener noreferrer\">BIP-39<\/a>. The wallet starts with random data \u2014 128 to 256 bits of entropy \u2014 adds a short checksum, then slices the result into 11-bit chunks. Each chunk maps to one word in a fixed list of 2,048 words, producing a phrase of 12 to 24 words.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More entropy means more words:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Entropy<\/th><th>Checksum<\/th><th>Words<\/th><\/tr><\/thead><tbody><tr><td>128 bits<\/td><td>4 bits<\/td><td>12<\/td><\/tr><tr><td>160 bits<\/td><td>5 bits<\/td><td>15<\/td><\/tr><tr><td>192 bits<\/td><td>6 bits<\/td><td>18<\/td><\/tr><tr><td>224 bits<\/td><td>7 bits<\/td><td>21<\/td><\/tr><tr><td>256 bits<\/td><td>8 bits<\/td><td>24<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The words are not the seed themselves. They are stretched through the PBKDF2 function into the 512-bit seed the HD tree is built from. BIP-39 also allows an optional passphrase, sometimes called a 25th word, which produces a different seed from the same words \u2014 effectively a separate wallet hidden behind the same phrase.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"bitcoin-derivation-paths-and-address-types\">Bitcoin Derivation Paths and Address Types<\/h2>\n\n\n<p class=\"wp-block-paragraph\">A derivation path is the address of a key inside the tree. Bitcoin paths follow <a href=\"https:\/\/github.com\/bitcoin\/bips\/blob\/master\/bip-0044.mediawiki\" rel=\"nofollow noopener noreferrer\">BIP-44<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>m \/ purpose' \/ coin_type' \/ account' \/ change \/ index<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Each level narrows things down. The <code>purpose<\/code> number states which address standard you are using. <code>coin_type<\/code> is <code>0<\/code> for Bitcoin, a value fixed by <a href=\"https:\/\/github.com\/satoshilabs\/slips\/blob\/master\/slip-0044.md\" rel=\"nofollow noopener noreferrer\">SLIP-0044<\/a>. <code>account<\/code> separates, say, savings from spending. <code>change<\/code> is <code>0<\/code> for receiving addresses and <code>1<\/code> for change. <code>index<\/code> counts addresses within a branch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The apostrophe marks a <em>hardened<\/em> level. Hardened derivation cuts the link between a parent xpub and its children, so leaking one child key cannot expose its siblings. Account-level and higher branches are hardened for exactly this reason.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>purpose<\/code> number also decides what your addresses look like:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Standard<\/th><th>Purpose<\/th><th>Example path<\/th><th>Prefix<\/th><th>Address type<\/th><\/tr><\/thead><tbody><tr><td>BIP-44<\/td><td><code>44'<\/code><\/td><td><code>m\/44'\/0'\/0'\/0\/0<\/code><\/td><td><code>1...<\/code><\/td><td>Legacy (P2PKH)<\/td><\/tr><tr><td>BIP-49<\/td><td><code>49'<\/code><\/td><td><code>m\/49'\/0'\/0'\/0\/0<\/code><\/td><td><code>3...<\/code><\/td><td>Nested SegWit (P2SH-P2WPKH)<\/td><\/tr><tr><td>BIP-84<\/td><td><code>84'<\/code><\/td><td><code>m\/84'\/0'\/0'\/0\/0<\/code><\/td><td><code>bc1q...<\/code><\/td><td>Native SegWit (P2WPKH)<\/td><\/tr><tr><td>BIP-86<\/td><td><code>86'<\/code><\/td><td><code>m\/86'\/0'\/0'\/0\/0<\/code><\/td><td><code>bc1p...<\/code><\/td><td>Taproot (P2TR)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Native SegWit (BIP-84) is the common default for new wallets because of lower fees. Taproot (BIP-86) is the newest format.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-build-a-bitcoin-hd-wallet-in-python\">How to Build a Bitcoin HD Wallet in Python<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Several libraries handle HD derivation. This guide uses the <a href=\"https:\/\/pypi.org\/project\/hdwallet\/\" rel=\"nofollow noopener noreferrer\">hdwallet<\/a> library, a production-stable package that implements BIP-32, BIP-44, BIP-49, BIP-84, and BIP-86 for Bitcoin and 200+ other coins (version 3.6.1 at the time of writing). <a href=\"https:\/\/bitcoinlib.readthedocs.io\/en\/latest\/\" rel=\"nofollow noopener noreferrer\">bitcoinlib<\/a> and <code>bip_utils<\/code> are solid alternatives if you prefer a different API.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"step-1-install-python-and-the-library\">Step 1: Install Python and the Library<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Download Python 3.9 or newer from <a href=\"https:\/\/www.python.org\/downloads\/\" rel=\"nofollow noopener noreferrer\">python.org<\/a>, then install the crypto library with pip:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install hdwallet<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"step-2-generate-a-mnemonic-and-seed\">Step 2: Generate a Mnemonic and Seed<\/h3>\n\n\n<p class=\"wp-block-paragraph\">This creates a new 12-word English phrase and builds a native SegWit wallet from it:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from hdwallet import HDWallet\nfrom hdwallet.mnemonics import (\n    BIP39Mnemonic, BIP39_MNEMONIC_WORDS, BIP39_MNEMONIC_LANGUAGES\n)\nfrom hdwallet.cryptocurrencies import Bitcoin\nfrom hdwallet.hds import BIP84HD\nfrom hdwallet.derivations import BIP84Derivation\n\n# A fresh 12-word English mnemonic (BIP-39)\nmnemonic = BIP39Mnemonic(\n    mnemonic=BIP39Mnemonic.from_words(\n        words=BIP39_MNEMONIC_WORDS.TWELVE,\n        language=BIP39_MNEMONIC_LANGUAGES.ENGLISH,\n    )\n)\n\nwallet = HDWallet(\n    cryptocurrency=Bitcoin,\n    hd=BIP84HD,                        # native SegWit (bc1q...)\n    network=Bitcoin.NETWORKS.MAINNET,\n).from_mnemonic(mnemonic).from_derivation(\n    BIP84Derivation(coin_type=Bitcoin.COIN_TYPE, account=0, address=0)\n)\n\nprint(\"Mnemonic:\", wallet.mnemonic())\nprint(\"Path:    \", wallet.path())\nprint(\"Address: \", wallet.address())\nprint(\"WIF:     \", wallet.wif())<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Running it prints a fresh mnemonic, the derivation path (<code>m\/84'\/0'\/0'\/0\/0<\/code>), the first address (a <code>bc1q...<\/code> string), and the key in Wallet Import Format. Each run produces a different wallet, because the mnemonic is random.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"step-3-derive-different-address-types\">Step 3: Derive Different Address Types<\/h3>\n\n\n<p class=\"wp-block-paragraph\">The address format depends on which standard you plug in. Swap <code>BIP84HD<\/code> and <code>BIP84Derivation<\/code> for <code>BIP44HD<\/code> and <code>BIP44Derivation<\/code> to get a legacy <code>1...<\/code> address, or <code>BIP49HD<\/code> and <code>BIP49Derivation<\/code> for a nested-SegWit <code>3...<\/code> address. The library supports Taproot (BIP-86) the same way. To generate the next receiving address in a branch, increment the index:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>BIP84Derivation(coin_type=Bitcoin.COIN_TYPE, account=0, address=1)<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"step-4-import-an-existing-mnemonic\">Step 4: Import an Existing Mnemonic<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Restoring a wallet means importing its mnemonic. Because derivation is deterministic, the same phrase and the same path always rebuild the same addresses:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from hdwallet import HDWallet\nfrom hdwallet.mnemonics import BIP39Mnemonic\nfrom hdwallet.cryptocurrencies import Bitcoin\nfrom hdwallet.hds import BIP84HD\nfrom hdwallet.derivations import BIP84Derivation\n\n# A well-known BIP-39 test phrase \u2014 never send real funds to it\nphrase = (\"abandon abandon abandon abandon abandon abandon \"\n          \"abandon abandon abandon abandon abandon about\")\n\nwallet = HDWallet(\n    cryptocurrency=Bitcoin, hd=BIP84HD, network=Bitcoin.NETWORKS.MAINNET\n).from_mnemonic(BIP39Mnemonic(mnemonic=phrase)).from_derivation(\n    BIP84Derivation(coin_type=Bitcoin.COIN_TYPE, account=0, address=0)\n)\n\nprint(wallet.address())  # bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This phrase is a public BIP-39 test vector, so it always derives <code>bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu<\/code> on the native SegWit path. Never send real funds to a test phrase \u2014 anyone can derive its keys. Replace it with your own words to restore a real wallet.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"connecting-your-wallet-to-the-bitcoin-network\">Connecting Your Wallet to the Bitcoin Network<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Everything so far happens offline. Deriving keys and addresses needs no internet at all, which is what makes cold storage possible. But a usable wallet also has to read the chain and write to it \u2014 check a balance, list the unspent outputs (UTXOs) behind an address, and broadcast a signed transaction.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That requires a Bitcoin node. You can run your own, but a full node stores the entire chain \u2014 hundreds of gigabytes that only grows \u2014 and has to stay synced through every upgrade. The alternative is connecting to a node that someone else maintains, over its API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is where NOWNodes fits. <a href=\"https:\/\/nownodes.io\/nodes\/bitcoin-btc\">Bitcoin node and API access<\/a> gives your Python wallet an endpoint for standard JSON-RPC calls, so you can broadcast transactions without operating a node yourself. For address-level reads \u2014 balances, transaction history, UTXOs \u2014 the indexed Blockbook interface suits the job better than raw RPC, since it is built for exactly those lookups. You can also sanity-check any derived address in a <a href=\"https:\/\/nownodes.io\/blockchain-explorers\">Bitcoin block explorer<\/a> before you use it. And because one seed can hold keys <a href=\"https:\/\/nownodes.io\/nodes\">across many networks<\/a>, the same accounts can reach several chains through one provider.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"security-notes-for-pythongenerated-wallets\">Security Notes for Python-Generated Wallets<\/h2>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-4-1024x683.png\" alt=\"\" class=\"wp-image-3694\" srcset=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-4-1024x683.png 1024w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-4-300x200.png 300w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-4-768x512.png 768w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/image-4.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A wallet is only as safe as its seed. A few rules matter more than the rest:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Trust the library&#8217;s randomness.<\/strong> hdwallet and bitcoinlib draw entropy from your operating system&#8217;s secure generator. Never invent your own &#8220;random&#8221; source, and never reuse a phrase you found online.<\/li>\n\n\n\n<li><strong>Keep the seed off the network.<\/strong> Don&#8217;t print it to logs, paste it into a chatbot, or commit it to a repository. Treat the file that holds it like cash.<\/li>\n\n\n\n<li><strong>Test with testnet or tiny amounts first.<\/strong> Set the network to testnet while you confirm your derivation paths produce the addresses you expect.<\/li>\n\n\n\n<li><strong>Guard extended keys.<\/strong> An xprv is as powerful as the seed itself, and an xpub exposes your whole address history.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Never share your seed phrase or extended private key.<\/strong> Anyone who has them controls every coin the wallet can ever hold.<\/p>\n<\/blockquote>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n<p class=\"wp-block-paragraph\">A Bitcoin HD wallet turns one seed phrase into an unlimited, organized set of keys, and the standards behind it \u2014 BIP-32 for the tree, BIP-39 for the words, BIP-44 and its siblings for the paths \u2014 are stable and widely supported. In Python, a library like hdwallet reduces the whole thing to a few lines, whether you are generating a new wallet or restoring one from an existing mnemonic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generating keys is only half the job. To check balances and move funds, the wallet still has to reach the Bitcoin network \u2014 through your own node or a provider&#8217;s API \u2014 the bridge between the keys on your machine and the coins on the chain.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">FAQ<\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"is-it-safe-to-generate-a-bitcoin-wallet-with-python\">Is it safe to generate a Bitcoin wallet with Python?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Yes, if you use a trusted library and keep the seed offline. The risk is almost never the math and almost always the handling \u2014 logging the phrase, running on a compromised machine, or sharing an extended key. For anything holding meaningful value, generate the wallet on an offline computer.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"which-bip-standard-should-i-use-for-a-new-bitcoin-wallet\">Which BIP standard should I use for a new Bitcoin wallet?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Native SegWit (BIP-84), which produces <code>bc1q<\/code> addresses, is the common default because it has the lowest transaction fees among the widely supported formats. Taproot (BIP-86), with <code>bc1p<\/code> addresses, is newer and improves privacy and efficiency but is not accepted everywhere yet. Legacy (BIP-44) remains the most universally compatible.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"can-i-restore-my-wallet-in-a-different-app-from-the-same-phrase\">Can I restore my wallet in a different app from the same phrase?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Usually, as long as both apps use the same derivation path. The mnemonic alone isn&#8217;t always enough \u2014 a phrase created on a BIP-84 path won&#8217;t show the same addresses in an app that defaults to BIP-44. Match the path, and the addresses line up.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"can-two-people-accidentally-generate-the-same-seed-phrase\">Can two people accidentally generate the same seed phrase?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">For any practical purpose, no. A 12-word phrase encodes 128 bits of entropy, which is about 3.4 \u00d7 10\u00b3\u2078 possibilities \u2014 vastly more than the number of grains of sand on Earth. A collision from proper random generation is not something you need to plan around.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A hierarchical deterministic (HD) wallet generates every key and address it will ever need from a single starting value called a seed. Write down that seed once, and you can rebuild the entire wallet on any device. BIP-32 defined the idea in 2012, and nearly every modern Bitcoin wallet is built on it. This guide [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":611,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","_lmt_disableupdate":"","_lmt_disable":"","_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Bitcoin HD Wallet in Python: Generate &amp; Import Keys<\/title>\n<meta name=\"description\" content=\"Create a Bitcoin HD wallet in Python with the hdwallet library: generate a BIP39 seed phrase, derive SegWit and Taproot addresses, and import a mnemonic.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bitcoin HD Wallet in Python: Generate &amp; Import Keys\" \/>\n<meta property=\"og:description\" content=\"Create a Bitcoin HD wallet in Python with the hdwallet library: generate a BIP39 seed phrase, derive SegWit and Taproot addresses, and import a mnemonic.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/\" \/>\n<meta property=\"og:site_name\" content=\"NOWNodes Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-02T09:30:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-15T13:10:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/NN_TON-2-min-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1440\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"NOWNodes Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nownodes\" \/>\n<meta name=\"twitter:site\" content=\"@nownodes\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"NOWNodes Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/\"},\"author\":{\"name\":\"NOWNodes Team\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/c041891469390738b68a2aafe063f93c\"},\"headline\":\"How to Create a Bitcoin Hierarchical Deterministic Wallet in Python\",\"datePublished\":\"2026-10-02T09:30:47+00:00\",\"dateModified\":\"2026-10-15T13:10:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/\"},\"wordCount\":1814,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\"},\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/\",\"url\":\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/\",\"name\":\"Bitcoin HD Wallet in Python: Generate & Import Keys\",\"isPartOf\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#website\"},\"datePublished\":\"2026-10-02T09:30:47+00:00\",\"dateModified\":\"2026-10-15T13:10:45+00:00\",\"description\":\"Create a Bitcoin HD wallet in Python with the hdwallet library: generate a BIP39 seed phrase, derive SegWit and Taproot addresses, and import a mnemonic.\",\"breadcrumb\":{\"@id\":\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/nownodes.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"General\",\"item\":\"https:\/\/nownodes.io\/blog\/category\/general\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Create a Bitcoin Hierarchical Deterministic Wallet in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/nownodes.io\/blog\/#website\",\"url\":\"https:\/\/nownodes.io\/blog\/\",\"name\":\"NOWNodes Blog\",\"description\":\"Your first-to-go source of development guides, web3 analytics and most recent news about NOWNodes\",\"publisher\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/nownodes.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\",\"name\":\"NOWNodes Blog\",\"url\":\"https:\/\/nownodes.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png\",\"contentUrl\":\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png\",\"width\":1164,\"height\":1164,\"caption\":\"NOWNodes Blog\"},\"image\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/nownodes\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/c041891469390738b68a2aafe063f93c\",\"name\":\"NOWNodes Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084e45aa2f2bfa61b9ce9f41af97a74f38e87c065b0d49f23a1bb84727320c2e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084e45aa2f2bfa61b9ce9f41af97a74f38e87c065b0d49f23a1bb84727320c2e?s=96&d=mm&r=g\",\"caption\":\"NOWNodes Team\"},\"sameAs\":[\"http:\/\/65.108.139.113\"],\"url\":\"https:\/\/nownodes.io\/blog\/author\/nownodes\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bitcoin HD Wallet in Python: Generate & Import Keys","description":"Create a Bitcoin HD wallet in Python with the hdwallet library: generate a BIP39 seed phrase, derive SegWit and Taproot addresses, and import a mnemonic.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/","og_locale":"en_US","og_type":"article","og_title":"Bitcoin HD Wallet in Python: Generate & Import Keys","og_description":"Create a Bitcoin HD wallet in Python with the hdwallet library: generate a BIP39 seed phrase, derive SegWit and Taproot addresses, and import a mnemonic.","og_url":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/","og_site_name":"NOWNodes Blog","article_published_time":"2026-10-02T09:30:47+00:00","article_modified_time":"2026-10-15T13:10:45+00:00","og_image":[{"width":2560,"height":1440,"url":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/NN_TON-2-min-scaled.jpg","type":"image\/jpeg"}],"author":"NOWNodes Team","twitter_card":"summary_large_image","twitter_creator":"@nownodes","twitter_site":"@nownodes","twitter_misc":{"Written by":"NOWNodes Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/#article","isPartOf":{"@id":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/"},"author":{"name":"NOWNodes Team","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/c041891469390738b68a2aafe063f93c"},"headline":"How to Create a Bitcoin Hierarchical Deterministic Wallet in Python","datePublished":"2026-10-02T09:30:47+00:00","dateModified":"2026-10-15T13:10:45+00:00","mainEntityOfPage":{"@id":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/"},"wordCount":1814,"commentCount":0,"publisher":{"@id":"https:\/\/nownodes.io\/blog\/#organization"},"articleSection":["General"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/","url":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/","name":"Bitcoin HD Wallet in Python: Generate & Import Keys","isPartOf":{"@id":"https:\/\/nownodes.io\/blog\/#website"},"datePublished":"2026-10-02T09:30:47+00:00","dateModified":"2026-10-15T13:10:45+00:00","description":"Create a Bitcoin HD wallet in Python with the hdwallet library: generate a BIP39 seed phrase, derive SegWit and Taproot addresses, and import a mnemonic.","breadcrumb":{"@id":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nownodes.io\/blog\/bitcoin-hierarchical-deterministic-wallet-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/nownodes.io\/blog"},{"@type":"ListItem","position":2,"name":"General","item":"https:\/\/nownodes.io\/blog\/category\/general"},{"@type":"ListItem","position":3,"name":"How to Create a Bitcoin Hierarchical Deterministic Wallet in Python"}]},{"@type":"WebSite","@id":"https:\/\/nownodes.io\/blog\/#website","url":"https:\/\/nownodes.io\/blog\/","name":"NOWNodes Blog","description":"Your first-to-go source of development guides, web3 analytics and most recent news about NOWNodes","publisher":{"@id":"https:\/\/nownodes.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nownodes.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/nownodes.io\/blog\/#organization","name":"NOWNodes Blog","url":"https:\/\/nownodes.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png","contentUrl":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png","width":1164,"height":1164,"caption":"NOWNodes Blog"},"image":{"@id":"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/twitter.com\/nownodes"]},{"@type":"Person","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/c041891469390738b68a2aafe063f93c","name":"NOWNodes Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084e45aa2f2bfa61b9ce9f41af97a74f38e87c065b0d49f23a1bb84727320c2e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084e45aa2f2bfa61b9ce9f41af97a74f38e87c065b0d49f23a1bb84727320c2e?s=96&d=mm&r=g","caption":"NOWNodes Team"},"sameAs":["http:\/\/65.108.139.113"],"url":"https:\/\/nownodes.io\/blog\/author\/nownodes"}]}},"modified_by":"\u0410nastasia","_links":{"self":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/comments?post=610"}],"version-history":[{"count":4,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/610\/revisions"}],"predecessor-version":[{"id":3695,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/610\/revisions\/3695"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/media\/611"}],"wp:attachment":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/media?parent=610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/categories?post=610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/tags?post=610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}