Hacker News new | ask | show | jobs
by anacrolix 522 days ago
I'm the author of https://github.com/anacrolix/torrent and added v2 support a while back.

The short answer is: You just publish as v1 infohash as if nothing is different, but the info contains extra stuff for v2 supporting clients. v1 clients will still work, it's backwards compatible.

So generate your torrent files as hybrid v1/v2, then just do everything else like you always have. Pretend v2 isn't a thing.

v2 clients know how to tap into both swarms and will take advantage of improvements when applicable. It's very well designed.

1 comments

Thing is, I'm planning on just storing the infohash itself, as a reference (for a knowledge database essentially), not the torrent file, so wanted to use just one of them, and skip the other.

So if I do v1, why do v2? If I do v2, I'd like to skip v1. Ideally I'd do v2 (only) as it seems a heck more future-safe with sha256.

Edit: Actually, I think I see what you're saying. Create hybrid torrent that works with both, share the v1 infohash of that one, v2 clients will automatically take advantage of v2 from that if supported, sounds right?

Yes. You only need the v1 info hash. The first thing a v2 client does with a v2 hash is derive the v1 hash from it anyway. In fact it can't connect to v1 clients until it's done this so prefer v1 unless you have good reason.