<p>I want to recover the hdseed for a wallet in bitcoin-core.
If I create a new wallet</p>
<pre><code>cli createwallet mywallet
</code></pre>
<p>I assume that bitcoind will generate a random hdseed for it.
But I don't see how to retrieve that hdseed, there is no <code>gethdseed</code> command.</p>
<p>According to the documentation of <code>sethdseed</code> (<a href="https://developer.bitcoin.org/reference/rpc/sethdseed.html" rel="nofollow noreferrer">https://developer.bitcoin.org/reference/rpc/sethdseed.html</a>)
I should be able to retrieve the seed with the <code>dumpwallet</code> command.</p>
<blockquote>
<p>The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1</p>
</blockquote>
<p>But that doesn't work, I get an error message if I try to dump the wallet secret data.</p>
<pre><code># cli -rpcwallet=mywallet dumpwallet /tmp/mydump
error code: -4
error message:
Only legacy wallets are supported by this command
</code></pre>
<p>Either the documentation is wrong or I compiled with a wrong set of flags.</p>
<pre><code># cli --version
Bitcoin Core RPC client version v24.99.0-2c1fe27bf3c1
...
</code></pre>
<pre><code># cat config.log
...
$ ./configure --with-gui=no --disable-tests --prefix=/bitcoin/install
...
</code></pre>

CC BY-SA 4.0
2023-02-14T13:45:51.810Z
`bitcoin-cli createwallet` creates a descriptor wallet by default, whereas the `dumpwallet` command only works with legacy wallets. However, I wouldn't recommend creating legacy wallets as they are deprecated and support for them will be removed at some point in the future. Can you explain more about why you are trying to get the `hdseed`?
josie
CC BY-SA 4.0
2023-02-14T18:38:30.767Z
There should be a way to extract the seed or master key from these descriptor wallets. Otherwise how can I make a backup or a public key only wallet in another device?
Lepus Cyberneticus
CC BY-SA 4.0
2023-02-15T09:30:39.417Z
Descriptors do allow backups, public key (watch-only) wallets, and importing to other devices, but they do so in a different way than just moving an hdseed around. Take a look at the linked answer for more information on how descriptors work
josie
<bip32-hd-wallets><rpc-error-4>
Getting hdseed from bitcoincore wallet
Lepus Cyberneticus
# Getting hdseed from bitcoincore wallet

(Asked by: username_0 on 2023-02-14)

I want to recover the hdseed for a wallet in bitcoin-core.
If I create a new wallet

```
cli createwallet mywallet

```

I assume that bitcoind will generate a random hdseed for it.
But I don't see how to retrieve that hdseed, there is no `gethdseed` command.

According to the documentation of `sethdseed` (<https://developer.bitcoin.org/reference/rpc/sethdseed.html>)
I should be able to retrieve the seed with the `dumpwallet` command.

> The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1

But that doesn't work, I get an error message if I try to dump the wallet secret data.

```
# cli -rpcwallet=mywallet dumpwallet /tmp/mydump
error code: -4
error message:
Only legacy wallets are supported by this command

```

Either the documentation is wrong or I compiled with a wrong set of flags.

```
# cli --version
Bitcoin Core RPC client version v24.99.0-2c1fe27bf3c1
...

```

```
# cat config.log
...
$ ./configure --with-gui=no --disable-tests --prefix=/bitcoin/install
...

```

**Tags:** bip32-hd-wallets, rpc-error-4

> **Comments:**
> **username_1**: `bitcoin-cli createwallet` creates a descriptor wallet by default, whereas the `dumpwallet` command only works with legacy wallets. However, I wouldn't recommend creating legacy wallets as they are deprecated and support for them will be removed at some point in the future. Can you explain more about why you are trying to get the `hdseed`?  
> **username_0**: There should be a way to extract the seed or master key from these descriptor wallets. Otherwise how can I make a backup or a public key only wallet in another device?  
> **username_1**: Descriptors do allow backups, public key (watch-only) wallets, and importing to other devices, but they do so in a different way than just moving an hdseed around. Take a look at the linked answer for more information on how descriptors work  

---

## 0 answers

