<p>I want to know how the prefixes for EXT_PUBLIC_KEY and EXT_PRIVATE_KEY are derived. For example in bitcoin you have:</p>
<pre><code>base58Prefixes[PUBKEY_ADDRESS] = std::vector&lt;unsigned char&gt;(1,0);
base58Prefixes[SCRIPT_ADDRESS] = std::vector&lt;unsigned char&gt;(1,5);
base58Prefixes[SECRET_KEY] =     std::vector&lt;unsigned char&gt;(1,128);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
</code></pre>
<p>And I another cryptocurrency has:</p>
<pre><code>base58Prefixes[PUBKEY_ADDRESS] = std::vector&lt;unsigned char&gt;(1,25); 
base58Prefixes[SCRIPT_ADDRESS] = std::vector&lt;unsigned char&gt;(1,5);
base58Prefixes[SECRET_KEY]     = std::vector&lt;unsigned char&gt;(1,153); // 25 + 128
base58Prefixes[SECRET_KEY_OLD] = std::vector&lt;unsigned char&gt;(1,151);
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x1E)(0x56)(0x2D)(0x9A).convert_to_container&lt;std::vector&lt;unsigned char&gt; &gt;();
base58Prefixes[EXT_SECRET_KEY] = list_of(0x1E)(0x56)(0x31)(0xBC).convert_to_container&lt;std::vector&lt;unsigned char&gt; &gt;();
</code></pre>
<p>Im trying to make a server that generates addresses from the Extended public key without exposing the private key on the latter cryptocurrency but I've been running into some problems. I want to understand how the EXT_PUBLIC_KEY is derived as for the development and how it is used  to generate addresses. I'm trying to implement it into pywallet (<a href="https://github.com/ranaroussi/pywallet" rel="nofollow noreferrer">https://github.com/ranaroussi/pywallet</a>) but it seems to not support this kind of EXT_PUBLIC_KEY</p>

CC BY-SA 4.0
2020-06-24T20:19:50.147Z
Are you asking about the prefixes or the actual keys themselves? The code you posted is related to the prefixes and not at all anything to do with key derivation.
Ava Chow
CC BY-SA 4.0
2020-06-25T11:36:52.920Z
Sorry, the question has been edited. I was asking about the prefixes
MisterSir
<wallet><bip32-hd-wallets><currencies><cryptography><bip>
How are the prefixes for EXT_PUBLIC_KEY and EXT_PRIVATE_KEY derived?
MisterSir
# How are the prefixes for EXT_PUBLIC_KEY and EXT_PRIVATE_KEY derived?

(Asked by: username_0 on 2020-06-24)

I want to know how the prefixes for EXT\_PUBLIC\_KEY and EXT\_PRIVATE\_KEY are derived. For example in bitcoin you have:

```
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,0);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,128);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};

```

And I another cryptocurrency has:

```
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,25); 
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[SECRET_KEY]     = std::vector<unsigned char>(1,153); // 25 + 128
base58Prefixes[SECRET_KEY_OLD] = std::vector<unsigned char>(1,151);
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x1E)(0x56)(0x2D)(0x9A).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = list_of(0x1E)(0x56)(0x31)(0xBC).convert_to_container<std::vector<unsigned char> >();

```

Im trying to make a server that generates addresses from the Extended public key without exposing the private key on the latter cryptocurrency but I've been running into some problems. I want to understand how the EXT\_PUBLIC\_KEY is derived as for the development and how it is used to generate addresses. I'm trying to implement it into pywallet (<https://github.com/ranaroussi/pywallet>) but it seems to not support this kind of EXT\_PUBLIC\_KEY

**Tags:** wallet, bip32-hd-wallets, currencies, cryptography, bip

> **Comments:**
> **username_1**: Are you asking about the prefixes or the actual keys themselves? The code you posted is related to the prefixes and not at all anything to do with key derivation.  
> **username_0**: Sorry, the question has been edited. I was asking about the prefixes  

---

## 0 answers

