<p><strong>1)</strong> You should not derive a master private key from a "passphrase". You need a secure PRNG (/dev/urandom) to generate 32byte of entropy. This 32bytes (256 random bits) is your master seed which can be "turned" into your "extended master private key".</p>

<p>You can later encrypt the 32byte entropy with a AES256 key derived from the passphrase (use a proper KDF).</p>

<p><strong>2)</strong> Public keys can be calculated form the private keys.</p>

<p><strong>3)</strong> If you have a private key, you can always calculate the public key</p>

<p><strong>4)</strong> You <strong>cannot</strong> calculate the private key out of a public key (discreet logarithm)</p>

<p><strong>5)</strong> The same applies to "extended" private/public keys (bip32 keys starting with <code>xpriv</code>, <code>xpub</code>, etc.)</p>

<p><strong>6)</strong> You can give someone your <code>extended public key</code> which would allow him/her to watch your balance, watch your transaction</p>

CC BY-SA 3.0
2016-05-25T10:40:04.753Z
Is it possible to share my extended public key to an another wallet using the Bitcoin network ?
jgm
CC BY-SA 3.0
2016-05-25T10:51:33.600Z
You can share your extended public key with another wallet. But keep in mind that if you have two wallets which can hand out addresses, you will very likely run into "the address reuse" problem.
Jonas Schnelli
CC BY-SA 3.0
2016-05-25T10:54:42.297Z
Is it possible to do with the bitcoin network itself, sharing the extended public key ?
jgm
CC BY-SA 3.0
2016-05-25T10:55:19.200Z
I don't understand you question, PM me on IRC #bitcoin-dev or #bitcoin
Jonas Schnelli
CC BY-SA 3.0
2016-05-25T11:14:18.583Z
I have pinged in IRC.
jgm
CC BY-SA 3.0
2016-05-25T07:37:30.390Z
2016-05-25T07:37:30.390Z
Jonas Schnelli
<p>I am trying to built an application that uses the <code>BIP-32</code>. But I am not sure on how to use it. </p>

<p>I have a <code>passphrase</code> with which I generate the <code>Derived Private Key</code> and <code>Derived Public Key</code>. If I share my <code>Derived Public Key</code> with a second wallet will the wallet be able to generate others <code>Derived Public Key</code> from it ? Is it possible ?</p>

<p>And since I have the original <code>Derived Private Key</code> with me, can I see what is happening in the second wallet ?</p>

<p>Also if I loose both the <code>Derived Private Key</code> and <code>Derived Public Key</code>, will I be able to recover my wallets using only the <code>Passphrase</code> ?</p>

<bitcoinj><multi-signature><bip32-hd-wallets>
How to use the BIP-32 keys
jgm
# How to use the BIP-32 keys

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

I am trying to built an application that uses the `BIP-32`. But I am not sure on how to use it.

I have a `passphrase` with which I generate the `Derived Private Key` and `Derived Public Key`. If I share my `Derived Public Key` with a second wallet will the wallet be able to generate others `Derived Public Key` from it ? Is it possible ?

And since I have the original `Derived Private Key` with me, can I see what is happening in the second wallet ?

Also if I loose both the `Derived Private Key` and `Derived Public Key`, will I be able to recover my wallets using only the `Passphrase` ?

**Tags:** bitcoinj, multi-signature, bip32-hd-wallets


---

## 1 answers

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

**1)** You should not derive a master private key from a "passphrase". You need a secure PRNG (/dev/urandom) to generate 32byte of entropy. This 32bytes (256 random bits) is your master seed which can be "turned" into your "extended master private key".

You can later encrypt the 32byte entropy with a AES256 key derived from the passphrase (use a proper KDF).

**2)** Public keys can be calculated form the private keys.

**3)** If you have a private key, you can always calculate the public key

**4)** You **cannot** calculate the private key out of a public key (discreet logarithm)

**5)** The same applies to "extended" private/public keys (bip32 keys starting with `xpriv`, `xpub`, etc.)

**6)** You can give someone your `extended public key` which would allow him/her to watch your balance, watch your transaction

> **Comments:**
> **username_0**: Is it possible to share my extended public key to an another wallet using the Bitcoin network ?  
> **username_1**: You can share your extended public key with another wallet. But keep in mind that if you have two wallets which can hand out addresses, you will very likely run into "the address reuse" problem.  
> **username_0**: Is it possible to do with the bitcoin network itself, sharing the extended public key ?  
> **username_1**: I don't understand you question, PM me on IRC #bitcoin-dev or #bitcoin  
> **username_0**: I have pinged in IRC.  

---

