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?

1 Answer 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 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.

  • tor is running on a separate machine. So I cannot do this. Feb 10, 2018 at 8:27
  • @jdejesus068 I have extended my answer. Hope it helps.
    – Willtech
    Feb 10, 2018 at 9:29

Your Answer

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

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