Does IPFS use bittorrent or bitswap?

From @iskradelta on Wed Nov 30 2016 21:13:11 GMT+0000 (UTC)

Or bitswap and bittorrent?

What is bitswap, how does it deal with free-riders/leechers in the swarm?

Copied from original issue:

From @raptortech-js on Tue Dec 06 2016 19:25:33 GMT+0000 (UTC)

IPFS uses Bitswap. It does not use Bittorrent in any way. Any references you see to Bittorrent are likely from people trying to explain the similarity, as Bitswap is similar in many ways to Bittorrent. You can learn more about Bitswap by reading this paper: Section 3.6 explains Bitswap.

Bitswap does not set one true way of dealing with leeches; instead, it allows clients to set their own Bitswap strategies. A Bitswap strategy tells a node how it should request and send blocks to/from its peers. In the paper, they discuss one possible strategy, which uses a “sigmoid scaled by a debt ratio.” I don’t understand the math involved, but basically it should elegantly handle free-riders and the retention of rare blocks and so on.