# Blockchain-Based Resource Allocation Model in Fog Computing
## 1 Introduction
### Related Works  
As mentioned above, resource contribution is a critical technical issue in resource management and allocation, especially in fog computing. Resource contribution refers to the provision of computing, storage, and other resources by devices with idle resources. Although the resources and computing power of idle resource devices have different degrees of restrictions [18], they can jointly cooperativelycomplete computing and storage tasks, thereby lightening the resource bottleneck problem of the primary service provider. In recent years, the issue of resource contribution has been the focus and hotspot of distributed computing in cloud computing, fog computing, and edge computing. [PERSON] et al. [19] proposed a game framework for resource management three-layered structure in data service operator (DSO), fog node (FN), and data service subscriber (ADSS) scenarios. Their solution is based on the Stackelberg game. The moral hazard model and the matching game strategy give the stability strategy of the fog computing system under the framework. [PERSON] et al. [20] proposed a resource sharing mechanism based on the alliance game by studying the resource contribution between cooperative cloud providers. The authors consider the uncertainty of mobile users fully. The purpose is to optimize the resource utilization rate and to reduce the cost of the cloud service provider. The authors aim to form the cloud service provider alliance by using the alliance game to ensure the stability of the mechanism structure and to analyze the resource usage cost of the cloud service provider participating in the alliance game by employing the Shapley value theory Distribution situation. [PERSON] et al. [21] proposed a service-oriented heterogeneous resource sharing scheme, which effectively reduces the service waiting time. [PERSON] et al. [22] studied the optimization of energy and communication resource sharing between mobile devices with limited energy and restricted data in mobile cloud computing. [PERSON] et al. [23] offload the computational tasks in the cloud to the fog server by bypassing the private cloud allocation strategy and use a genetic algorithm to find the optimal allocation scheme. [PERSON] et al. [24] proved that the shortest path scheme based on [PERSON] tree theory is more efficient than the traditional scheme to minimize the path cost of the fog server contributing resources. [PERSON] et al. [25] proposed a linear tree decision rule algorithm based on service size, completion time, and virtual machine capacity, which helps workload balancing and improves resource allocation. [PERSON] et al. [26] used the Representational State Transfer (REST) design pattern and the IoT Constrained Application Protocol (CoAP) to enable resource cooperation in the form of a planar architecture between fog nodes. [PERSON] et al. [27] optimized the load balancing in a fog environment using the multi-tenant allocation algorithm (MtLDF), which takes into account the latency and priority of specific multi-tenant needs. [PERSON] and [PERSON] [28] constructed a two-tier edge computing resource sharing framework that takes into account the benefits of the fog service provider, resulting in higher system utilization. [PERSON] et al. [29] designed a fog computing resource contribution system consisting of a remote cloud server, computing access point (CAP) and users, and designed the CAP as a mobile user. [PERSON] et al. [30] used virtualization technology to analyze potential threats and attacks in the fog computing environment and constructed a cloud architecture with elastic resource allocation. [PERSON] et al. [31] developed a systematic framework to study the trade-off between power consumption and latency in cloud systems. In the above approaches, most of the researchers analyzed the resource contribution methods of different resource providers from a static perspective and did not consider the interaction between resource contributors.