TeachMeBitcoin

The Unroutable Void and the Support for CJDNS

From TeachMeBitcoin, the free encyclopedia Reading time: 3 min

The Unroutable Void and the Support for CJDNS

[!NOTE] Technical Context: netbase.cpp | Lines 106-112

In lines 106 through 112 of netbase.cpp, we conclude the network taxonomy. This block introduces support for the CJDNS network and defines the "Default Failure Mode" for the network parser: the NET_UNROUTABLE state. This is the final layer of the node's geographical classification engine.

1. "cjdns": Support for Hyper-Scalable Mesh Networks

Line 107-108 handles the CJDNS network.

What is CJDNS?

CJDNS is a networking protocol that implements an encrypted, decentralized IPv6 mesh network. Unlike the regular internet, CJDNS uses public-key cryptography to assign addresses, making it natively secure and resistant to man-in-the-middle attacks.

By including NET_CJDNS in the core taxonomy, the Bitcoin architect is acknowledging that the future of the internet might be decentralized mesh networks. It shows that Bitcoin is not just "stuck" on the legacy internet; it is a "Multi-Protocol Sovereign." It can live on any substrate—TCP/IP, Tor, I2P, or Mesh—ensuring that even if the centralized internet fails, Bitcoin can continue to propagate over specialized peer-to-peer hardware.

2. NET_UNROUTABLE: The Safety Bucket

Line 111 is the "Default Case" of the function: return NET_UNROUTABLE;.

In computer science, this is known as a "Sentinel Value." If a user types something that the node doesn't recognize (e.g., "ham-radio" or "satellite"), the function doesn't crash or return a random value. It returns NET_UNROUTABLE.

The Security of Failure

Returning NET_UNROUTABLE is a Security Defense. If the node can't categorize a network, it refuses to route traffic to it. This prevents "Ambiguity Attacks," where an attacker might try to trick a node into using an insecure network by giving it a slightly misspelled name. If the name isn't perfect, the node considers it "Unroutable."

3. Closing the Taxonomy

Line 112 closes the ParseNetwork function. We now have a complete mapping:

  • Legacy: IPv4, IPv6.

  • Privacy Layers: Onion (Tor), I2P.

  • Mesh Layers: CJDNS.

  • The Void: Unroutable.

4. Architectural Synthesis: The Logical Switchboard

The ParseNetwork function acts as a "Logical Filter" for the entire codebase. Every other function in the netbase module (and the higher-level net module) will rely on these six enums to make decisions.

  • "Should I use a proxy?" -> Check if the network is NET_ONION.

  • "Is this peer reachable?" -> Check if the network is NET_UNROUTABLE.

By defining these boundaries early and clearly, the architect has created a "Self-Documenting State." When a developer sees NET_ONION, they instantly know the privacy guarantees and technical requirements of that connection.

5. Conclusion: A World Categorized

Lines 106-112 provide the final "Punctuation" to the node's network identity. We have defined the known worlds and established a safe "Void" for the unknown. This taxonomy is the bedrock upon which the entire P2P routing engine is built.

In Article 0047, we will transition into the first of the "Setter" functions, where these enums are used to configure the node's physical routing table.

☕ 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!