<p>With <strong>"Master public key"</strong> you probably refer to deterministic key derivation after bip32.</p>

<p>The correct term is <strong>"Master extended private key"</strong> (acronym <strong>xpriv</strong>) and <strong>"Master extended public key"</strong> (acronym <strong>xpub</strong>).</p>

<p>The acronyms are "xpriv" and "xpub" because the base58 check prefix results in those 4 characters for a mainnet extended pub/priv key.</p>

<p>The difference between a <strong>extended</strong> public key and a normal public key is that it also contains information about the bip32 chain (deterministic chain/hierarchy).</p>

<p>It contains:</p>

<ul>
<li>The <em>depth</em> in the hierarchy (1byte 0x00 for master nodes, 0x01 for level-1 derived keys, ....)</li>
<li>A fingerprint (4 bytes, possible identifier)</li>
<li>The <em>chaincode</em> (32 bytes, = link used for the hierarchy)</li>
<li>The <em>child index</em> ("number" of the key at the current hierarchy level)</li>
<li>The <em>private or public key</em> (32bytes for private-, 33bytes for public-key)</li>
</ul>

<p>A normal private- or public-key only contains the last element (32/33byte [public|private]key).</p>

<p><strong>A (simplified) example how you would generate addresses:</strong></p>

<ol>
<li>Take the extended master private key (<code>m/</code>)</li>
<li>Derive an account extended private key (<code>m/0'</code>)</li>
<li>Take this account extended private key (<code>m/0'</code>) and derive the first extended private key on the next level (<code>m/0'/0</code>).</li>
<li>Use the extended private key of (<code>m/0'/0</code>) to generate the extended public key and take out the "normal public key" (33 bytes) and encode a P2PKH address (or P2WPKH, multisig, etc.) out of it.</li>
</ol>

CC BY-SA 4.0
2016-12-05T13:31:48.417Z
2019-08-25T15:49:13.040Z
2019-08-25T15:49:13.040Z
Jonas Schnelli
<ol>
<li>what is difference between Master Public Key (MPK) and Public Key?</li>
<li>what is difference between Master Private Key and Private Key?</li>
<li>should I use master public key (MPK) when generating address or public key?</li>
</ol>

<private-key><public-key><bip32-hd-wallets>
difference between Master Public/private Key and Public/private Key?
max
# difference between Master Public/private Key and Public/private Key?

(Asked by: username_0 on 2016-12-05)

1. what is difference between Master Public Key (MPK) and Public Key?
2. what is difference between Master Private Key and Private Key?
3. should I use master public key (MPK) when generating address or public key?

**Tags:** private-key, public-key, bip32-hd-wallets


---

## 1 answers

### Answer by username_1 on 2016-12-05. Score: 12 | Accepted answer

With **"Master public key"** you probably refer to deterministic key derivation after bip32.

The correct term is **"Master extended private key"** (acronym **xpriv**) and **"Master extended public key"** (acronym **xpub**).

The acronyms are "xpriv" and "xpub" because the base58 check prefix results in those 4 characters for a mainnet extended pub/priv key.

The difference between a **extended** public key and a normal public key is that it also contains information about the bip32 chain (deterministic chain/hierarchy).

It contains:

* The *depth* in the hierarchy (1byte 0x00 for master nodes, 0x01 for level-1 derived keys, ....)
* A fingerprint (4 bytes, possible identifier)
* The *chaincode* (32 bytes, = link used for the hierarchy)
* The *child index* ("number" of the key at the current hierarchy level)
* The *private or public key* (32bytes for private-, 33bytes for public-key)

A normal private- or public-key only contains the last element (32/33byte [public|private]key).

**A (simplified) example how you would generate addresses:**

1. Take the extended master private key (`m/`)
2. Derive an account extended private key (`m/0'`)
3. Take this account extended private key (`m/0'`) and derive the first extended private key on the next level (`m/0'/0`).
4. Use the extended private key of (`m/0'/0`) to generate the extended public key and take out the "normal public key" (33 bytes) and encode a P2PKH address (or P2WPKH, multisig, etc.) out of it.


---

