What is BEP 27: Private Torrents Explained
BEP 27 (BitTorrent Enhancement Proposal 27) is the official specification that defines how BitTorrent clients must handle private torrents. By introducing a standardized “private” flag within the torrent metadata, BEP 27 instructs BitTorrent clients to disable decentralized peer discovery mechanisms—specifically Distributed Hash Tables (DHT), Peer Exchange (PEX), and Local Peer Discovery (LSD). This ensures that swarm membership and data transfer remain strictly controlled by the specified tracker, preserving access control and tracking accuracy for private communities.
How BEP 27 Works
BEP 27 operates by placing a single key-value pair inside the
info dictionary of a .torrent file:
info: {
"private": 1
}
When a torrent client opens a .torrent file containing
private: 1 (or any non-zero integer), it enters private
mode for that specific swarm. Because this key resides inside the
info dictionary, it is part of the torrent’s cryptographic
info-hash. If anyone alters or removes the flag, the info-hash changes
entirely, preventing users from tampering with the privacy status
without breaking compatibility with the rest of the swarm.
Interaction with Peer Discovery Extensions
Standard BitTorrent relies heavily on decentralized peer discovery to find peers without overloading centralized trackers. However, BEP 27 explicitly restricts these extensions to protect the swarm.
1. Distributed Hash Table (DHT)
DHT allows clients to find peers by querying a decentralized network using the torrent’s info-hash. * BEP 27 Behavior: The client must not publish its presence to the DHT for private torrents, nor may it query the DHT to obtain peer lists.
2. Peer Exchange (PEX)
PEX allows connected peers to share lists of other peers they are currently connected to within the same swarm. * BEP 27 Behavior: The client must disable PEX for the private swarm. It cannot send its peer list to other peers or accept peer introductions from them.
3. Local Peer Discovery (LSD)
LSD broadcasts multicast packets across a local network to find neighboring seeders and leechers. * BEP 27 Behavior: Compliant clients disable LSD on private swarms to prevent leaking metadata or transferring data outside tracker authorization.
Why BEP 27 is Crucial for Private Trackers
Private torrent trackers require absolute control over who enters a swarm and how much data is uploaded and downloaded.
- Ratio Enforcement: Private communities track user upload-to-download ratios. If PEX or DHT were active, unauthorized users could download data without reporting stats back to the tracker.
- Access Control: Trackers use unique passkeys embedded in the announce URL to authenticate members. Disabling decentralized discovery ensures that only users with valid tracker credentials can join the swarm.
- Swarm Isolation: It prevents private swarm info-hashes and IP addresses from leaking into public decentralized indexing networks.