# Trusted Electronic Contract for Enabling Peer-to-Peer HPC Resource Sharing
## 3 Proposed Design
### Smart Contract Design and Communication Flow
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Test Round \#**} & \multicolumn{4}{c}{**Execution Time (ms)**} \\ \cline{2-5}  & \(T_{spaturn}\) & \(T_{executor}\) & \(T_{executor}\) & \(T_{spatate\_state}\) \\  & & **(Monitoring Job Status)** & **(Retrieving Cluster Health)** & **\(T_{spatate\_state}\)** \\ \hline
1 & 9.519627 & 36.556 & 616.693 & 0.175355 \\
2 & 8.422683 & 39.495 & 718.583 & 0.378252 \\
3 & 7.491831 & 38.483 & 681.012 & 0.28282 \\
4 & 9.348326 & 38.234 & 649.233 & 0.325491 \\
5 & 8.6374 & 37.424 & 672.796 & 0.29372 \\ \hline Average & 8.6839734 & 38.0384 & 667.663 & 0.2911276 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Execution time of System Monitoring Service. in our work is to ensure the _interface module_, along with its dependencies, can operate properly regardless of the host machine environment, not to execute jobs or any HPC-related commands from inside the container. Therefore, HPC providers can be certain that no actions can attain privilege from container runtime, and any container brand is fine to use in deploying the module. ## 6 Conclusions

This study focuses on the practical design and implementation of an HPC resource sharing system. Blockchain technology is leveraged to present trust and manage agreements between resource providers and lenders. To enhance security in the design, all network activities, including the ability to access system data, are governed by a two-layer access control policy which helps in validating the user's permission on network resources and smart contract function calls. To enable secure connection from the off-chain remote HPC system to the on-chain node, an interface module is proposed for establishing a secure connection and automating cluster data synchronization with blockchain states. Performance evaluation on the prototype shows that the design can efficiently respond to the request with little processing delay, and is also capable of tolerating node crashes. With the permission control presence, security analysis shows the design holds the principle of least privilege where users are granted to perform only relevant actions and acquire only information that is relevant to their roles and responsibilities. Prior to exchanging data, authentication is performed to ensure the connection is established to legitimate peers. With the transmission channel being encrypted, acquiring confidential information by eavesdropping on data in transit is infeasible. Conceptualization, K.P., S.C. and C.V.; methodology, S.C.; resources, K.P. and C.V.; writing--original draft preparation, S.C. and K.P. ; writing--review and editing, K.P., S.C. and C.V.; supervision, C.V.; project administration, C.V. All authors have read and agreed to the published version of the manuscript. This research received no external funding. Not applicable. Data Availability StatementData are contained within the article. The authors would like to thank the National e-Science Infrastructure Consortium (Thailand) project for supporting HPC resources, hardware usage data and user statistics which are essential for conducting this research study. The authors declare no conflict of interest. ## References

* [PERSON] et al. (2019) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON] Scheduling Algorithms for High-Performance Computing: An Application Perspective of Fog Computing. In _Recent Trends and Advances in Wireless and IoT-Enabled Networks_; Springer: Berlin/Heidelberg, Germany, 2019; pp. 107-117. * [PERSON] (2019) [PERSON] Queue Waiting Time Prediction for Large-scale High-performance Computing System. In Proceedings of the 2019 International Conference on High Performance Computing Simulation (HPCS 2019), Dublin, Ireland, 15-19 July 2019; pp. 850-855. * [PERSON] et al. (2003) [PERSON]; [PERSON]; [PERSON]; [PERSON] [PERSON] Scheduling in HPC Resource Management Systems: Queuing vs. Planning. In Proceedings of the Job Scheduling Strategies for Parallel Processing (JSSPP), Seattle, WA, USA, 24 June 2003. * [PERSON] et al.