<blockquote>
  <p>What's the difference between CKDpub and CKDpriv from the path notation</p>
</blockquote>

<p>1.</p>

<h2>CKDpub (public key child key derivation)</h2>

<p>Derives a child <em>pubkey</em> with given extended pubkey (pubkey &amp; chaincode) and child index. Only works for non-hardened derivation.</p>

<h2>CKDpriv (private key child key derivation)</h2>

<p>Derives a child <em>private</em> key with given extended privatekey (privkey &amp; chaincode) and child index.</p>

<p>The keypath does not distinguish between private- and public-keys, so on that level there is no difference between CKDpub/CKDpriv.</p>

<p>Although, as you mentioned, to derive a hardened key – even if you only want to derive the public key – you need the corresponding extended private key.</p>

<p>Examples:</p>

<ol>
<li>you <strong>can</strong> derive the extended pubkey at <code>m/1</code> if you have the  extended pubkey <code>m</code></li>
<li>You <strong>can't</strong> derive the pubkey at <code>m/1'</code> with the extended pubkey <code>m</code></li>
<li>You <strong>can</strong> derive the pubkey (and the privkey) at <code>m/1'</code> with the extended privatekey <code>m</code></li>
</ol>

<hr>

<blockquote>
  <p>From this Ethereum standard derivation node /m/44'/60'/0'/0/0 ,how can someone get the extended public key and derive other public from that extended public key respecting those conventions.</p>
</blockquote>

<p>You need the xpriv (extended private key) to derive /m/44'/60'/0', but further public child keys (like <code>/m/44'/60'/0'/0</code> and <code>/m/44'/60'/0'/0/0</code>) can be derived with the xpub (extended public key at /m/44'/60'/0').</p>

<hr>

<blockquote>
  <p>f(parentExtendedPubKey, index ) = childPubKey --> address. How is this achieved and how can a private key that stayed in the HD wallet can later be used to unlock or spend those funds sent to that address generated through the parent public key ?</p>
</blockquote>

<p>Deriving a child public key – regardless if you have use the xpub or xpriv – result in the same public key. Just be aware that only the xpriv can derive <em>hardened</em> childkeys.</p>

<p>Assume you have derived the pubkey at m/10 with the xpub at <code>m</code>, you can later derive the according <strong>priv</strong>-key at m/10 with the xpriv at <code>m</code>.</p>

<h2>Further thoughts</h2>

<p>BIP44 was designed for hardware wallets and or cold storage.
Ideally you <strong>should not</strong> mix non hardened key derivation (CKDpub) with the possibility to export child private keys. If you leak a xpub and a single child private key, you reveal all your keys.</p>

CC BY-SA 4.0
2018-06-13T20:33:48.343Z
I was thinking about building an HD wallet and then send an extended pubk on the server to generate more addresses to receiving transactions.

`Ideally you should not mix non hardened key derivation (CKDpub) with the possibility to export child private keys`. Does this mean we should only use only hardened keys ? How can the server generate hardened keys without private keys if the idea is to only export xpub ?
Eddy
CC BY-SA 4.0
2018-06-18T10:32:24.373Z
Using a server for child key derivation can be tricky... what if the server is hacked and an attacker sends back a forged address,... would that lead to that one may send funds to the attackers address?
Jonas Schnelli
CC BY-SA 4.0
2018-06-13T19:56:18.783Z
2018-06-13T19:56:18.783Z
Jonas Schnelli
<pre><code>What's the difference between CKDpub and CKDpriv from the path notation
</code></pre>

<p>1.
CKDpub (public key child key derivation)</p>

<p>Derives a child pubkey with given extended pubkey (pubkey &amp; chaincode) and child index. Only works for non-hardened derivation.
CKDpriv (private key child key derivation)</p>

<p>Derives a child private key with given extended privatekey (privkey &amp; chaincode) and child index.</p>

<p>The keypath does not distinguish between private- and public-keys, so on that level there is no difference between CKDpub/CKDpriv.</p>

<p>Although, as you mentioned, to derive a hardened key – even if you only want to derive the public key – you need the corresponding extended private key.</p>

<p>Examples:</p>

<pre><code>you can derive the extended pubkey at m/1 if you have the extended pubkey m
You can't derive the pubkey at m/1' with the extended pubkey m
You can derive the pubkey (and the privkey) at m/1' with the extended privatekey m

From this Ethereum standard derivation node /m/44'/60'/0'/0/0 ,how can someone get the extended public key and derive other public from that extended public key respecting those conventions.
</code></pre>

<p>You need the xpriv (extended private key) to derive /m/44'/60'/0', but further public child keys (like /m/44'/60'/0'/0 and /m/44'/60'/0'/0/0) can be derived with the xpub (extended public key at /m/44'/60'/0').</p>

<pre><code>f(parentExtendedPubKey, index ) = childPubKey --&gt; address. How is this achieved and how can a private key that stayed in the HD wallet can later be used to unlock or spend those funds sent to that address generated through the parent public key ?
</code></pre>

<p>Deriving a child public key – regardless if you have use the xpub or xpriv – result in the same public key. Just be aware that only the xpriv can derive hardened childkeys.</p>

<p>Assume you have derived the pubkey at m/10 with the xpub at m, you can later derive the according priv-key at m/10 with the xpriv at m.
Further thoughts</p>

<p>BIP44 was designed for hardware wallets and or cold storage. Ideally you should not mix non hardened key derivation (CKDpub) with the possibility to export child private keys. If you leak a xpub and a single child private key, you reveal all your keys.
shareedit</p>

CC BY-SA 4.0
2018-06-13T20:01:23.543Z
2018-06-13T20:01:23.543Z
Multi Tech
<p>I' m still trying to grasp the conventions used in HD wallets, so I have a couple of questions:</p>

<ol>
<li><p>What's the difference between CKDpub and CKDpriv from the path notation.
What I know is the path  just uses <code>h</code> or <code>'</code> to denote difference between hardened and non-hardened dervivations but I don't see <em>the difference between a CKDpub and CKDpriv by just seeing the path.</em></p></li>
<li><p>From this Ethereum standard derivation node <code>/m/44'/60'/0'/0/0</code> ,how can someone get the extended public key and derive other public from that extended public key respecting those conventions.</p></li>
<li><p><code>f(parentExtendedPubKey, index ) = childPubKey --&gt; address</code>. How is this achieved and how can  a private key that stayed in the HD wallet can later be used to unlock or spend those funds sent to that address generated through the parent public key ?</p></li>
</ol>

<bip32-hd-wallets>
HD Wallets Difference between a CKDpub and CKDpriv from the path notation
Eddy
# HD Wallets Difference between a CKDpub and CKDpriv from the path notation

(Asked by: username_0 on 2018-06-13)

I' m still trying to grasp the conventions used in HD wallets, so I have a couple of questions:

1. What's the difference between CKDpub and CKDpriv from the path notation.
   What I know is the path just uses `h` or `'` to denote difference between hardened and non-hardened dervivations but I don't see *the difference between a CKDpub and CKDpriv by just seeing the path.*
2. From this Ethereum standard derivation node `/m/44'/60'/0'/0/0` ,how can someone get the extended public key and derive other public from that extended public key respecting those conventions.
3. `f(parentExtendedPubKey, index ) = childPubKey --> address`. How is this achieved and how can a private key that stayed in the HD wallet can later be used to unlock or spend those funds sent to that address generated through the parent public key ?

**Tags:** bip32-hd-wallets


---

## 2 answers

### Answer by username_1 on 2018-06-13. Score: 2

> What's the difference between CKDpub and CKDpriv from the path notation

1.

## CKDpub (public key child key derivation)

Derives a child *pubkey* with given extended pubkey (pubkey & chaincode) and child index. Only works for non-hardened derivation.

## CKDpriv (private key child key derivation)

Derives a child *private* key with given extended privatekey (privkey & chaincode) and child index.

The keypath does not distinguish between private- and public-keys, so on that level there is no difference between CKDpub/CKDpriv.

Although, as you mentioned, to derive a hardened key – even if you only want to derive the public key – you need the corresponding extended private key.

Examples:

1. you **can** derive the extended pubkey at `m/1` if you have the extended pubkey `m`
2. You **can't** derive the pubkey at `m/1'` with the extended pubkey `m`
3. You **can** derive the pubkey (and the privkey) at `m/1'` with the extended privatekey `m`

---

> From this Ethereum standard derivation node /m/44'/60'/0'/0/0 ,how can someone get the extended public key and derive other public from that extended public key respecting those conventions.

You need the xpriv (extended private key) to derive /m/44'/60'/0', but further public child keys (like `/m/44'/60'/0'/0` and `/m/44'/60'/0'/0/0`) can be derived with the xpub (extended public key at /m/44'/60'/0').

---

> f(parentExtendedPubKey, index ) = childPubKey --> address. How is this achieved and how can a private key that stayed in the HD wallet can later be used to unlock or spend those funds sent to that address generated through the parent public key ?

Deriving a child public key – regardless if you have use the xpub or xpriv – result in the same public key. Just be aware that only the xpriv can derive *hardened* childkeys.

Assume you have derived the pubkey at m/10 with the xpub at `m`, you can later derive the according **priv**-key at m/10 with the xpriv at `m`.

## Further thoughts

BIP44 was designed for hardware wallets and or cold storage.
Ideally you **should not** mix non hardened key derivation (CKDpub) with the possibility to export child private keys. If you leak a xpub and a single child private key, you reveal all your keys.

> **Comments:**
> **username_0**: I was thinking about building an HD wallet and then send an extended pubk on the server to generate more addresses to receiving transactions.  `Ideally you should not mix non hardened key derivation (CKDpub) with the possibility to export child private keys`. Does this mean we should only use only hardened keys ? How can the server generate hardened keys without private keys if the idea is to only export xpub ?  
> **username_1**: Using a server for child key derivation can be tricky... what if the server is hacked and an attacker sends back a forged address,... would that lead to that one may send funds to the attackers address?  

---

### Answer by username_2 on 2018-06-13. Score: 1

```
What's the difference between CKDpub and CKDpriv from the path notation

```

1.
CKDpub (public key child key derivation)

Derives a child pubkey with given extended pubkey (pubkey & chaincode) and child index. Only works for non-hardened derivation.
CKDpriv (private key child key derivation)

Derives a child private key with given extended privatekey (privkey & chaincode) and child index.

The keypath does not distinguish between private- and public-keys, so on that level there is no difference between CKDpub/CKDpriv.

Although, as you mentioned, to derive a hardened key – even if you only want to derive the public key – you need the corresponding extended private key.

Examples:

```
you can derive the extended pubkey at m/1 if you have the extended pubkey m
You can't derive the pubkey at m/1' with the extended pubkey m
You can derive the pubkey (and the privkey) at m/1' with the extended privatekey m

From this Ethereum standard derivation node /m/44'/60'/0'/0/0 ,how can someone get the extended public key and derive other public from that extended public key respecting those conventions.

```

You need the xpriv (extended private key) to derive /m/44'/60'/0', but further public child keys (like /m/44'/60'/0'/0 and /m/44'/60'/0'/0/0) can be derived with the xpub (extended public key at /m/44'/60'/0').

```
f(parentExtendedPubKey, index ) = childPubKey --> address. How is this achieved and how can a private key that stayed in the HD wallet can later be used to unlock or spend those funds sent to that address generated through the parent public key ?

```

Deriving a child public key – regardless if you have use the xpub or xpriv – result in the same public key. Just be aware that only the xpriv can derive hardened childkeys.

Assume you have derived the pubkey at m/10 with the xpub at m, you can later derive the according priv-key at m/10 with the xpriv at m.
Further thoughts

BIP44 was designed for hardware wallets and or cold storage. Ideally you should not mix non hardened key derivation (CKDpub) with the possibility to export child private keys. If you leak a xpub and a single child private key, you reveal all your keys.
shareedit


---

