how does bitcoin core generate addresses and where can they be found in the data directory?

  • To generate addresses or to save the ones generated? Maybe you are talking about the wallet file itself.
    – Osias Jota
    Commented Mar 22, 2018 at 10:52

1 Answer 1


Bitcoin addresses can be created anywhere with any programming language. they're just like the result of 1 + 1 = 2.

if you are looking for the function they're using for getting a new address here you go: https://github.com/bitcoin/bitcoin/blob/4ad3b3c72c73d61e0a0cab541dca20acf651320d/src/wallet/rpcwallet.cpp#L135

When you make RPC call 'getnewaddress' that function will be called, and addresses keys are already generated (keypool) and saved into wallet.dat file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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