How to use the BIP-32 keys

1

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 ?

jgm

Posted 2016-05-24T22:19:40.923

Reputation: 748

Answers

1

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

Jonas Schnelli

Posted 2016-05-24T22:19:40.923

Reputation: 5 465

Is it possible to share my extended public key to an another wallet using the Bitcoin network ?jgm 2016-05-25T10:40:04.753

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 2016-05-25T10:51:33.600

Is it possible to do with the bitcoin network itself, sharing the extended public key ?jgm 2016-05-25T10:54:42.297

I don't understand you question, PM me on IRC #bitcoin-dev or #bitcoinJonas Schnelli 2016-05-25T10:55:19.200

I have pinged in IRC.jgm 2016-05-25T11:14:18.583