Anonymous File Sharing: BitTorrent over I2P

Anonymous File Sharing: BitTorrent over I2P

In a typical file sharing setup, there are users and a server that receives a file from one user and allows others to download it. This scenario has two main weaknesses: the server’s network bandwidth and the issue of centralization. While a server’s network channel can provide good download speeds to a handful of users—say, a hundred—if thousands try to download at once, everyone’s speed drops dramatically. The server’s hard drive speed can also become a bottleneck, just like a weak network channel. All of this is a consequence of centralized architecture, whose main danger is that if the server goes offline, the file it hosts becomes completely unavailable.

BitTorrent is the most popular peer-to-peer file sharing protocol, allowing users to exchange files directly without relying on a central server. BitTorrent supports several modes of operation, often used together: via trackers, PEX (Peer Exchange), and DHT (Distributed Hash Table). Let’s break these down:

Basic BitTorrent Terminology

  • Peer: Any participant in the process.
  • Seed/Seeder: A peer who has the entire file. The user who creates the torrent is always a seeder at first, since only they have the full file. If you finish downloading and stay connected, you become a seeder too.
  • Leech/Leecher: A peer who is downloading the file but hasn’t finished yet. They can also upload the parts they’ve already downloaded to others.
  • SuperSeed: A special seeding mode where the seeder gives each downloader only unique file fragments, encouraging peers to exchange missing parts among themselves.

Trackers

A tracker is a server that participants contact to announce themselves and get information about other peers. After getting a peer list, a user requests file parts from them. Torrents contain hashes of file fragments, allowing users to download pieces from different peers and verify their integrity. The tracker only coordinates peers; it never touches the actual file. To minimize the impact of a tracker going offline, torrents can list multiple trackers, and anyone can add a new tracker to a torrent. This redundancy ensures downloads can continue even if one server fails.

PEX (Peer Exchange)

PEX is a BitTorrent protocol extension for exchanging peer lists. Besides file fragments, users send messages containing lists of peers who have joined or left the swarm. This helps new users quickly find peers without waiting for the tracker to update. However, PEX only works for users already connected to the swarm, and some clients have incompatible PEX implementations.

DHT (Distributed Hash Table)

DHT allows BitTorrent clients to find each other without a tracker. Each client is a node in the DHT network, with a unique ID randomly chosen from the same 160-bit space as torrent infohashes. Nodes store routing tables with contact info for many “nearby” nodes (based on ID similarity, not geography). To find peers for a torrent, a node compares the torrent’s infohash to known node IDs and queries the closest match, which then returns an even closer node, and so on. Eventually, requests reach nodes whose IDs are closest to the infohash, and these nodes remember previous requests and return peer addresses to new requesters.

DHT data is stored by the client independently of active torrents and is kept until shutdown or restart. DHT is updated whenever possible: from trackers, PEX, or other DHT nodes. DHT also enables publishing torrents without a tracker, usually via a magnet link containing the infohash. However, magnet links and trackerless torrents are useless if the user has no active DHT connections to find peers.

BitTorrent over I2P

The idea of file sharing over anonymous networks like I2P isn’t new. For regular users, I2P torrents are notable because ISPs can’t block torrents or trackers, as I2P is a hidden network focused on anonymity and untraceable traffic. BitTorrent and other peer-to-peer protocols rely on direct connections between users, which makes traditional torrents unsuitable for those who want to avoid being tracked or punished by authorities. In some countries, law enforcement joins torrents to track IP addresses of users sharing pirated content, leading to warnings or even police visits.

Public discussion of anonymous file sharing is often stigmatized, as anonymity is associated with criminals or extremists. However, there are many legitimate uses, such as whistleblowing (think WikiLeaks) or sharing information that’s criminalized by unjust laws. The ability to transfer files secretly can be a matter of life, health, or freedom. Anonymity is a broad topic, relevant to everyone from activists to ordinary users. This article is for a general audience and aims to educate, so that free technologies belong to everyone, not just a select few.

I2P technology ensures resistance to ISP censorship and anonymity among peers. It’s nearly impossible to trace I2P traffic or its source. All users and servers have cryptographic identifiers instead of IP addresses, which have no relation to physical location but allow communication. For more on I2P, see this article and related resources.

BitTorrent Clients for I2P

There are several BitTorrent clients that work over I2P. Some are multi-network (supporting both clearnet and I2P), while others are I2P-only. Using a multi-network client can be risky if misconfigured, as it may leak your real IP address. For example, if you download via I2P but have active DHT connections or trackers outside I2P, your client might relay darknet torrents to the clearnet, exposing your IP. This can have unpredictable and unpleasant consequences.

On the other hand, multi-network clients are useful for intentionally bridging torrents between networks. For example, you can download a movie from a clearnet tracker and seed it on I2P for those who can’t or don’t want to use traditional torrents. Just make sure not to alter the torrent, so the infohash remains the same, maximizing the number of peers across networks.

As of this writing, average I2P network speeds are around 40 KB/s, sometimes exceeding 100 KB/s. With default tunnel lengths (three hops in and out), speeds typically range from 20–50 KB/s. The actual upload speed of a seeder doesn’t matter much, as the file is sent to each user at up to 100 KB/s, limited by I2P’s factors like tunnel quality and length. The slowest link in the chain determines the speed.

Leechers play a crucial role in speeding up the swarm (all participants in a torrent). Despite low per-connection speeds, popular torrents can reach 2 MB/s in I2P thanks to collective sharing—many slow connections add up, like streams forming a river. BitTorrent’s architecture is perfect for distributing load and works well with I2P.

I2PSnark Torrent Client

You can find a list of I2P-compatible torrent clients in the i2pd documentation. If you know of others, you can contribute to the list. This article focuses on I2PSnark, the best I2P-only client for years. It only works over I2P, protecting inexperienced users from IP leaks.

I2PSnark was released around the same time as I2P itself (~2003) and is part of the Java I2P router, which includes several apps besides the core network function. I2PSnark communicates with the I2P router via the I2CP protocol, also supported by the lightweight, fast i2pd router (written in C++). To use I2PSnark standalone, you can build it from source or use a prebuilt binary from the I2P+ project, a soft fork of the main I2P router. Download links are on the documentation page.

Java applications require a Java Virtual Machine (JVM). You can install Java on almost any modern OS. Download the latest release for Linux, Mac, or Windows from the official page.

Before using I2PSnark standalone, enable the I2CP interface in i2pd (disabled by default). Edit i2pd.conf, uncomment enabled = true in the [i2cp] section, and restart i2pd. To find the config file, check the “Data path” on the i2pd web interface at http://127.0.0.1:7070.

The I2PSnark standalone archive includes launch-i2psnark and launch-i2psnark.bat. Use the .bat file for Windows, and the other for Unix-like systems (make it executable with chmod +x launch-i2psnark).

Interact with I2PSnark via its web interface at http://127.0.0.1:8002. It’s intuitive and easy to use. To change the language, go to settings (gear icon), select your language under “User interface,” and click “Save Configuration.”

Pay attention to the “Tunnel Configuration” section, which controls inbound and outbound tunnels. “Hops” are the number of transit nodes in a tunnel. More hops mean more anonymity but slower speeds. The default is three hops, but for everyday use, two or even one hop is fine. You can run multiple I2PSnark instances on one device: short tunnels for regular content, long tunnels for sensitive material. Copy the I2PSnark folder and change the port in jetty-i2psnark.xml (e.g., 8002 and 8003). Use different themes to avoid confusion. Note: I2PSnark changes its I2P identifier on each launch.

Downloading and Creating Torrents

To join a torrent, click the add menu (top button with a plus icon). In “From URL,” paste a magnet link or the path to a .torrent file. In “Data dir,” specify where to save downloads. Click “Add torrent” to start.

I2PSnark also supports “maggot” links (a variant of magnet links from the now-defunct Robert client), but today, “maggot link” is usually a mistaken term for standard magnet links.

You can also add a torrent by placing the .torrent file in I2PSnark’s main storage directory (i2psnark/i2psnark by default). The app will pick it up and start downloading automatically.

To create a new torrent, click the magic wand icon. Specify the full path to the file or folder to share, and select trackers to add. If you create a torrent without trackers, peer discovery will rely solely on DHT. If unsure, check all suggested trackers and pick one as primary (usually Postman: http://tracker2.postman.i2p).

After clicking “Create torrent,” your torrent will appear in the list. It’s best to keep shared files in I2PSnark’s default folder for convenience. The new .torrent file will appear alongside others, ready for sharing. Click the torrent name in the web interface for info. In the top right, you’ll find the infohash, magnet link (magnet icon), and a link to download the .torrent file. Right-click the magnet icon to copy the link for sharing.

When you create an important torrent, try to seed as long as possible so at least the first few peers can download the full file. After downloading from others, don’t disconnect immediately—seed if you can. Good etiquette matters everywhere.

Getting to know I2P torrent trackers is beyond this article’s scope, but it’s not difficult: make your torrents clear, informative, and well-presented.

Seedbox

A seedbox is a device for always-on seeding. Usually, it’s built from single-board computers and external HDDs, but any device that can run an I2P router and torrent client with high uptime and enough disk space will do. Seedboxing means not only seeding your own files but also supporting others’ torrents, at least during the release week. It’s a subculture focused on free information sharing, altruism, and hard drive prices.

Tips for building a seedbox:

  • Minimum RAM for i2pd and I2PSnark: 512MB; 1GB is comfortable.
  • Active torrenting can shorten hard drive lifespan due to constant read/write activity, especially when seeding to many peers. It’s better to use several smaller drives than one huge one—this boosts performance and reduces data loss risk if one fails. RAID setups can further protect against drive failure.
  • Ideally, the OS should be on a separate physical drive from the torrent content, especially on single-board computers where the OS runs from an SD card (which isn’t very durable).

Seedboxes based on budget single-board computers are especially relevant now that Linux kernel 5.15 supports SMB and NTFS, opening new possibilities for low-powered hardware—but that’s a topic for another day.

Postscript

Decentralization and the growth of free technologies depend on ordinary people. If we don’t want to rely on file hosters’ policies or ISP restrictions, everyone needs to contribute. In the early days of I2P torrents, seedboxing is critical for the technology’s development. Torrents in hidden networks are already common in countries where circumstances demand it, and bans and fines are spreading elsewhere. Consider investing in a single-board computer and a couple of hard drives for your own seedbox. Even if you’re new to Linux or SSH, the journey into free technologies and transparency is worth the effort. The culture of free software and hidden networks lets every user be an equal participant and guardian of technology and information—a pursuit as engaging as any top online game, but with the key difference that you grow and develop, not stagnate.

Leave a Reply