Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume you have files locally present (already downloaded, retrieval unrelated t

ID: 660254 • Letter: A

Question

Assume you have files locally present (already downloaded, retrieval unrelated to problem) and you know or are very certain that they have something (some blocks of data) in common with a torrent you want to download. Is there a client which allows reading a (user selected) selection of files, comparing it against the list of block checksums of the torrent file and skipping blocks based on locally present data.

An example would be a live system ISO of an OS of which you know (or guess) that it didn't change 50 or 30 or 10 percent of its content in comparison to a newer version. Normally you'd use zsync if possible, but that depends on a central server. How would I save the traffic with the same idea zsync is based on in a bittorrent architecture?

The only prerequisite for server and client should be that they speak bittorrent and arbitrary bittorrent or magnetlinks should be usable with the solution.

I know about (solutions which don't comply with prerequisite):

zsync which does this job outside the bittorrent world. As there's no checksum transfer in HTTP, that has to be handled in zsync with .zsync files.
jigdo which is great for updating only relevant parts of (Debian) iso images, but it's not integrated into bittorrent
Deduplicating filesystems like btrfs or ZFS offer deduplicated streamed transmission of subvolumes/datasets (e.g. btrfs send and zfs send), but they're now really suitable for simple download tasks.

Explanation / Answer

What you'll need to do is read through the torrent file and compare all the hashes with a hash table of files you have on your local system.

Then, rebuild a local directory tree that is identical to what is in the torrent file. Afterwards, when you access the torrent with a manager, it will see the existing files and on retrieve non-existing ones.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote