# Exploiting Blockchain Technology for Enhancing Digital Twins' Security and Transparency
## 5 Working Example  
This section presents a practical application of the proposed framework, illustrated through the case study of the AiWatch system [42]. The primary objective of this modular project is to develop a machine learning-powered system for the protection of physical environments (e.g., rooms, hallways) in real-time scenarios. By integrating the proposed architecture into a practical implementation, this study aimed to validate the obtained results while verifying the feasibility of the proposed design and highlighting its potential application in real-world systems. In the context of this application, each physical space is represented by its corresponding digital twin, while cameras serve as data-gathering agents for the virtual model by capturing and transmitting information on detected entities. The produced data are subsequently forwarded to an elaborating device, which is responsible for processing and analyzing the received information to enable effective system operation. As a last step of this procedure, the elaborated data are then retransmitted from different cameras into a final destination server employed for the update of the environmental digital twin represented. To facilitate efficient and reliable communication among devices within the system, the integration of Apache Kafka serves as the primary communication channel. By managing the system's data queues through Kafka's topic-based infrastructure, the architecture enables the security system to concentrate on validation tasks at the component level. The system adopts the JSON format as the communication standard, and with each data transmission within Kafka topics, the message is formatted, ensuring consistent data exchange standards across the system's components. The AiWatch system leverages real-time surveillance data to update digital twins, serving as a proper test case for validating the proposed blockchain-based security framework. By capturing and processing continuous streams of data from surveillance cameras, AiWatch updates the digital twin models with actionable insights in real time. This dynamic and complex data flow highlights several critical challenges, including ensuring the integrity and authenticity of transmitted data, maintaining system reliability under high transaction loads, and providing scalability to accommodate increasing data volumes or system expansions. The application of the blockchain-based proposed solution addresses these challenges by offering a decentralized and tamper-proof layer of data validation while providing a local autonomy for the actors involved resulting in enhancing both the security and transparency of the system. Within the AiWatch application, each component involved is assigned a specific identifier that is used consistently throughout this discussion. Specifically, the term _Tracker_ refers to the camera modules responsible for the initial processing of image frames, while the final destination server, tasked with managing digital twin information, is designated as _Ditto_. The latter is chosen as a direct reference to the _Eclipse Ditto_ 1.1.0 software, which empowers the module's functionality. The focus of this discussion lies in integrating the proposed security system into the pre-existing AiWatch architecture. To achieve this objective, the development of specialized sub-modules for both Tracker and Ditto was required, while the specified smart contracts and the underlying blockchain infrastructure were provided to support the system's functionality. A visual schematic description of the system is provided in Figure 9, where the proposed integration is included. For the purposes of this analysis, further exploration of the general functionalities provided by the AiWatch system was postponed in order to focus on the implementation of the security system for managing the digital twin's information. The objective was to achieve a secure and reusable interface for interacting with the digital twin, thereby ensuring consistent and reliable use of the collected data.