I understand that the AS information plays a part in how addresses are populated in the buckets of the new table for IPv4/IPv6 addresses, but how does it work for .onion addresses?

I understand the address assignment into buckets for IPv4/IPv6 via here but the process for .onion address is not clear to me. The only thing I know is that the group for the .onion address is the first 4 bytes of the address(without the .onion)

1 Answer 1


The reason behind the network groups concept as used in Bitcoin Core (which correspond to AS numbers if you use asmap) is the rather vague notion that an attacker may get many IP addresses in a single range/network, but is unlikely to get access to IP addresses that belong to many distinct networks. It is very approximate, but it permits making some decisions that avoid Eclipse attacks and others as long as this assumption holds.

This notion does not apply in Tor, or other anonymization overlay networks like I2P or CJDNS. There is no concept of locality of address ranges in these networks: getting two addresses that are close or far apart has no bearing on cost, as these addresses are hashes of public key material.

Bitcoin Core treats all onion/I2P addresses as being in just 4 network groups for bucketing purposes, just so that not all keys map to the same thing, but there is little basis in reality for this. The whole idea of network grouls just doesn't apply to these networks.

  • So based on the bucketing algorithm, looks like if the source and the actual address are for an addr message both .onion,and if the node only accepts these kind of messages, then the node will only fill 256 buckets of the 1024 in the new table(theoretically). Or am I mistaken? Oct 11 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.