Asmap
A Bitcoin Core feature mapping IP addresses to autonomous systems (AS) to diversify peer connections and mitigate network attacks.
asmap is a feature in Bitcoin Core that maps peer IP addresses to their Autonomous System Numbers (ASNs) - the routing entities that own and operate ranges of internet IP space. Using this mapping, the node spreads its outbound peer connections across many different ASNs rather than risking many connections to the same network operator.
Why this matters for eclipse-attack defense:
- An ASN is a real-world entity (e.g., AS15169 = Google, AS16509 = Amazon AWS, etc.). All IPs belonging to one ASN are administratively under the same authority.
- If your node has 8 outbound peers all on AWS, then an attacker who can compromise AWS or coerce them can isolate your node trivially. They control the entire path.
- If your node has outbound peers across 8 different ASNs spanning Google, AWS, Hetzner, OVH, Digital Ocean, and assorted residential ISPs, an attacker has to compromise all of them to isolate you - dramatically harder.
The asmap file is just a compressed lookup table: given an IP address, which ASN owns it? Bitcoin Core's addrman (address manager) uses this when selecting peers to ensure ASN diversity in the outbound peer set.
The asmap data is a snapshot of internet routing records, built from RPKI and IRR registry data plus BGP routes seen by the Routeviews collectors. Since Bitcoin Core 31.0 a copy ships inside the release. Contributors build it with the Kartograf tool in coordinated runs, and a file is published at the asmap-data project only when at least five of them sign the same result. Operators can still load their own file with -asmap=<file>.
Asmap is off by default, even in releases that embed the map, and for most home node operators the default grouping by IP range is good enough. On Bitcoin Core 31.0 and later, turning it on takes one line in bitcoin.conf: asmap=1. For operators serious about defense-in-depth - high-value Lightning routing nodes, exchange-operated nodes, or anyone whose node is a meaningful target - asmap is one of several network-layer defenses worth knowing about.
See Eclipse Attack for the threat this defends against and Peer Discovery for the broader peer-selection process.
Key takeaways
- Diversifies peer connections by AS
- Aims to reduce potential eclipse attacks
- Enhances decentralization in node networking
Corrected
-
Was: The entry said asmap data is shipped or downloaded separately from Bitcoin Core, credited the main data source to Sjors Provoost and Pieter Wuille without support, and implied asmap is in use by default.
Now: Since Bitcoin Core 31.0 a map built from RPKI, IRR and Routeviews data ships inside the release, and asmap stays off unless asmap=1 is set. The unsupported attribution was removed. Details
Sources (4)
Related terms (5)
Published . Revised . One correction logged for this page.
Edit this page on GitHub