## 5 Experimental Results and Analysis  
An experiment was successfully performed that proved the feasibility of the proposed system to publish and retrieve authenticated, encrypted environmental IoT sensor data by using a distributed ledger. The MAM protocol ensured the source's validity and the data's integrity, which were formatted in the JSON format. We also demonstrated how an environmentalist might change the authentication keys to restrict permission to the data they may publish in the future. As a result, we demonstrated the potential of granular access controls, defined by the environmentalist.  
A private Tangle was created, which consisted of three full nodes, called the coordinator, and two neighbor nodes, namely, \"Neighbor Node_1\" and \"Neighbor Node_2\" to test our proposed work, as shown in Figure 8. All three nodes were set up on three Linux Ubuntu servers with Hornet installed on them. Hornet is a powerful, community-driven IOTA node software written in the Go language and is a lightweight alternative to the IOTA reference implementation (IRI). Hornet was developed for the secure transfer of tokens or data, and for experimenting and implementing IOTA protocols between nodes or network participants. Machines can act as a node and connect to the IOTA network with the help of the Hornet software. These nodes or machines have functions such as authenticating the transactions, storing these authenticated transactions on the Tangle, and fetching these transactions back from the Tangle whenever required.  
The dataset used was an open-source dataset that contained the environmental sensor data in a JSON format. The data included environmental parameters, such as temperature, timestamp, unique device id, carbon monoxide level, humidity percentage, light detected, liquified petroleum gas content, motion detected, and smoke levels. The payloads were created, and three actions (namely, create, attach, and fetch) were performed and analyzed in 300 trials. The Windows client machine, also known as the IOTA client, published and retrieved sensor data in the form of transactions to the Tangle. The client machine connects to the private Tangle using IOTA API and can make various API calls to perform various tasks. The experiment was performed with two approaches--(1) using the MAM protocol and (2) a non-protocol-based approach.  
An experimental assessment was performed to evaluate the scalability of the two approaches. To achieve this, we focused on the three major tasks (i.e., create, attach, and fetch) that occur when publishing and fetching transactions. For the \"create\" task, we calculated the time it takes to create the transactions before publishing them to the IOTAnodes. The IOTA API was used to create the transaction object from the data payload and the execution time for this task was measured, which is called \"create time\".  
The next step was to execute the \"attach\" task and calculate its execution time. Once the transaction object is created, it is published to the IOTA network by conducting the PoW and storing the transactions that the IOTA nodes perform. We calculated the execution time for this and labeled it as \"attach time\".  
The final step was to execute the \"fetch task\" and calculate its execution time. After the transactions are published and stored in the IOTA network, we fetched these transactions by performing a query to the private Tangle, which in response provides the transactional data. We calculated the execution time for this fetch task and labeled it as \"fetch time\".  
The three tasks can be mathematically expressed for the two approaches in the following way:  
\[\begin{array}{l}MAM_{c}=E(data)+ch\_gen\\ MAM_{a}=PoW(MAM_{c})+stor(MAM_{c})\\ MAM_{f}=D(que(MAM_{a})+response)\\ NON-MAM_{c}=Enc(data)\\ NON-MAM_{a}=PoW(NON-MAM_{c})+stor(NON-MAM_{c})\\ NON-MAM_{c}=que(NON-MAM_{c})+response\end{array}\]  
where \(E\) represents encryption; \(ch\_gen\) represents channel generation; \(stor\) represents storing; \(Enc\) represents encoding; and \(que\) represents a query.