Merge bitcoin/bitcoin#33414: tor: enable PoW defenses for automatically created hidden services

c68e3d2c57 doc: add release notes for Tor PoW defenses (Vasil Dimov)
4bae84c94a doc: add a hint to enable PoW defenses to manual hidden services (Vasil Dimov)
4c6798a3d3 tor: enable PoW defenses for automatically created hidden services (Vasil Dimov)
fb993f7604 tor, fuzz: reuse constants instead of duplicating (Vasil Dimov)

Pull request description:

  Enable [PoW defenses](https://tpo.pages.torproject.net/onion-services/ecosystem/technology/security/pow/) for hidden services that we create via Tor Control using the [`ADD_ONION` command](https://spec.torproject.org/control-spec/commands.html#add_onion).

  The ability to do that has been added in [tor-0.4.9.2-alpha](02c1804446). Previous versions return a syntax error to the `ADD_ONION` command with `PoWDefensesEnabled=1`, so the approach here is to try with PoW and if we get syntax error, then retry without PoW.

  Also update `doc/tor.md` with a hint on enabling PoW on manually configured Tor hidden services.

ACKs for top commit:
  willcl-ark:
    ACK c68e3d2c57
  fjahr:
    tACK c68e3d2c57
  sedited:
    ACK c68e3d2c57

Tree-SHA512: 56f57bc770b89389c35a4c0bc2a28804d17b1479ecd4d9b764695d6c9d2994425aee759e71658d7b57088bbe43ce90b94fb972f66d79ef903e0c1a4d6c4562f3
This commit is contained in:
merge-script
2026-03-23 14:54:47 +08:00
5 changed files with 50 additions and 12 deletions

View File

@@ -0,0 +1,9 @@
Notable changes
===============
P2P and network changes
-----------------------
Tor hidden services that are created automatically by Bitcoin Core will have
[PoW defenses](https://tpo.pages.torproject.net/onion-services/ecosystem/technology/security/pow/)
enabled if the Tor daemon supports that. (#33414)

View File

@@ -181,6 +181,10 @@ Add these lines to your `/etc/tor/torrc` (or equivalent config file):
HiddenServiceDir /var/lib/tor/bitcoin-service/
HiddenServicePort 8333 127.0.0.1:8334
# If `tor --list-modules` shows "pow: yes", then enable PoW protection.
# It is available in tor-0.4.8.1-alpha and newer when configured with
# `./configure --enable-gpl`.
HiddenServicePoWDefensesEnabled 1
The directory can be different of course, but virtual port numbers should be equal to
your bitcoind's P2P listen port (8333 by default), and target addresses and ports