Abstract:With the rapid development of outsourcing services, cloud computing has attracted an increasing number of individuals and enterprises to enjoy the services from outsourcing service providers. Moreover, fog computing further extends cloud computing to the edge of the network. In fog computing, because the end user is usually resource-constrained, the outsourcing computation tasks can be outsourced to the fog nodes. However, the mutual distrust between users and fog nodes may impede the fair payment of outsourcing services. Nevertheless, most existing solutions adopt the traditional payment mechanism, which needs a trusted authority such as a bank. In this study, in order to realize fair payment of outsourcing services, we introduce a new fair payment framework based on Blockchain in fog computing to directly transfer rewards by smart contract. Meanwhile, we present a construction to guarantee that if there is a malicious user, the honest one can get compensation. Finally, our security analysis indicates that the proposed protocol achieves correctness and fairness, and performance analysis shows that the experimental consumption is acceptable.