# Enhancing Data Integrity in Blockchain Oracles Through Multi-Label Analysis
## 3 Methods
### Testing and Deployment of Smart Contract on a Test Network with the Best-Evaluated Method  
The proposal's implementation uses Ganache, a technology that provides a test blockchain to simulate a local network environment. This environment is crucial as it allows for testing and debugging smart contracts before deploying them on public networks, ensuring their functionality is appropriate and error-free. In this case, the smart contract is deployed on a test network called CONTRATOS_FUTUROS_PRUEBA, specifically designed to simulate the conditions and transactions of the coffee futures contract scenario. Additionally, Truffle Solidity is used to program and develop the smart contract, a widely used framework in the Ethereum ecosystem. Truffle provides tools for compiling, deploying, and managing smart contracts efficiently, making integrating and managing contracts in the testing environment easier. As for the contract design, as shown in Figure 7, it begins with a variable call through the Oracle request. This step is essential because it allows for obtaining external information (in this case, related to coffee production data) validated through the smart contract. The oracle acts as a bridge between the external world and the blockchain, ensuring that the data used in the contracts are relevant and aligned with the actual context of transactions, such as coffee production for futures contracts. In the smart contract's data integrity validation process, the multi-level weighted hard voting method is implemented as a key indicator to assess whether the data meet the predefined integrity criteria. Figure 8 describes the techniques and exposes the results of several models, with precisely four bagging models predefined after the tests conducted in previous sections. These models provide their respective evaluations and perform the integrity, determining whether the analyzed data meets the required quality standards. The implementation of the IMWV process ensures that most of the models support the final decision. That is, if more than half of the models conclude that the data are valid, the data are accepted by the smart contract. This approach strengthens the system's reliability, reducing the impact of individual erroneous or biased results and enhancing the overall robustness and accuracy of the evaluation. Two daily tests were conducted, the results of which are detailed in the corresponding table. A latency test was also performed to measure the time required to complete this evaluation. For these tests, we used an HP ENVY 17 Leap Motion SENB computer with an  
Figure 8: Proposed application architecture. Intel(R) Core (TM) i7-4702 MQ processor (8 CPUs) and 16 GB of RAM in a local environment set up with the Ganache test network. We present the results of the two daily data transmissions in Figure 8.  
In Figure 9, the latency evaluation conducted during the data integrity validation process reveals that the time required to complete the verification is crucial for the performance of smart contracts. The data indicate that latency remains within acceptable limits despite the complexity of the IMWV process and the use of multiple bagging models, reflecting an efficient system design. However, latency can vary depending on network load and transaction complexity, highlighting the importance of continuously monitoring and optimizing latency to ensure optimal performance. An increase in latency can cause delays in decision making and risks of inconsistencies in the data. The effectiveness of the IMWV method depends on how quickly the models cast their votes; therefore, high latency can compromise the integrity of the final decision. In this regard, continuous latency optimization is essential to maintain trust in blockchain systems and their viability in real-world applications.