Are keys generated deterministically?

…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.

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

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.

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.

1 Like

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.

You shouldn’t run same wallet.dat in multiple computers, especially for incoming transactions. Gavin suggested that it might lead to problems:

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

1 Like

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:

[Wallet] Add simplest BIP32/deterministic key generation implementation by jonasschnelli · Pull Request #8035 · bitcoin/bitcoin · GitHub