## 1 Introduction  
Assembly of complex products found in various industries (such as aviation, automotive, medical, and heavy-duty machinery) is extremely complex and involves many thousands of parts and operations, as well as huge amounts of human resources and machinery. Controlling, monitoring, and documenting the assembly processes becomes a major challenge. From the supply-chain perspective, the challenge is to trace and document the parts, sub-assemblies, and operations, from the bottom level up to the final assembled product. Safety and security go hand in hand in the production of these assemblies [1], and even more so for the medical devices industry. This paper describes a framework for automating the documentation and verification processes along the assembly of complex assembled products. This is achieved by tracing and validating the proposed concept of Bill-Of-Assembly (BOA) is which incorporates data from the bill of materials (BOM), the bill of operations and processes, and the bill of resources (machines and/or operators). The automation is accomplished by integrating smart contracts into all the stages of the assembly according to the BOA, to attain full traceability of the product sub-assemblies, parts, and processes. This integration enables automated verifications and authorizations for the many stages of the supply chain and the assembly process. The result is an advanced assembly data structure that could be the backbone of the product's digital twin (DT). The proposed smart contracts are based on a platform of blockchain that gives it the advantages of immutability and security. While the aircraft industry requires strict traceability [2], supply chains of other complex products such as automobiles often lack traceability and documentation. However, legal authorities such as the National Highway Traffic Safety Administration of the USA, or Federal Motor Transport Authority of Germany, require end-to-end traceability of parts [3]. [PERSON] et al. [4] stated that: \"The complexity of large assemblies has fostered segmentation and decentralization of production chains and exacerbate their information management. Consequently, interoperability, as well as data integration and exchange, have become a major challenge in discrete assembly processes and induce the need for innovative traceability solutions\". To tackle this challenge there were several attempts to use blockchain technology. For example, [PERSON] and [PERSON] [5; 6] focused on data management and traceability. Furthermore, [PERSON], et al. [7] used a blockchain solution in an aircraft assembly setting. [PERSON] et al. [8] developed a decentralized blockchain application called TokenTrail, which focuses on the specific traceability requirements of multi-hierarchical assembly structures. This is an important proof of concept that supports the use of smart contracts, as advocated in our paper and in [PERSON], et al. [9] and [PERSON] et al. [10]. Traceability becomes crucial for the identification of defective parts in recalls, and even more so when multiple suppliers are involved [11]. Defective parts must be rapidly identified among massive number of vehicles. The prohibitive cost of manual investigation in such cases increase the attractiveness of automating the traceability [3]. Another challenge is the detection of counterfeit parts, especially in after-sales markets [11; 12]. [PERSON] et al. [13] suggested a framework for supply chain traceability based on blockchain tokens. However, they did not use the approach as suggested here. Smart contracts are contract paragraphs written in computer programs [14]. Smart contracts are automatically implemented when prerequisites are met, thus preventing human errors. Smart contracts automatically perform transactions, and are stored, replicated and replaced (if needed) in distributed ledgers [15]. To attain the trust of all stakeholders of the assembled product, the contracts must be decentralized programs cryptographically protected with verified immutability.