## 4 Integrating Smart Contracts in BOA  
In this section we first discuss the current state of the art in the deployment of smart contracts in logistics and supply chains. We then discuss the implications and describe our suggested method for using the smart contracts in the process of building the product BOA. For reliable traceability, the smart contracts should be applied throughout the entire supply chain process. At the end of the production process, the final assembly requires intense application of smart contracts. At this stage, the BOA is developed along the assembly line, and therefore must be controlled by the assembly line's stations. The use of smart contracts in logistics and supply chains has gathered interest and experience in recent years, asserting the ability of smart contracts to provide traceability in various supply chains in different industries. The following cases are just samples from the literature on this subject. [PERSON] et al. [40] developed requirements for tracking and tracing using blockchain technology. They present a model that has been implemented in a proof of concept for traceability and tracking using smart contracts in the Ethereum blockchain. [PERSON] et al. [8] developed a decentralized blockchain application that meets rigorous traceability requirements of various assembly products and sub-assemblies. Their application combines an Ethereum network and a Proof-of-Authority consensus. The traceability is supported by special tokens that combine cryptography and data of complex assembly processes and structures. [PERSON] et al. [41] presented a case study in the dairy sector of blockchain-based food supply chain traceability. They implemented a set of functions to provide an end-to-end traceability flow, from raw materials acquisition to end customers' product delivery. The suggested method starts at the very beginning of the supply chain by verification of the raw materials. In case the raw materials are produced by automated machines, the  
Figure 3: Illustration of the sub-assembly 1.1 efficiency computations. verification could be done as part of the automated process by the attachment of smart tags (with a cryptographic shielding layer). In case the process is not automated, the smart tag authorization involves the people in charge (and their identity verification). From this point on, the verifications along the supply chain could and should be done by smart contracts. This automates the verification process and provides secure traceability. For each sub-assembly, there is a separate smart contract that has the information about the structure of the sub-assembly, and its precedence activities. For a given sub-assembly, the smart contract detects the availability of the sub-assembly components via scanning (e.g., RFID tags could be scanned with antennas [42]). Of course, the smart contract must verify the authenticity of the parts (checking the cryptography), and their compliance with the technical requirements of the sub-assembly. In Figure 4 we describe the verification logic of the smart contract related to activity 6 from Figure 2.  
Figure 4: Verification logic of the smart contract related to activity 6 (see Figure 2). Figure 4 demonstrates that the main process starts after the arrival of the workpiece at the workstation where activity 6 is performed. This arrival invokes the verification agent of activity 6. At the beginning, the agent of activity 6 is waiting for the completion tokens of predecessor activities 4 and 5 to initiate the smart contract verifications. The arrival of tokens 4 and 5 starts the verification process: first the tokens' authenticity is verified, then the operator identity is verified, then the raw material authenticity and type are verified, then the machine type and its suitability are verified. If all the verifications are successful, activity 6 is authorized and the timestamp is recorded. Activity 6 starts formally at this moment, and the static parameters relevant to Machine 3 are inserted by the smart contract code.