# Decentralized Storage with Access Control and Data Persistence for e-Book Stores
## 4 Proposed System
### Decentralized Access Control to the Stored Data
#### 4.2.1 Access Control Contract (ACC)
Hash Vec\(<\)bool\(>\) with keccak256 to complete the proof. In the experiments, we measure the time to generate the proof by changing the number of files as 10,000, 100,000, and 200,000 on an EC2 instance hosting the storage node, where, in order to focus on the computational cost of storage nodes, we exclude the query time for the block hash in the first step from the measurement time. Note that, since the generation of a proof does not require reading the entire file, there is no direct relationship between the e-book size and the generation time. \begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline \(\mathbf{X}\) & **5** & **6** & **7** & **8** & **9** & **10** & **11** & **12** & **13** & **14** & **15** \\ \hline \(k=20\) & 399 & 536 & 648 & 763 & 795 & 868 & 910 & 942 & 964 & 980 & 990 \\ \(k=30\) & 555 & 719 & 841 & 902 & 942 & 979 & 992 & 999 & 999 & 1000 & 1000 \\ \(k=40\) & 678 & 856 & 927 & 971 & 992 & 999 & 999 & 1000 & 1000 & 1000 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The number of event sequences that did not fail to persist in the proposed system (out of 1000). \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \(\mathbf{Y}\) & **100** & **200** & **300** & **400** & **500** & **600** \\ \hline
200,000 books (=20 TB) & 0 & 0 & 56 & 585 & 943 & 998 \\
100,000 books (=10 TB) & 0 & 454 & 900 & 993 & 1000 & 1000 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: The number of event sequences that did not fail to persist in Arweave (out of 1000). Table 6 summarizes the generation time of a proof for different numbers of files and for two different EC2 instances, t2.micro and m5.xlarge. The most time-consuming case is the handling of 200,000 files on t2.micro, but even in this case, the time required is only about one and a half minutes. Therefore, we can conclude that this is well within the practical range as long as the quiz is issued at a frequency of about once a day. In addition, m5.xlarge is faster than t2.micro, and the degree of speedup is more significant when the number of files is smaller. Behind this phenomenon may be the influence of the cache and hardware characteristics of the EC2 instance. ### Execution Cost of ACC Functions and Performance Comparison by Blockchain

As of 2023, numerous public blockchains have emerged as viable options for implementing decentralized applications like ACCs. Given that the smart contracts of the proposed system are deployable on any blockchain that supports the Ethereum virtual machine (EVM), the choice of blockchain for app development becomes a crucial issue. In this subsection, we focus on Polygon [28], Arbitrum [29, 30], and Solana [31, 32] as notable alternatives to Ethereum and evaluate these blockchains in terms of max recorded TPS, real-time TPS, block time, and average transaction fee, where TPS stands for the number of transactions processed per second and block time is the average time for generating a block. Table 7 summarizes the results. The table shows that Ethereum exhibits the lowest TPS, and its long block time and high transaction fee make it less user-friendly. In fact, the best choice in terms of TPS and transaction fee is Solana, especially in TPS, which is far ahead of other blockchains, and Arbitrum is the best choice in terms of block time. It should be noted, however, that there is a tradeoff between speed and security [33], and this consideration arises because public blockchains necessitate security-dependent transaction fees, which are ultimately borne by the app's users. Finally, we evaluate the cost of running ACC functions on Ethereum. Table 8 summarizes the cost of each function measured using the hardhat-gas-reporter. Although the costs of functions vary widely depending on Ethereum price fluctuations and network conditions, the gas price and ETH price were 26 Gwei/gas and 2151.72 USD/ETH at the time of evaluation. The table shows that the most expensive ACC function is registerNode at USD 10.21, while the mint function, which is considered the most frequently used by users, costs USD 8.49.