<p>There has been some discussion today before the Bitcoin Core PR review club <a href="https://bitcoincore.reviews/19845" rel="nofollow noreferrer">session</a> on the subject of <a href="https://github.com/bitcoin/bitcoin/issues/18884" rel="nofollow noreferrer">Tor v3 support</a>. I haven't been through the above answers to comment on whether any of it needs updating.</p>
<p>But Jon Atack pointed out on IRC some good additional resources on getting started with Tor. There is the Bitcoin <a href="https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service" rel="nofollow noreferrer">wiki</a> and the Bitcoin Core <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md" rel="nofollow noreferrer">documentation</a>.</p>
<p>He also explained how you can build and run a Tor v3 service using this draft <a href="https://github.com/bitcoin/bitcoin/pull/19954" rel="nofollow noreferrer">PR 19954</a> (draft at the time of the writing, September 2020).</p>
<p>If you have Tor configured and running, Bitcoin will automatically create a Tor service even with the default settings. You can get <code>debug.log</code> info on your Tor status by setting <code>debug=tor</code> in your <code>bitcoin.conf</code> file or by launching <code>bitcoind -debug=tor</code></p>
<p>You can observe your node with:</p>
<p>MacOS</p>
<pre><code>./src/bitcoin-cli -netinfo 4
</code></pre>
<p>Linux</p>
<pre><code>watch ./src/bitcoin-cli -netinfo 4
</code></pre>

CC BY-SA 4.0
2020-09-16T16:23:48.323Z
2020-09-17T10:07:05.583Z
2020-09-17T10:07:05.583Z
Michael Folkson
<p>Here is a simple guide on how to build and run your own home node behind a tor.</p>

<p><a href="https://github.com/bitembassy/home-node" rel="nofollow noreferrer">https://github.com/bitembassy/home-node</a></p>

CC BY-SA 4.0
2019-04-25T23:46:17.550Z
2019-04-26T08:15:09.853Z
2019-04-26T08:15:09.853Z
Adys
<p>There is a <a href="https://bennybackslash.github.io/%2Fposts%2FTorctl%20on%20Arch.html" rel="nofollow noreferrer">pretty straight forward way</a> to get system-wide TOR for arch linux. It might be worth to setup an encrypted arch linux VM with TOR and then proceed to use <a href="https://aur.archlinux.org/packages/bitcoin-core/" rel="nofollow noreferrer">bitcoin-core</a> from the AUR.</p>

CC BY-SA 4.0
2021-05-24T23:14:01.310Z
2021-05-24T23:14:01.310Z
Martin Braun
<p><em>This is not a thorough schooling on Tor and only shows how to configure it to work together with Bitcoin Core.</em></p>
<h3>Bitcoin Core includes Tor integration</h3>
<p>When Tor is correctly setup on your system, Bitcoin Core automatically identifies Tor and creates an anonymous service. Little configuration is required to be 'off the grid' and, just a tiny bit more to be completely anonymous if that is important to you, with none of your Bitcoin traffic reaching out onto the public internet.</p>
<p>Using these steps you can be anonymous in only five minutes.</p>
<p>With the full privacy setup, transactions will of course still be broadcast but will only be broadcast actually onto the public internet by other Bitcoin nodes. With the standard 'off-the-grid' Tor setup, your Bitcoin traffic will be routed through the anonymous Tor network before reaching the public internet and other Bitcoin nodes on and off the Tor network to be effectively untraceable.</p>
<h3>Setting Up Bitcoin Core and Tor</h3>
<p>These instructions work on Fedora 23&gt;29 and assume a <a href="https://bitcoin.org/en/full-node#other-linux-distributions" rel="nofollow noreferrer">default setup of Bitcoin Core v0.15.1</a> and Tor v0.2.7.1 or newer (<em>and have been tested to work with Bitcoin Core v0.16.0 on Fedora 27 with Tor v0.3.1.9</em>). Fedora is a modern operating system that will run on most standard modern hardware. The configuration is the same on Windows, but the instructions are different. There are some instructions for setting up Tor on Windows <a href="https://en.bitcoin.it/wiki/Tor" rel="nofollow noreferrer">here</a>.</p>
<p>Further instructions for other *nix based systems are available <a href="https://trac.torproject.org/projects/tor/wiki/TorRelayGuide" rel="nofollow noreferrer">here</a>. <em>NOTE: You do not need to configure your Tor client as a relay or exit node for Tor to operate, so you can skip the step for 'Put the configuration file /etc/tor/torrc place:' in <strong>that</strong> guide. You will still need to use all of the following steps in <strong>this</strong> guide.</em></p>
<ol>
<li><p>Setup Tor</p>
</li>
<li><p>Install the tor package:</p>
<pre><code>   sudo dnf install tor
</code></pre>
</li>
<li><p>Start the tor daemon and make sure it starts at boot:</p>
<pre><code>   sudo systemctl enable tor
   sudo systemctl start tor
</code></pre>
</li>
<li><p>Figure out where your <code>torrc</code> file is (<code>/etc/tor/torrc</code> is one possibility).</p>
</li>
<li><p>Open the <code>torrc</code> file to edit:</p>
<pre><code> xhost +local: ## skip if earlier than v29 only needed for Wayland
 sudo gedit /etc/tor/torrc
</code></pre>
<p><em>or</em></p>
<pre><code> sudo nano /etc/tor/torrc
</code></pre>
</li>
<li><p>Add these lines to your <code>torrc</code> (or ensure that they are uncommented):</p>
<pre><code> ControlPort 9051
 CookieAuthentication 1
 CookieAuthFileGroupReadable 1
</code></pre>
</li>
<li><p>You need to figure out what group tor is using. On Fedora 23 it is <code>toranon</code>. Run the following command:</p>
<pre><code> ps -eo user,group,comm |egrep 'tor' |awk '{print &quot;tor group: &quot; $2}'
</code></pre>
</li>
<li><p>You need to figure out what user bitcoind or bitcoin-qt is running as. Run the following command while Bitcoin is running:</p>
<pre><code> ps -eo user,group,comm |egrep 'bitcoind|bitcoin-qt' |awk '{print &quot;Bitcoin user: &quot; $1}'
</code></pre>
</li>
<li><p>Run the following command as root, which adds your Bitcoin user to the tor group. Replace TOR_GROUP and BITCOIN_USER with the actual information found above:</p>
<pre><code> sudo usermod -a -G TOR_GROUP BITCOIN_USER
</code></pre>
</li>
</ol>
<p>If you don't modify any other settings, Bitcoin Core will usually connect over the regular Internet, but will also allow connections to and from the hidden Tor service.</p>
<ol start="8">
<li><p>So that Bitcoin Core wil only connect via Tor (for standard 'off-the-grid' setup), add these lines to <code>bitcoin.conf</code>. In Bitcoin Core, go to Settings -&gt; Options -&gt; Open Configuration File. Bitcoin Core uses Tor stream isolation by default:</p>
<pre><code> proxy=127.0.0.1:9050 #If you use Windows, this could possibly be 127.0.0.1:9150 in some cases.
 listen=1
 bind=127.0.0.1
</code></pre>
</li>
<li><p>(optional) If you like, you can add some onion service peer nodes to connect to. This will help especially if you do all of the following optional configurations. Add the following lines to your <code>bitcoin.conf</code> file. Bitcoin Core will only connect to a maximum of eight of these at any one time randomly, depending which ones are online (Starting with version 22.0, Bitcoin Core only supports Tor version 3 hidden services (Tor v3). Tor v2 addresses are ignored by Bitcoin Core and neither relayed nor stored. A list of Tor v3 addresses can be found <a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt#L648" rel="nofollow noreferrer">here</a>):</p>
<pre><code> #Add seed nodes
 seednode=wxvp2d4rspn7tqyu.onion
 seednode=bk5ejfe56xakvtkk.onion
 seednode=bpdlwholl7rnkrkw.onion
 seednode=hhiv5pnxenvbf4am.onion
 seednode=4iuf2zac6aq3ndrb.onion
 seednode=nkf5e6b7pl4jfd4a.onion
 seednode=xqzfakpeuvrobvpj.onion
 seednode=tsyvzsqwa2kkf6b2.onion

 #And/or add some nodes
 addnode=gyn2vguc35viks2b.onion
 addnode=kvd44sw7skb5folw.onion
 addnode=nkf5e6b7pl4jfd4a.onion
 addnode=yu7sezmixhmyljn4.onion
 addnode=3ffk7iumtx3cegbi.onion
 addnode=3nmbbakinewlgdln.onion
 addnode=4j77gihpokxu2kj4.onion
 addnode=546esc6botbjfbxb.onion
 addnode=5at7sq5nm76xijkd.onion
 addnode=77mx2jsxaoyesz2p.onion
 addnode=7g7j54btiaxhtsiy.onion
 addnode=a6obdgzn67l7exu3.onion
 addnode=ab64h7olpl7qpxci.onion
 addnode=am2a4rahltfuxz6l.onion
 addnode=azuxls4ihrr2mep7.onion
 addnode=bitcoin7bi4op7wb.onion
 addnode=bitcoinostk4e4re.onion
 addnode=bk7yp6epnmcllq72.onion
 addnode=bmutjfrj5btseddb.onion
 addnode=ceeji4qpfs3ms3zc.onion
 addnode=clexmzqio7yhdao4.onion
 addnode=gb5ypqt63du3wfhn.onion
 addnode=h2vlpudzphzqxutd.onion
 addnode=n42h7r6oumcfsbrs.onion:4176
 addnode=ncwk3lutemffcpc4.onion
 addnode=okdzjarwekbshnof.onion
 addnode=pjghcivzkoersesd.onion
 addnode=rw7ocjltix26mefn.onion
 addnode=uws7itep7o3yinxo.onion
 addnode=vk3qjdehyy4dwcxw.onion
 addnode=vqpye2k5rcqvj5mq.onion
 addnode=wpi7rpvhnndl52ee.onion
</code></pre>
</li>
</ol>
<p>If you additionally want Bitcoin Core to only connect out to Tor hidden services and not even to connect to IPv4/IPv6 nodes on the public internet via the Tor network proxy:</p>
<ol start="10">
<li><p>(optional) Also add this to <code>bitcoin.conf</code> for full anonymity (not particularly recommended)<sup>*</sup>:</p>
<pre><code>onlynet=onion
</code></pre>
</li>
</ol>
<p>*<em>Note: Bitcoin Core will still query for peer addresses via DNS lookup if low on addresses. This also can be disabled using the next option. However, it is possible your node may not be able to find any other nodes to connect to.</em></p>
<p>*<em>Note: Bitcoin Core v0.15.1 currently seems to make some outbound IPv4 connections at node startup even when <code>onlynet=onion</code>, none have been observed after initial startup. These connections should be made via your onion proxy, however, using the next option has been observed to prevent them.</em></p>
<ol start="11">
<li><p>(optional) (advanced) If you also want to disable DNS lookup to query for peer addresses then also add the following to <code>bitcoin.conf</code> (not particularly recommended) <em>note: if you use this option your node may be unable to find peers until you add some good peers with the <code>addnode=</code> parameter.</em>:</p>
<pre><code>dnsseed=0
dns=0
</code></pre>
</li>
<li><p>Restart tor:</p>
<pre><code>sudo systemctl stop tor
sudo systemctl start tor
</code></pre>
</li>
<li><p>Log out of your user, log back in (this is so that your new user group permissions are effective, I do not know what user you are running Bitcoin Core on).</p>
</li>
<li><p>Restart Bitcoin Core. Since Tor version 0.2.7.1 and newer the Bitcoin Core GUI version called bitcoin-qt automatically registers your Tor hidden service and makes it reachable on the onion network. For the command line version of Bitcoin Core, bitcoind, add the following parameter to your command line:</p>
<pre><code>&gt;bitcoind -listenonion
</code></pre>
</li>
</ol>
<p>No port forwarding is necessary for everything to work with Tor including incoming connections via the Tor hidden service, you do not need to forward any ports for Bitcoin Core or Tor for this.</p>
<p>If you want your Bitcoin node still publicly reachable via the public internet for incoming connections you will still need to forward port 8333 for Bitcoin Core.</p>
<h3>Checking everything is working</h3>
<p>There are only two things to check that all is working. Checking peer info in the debug window of bitcoin-qt, you should see that connections to IPv4/IPv6 peers now have some extra connected 'via' info along with the peer address when you click on a peer. Onion addresses only route via Tor.</p>
<p>Checking the same thing via console or CLI for <code>getnetworkinfo</code>, you should see for each network type the proxy info and, checking with <code>getpeerinfo</code> you should see that the <code>addrlocal</code> info is a remote address for each peer. Onion peers do not have <code>addrlocal</code> and just have their onion service name for <code>addr</code>.</p>
<p>The second thing to check is that your onion service for inbound Tor connections is up and all configuration is in place. Have a look in your <code>debug.log</code> file, you should see a few entries after the most recent node restart that match the following:</p>
<pre><code>2018-02-10 06:31:48 InitParameterInteraction: parameter interaction: -proxy set -&gt; setting -upnp=0
2018-02-10 06:31:48 InitParameterInteraction: parameter interaction: -proxy set -&gt; setting -discover=0
...
2018-02-10 06:32:13 Bound to 127.0.0.1:8333
...
2018-02-10 06:32:13 torcontrol thread start
2018-02-10 06:32:13 tor: Got service ID {onion}, advertising service {onion}.onion:8333
2018-02-10 06:32:13 AddLocal({onion}.onion:8333,4)
</code></pre>
<p>The <code>advertising service</code> information is your onion service address.</p>
<p>In the <code>debug.log</code>, connections to onion peers will only look like the following but still show up in the peers tab of the debug window on bitcoin-qt:</p>
<pre><code>2018-02-10 06:34:07 receive version message: /Satoshi:0.15.1/: version 70015, blocks=508469, us=[::]:0, peer=7
</code></pre>
<p>It is <strong>not</strong> necessary to configure port forwarding on your modem/router for Tor to operate. If you are behind a restrictive firewall it <em>may</em> be necessary to configure <strong>outbound</strong> connections to allow Tor to connect out to other Tor nodes. Tor can be configured to only connect out using port 80/443 if that helps. See <strong>Appendix 1 - Monitoring Tor</strong> for <code>nyx</code> and access to full Tor configuration options.</p>
<p>It is difficult to be completely anonymous since the sender and the receiver know, however, you can obfuscate your transaction origin so that your data cannot be traced by IP address without breaching the Tor network. Do some research, <code>onlynet=onion</code> is more secure.</p>
<p>Additionally, there has been research<a href="https://graphsense.info/" rel="nofollow noreferrer">[1]</a><a href="https://datalion.com/visualizing-blockchain-7-beautiful-informative-bitcoin-visualizations/" rel="nofollow noreferrer">[2]</a> done on graphing the blockchain in an attempt to trace all BTC to their origin, potentially identifying source&lt;-wallet&lt;-purchase and depending on the combination of UTXOs potentially identifying wallet balances or wallet balance subsets. Data linkage is a privacy issue we may all be concerned about, <a href="https://envisionourfuture.tumblr.com/post/184433625869/future-money-requires-privacy" rel="nofollow noreferrer">this article discusses the use of bitcoin mixers</a>, and this <a href="https://twitter.com/Willtech101/likes" rel="nofollow noreferrer">series of tweets</a>.</p>
<p>Done! Enjoy being anonymous!</p>
<h3>Appendix 1 - Monitoring Tor</h3>
<p>You can monitor (and further tweak/break) Tor using <a href="https://nyx.torproject.org/" rel="nofollow noreferrer">nyx</a>.</p>
<p>There are several installation methods available. On Fedora 27:</p>
<pre><code>sudo dnf install nyx
</code></pre>
<p>To start nyx simply type <code>nyx</code> in the console and it will connect to Tor if it is running.</p>
<h3>Footnotes</h3>
<p>Once correctly configured, most synchronisation issues are to do with your hardware. See <a href="https://bitcoin.stackexchange.com/a/69862/75001">this answer</a> for more information.</p>
<p>There are more configuration options available, and additional ways you can support the Tor network. Please see the several pages available <a href="https://trac.torproject.org/projects/tor/wiki/TorRelayGuide" rel="nofollow noreferrer">here</a> for information.</p>
<p>Thanks to en.bitcoin.it for your excellent <a href="https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service" rel="nofollow noreferrer">guide</a> that got me started on this.</p>
<p>Additional information is available from the bitcoin project <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md" rel="nofollow noreferrer">here</a>.</p>
<p>For an even higher level of anonymity, it is possible to configure Tor as a DNS resolver and, configure your system network configuration to use Tor to resolve DNS queries.</p>
<p>*by default, Tor will participate in the Tor network.</p>

CC BY-SA 3.0
2018-02-03T01:41:42.470Z
Waiting for peer review before marking as accepted.
Willtech
CC BY-SA 3.0
2018-02-03T03:31:31.857Z
If you aren't extremely careful with dns configuration, it can betray the fact that your wallet is communicating with tor-based wallet nodes.  https://tor.stackexchange.com/questions/8/how-does-tor-route-dns-requests
Hannah Vernon
CC BY-SA 3.0
2018-02-03T03:43:13.003Z
@MaxVernon Okay, appreciate the risk. This [answer](https://tor.stackexchange.com/a/26/20857) seems to indicate that Tor handles DNS resolution for requests through the exit node. However, if the client directly resolves DNS I doubt this is handled.  I will need drag out my old network log box to test what is actually happening. Do you think I should re-word the answer? Still, all transaction information is only relayed by Tor so the objective is achieved. Even if it is possible to identify a particular IP is running a Bitcoin wallet and/or Tor the data traffic is unidentifiable.
Willtech
CC BY-SA 3.0
2018-02-03T06:42:18.770Z
@MaxVernon added the option to disable DNS lookups.
Willtech
CC BY-SA 4.0
2018-11-05T17:56:12.427Z
Where did you get this list of tor nodes?
Mr Hash
CC BY-SA 4.0
2018-12-07T02:06:30.307Z
Great guide, thanks! Note that bitcoind saves a file `onion_private_key` in its home folder (default `~/.bitcoin/`). As long as that file is in the bitcoind data folder your `*.onion` address will remain the same, across restarts and reboots. Deleting that file will force bitcoind (or tor) to generate a new `onion_private_key` and thus a new `*.onion`
Mike
CC BY-SA 4.0
2019-04-17T19:27:50.930Z
@MrHash That list comes from the FBI ;-)  You can just [grab your own list from bitnodes](https://bitnodes.earn.com/nodes/?page=6&q=Tor%20network) if you like.  The ones at the end have the best uptime.
Jonathan Cross
CC BY-SA 4.0
2019-11-09T00:10:05.300Z
On ubuntu the tor group command returns 'root' and 'debian-+', but neither of these are groups on the machine, so I can't add the user to these groups.  Not sure what to do.
wordsforthewise
CC BY-SA 4.0
2019-11-15T19:52:59.610Z
@wordsforthewise you should be able to list groups with something like `cut -d: -f1 /etc/group | grep toranon` if group toranon exists use that. It may be the group is debian-tor?
Willtech
CC BY-SA 4.0
2020-11-14T13:57:19.137Z
Could someone elaborate on the error I get: `Issue: Authentication failed: unable to read '/run/tor/control.authcookie' ([Errno 13] Permission denied: '/run/tor/control.authcookie')`. This happens when I try to run it as a normal user. It works fine with `sudo` but then I get: `Nyx is currently running with root permissions. This isn't a good idea, nor hould it be necessary.`
bomben
CC BY-SA 4.0
2020-11-16T12:28:06.773Z
@Ben If you have completed step 7 correctly it should work, unless something is changed on a newer version of Tor I will check it eventually.
Willtech
CC BY-SA 4.0
2018-02-02T13:40:14.513Z
2022-05-10T18:23:45.283Z
2022-05-10T18:23:45.283Z
Willtech
<p>Bitcoin is billed as many things, among them its anonymity is highly regarded. While it is true that a transaction does not identify a user or wallet, <a href="https://bitcointalk.org/index.php?topic=34383.0" rel="noreferrer">recent news</a> shows that there is the potential for privacy to be partially undermined, by an 'educated guess' method that may identify the IP address of a transaction originator.</p>

<p>How do I setup to use Bitcoin completely anonymously using Tor?</p>

<bitcoin-core><bitcoind><client><network><tor>
How can I setup Bitcoin to be anonymous with Tor?
Willtech
# How can I setup Bitcoin to be anonymous with Tor?

(Asked by: username_0 on 2018-02-02)

Bitcoin is billed as many things, among them its anonymity is highly regarded. While it is true that a transaction does not identify a user or wallet, [recent news](https://bitcointalk.org/index.php?topic=34383.0) shows that there is the potential for privacy to be partially undermined, by an 'educated guess' method that may identify the IP address of a transaction originator.

How do I setup to use Bitcoin completely anonymously using Tor?

**Tags:** bitcoin-core, bitcoind, client, network, tor


---

## 4 answers

### Answer by username_0 on 2018-02-02. Score: 36 | Accepted answer

*This is not a thorough schooling on Tor and only shows how to configure it to work together with Bitcoin Core.*

### Bitcoin Core includes Tor integration

When Tor is correctly setup on your system, Bitcoin Core automatically identifies Tor and creates an anonymous service. Little configuration is required to be 'off the grid' and, just a tiny bit more to be completely anonymous if that is important to you, with none of your Bitcoin traffic reaching out onto the public internet.

Using these steps you can be anonymous in only five minutes.

With the full privacy setup, transactions will of course still be broadcast but will only be broadcast actually onto the public internet by other Bitcoin nodes. With the standard 'off-the-grid' Tor setup, your Bitcoin traffic will be routed through the anonymous Tor network before reaching the public internet and other Bitcoin nodes on and off the Tor network to be effectively untraceable.

### Setting Up Bitcoin Core and Tor

These instructions work on Fedora 23>29 and assume a [default setup of Bitcoin Core v0.15.1](https://bitcoin.org/en/full-node#other-linux-distributions) and Tor v0.2.7.1 or newer (*and have been tested to work with Bitcoin Core v0.16.0 on Fedora 27 with Tor v0.3.1.9*). Fedora is a modern operating system that will run on most standard modern hardware. The configuration is the same on Windows, but the instructions are different. There are some instructions for setting up Tor on Windows [here](https://en.bitcoin.it/wiki/Tor).

Further instructions for other \*nix based systems are available [here](https://trac.torproject.org/projects/tor/wiki/TorRelayGuide). *NOTE: You do not need to configure your Tor client as a relay or exit node for Tor to operate, so you can skip the step for 'Put the configuration file /etc/tor/torrc place:' in **that** guide. You will still need to use all of the following steps in **this** guide.*

1. Setup Tor
2. Install the tor package:

   ```
      sudo dnf install tor

   ```
3. Start the tor daemon and make sure it starts at boot:

   ```
      sudo systemctl enable tor
      sudo systemctl start tor

   ```
4. Figure out where your `torrc` file is (`/etc/tor/torrc` is one possibility).
5. Open the `torrc` file to edit:

   ```
    xhost +local: ## skip if earlier than v29 only needed for Wayland
    sudo gedit /etc/tor/torrc

   ```

   *or*

   ```
    sudo nano /etc/tor/torrc

   ```
6. Add these lines to your `torrc` (or ensure that they are uncommented):

   ```
    ControlPort 9051
    CookieAuthentication 1
    CookieAuthFileGroupReadable 1

   ```
7. You need to figure out what group tor is using. On Fedora 23 it is `toranon`. Run the following command:

   ```
    ps -eo user,group,comm |egrep 'tor' |awk '{print "tor group: " $2}'

   ```
8. You need to figure out what user bitcoind or bitcoin-qt is running as. Run the following command while Bitcoin is running:

   ```
    ps -eo user,group,comm |egrep 'bitcoind|bitcoin-qt' |awk '{print "Bitcoin user: " $1}'

   ```
9. Run the following command as root, which adds your Bitcoin user to the tor group. Replace TOR\_GROUP and BITCOIN\_USER with the actual information found above:

   ```
    sudo usermod -a -G TOR_GROUP BITCOIN_USER

   ```

If you don't modify any other settings, Bitcoin Core will usually connect over the regular Internet, but will also allow connections to and from the hidden Tor service.

8. So that Bitcoin Core wil only connect via Tor (for standard 'off-the-grid' setup), add these lines to `bitcoin.conf`. In Bitcoin Core, go to Settings -> Options -> Open Configuration File. Bitcoin Core uses Tor stream isolation by default:

   ```
    proxy=127.0.0.1:9050 #If you use Windows, this could possibly be 127.0.0.1:9150 in some cases.
    listen=1
    bind=127.0.0.1

   ```
9. (optional) If you like, you can add some onion service peer nodes to connect to. This will help especially if you do all of the following optional configurations. Add the following lines to your `bitcoin.conf` file. Bitcoin Core will only connect to a maximum of eight of these at any one time randomly, depending which ones are online (Starting with version 22.0, Bitcoin Core only supports Tor version 3 hidden services (Tor v3). Tor v2 addresses are ignored by Bitcoin Core and neither relayed nor stored. A list of Tor v3 addresses can be found [here](https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt#L648)):

   ```
    #Add seed nodes
    seednode=wxvp2d4rspn7tqyu.onion
    seednode=bk5ejfe56xakvtkk.onion
    seednode=bpdlwholl7rnkrkw.onion
    seednode=hhiv5pnxenvbf4am.onion
    seednode=4iuf2zac6aq3ndrb.onion
    seednode=nkf5e6b7pl4jfd4a.onion
    seednode=xqzfakpeuvrobvpj.onion
    seednode=tsyvzsqwa2kkf6b2.onion

    #And/or add some nodes
    addnode=gyn2vguc35viks2b.onion
    addnode=kvd44sw7skb5folw.onion
    addnode=nkf5e6b7pl4jfd4a.onion
    addnode=yu7sezmixhmyljn4.onion
    addnode=3ffk7iumtx3cegbi.onion
    addnode=3nmbbakinewlgdln.onion
    addnode=4j77gihpokxu2kj4.onion
    addnode=546esc6botbjfbxb.onion
    addnode=5at7sq5nm76xijkd.onion
    addnode=77mx2jsxaoyesz2p.onion
    addnode=7g7j54btiaxhtsiy.onion
    addnode=a6obdgzn67l7exu3.onion
    addnode=ab64h7olpl7qpxci.onion
    addnode=am2a4rahltfuxz6l.onion
    addnode=azuxls4ihrr2mep7.onion
    addnode=bitcoin7bi4op7wb.onion
    addnode=bitcoinostk4e4re.onion
    addnode=bk7yp6epnmcllq72.onion
    addnode=bmutjfrj5btseddb.onion
    addnode=ceeji4qpfs3ms3zc.onion
    addnode=clexmzqio7yhdao4.onion
    addnode=gb5ypqt63du3wfhn.onion
    addnode=h2vlpudzphzqxutd.onion
    addnode=n42h7r6oumcfsbrs.onion:4176
    addnode=ncwk3lutemffcpc4.onion
    addnode=okdzjarwekbshnof.onion
    addnode=pjghcivzkoersesd.onion
    addnode=rw7ocjltix26mefn.onion
    addnode=uws7itep7o3yinxo.onion
    addnode=vk3qjdehyy4dwcxw.onion
    addnode=vqpye2k5rcqvj5mq.onion
    addnode=wpi7rpvhnndl52ee.onion

   ```

If you additionally want Bitcoin Core to only connect out to Tor hidden services and not even to connect to IPv4/IPv6 nodes on the public internet via the Tor network proxy:

10. (optional) Also add this to `bitcoin.conf` for full anonymity (not particularly recommended)\*:

    ```
    onlynet=onion

    ```

\**Note: Bitcoin Core will still query for peer addresses via DNS lookup if low on addresses. This also can be disabled using the next option. However, it is possible your node may not be able to find any other nodes to connect to.*

\**Note: Bitcoin Core v0.15.1 currently seems to make some outbound IPv4 connections at node startup even when `onlynet=onion`, none have been observed after initial startup. These connections should be made via your onion proxy, however, using the next option has been observed to prevent them.*

11. (optional) (advanced) If you also want to disable DNS lookup to query for peer addresses then also add the following to `bitcoin.conf` (not particularly recommended) *note: if you use this option your node may be unable to find peers until you add some good peers with the `addnode=` parameter.*:

    ```
    dnsseed=0
    dns=0

    ```
12. Restart tor:

    ```
    sudo systemctl stop tor
    sudo systemctl start tor

    ```
13. Log out of your user, log back in (this is so that your new user group permissions are effective, I do not know what user you are running Bitcoin Core on).
14. Restart Bitcoin Core. Since Tor version 0.2.7.1 and newer the Bitcoin Core GUI version called bitcoin-qt automatically registers your Tor hidden service and makes it reachable on the onion network. For the command line version of Bitcoin Core, bitcoind, add the following parameter to your command line:

    ```
    >bitcoind -listenonion

    ```

No port forwarding is necessary for everything to work with Tor including incoming connections via the Tor hidden service, you do not need to forward any ports for Bitcoin Core or Tor for this.

If you want your Bitcoin node still publicly reachable via the public internet for incoming connections you will still need to forward port 8333 for Bitcoin Core.

### Checking everything is working

There are only two things to check that all is working. Checking peer info in the debug window of bitcoin-qt, you should see that connections to IPv4/IPv6 peers now have some extra connected 'via' info along with the peer address when you click on a peer. Onion addresses only route via Tor.

Checking the same thing via console or CLI for `getnetworkinfo`, you should see for each network type the proxy info and, checking with `getpeerinfo` you should see that the `addrlocal` info is a remote address for each peer. Onion peers do not have `addrlocal` and just have their onion service name for `addr`.

The second thing to check is that your onion service for inbound Tor connections is up and all configuration is in place. Have a look in your `debug.log` file, you should see a few entries after the most recent node restart that match the following:

```
2018-02-10 06:31:48 InitParameterInteraction: parameter interaction: -proxy set -> setting -upnp=0
2018-02-10 06:31:48 InitParameterInteraction: parameter interaction: -proxy set -> setting -discover=0
...
2018-02-10 06:32:13 Bound to 127.0.0.1:8333
...
2018-02-10 06:32:13 torcontrol thread start
2018-02-10 06:32:13 tor: Got service ID {onion}, advertising service {onion}.onion:8333
2018-02-10 06:32:13 AddLocal({onion}.onion:8333,4)

```

The `advertising service` information is your onion service address.

In the `debug.log`, connections to onion peers will only look like the following but still show up in the peers tab of the debug window on bitcoin-qt:

```
2018-02-10 06:34:07 receive version message: /Satoshi:0.15.1/: version 70015, blocks=508469, us=[::]:0, peer=7

```

It is **not** necessary to configure port forwarding on your modem/router for Tor to operate. If you are behind a restrictive firewall it *may* be necessary to configure **outbound** connections to allow Tor to connect out to other Tor nodes. Tor can be configured to only connect out using port 80/443 if that helps. See **Appendix 1 - Monitoring Tor** for `nyx` and access to full Tor configuration options.

It is difficult to be completely anonymous since the sender and the receiver know, however, you can obfuscate your transaction origin so that your data cannot be traced by IP address without breaching the Tor network. Do some research, `onlynet=onion` is more secure.

Additionally, there has been research[[1]](https://graphsense.info/)[[2]](https://datalion.com/visualizing-blockchain-7-beautiful-informative-bitcoin-visualizations/) done on graphing the blockchain in an attempt to trace all BTC to their origin, potentially identifying source<-wallet<-purchase and depending on the combination of UTXOs potentially identifying wallet balances or wallet balance subsets. Data linkage is a privacy issue we may all be concerned about, [this article discusses the use of bitcoin mixers](https://envisionourfuture.tumblr.com/post/184433625869/future-money-requires-privacy), and this [series of tweets](https://twitter.com/Willtech101/likes).

Done! Enjoy being anonymous!

### Appendix 1 - Monitoring Tor

You can monitor (and further tweak/break) Tor using [nyx](https://nyx.torproject.org/).

There are several installation methods available. On Fedora 27:

```
sudo dnf install nyx

```

To start nyx simply type `nyx` in the console and it will connect to Tor if it is running.

### Footnotes

Once correctly configured, most synchronisation issues are to do with your hardware. See [this answer](https://bitcoin.stackexchange.com/a/69862/75001) for more information.

There are more configuration options available, and additional ways you can support the Tor network. Please see the several pages available [here](https://trac.torproject.org/projects/tor/wiki/TorRelayGuide) for information.

Thanks to en.bitcoin.it for your excellent [guide](https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service) that got me started on this.

Additional information is available from the bitcoin project [here](https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md).

For an even higher level of anonymity, it is possible to configure Tor as a DNS resolver and, configure your system network configuration to use Tor to resolve DNS queries.

\*by default, Tor will participate in the Tor network.

> **Comments:**
> **username_0**: Waiting for peer review before marking as accepted.  
> **username_4**: If you aren't extremely careful with dns configuration, it can betray the fact that your wallet is communicating with tor-based wallet nodes.  https://tor.stackexchange.com/questions/8/how-does-tor-route-dns-requests  
> **username_0**: @MaxVernon Okay, appreciate the risk. This [answer](https://tor.stackexchange.com/a/26/20857) seems to indicate that Tor handles DNS resolution for requests through the exit node. However, if the client directly resolves DNS I doubt this is handled.  I will need drag out my old network log box to test what is actually happening. Do you think I should re-word the answer? Still, all transaction information is only relayed by Tor so the objective is achieved. Even if it is possible to identify a particular IP is running a Bitcoin wallet and/or Tor the data traffic is unidentifiable.  
> **username_0**: @MaxVernon added the option to disable DNS lookups.  
> **username_5**: Where did you get this list of tor nodes?  
> **username_6**: Great guide, thanks! Note that bitcoind saves a file `onion_private_key` in its home folder (default `~/.bitcoin/`). As long as that file is in the bitcoind data folder your `*.onion` address will remain the same, across restarts and reboots. Deleting that file will force bitcoind (or tor) to generate a new `onion_private_key` and thus a new `*.onion`  
> **username_7**: @username_5 That list comes from the FBI ;-)  You can just [grab your own list from bitnodes](https://bitnodes.earn.com/nodes/?page=6&q=Tor%20network) if you like.  The ones at the end have the best uptime.  
> **username_8**: On ubuntu the tor group command returns 'root' and 'debian-+', but neither of these are groups on the machine, so I can't add the user to these groups.  Not sure what to do.  
> **username_0**: @username_8 you should be able to list groups with something like `cut -d: -f1 /etc/group | grep toranon` if group toranon exists use that. It may be the group is debian-tor?  
> **username_9**: Could someone elaborate on the error I get: `Issue: Authentication failed: unable to read '/run/tor/control.authcookie' ([Errno 13] Permission denied: '/run/tor/control.authcookie')`. This happens when I try to run it as a normal user. It works fine with `sudo` but then I get: `Nyx is currently running with root permissions. This isn't a good idea, nor hould it be necessary.`  
> **username_0**: @Ben If you have completed step 7 correctly it should work, unless something is changed on a newer version of Tor I will check it eventually.  

---

### Answer by username_1 on 2020-09-16. Score: 1

There has been some discussion today before the Bitcoin Core PR review club [session](https://bitcoincore.reviews/19845) on the subject of [Tor v3 support](https://github.com/bitcoin/bitcoin/issues/18884). I haven't been through the above answers to comment on whether any of it needs updating.

But Jon Atack pointed out on IRC some good additional resources on getting started with Tor. There is the Bitcoin [wiki](https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service) and the Bitcoin Core [documentation](https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md).

He also explained how you can build and run a Tor v3 service using this draft [PR 19954](https://github.com/bitcoin/bitcoin/pull/19954) (draft at the time of the writing, September 2020).

If you have Tor configured and running, Bitcoin will automatically create a Tor service even with the default settings. You can get `debug.log` info on your Tor status by setting `debug=tor` in your `bitcoin.conf` file or by launching `bitcoind -debug=tor`

You can observe your node with:

MacOS

```
./src/bitcoin-cli -netinfo 4

```

Linux

```
watch ./src/bitcoin-cli -netinfo 4

```


---

### Answer by username_2 on 2019-04-25. Score: 1

Here is a simple guide on how to build and run your own home node behind a tor.

<https://github.com/bitembassy/home-node>


---

### Answer by username_3 on 2021-05-24. Score: 0

There is a [pretty straight forward way](https://bennybackslash.github.io/%2Fposts%2FTorctl%20on%20Arch.html) to get system-wide TOR for arch linux. It might be worth to setup an encrypted arch linux VM with TOR and then proceed to use [bitcoin-core](https://aur.archlinux.org/packages/bitcoin-core/) from the AUR.


---

