Spare parts are essential assets to maintain productivity and operations. A spare part is used for the repair or replacement of failed units. Tracing and tracking of spare parts ownership can help to ensure reliable outcomes in terms of manufacturing operations and service delivery. However, today's spare part inventory systems fall short of providing reliable tracing and tracking of spare parts ownership which poses serious threats to their authenticity. Also, current approaches and systems leveraged for spare part inventory management are vulnerable to the single point of failures. In this paper, we propose a blockchain-based smart contract to trace and track the spare parts ownership details from the original equipment manufacturer to the supplier and end-users. We exploit blockchain features to build a secure and trusted spare part inventory system that is tamper-proof, traceable, trackable, accessible immutable, resilient, and reliable. The proposed system integrates decentralized storage of interplanetary file systems (IPFS) to store and share spare parts data. We present algorithms along with their full implementation details. We perform testing and validation of the smart contract. Furthermore, we provide security and cost analysis, and show how the proposed system ensures reliable tracing and tracking of spare parts ownership. We make the smart contract source code publicly available on Github.