TeachMeBitcoin

The Poisoning Protection: Defending against eclipse and sybil attacks

From TeachMeBitcoin, the free encyclopedia Reading time: 3 min

The Poisoning Protection: Defending against eclipse and sybil attacks

The P2P network is an "Open Battlefield." An attacker might try to "Poison" your node's view of the world. Two of the most dangerous attacks are the Sybil Attack (creating thousands of fake nodes to surround you) and the Eclipse Attack (cutting you off from the real network so you only see the attacker's fake chain). Bitcoin Core has built-in Poisoning Protection to defend against these.

For the Sovereign Architect, Poisoning Protection is the "Immune System" of the node. It is a set of "Heuristics" (Smart Rules) that detect when the network around you looks "Too Uniform" or "Too Artificial."

Analyzing the Immunity: IP Diversity and Bucketing

In the source code (src/addrman.cpp), we see the most important defense: Address Bucketing.

/**
 * PEDAGOGICAL ANALYSIS: THE IMMUNE SYSTEM
 * This logic ensures your node's "Contact List" is geographically 
 * and logically diverse.
 */
int AddrManImpl::GetNewBucket(const CNetAddr& addr, const CNetAddr& src) const
{
 // 1. We take the IP of the "New Peer" (addr).
 // 2. We take the IP of the "Person who told us" (src).
 // 3. We "Hash" them together with a "Secret Key" (nKey).
 uint256 hash = Hash(nKey, addr.GetGroup(), src.GetGroup());

 // 4. The result tells us which "Bucket" to put the address in.
 return hash.GetLow64() % ADDRMAN_NEW_BUCKET_COUNT;
}

Explaining the Immunity: The Diversity Engine

The Sovereignty of the Defense

Your node is "Skeptical by Design." It doesn't believe everything it hears, and it doesn't trust everyone it meets. By enforcing these diversity rules, your node ensures that its "Digital Horizon" is always wide and truthful. As a Sovereign Architect, you know that "Diversity is Security." By maintaining a node that protects itself from poisoning, you are ensuring your wealth is always anchored in the Global Consensus, not an "Attacker's Mirage." You are the "Master of the Immunity."


☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!