Personalized quality of service (QoS) prediction plays an important role in helping users build high-quality service-oriented systems. To obtain accurate prediction results, many approaches have been investigated in recent years. However, these approaches do not fully address untrustworthy QoS values submitted by unreliable users, leading to inaccurate predictions. To address this issue, inspired by blockchain with distributed ledger technology, distributed consensus mechanisms, encryption algorithms, etc., we propose a personalized QoS prediction method for web services that we call blockchain-based matrix factorization (BMF). We develop a user verification approach based on homomorphic hash, and use the Byzantine agreement to remove unreliable users. Then, matrix factorization is employed to improve the accuracy of predictions and we evaluate the proposed BMF on a real-world web services dataset. Experimental results show that the proposed method significantly outperforms existing approaches, making it much more effective than traditional techniques.