Peer to Peer - Incentive Mechanisms

Why bother understanding the peer to peer mechanism?

If I should build another network, I am curious to understand how this one works.

Underpinning it all are: incentives:

  • You must have something to gain. If you want something, you must give something.
  • A system built upon mooching will fail (e.g. socialist systems).

How does it work?

  • Demand: If you want a file, you are incentivised to obtain it from a peer-to-peer network.
  • Supply: If you want to share a file, you can do so on the network.

All networks begin with one node. If there is no incentive to get to the second node, then you have a broken network that will not grow. Metcalfe’s law is broken.

Let’s try to break the system:

Entry point: Somebody must initially share a file. Ideally he will share a file, so that he can receive another file (which he does not have). Assuming there is only one file in the universe, when the initial torrent user shares his file: he knows he will not be receiving another other file in return: why would he go to the effort of sharing his file, if he knows that he cannot benefit from its sharing? Simultaneously: other users: they are only interested in downloading the file: as soon as it has been downloaded: why would they become a “seeder” to incur the expenses of sharing the file? The system can only work if it a charitable system: where “seeders” are incentivised to freely share their files out of charity. To me, it seems that the network would work well if users are incentivised to share:

  • unique files - the more files there are to share, the larger the pool of new users who will enter, wanting to download from that set - but in order to participate, they must in-turn share files. i.e. they are providing something to the network, and will be receiving something.

The Algorithms in Peer to Peer.

Every node in the network has to answer the following questions:

  1. Which chunks (of files) should you request, from which neighbour?
  2. Which chunks should you SEND, to which neighbour.

The following algorithms seek to answer the above:

  • rarest first
  • priority: you send data to peers who are in-turn supplying you data at the highest rate.
  • randomly sending other peers data

Above all - these systems are designed to:

  • incentivise those doing the desired behaviour, vs.
  • minimising the free-rider problem: a situation where you get something, without providing anything in return.

If that were the case, then the entire network will be filled with moochers 1 . people downloading stuff, without uploading anything, in which case, there wouldn’t be any one left uploading anything. 1

Let us investigate each of these policies in turn.


Rarest First (Which chunks should you request)

If a chunk is rare: then the network seeks to produce more of it - and they get more quickly re-distributed. You will seek to obtain the chunks that are rarest, first.

Which chunks should you share, and to whom? (Trading Algorithm)

Send data (i.e give priority) to those who are sharing data with you at the highest rate. This encourages people to SHARE at high rates - so they will in turn get preferntial reception of data. You re-calculate the rates, and modify the set of peers from which you are downloading from, at a set interval. This set of “peers” are said to be “unchoked”

But how will you discover new people to peer from: those who may give you a better deal? You randomly send some data to a neighbour, Bob. If you send enough data to Bob, at high enough rates, you could become Bob’s top uploader, and you could then receive data from Bob in turn.

The other benefit: if you receive random chunks of data, for those who have nothing to trade, they can now “buy in” to the network: they now have something to trade. In effect, members of the network randomly invest in new members (by conscription). Perhaps there are other ways that people could “buy-in” to a network?

Other interesting mechanisms including: pieces (mini-chunks), pipelining, random first selection, endgame mode, and anti-snubbing Cohen 2003.

1 A system of moochers - akin to Australia’s NDIS system (a government funded disability scheme) where every man and his dog are claiming to be disabled (in order to get some sweet disability pay-cheques from the government). This gravy train will last as long as: the dollar remains above water, and the tax remains generous - both are rapidly depreciating stocks.

2 Socialism does not work here. If you want to get something, you have to give something. Only then can you start to have any leverage in getting what you want.

Written on January 8, 2024