# A Blockchain-Based Privacy-Preserving and Fair Data Transaction Model in IoT
## 7 Experiments
### Experimental Analysis  
In the work of using local differential privacy technology to protect user privacy, most of them use other implementation mechanisms such as Laplace, while the use of random perturbation mechanisms is relatively rare. Therefore, this article chose the traditional LDP algorithm [42] and DDLDP [43] as a comparison, both of which use random perturbation mechanisms. To ensure a fair comparison, five data groups identical in size to [43] were chosen, with sizes of 100, 200, 300, 400, and 500, respectively. Three different privacy budgets were selected: \(\varepsilon=0.5\), \(\varepsilon=1.0\), and \(\varepsilon=2.0\). Figure 2 shows the privacy protection degree under different data sizes for the three algorithms. To prevent randomly inconsistent results, we chose \(w=10\) and calculated the average of 10 instances. Moreover, the experiment randomly selected 10% of the data size from the original set \(D\) as private data \(L\)According to Equations (4) and (5), we obtained the privacy protection degrees of three algorithms under different privacy budgets and data sizes. As shown in Figure 2, under three different privacy budgets, the privacy protection of the MDLDP method is generally higher than that of the other two comparison methods. This indicates that the MDLDP method is more effective than the MDLDP method.  
Figure 2: Privacy-preserving degrees of private dataset with different data sizes.  
method can better and more accurately protect the privacy dataset \(L\). As the amount of data increases, the degree of privacy protection \(\alpha\) slightly decreases and eventually stabilizes.  
According to Equation (6), we obtained the mean square error (MSE) of three algorithms under different privacy budgets and data sizes. From Figure 3, it can be observed that under varying privacy budgets and data sizes, the traditional LDP method exhibits a slightly larger mean squared error, indicating its relatively lower data availability. The mean squared error of the MDLDP method is close to that of the DDLDP method, suggesting that both methods offer better data availability. In conjunction with Figure 2, it can be concluded that the MDLDP method not only offers superior privacy protection but also ensures great data availability. This is because under the same privacy budget, the MDLDP method tends to protect private datasets and relatively reduces the protection of non-private data.  
Figure 4 depicts the perturbation time of the three algorithms at different data sizes. As the data size increases, the fluctuation in perturbation time for all three algorithms remains within a certain range, with these fluctuations being related to the randomness of differential privacy. When the data size is constant, the perturbation time for each algorithm under different privacy budgets is roughly equivalent, which aligns with the characteristics of differential privacy. As can be observed from Figure 4, the time consumed by the MDLDP algorithm is approximately on par with the DDLDP algorithm, both of which are slightly longer than that of the LDP algorithm. But compared to better privacy protection, these limited excess time consumption are acceptable. Due to the fact that time consumption does not significantly change with changes in privacy budget or data volume, the MDLDP method has good practicality.  
Figure 3: \(Cont.\)  
Figure 4: _Cont._  
Figure 3: Mean Square Error with different data sizes.