TLDR: When a node is connected to multiple networks (e.g., clearnet and Tor), it keeps separate ADDR response caches for each network. These are refreshed about once per day (randomized between 21 and 27 hours). See → https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp#L3519 This is an example of a dual-homed node’s addrman response, with separate caches:
IPv4 response:
0{102.130.242.11:8333 : 1741100851}
1{119.17.151.161:8333 : 1739825443}
2{ubeirqalc4vj54baszpatvctpohn62hzj7vfnbncy6upa6vywvgewrad.onion:8333 : 1739825443}
Tor response:
0{102.130.242.11:8333 : 1741100851}
1{94.23.167.176:8333 : 1740895525}
2{ubeirqalc4vj54baszpatvctpohn62hzj7vfnbncy6upa6vywvgewrad.onion:8333 : 1739825443}
Currently, there’s a fingerprinting attack that exploits responses to GETADDR messages. An attacker can collect responses from supposedly different nodes and compare the timestamps. By looking at overlaps in responses, they can correlate Tor and clearnet identities — effectively linking them back to the same node. More details on this attack here: https://delvingbitcoin.org/t/fingerprinting-nodes-via-addr-requests/1786
This PR mitigates the attack by setting the timestamps in different caches to a fixed value in the past (10.5 ± 2.5 days), preventing correlation through timestamps. After the change, timestamps in each cache are now uniform, but differ between caches:
IPv4 response:
0{102.130.242.11:8333 : 1757964675}
1{119.17.151.161:8333 : 1757964675}
2{ubeirqalc4vj54baszpatvctpohn62hzj7vfnbncy6upa6vywvgewrad.onion:8333 : 1757964675}
Tor response:
0{102.130.242.11:8333 : 1757878277}
1{119.17.151.161:8333 : 1757878277}
2{ubeirqalc4vj54baszpatvctpohn62hzj7vfnbncy6upa6vywvgewrad.onion:8333 : 1757878277}
We initially considered setting the timestamps to 0, since they would eventually be updated and saved. However, this isn’t compatible with btcd (see details here → https://github.com/btcsuite/btcd/issues/2411 ). This is still a work in progress — we’re continuing to test and are open to trying other solutions as well.
This is joint work with @danielabrozzoni