<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cavemansalem</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cavemansalem"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Cavemansalem"/>
	<updated>2026-04-11T12:56:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65987</id>
		<title>Setting up a Tor hidden service</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65987"/>
		<updated>2018-12-21T19:02:04Z</updated>

		<summary type="html">&lt;p&gt;Cavemansalem: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you use a Bitcoin [[full node]] over Tor, then usually it will only be able to make outgoing connections. Therefore, you will only get a maximum of 8 total connections. This is fine, and is not something you usually need to worry about, but if your computer is often online and you want to be a big help to the network, you can run a Tor hidden service in order to accept incoming connections over Tor.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to forward port 8333 when using a Tor hidden service. The hidden service will cause most firewalls and NAT setups to be bypassed. For this reason, running a Tor hidden service is also a good idea if you want incoming connections but are for some reason unable to forward port 8333.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for Linux. It is possible to do on Windows, but the instructions would be rather different. (If you&#039;ve done it on Windows, consider adding the instructions to this page.)&lt;br /&gt;
&lt;br /&gt;
You need Tor (at least version 0.2.7.1). Figure out where your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt; file is (&amp;lt;tt&amp;gt;/etc/tor/torrc&amp;lt;/tt&amp;gt; is one possibility). This guide assumes default Tor settings. This guide assumes that Tor is running under the user and group &amp;lt;tt&amp;gt;tor&amp;lt;/tt&amp;gt;, which will usually be the case if you install Tor using your distro&#039;s package manager. Note that Bitcoin &#039;&#039;&#039;does not&#039;&#039;&#039; support hidden service version 3 (ie. long onion addresses).&lt;br /&gt;
&lt;br /&gt;
You need Bitcoin Core (or similar). For method 1, you need at least version 0.12.0. Find &amp;lt;tt&amp;gt;bitcoin.conf&amp;lt;/tt&amp;gt; in your [[data directory]].&lt;br /&gt;
&lt;br /&gt;
=== Method 1 (recommended) ===&lt;br /&gt;
&lt;br /&gt;
This sets up an automatic hidden service that is initiated by Bitcoin Core. On the first startup of &amp;lt;tt&amp;gt;bitcoind&amp;lt;/tt&amp;gt; after configuring Bitcoin Core to use Tor ControlPort as follows, Bitcoin Core will generate a file called &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; in the [[data directory]]. The file &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; contains the private key needed to generate your unique &amp;lt;tt&amp;gt;XXXXXXX.onion&amp;lt;/tt&amp;gt; address. KEEP THIS SAFE. If someone copies this file they can run a server with your .onion address. Also, if you delete this file, the next time bitcoind loads it will generate a new key file and &amp;lt;tt&amp;gt;xxxxxxxx.onion&amp;lt;/tt&amp;gt; address. Note that while a malicious party cannot necessarily associate the server with you as a person, as long as your server has the same xxxx.onion address they will know it is run by the same person. For absolute security delete &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; at each reboot or some frequent interval.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ControlPort 9051&lt;br /&gt;
CookieAuthentication 1&lt;br /&gt;
CookieAuthFileGroupReadable 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to figure out what user bitcoind or bitcoin-qt is running as. Run the following command while Bitcoin is running:&lt;br /&gt;
&amp;lt;pre&amp;gt;ps -eo user,group,comm |egrep &#039;bitcoind|bitcoin-qt&#039; |awk &#039;{print &amp;quot;Bitcoin user: &amp;quot; $1}&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Write down the reported user.&lt;br /&gt;
&lt;br /&gt;
Run the following command as root, which adds your Bitcoin user to the tor group. Replace BITCOIN_USER with the actual user name found above:&lt;br /&gt;
&amp;lt;pre&amp;gt;usermod -a -G tor BITCOIN_USER&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point your node will work over Tor without further configuartion. Bitcoin Core v0.12 and later automatically tries to connect to Tor via the ControlPort if &amp;lt;tt&amp;gt;listen=1&amp;lt;/tt&amp;gt; is set in &amp;lt;tt&amp;gt;bitcoin.conf&amp;lt;/tt&amp;gt;. By default Bitcoin Core will usually connect over the regular Internet as well as allow connections to and from the Tor hidden service. This will help other users who wish to submit transactions to the bitcoin network securely and obscurely, but transactions you submit could theoretically be traced back to your ip address. If you want Bitcoin Core to only connect via Tor (for anonymity), add these lines to bitcoin.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Doing so will make your specific bitcoind node arguably more secure because it will never have an unencrypted connection to another node, but if everyone used &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt; nobody on the onion bitcoin chain would be able to communicate with the clearnet chain. It is essential that some nodes access both clearnet and Tor. If you need to submit bitcoin transactions to the network with the highest level of obscurity, use &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt;. If you only wish to give access to your node to other Tor users, do not use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now restart Tor, and then Bitcoin Core. At some point during startup in &amp;lt;tt&amp;gt;~/.bitcoin/debug.log&amp;lt;/tt&amp;gt; you will see &lt;br /&gt;
&amp;lt;pre&amp;gt;tor: Got service ID XXXXXXXXXXX, advertising service XXXXXXXXXXX.onion:8333&amp;lt;/pre&amp;gt; This is the .onion address of your server. You should eventually get incoming connections via the hidden service.&lt;br /&gt;
&lt;br /&gt;
=== Method 2 ===&lt;br /&gt;
&lt;br /&gt;
This sets up a manual hidden service controlled by the tor daemon. The hidden service address (xxxx.onion). Note that as in method 1, your xxxxx.onion address will stay the same until you delete your key file. Someone tracking you can&#039;t necessarily associate the xxxx.onion with you, but they will know it is run by the same person or entity.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;HiddenServiceDir /var/lib/tor/bitcoin-service/&lt;br /&gt;
HiddenServicePort 8333 127.0.0.1:8333&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Tor. As root, run &amp;lt;tt&amp;gt;cat /var/lib/tor/bitcoin-service/hostname&amp;lt;/tt&amp;gt;. Your onion address will be reported. If it didn&#039;t work, then probably your distro&#039;s version of Tor doesn&#039;t actually use &amp;lt;tt&amp;gt;/var/lib/tor&amp;lt;/tt&amp;gt; for this purpose. You should try to figure out the correct HiddenServiceDir location.&lt;br /&gt;
&lt;br /&gt;
In the following steps, replace ONION_ADDR with the onion address reported above.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t care about anonymity and are only looking to help the network, add the following lines to bitcoin.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;onion=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
externalip=ONION_ADDR&lt;br /&gt;
discover=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will allow you to accept connections both via your onion address and your IP address (if you have port 8333 forwarded), and Tor will only be used for connections to and from Tor hidden services.&lt;br /&gt;
&lt;br /&gt;
If you care about anonymity, &#039;&#039;&#039;instead&#039;&#039;&#039; of the above, add the following lines to bitcoin.conf to use Tor for everything:&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&lt;br /&gt;
externalip=ONION_ADDR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Bitcoin Core. You should eventually get incoming connections via your hidden service.&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>Cavemansalem</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65986</id>
		<title>Setting up a Tor hidden service</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65986"/>
		<updated>2018-12-21T16:56:53Z</updated>

		<summary type="html">&lt;p&gt;Cavemansalem: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you use a Bitcoin [[full node]] over Tor, then usually it will only be able to make outgoing connections. Therefore, you will only get a maximum of 8 total connections. This is fine, and is not something you usually need to worry about, but if your computer is often online and you want to be a big help to the network, you can run a Tor hidden service in order to accept incoming connections over Tor.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to forward port 8333 when using a Tor hidden service. The hidden service will cause most firewalls and NAT setups to be bypassed. For this reason, running a Tor hidden service is also a good idea if you want incoming connections but are for some reason unable to forward port 8333.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for Linux. It is possible to do on Windows, but the instructions would be rather different. (If you&#039;ve done it on Windows, consider adding the instructions to this page.)&lt;br /&gt;
&lt;br /&gt;
You need Tor (at least version 0.2.7.1). Figure out where your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt; file is (&amp;lt;tt&amp;gt;/etc/tor/torrc&amp;lt;/tt&amp;gt; is one possibility). This guide assumes default Tor settings. This guide assumes that Tor is running under the user and group &amp;lt;tt&amp;gt;tor&amp;lt;/tt&amp;gt;, which will usually be the case if you install Tor using your distro&#039;s package manager. Note that Bitcoin &#039;&#039;&#039;does not&#039;&#039;&#039; support hidden service version 3 (ie. long onion addresses).&lt;br /&gt;
&lt;br /&gt;
You need Bitcoin Core (or similar). For method 1, you need at least version 0.12.0. Find &amp;lt;tt&amp;gt;bitcoin.conf&amp;lt;/tt&amp;gt; in your [[data directory]].&lt;br /&gt;
&lt;br /&gt;
=== Method 1 (recommended) ===&lt;br /&gt;
&lt;br /&gt;
This sets up an automatic hidden service that is initiated by Bitcoin Core. On the first startup of &amp;lt;tt&amp;gt;bitcoind&amp;lt;/tt&amp;gt; after configuring Bitcoin Core to use Tor ControlPort as follows, Bitcoin Core will generate a file called &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; in the [[data directory]]. The file &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; contains the private key needed to generate your unique &amp;lt;tt&amp;gt;XXXXXXX.onion&amp;lt;/tt&amp;gt; address. KEEP THIS SAFE. If someone copies this file they can run a server with your .onion address. Also, if you delete this file, the next time bitcoind loads it will generate a new key file and &amp;lt;tt&amp;gt;xxxxxxxx.onion&amp;lt;/tt&amp;gt; address. Note that while a malicious party cannot necessarily associate the server with you as a person, as long as your server has the same xxxx.onion address they will know it is run by the same person. For absolute security delete &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; at each reboot or some frequent interval.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ControlPort 9051&lt;br /&gt;
CookieAuthentication 1&lt;br /&gt;
CookieAuthFileGroupReadable 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to figure out what user bitcoind or bitcoin-qt is running as. Run the following command while Bitcoin is running:&lt;br /&gt;
&amp;lt;pre&amp;gt;ps -eo user,group,comm |egrep &#039;bitcoind|bitcoin-qt&#039; |awk &#039;{print &amp;quot;Bitcoin user: &amp;quot; $1}&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Write down the reported user.&lt;br /&gt;
&lt;br /&gt;
Run the following command as root, which adds your Bitcoin user to the tor group. Replace BITCOIN_USER with the actual user name found above:&lt;br /&gt;
&amp;lt;pre&amp;gt;usermod -a -G tor BITCOIN_USER&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit bitcoin.conf and add the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;listenonion=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t modify any other settings, Bitcoin Core will usually connect over the regular Internet, but will also allow connections to and from the hidden service. This will help other users who wish to submit transactions to the bitcoin network securely and obscurely, but transactions you submit could theoretically be traced back to your ip address. If you want Bitcoin Core to only connect via Tor (for anonymity), add these lines to bitcoin.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Doing so will make your specific bitcoind node arguably more secure because it will never have an unencrypted connection to another node, but if everyone used &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt; nobody on the onion bitcoin chain would be able to communicate with the clearnet chain. It is essential that some nodes access both clearnet and Tor. If you need to submit bitcoin transactions to the network with the highest level of obscurity, use &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt;. If you only wish to give access to your node to other Tor users, do not use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now restart Tor, and then Bitcoin Core. At some point during startup in &amp;lt;tt&amp;gt;~/.bitcoin/debug.log&amp;lt;/tt&amp;gt; you will see &lt;br /&gt;
&amp;lt;pre&amp;gt;tor: Got service ID XXXXXXXXXXX, advertising service XXXXXXXXXXX.onion:8333&amp;lt;/pre&amp;gt; This is the .onion address of your server. You should eventually get incoming connections via the hidden service.&lt;br /&gt;
&lt;br /&gt;
=== Method 2 ===&lt;br /&gt;
&lt;br /&gt;
This sets up a manual hidden service controlled by the tor daemon. The hidden service address (xxxx.onion). Note that as in method 1, your xxxxx.onion address will stay the same until you delete your key file. Someone tracking you can&#039;t necessarily associate the xxxx.onion with you, but they will know it is run by the same person or entity.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;HiddenServiceDir /var/lib/tor/bitcoin-service/&lt;br /&gt;
HiddenServicePort 8333 127.0.0.1:8333&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Tor. As root, run &amp;lt;tt&amp;gt;cat /var/lib/tor/bitcoin-service/hostname&amp;lt;/tt&amp;gt;. Your onion address will be reported. If it didn&#039;t work, then probably your distro&#039;s version of Tor doesn&#039;t actually use &amp;lt;tt&amp;gt;/var/lib/tor&amp;lt;/tt&amp;gt; for this purpose. You should try to figure out the correct HiddenServiceDir location.&lt;br /&gt;
&lt;br /&gt;
In the following steps, replace ONION_ADDR with the onion address reported above.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t care about anonymity and are only looking to help the network, add the following lines to bitcoin.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;onion=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
externalip=ONION_ADDR&lt;br /&gt;
discover=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will allow you to accept connections both via your onion address and your IP address (if you have port 8333 forwarded), and Tor will only be used for connections to and from Tor hidden services.&lt;br /&gt;
&lt;br /&gt;
If you care about anonymity, &#039;&#039;&#039;instead&#039;&#039;&#039; of the above, add the following lines to bitcoin.conf to use Tor for everything:&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&lt;br /&gt;
externalip=ONION_ADDR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Bitcoin Core. You should eventually get incoming connections via your hidden service.&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>Cavemansalem</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65985</id>
		<title>Setting up a Tor hidden service</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65985"/>
		<updated>2018-12-21T15:20:00Z</updated>

		<summary type="html">&lt;p&gt;Cavemansalem: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you use a Bitcoin [[full node]] over Tor, then usually it will only be able to make outgoing connections. Therefore, you will only get a maximum of 8 total connections. This is fine, and is not something you usually need to worry about, but if your computer is often online and you want to be a big help to the network, you can run a Tor hidden service in order to accept incoming connections over Tor.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to forward port 8333 when using a Tor hidden service. The hidden service will cause most firewalls and NAT setups to be bypassed. For this reason, running a Tor hidden service is also a good idea if you want incoming connections but are for some reason unable to forward port 8333.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for Linux. It is possible to do on Windows, but the instructions would be rather different. (If you&#039;ve done it on Windows, consider adding the instructions to this page.)&lt;br /&gt;
&lt;br /&gt;
You need Tor (at least version 0.2.7.1). Figure out where your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt; file is (&amp;lt;tt&amp;gt;/etc/tor/torrc&amp;lt;/tt&amp;gt; is one possibility). This guide assumes default Tor settings. This guide assumes that Tor is running under the user and group &amp;lt;tt&amp;gt;tor&amp;lt;/tt&amp;gt;, which will usually be the case if you install Tor using your distro&#039;s package manager. Note that Bitcoin &#039;&#039;&#039;does not&#039;&#039;&#039; support hidden service version 3 (ie. long onion addresses).&lt;br /&gt;
&lt;br /&gt;
You need Bitcoin Core (or similar). For method 1, you need at least version 0.12.0. Find &amp;lt;tt&amp;gt;bitcoin.conf&amp;lt;/tt&amp;gt; in your [[data directory]].&lt;br /&gt;
&lt;br /&gt;
=== Method 1 (recommended) ===&lt;br /&gt;
&lt;br /&gt;
This sets up an automatic hidden service that is initiated by Bitcoin Core. On the first startup of &amp;lt;tt&amp;gt;bitcoind&amp;lt;/tt&amp;gt; after configuring Bitcoin Core to use Tor ControlPort as follows, Bitcoin Core will generate a file called &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; in the [[data directory]]. The file &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; contains the private key needed to generate your unique &amp;lt;tt&amp;gt;XXXXXXX.onion&amp;lt;/tt&amp;gt; address. KEEP THIS SAFE. If someone copies this file they can run a server with your .onion address. Also, if you delete this file, the next time bitcoind loads it will generate a new key file and &amp;lt;tt&amp;gt;xxxxxxxx.onion&amp;lt;/tt&amp;gt; address. Note that while a malicious party cannot necessarily associate the server with you as a person, as long as your server has the same xxxx.onion address they will know it is run by the same person. For absolute security delete &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; at each reboot or some frequent interval.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ControlPort 9051&lt;br /&gt;
CookieAuthentication 1&lt;br /&gt;
CookieAuthFileGroupReadable 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to figure out what user bitcoind or bitcoin-qt is running as. Run the following command while Bitcoin is running:&lt;br /&gt;
&amp;lt;pre&amp;gt;ps -eo user,group,comm |egrep &#039;bitcoind|bitcoin-qt&#039; |awk &#039;{print &amp;quot;Bitcoin user: &amp;quot; $1}&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Write down the reported user.&lt;br /&gt;
&lt;br /&gt;
Run the following command as root, which adds your Bitcoin user to the tor group. Replace BITCOIN_USER with the actual user name found above:&lt;br /&gt;
&amp;lt;pre&amp;gt;usermod -a -G tor BITCOIN_USER&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t modify any other settings, Bitcoin Core will usually connect over the regular Internet, but will also allow connections to and from the hidden service. This will help other users who wish to submit transactions to the bitcoin network securely and obscurely, but transactions you submit could theoretically be traced back to your ip address. If you want Bitcoin Core to only connect via Tor (for anonymity), add these lines to bitcoin.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Doing so will make your specific bitcoind node arguably more secure because it will never have an unencrypted connection to another node, but if everyone used &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt; nobody on the onion bitcoin chain would be able to communicate with the clearnet chain. It is essential that some nodes access both clearnet and Tor. If you need to submit bitcoin transactions to the network with the highest level of obscurity, use &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt;. If you only wish to give access to your node to other Tor users, do not use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now restart Tor, and then Bitcoin Core. At some point during startup in &amp;lt;tt&amp;gt;~/.bitcoin/debug.log&amp;lt;/tt&amp;gt; you will see &lt;br /&gt;
&amp;lt;pre&amp;gt;tor: Got service ID XXXXXXXXXXX, advertising service XXXXXXXXXXX.onion:8333&amp;lt;/pre&amp;gt; This is the .onion address of your server. You should eventually get incoming connections via the hidden service.&lt;br /&gt;
&lt;br /&gt;
=== Method 2 ===&lt;br /&gt;
&lt;br /&gt;
This sets up a manual hidden service controlled by the tor daemon. The hidden service address (xxxx.onion). Note that as in method 1, your xxxxx.onion address will stay the same until you delete your key file. Someone tracking you can&#039;t necessarily associate the xxxx.onion with you, but they will know it is run by the same person or entity.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;HiddenServiceDir /var/lib/tor/bitcoin-service/&lt;br /&gt;
HiddenServicePort 8333 127.0.0.1:8333&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Tor. As root, run &amp;lt;tt&amp;gt;cat /var/lib/tor/bitcoin-service/hostname&amp;lt;/tt&amp;gt;. Your onion address will be reported. If it didn&#039;t work, then probably your distro&#039;s version of Tor doesn&#039;t actually use &amp;lt;tt&amp;gt;/var/lib/tor&amp;lt;/tt&amp;gt; for this purpose. You should try to figure out the correct HiddenServiceDir location.&lt;br /&gt;
&lt;br /&gt;
In the following steps, replace ONION_ADDR with the onion address reported above.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t care about anonymity and are only looking to help the network, add the following lines to bitcoin.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;onion=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
externalip=ONION_ADDR&lt;br /&gt;
discover=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will allow you to accept connections both via your onion address and your IP address (if you have port 8333 forwarded), and Tor will only be used for connections to and from Tor hidden services.&lt;br /&gt;
&lt;br /&gt;
If you care about anonymity, &#039;&#039;&#039;instead&#039;&#039;&#039; of the above, add the following lines to bitcoin.conf to use Tor for everything:&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&lt;br /&gt;
externalip=ONION_ADDR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Bitcoin Core. You should eventually get incoming connections via your hidden service.&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>Cavemansalem</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65984</id>
		<title>Setting up a Tor hidden service</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65984"/>
		<updated>2018-12-21T15:18:08Z</updated>

		<summary type="html">&lt;p&gt;Cavemansalem: /* Method 1 (recommended) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you use a Bitcoin [[full node]] over Tor, then usually it will only be able to make outgoing connections. Therefore, you will only get a maximum of 8 total connections. This is fine, and is not something you usually need to worry about, but if your computer is often online and you want to be a big help to the network, you can run a Tor hidden service in order to accept incoming connections over Tor.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to forward port 8333 when using a Tor hidden service. The hidden service will cause most firewalls and NAT setups to be bypassed. For this reason, running a Tor hidden service is also a good idea if you want incoming connections but are for some reason unable to forward port 8333.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for Linux. It is possible to do on Windows, but the instructions would be rather different. (If you&#039;ve done it on Windows, consider adding the instructions to this page.)&lt;br /&gt;
&lt;br /&gt;
You need Tor (at least version 0.2.7.1). Figure out where your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt; file is (&amp;lt;tt&amp;gt;/etc/tor/torrc&amp;lt;/tt&amp;gt; is one possibility). This guide assumes default Tor settings. This guide assumes that Tor is running under the user and group &amp;lt;tt&amp;gt;tor&amp;lt;/tt&amp;gt;, which will usually be the case if you install Tor using your distro&#039;s package manager. Note that Bitcoin &#039;&#039;&#039;does not&#039;&#039;&#039; support hidden service version 3 (ie. long onion addresses).&lt;br /&gt;
&lt;br /&gt;
You need Bitcoin Core (or similar). For method 1, you need at least version 0.12.0. Find &amp;lt;tt&amp;gt;bitcoin.conf&amp;lt;/tt&amp;gt; in your [[data directory]].&lt;br /&gt;
&lt;br /&gt;
=== Method 1 (recommended) ===&lt;br /&gt;
&lt;br /&gt;
This sets up an automatic hidden service that is initiated by Bitcoin Core. On the first startup of &amp;lt;tt&amp;gt;bitcoind&amp;lt;/tt&amp;gt; after configuring Bitcoin Core to use Tor ControlPort as follows, Bitcoin Core will generate a file called &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; in the data directory (default: &amp;lt;tt&amp;gt;~/.bitcoin&amp;lt;/tt&amp;gt;, or specified using &amp;lt;tt&amp;gt;-datadir=/path/to/bitcoin/data&amp;lt;/tt&amp;gt; at the command line or &amp;lt;tt&amp;gt;datadir=/path/to/bitcoin/data&amp;lt;/tt&amp;gt; in bitcoin.conf). The file &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; contains the private key needed to generate your unique &amp;lt;tt&amp;gt;XXXXXXX.onion&amp;lt;/tt&amp;gt; address. KEEP THIS SAFE. If someone copies this file they can run a server with your .onion address. Also, if you delete this file, the next time bitcoind loads it will generate a new key file and &amp;lt;tt&amp;gt;xxxxxxxx.onion&amp;lt;/tt&amp;gt; address. Note that while a malicious party cannot necessarily associate the server with you as a person, as long as your server has the same xxxx.onion address they will know it is run by the same person. For absolute security delete &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; at each reboot or some frequent interval.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ControlPort 9051&lt;br /&gt;
CookieAuthentication 1&lt;br /&gt;
CookieAuthFileGroupReadable 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to figure out what user bitcoind or bitcoin-qt is running as. Run the following command while Bitcoin is running:&lt;br /&gt;
&amp;lt;pre&amp;gt;ps -eo user,group,comm |egrep &#039;bitcoind|bitcoin-qt&#039; |awk &#039;{print &amp;quot;Bitcoin user: &amp;quot; $1}&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Write down the reported user.&lt;br /&gt;
&lt;br /&gt;
Run the following command as root, which adds your Bitcoin user to the tor group. Replace BITCOIN_USER with the actual user name found above:&lt;br /&gt;
&amp;lt;pre&amp;gt;usermod -a -G tor BITCOIN_USER&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t modify any other settings, Bitcoin Core will usually connect over the regular Internet, but will also allow connections to and from the hidden service. This will help other users who wish to submit transactions to the bitcoin network securely and obscurely, but transactions you submit could theoretically be traced back to your ip address. If you want Bitcoin Core to only connect via Tor (for anonymity), add these lines to bitcoin.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Doing so will make your specific bitcoind node arguably more secure because it will never have an unencrypted connection to another node, but if everyone used &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt; nobody on the onion bitcoin chain would be able to communicate with the clearnet chain. It is essential that some nodes access both clearnet and Tor. If you need to submit bitcoin transactions to the network with the highest level of obscurity, use &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt;. If you only wish to give access to your node to other Tor users, do not use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now restart Tor, and then Bitcoin Core. At some point during startup in &amp;lt;tt&amp;gt;~/.bitcoin/debug.log&amp;lt;/tt&amp;gt; you will see &lt;br /&gt;
&amp;lt;pre&amp;gt;tor: Got service ID XXXXXXXXXXX, advertising service XXXXXXXXXXX.onion:8333&amp;lt;/pre&amp;gt; This is the .onion address of your server. You should eventually get incoming connections via the hidden service.&lt;br /&gt;
&lt;br /&gt;
=== Method 2 ===&lt;br /&gt;
&lt;br /&gt;
This sets up a manual hidden service controlled by the tor daemon. The hidden service address (xxxx.onion). Note that as in method 1, your xxxxx.onion address will stay the same until you delete your key file. Someone tracking you can&#039;t necessarily associate the xxxx.onion with you, but they will know it is run by the same person or entity.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;HiddenServiceDir /var/lib/tor/bitcoin-service/&lt;br /&gt;
HiddenServicePort 8333 127.0.0.1:8333&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Tor. As root, run &amp;lt;tt&amp;gt;cat /var/lib/tor/bitcoin-service/hostname&amp;lt;/tt&amp;gt;. Your onion address will be reported. If it didn&#039;t work, then probably your distro&#039;s version of Tor doesn&#039;t actually use &amp;lt;tt&amp;gt;/var/lib/tor&amp;lt;/tt&amp;gt; for this purpose. You should try to figure out the correct HiddenServiceDir location.&lt;br /&gt;
&lt;br /&gt;
In the following steps, replace ONION_ADDR with the onion address reported above.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t care about anonymity and are only looking to help the network, add the following lines to bitcoin.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;onion=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
externalip=ONION_ADDR&lt;br /&gt;
discover=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will allow you to accept connections both via your onion address and your IP address (if you have port 8333 forwarded), and Tor will only be used for connections to and from Tor hidden services.&lt;br /&gt;
&lt;br /&gt;
If you care about anonymity, &#039;&#039;&#039;instead&#039;&#039;&#039; of the above, add the following lines to bitcoin.conf to use Tor for everything:&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&lt;br /&gt;
externalip=ONION_ADDR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Bitcoin Core. You should eventually get incoming connections via your hidden service.&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>Cavemansalem</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65983</id>
		<title>Setting up a Tor hidden service</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65983"/>
		<updated>2018-12-21T15:16:02Z</updated>

		<summary type="html">&lt;p&gt;Cavemansalem: /* Method 1 (recommended) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you use a Bitcoin [[full node]] over Tor, then usually it will only be able to make outgoing connections. Therefore, you will only get a maximum of 8 total connections. This is fine, and is not something you usually need to worry about, but if your computer is often online and you want to be a big help to the network, you can run a Tor hidden service in order to accept incoming connections over Tor.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to forward port 8333 when using a Tor hidden service. The hidden service will cause most firewalls and NAT setups to be bypassed. For this reason, running a Tor hidden service is also a good idea if you want incoming connections but are for some reason unable to forward port 8333.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for Linux. It is possible to do on Windows, but the instructions would be rather different. (If you&#039;ve done it on Windows, consider adding the instructions to this page.)&lt;br /&gt;
&lt;br /&gt;
You need Tor (at least version 0.2.7.1). Figure out where your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt; file is (&amp;lt;tt&amp;gt;/etc/tor/torrc&amp;lt;/tt&amp;gt; is one possibility). This guide assumes default Tor settings. This guide assumes that Tor is running under the user and group &amp;lt;tt&amp;gt;tor&amp;lt;/tt&amp;gt;, which will usually be the case if you install Tor using your distro&#039;s package manager. Note that Bitcoin &#039;&#039;&#039;does not&#039;&#039;&#039; support hidden service version 3 (ie. long onion addresses).&lt;br /&gt;
&lt;br /&gt;
You need Bitcoin Core (or similar). For method 1, you need at least version 0.12.0. Find &amp;lt;tt&amp;gt;bitcoin.conf&amp;lt;/tt&amp;gt; in your [[data directory]].&lt;br /&gt;
&lt;br /&gt;
=== Method 1 (recommended) ===&lt;br /&gt;
&lt;br /&gt;
This sets up an automatic hidden service that is initiated by Bitcoin Core. On the first startup of &amp;lt;tt&amp;gt;bitcoind&amp;lt;/tt&amp;gt; after configuring Bitcoin Core to use Tor ControlPort as follows, Bitcoin Core will generate a file called &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; in the data directory (default: &amp;lt;tt&amp;gt;~/.bitcoin&amp;lt;/tt&amp;gt;, or specified using &amp;lt;tt&amp;gt;-datadir=/path/to/bitcoin/data&amp;lt;/tt&amp;gt; at the command line or &amp;lt;tt&amp;gt;datadir=/path/to/bitcoin/data&amp;lt;/tt&amp;gt; in bitcoin.conf). The file &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; contains the private key needed to generate your unique &amp;lt;tt&amp;gt;XXXXXXX.onion&amp;lt;/tt&amp;gt; address. KEEP THIS SAFE. If someone copies this file they can run a server with your .onion address. Also, if you delete this file, the next time bitcoind loads it will generate a new key file and &amp;lt;tt&amp;gt;xxxxxxxx.onion&amp;lt;/tt&amp;gt; address. Note that while a malicious party cannot necessarily associate the server with you as a person, as long as your server has the same xxxx.onion address they will know it is run by the same person. For absolute security delete &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; at each reboot or some frequent interval.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ControlPort 9051&lt;br /&gt;
CookieAuthentication 1&lt;br /&gt;
CookieAuthFileGroupReadable 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to figure out what user bitcoind or bitcoin-qt is running as. Run the following command while Bitcoin is running:&lt;br /&gt;
&amp;lt;pre&amp;gt;ps -eo user,group,comm |egrep &#039;bitcoind|bitcoin-qt&#039; |awk &#039;{print &amp;quot;Bitcoin user: &amp;quot; $1}&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Write down the reported user.&lt;br /&gt;
&lt;br /&gt;
Run the following command as root, which adds your Bitcoin user to the tor group. Replace BITCOIN_USER with the actual user name found above:&lt;br /&gt;
&amp;lt;pre&amp;gt;usermod -a -G tor BITCOIN_USER&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t modify any other settings, Bitcoin Core will usually connect over the regular Internet, but will also allow connections to and from the hidden service. This will help other users who wish to submit transactions to the bitcoin network securely and obscurely, but transactions you submit could theoretically be traced back to your ip address. If you want Bitcoin Core to only connect via Tor (for anonymity), add these lines to bitcoin.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Doing so will make your specific bitcoind node arguably more secure because it will never have an unencrypted connection to another node, but if everyone used &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt; nobody on the onion bitcoin chain would be able to communicate with the clearnet chain. It is essential that some nodes access both clearnet and Tor. If you need to submit bitcoin transactions to the network with the highest level of obscurity, use &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt;. If you only wish to give access to your node to other Tor users, do not use it.&lt;br /&gt;
&lt;br /&gt;
Now restart Tor, and then Bitcoin Core. At some point during startup in &amp;lt;tt&amp;gt;~/.bitcoin/debug.log&amp;lt;/tt&amp;gt; you will see &lt;br /&gt;
&amp;lt;pre&amp;gt;tor: Got service ID XXXXXXXXXXX, advertising service XXXXXXXXXXX.onion:8333&amp;lt;/pre&amp;gt; This is the .onion address of your server. You should eventually get incoming connections via the hidden service.&lt;br /&gt;
&lt;br /&gt;
=== Method 2 ===&lt;br /&gt;
&lt;br /&gt;
This sets up a manual hidden service controlled by the tor daemon. The hidden service address (xxxx.onion). Note that as in method 1, your xxxxx.onion address will stay the same until you delete your key file. Someone tracking you can&#039;t necessarily associate the xxxx.onion with you, but they will know it is run by the same person or entity.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;HiddenServiceDir /var/lib/tor/bitcoin-service/&lt;br /&gt;
HiddenServicePort 8333 127.0.0.1:8333&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Tor. As root, run &amp;lt;tt&amp;gt;cat /var/lib/tor/bitcoin-service/hostname&amp;lt;/tt&amp;gt;. Your onion address will be reported. If it didn&#039;t work, then probably your distro&#039;s version of Tor doesn&#039;t actually use &amp;lt;tt&amp;gt;/var/lib/tor&amp;lt;/tt&amp;gt; for this purpose. You should try to figure out the correct HiddenServiceDir location.&lt;br /&gt;
&lt;br /&gt;
In the following steps, replace ONION_ADDR with the onion address reported above.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t care about anonymity and are only looking to help the network, add the following lines to bitcoin.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;onion=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
externalip=ONION_ADDR&lt;br /&gt;
discover=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will allow you to accept connections both via your onion address and your IP address (if you have port 8333 forwarded), and Tor will only be used for connections to and from Tor hidden services.&lt;br /&gt;
&lt;br /&gt;
If you care about anonymity, &#039;&#039;&#039;instead&#039;&#039;&#039; of the above, add the following lines to bitcoin.conf to use Tor for everything:&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&lt;br /&gt;
externalip=ONION_ADDR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Bitcoin Core. You should eventually get incoming connections via your hidden service.&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>Cavemansalem</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65982</id>
		<title>Setting up a Tor hidden service</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Setting_up_a_Tor_hidden_service&amp;diff=65982"/>
		<updated>2018-12-21T15:15:27Z</updated>

		<summary type="html">&lt;p&gt;Cavemansalem: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you use a Bitcoin [[full node]] over Tor, then usually it will only be able to make outgoing connections. Therefore, you will only get a maximum of 8 total connections. This is fine, and is not something you usually need to worry about, but if your computer is often online and you want to be a big help to the network, you can run a Tor hidden service in order to accept incoming connections over Tor.&lt;br /&gt;
&lt;br /&gt;
Note that there is no need to forward port 8333 when using a Tor hidden service. The hidden service will cause most firewalls and NAT setups to be bypassed. For this reason, running a Tor hidden service is also a good idea if you want incoming connections but are for some reason unable to forward port 8333.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for Linux. It is possible to do on Windows, but the instructions would be rather different. (If you&#039;ve done it on Windows, consider adding the instructions to this page.)&lt;br /&gt;
&lt;br /&gt;
You need Tor (at least version 0.2.7.1). Figure out where your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt; file is (&amp;lt;tt&amp;gt;/etc/tor/torrc&amp;lt;/tt&amp;gt; is one possibility). This guide assumes default Tor settings. This guide assumes that Tor is running under the user and group &amp;lt;tt&amp;gt;tor&amp;lt;/tt&amp;gt;, which will usually be the case if you install Tor using your distro&#039;s package manager. Note that Bitcoin &#039;&#039;&#039;does not&#039;&#039;&#039; support hidden service version 3 (ie. long onion addresses).&lt;br /&gt;
&lt;br /&gt;
You need Bitcoin Core (or similar). For method 1, you need at least version 0.12.0. Find &amp;lt;tt&amp;gt;bitcoin.conf&amp;lt;/tt&amp;gt; in your [[data directory]].&lt;br /&gt;
&lt;br /&gt;
=== Method 1 (recommended) ===&lt;br /&gt;
&lt;br /&gt;
This sets up an automatic hidden service that is initiated by Bitcoin Core. On the first startup of &amp;lt;tt&amp;gt;bitcoind&amp;lt;/tt&amp;gt; after configuring Bitcoin Core to use Tor ControlPort, Bitcoin Core will generate a file called &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; in the data directory (default: &amp;lt;tt&amp;gt;~/.bitcoin&amp;lt;/tt&amp;gt;, or specified using &amp;lt;tt&amp;gt;-datadir=/path/to/bitcoin/data&amp;lt;/tt&amp;gt; at the command line or &amp;lt;tt&amp;gt;datadir=/path/to/bitcoin/data&amp;lt;/tt&amp;gt; in bitcoin.conf). The file &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; contains the private key needed to generate your unique &amp;lt;tt&amp;gt;XXXXXXX.onion&amp;lt;/tt&amp;gt; address. KEEP THIS SAFE. If someone copies this file they can run a server with your .onion address. Also, if you delete this file, the next time bitcoind loads it will generate a new key file and &amp;lt;tt&amp;gt;xxxxxxxx.onion&amp;lt;/tt&amp;gt; address. Note that while a malicious party cannot necessarily associate the server with you as a person, as long as your server has the same xxxx.onion address they will know it is run by the same person. For absolute security delete &amp;lt;tt&amp;gt;onion_private_key&amp;lt;/tt&amp;gt; at each reboot or some frequent interval.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ControlPort 9051&lt;br /&gt;
CookieAuthentication 1&lt;br /&gt;
CookieAuthFileGroupReadable 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to figure out what user bitcoind or bitcoin-qt is running as. Run the following command while Bitcoin is running:&lt;br /&gt;
&amp;lt;pre&amp;gt;ps -eo user,group,comm |egrep &#039;bitcoind|bitcoin-qt&#039; |awk &#039;{print &amp;quot;Bitcoin user: &amp;quot; $1}&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Write down the reported user.&lt;br /&gt;
&lt;br /&gt;
Run the following command as root, which adds your Bitcoin user to the tor group. Replace BITCOIN_USER with the actual user name found above:&lt;br /&gt;
&amp;lt;pre&amp;gt;usermod -a -G tor BITCOIN_USER&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t modify any other settings, Bitcoin Core will usually connect over the regular Internet, but will also allow connections to and from the hidden service. This will help other users who wish to submit transactions to the bitcoin network securely and obscurely, but transactions you submit could theoretically be traced back to your ip address. If you want Bitcoin Core to only connect via Tor (for anonymity), add these lines to bitcoin.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Doing so will make your specific bitcoind node arguably more secure because it will never have an unencrypted connection to another node, but if everyone used &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt; nobody on the onion bitcoin chain would be able to communicate with the clearnet chain. It is essential that some nodes access both clearnet and Tor. If you need to submit bitcoin transactions to the network with the highest level of obscurity, use &amp;lt;tt&amp;gt;onlynet=onion&amp;lt;/tt&amp;gt;. If you only wish to give access to your node to other Tor users, do not use it.&lt;br /&gt;
&lt;br /&gt;
Now restart Tor, and then Bitcoin Core. At some point during startup in &amp;lt;tt&amp;gt;~/.bitcoin/debug.log&amp;lt;/tt&amp;gt; you will see &lt;br /&gt;
&amp;lt;pre&amp;gt;tor: Got service ID XXXXXXXXXXX, advertising service XXXXXXXXXXX.onion:8333&amp;lt;/pre&amp;gt; This is the .onion address of your server. You should eventually get incoming connections via the hidden service.&lt;br /&gt;
&lt;br /&gt;
=== Method 2 ===&lt;br /&gt;
&lt;br /&gt;
This sets up a manual hidden service controlled by the tor daemon. The hidden service address (xxxx.onion). Note that as in method 1, your xxxxx.onion address will stay the same until you delete your key file. Someone tracking you can&#039;t necessarily associate the xxxx.onion with you, but they will know it is run by the same person or entity.&lt;br /&gt;
&lt;br /&gt;
Add these lines to your &amp;lt;tt&amp;gt;torrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;HiddenServiceDir /var/lib/tor/bitcoin-service/&lt;br /&gt;
HiddenServicePort 8333 127.0.0.1:8333&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Tor. As root, run &amp;lt;tt&amp;gt;cat /var/lib/tor/bitcoin-service/hostname&amp;lt;/tt&amp;gt;. Your onion address will be reported. If it didn&#039;t work, then probably your distro&#039;s version of Tor doesn&#039;t actually use &amp;lt;tt&amp;gt;/var/lib/tor&amp;lt;/tt&amp;gt; for this purpose. You should try to figure out the correct HiddenServiceDir location.&lt;br /&gt;
&lt;br /&gt;
In the following steps, replace ONION_ADDR with the onion address reported above.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t care about anonymity and are only looking to help the network, add the following lines to bitcoin.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;onion=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
externalip=ONION_ADDR&lt;br /&gt;
discover=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will allow you to accept connections both via your onion address and your IP address (if you have port 8333 forwarded), and Tor will only be used for connections to and from Tor hidden services.&lt;br /&gt;
&lt;br /&gt;
If you care about anonymity, &#039;&#039;&#039;instead&#039;&#039;&#039; of the above, add the following lines to bitcoin.conf to use Tor for everything:&lt;br /&gt;
&amp;lt;pre&amp;gt;proxy=127.0.0.1:9050&lt;br /&gt;
listen=1&lt;br /&gt;
bind=127.0.0.1&lt;br /&gt;
externalip=ONION_ADDR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you additionally want Bitcoin Core to only connect out to Tor &#039;&#039;hidden services&#039;&#039;, also add this line (not particularly recommended):&lt;br /&gt;
&amp;lt;pre&amp;gt;onlynet=onion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Bitcoin Core. You should eventually get incoming connections via your hidden service.&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>Cavemansalem</name></author>
	</entry>
</feed>