ASMap
ASMap (autonomous-system map) is a Bitcoin Core feature that maps IP address prefixes to autonomous system numbers (ASNs) so that peer selection can diversify by routing domain rather than by IP prefix alone. The goal is to make eclipse attacks that rely on many addresses in one network operator's space harder. ASMap is not a consensus rule.
Bitcoin Core's address manager groups peers into netgroups and avoids filling outbound slots from a single group. The historical grouping is a /16 prefix for IPv4 (and analogous prefix cuts for IPv6). A single autonomous system, especially a large hosting provider or transit network, commonly originates many /16s. The Erebus attack (Tran et al., 2020) showed that an AS on the victim's path can occupy those groups with addresses it already legitimately announces, without BGP hijacking, and eventually supply all of a victim's outbound peers. Mapping each address to the originating ASN and using the ASN as the netgroup collapses those prefixes into one bucket, so outbound diversity tracks administrative control of address space more closely than the /16 cut.
An ASMap file is a compressed trie from IP prefix to ASN, produced from public routing data (BGP tables and related dumps). The Kartograf tooling used by the asmap-data project parses several sources deterministically so independent operators can rebuild the same file and compare hashes. Encoded maps suitable for Bitcoin Core are published in the bitcoin-core/asmap-data repository after coordinated reconstruction and review. When ASMap is enabled, AddrMan buckets and eviction use the ASN as the group identifier for IPv4 and IPv6 peers; Tor and I2P overlay addresses are not ASN-mapped the same way and keep their own network groups. The map is a snapshot routing tables change, so an old map mis-groups some prefixes; operators replace the file for a fresh map, and releases that embed a map update it around release time.
Bitcoin Core has accepted an ASMap file via -asmap=<path> since version 0.20. Bitcoin Core 31.0 was the first release to embed a default map in the binary (the embedded dump was created on 5 March 2026). The feature remains off by default: -asmap or -asmap=1 loads the embedded map, and -asmap=filename loads an external file. Builds can disable embedding with a compile option. ASMap does not encrypt traffic, authenticate peers, or stop an attacker who controls many independent ASNs, and it does not help if the victim has only one network path and that path is the adversary. It is one layer of eclipse mitigation alongside feeler connections, anchor connections, and optional overlay networks. No wallet behaviour depends on ASMap. Related Network topics include Erlay for transaction relay; Addr v2 and BIP324 are separate peer-address and transport work.