P2P network is open, anonymous, dynamical in contrast with conventional network. It’s full of dishonesty, deceit, selfishness. It’s necessary to build a robust security infrastructure system. The one important module of security infrastructure is to identify the users in transactions. This paper will propose an identification solution based on PKI. In our algorithm, the peer generates their public-private key pairs by themselves, to issue certificates, and perform authentication without any centralized services. It can realize the identification, meanwhile keep peers anonymous. Moreover, it can limit the quantity of ID that a user applies for; alleviate the risk of Sybil attack.