<p><a href="https://bitcoin.stackexchange.com/a/118130/101498">This answer</a> contains a step-by-step guide to import a testnet WIF private key under a <code>pk()</code> (for P2PK) descriptor on a Bitcoin Core wallet using the command line. You can use the same commands in a Bitcoin Core GUI Debug Console. For P2PKH, you simply need to substitute <code>pk()</code> for <code>pkh()</code>.</p>

CC BY-SA 4.0
2024-01-24T14:23:31.780Z
ah.. so let me make the step by step
Michel van Kessel
CC BY-SA 4.0
2024-01-24T14:33:13.447Z
@MichelvanKessel: Self-answers are encouraged, so please post it as an answer here!
Murch
CC BY-SA 4.0
2024-01-24T13:31:37.900Z
2024-01-24T13:31:37.900Z
Antoine Poinsot
<p>ah.. so let me make the step by step</p>
<ol>
<li>getdescriptorinfo &quot;pkh(cSTHGbKgKLCGDRRn5AgtS7L4KHkqmdBau4nsEw8ckAzXV784bgeR)&quot;</li>
</ol>
<p>result:</p>
<pre><code>{
  &quot;descriptor&quot;: &quot;pkh(030264ff3c978d2845efd78ff3092650ff80e49a95bebe2fe2f0e9328f72e31799)#kfn7yc4w&quot;,
  &quot;checksum&quot;: &quot;h9ya7gkd&quot;,
  &quot;isrange&quot;: false,
  &quot;issolvable&quot;: true,
  &quot;hasprivatekeys&quot;: true
}
</code></pre>
<p>important info is <code>&quot;checksum&quot;: &quot;h9ya7gkd&quot;</code></p>
<ol start="2">
<li>importdescriptors '[{&quot;desc&quot;:&quot;pkh(cSTHGbKgKLCGDRRn5AgtS7L4KHkqmdBau4nsEw8ckAzXV784bgeR)#h9ya7gkd&quot;,&quot;timestamp&quot;:&quot;now&quot;}]'</li>
</ol>
<p>At this point I can see my address under <code>receiving addresses</code></p>
<ol start="3">
<li>getaddressinfo mv9u2iuhXL86Y4JKHazEYvAzAXvbt5bwwo</li>
</ol>
<p>result</p>
<pre><code>{
  &quot;address&quot;: &quot;mv9u2iuhXL86Y4JKHazEYvAzAXvbt5bwwo&quot;,
  &quot;scriptPubKey&quot;: &quot;76a914a08e6d3854c35052dd64757f423c1bf91326c5b888ac&quot;,
  &quot;ismine&quot;: true,
  &quot;solvable&quot;: true,
  &quot;desc&quot;: &quot;pkh([a08e6d38]030264ff3c978d2845efd78ff3092650ff80e49a95bebe2fe2f0e9328f72e31799)#ywkyykha&quot;,
  &quot;parent_desc&quot;: &quot;pkh(030264ff3c978d2845efd78ff3092650ff80e49a95bebe2fe2f0e9328f72e31799)#kfn7yc4w&quot;,
  &quot;iswatchonly&quot;: false,
  &quot;isscript&quot;: false,
  &quot;iswitness&quot;: false,
  &quot;pubkey&quot;: &quot;030264ff3c978d2845efd78ff3092650ff80e49a95bebe2fe2f0e9328f72e31799&quot;,
  &quot;iscompressed&quot;: true,
  &quot;ischange&quot;: false,
  &quot;timestamp&quot;: 1706106032,
  &quot;hdkeypath&quot;: &quot;m&quot;,
  &quot;hdseedid&quot;: &quot;0000000000000000000000000000000000000000&quot;,
  &quot;hdmasterfingerprint&quot;: &quot;a08e6d38&quot;,
  &quot;labels&quot;: [
    &quot;&quot;
  ]
}
</code></pre>

CC BY-SA 4.0
2024-01-24T14:34:22.710Z
2024-01-24T14:41:11.237Z
2024-01-24T14:41:11.237Z
Michel van Kessel
<p>Can someone create a step by step, how to import a legacy P2PKH WIF key on testnet (let's say <code>cSTHGbKgKLCGDRRn5AgtS7L4KHkqmdBau4nsEw8ckAzXV784bgeR</code>) into Bitcoin Core 25.1 descriptor wallet using the Debug Console?</p>

CC BY-SA 4.0
2024-01-24T13:28:50.870Z
Does any of those answer your question? https://bitcoin.stackexchange.com/a/108392/101498, https://bitcoin.stackexchange.com/a/108392/101498, https://bitcoin.stackexchange.com/a/118130/101498.
Antoine Poinsot
CC BY-SA 4.0
2024-01-24T13:31:28.210Z
thanks.. but most solutions are so complicated.. I was hoping that there was a simple 2-3 step process
Michel van Kessel
CC BY-SA 4.0
2024-01-24T13:35:07.053Z
Added an answer, you've got a step by step guide in the last link. You simply need to use `pkh()` instead of `pk()`.
Antoine Poinsot
<bitcoin-core><wallet><output-script-descriptors><wallet-import-format>
Import WIF key for P2PKH into Bitcoin Core descriptor wallet
Michel van Kessel
# Import WIF key for P2PKH into Bitcoin Core descriptor wallet

(Asked by: username_0 on 2024-01-24)

Can someone create a step by step, how to import a legacy P2PKH WIF key on testnet (let's say `cSTHGbKgKLCGDRRn5AgtS7L4KHkqmdBau4nsEw8ckAzXV784bgeR`) into Bitcoin Core 25.1 descriptor wallet using the Debug Console?

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

> **Comments:**
> **username_1**: Does any of those answer your question? https://bitcoin.stackexchange.com/a/108392/101498, https://bitcoin.stackexchange.com/a/108392/101498, https://bitcoin.stackexchange.com/a/118130/101498.  
> **username_0**: thanks.. but most solutions are so complicated.. I was hoping that there was a simple 2-3 step process  
> **username_1**: Added an answer, you've got a step by step guide in the last link. You simply need to use `pkh()` instead of `pk()`.  

---

## 2 answers

### Answer by username_0 on 2024-01-24. Score: 3 | Accepted answer

ah.. so let me make the step by step

1. getdescriptorinfo "pkh(cSTHGbKgKLCGDRRn5AgtS7L4KHkqmdBau4nsEw8ckAzXV784bgeR)"

result:

```
{
  "descriptor": "pkh(030264ff3c978d2845efd78ff3092650ff80e49a95bebe2fe2f0e9328f72e31799)#kfn7yc4w",
  "checksum": "h9ya7gkd",
  "isrange": false,
  "issolvable": true,
  "hasprivatekeys": true
}

```

important info is `"checksum": "h9ya7gkd"`

2. importdescriptors '[{"desc":"pkh(cSTHGbKgKLCGDRRn5AgtS7L4KHkqmdBau4nsEw8ckAzXV784bgeR)#h9ya7gkd","timestamp":"now"}]'

At this point I can see my address under `receiving addresses`

3. getaddressinfo mv9u2iuhXL86Y4JKHazEYvAzAXvbt5bwwo

result

```
{
  "address": "mv9u2iuhXL86Y4JKHazEYvAzAXvbt5bwwo",
  "scriptPubKey": "76a914a08e6d3854c35052dd64757f423c1bf91326c5b888ac",
  "ismine": true,
  "solvable": true,
  "desc": "pkh([a08e6d38]030264ff3c978d2845efd78ff3092650ff80e49a95bebe2fe2f0e9328f72e31799)#ywkyykha",
  "parent_desc": "pkh(030264ff3c978d2845efd78ff3092650ff80e49a95bebe2fe2f0e9328f72e31799)#kfn7yc4w",
  "iswatchonly": false,
  "isscript": false,
  "iswitness": false,
  "pubkey": "030264ff3c978d2845efd78ff3092650ff80e49a95bebe2fe2f0e9328f72e31799",
  "iscompressed": true,
  "ischange": false,
  "timestamp": 1706106032,
  "hdkeypath": "m",
  "hdseedid": "0000000000000000000000000000000000000000",
  "hdmasterfingerprint": "a08e6d38",
  "labels": [
    ""
  ]
}

```


---

### Answer by username_1 on 2024-01-24. Score: 3

[This answer](https://bitcoin.stackexchange.com/a/118130/101498) contains a step-by-step guide to import a testnet WIF private key under a `pk()` (for P2PK) descriptor on a Bitcoin Core wallet using the command line. You can use the same commands in a Bitcoin Core GUI Debug Console. For P2PKH, you simply need to substitute `pk()` for `pkh()`.

> **Comments:**
> **username_0**: ah.. so let me make the step by step  
> **username_2**: @username_0: Self-answers are encouraged, so please post it as an answer here!  

---

