# Blockchain-Based Resource Allocation Model in Fog Computing
## Materials and Methods
### Problem Formulation and System Model
At this time, token rewards of a certain proportion are given to the nodes that participate in the verification of voting records in the process of transaction initiator, namely resource contributor and DPoS link, so as to continuously encourage fog nodes to actively contribute resources and promote other fog nodes to jointly maintain the fog computing ecosystem based on blockchain. The token mechanism in the blockchain, due to its high security and non-tamper ability, compared to the traditional fiat currency payment incentive mechanism, has the following characteristics:  
* Cryptographic digital currency is a decentralized currency compared to legal tender. As the most successful product of blockchain technology, cryptographic digital currency allows people to move freely and securely from one currency to another without the help of intermediaries. The issuance of money is done spontaneously and impartially by the participants and is not supervised by any external agency, even the central bank or government agency. * Compared with legal tender, encrypted digital currency is encrypted and anonymous. Encrypted digital currency based on blockchain technology has all the advantages of blockchain technology to ensure the security of all aspects of currency circulation. Moreover, the private key is the only voucher for holding the currency. The public key is publicly disclosed and does not bind any personal information of the private key holder, making the operation anonymous. * Compared with traditional electronic currency, digital currency is a kind of currency that cannot be tampered with and is open and transparent. Since accounts for encrypted digital currency are recorded in the public ledger of blockchain, it means that transactions for digital currency, once confirmed, cannot be tampered with and are open to all users across the network. * Compared with traditional electronic money, digital money can deliver value. In the Internet, traditional electronic currency can only deliver information, but cannot deliver value. Every transfer of encrypted digital currency in the network is itself a transfer of value, and transfer is a re-authorization of the right to use value. The process of fog nodes contributing resources and completing tasks is regarded as the \"transaction\" behavior in the blockchain. The behavior log of resources contributed by fog node is regarded as the \"asset\" in the blockchain and uploaded to the blockchain network. The new block is generated and recorded permanently in the \"ledger\" According to blockchain technology, once records cannot be tampered with, the time stamp can be trading information for traceability and high-security features, such as when the fog is used to calculate the abnormal conditions of network nodes. According to the record information in the \"book\" traceability, other blocks of tokens in the chain system are an incentive mechanism to make the fog compute node jointly maintain the entire network environment. At the same time, considering the task satisfaction M as a record to keep in the ledger, its essence is a transparent, open, non-tamper (brushing) evaluation system, which undoubtedly brings long-term economic benefits for fog providers, as shown in Figure 3.  
It is particularly noticeable that the blockchain technology used in this paper is the alliance chain, and the token issued in this paper should not be qualified to exchange with legal coins, but only circulated within the economic system of the alliance, which has many functions such as purchasing upper cloud service resources, lower user information, and extra transmission bandwidth. Token issued under this architecture is not only resource currency to some extent because when the node of the alliance system has an abnormal condition, the behavior log, which has been recorded in the ledger, becomes a piece of valuable asset information. At this time, the token becomes an asset currency with an asset tag.