We propose a mechanism for providing the incentives for reporting truthful feedback in a peer-to-peer system for exchanging services (or content). This mechanism is to complement reputation mechanisms that employ ratings' feedback on the various transactions in order to provide incentives to peers for offering better services to others. Under our approach, each of the transacting peers (rather than just the client) submits a rating on the performance of their mutual transaction. If these are in disagreement, then both transacting peers are punished, since such an occasion is a sign that one of them is lying. The severity of each peer's punishment is determined by his corresponding non- credibility metric; this is maintained by the mechanism and evolves according to the peer's record. When under punishment, a peer does not transact with others. We model the punishment effect of the mechanism in a peer-to-peer system as a Markov chain that is experimentally proved to be very accurate. According to this model, the credibility mechanism leads the peer-to-peer system to a desirable steady state isolating liars. Then, we define a procedure for the optimization of the punishment parameters of the mechanism for peer-to-peer systems of various characteristics. We experimentally prove that this optimization procedure is effective and necessary for the successful employment of the mechanism in real peer-to-peer systems. Then, the optimized credibility mechanism is combined with reputation-based policies to provide a complete solution for high performance and truthful rating in peer-to-peer systems. The combined mechanism was experimentally proved to deal very effectively with large fractions of collaborated liar peers that follow static or dynamic rational lying strategies in peer-to-peer systems with dynamically renewed population, while the efficiency loss induced to sincere peers by the presence of liars is diminished. Finally, we describe the potential implementation of the mechanism in real peer-to-peer systems.