# A Blockchain-Based Auction Framework for Location-Aware Services
## 5 Experiments
### Cost Analysis and Discussion  
This section explores the cost charges incurred by the framework participants. During this analysis, we assume that a single auction request is submitted by a buyer, where the auction duration is set to 5 min. In the presented experiments, 17 sellers interact with the submitted auction by submitting offers that satisfy the auction requirements. Additionally, one verifier is assigned to handle all verification tasks, and a single account is used by the administrator. During the operational lifetime of an auction, each participant will be charged based on the computational and/or storage requirements for the called functions. This cost (charges) is represented as a \"gas\" fee. For each function call, the consumed gas is eventually converted to Ether based on the current gas price. In the presented results, the used price for the gas is 14.3 Gwei, where one Gwei is equal to ETH \(10^{-9}\). Table 4 shows the charges associated with the performed transactions, in which the cost (USD) is obtained by using the exchange rate provided by Coinbase [23]. From the table, we can see the settleAuction function has the highest cost. Besides the auction settlement functionalities, the settlement function calls and executes the distribute-dRewards function, which works iteratively to distribute the rewards. A loop statement is implemented to iterate over the entire set of participating bidders (17). Thus, the number of operations and assignments performed by this function is expected to be higher than \begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Transaction Type** & **Gas Used** & **Cost (ETH)** & **Cost (USD)** & **Transaction Source** \\ \hline submit offer & 123,760 & 0.00177 & 2.241 & \\ \hline reveal offer & 100,327 & 0.00143 & 1.816 & bidders \\ \hline withdraw reward & 28,429 & 0.00041 & 0.514 & \\ \hline initialize auction & 368,922 & 0.00527 & 6.681 & buyer \\ \hline contracts deploy & 2,514,376 & 0.03595 & 45.528 & \\ \hline add verifier & 48,336 & 0.00069 & 0.875 & \\ \hline verify user & 91,669 & 0.00131 & 1.659 & \\ \hline settle auction & 623,308 & 0.00891 & 11.286 & \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Cost of transactions. \begin{table}
\begin{tabular}{l l l} \hline \hline
**Contract** & **Function** & **Description** \\ \hline \multirow{4}{*}{DIDs} & isVerified & check if the input address belongs to a verified participant \\  & verifyParticipant & called by the verifier to add the input address as a verified participant \\  & addVerifier & called by admin to add the input address as a verifier \\  & removeVerifier & called by admin to remove the input address from the verifiers list \\  & removeParticipant & called by the verifier to remove the input address from the participants list \\  & calculateServiceIndex & called to recalculate the SI for the input participant (seller or buyer) \\ \hline \multirow{4}{*}{Auction} & initializeAuction & initialize an auction with all required fields mentioned in Table 1 \\  & submitOffer & store the input hashed offer \\  & revealOffers & check if the buyer’s revealed offer matches the hashed offer \\  & settleAuction & settle the auction and call the distributedReward function \\  & distributeRewards & distribute the collected fees \\  & setFees & set the values for all required fees \\  & cancelAuction & cancel the auction \\  & withdrawReward & withdraw bidder share of reward \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Smart contract functions summary. the rest. Furthermore, the cost of running the function is expected to grow linearly while increasing the number of bidders. Regarding the submitOffer and revealOffer functions costs, both of these functions implement a hashing algorithm. The submitOffer function incurs the cost of submitting the fees and all verification requirements. The initializeAuction function has the highest storage requirement, contributing to its cost. The cost of the contract deployment is the highest.