Bitcoin Forum
May 13, 2024, 12:29:10 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: "Best Practices" when using BIP 32 master public keys  (Read 1322 times)
NRF (OP)
Sr. Member
****
Offline Offline

Activity: 279
Merit: 250



View Profile
March 11, 2015, 12:54:46 AM
 #1

I apologize because this question has been asked before quite a few time all over the internet (here too) and there have been a lot of answers.  I just want to be sure that I don't shoot myself in the foot.

So, for arguments say lets say I am using pycoin's (https://github.com/richardkiss/pycoin) ky tool and I generate a mpk with "ku create" and get the mpk value. I can the grab 10 keys using like this.

Code:
ku xpub661MyMwAqRbcEp8XttK9d2edcSGdtgB5Jjti3upwRiwGYPMFRBJHLe994uMuyLubJWbhzqUtBtYmGfpjHxVbDCjGPboCg3b5wWNGkxavC3B -a -s0-9
1PN6bChSyBmogR264VxWavnhL7sTE39N4i
1GV7T2qyhTDNq7vWo8vSk5nVj1feSHyUMU
1FG5CaEPPDn29vVpuRUWaFyqSdjVZjyo2t
1CnZXqhYSXXv4wFdj3Ss6YjWAMqDtPFokh
16CthYE7THTWAE5hb7MruRLacMviiA9Ah3
1H8EzkbpD1n5TXqZRSrwVzsnXTckxjyCdh
1J5nceBipnQrK1TzwfqcaEoJ8f2MhAKDA
16c6ZJjQw22QCQeJty8UZZEacWqkpqcp4U
1CXdrSPQK1gq25o7Waohp3dQEwGXTHf4R4
13ts9DzMBDms2A4R2SK7xCcWRFwepf5w7d

I have 3 questions.

1. Assuming I keep control of the master private key and start giving out those addresses have I shot myself in the foot?

2. How many public keys can I generate like this?  it seems I can use -s999999999

3. Is there a better way?

1715560150
Hero Member
*
Offline Offline

Posts: 1715560150

View Profile Personal Message (Offline)

Ignore
1715560150
Reply with quote  #2

1715560150
Report to moderator
1715560150
Hero Member
*
Offline Offline

Posts: 1715560150

View Profile Personal Message (Offline)

Ignore
1715560150
Reply with quote  #2

1715560150
Report to moderator
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715560150
Hero Member
*
Offline Offline

Posts: 1715560150

View Profile Personal Message (Offline)

Ignore
1715560150
Reply with quote  #2

1715560150
Report to moderator
1715560150
Hero Member
*
Offline Offline

Posts: 1715560150

View Profile Personal Message (Offline)

Ignore
1715560150
Reply with quote  #2

1715560150
Report to moderator
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
March 11, 2015, 12:21:20 PM
 #2

1. Assuming I keep control of the master private key and start giving out those addresses have I shot myself in the foot?

2. How many public keys can I generate like this?  it seems I can use -s999999999

3. Is there a better way?

1. Assuming you keep a record of which index you gave to whom, I see no problem.

2. 2,147,483,648 keys per MPK (remember, in HD wallets, any pubkey can be turned into an MPK... so basically limitless... but for 1 single MPK, you're limited to a little over 2 billion keys.

3. Depends on exactly what you want to do with the addresses. Giving out for simple payments, fine... just NEVER GIVE OUT A SINGLE PRIVATE KEY TO ANY OF THOSE ADDRESSES. (Remember: 1 MPK + 1 private key of an address generated from it = the Master Private Key for that MPK can be calculated.)

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
NRF (OP)
Sr. Member
****
Offline Offline

Activity: 279
Merit: 250



View Profile
March 11, 2015, 08:37:58 PM
 #3

NEVER GIVE OUT A SINGLE PRIVATE KEY TO ANY OF THOSE ADDRESSES. (Remember: 1 MPK + 1 private key of an address generated from it = the Master Private Key for that MPK can be calculated.)

Noted, I had been aware but it is good to reiterate.

One last question, and this is more about client/wallet behavior than anything else and I am probably pushing s*@t up hill.  Given the master private or master public key can you do something like a Peter Todd proof-of-solvency to gain the value or is it a "loop through keys" job?


Envrin
Sr. Member
****
Offline Offline

Activity: 318
Merit: 251



View Profile
March 12, 2015, 07:20:39 AM
 #4

One last question, and this is more about client/wallet behavior than anything else and I am probably pushing s*@t up hill.  Given the master private or master public key can you do something like a Peter Todd proof-of-solvency to gain the value or is it a "loop through keys" job?

Public -> Private is basically impossible, so nothing to worry about there, if someone gets your public key.

Private -> Private is obviously possible though.  More than likely they would just loop through the keys.

As a side note, make sure whatever you're using to sign transactions is legit.  If you sign your transactions using malicious code that specifies the nonce to use for signing, then yeah, they'll be able to obtain your private key after gathering some signatures from the blockchain.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!