Been following this guide just to tinker around with bitcoind over tor. According to the guide, when bitcoind controls the tor daemon using controlport=9051 whenever you restart bitcoind tor should generate a new .onion address. This is not happening. If I restart bitcoind, tor or both, it always uses the same old .onion address. A fully system restart doesn't work either.

how do I generate a new .onion address?

Note: I am NOT using /blah/var/hidden_service and cannot just delete the private key in that folder. When using controlport there doesn't seem to be a private key anywhere. Or is there?

1 Answer 1


bitcoind will cache the private key used. It is located at in the onion_private_key file in your bitcoind data directory (default will be ~/.bitcoin/onion_private_key). Delete that file and you should get a new onion private key and thus a new onion URL.

  • Perfect. How is this not documented anywhere. I've been searching high and low. Even TOR's official manual/guide says it will generate a new .onion when bitcoind reboots
    – Mike
    Commented Dec 5, 2018 at 2:40
  • 1
    It's mentioned here: github.com/bitcoin/bitcoin/blob/master/doc/files.md, but I agree that the documentation could use some work.
    – Ava Chow
    Commented Dec 5, 2018 at 4:46

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.