Network Privacy: Tor, I2P, and the Shadow Network
17. Network Privacy: Tor, I2P, and the Shadow Network
In our next 1,100 words, we perform an audit of the Sovereign's Invisibility. For Bitcoin to be truly free, it must be possible to run a node without revealing your "Physical Location" (your IP address) to the world. We are building a "Shadow Network" of nodes that communicate through encrypted tunnels like Tor and I2P.
The Physics of the Hidden Tunnel
When you connect to the internet normally, your IP address is like a "Return Address" on an envelope. Anyone who sees the envelope knows where you live. Tor and I2P are like a "Global Network of Trusted Couriers" who pass your envelope through so many hands that the final recipient has no idea where it started.
Tor (The Onion Router) and I2P (Invisible Internet Project) are the primary tools Bitcoin Core uses to achieve this. By integrating these protocols directly into the node, we ensure that privacy is not an "Add-on," but a fundamental feature of the machine. The node can now "Listen" for connections on a hidden address (.onion or .b32.i2p) and "Speak" to other nodes without ever touching the public internet.
Analyzing the Invisibility: The src/i2p.cpp Audit
/**
* PEDAGOGICAL ANALYSIS: THE HIDDEN SESSION
* This logic (from src/i2p.cpp) shows how the node
* creates a "Private Tunnel" into the I2P network.
*/
namespace i2p {
namespace sam {
void Session::CreateIfNotCreatedAlready()
{
// 1. Check if the "Control Connection" is alive.
// We talk to the I2P router through a local "SAM" bridge.
if (m_control_sock && m_control_sock->IsConnected(errmsg)) return;
// 2. Create a "Persistent" or "Transient" session.
// A persistent session keeps the same I2P address
// even after the node restarts.
const auto session_type = m_transient ? "transient" : "persistent";
const auto session_id = GetRandHash().GetHex().substr(0, 10);
// 3. Request a "STREAM" session from the I2P router.
// We specify our signature type (EdDSA) and our
// desired tunnel quantity (inbound/outbound).
const Reply& reply = SendRequestAndGetReply(
*sock,
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s "
"SIGNATURE_TYPE=7 inbound.quantity=3 outbound.quantity=3",
session_id, private_key_b64));
// 4. The node now has a ".b32.i2p" address.
// It can now "Listen" for other Bitcoin nodes
// in total anonymity.
m_my_addr = CService(DestBinToAddr(MyDestination()), I2P_SAM31_PORT);
m_session_id = session_id;
}
} // namespace sam
} // namespace i2p
Explaining the Invisibility: The Purity of the Mesh
-
"The Decoupling from Geography": By using Tor and I2P, your node is no longer tied to a "Country" or an "ISP." You are a citizen of the "Network Itself." This makes it impossible for governments to block Bitcoin by simply blocking IP addresses. It is the Resilience of the Sovereign.
-
"The Anti-Surveillance Shield": Spies try to "Map the Network" by watching which IP addresses talk to each other. On the Shadow Network, these connections are encrypted and randomized. The spy sees "Noise," but the node sees "Truth." It is the Security of the Machine.
-
"The Permissionless Entry": In some parts of the world, ISPs block the Bitcoin protocol entirely. By "Wrapping" Bitcoin traffic inside I2P or Tor, the node bypasses these filters. It is the Freedom of the Protocol.
-
"The Hybrid Resilience": A modern Bitcoin node can run on the "Public Internet" and the "Shadow Network" at the same time. If the public internet is attacked, the node stays in sync via the hidden tunnels. It is the Stability of the Core.
The Philosophy of the Invisibility
As a Sovereign Architect, you know that "Privacy is the power to selectively reveal oneself to the world." Network Privacy is the node's way of "Choosing its own Visibility." It is the understanding that for money to be "Unstoppable," it must be "Untraceable."
We are building a "Digital Fog" that protects the participants of the economy. By making it easy and standard to run nodes over Tor and I2P, we ensure that the "Smallest Individual" has the same protection as the "Largest Institution." You are not just running a node; you are Commanding a Ghost in the Global Mesh.
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: