Blockchain-Based Solution for the Traceability of Spare Parts in Manufacturing

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.


I. INTRODUCTION
The rapidly growing automotive industries and technological advancements in the design of machinery have derived the demand for spare part components [1]. The spare parts supply chain management is complex and challenging as it involves globally interconnected partners and supply chain services. The transparency and visibility of operations during the supply chain process affect the conformity and safety of spare part components. The absence of reliable protocols to exchange data, dependency on human mediation to transfer valuable assets, and limited participation of stakeholders during the supply chain process can affect components' reliability, availability, maintenance, and total return on investment (ROI) [2], [3]. Blockchain technology can improve supply chain operations to increase system efficiency, minimize The associate editor coordinating the review of this manuscript and approving it for publication was Fabrizio Messina . maintenance costs, and secure business activities. According to the Accenture technology vision report, 86% of aerospace organizations will integrate blockchain technology into their corporate operations by 2021 [4]. One of the aerospace giants named Honeywell has employed blockchain technology to prove the provenance of Boeing parts and ensure they comply with safety standards [5].
A spare part is an interchangeable component of a system that is appropriate to replace a failed or damaged part [1]. Spare parts management is of critical importance as it is a maintenance service that maintains an adequate amount of spare parts to increase mean times between system failure and reduce the budget in the repair-and-reliability value chain. As a result, it significantly minimizes the spare part associated delays to increase the operational reliability of a system. The maintenance service to a system or component helps to restore its reliability and safety by enhancing the system's performance [6], [7]. For instance, in the aviation industry, airworthiness investigative authority (AIA) assigns a certificate of airworthiness (CoA) based on the health level of aircraft or components. Spare parts are heterogeneous and vary depending on their life cycle, design, type, and scrap rate. For instance, spare parts of an aircraft can be rotatable (e.g., brakes and wheels), repairable, expandable (e.g., fasteners), recoverable, and life-limited. The high-speed turbine rotor is a life limited spare part and its life cycle is subject to hours only [7], [8].
Traditional spare parts supply chain management is based on manual inventory management systems that are very slow, expensive, and difficult to manage and process. In the traditional systems, during the maintenance operations, tracing the provenance of a component is very difficult and it takes days to trace the history of a spare part. Also, the manual systems follow centralized storage architecture that makes it vulnerable to hackers and a single point of failure [9], [10]. Typically, web-based approaches are used to handle orders for purchasing and selling components. However, most of the organizations have restricted control over the supply chain process in recent years due to limited visibility and transparency that hinder the assessment of customer demand [11]. In comparison, blockchain technology presents a single, synchronized, secure, and immutable view of tamper-proof data [3], [7], [12].
To handle the aforementioned spare parts related supply chain challenges, blockchain technology proposes to permanently record all movements, modifications, restorations, and ownership details of spare parts on a distributed transparent and tamper-proof ledger. Furthermore, transparency of transaction records (e.g., frequent maintenance of components) increases the trust of customers and regularity authorities [8]. Using immutable transaction records, blockchain technology assists to identify counterfeit parts, minimize frauds, reduce components' maintenance costs and delays, and establish the provenance of assets based on the traceability feature [13].

A. RELATED WORK AND CONTRIBUTIONS
Tracing and Tracking are the most critical aspects of the existing supply chain management of spare parts. Moreover, their logistical operations are challenging to maintain because of the complicated architecture of industrial machines. Additionally, each component has different characteristics and features. For instance, many of the components can be installed, removed, maintained, and shipped within the organizations during their lifetime. In traditional systems, the data storage and sharing using web-interfaces, emails, and fax open the door for hackers to perform modification within the documents to falsify the truth [8], [14]. Also, the increasing demand for spare part components motivates the original equipment manufacturer (OEM) to directly provide support by-the-hour basis along with high-quality service assurance. The type, nature, and complexity of spare part components put forward demands for highly optimized algorithms that can ensure efficient planning and decision making during supply chain management [15].
The study conducted in [16] has proposed a tool to analyze and assure the high availability of spare parts for the uninterruptible production process. The proposed method aims to satisfy the customers to proactively handle interruptions in the production process resulting from planned and unplanned maintenance, repair, and overhaul operations. The presented tool managed the spare parts components into two classes based on their frequency of use and critical priority criterion. The critical spare parts are crucial to handle to assure the continuous production process. The criticality of components is forecasted based on a multi-criteria decision-making method called the analytic hierarchy process. The decision engine considered logistics costs, upper bound of delivery waiting time, spare parts warehouse location, and repairing time factors to schedule spare parts associated operations to minimize the downtime. The primary focus of the study was to manage the inventory of the spare parts. However, it lacks tracing and tracking of the spare parts ownership.
Similarly, in [17], the authors did not provide a mechanism to trace the spare part as its ownership is revoked from the OEM to the suppliers and end-users. The authors have proposed the integration of an intelligent maintenance system (IMS) to the supply chain to forecast the failure of components to improve the operational planning of spare parts supply chain. The proposed system incorporates and follows a heuristic approach, mixed linear programming (MILP) model, and the demand for spare parts indicated by the IMS module. It ensures that during erratic spare parts demand, components breakdowns are proactively handled without disrupting the production and logistic operations for the preset deadlines. The linear programming model optimizes the behavior of the system under certain conditions such as system capabilities, forecasts, and spare parts delivery dates (Stochastic variables). The scheduler for distribution and maintenance keeps a balance between cost and service level. Also, it ensures that spare parts are delivered before the deadline for higher customer satisfaction. Furthermore, the system proposed in [10], called FIEGE, has analyzed a web service-based logistics case study to establish a global information state about spare part components and documents exchanged among participating organizations. The key services of the proposed logistic system include shipment management, consolidation, freight calculator, tracking and tracing information and documents, event management, e-invoicing, and reconciliation. Among all services, consolidation combines multiple transport orders into a single shipment unit to reduce the total cost. During the shipment process, the proposed system offers two modes called manual and automated to update the location of the shipment for tracking purposes. On the other hand, tracking and traceability service helps to keep the track record of a component or document during its shipment. The proposed system has integrated several logistic systems for greater efficiency. The system was implemented on a four-layer web architecture server. The proposed system is viable to support the transfer of standard documents such as EDIFACT, VDA, XML, and FORTRAS. However, the proposed system is prone to errors, frauds, and vulnerable to a single point of failure.
In general, the spare part components are mostly managed based on cooperative pooling, commercial pooling, Adhoc, and in-house sourcing methods. In [18], the authors have proposed an Internet of things (IoT) based study to assess the four spare parts inventory management techniques as stated above. During the maintenance operation, the IoT-based system assists to optimize predictive and scheduled maintenance based on real-time monitoring data of maintenance operations, health history of component, and its remaining life expectancy. The proposed IoT-based solution does not cover a methodology to keep track of the ownership of the spare parts in case of accidents or other use cases.
On the other hand, the authors in [3], [7], [12], [19] have highlighted the importance of having a decentralized supply chain procedure for the management of spare parts. However, they did not discuss any system architecture design or algorithms in this regard. Although they have presented the various challenges that blockchain can help to resolve, they did not explore or study the issues related to tracing or tracking of the spare parts ownership.
Furthermore, the authors in [20], [21] proposed the use of cloud computing technology to support and facilitate spare parts supply chain management, operations, and services. Cloud computing is a technology that is widely used nowadays to provide computation and storage at scale with high availability and reliability. However, cloud technology is centralized in which the data and computation are done by a single platform which can be subject to data tampering and manipulation, hacking, mistrust, failure, and privacy evasion. By design, blockchain is decentralized, and computation and storage are done in a secure and trusted manner. This makes it ideal for supply chain tracking and tracing. In short, some of the key blockchain features include trusted data provenance [22], [23], transparency and visibility as well as data authentication and signature of origin, immutability and integrity-in a fully secure, trusted and decentralized manner. Furthermore, blockchain smart contracts can offer programmability to ensure execution of business logic with ordered execution of transactions according to predefined set of rules and policies, in a way that is open and trusted by all actors and organizations who are interacting with the blockchain network.
In summary, most of the above-mentioned solutions are primarily focused on inventory management systems that follow centralized management and record keeping. They are also unable to trace and track spare parts ownership history in a tamper-proof and transparent manner. This can be achieved using blockchain technology that is based on distributed and decentralized architecture. The lack of enough research on the tracing and tracking of spare part details and ownership in a decentralized way motivated us to conduct this study. Unlike the existing works, the key contributions of our paper can be summarized as follows: • We propose a blockchain-based solution that guarantees secure and trusted traceability, trackability, accessibility, immutability, and data provenance of spare parts.
• We introduce and develop smart contracts code and algorithms to implement the functions, modifiers, and trigger events.
• We integrate our blockchain-based system with the InterPlanetary File System (IPFS) to securely store the details of the spare part components in a decentralized way.
• We perform security and cost analysis to evaluate the reliability and practicality of the proposed solution.
• We propose a generic solution that can be implemented on a permissioned or permissionless blockchain depending on the needs of industries.
• We present the full implementation details, smart contract code, 1 and testing details.
The remainder of the paper is organized as follows. Section II presents the proposed blockchain-based approach. Section III describes the key implementation details. Section IV provides testing and validation details. Security and cost analysis are provided in section V. Section VI concludes the paper.

II. PROPOSED BLOCKCHAIN-BASED SOLUTION
The details of the proposed blockchain-based system to trace and track the spare parts in manufacturing are provided in this section. Figure 1 shows the components of the system along with the interactions between the different participating entities and the smart contracts.
• Participating Entities: Suppliers and the Original Equipment Manufacturer (OEM) usually interact with the participating entities of a company through the procurement manager. The participating entities include engineer, line manager, inventory manager, purchase manager, and procurement manager. All the participating entities possess Ethereum addresses to interact with each other through the blockchain network. The participating entities would access a decentralized application to communicate with the blockchain client through web3 and JSON-RPC. The engineer initiates the requests such as the purchase request (PR) and the purchase order (PO). The line, inventory, and purchase managers approve the requests and make confirmations based on their roles. To satisfy the privacy needs of an organization, the interactions between the suppliers and OEM are only viewed/heard by the procurement manager. Moreover, all the interactions of the organization's employees are restricted to a certain number of entities (viewed/heard). This can be achieved (if necessary) by using a private Ethereum blockchain or the Hyperledger. However, if the objective is to just trace back a spare part to the OEM through the suppliers and  random purchasers, a public blockchain can be used to meet such a requirement.
• IPFS Server: IPFS [24] is an essential part of the proposed blockchain-based solution. It stores all the images of the spare part from different angles as well as the purchase quotations (PQ) of the suppliers and OEM. The bidders provide their IPFS hashes when they present their PQs to the procurement manager and other entities of an organization. Storing such data on the chain can be extremely expensive. Alternatively, the IPFS is an emerging storage option that makes the solution feasible and tamper-proof.
• Smart Contracts: Each spare part has its smart contract. A spare part can be assembled from other spare parts. Consequently, every assembled spare part points to other smart contracts. Figure 2 shows in details how the smart contracts in Figure 1 represent the real spare parts of a car engine. A car engine is assembled from other spare parts such as an injection pump, air compressor, piston, and turbocharger. Each of those has a separate smart contract and the original parent contract is the engine's smart contract. Hence, the parent smart contract will have addresses of all sub-smart contracts.

A. COMMUNICATION BETWEEN THE PARTICIPATING ENTITIES
A public blockchain can be used to keep track of the spare part owners, if the participating entities have no privacy concerns. However, if the participating entities are employees of an organization then it is important to maintain the privacy of their logs and communication. At the same time, it is important to listen to the interactions between the suppliers and the OEM. Therefore, to maintain the transparency between the different vendors, a permissioned blockchain can be used. Hyperledger Fabric (HLF) is a private blockchain that allows certain users to use or access the blockchain. Communication channels are used in Fabric to ensure confidential communication between two or more parties. A channel can be designed by organization members and communicating members who must be authorized and authenticated. Moreover, privacy can be maintained using Hyperledger Besu which is an Ethereum client that has access control and management through its transaction manager 'Orion' [25], [26]. Additionally, it also has 'EthSigner' for managing identities and private keys [25].

III. IMPLEMENTATION DETAILS
We develop the smart contract in Solidity language using the Remix IDE [27]. The blockchain-based system is verified using the Ethereum smart contract that logs all the communication information between the participating entities. In this section, we discuss full implementation details along with algorithms. The implemented source code is made publicly available on GitHub.
Our proposed decentralized approach to trace and track the spare parts ownership is generic, and thus can be implemented on public or private blockchain infrastructure. It all depends on the use case. The participating entities can be only the Original Equipment Manufacturer (OEM), suppliers, and people who are interested in owning the spare parts, or it could be engineers and managers from a company in addition to the OEM and suppliers. The latter case requires additional privacy and access control to authorize only certain entities to listen/view the on-chain communications. In our implementation, we will explain the details of the algorithms that can be applied in a real scenario in a company. For instance, an engine needs a replacement, the whole on-chain procedure is demonstrated in the implementation from the Purchase Request (PR) to the Purchase Quotations (PQ), and finally the Purchase Order (PO). Figure 3 shows the sequential interactions between the members of a company when a spare part is required for maintenance. The engineer initiates the request by making a PR which is approved by the line manager. The inventory is checked to ensure whether or not the spare part available locally. This is followed by the PQs that are supplied by the procurement manager. The procurement manager is the only member that is allowed to listen/view the communication between the suppliers and the OEM. Hence, the procurement manager forwards IPFS hashes information provided by the suppliers and bidders to the engineer to examine and analyze them based on the requested specifications and criteria. In the final phase, the PO is placed by the engineer and is approved by the line manager and purchase manager.
It is important to mention that the spare part received was originally manufactured by the OEM and then provided to the company either through the OEM or through a supplier who bought it from the OEM or another supplier. Therefore, to trace and track the ownership details of the spare part, the ownership revocation of the spare part needs to be logged on the chain. In our implementation scenario, ensuring privacy of the communication information is achieved using private blockchain infrastructure as it helps to authorize participating entities and provides separate communication channels between suppliers and bidders. The sequential interaction between OEM and suppliers is explained in Figure 4. The spare parts ownership requested by the supplier is transferred to the new owner after the payment is completed using the smart contract. Tracing and tracking ownership records can be made manageable using blockchain's tamper-proof logging abilities and smart contracts. Details of the function calls and their events are presented as part of the algorithms. Each function holds a state change and is restricted based on the current state of the smart contract as well as modifiers. Modifiers restrict and control who can initiate a function call. Also, the Material and Equipment Standards and Code number (MESC) of the spare part is used in the algorithms to log the spare part identification number. Further details of the algorithms can be found in the next subsections.

A. SUBMITTING A PURCHASE REQUEST
Only an engineer can submit a purchase request for a required spare part when the status is 'Needs PR'. This status indicates that the spare part is currently unavailable in the local inventory, and thus needs to be purchased. At the end of this request, the state is updated to 'PR Submitted' and an event is triggered to notify the participating entities, as can be seen in algorithm 1.

Algorithm 1 Submitting a Purchase Request
Input Emit an event to notify everyone that a purchase request with the MESC number is submitted. Preview an error after returning the contract to its previous state. 9 end 10 end 11 else 12 Preview an error after returning the contract to its previous state. 13 end

B. APPROVING THE PURCHASE REQUEST
Once the PR is submitted by the engineer, the line manager needs to approve the request. Algorithm 2 shows how the state is updated as the line manager approves the request.

C. CONFIRMING THE UNAVAILABILITY OF THE SPARE PART LOCALLY
After the approval of the PR, the line manager creates a notification that notifies the inventory manager to confirm the unavailability of the spare part in the local inventory. The inventory manager follows the algorithm 3 when confirming that the item is not available locally.

D. SUBMITTING THE PURCHASE QUOTATIONS IPFS HASH
The next phase after getting the PR approval is to submit PQ to the engineer for evaluation. The procurement manager who is the only in contact with the suppliers and bidders submits the PQs' IPFS hash on the chain, as can be seen in algorithm 4.

E. SUBMITTING THE EVALUATION RESULTS
The engineer evaluates the quotations of the suppliers based on the company's criteria and requirements. The engineer is responsible to choose the best-fit supplier and submit the supplier's unique identification code as shown in algorithm 5. Emit an event to notify listeners about the successful approval of the PR. Emit an event to notify listeners that the PR is not approved.

F. APPROVING THE ENGINEER's EVALUATION
The line manager is required to approve the evaluation submitted by the engineer to complete the purchase process. Algorithm 6presents this process.

G. CONFIRMING SPARE PART CURRENT AVAILABILITY AT THE SUPPLIER
An approved evaluation result allows the procurement manager to step in and confirm that the spare part is currently available with the chosen supplier. This is the last step in the purchase quotations phase which leads to complete a purchase order request if all goes well. It is handled by the procurement manager as presented in algorithm 7.

H. SUBMITTING A PURCHASE ORDER
The PO is placed by the engineer through a function call, as can be seen in algorithm 8. When the PO is placed, the state is automatically updated.

I. APPROVING THE PURCHASE ORDER
The line manager approves the engineer's request against the PO as shown in algorithm 9. A boolean is passed as a parameter to the function to approve the request.

J. CONFIRMING THE PURCHASE ORDER BY THE PURCHASE MANAGER
The purchase manager is responsible to confirm the PO. The payment and delivery process can be made on the chain as discussed in detail using a proof of delivery blockchain-based Error reverse contract state to the previous one. Error reverse contract state and to the previous one. 14 end solution [28], [29]. Algorithm 10 explains the details of confirming the PO by the purchase manager.

K. ANNOUNCING THE AVAILABILITY OF SPARE PART IN THE INVENTORY
The successful procurement of the spare part makes it locally available in the inventory. The inventory manager creates a notification and announces the availability of the requested spare part using algorithm 11.

Algorithm 5 Submitting the Evaluation Result
Input : caller, SPstate, Engineer, supplierCode 1 caller is the Ethereum Address of the function caller. 2 6 Emit an event stating that the evaluation is approved by the manager. Emit an event stating that the evaluation is not approved by the manager.

L. COLLECTING THE REQUESTED SPARE PART
Once the spare part is locally available in the inventory, the engineer can collect it for its further distribution. The engineer announces collecting the spare part and updates its state as explained in algorithm 12.

IV. TESTING AND VALIDATION
In this section, we provide testing and validation details of the smart contract. We use an Ethereum smart contract to test the interactions between the employees of an organization. Emit an event to notify everyone that a purchase order is submitted. Preview an error after returning the contract to its previous state. 9 end 10 end 11 else 12 Preview an error after returning the contract to its previous state.

end
The purchase of the spare part and the delivery of the item is not tested in this paper, as it has already been implemented and discussed in our previous study [28], [29]. The participants including engineer, line manager, inventory manager, procurement manager, and purchase manager Emit an event to notify everyone that a purchase order is confirmed. Preview an error after returning the contract to its previous state. 9 end 10 end 11 else 12 Preview an error after returning the contract to its previous state. 13 end have the following Ethereum addresses, respectively; ''0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'', ''0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C'', ''0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB'', ''0x583031D1113aD414F02576BD6afaBfb302140225'', ''0xdD870fA1b7C4700F2BD7f44238821C26f7392148''.
Modifiers are tested to ensure that each function can only be executed by the authorized entity only. Also, the state Emit an event to notify everyone that the ordered spare part is now available. Preview an error after returning the contract to its previous state. 9 end 10 end 11 else 12 Preview an error after returning the contract to its previous state. 13  Emit an event to notify everyone that the spare part has been collected. Preview an error after returning the contract to its previous state. 10 end 11 end 12 else 13 Preview an error after returning the contract to its previous state. 14 end of the spare part components ensures the correct sequence is followed during execution without any repetition unless allowed. For instance, a new purchase request can only be submitted by an engineer if the old request is already completed and the spare part is not locally available. In the following subsections, we present the logs produced when the functions are successfully executed using the Remix IDE [27]. We further present a complete scenario of an engineer requesting a spare part by showing the logs of the main functions.

A. SUBMITTING A PURCHASE REQUEST
The engineer initiates the process by submitting a purchase request using a function called SubmitPurchaseRequest which changes the state and emits an event as shown in the logs in Figure 5.

B. APPROVING THE PURCHASE REQUEST
The line manager approves the PR of the engineer by using a boolean as an input in ApproveRequest function, as can be seen in Figure 6. After the purchase request is approved by the line manager, the inventory manager executes a successful transaction to ensure that the spare part is not available locally in the inventory. This updates the state of the spare part to 'NotAvailableLocally' which allows the procurement manager to supply on the chain the IPFS hash of the purchase quotations available from the bidders and suppliers.

D. CONFIRMING SPARE PART AVAILABILITY AT THE REQUESTED SUPPLIER
The last step before the engineer submits a purchase order is performed by the procurement manager where the spare part is confirmed to be available immediately at the requested and approved supplier. This is done using a boolean as an input parameter in the function ConfirmSparePartAvailability, as can be seen in Figure 8.

E. SUBMITTING THE PURCHASE ORDER
The engineer submits the PO request which emits an event announcing the submission of the request and updates the state to 'PurchaseOderSubmitted' as presented in Figure 9. This PO request is approved successfully by the Line Manager before the Purchase Manager confirms the purchase.

F. CONFIRMING THE PURCHASE ORDER REQUEST
The engineer submits the PO request which triggers an event announcing the submission of the request and updates the state to 'PurchaseOderSubmitted', as presented in Figure 9. This PO request is approved by the line manager before the purchase manager confirms the purchase.

G. ANNOUNCING SPARE PART AVAILABILITY IN THE INVENTORY
When the spare part is successfully procured and made available in the inventory, the inventory manager creates a transaction to announce its availability and readiness for collection. This is performed using the function Announce AvailabilityInInventory, as seen in Figure 11.

H. COLLECTING THE SPARE PART
The engineer collects the spare part from the local inventory and logs the event using the function CollectRequestedSpare Part to confirm and announce its collection. Also, the state of the spare part is updated to 'NeedsPR' which indicates that a new purchase request needs to be filed to place the order of a new spare part. A successful transaction can be seen in Figure 12.

V. DISCUSSION
The proposed blockchain-based system is evaluated in terms of security and cost to verify the reliability and feasibility of the solution.

A. SECURITY ANALYSIS
Blockchain can be vulnerable to attacks that target mining pools, smart contracts, and even digital wallets. For instance, a smart contract code of the Ethereum based Decentralized Autonomous Organization (DAO) has recently been exploited through a well-known hack named as the 'never ending ATM'. Sybil attacks are another type of attacks that can target the blockchain nodes. They empower a single node to take control over the network and block other users from using it. The attack that happened on the DAO can be prevented by examining the smart contract code for possible vulnerabilities. Moreover, consensus algorithms (e.g., proof of work and proof of stake) in blockchain can make the Sybil attacks impractical for the hacker [30]. In this way, blockchain can help to reduce the chances of attacks drastically.
The implementation code that is publicly made available on GitHub has been validated using a security tool named 'SmartCheck' and verified successfully against known vulnerabilities. The tool helps to evaluate and eradicate weaknesses in the code. Exploits and errors that can cause great losses and pose serious threats to data security and the participating entities are detected. Such bugs include time stamp dependence, malicious libraries, reentrancy, and locked money. Therefore, the code is free from the known threats and since it has no fall back functions or loops it is less vulnerable compared to other smart contracts.
On the other hand, by design, Blockchain has built-in security features that allow for building a trusted, secure, and resilient services and networks. For instance, security requirements such as integrity, authorization, non-repudiation, availability, and privacy can be easily achieved using blockchain [31]. Table 1 highlights key spare parts supply chain challenges and how blockchain can help to resolve such challenges.

B. COST ANALYSIS
Any transaction on the chain costs a certain amount of Ether or cryptocurrency. The transaction fee of every function is calculated as gas in the Ethereum blockchain, but the cost is paid in 'Ether'. On the other hand, the 'gas price' provides the cost in Ether for a unit of gas, which is given the unit 'Gwei'. Therefore, a higher amount of Gwei would incentivize the miners and elevate the transaction's priority. Hence, it is important to study and examine the code for possible ways of decreasing the cost and making it more efficient. In our Ethereum smart contract, we have a dependency on the logs to trigger events and trace the spare parts details. There are no arrays or mappings used. Moreover, we have used bytes32 whenever possible instead of strings to increase the efficiency and the feasibility of the solution. Table 2 shows the cost details of the algorithms used in the smart contract. The table shows the algorithm number based on the execution order in the smart contract and the order of appearance in section III (the Implementation Details). The table shows the transaction cost, which includes the execution cost as gas. To calculate the cost in USD ($), we have used the gas price in the Eth Gas Station. Based on the gas prices offered by the ETH Gas Station on May 7, 2020, the fastest, fast, average, and cheap gas prices were found as 10, 6.6, 4, and 4 Gwei, respectively [32]. In table 2, we have used the average gas price of 4 Gwei to calculate the cost in USD. The highest cost is $ 0.0264 which is almost negligible. The calculated cost for the algorithms is as expected as they follow a constant time complexity O(1). The algorithms do not have any loops or arrays as they only used to trigger notifications. Hence, the cost is very minimal.

C. TRACING SPARE PARTS REQUIREMENTS
The spare parts are reliably being tracked from the OEM to the suppliers and end-users using the proposed blockchain system. Provenance data is available on the chain using logs and events which capture the details of all on-chain transactions. The proposed solution is decentralized that ensures non-repudiation and accountability as every transaction is signed by the address of the caller. Each function is restricted using modifiers to only authorize a specific participant to execute it. Furthermore, because of data integrity, transparent, and tamper-proof features of the blockchain, trust is easily acquired and is part of the solution. Also, the proposed solution relies on IPFS for the storage of the spare part details and information. The proposed solution relies on the security features of the blockchain technology that make it resilient and reliable. Finally, our solution can be easily implemented on permissioned or permissionless blockchain based on the needs and requirements of enterprises.

D. OPEN CHALLENGES
Blockchain is a promising technology that can play a key role in shaping and transforming the way spare parts are managed, traced, and tracked. However, Blockchain is still maturing and is relatively a new technology facing many challenges that need to be overcome before being widely adopted and deployed in the supply chain management domain. Some of these challenges include scalability, governance, energy consumption, privacy, security of smart contract codes, transaction costs, and interoperability [33]. VOLUME 8, 2020 It is worth noting that blockchain is the preferred platform to record and store alerts about serious notifications and violations that may be triggered by blockchain-enabled IoT devices to trace and track shipment, products, or equipment during the supply chain phases [34], [35]. In today's Cyber Physical Systems (CPS), the accuracy of the reported data to the blockchain are as accurate as the devices reporting them. More specifically, the accuracy of the data stored on-chain depends on the source that is feeding the data to the network. By design, blockchain ensures that the stored data and relevant transactions are immutable, secure, and tampered-proof with trusted data provenance and history [36]. Blockchain also ensures authentication of data origins. It is to be noted that blockchain can be a computational expensive platform for storing large-size data. Therefore, blockchain solution and systems usually integrate decentralized storage technologies like IPFS or SWARM, or cloud platforms, for storing large-size data and files. The hashes of these large-size data are then stored in blockchain.

VI. CONCLUSION
In this paper, we have proposed blockchain-based tracing and tracking of spare parts ownership from the OEM to the suppliers and end-users. We developed smart contracts to implement the functions, modifiers, and trigger events. In our proposed solution, we integrated decentralized storage services (IPFS) to store the details of the spare parts and quotations of the suppliers. We provided detailed discussions on implementation, testing, and validation aspects. Our proposed solution is generic enough and can be adopted for permissioned or permissionless blockchain platforms depending on the use case. Hyperledger Fabric and Hyperledger Besu are two possible permissioned blockchains where authorization, access control, and confidential communication can be achieved. For future work, we plan to implement and evaluate the cost and performance of our blockchain solution when deployed on these two permissioned networks, and show how such deployment and implementation can satisfy defined system requirements. The implemented code of the smart contract was made publicly available on GitHub and it has been successfully verified for the known vulnerabilities using the SmartCheck tool. We presented cost analysis to demonstrate the practicality to use and adopt our proposed solution by users and organizations involved in the trading, management, and traceability of spare parts. Overall, our technical details presented in this paper (with regards to blockchain system design, architecture, smart contracts and algorithms) are generic enough and can be used and integrated in most popular blockchain platforms. He is currently a Full Professor with the Department of Electrical and Computer Engineering, Khalifa University, United Arab Emirates. He has over 220 publications and three U.S. patents, has been giving a number of international keynote speeches, invited talks, tutorials, and research seminars on the subjects of blockchain, the IoT, fog, and cloud computing, and cybersecurity. He has served as the Chair of the Track Chair of the IEEE Globecom 2018 on Cloud Computing. He is an Associate Editor of the IEEE Blockchain Tech Briefs, and a member of IEEE Blockchain Education Commitee. He is also leading a number of projects on how to leverage blockchain for healthacare, 5G networks, combating deepfake videos, supply chain management, and AI.
RAJA JAYARAMAN received the bachelor's and master's degree in mathematics from India, the Master of Science degree in industrial engineering from New Mexico State University, and the Ph.D. degree in industrial engineering from Texas Tech University. He is currently an Associate Professor with the Department of Industrial and Systems Engineering, Khalifa University, Abu Dhabi, United Arab Emirates. His expertise is in multi-criteria optimization techniques applied to diverse applications including supply chain and logistics, healthcare, energy, environment, and sustainability. His research interests include primarily focused on using blockchain technology, systems engineering and process optimization techniques to characterize, model and analyze complex systems with applications to supply chains, maintenance operations planning and healthcare delivery. His Postdoctoral Research was centered on technology adoption and implementation of innovative practices in the healthcare supply chains and service delivery. He has led several successful research projects and pilot implementations in the area of supply chain data standards adoption in the US healthcare system. His research has appeared in top-rated journals including:

MOHAMMED OMAR is currently a Full
Professor and the Founding Chair of the Department of Engineering Systems and Management (currently renamed industrial and systems engineering). Prior to joining the Masdar Institute/KUST, he was an Associate Professor and a Graduate Coordinator with Clemson University, Clemson, SC, USA. He was a part of the Founding Faculty Cohort of Clemson University Research Park, Greenville, SC. He has over 100 publications in the areas of product lifecycle management, knowledge-based manufacturing, and automated testing systems, in addition to authoring several books and book chapters. He holds four U.S. and international patents.