# Reputation-Based Blockchain for Spatial Crowdsourcing in Vehicular Networks
## 3 Reputation-Based Honest Blockchain Pool Mining
### Utility Function  
Since the incentive problem of the blockchain \(\mathcal{B}_{Cs}\) is the main priniciple of investigation, we focus on the distribution of profit and reputation in the pool. The reputation-based Shapley Value method [35] is utilized to realize the distribution of incentives, which satisfies the following conditions:  
* The reward is unrelated to the order of joining in the group. Honest pool miners contribute computational resources for mining and obtain reward based on their contributed proportion.
* The miners can only obtain rewards based on contributions. There are only two roles in the mining pool, pool managers and miners. Pool managers collect management fees based on the participation, and miners receive only dividends.
* The benefits of multiple tasks do not conflict with each other. Miners can choose to contribute part of computational resources to join multiple chains. The incentive and reputation between tasks can be individually accumulated, where the proof of cross-chain assets needs to be based on side-chain protocols.
* The strategy set of pool miners consists of honest or dishonest actions, but only honesty can be rewarded.  
Assume a weight value function  
\[v_{j}^{(i)}\big{(}\alpha_{j},\Delta R_{j}(n)\big{)}=\sum_{s\in\mathcal{H}} \omega\Big{(}|\mathcal{H}^{(i)}|\Big{)}\frac{\Delta R_{j}(n)}{R_{j}(n)} \tag{7}\]  
where \(\omega\Big{(}|\mathcal{H}^{(i)}|\Big{)}=\frac{\big{(}|\mathcal{M}^{(i)}|-| \mathcal{H}^{(i)}|-1\big{)}|\mathcal{H}^{(i)}|!}{|\mathcal{M}^{(i)}|!}\) and \(\Delta R_{j}(n)=R_{j}(n+1)-R_{j}(n)\), \(|\mathcal{M}^{(i)}|\) and \(|\mathcal{H}^{(i)}|\) denote the volume of pool miners and honest miners in pool \(i\), respectively.  
Then the expected utility function (i.e., incentive) of pool \(i\) is \[u^{(i)}=p^{(i)}E_{1}^{(i)}+E_{\varepsilon}^{(i)}-c^{(i)} \tag{8}\]  
where \(p^{(i)}=\frac{\alpha^{(i)}}{\lambda^{(i)}}e^{-\lambda t^{(i)}}\) is the probability of successfully rewarded, and delay function \(\lambda t^{(i)}\) is related to the transactions of each block; \(E_{1}^{(i)}\) is a combination of fixed reward and performance reward, i.e., \(E_{1}^{(i)}=E_{f}^{(i)}+E_{p}^{(i)}\) ; the participant reward \(E_{\varepsilon}^{(i)}\) depends on the degree of participation in the computing process while the new block is generated. In addition, \(c^{(i)}\) is used to compensate for the cost of pool managers.  
The incentive consists of fixed reward, performance reward and participant reward [36]. Among them, the fixed reward \(E_{f}^{(i)}=E_{f}^{\max}\Big{(}\frac{1}{2}\Big{)}^{\frac{\varepsilon}{T}}\) mainly comes from the reward generated by the block, which is related to the time slot when the miner joins the blockchain, where \(E_{f}^{\max}\) is the constant reward from genesis block, the \"half-life\" is \(T\) and \(t_{c}\) is the time point when miners start mining; the performance reward \(E_{p}^{(i)}=r\pi_{b}\) is mainly related to the number of transactions contained in the generated block, where \(r\) is an evaluation factor and \(\pi_{b}\) is the size of block; and the participant reward \(E_{\varepsilon}^{(i)}=\varepsilon\alpha_{i}\) is mainly from the system compensation, which is related to the degree of computational capability involved in computing, where \(\varepsilon\) is an evaluation factor. For the blockchain network, the total reward mainly comes from the generation of new blocks and the fees from EV customers.  
Then the utility function of miner \(j\) is  
\[u_{j}(n)=u^{(i)}\sum\limits_{B}\Big{(}v_{j}^{(i)}\big{(}\alpha_{j},\Delta R_{ j}(n)\big{)}-c_{j}\Big{)} \tag{9}\]  
where \(c_{j}\) is the cost of miner \(j\).