# Reputation-Based Blockchain for Spatial Crowdsourcing in Vehicular Networks
## 3 Reputation-Based Honest Blockchain Pool Mining
### Incentive Decision-Making Based on Probability Interval  
Based on the above-mentioned reputation calculation process, we can limit the joining of dishonest users by setting mining pool entry conditions. Next, we explore such condition of the mining pool from the perspective of behavioral benefits (i.e., incentive and reputation). To eliminate dishonest behaviors, we introduced the survival times \(T_{j}(T_{j}\in N)\) and the probability \(Q_{j}\) of being dishonest. Consequently, the reputation incremental after each mining rounds also reflects the honesty evaluation of the decision-making, i.e., honest decision would produce a positive fluctuation. Then we take the reputation evaluation of miners as single variable, the problem of mining strategy could be transformed into the parameter interval estimation problem of the \(0-1\) distribution. \(Q_{j}\) subjects to the confidence level of \(p\) as the confidence interval of \(1-a\). Since the mathematical expectation and variance are \(\mu_{(0,1)}=p\) and \(\sigma_{(0,1)}^{2}=p(1-p)\), respectively, then conclusions can be obtained according to the central-limit theorem:  
\[\frac{\sum\limits_{t=1}^{N}X_{t}-np}{\sqrt{np(1-p)}}=\frac{n\overline{X}-np}{ \sqrt{np(1-p)}},t\in N \tag{12}\]  
where \(p\) is a probability parameter of event \(1\). Approximately, we have \(X\sim\)\(N(0,1)\), and  
\[P\Bigg{\{}-z_{\textit{a}}\!\!\!/_{2}<\frac{n\overline{X}-np}{\sqrt{np(1-p)}}<z _{\textit{a}}\!\!\!/_{2}\Bigg{\}}\approx 1-\alpha \tag{13}\]  
Since \(-z_{\textit{a}}\!\!\!/_{2}<\frac{n\overline{X}-np}{\sqrt{np(1-p)}}<z_{\textit {a}}\!\!\!/_{2}\) is equivalent to \(\Big{(}n+z_{\textit{a}/2}^{2}\Big{)}p^{2}-(2n\overline{X}+z_{\textit{a}/2}^{2 })p+n\overline{X}^{2}<0\), then we get a confidence interval \((p_{1},p_{2})\) with an approximate confidence level of \(1-\alpha\) for \(p\), which is  
\[p_{1,2}=\frac{1}{2\bigg{(}n+z_{\textit{a}}^{2}\!\!\!/_{2}\bigg{)}}((2n \overline{X}+z_{\textit{a}}^{2}\!\!\!/_{2})\pm\sqrt{(2n\overline{X}+z_{ \textit{a}}^{2}\!\!\!/_{2})^{2}-4\bigg{(}n+z_{\textit{a}}^{2}\!\!\!/_{2}\bigg{)} n\overline{X}^{2}}) \tag{14}\]  
Let \(p_{1}\leq p_{2}\), then we have \(1-Q_{j}\in(p_{1},p_{2})\). If miners maintain honesty in all iterations, they will meet the rules so as to enter pools to accumulate/slash reputation and \(T_{j}\) via iterations. While \(T_{j}\) decreases to \(0\), miner \(j\) is eliminated. Next, when miners choose to engage in honest or dishonest behavior, the immediate estimation rewards would be \(u_{j}^{H}\) and \(u_{j}^{D}\) as follows. \[\left\{ \begin{array}{l}u_{j}^{H}=u\bigg{(}T_{j},(\mu_{j}-h^{(i)}-\Big{(} \frac{\sigma_{j}}{\tilde{T_{j}}}\Big{)}^{2})\bigg{)}\\ u_{j}^{D}=0\end{array} \right. \tag{15}\]  
where \(u(\cdot)\) is the utility related to the factors \((\cdot)\). Consider the utility function of miner \(j\) is \(u_{j}(n)\), the accumulated estimated reward would be  
\[\widehat{u}_{j}(n)=\sum\limits_{n=1}^{N}\Bigg{(}\frac{\overline{R_{j}}-\mu_{ j}}{\sigma_{j}^{2}}+Q_{j}u_{j}^{H}+\chi u_{j}(n-1)\Bigg{)} \tag{16}\]  
where \(\chi\) is a coefficient. \(\chi\) represents the comprehensive utility function of miners and the influence coefficient of the previous rounds of mining, which is mainly based on the fact that the reputation of the current round of mining behavior is affected by the previous rounds. A reputation-based incentive method to promote honest mining is formulated in Algorithm 1 as follows. First, the miners who join the mining pool are evaluated accordingto the access conditions. When the conditions are satisfied, the miners are allowed to join the mining pool for calculation, otherwise, they will be eliminated. After joining the pool, miners can solve the PoW puzzle by contributing computational resources. After successfully mining, the miners will be rewarded according to their contribution proportion. During the iteration, the current and historical behaviors of the miners can be evaluated. For honest behaviors, the miner's survival time is increased by 1, or otherwise decreased by 1.