# Blockchain Based Trust Model Using Tendermint in Vehicular Adhoc Networks
## 3 Proposed Approach
### Main Procedures  
The proposed model procedure is divided into three parts, as described in Figure 2.  
Step 1 Rating generation and uploading  
This is the first step towards the decentralization of trust management in a vehicular network. This is the procedure that has to be conducted on vehicles. Some specific rules are required to assess the credibility of the messages and to generate the ratings. The messages are divided into groups {_M1_, _M2_,......... _Mj_}, where _Mj_ represents the group reporting event, e.g., an accident happened in one road segment R. All messages have different values of ratings calculated by the RSUs. The vehicle which is near to the event will have more rating value because it is close to the event and will be exactly aware of whether the event happened or not. Therefore, the credibility of a certain message is defined as follows [32]:  
\[c_{k}^{j}=b+e^{-\gamma d_{k}^{j}} \tag{1}\]  
where \(c_{k}^{j}\) is the credibility of the message in group Mj sent by vehicle, \(d_{k}^{j}\) is the distance between the sender and the location of the event. b and \(\gamma\) are two preset parameters, which control the lower bound and the rate of change of message credibility. Moreover, \(c_{k}^{j}=0\), if k does not report this event. The receiver can obtain a credibility set \(C^{j}\) for event \(e^{j}\) using Equation (1), where \(C^{j}=\left\{ \begin{array}{ll}c_{1}^{j},&c_{2}^{j},&\ldots\ldots\end{array} \right\}\). Based on credibility set C, the receiver is able to calculate the aggregated credibility of event e using the gradient boosting technique [33]. The gradient boosting technique splits the input space into \(T_{m}\) disjoint regions, such as \(R_{1m}\), \(R_{2m}\),... \(R_{Tm}\), and then predicts a vehicle with a lower trust value in each region. Here, \(T_{m}\) represents the number of leaves in a tree. Therefore, this is the output of gradient boosting. Thus, the output of the gradient boosting tree is \(h_{m}(x)\) for input \(x\) (\(x\) indicates the mobile node with trust value), and this is represented mathematically as follows:  
\[h_{m}(x)=\sum_{T=1}^{T_{m}}b_{tm}\ I\ (x\in R_{Tm}) \tag{2}\]  
From Equation (2), \(b_{tm}\) denotes the predicted mobile nodes, which consist of lower trust values in the tree. After that, the coefficients \(b_{tm}\) are multiplied by a random value \(\gamma_{m}\) in order to remove the lower trust value mobile nodes in the VANET scenario. So, the updated model is described below:  
\[F_{m}(x)=F_{m-1}(x)+\ \gamma_{m}h_{m}(x) \tag{3}\]  
\[\gamma_{m}=\underset{\gamma}{\text{argmin}}\sum_{i=1}^{n}L\ (y_{i},\ F_{m-1}(x_{i})+ \gamma_{m}h_{m}(x_{i})) \tag{4}\]  
Using Equations (3) and (4), the lower trust values from the vehicular network will be removed by RSU. Finally, the nodes with higher trust values will be retained by the given formula,  
\[F_{m}(x)=F_{m-1}(x)+\sum_{T=1}^{T_{m}}\gamma_{T_{m}}I(x\in\ R_{Tm}) \tag{5}\]\[\tau_{T_{m}}=\arg\!\!\min_{\gamma}\sum_{x_{i}\in T_{m}}^{n}L(y_{i},F_{m-1}(x_{i})) \tag{6}\]  
The RSU may have differences in ratings produced by similar messages, e.g., nine positive and three negative ratings. The former is a majority group, and the latter is a minority group. In the proposed methodology, weighted aggregation solves the problem of ranking conflicts. The offset is between \(-1\) and +1 (normalized value), which is positively associated with the positive rating ratio in this message. The estimation of the offset value of the trust is shown in Equation (7). \[\sigma_{k}^{j}=\frac{\theta_{1}.m-\theta_{2}.n}{m+n} \tag{7}\]  
where \(\sigma_{k}^{j}\) is the trust value offset of vehicle k based on message j and \(\sigma_{k}^{j}\in[-1,1]\). m and n are the number of positive and negative ratings, whose weights are \(\theta_{1}\) and \(\theta_{2}\), respectively. \(\theta_{1}\) and \(\theta_{2}\) are determined using Equations (8) and (9), respectively. \[\theta_{1}=\frac{F(m)}{F(m)+F(n)} \tag{8}\]  
\[\theta_{2}=\frac{F(n)}{F(m)+F(n)} \tag{9}\]  
where \(F(.