<p>You need a way for an onion service to be created, connected to and advertised. Usually, with Tor running on the same machine, just start bitcoind with the following option should do it depending if your installed versions of Tor and Bitcoin Core are new enough:</p>

<pre><code>&gt;bitcoind -listenonion
</code></pre>

<p>You may also need to override <code>-bind=</code>, <code>-discover=</code>, <code>listen=</code> and <code>-externalip=</code> after that to suit your exact configuration. </p>

<hr>

<p>Of course, the setup in your question is a little different to standard. What you will need to do is: </p>

<ol>
<li>Bind your bitcoind to the network IP of the machine it is running on. It probably is already but, you can use <code>-bind=</code> if necessary.</li>
<li>Ensure the firewall on your bitcoind machine will allow incoming connections to the bitcoind service from your Tor router. With firewall configuration, it is always best to be specific.</li>
<li><p>Setup the onion service on your Tor router and point it to your bitcoind machine. Make a note of your onion service name.</p>

<ol>
<li><p>Ordinarily, you should be able to add the following lines to the <code>/etc/tor/torrc</code> file:</p>

<pre><code>HiddenServiceDir /var/lib/tor/bitcoin-service/
HiddenServicePort 8333 {machine IP of bitcoind}:{mainnet port}
HiddenServicePort 18333 {machine IP of bitcoind}:{testnet port}
</code></pre>

<p>*<em>Note that I have not tested this setup and presume Tor will allow you to specify the IP of your network machine running bitcoind</em></p></li>
</ol></li>
<li>You may consider adding 8333 to the <code>LongLivedPorts</code> parameter in your permanent Tor config and restart Tor unless you have a live configuration editor like <a href="https://nyx.torproject.org/" rel="nofollow noreferrer">nyx</a> to also change it on the hop.</li>
<li>Configure bitcoind to use and advertise the onion address for incoming connections. You can use <code>-externalip={onion}</code>. I am not sure if you can or if you need to specify this multiple times, for any standard IPv4/IPv6 external incoming addresses also.</li>
<li>You may also consider using <code>-discover=1</code> since you are not trying to hide your standard external IP addresses I presume.</li>
</ol>

<p>In bitcoin-qt, you can see the command line options and their descriptions in the help menu.</p>

CC BY-SA 3.0
2018-02-10T08:27:52.897Z
tor is running on a separate machine.  So I cannot do this.
jdejesus068
CC BY-SA 3.0
2018-02-10T09:29:35.447Z
@jdejesus068 I have extended my answer. Hope it helps.
Willtech
CC BY-SA 3.0
2018-02-10T08:02:31.417Z
2018-02-10T09:35:45.693Z
2018-02-10T09:35:45.693Z
Willtech
<p>I would like to get Bitcoind to advertise that it is listening on an onion address.  However, I do not want to have Bitcoind use a tor socks proxy to connect.  I have a special router for tor connections and the Bitcoind server uses that as its network gateway.  How do I get bitcoind to advertise an onion address without setting a socks proxy?</p>

<bitcoind><tor>
bitcoind and onion listening
jdejesus068
# bitcoind and onion listening

(Asked by: username_0 on 2016-07-27)

I would like to get Bitcoind to advertise that it is listening on an onion address. However, I do not want to have Bitcoind use a tor socks proxy to connect. I have a special router for tor connections and the Bitcoind server uses that as its network gateway. How do I get bitcoind to advertise an onion address without setting a socks proxy?

**Tags:** bitcoind, tor


---

## 1 answers

### Answer by username_1 on 2018-02-10. Score: 1

You need a way for an onion service to be created, connected to and advertised. Usually, with Tor running on the same machine, just start bitcoind with the following option should do it depending if your installed versions of Tor and Bitcoin Core are new enough:

```
>bitcoind -listenonion

```

You may also need to override `-bind=`, `-discover=`, `listen=` and `-externalip=` after that to suit your exact configuration.

---

Of course, the setup in your question is a little different to standard. What you will need to do is:

1. Bind your bitcoind to the network IP of the machine it is running on. It probably is already but, you can use `-bind=` if necessary.
2. Ensure the firewall on your bitcoind machine will allow incoming connections to the bitcoind service from your Tor router. With firewall configuration, it is always best to be specific.
3. Setup the onion service on your Tor router and point it to your bitcoind machine. Make a note of your onion service name.

   1. Ordinarily, you should be able to add the following lines to the `/etc/tor/torrc` file:

      ```
      HiddenServiceDir /var/lib/tor/bitcoin-service/
      HiddenServicePort 8333 {machine IP of bitcoind}:{mainnet port}
      HiddenServicePort 18333 {machine IP of bitcoind}:{testnet port}

      ```

      \**Note that I have not tested this setup and presume Tor will allow you to specify the IP of your network machine running bitcoind*
4. You may consider adding 8333 to the `LongLivedPorts` parameter in your permanent Tor config and restart Tor unless you have a live configuration editor like [nyx](https://nyx.torproject.org/) to also change it on the hop.
5. Configure bitcoind to use and advertise the onion address for incoming connections. You can use `-externalip={onion}`. I am not sure if you can or if you need to specify this multiple times, for any standard IPv4/IPv6 external incoming addresses also.
6. You may also consider using `-discover=1` since you are not trying to hide your standard external IP addresses I presume.

In bitcoin-qt, you can see the command line options and their descriptions in the help menu.

> **Comments:**
> **username_0**: tor is running on a separate machine.  So I cannot do this.  
> **username_1**: @username_0 I have extended my answer. Hope it helps.  

---

