<p>You can generate new extended public keys on</p>

<p><a href="http://bip32.org/" rel="nofollow noreferrer">http://bip32.org/</a></p>

<p>You can generate them for testnet or mainnet. Just set the network combo box in the upper right to the network you want.</p>

<hr>

<p><strong>ADVISO</strong>: Please don't ever use websites to generate key material. Suitable only for throw-away addresses for testing only.</p>

CC BY-SA 3.0
2018-04-24T13:37:42.840Z
2018-04-24T13:37:42.840Z
toddmo
<p>You can do that, but each HD seed needs to be inside its own wallet file which is loaded by the server. Running bitcoind with multiple -wallet arguments will achieve what you are aiming for. Currently it is not supported to dynamically load and unload wallets at runtime, but support for that is being added and will be available in a future release.</p>

CC BY-SA 3.0
2018-04-23T08:48:38.047Z
Exporting xpub from bitcoin node doesn't server purpose as it uses hardened key derviation... you need to export the xprv https://bitcoin.stackexchange.com/questions/50244/how-to-get-xpub-or-mpkbip32-for-my-bitcoin-core-wallet?noredirect=1&lq=1
dark knight
CC BY-SA 3.0
2018-04-24T02:11:31.660Z
@toddmo you can generate a valid xpub any way you like if you just want one for testing, it doesn't have to be the same one as the one in your wallet
meshcollider
CC BY-SA 3.0
2018-04-24T03:04:40.600Z
ok I put a lot of effort into editing my question and doing research, which provided an answer, which may not be the best. Sorry but I needed to learn what I needed to ask and cut out all the extraneous babbling in my original question. Now you can see what I really want by looking at my edited question and my new answer. Again, sorry. Feel free to give a better answer than mine.
toddmo
CC BY-SA 4.0
2023-07-03T03:23:18.967Z
It's worth noting that Bitcoin Core can load and unload wallets at runtime since 0.16.
Zenul_Abidin
CC BY-SA 3.0
2018-04-22T23:55:09.750Z
2018-04-22T23:55:09.750Z
meshcollider
<p>I have a need to generate a new extended public key (xpub).</p>

<p>Examples: </p>

<pre><code>xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz

tpubD6NzVbkrYhZ4WLczPJWReQycCJdd6YVWXubbVUFnJ5KgU5MDQrD998ZJLNGbhd2pq7ZtDiPYTfJ7iBenLVQpYgSQqPjUsQeJXH8VQ8xA67D
</code></pre>

<p>How can I do this?</p>

<p>I would like to do it inside json rpc, because that would help automate testing, but I ultimately don't care how I get them. They are for testing.</p>

<address-generation><bip32-hd-wallets><xpub>
How to generate a new extended public key (xpub)?
toddmo
# How to generate a new extended public key (xpub)?

(Asked by: username_0 on 2018-04-22)

I have a need to generate a new extended public key (xpub).

Examples:

```
xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz

tpubD6NzVbkrYhZ4WLczPJWReQycCJdd6YVWXubbVUFnJ5KgU5MDQrD998ZJLNGbhd2pq7ZtDiPYTfJ7iBenLVQpYgSQqPjUsQeJXH8VQ8xA67D

```

How can I do this?

I would like to do it inside json rpc, because that would help automate testing, but I ultimately don't care how I get them. They are for testing.

**Tags:** address-generation, bip32-hd-wallets, xpub


---

## 2 answers

### Answer by username_0 on 2018-04-24. Score: 1 | Accepted answer

You can generate new extended public keys on

<http://bip32.org/>

You can generate them for testnet or mainnet. Just set the network combo box in the upper right to the network you want.

---

**ADVISO**: Please don't ever use websites to generate key material. Suitable only for throw-away addresses for testing only.


---

### Answer by username_1 on 2018-04-22. Score: 1

You can do that, but each HD seed needs to be inside its own wallet file which is loaded by the server. Running bitcoind with multiple -wallet arguments will achieve what you are aiming for. Currently it is not supported to dynamically load and unload wallets at runtime, but support for that is being added and will be available in a future release.

> **Comments:**
> **username_2**: Exporting xpub from bitcoin node doesn't server purpose as it uses hardened key derviation... you need to export the xprv https://bitcoin.stackexchange.com/questions/50244/how-to-get-xpub-or-mpkbip32-for-my-bitcoin-core-wallet?noredirect=1&lq=1  
> **username_1**: @username_0 you can generate a valid xpub any way you like if you just want one for testing, it doesn't have to be the same one as the one in your wallet  
> **username_0**: ok I put a lot of effort into editing my question and doing research, which provided an answer, which may not be the best. Sorry but I needed to learn what I needed to ask and cut out all the extraneous babbling in my original question. Now you can see what I really want by looking at my edited question and my new answer. Again, sorry. Feel free to give a better answer than mine.  
> **username_3**: It's worth noting that Bitcoin Core can load and unload wallets at runtime since 0.16.  

---

