5

I'm just assuming that the wallet.dat file created by the reference client contains just one private key. (Correct me if I'm wrong here)

I want to know if the client generates additional private keys and if so, under what circumstances? Does a keypoolrefill affect the quantity of private keys? Does generating a given number of addresses cause an additional private key to be generated? etc...

7

When a wallet is created, it contains 100 keys in its "key pool". Only one of them is made visible, but when you create a new address, it actually just takes one key from the pool. The reason for this is so you don't need to backup your wallet.dat file after every transaction or new address,

New keys are generated every time one is pulled from the key pool, if possible, to keep the key pool at size 100. In an encrypted wallet, the passphrase is required to store new keys, so the key pool is only filled when the wallet gets unlocked.

  • So then, is it a certainty that one private key has just one public key associated with it? – smickles Nov 25 '12 at 18:08
  • 1
    Every EC private key has exactly one EC public key associated with it. This public key can be serialized in compressed or uncompressed form, though, and as the address is derived from the hash of the serialized public key, there are really two addresses for every private/public key. In Bitcoin we solve this by separating all of them: the private keys get a marker byte, and we consider the compressed and uncompressed public key to be separate. – Pieter Wuille Nov 27 '12 at 11:03
  • what does EC stand for? – knocte May 31 '16 at 11:25
  • Elliptic Curve. – Pieter Wuille May 31 '16 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.