Skip to content

Commit 1e72b68

Browse files
RiccardoMasuttiRiccardo Masutti
authored andcommitted
Replace hidden service with onion service
For a couple of years, Tor documentation has made the term hidden service obsolete, in favor of onion service. This PR updates all the references in the code base.
1 parent f7c73b0 commit 1e72b68

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ the pull request affects. Valid areas as:
158158
Examples:
159159

160160
consensus: Add new opcode for BIP-XXXX OP_CHECKAWESOMESIG
161-
net: Automatically create hidden service, listen on Tor
161+
net: Automatically create onion service, listen on Tor
162162
qt: Add feed bump button
163163
log: Fix typo in log message
164164

doc/JSON-RPC-interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ RPC interface will be abused.
6060
are sent as clear text that can be read by anyone on your network
6161
path. Additionally, the RPC interface has not been hardened to
6262
withstand arbitrary Internet traffic, so changing the above settings
63-
to expose it to the Internet (even using something like a Tor hidden
63+
to expose it to the Internet (even using something like a Tor onion
6464
service) could expose you to unconsidered vulnerabilities. See
6565
`bitcoind -help` for more information about these settings and other
6666
settings described in this document.

doc/files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Subdirectory | File(s) | Description
5656
`./` | `fee_estimates.dat` | Stores statistics used to estimate minimum transaction fees and priorities required for confirmation
5757
`./` | `guisettings.ini.bak` | Backup of former [GUI settings](#gui-settings) after `-resetguisettings` option is used
5858
`./` | `mempool.dat` | Dump of the mempool's transactions
59-
`./` | `onion_private_key` | Cached Tor hidden service private key for `-listenonion` option
59+
`./` | `onion_private_key` | Cached Tor onion service private key for `-listenonion` option
6060
`./` | `peers.dat` | Peer IP address database (custom format)
6161
`./` | `settings.json` | Read-write settings set through GUI or RPC interfaces, augmenting manual settings from [bitcoin.conf](bitcoin-conf.md). File is created automatically if read-write settings storage is not disabled with `-nosettings` option. Path can be specified with `-settings` option
6262
`./` | `.cookie` | Session RPC authentication cookie; if used, created at start and deleted on shutdown; can be specified by `-rpccookiefile` option

doc/tor.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TOR SUPPORT IN BITCOIN
22

3-
It is possible to run Bitcoin Core as a Tor hidden service, and connect to such services.
3+
It is possible to run Bitcoin Core as a Tor onion service, and connect to such services.
44

55
The following directions assume you have a Tor proxy running on port 9050. Many distributions default to having a SOCKS proxy listening on port 9050, but others may not. In particular, the Tor Browser Bundle defaults to listening on port 9150. See [Tor Project FAQ:TBBSocksPort](https://www.torproject.org/docs/faq.html.en#TBBSocksPort) for how to properly
66
configure Tor.
@@ -14,12 +14,12 @@ outgoing connections, but more is possible.
1414
-proxy=ip:port Set the proxy server. If SOCKS5 is selected (default), this proxy
1515
server will be used to try to reach .onion addresses as well.
1616

17-
-onion=ip:port Set the proxy server to use for Tor hidden services. You do not
17+
-onion=ip:port Set the proxy server to use for Tor onion services. You do not
1818
need to set this if it's the same as -proxy. You can use -noonion
19-
to explicitly disable access to hidden services.
19+
to explicitly disable access to onion services.
2020

2121
-listen When using -proxy, listening is disabled by default. If you want
22-
to run a hidden service (see next section), you'll need to enable
22+
to run an onion service (see next section), you'll need to enable
2323
it explicitly.
2424

2525
-connect=X When behind a Tor proxy, you can specify .onion addresses instead
@@ -94,11 +94,11 @@ for normal IPv4/IPv6 communication, use:
9494
## 3. Automatically listen on Tor
9595

9696
Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket
97-
API, to create and destroy 'ephemeral' hidden services programmatically.
97+
API, to create and destroy 'ephemeral' onion services programmatically.
9898
Bitcoin Core has been updated to make use of this.
9999

100100
This means that if Tor is running (and proper authentication has been configured),
101-
Bitcoin Core automatically creates a hidden service to listen on. This will positively
101+
Bitcoin Core automatically creates an onion service to listen on. This will positively
102102
affect the number of available .onion nodes.
103103

104104
This new feature is enabled by default if Bitcoin Core is listening (`-listen`), and
@@ -110,7 +110,7 @@ Connecting to Tor's control socket API requires one of two authentication method
110110
configured. It also requires the control socket to be enabled, e.g. put `ControlPort 9051`
111111
in `torrc` config file. For cookie authentication the user running bitcoind must have read
112112
access to the `CookieAuthFile` specified in Tor configuration. In some cases this is
113-
preconfigured and the creation of a hidden service is automatic. If permission problems
113+
preconfigured and the creation of an onion service is automatic. If permission problems
114114
are seen with `-debug=tor` they can be resolved by adding both the user running Tor and
115115
the user running bitcoind to the same group and setting permissions appropriately. On
116116
Debian-based systems the user running bitcoind can be added to the debian-tor group,
@@ -127,8 +127,8 @@ in the tor configuration file. The hashed password can be obtained with the comm
127127

128128
## 4. Privacy recommendations
129129

130-
- Do not add anything but Bitcoin Core ports to the hidden service created in section 2.
131-
If you run a web service too, create a new hidden service for that.
130+
- Do not add anything but Bitcoin Core ports to the onion service created in section 2.
131+
If you run a web service too, create a new onion service for that.
132132
Otherwise it is trivial to link them, which may reduce privacy. Hidden
133133
services created automatically (as in section 3) always have only one port
134134
open.

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,13 @@ void SetupServerArgs(NodeContext& node)
442442
argsman.AddArg("-externalip=<ip>", "Specify your own public address", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
443443
argsman.AddArg("-forcednsseed", strprintf("Always query for peer addresses via DNS lookup (default: %u)", DEFAULT_FORCEDNSSEED), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
444444
argsman.AddArg("-listen", "Accept connections from outside (default: 1 if no -proxy or -connect)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
445-
argsman.AddArg("-listenonion", strprintf("Automatically create Tor hidden service (default: %d)", DEFAULT_LISTEN_ONION), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
445+
argsman.AddArg("-listenonion", strprintf("Automatically create Tor onion service (default: %d)", DEFAULT_LISTEN_ONION), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
446446
argsman.AddArg("-maxconnections=<n>", strprintf("Maintain at most <n> connections to peers (default: %u)", DEFAULT_MAX_PEER_CONNECTIONS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
447447
argsman.AddArg("-maxreceivebuffer=<n>", strprintf("Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXRECEIVEBUFFER), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
448448
argsman.AddArg("-maxsendbuffer=<n>", strprintf("Maximum per-connection send buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXSENDBUFFER), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
449449
argsman.AddArg("-maxtimeadjustment", strprintf("Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)", DEFAULT_MAX_TIME_ADJUSTMENT), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
450450
argsman.AddArg("-maxuploadtarget=<n>", strprintf("Tries to keep outbound traffic under the given target (in MiB per 24h). Limit does not apply to peers with 'download' permission. 0 = no limit (default: %d)", DEFAULT_MAX_UPLOAD_TARGET), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
451-
argsman.AddArg("-onion=<ip:port>", "Use separate SOCKS5 proxy to reach peers via Tor hidden services, set -noonion to disable (default: -proxy)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
451+
argsman.AddArg("-onion=<ip:port>", "Use separate SOCKS5 proxy to reach peers via Tor onion services, set -noonion to disable (default: -proxy)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
452452
argsman.AddArg("-onlynet=<net>", "Make outgoing connections only through network <net> (ipv4, ipv6 or onion). Incoming connections are not affected by this option. This option can be specified multiple times to allow multiple networks.", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
453453
argsman.AddArg("-peerbloomfilters", strprintf("Support filtering of blocks and transaction with bloom filters (default: %u)", DEFAULT_PEERBLOOMFILTERS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
454454
argsman.AddArg("-peerblockfilters", strprintf("Serve compact block filters to peers per BIP 157 (default: %u)", DEFAULT_PEERBLOCKFILTERS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);

src/qt/forms/optionsdialog.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,10 @@
459459
<item>
460460
<widget class="QCheckBox" name="connectSocksTor">
461461
<property name="toolTip">
462-
<string>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</string>
462+
<string>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor onion services.</string>
463463
</property>
464464
<property name="text">
465-
<string>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</string>
465+
<string>Use separate SOCKS&amp;5 proxy to reach peers via Tor onion services:</string>
466466
</property>
467467
</widget>
468468
</item>

src/torcontrol.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ static bool WriteBinaryFile(const fs::path &filename, const std::string &data)
405405
/****** Bitcoin specific TorController implementation ********/
406406

407407
/** Controller that connects to Tor control socket, authenticate, then create
408-
* and maintain an ephemeral hidden service.
408+
* and maintain an ephemeral onion service.
409409
*/
410410
class TorController
411411
{
@@ -534,7 +534,7 @@ void TorController::auth_cb(TorControlConnection& _conn, const TorControlReply&
534534
// Finally - now create the service
535535
if (private_key.empty()) // No private key, generate one
536536
private_key = "NEW:RSA1024"; // Explicitly request RSA1024 - see issue #9214
537-
// Request hidden service, redirect port.
537+
// Request onion service, redirect port.
538538
// Note that the 'virtual' port is always the default port to avoid decloaking nodes using other ports.
539539
_conn.Command(strprintf("ADD_ONION %s Port=%i,127.0.0.1:%i", private_key, Params().GetDefaultPort(), GetListenPort()),
540540
std::bind(&TorController::add_onion_cb, this, std::placeholders::_1, std::placeholders::_2));

0 commit comments

Comments
 (0)