IMO this is very doable whether Kubo can do this very efficiently or whether it’d be more efficient to leverage existing IPFS library code (e.g. the Go code that goes into Kubo or some of the alternatives in JS or Rust). There are already a number of IPFS implementations out there so making a new one out of similar parts doesn’t seem like a stretch.
As you mentioned the strawman version of this is pretty easy already you can run a kubo node and use a local (or public) HTTP gateway and call it a day . The complexity comes with making sure your bytes on disk are deduplicated and the UX for synchronizing the “keep my stuff” concept between the IPFS and BitTorrent implementation.
One way to get started here if you wanted to handle serving data over common IPFS protocols (e.g. Bitswap) as well might be to fork/leverage one of the multiple existing BitTorrent implementations and integrate the IPFS pieces into it. I’m pretty sure there are a number of Go-based BitTorrent clients that would make plugging in some of the Go IPFS tooling not too rough. There’s a bunch of funding and grants going into IPFS implementations these days too if that’s something you’re interested in.
As an aside you might be interested to know that there’s another way that IPFS compatibility with BitTorrent might be achieved. Namely, you could take the merkle-tree used for BitTorrent data and work with that data via IPLD rather than strictly the UnixFS file format most people first encounter when working with IPFS.
This would mean that instead of requiring an ipfs://<some-cid>
in the webseed you implementations downloading torrents (even without webseeds) could check if <bittorrent-infohash>
was available using IPFS tooling (e.g. someone advertised it in the IPFS Public DHT and made it available over Bitswap).
For example, if you look at the bottom of my post in IPLD and IPFS - A Pitch for the Future ⚾ you can see an example of loading a file from inside of a BitTorrent directory referenced by the BitTorrent infohash. It’s still early work, but if you’re interested in pushing in that direction there are likely a bunch of people (including myself) who can give you some pointers on where to go from here.