In this paper we study the optimal file-sharing mechanism in a peer-to-peer network with a mechanism design perspective. This mechanism improves upon existing incentive schemes. In particular, we show that peer-approved scheme is never optimal and service-quality scheme is optimal only under certain circumstances. Moreover, we find that the optimal mechanism can be implemented by a mixture of peer-approved and service-quality schemes.JEL Classification: D82, C72