I downloaded bitcoin core from github. Now I have imported the complete blockchain and am examining the bitcoin core interface. If I click on >File >>Receiving addresses I see that bitcoin core has already created a receiving address for me. I have not yet chosen a private key (as far as I know) so how can bitcoin core generate a receiving address? How is the receiving address created?
2 Answers
When the wallet initializes, it will generate a master private key for the you as part of the initialization. All subsequently generated keypairs will be related to the master private key, this is called a 'Hierarchical Deterministic' Wallet (HD wallet).
An HD wallet is nice, because you only need to backup the seed phrase that generates your master private key, rather than backup every individual address.
Bitcoin core automatically generates your private keys (or if it's an HD wallet, your seed) when you first use it, and stores them in a file called wallet.dat
in your data directory. You don't choose private keys, software generates them for you cryptographically. For this reason, if you're using Bitcoin Core it's a good idea to encrypt your wallet (but don't lose the passphrase!) and backup your wallet.dat file.