Peers in P2P networks share resources voluntarily. They may arbitrarily terminate services, and some peers may provide fake services, so the QoS of services are not reliable. Moreover, peers are self-interest and rationality. Some peers always abuse resources but seldom contribute their own resources, which induces the free-riding in P2P networks. Traditional security schemes can hardly solve the fake services providing and free-ridings in P2P networks. The trust model based on reputation can restrain these kinds of malicious behaviors. However, it suffers much from strategically altering behaviors and dishonest feedbacks from malicious peers. Recurring to the trust model of society network, a distributed trust model based on vector space is proposed. This trust model uses ‘time-sensitive factor’ to improve the sensitiveness of detecting peers' behaviors, and recommendation trust based on vector space model to prevent collusion and bad-mouthing among peers. Furthermore, a distributed implementation schema based on R-Chain is proposed. Simulation and analysis show that this trust model is effective and has favorable feasibility of implementation.