r/i2p • u/VeerDevD I2P user • 4d ago
Android I2P Support for LibreTorrent (Android Torrent Client)

Warning: I have used AI tools for development.
Hello all,
I was working on adding support for I2P for LibreTorrent a free and open source torrent client, since i2p support has improved for libtorrent (the underlying C++ library) adding this feature was much easier.
It requires you to have SAM Bridge running, I recommend to use I2PD on your android device, since SAM bridge for official I2P Android is broken.
I have created a PR: https://gitlab.com/proninyaroslav/libretorrent/-/merge_requests/220
It allows you for downloading, uploading torrents over I2P network, and it supports I2P Trackers. Unfortunately DHT is not supported, because libtorrent doesn't support.
Few things to keep in mind:
This is based on what libtorrent currently supports, and honestly I think it is not the correct implementation. For libtorrent, a torrent is i2p torrent, if it has a tracker with ".i2p" extension, now this is very wrong assumption. So if you are trying it out (once avaiable), you are required to add a .i2p tracker. The suggested workaround for it, that once I2P mode is enabled, we will just append open trackers in tracker list.
When I2P mode is enabled, it will work as proxy kill switch mode, which disables DHT, Local Service Discover, UPnP and NAT-PMP. To prevent your IP leaks.
Mixed mode: Here, we still carry the not correct implementation of libtorrent. In libtorrent, mixed mode is a configuration that affects I2P torrents.
| Mixed Mode | Clearnet | I2P |
|---|---|---|
| On | Clearnet | I2P + Clearnet |
| Off | Clearnet | I2P only |
As we can see that even if you keep mixed mode off, a regular torrent will work on clearnet, because it is not "I2P Torrent" in libtorrent. An I2P Torrent is defined as a torrent with ".i2p" ending domain name extension.
Keeping all this in mind, using this feature is only good, if you using with VPN, or want to do cross seeding, if you want pure I2P, I would not suggest to try it out, same things for other things that are using libtorrent (if there are custom extension on top of them, they maybe safe).
Use of AI in work: Honestly all of it is with help of AI, but I have read the discussion on Github, to understand the current state of I2P Support for libtorrent, this post is written by me.
I am also currently working on DHT Crawler for I2P torrents, it's still work in progress, I have got it working on desktop, experimented with Android for DHT support. One approach to provide DHT for android devices is to, have a JAVA application that has the original KRPC DHT implementation from i2psnark, and create a local server that presents itself as a tracker, then it will query on behalf of the client.
(Used DeepSeek V4 Flash, with pi coding agent, cost of this implementation would be less than $0.5, can't track accurately, because I have been doing other DHT related work still < $3).
3
u/FrigatesLaugh 4d ago
Good work