Trust is a pivotal element of any information system that allows users to share, communicate, interact, or collaborate with one another. Trust inference is particularly crucial for online social networks where interaction with acquaintances or even anonymous strangers is widely a norm. In the past decade, a number of trust inference algorithms have been proposed to address this issue, which are primarily based either on the "reputation" or the "Web of trust (WoT)" model. The reputation-based model supports objective inference of a universal reputation for each user by analyzing the interaction histories among the users; however, it does not allow individual users to specify personalized trust measures for the same other users. In contrast, the WoT-based model allows each individual user to specify a trust value for their direct neighbors within a trust network. However, the accuracy of such a subjective trust value is questionable and further subject to loss in the course of propagating trust measures to nonneighboring users in the network. In this paper, we propose a new trust model referred to as "Web of credit (WoC)," where one gives credit to those others one has interacted with based on the quality of the information one's peers have provided. Credit flows from one user to another within a trust network, forming trust relationships. This new model combines the objectivism from the reputation-based model for credit assignment by exploiting the actual interaction histories among users in the form of online rating data and the individualism from the WoT-based model for personalized trust measures. We further contribute a WoC-based trust inference algorithm that is adaptive to the change of user profiles by automatically redistributing credit and reinferring trust measures within the network. Experiments with two real-world data sets have shown that the WoC-based trust inference algorithm is not only able to infer more accurate trust measures than both reputation-based and WoT-based algorithms do but also fast enough to be a viable solution for real-time trust inference in large-scale trust networks.