Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torrent v2 format support #188

Open
Artoria2e5 opened this issue May 14, 2023 · 0 comments
Open

Torrent v2 format support #188

Artoria2e5 opened this issue May 14, 2023 · 0 comments

Comments

@Artoria2e5
Copy link

Artoria2e5 commented May 14, 2023

BitTorrent v2 has been a thing since 2020. A good technical overview is given by https://blog.libtorrent.org/2020/09/bittorrent-v2/. In short, it:

  • restructures the hash calculation around SHA-256
  • Uses a merkle tree, so that
    • piece sizes do not affect the hash any more (allowing file deduplication).
    • piece sizes actually no longer affect downloading that much, because verification can be done down at the fixed 16 KB block level. So you have more freedom to use bigger pieces.

These changes necessarily change the info-hash, for which they have made a new thing called "btmh" based around, you guessed it, SHA256. It is possible to make a hybrid v1/v2 file, though the file size will approximately double.

What does it mean for mirrorbrain? Well...

  • New .btmh URL handling for the new kind of info-hash.
  • hashes.py needs some work to generate the v2 values (Python reference implementation in blog post should help). DB will need to change.

The LTv2 documentation also mentions tightened bencode requirements. The url-list and sources behavior in https://github.com/poeml/mirrorbrain/blob/76f2909e33004a7f5e0dd52b816881eb9fbd4246/docs/configuration.rst#generating-torrents, if it still exists, needs to be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant