# Privacy-Preserving Data Mining on Blockchain-Based WSNs
## 5 Results
### Validation of the Privacy-Preserving Architecture  
The described privacy-preserving architecture builds upon the Ethereum blockchain running the PoA consensus and the privacy-preserving communication protocol described in [35]. Since the use of the blockchain in our architecture does not diverge from the typical use, we focus on evaluating the privacy-preserving communication protocol for distributed data mining. Moreover, the adoption of blockchain technology for resource-constrained devices was discussed in several other research works; specifically, we point out [57], which provides performance analyses of the Ethereum blockchain running the PoA consensus in IoT networks.  
The privacy-preserving communication protocol uses the onion routing technique, which builds on messages having several layers of public-key cryptography; public-key cryptography is known for being computationally intensive. However, in the proposed architecture, multiple public-key cryptography operations are required only at the point of message creation; therefore, this is conducted by the user on the client, which is supposed to be running on a typical consumer machine. Nodes of the WSN at the onion message receipt perform only one public-key cryptography operation. To assess the time required for a node of our system to decipher a message, we coded a test script that measures the required time for ciphering several bytes of data using the same cipher as the simulator [52]. The cipher is based on the elliptic curve Curve2551 [58], and is implemented in the Libsodium library [56] under the name _Sealed Box_. By our measurments, encrypting 1 kB and 16 kB of data using the _Sealed Box_ implementation on a Raspberry Pi4 takes, respectively, 603 and 735 microseconds. Therefore, the processing time required for cryptographic operations is low compared to the DM model processing and the message propagation time. On the other hand, DM model processing depends on the amount of data to be processed at each node and on the computational complexity of the applied DM model. In the proposed architecture, we describe the use of the DM model known as Hoeffding tree, which is known to be memory and computationally efficient [59].  
Figure 8: Absolute error comparison between the Hoeffding tree and traditional algorithms. The box plots aggregate the daily absolute error per DM model.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithm** & **MAE** & **RMSE** & **RRSE** & **COR** \\ \hline Random forest & 154.8616 & 249.2222 & 61.5162 & 0.803 \\ M5\({}^{\prime}\) & 148.5085 & 232.2563 & 57.3284 & 0.8323 \\ Linear regression & 157.7538 & 212.1302 & 52.3606 & 0.8717 \\ Hoeffding tree & 135.3154 & 230.9903 & 57.0625 & 0.8432 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Statistical comparison of the prediction accuracy of different models. MAE—mean absolute error, RMSE—root mean squared error, RMSE—root relative squared error, and COR—correlation coefficient.  
To show the feasibility of the onion-routed approach, we study the impact of message propagation through the WSN based on different tree sizes. The experiment was designed to simulate the worst-case scenario with random node deployment, inducing a high packet drop rate. Figure 9 shows the average propagation time of an onion message relative to the size of the Hoeffding tree. We observe a low impact of larger trees on encryption, decryption, and training on total propagation times.