Are keys generated deterministically?


#1

...or does the wallet "roll dice" each time to create a new address?

In other words, does the current client implement HD wallets?

Thank you.


#2

Current Zcash implementation is based on Bitcoin Core 0.11.2 which means no HD wallet.


#3

That is really weird then.

I installed zcash on a server. Took an image of the server. Then copied that image over to three other servers.

Then I told each of the three new servers (along with the original one) to generate 5 new addresses each. Each machine generated exactly the same 5 new addresses in exactly the same order.


#4

This behaviour is inherited from Bitcoin. On the first launch of bitcoind/zcashd, a keypool is filled with keys. If you took an image of the main server after you had launched zcashd, this would explain why the other three servers are retrieving the same addresses from the keypool.


#5

Okay, that makes sense. So then if I kept creating new addresses on each of the servers, I would expect to see each server generating different addresses after the initial keypool were exhausted.


Mining to the same wallet
#6

You shouldn't run same wallet.dat in multiple computers, especially for incoming transactions. Gavin suggested that it might lead to problems:
https://bitcointalk.org/index.php?topic=5324.0

Bitcoin Core is bad wallet, because it is actually a node software.


#7

Yeah, that's the "divergin keypool" issue.
However, I think a recent merge solves these problems. It seems core has finally implemented HD wallets :slight_smile:

https://github.com/bitcoin/bitcoin/pull/8035