# Trusted Electronic Contract for Enabling Peer-to-Peer HPC Resource Sharing
## 1 Introduction  
High-performance computing (HPC) was introduced for research advancement in Thailand in 2007. Due to the niche in demand for intensive computation, applications of HPC are limited to some research areas, and most of the users are researchers, university professors, students, and a few experimental projects from the private sector. Currently, the main research fields that leverage HPC in Thailand include: synthesis and modeling in biopharmaceutical research, enhancing efficiency in energy supply, natural disasters, and environmental impact modeling and prediction (e.g., flooding, air quality). The National e-Science Infrastructure Consortium was established to serve needs in the computational infrastructure of HPC systems, high-capacity storage systems, and network backbone at the national scale. Initially, the project aimed to support research in three main fields comprising (a) high energy particle physics, (b) computational science and engineering and (c) computer science and engineering. Displayed in Figure 1, statistics of research projects submitted to the e-Science service from the year 2010 to 2022 can be categorized into five research topics. Due to huge investment and maintenance costs, as well as a limited number of trained personnel, most of the HPC services are supported by the government and intended to provide specifically to the collaborative research institutes and non-commercialized partner organizations. Nevertheless, with the emergence of big data analytics and artificial intelligence, many private companies or individuals have begun to pay more attentionto the value of data analytics. With the increase in the number of data-driven business models, HPC has started to gain demand for performing complex computations to extract data insight. To efficiently utilize in-house resources in response to the growing need, the providing scale of HPC in Thailand should be expanded to support new user groups with the means to facilitate ease of access in order to support nationwide innovation creation from all economic sectors. The model of computing resources sharing is a challenging topic that this study will explore. The goal is to create a unified network of computing resources regardless of the heterogeneity of the underlying infrastructure HPC services. Clients can easily make a request to the system for the type and amount of resources suitable for their job's requirements. The system will then help to find the best matches for HPC services, allowing clients to get the resource that best suits their tasks at a reasonable price with the service assurance guaranteed. On the other hand, the system enables HPC providers to benefit from their resource's idle time. With this freely competitive model, HPC providers are encouraged to consistently improve their service quality. The goal of this study is to promote the creation of a computing resource sharing ecosystem based on in-house available infrastructure. Our contributions to this work are as follows:  
1. Present architecture design of trusted network based on blockchain technology, smart contract logic, and role-based permission for restricting entities' actions on network resources and function calls. 2. Present a secure gateway service for enabling communication between HPC clusters and blockchain. It facilitates authentication, initiating a secure connection, and asynchronously performing actions according to blockchain events. 3. Present a system monitoring service that periodically sends out updates on the cluster's data states to the blockchain (i.e., cluster health, job status). The service will help monitor HPC's states without interfering with the operational pipeline. The sections in this paper are organized as follows. Section 2 reviews related works on applying blockchain technology to HPC and explores challenges and difficulties in adopting a decentralized sharing model in Thailand. Section 3 describes the architecture design and key modules in the proposed system.