Starting with Tor 0.4.8, hidden services support a proof-of-work (PoW) mechanism that requires clients to solve a computational puzzle before connecting. During normal operation, the puzzle is trivial. Under DDoS conditions, the difficulty automatically increases, forcing attackers to expend significant CPU resources for each connection attempt:
# /etc/tor/torrc - Enable proof-of-work defense
HiddenServiceDir /var/lib/tor/my_hidden_service/
HiddenServicePort 80 127.0.0.1:8080
HiddenServiceVersion 3
HiddenServicePoWDefensesEnabled 1
HiddenServicePoWQueueRate 200
HiddenServicePoWQueueBurst 2500HiddenServicePoWDefensesEnabled 1 activates the EquiX proof-of-work scheme. The queue rate and burst parameters control how many connections per second are served and the maximum queue size. During a flood, clients that solve harder puzzles get priority, while the attacker must burn CPU cycles for every connection.
This defense requires Tor Browser 13.0 or later on the client side. Older clients will still connect but will not benefit from prioritization during attacks.