# A Blockchain-Based Framework to Enhance Anonymous Services with Accountability Guarantees
## 6 Implementation and Time-Cost Analysis
### Time-Cost Analysis  
We analyzed our implementation by measuring the time taken to perform the operations required by our solution. The measurements were performed by using a personal computer equipped with a 2.8 GHz Intel i7-1165G7 CPU and 16 GB of RAM. The obtained results are reported in Figures 12 and 13.  
In Figure 12, the interaction between the user, \(IG\), and blockchain is represented. In Figure 13, the interaction between the user, \(LA\), \(SP\), and blockchain is reported.  
We distinguished between the tasks the executed client-side (marked by CC) and the tasks executed server-side (marked by \(SC\)). The time intervals necessary to perform these two kinds of tasks are represented with a solid grey line. For each of these intervals, the time needed to complete it is reported in the figures.  
We also represent the user-dependent time intervals (marked by \(UDT\)) with a grey dashed line. Since the duration of these time intervals depends on the time the users need to click the buttons, we assumed realistic average times of 2-3 s.  
Figure 11: Subscription to \(SP\).  
Figure 10: Completion of the interaction with \(LA\).  
Finally, the measurements of the time intervals between sending a transaction to the blockchain and confirming the transaction itself are reported in the two figures. To perform these measurements, we chose the _Ropsten_ test network [44], since it is able to reproduce the network conditions of the live Ethereum MainNet.  
Our measurements show that the time intervals pertaining to the blockchain timeline lasted 15-25 s. From our experiments, these values, compared to the duration of the other measured time intervals, appear to be predominant but still acceptable.  
A factor influencing the duration of the time intervals pertaining to the blockchain is the selected gas price. Indeed, a high gas price causes a transaction to be processed faster, at the cost of greater transaction fees. For our experiments, we adopted the default gas price suggested by Metamask.  
To summarize the results, we obtained that the entire registration procedure with \(IG\) requires less than 1 min, whereas the registration procedure with \(SP\) (including the interaction with \(LA\)) requires less than 2 min.  
By using the default gas price suggested by Metamask, we also measured the costs, in terms of Ethers, resulting from the following operations: smart contract deployment, the execution of the setChallenge function, and the execution of the solveChallenge function.  
Figure 12: Timeline of the interactions between user, \(IG\), and blockchain.  
Figure 13: Timeline of the interactions between user, \(LA\), \(SP\), and blockchain.  
In the following, we report the resulting costs in terms of Ethers (ETH) and US dollars in June 2022:  
* Smart contract deployment: 0.00296997 ETH/USD 5.34;
* setChallenge execution: 0.00029962 ETH/USD 0.54;
* solveChallenge execution: 0.00013468 ETH/USD 0.24.  
We stress that, although the smart contract deployment has a relatively high cost, it is a one-time operation performed by \(SP\), \(LA\), and \(IG\), and therefore its cost is sustainable.  
From the above results, we can estimate the overall cost of a user registration, which is approximately USD 2.34. In a real business model, this cost can be charged to the user willing to use the anonymous service. Therefore, our solution does not result in significant costs, neither for the user nor for the service providers.