<p>I don't know how to perform this on the GUI, but in order to import a WIF private key on a modern Bitcoin Core you have to use a <a href="https://bitcoin.stackexchange.com/questions/99540/what-are-output-descriptors">descriptor</a>. In order to recover from a backup, you most likely want to use the <code>combo()</code> descriptor.</p>
<p>Here is an example with an example WIF private key: <code>cSWVo8YMehg6STxqw6xGgmMJE6Ac6RCJ7owcrBZRAT7QANtyAAEj</code> (it's a testnet-encoded WIF private key on purpose, yours will be different). There is most likely a similar flow on the graphical interface, but failing that you can always use the command line (or the command input on the GUI).</p>
<p>First craft a combo descriptor from this private key and get its checksum:</p>
<pre><code>getdescriptorinfo 'combo(cSWVo8YMehg6STxqw6xGgmMJE6Ac6RCJ7owcrBZRAT7QANtyAAEj)'
</code></pre>
<p>We get:</p>
<pre><code>{
  &quot;descriptor&quot;: &quot;combo(023ad6336ae257527ff59ec4356fa5d2ac33fff5e04be9e5958dfed9b0100b7948)#mv9rgx7y&quot;,
  &quot;checksum&quot;: &quot;9zedq5ns&quot;,
  &quot;isrange&quot;: false,
  &quot;issolvable&quot;: true,
  &quot;hasprivatekeys&quot;: true
}
</code></pre>
<p>You can now import this descriptor using the <code>importdescriptors</code> command:</p>
<pre><code>importdescriptors '[{&quot;desc&quot;:&quot;combo(cSWVo8YMehg6STxqw6xGgmMJE6Ac6RCJ7owcrBZRAT7QANtyAAEj)#9zedq5ns&quot;,&quot;timestamp&quot;:&quot;now&quot;}]'
</code></pre>
<p>Finally rescan the blockchain from a point before which you are certain to not have received coins. To rescan the whole chain from the genesis block do not provide any parameter:</p>
<pre><code>rescanblockchain
</code></pre>

CC BY-SA 4.0
2023-12-04T12:19:33.743Z
2023-12-04T12:19:33.743Z
Antoine Poinsot
<p>importprivkey only works on legacy wallets, so you need create a legacy wallet and then import the private key succ.</p>
<ol>
<li>create a new wallet with descriptor wallet unchecked.</li>
<li>go to console and importprivkey.</li>
</ol>

CC BY-SA 4.0
2024-03-29T07:25:51.053Z
2024-03-29T07:25:51.053Z
foolbear
<p>When trying to import a WIF private key into Bitcoin-QT i get this error:</p>
<blockquote>
<p>Only legacy wallets are supported by this command (code -4)</p>
</blockquote>
<p>How can one import a private key on a non-legacy wallet?</p>

<bitcoin-core><private-key><wallet-recovery><output-script-descriptors><wallet-import-format>
Import old paper backup (WIF private key) into modern Bitcoin-QT
Ken
# Import old paper backup (WIF private key) into modern Bitcoin-QT

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

When trying to import a WIF private key into Bitcoin-QT i get this error:

> Only legacy wallets are supported by this command (code -4)

How can one import a private key on a non-legacy wallet?

**Tags:** bitcoin-core, private-key, wallet-recovery, output-script-descriptors, wallet-import-format


---

## 2 answers

### Answer by username_1 on 2023-12-04. Score: 1

I don't know how to perform this on the GUI, but in order to import a WIF private key on a modern Bitcoin Core you have to use a [descriptor](https://bitcoin.stackexchange.com/questions/99540/what-are-output-descriptors). In order to recover from a backup, you most likely want to use the `combo()` descriptor.

Here is an example with an example WIF private key: `cSWVo8YMehg6STxqw6xGgmMJE6Ac6RCJ7owcrBZRAT7QANtyAAEj` (it's a testnet-encoded WIF private key on purpose, yours will be different). There is most likely a similar flow on the graphical interface, but failing that you can always use the command line (or the command input on the GUI).

First craft a combo descriptor from this private key and get its checksum:

```
getdescriptorinfo 'combo(cSWVo8YMehg6STxqw6xGgmMJE6Ac6RCJ7owcrBZRAT7QANtyAAEj)'

```

We get:

```
{
  "descriptor": "combo(023ad6336ae257527ff59ec4356fa5d2ac33fff5e04be9e5958dfed9b0100b7948)#mv9rgx7y",
  "checksum": "9zedq5ns",
  "isrange": false,
  "issolvable": true,
  "hasprivatekeys": true
}

```

You can now import this descriptor using the `importdescriptors` command:

```
importdescriptors '[{"desc":"combo(cSWVo8YMehg6STxqw6xGgmMJE6Ac6RCJ7owcrBZRAT7QANtyAAEj)#9zedq5ns","timestamp":"now"}]'

```

Finally rescan the blockchain from a point before which you are certain to not have received coins. To rescan the whole chain from the genesis block do not provide any parameter:

```
rescanblockchain

```


---

### Answer by username_2 on 2024-03-29. Score: 0

importprivkey only works on legacy wallets, so you need create a legacy wallet and then import the private key succ.

1. create a new wallet with descriptor wallet unchecked.
2. go to console and importprivkey.


---

