Incentives In Peer-To-Peer Systems
Free-riding in p2p (Gnutella: two thirds free riders); the p2p file-sharing game as a Prisoner's Dilemma; direct vs indirect reciprocity and why reciprocative strategies fail to scale under random matching; treating strangers and whitewashers; reputation systems (KaZaA, EigenTrust, Credence) and collusion, Sybil and whitewashing attacks; a minimalist generosity-type model with contribution cost 1/x, fixpoint dynamics, tipping point and collapse for theta_m < 4 (Claim 23.1); reputation-based service differentiation, threat vs reduced cost, and full cooperation when p >= 1/alpha (Claim 23.2); BitTorrent barter, opportunistic unchoking and its rational manipulations; FOX and non-credible grim triggers; currency systems (Golle et al., threshold equilibria and optimal money supply); hidden actions as moral hazard, principal–agent model with AND/OR read-once technologies, marginal contribution and optimal contracts c/Delta_i, price of unaccountability, single 0-to-n transition and unbounded POU for AND (Theorem 23.8), all transitions and POU at most 5/2 for OR (Theorem 23.9), #P-hardness of optimal contracts on read-once networks (Theorem 23.10)
Motivation: voluntary contribution among strangers
Napster (1999) and Gnutella (2000) showed that millions of strangers could self-organize to share content. Yet within six months, two thirds of Gnutella users were free-riding: downloading without uploading. This was long before copyright lawsuits gave users any reason to hide.
Why cooperation is hard in p2p:
| Feature | Consequence |
|---|---|
| large scale, high turnover, anonymity | most transactions are one-shot interactions between strangers |
| hidden actions | defections may be undetectable |
| cheap pseudonyms | identities can be multiplied (Sybil) or discarded (whitewashing) at no cost |
IntuitionThe central question
Every p2p system — file sharing, streaming, mesh networking, anonymity overlays — depends on peers voluntarily contributing resources they would rather keep. What mechanism makes contributing individually rational, and which mechanisms survive peers who can lie, hide their effort, and change identities at will?
The strategy space is rich. Beyond share/don’t share, peers choose:
- what private information to reveal (resources, workload, costs, willingness to pay);
- how much hidden effort to exert;
- whom to connect to (network-formation-games);
- when to arrive and leave (strategic churn);
- how to manage their own identities and treat others’.
NoteP2P as a live laboratory
Deployed p2p systems provide concrete evidence of strategic behaviour at scale, and real user populations on which to validate proposed mechanisms.
| Mechanism | Reciprocity | Long-term state | Example |
|---|---|---|---|
| barter | direct | none needed | BitTorrent |
| reputation | indirect | reputation scores | KaZaA, EigenTrust |
| currency | indirect, stored | account balances | MojoNation, Karma |
| contracts | — (moral hazard) | outcome-contingent payments | packet forwarding |
The p2p file-sharing game
Each peer is sometimes a client, who benefits from a download, and sometimes a server, who pays bandwidth and CPU costs to upload.
WarningOne-shot: free-riding is dominant
In a single interaction, a rational peer downloads as a client and refuses to upload as a server. This is the Prisoner’s Dilemma: mutual defection is the unique equilibrium, a tragedy of the commons.
DefinitionDirect vs indirect reciprocity
- Direct reciprocity: condition your action toward a peer on that peer’s past actions toward you (e.g., Tit-for-Tat in the Iterated PD). The “shadow of the future” deters defection.
- Indirect reciprocity: condition your action on the peer’s past actions toward others. This requires shared information, i.e. reputation.
Why direct reciprocity doesn’t scale
With random matching in a large, dynamic population, two peers rarely meet again, and even more rarely with their client/server roles reversed. The shadow of the future is too faint.
ExampleFigure 23.1 — reciprocators win small, lose large
A simulation (Feldman et al. 2004) starts with equal shares of three strategies: always defect, always cooperate, and a reciprocative generalization of TFT. Each round, a strategy’s population share grows in proportion to its payoff.
- Population 60: reciprocators take over within 1,000 rounds.
- Population 120: defectors win. Pairwise encounters are too rare for reciprocity to punish defection.
Two remedies follow, and they organize the rest of the chapter:
- Force repeat interaction with a small set of peers. This is BitTorrent’s barter, and it works for large, popular files.
- Share information so that behaviour toward others counts. This is reputation, and it covers many files and long timescales.
Dealing with strangers
In high-turnover systems, peers constantly meet strangers with no history. The policy toward strangers is a critical design choice:
| Policy toward strangers | Problem |
|---|---|
| always cooperate | exploited by whitewashers, who leave and rejoin as “newcomers” |
| always defect | robust to whitewashers, but discourages real newcomers and can trigger defection cycles |
| cooperate with fixed probability | not robust against whitewashers |
| cooperate with probability adapted to strangers’ recent cooperation | effective against whitewashers, at least for low turnover |
WarningThe root problem
A whitewasher is indistinguishable from a legitimate newcomer. Any generosity toward newcomers is generosity toward defectors in disguise.
Reputation
Reputation sustains cooperation from evolutionary biology to eBay. In p2p it is paired with service differentiation: contributors earn good reputations and receive good service; free riders get poor service.
ExampleDeployed and proposed reputation schemes
- KaZaA: uploading raises your score, and a high score earns download priority.
- EigenTrust: aggregates local trust into global trust values via transitive trust, like PageRank. Peers serving inauthentic files get low trust and are shunned.
- Credence: reputation attached to objects rather than peers. Defends against pollution and poisoning attacks.
Similar schemes exist for p2p storage, p2p multicast and mobile ad hoc networks.
Attacks on reputation systems:
| Attack | Mechanism |
|---|---|
| collusion | peers boost each other with false praise, or target a victim with false accusations |
| Sybil | one peer creates many colluding identities |
| whitewashing | defect every time, and rejoin under a fresh identity before bad reputation bites |
NoteScope
A full treatment of reputation systems is in Chapter 27. Here the chapter uses a minimalist model to show why reputation-based service differentiation raises contribution.
A minimalist model: generosity types
DefinitionMinimalist p2p model
Each peer has a type : its generosity, the maximum contribution cost it will bear. Contributors carry the system’s load, so when a fraction of peers contribute, the per-contributor cost is . A rational peer:
FormulaEquilibrium contribution level
The equilibria are the intersections of the type distribution with the cost curve, plus , which always exists.
Fixpoint dynamics. From some , peers decide, their decisions define a new , and so on. Write .
- If (cost exceeds willingness), contribution falls.
- If , contribution rises.
With two nonzero fixpoints :
| Region | Direction | Fate |
|---|---|---|
| down | collapse to | |
| up | converge to | |
| down | converge to |
IntuitionA tipping point
and are attractors, and is an unstable tipping point. Fewer contributors means a heavier load on each, which drives more of them away. If too few start out generous, or if the curves don’t intersect at all (“too many selfish rascals”), the system collapses.
DerivationUniform generosity
Step 1: The willingness curve. For , .
Step 2: The fixpoint equation. , i.e. .
Step 3: Solve.
The larger root is stable and is not.
Step 4: Read off Claim 23.1. Real roots need . At , . As , .
PropositionClaim 23.1 — generosity threshold
The stable nonzero equilibrium increases in and as , but falls to zero when .
System performance. Each peer, contributor or not, gets benefit with large, so collapse is socially bad. Only contributors pay, each. With the network size normalized to 1:
WarningHigh benefits don’t save a stingy population
Even if is huge, low maximal generosity () collapses contribution, and with it all the benefit.
Reputation-based service differentiation
DefinitionPenalty mechanism
A reputation system catches free riders with probability , and caught free riders are excluded. Equivalently: free riders are identified perfectly but receive only times a contributor’s service.
The penalty has two effects, both raising contribution:
| Effect | Formula |
|---|---|
| reduced cost : free riders consume less, so the load falls to | |
| threat : free-riding forfeits a fraction of the benefit |
With individual benefit :
- a contributor gets ;
- a free rider gets .
A peer contributes iff .
FormulaNew fixpoint and performance
DerivationSimplifying
Let . Then
PropositionClaim 23.2 — enough threat eliminates free-riding
If , there is an equilibrium with .
ProofAt full contribution, the threat outweighs the cost
At : and , so for every peer, and everyone contributes. There are no free riders, so no penalty is ever actually imposed, and performance reaches the optimum .
∎
ImportantThreats that are never executed
When participation is valuable ( large), a small penalty, or a small probability of catching free riders, suffices for full cooperation regardless of generosity. The penalty is socially costly only off the equilibrium path. If is small, a harsher penalty or a finer sieve is needed.
Barter: BitTorrent
DefinitionSwarming download
A seed splits a large file into fixed-size pieces and gives different pieces to different peers, who exchange pieces with each other. Each peer’s download rate depends on its upload rate: barter, i.e. direct reciprocity.
AlgorithmBitTorrent peer selection
- On starting a download, join a set of about 40 peers sharing the same file.
- Upload to 4–5 neighbours, periodically replacing them with the peers giving the best download rates (tit-for-tat).
- Opportunistic unchoking: occasionally upload to a random peer from the set, to discover better partners.
IntuitionManufacturing a shadow of the future
Chunking forces many repeated interactions with a small set of peers during one download. That restores what random matching destroyed (Figure 23.1b). It also needs no long-term state (no reputations or balances), which simplifies the design and makes it more robust to attack. Empirically, BitTorrent communities free-ride much less.
WarningNo incentive to seed
Barter lasts only as long as the download. Once a peer has the whole file, nothing rewards it for continuing to upload as a seed. Many communities layer a reputation scheme on top and exclude low contributors.
Rational manipulations (Shneidman et al. 2004, via “specification faithfulness”):
- understate upload bandwidth while preserving your rank among uploaders, so you upload less without downloading less;
- Sybil: split into several identities to be picked more often by opportunistic unchoking;
- whitewash identities when beneficial;
- upload garbage to inflate your apparent upload rate.
NoteOpen problem
Can BitTorrent, or any barter scheme, be made robust to all rational manipulations? Faithfulness here is the same concern as computational manipulation in distributed-algorithmic-mechanism-design.
ExampleFOX (Fair, Optimal eXchange)
Assume homogeneous peers, each serving requests in parallel and minimizing completion time. FOX schedules block exchanges on a static -ary tree with a synchronized protocol. If everyone complies, all peers finish optimally.
Enforcement is a grim trigger: a peer that detects a deviating neighbour can trigger a meltdown of the whole system, so any deviation means infinite completion time.
WarningNon-credible threats
FOX’s equilibrium is not subgame perfect: nobody actually wants to melt down the system after a deviation. And a single malicious or faulty node can destroy everything. So FOX has limited practical value.
Currency
Peers earn currency by contributing and spend it to consume (MojoNation, Karma).
TheoremGolle et al. (2001) — first equilibrium analysis
If each peer is charged in proportion to the gap between its downloads and uploads, there is a unique strict Nash equilibrium in which every peer maximizes both uploads and downloads.
NoteStated without proof
The chapter cites this result without derivation.
TheoremFriedman et al. (2006) — threshold equilibria and money supply
For each fixed money supply, if peers are patient enough, there is a nontrivial Nash equilibrium in threshold strategies: satisfy requests, and earn money, while your balance is below a threshold; refuse once it is above.
IntuitionMoney supply as a policy lever
Comparing equilibria across money supplies identifies the efficiency-maximizing supply for a system of a given size. The effective supply can be tuned either by injecting or removing currency, or by changing the price of a service request. So inflation is a tool for keeping a growing system efficient.
WarningCurrency is also vulnerable to whitewashing
Whitewashing pays whenever newcomers receive a positive opening balance, or balances may go negative, even temporarily: run up a debt, then vanish.
Hidden actions: contracts for unobservable effort
Free-riding is observable in principle. Many p2p actions are hidden.
ExampleHidden effort in networks
- Gnutella and KaZaA peers are expected to forward queries, but can silently drop them or forward only probabilistically. Best-effort delivery and a changing topology make shirkers unidentifiable. If everyone drops, search stops working.
- MANET devices drop packets to save energy.
- ISPs practise hot-potato routing to avoid carrying traffic.
DefinitionMoral hazard
The economists’ name for hidden action, familiar from insurance and labour contracts. The principal–agent framework measures the efficiency lost and designs optimal contracts that pay on observable outcomes.
The principal–agent model
DefinitionPrincipal–agent setting (Feldman et al.)
- agents. Agent chooses (shirk or work) at cost , .
- A contractible outcome (failure or success). The principal values success at and failure at 0.
- A technology gives the success probability .
- Assumptions: effort always helps, , and always.
DefinitionRead-once networks; AND and OR
A graph with a source and a sink, where each agent controls one edge. Agent ‘s edge succeeds with probability if it shirks and if it works. The project succeeds iff some source–sink path succeeds. Anonymous case: .
| Technology | Rule | With agents working |
|---|---|---|
| AND | all edges succeed | |
| OR | at least one edge succeeds |
graph LR
subgraph AND["AND: packet forwarding along one path"]
S1["s"] -->|"agent 1"| M1["relay"]
M1 -->|"agent 2"| M2["relay"]
M2 -->|"agent n"| T1["t"]
end
subgraph OR["OR: multipath routing"]
S2["s"] -->|"agent 1"| T2["t"]
S2 -->|"agent 2"| T2
S2 -->|"agent n"| T2
end
| Running example | Technology | What the sender observes |
|---|---|---|
| packet forwarding in a MANET: each hop is an agent | AND | only whether the packet arrived |
| multipath routing: duplicate over disjoint paths, one agent per path | OR | whether any copy arrived |
| query forwarding in p2p file sharing | OR-of-AND | — |
Contracts. Under limited liability (no fines), a contract pays agent an amount on success only.
The principal picks contracts to maximize its utility at a Nash equilibrium of the agents. With multiple equilibria it may “suggest” one. This is justified here because the best Nash equilibrium is also a strong equilibrium, and often the unique one.
DefinitionDefinition 23.3 — marginal contribution
The increase in success probability when switches from shirking to working, given the others’ actions.
PropositionClaim 23.4 — best response
Agent works iff (indifferent at equality), since .
PropositionClaim 23.5 — optimal contracts for a target profile
To induce : pay to shirkers and to workers. Then
- a working agent earns , an information rent;
- the principal earns .
IntuitionWhy hidden action costs the principal
The payment must make effort worthwhile on the margin. But it is paid whenever the project succeeds, including when it would have succeeded without ‘s effort. So each worker is paid . The principal gets only the second best.
RemarkWhen hidden action is free
Consider AND with : a shirker always fails. Then , the information rent vanishes, and the principal gets the first best. This holds with direct contracts, or with recursive contracts in which each agent contracts with the next.
The price of unaccountability
If actions were observable, the principal would pay exactly per worker, so its utility would equal social welfare, . Let and be the optimal worker sets under hidden and observable actions.
DefinitionDefinition 23.6 — price of unaccountability
This is the worst multiplicative loss from not being able to monitor individual actions. In the forwarding example, it is what the sender loses by seeing only end-to-end delivery. (It plays the role of a price of anarchy; see inefficiency-of-equilibria.)
LemmaLemma 23.7 — monotonicity
For any technology, in both the hidden- and observable-action cases, the principal’s optimal utility, the success probability of the optimal contract, and its expected payment are all nondecreasing in . For anonymous technologies, the number of workers is nondecreasing in .
TheoremTheorem 23.8 — AND: all or nothing
For anonymous AND with :
- there is a threshold (depending on ): below it contract with no one, above it with all , and at both are optimal;
- the POU is attained at the hidden-action transition point:
WarningAND’s POU is unbounded
as (any ) or as (any fixed ). A forwarding sender induces effort from all hops or none, and can lose enormously from not monitoring. This makes a case for network monitoring, even if it is costly.
IntuitionWhy AND is all-or-nothing
On a serial path, one agent’s effort is worth little unless the others also work: is tiny when others shirk. Effort is complementary, so once it pays to motivate anyone, it pays to motivate everyone. For the same reason, each worker’s required pay is huge when is small.
TheoremTheorem 23.9 — OR: every transition, bounded loss
For anonymous OR with :
- there are thresholds such that for , contracting with exactly agents is optimal (none below , all above );
- for every , and .
IntuitionWhy OR is gradual
Parallel paths are substitutes: each extra working path adds less than the previous one. So the principal adds workers one at a time as grows. The information rent stays moderate, bounding the loss.
NoteProofs omitted
Theorems 23.8 and 23.9 and Lemma 23.7 are stated without proof in the chapter (Feldman et al. 2005 and follow-ups).
Computational hardness
For general read-once networks, the optimal contract depends on which agents work, not just how many.
TheoremTheorem 23.10 — optimal contracts are #P-hard
The optimal contract problem for read-once networks is #P-hard (under Turing reductions).
ProofSketch: recover network reliability from the contract threshold
Step 1: Start from network reliability. Take an instance : compute , the probability that some path works when edge works with probability . This is #P-hard (Provan–Ball).
Step 2: Build . AND in series with a new agent having just below and . For the original edges, set and .
Step 3: Agent enters last. With , ‘s effort barely matters, so it joins the optimal contract only at very large , after all of .
The key step: use the supposed optimal-contract algorithm to find the critical at which enters. There the principal is indifferent between and , and that indifference equation can be solved for .
∎
NoteOpen problems
Which families of technologies admit polynomial-time optimal contracts? How well can optimal contracts be approximated, given that network reliability has an FPTAS (Karger)?
Open problems
NoteTwo challenges from the chapter
- A catalogue of rational manipulations. Which manipulations are specific to a mechanism, and which apply to all? Sybil and whitewashing robustness matters for reputation, barter and currency alike. Can a design be tested against a comprehensive catalogue?
- Beyond perfect rationality. Real populations mix rational, boundedly rational, altruistic, malicious and faulty peers. What solution concepts fit p2p and distributed systems? This calls for cross-fertilization with behavioural economics and computer security.
Quick reference
| Object | Statement | Note |
|---|---|---|
| Gnutella free-riding | two thirds within six months | pre-lawsuits |
| One-shot file sharing | free-ride is dominant | Prisoner’s Dilemma |
| Direct reciprocity | TFT on your own history with the peer | fails under random matching at scale (Fig. 23.1) |
| Indirect reciprocity | condition on behaviour toward others | needs reputation |
| Strangers policy | adapt cooperation to strangers’ recent behaviour | fixed fails vs whitewashers |
| Reputation attacks | collusion, Sybil, whitewashing | cheap pseudonyms |
| Minimalist model | contribute iff | cost |
| Fixpoint | attractors , ; tipping point | |
| Uniform types | ||
| Claim 23.1 | in , ; collapse if | |
| Performance | ||
| Penalty: cost | reduced load | |
| Penalty: threat | lost benefit | |
| Penalty fixpoint | ||
| Penalty performance | ||
| Claim 23.2 | ⇒ equilibrium | threat never executed; welfare |
| BitTorrent | about 40 peers, 4–5 neighbours, opportunistic unchoke | barter; no seeding incentive |
| BitTorrent manipulations | understate bandwidth, Sybil, whitewash, garbage uploads | Shneidman et al. |
| FOX | -ary tree schedule plus grim-trigger meltdown | not subgame perfect |
| Golle et al. | charge downloads − uploads ⇒ unique strict NE | |
| Friedman et al. | threshold equilibria; optimal money supply | inflation as a lever |
| Principal–agent | , cost , pay on success | limited liability |
| AND / OR | / | forwarding / multipath |
| Marginal contribution | Def 23.3 | |
| Claims 23.4–23.5 | work iff ; optimal | information rent |
| POU (Def 23.6) | observable-action optimum / hidden-action optimum, worst over | price-of-anarchy analogue |
| Lemma 23.7 | utility, success probability, payment nondecreasing in | |
| Thm 23.8 (AND) | one transition ; | unbounded |
| Thm 23.9 (OR) | all transitions ; | |
| Thm 23.10 | optimal contracts on read-once networks are #P-hard | via network reliability |
Facts to keep to hand
- Every mechanism rebuilds the shadow of the future differently. Barter forces repeat play, reputation broadcasts history, currency stores it as a balance. All three fail when identities are free: Sybil multiplies them and whitewashing resets them.
- Generosity toward newcomers is a subsidy to whitewashers. They are indistinguishable, so any fixed welcome can be exploited. Only welcome levels adapted to observed newcomer behaviour resist it.
- Contribution has increasing returns, which creates tipping points. The cost per contributor is , so participation feeds on itself upward and unravels downward. is always an equilibrium, and a stingy population () always falls to it.
- Good threats are never executed. With , everyone contributes and no penalty is imposed. The cost of the mechanism is paid only off the equilibrium path. The flip side: FOX’s threat is so extreme that it isn’t credible (not subgame perfect).
- Hidden action is moral hazard. Pay-on-success contracts must reward the marginal contribution , so they overpay by an information rent. The size of the loss depends on complementarity: AND (complements) gives all-or-nothing contracting and unbounded POU; OR (substitutes) gives gradual contracting and POU .
- Monitoring has value exactly where effort is complementary. AND’s unbounded POU argues for investing in per-hop monitoring. OR’s bounded POU says end-to-end observation is nearly enough.
- Designing optimal contracts can be as hard as computing reliability. They are #P-hard on general read-once networks.
References
- Nisan, Roughgarden, Tardos, Vazirani, Algorithmic Game Theory — chapter 23 (Babaioff, Chuang, Feldman)