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

CC BY-SA 4.0
2018-12-05T02:40:21.790Z
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
CC BY-SA 4.0
2018-12-05T04:46:35.850Z
It's mentioned here: https://github.com/bitcoin/bitcoin/blob/master/doc/files.md, but I agree that the documentation could use some work.
Ava Chow
CC BY-SA 4.0
2018-12-04T16:44:33.287Z
2018-12-04T16:44:33.287Z
Ava Chow
<p>Been following <a href="https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service" rel="nofollow noreferrer">this guide</a> 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.</p>

<p>how do I generate a new .onion address?</p>

<p>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?</p>

<bitcoind><tor>
Generate new .onion address for bitcoind over tor
Mike
# Generate new .onion address for bitcoind over tor

(Asked by: username_0 on 2018-12-04)

Been following [this guide](https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service) 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?

**Tags:** bitcoind, tor


---

## 1 answers

### Answer by username_1 on 2018-12-04. Score: 2 | Accepted answer

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.

> **Comments:**
> **username_0**: 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  
> **username_1**: It's mentioned here: https://github.com/bitcoin/bitcoin/blob/master/doc/files.md, but I agree that the documentation could use some work.  

---

