# Blockchain-Based Resource Allocation Model in Fog Computing
## 1 Introduction
### Related Works
In practical applications, the resource requirements of cloud service providers or users change dynamically, and contributing resources are not 100% successful [32] (or 100% total contribution). Hence, it is significant to design a reasonable resource contribution scheme under the premise of fully considering the dynamic changes of resource demand in time and the success rate of contribution. The authors of [33] analyze the rapid development of IoT services, carry out analysis concerning the innovative application of blockchain technology based on the fog computing architecture, and propose a fog computing architecture which is built on Hypriot Cluster Lab of Fog computing (HCL-BaFog) based on blockchain. This architecture enables efficient and secure collection and sharing of sensor-sensitive data, especially in smart homes and applications requiring secure electronic medical applications. The proposed architecture uses the license chain and the full virtualization capabilities of the fog compute node network. It also utilizes the container orchestration and management system Docker and multi-chain frameworks to test some of the necessary performance metrics of the proposed architecture using Raspberry Pi System Basis Chips (SBCs). In [34], [PERSON] et al. consider the scenario in the fog computing offload environment in which mobile users may mistakenly transfer computing tasks to nearby fog servers that are attacked, causing a series of privacy and security issues. In response to this challenge, the authors introduced blockchain technology into the fog computing environment and sought to check the accuracy and authenticity of the fog server performing the unloading in a short time. More in detail, they use the characteristics of collective maintenance in blockchain technology to continuously maintain a set of authorized fog servers to ensure the accuracy and authenticity of the unloaded fog server when the uninstall task is executed. A blockchain-based distributed cloud architecture is proposed in [35]. The proposed solution practices software-defined networking technologies to provide the need for on-demand access to make secure and low-cost the IoT networks. Moreover, it brings computing resources to the edge of the IoT network, implements a secure distributed fog node architecture based on Software Defined Network (SDN), and designs blockchain intending to simplify the network traffic in the core network. At the same time, in the IoT device, minimal end-to-end latency and computational resources can be achieved. The results of the evaluation show that the system performance can be significantly improved by reducing induction delays, reducing response time, increasing throughput, and detecting real-time attacks. [PERSON] et al. [36] introduced a decentralized market for industrial edge applications, Industrial Internet of Things (IIoT) Bazaar, which uses the blockchain's collective maintenance, timing, and other features to create high transparency for users while ensuring edge device applications. The traceability of the installation considerably improves the safety of the edge device. At the same time, the use of fog calculations integrates resource-constrained edge devices into the IIoT Bazaar ecosystem. In the meantime, Augmented Reality (AR) technology is used to enable more intuitive human-computer interaction between users and edge devices. Through their research, software developers and users can be brought together jointly, so that people can provide a variety of performance needs more conveniently. [PERSON] et al. [37] proposed a statistical method to solve the expected value of a mathematical problem in the PoW consensus, to make the blockchain better suited for cloud computing or fog computing. This method relies on the desired mathematical model and uses polynomial matrix decomposition to make it easier to obtain the PoW consensus solution, taking into account all the constraints of the mathematical puzzle.