Release of libtorrent 2.0 with support for BitTorrent 2 protocol

Submitted by significant library release libtorrent 2.0 (also known as libtorrent-rasterbar), which offers an implementation of the BitTorrent protocol that is efficient in terms of memory consumption and CPU load. Library involved in torrent clients like Deluge, qBittorrent, folx, Lynx, Miro ΠΈ Flush (not to be confused with another library libtorrent, which is used in rTorrent). The libtorrent code is written in C++ and spreads under the BSD license.

Issue notable adding protocol support BitTorrent v2, which avoided the use of the SHA-1 algorithm, which has problems with selection of collisions, in favor of SHA2-256. SHA2-256 is used both to control the integrity of data blocks and for entries in indexes (info-dictionary), which breaks compatibility with DHT and trackers. A new prefix "urn:btmh:" has been proposed for magnet links to torrents with SHA2-256 hashes (for SHA-1 and hybrid torrents, "urn:btih:" is used).

Since the change in hash function breaks protocol compatibility (a field with a hash of 32 bytes instead of 20 bytes), the development of the BitTorrent v2 specification was initially carried out without regard to backwards compatibility and other significant changes were adopted, such as the use of a Merkle hash tree in indexes to reduce the size torrent files and checking downloaded data at the block level.

The changes in BitTorrent v2 also highlight the transition to linking separate hash trees to each file and the application of file alignment in parts (without adding padding after each file), which allows you to get rid of duplicate data when there are identical files and makes it easier to identify different sources for files ... Improved the efficiency of encoding the directory structure in torrent and added optimizations for processing a large number of small files.

To smooth the coexistence of BitTorrent v1 and BitTorrent v2, the ability to create hybrid torrent files, which include, in addition to structures with SHA-1 hashes, indexes with SHA2-256, is implemented.
These hybrid torrents can be used with clients that only support the BitTorrent v1 protocol. WebTorrent protocol support expected in libtorrent 2.0 due to unresolved stability issues postponed until the next major release, which will not be released until the end of the year.

Source: opennet.ru

Add a comment