<p>You can share an extended public key (xpub key), and the recipient will be able to generate child pubkeys (and thus, verify and child pubkeys provided to them). An extended public key is defined as <code>(K,c)</code>, where <code>K</code> is the parent public key, and <code>c</code> is the chain code.</p>

<p>Keep in mind: anyone with the xpub key will not only be able to verify that an address you give them is derived from the xpub key, <em>they will be able to derive all addresses related to the xpub key themselves</em>. Depending on the situation, this may be a privacy concern.</p>

<p>Worth mentioning: for most applications you should <strong>not</strong> share a master extended public key. Instead, you should share an extended public key that is located at a deeper level of the derivation tree. It may also be worth looking at the benefits of using a hardened key derivation scheme, so you can create a firewall at a certain derivation depth, meaning an attacker will not be able to work back past that level in case your system is compromised.</p>

CC BY-SA 3.0
2018-02-23T07:04:38.980Z
So basically an Master Private Key (k) could be 0<k<n, and a Master Public Key kG where G is a point on the choosed curve. Right?
CipherX
CC BY-SA 3.0
2018-02-24T06:35:45.453Z
@CipherX To create a master extended private key, you should closely follow the BIP32 standard to ensure compatibility with other wallet implementations. As for what values a private key can be, the [bitcoin wiki has some good info](https://en.bitcoin.it/wiki/Private_key). Copied from that page: *...any 256-bit number from 0x1 to 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140 is a valid private key. The range of valid private keys is governed by the secp256k1 ECDSA standard used by Bitcoin.*
chytrik
CC BY-SA 3.0
2018-02-23T01:23:47.527Z
2018-02-23T01:23:47.527Z
chytrik
<p>When the Master Private Key and the Master Public Key are generated, can I disclose the chain code as say <a href="https://www.ietf.org/proceedings/interim-2017-cfrg-01/slides/slides-interim-2017-cfrg-01-sessa-bip32-ed25519-01.pdf" rel="nofollow noreferrer">BIP32</a>? If not, how can is possible verify a child public key with public parameters?</p>

<p>This is an important question for me because it's necessary give the possibility to verify the generated child public key to another user in my scenario.</p>

<p>Could the Master Private Key generated by using a random integer 0&lt; k &lt; n where n is the curve group order?</p>

<private-key><public-key><bip32-hd-wallets>
Public Chain Code and MPK
CipherX
# Public Chain Code and MPK

(Asked by: username_0 on 2018-02-22)

When the Master Private Key and the Master Public Key are generated, can I disclose the chain code as say [BIP32](https://www.ietf.org/proceedings/interim-2017-cfrg-01/slides/slides-interim-2017-cfrg-01-sessa-bip32-ed25519-01.pdf)? If not, how can is possible verify a child public key with public parameters?

This is an important question for me because it's necessary give the possibility to verify the generated child public key to another user in my scenario.

Could the Master Private Key generated by using a random integer 0< k < n where n is the curve group order?

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


---

## 1 answers

### Answer by username_1 on 2018-02-23. Score: 0 | Accepted answer

You can share an extended public key (xpub key), and the recipient will be able to generate child pubkeys (and thus, verify and child pubkeys provided to them). An extended public key is defined as `(K,c)`, where `K` is the parent public key, and `c` is the chain code.

Keep in mind: anyone with the xpub key will not only be able to verify that an address you give them is derived from the xpub key, *they will be able to derive all addresses related to the xpub key themselves*. Depending on the situation, this may be a privacy concern.

Worth mentioning: for most applications you should **not** share a master extended public key. Instead, you should share an extended public key that is located at a deeper level of the derivation tree. It may also be worth looking at the benefits of using a hardened key derivation scheme, so you can create a firewall at a certain derivation depth, meaning an attacker will not be able to work back past that level in case your system is compromised.

> **Comments:**
> **username_0**: So basically an Master Private Key (k) could be 0<k<n, and a Master Public Key kG where G is a point on the choosed curve. Right?  
> **username_1**: @username_0 To create a master extended private key, you should closely follow the BIP32 standard to ensure compatibility with other wallet implementations. As for what values a private key can be, the [bitcoin wiki has some good info](https://en.bitcoin.it/wiki/Private_key). Copied from that page: *...any 256-bit number from 0x1 to 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140 is a valid private key. The range of valid private keys is governed by the secp256k1 ECDSA standard used by Bitcoin.*  

---

