# Blockchain-Based Lightweight Trust Management in Mobile Ad-Hoc Networks
## 3 Proposed Solution
### Blockchain-Based Lightweight Trust Management in MANETs
#### 3.2.1 Phase 1--Trust Value Calculation  
Because the objective of this work was to develop a distributed trust system for improving network reliability and scalability, we focus on how to construct a trusted network, rather than how trust should be calculated. Furthermore, to reduce vulnerability to repeated attacks by the same attacker, whenever a node detects an adversary in its vicinity, the attacker information is distributed through the network. A variety of detection schemes and trust models will work in the proposed scheme, but the DCFM [15] was adopted as a representative scheme that is applicable to the solution presented in this paper. All nodes in the network follow the DCFM rules to detect malicious neighbors. As discussed above, the DCFM algorithm detects adversaries by analyzing topology information obtained from neighboring nodes. If there are any contradictions in the received information, the sender node is identified as a malicious node and receives a large penalty from the checking nodes. As soon as a particular node is identified as an adversary, that node is effectively removed from the network by sharing its information across the network via blockchain technology. To specify explicit and fair rewards and penalties for residential nodes, including adversaries in MANETs, we adopt the additive increase/multiplicative decrease (AIMD) [21] scheme to control the TV of each node. As the name implies, the TVs of nodes will be added and multiplied based on \(\alpha\) and \(\beta\) factors, respectively, as shown in Equation (1). In the DCFM detection strategy, an identified attacker's TV will be multiplied by a \(\beta\) value of -1, which represents the worst penalty in the network. The information of nodes with negative TV values is distributed through the network so every resident can eliminate such nodes from their connections (the validation of that information (block transaction) will be discussed in a later section). Negative trust value means that the node is banished from the network since the trust value for the nodes in this network is only between 0 and 1. However, for nodes that do not intentionally attack neighboring nodes, but are attempting to be selfish, the \(\beta\) value will be different, as described in Equation (2). In contrast, nodes that behave appropriately will gain increasing TVs by adding \(\alpha\) values. For the sake of fairness of decisions on the trust level, the MPR node should have a greater value compared to other nodes. Therefore, \(\alpha\) is adjusted based on Equation (3). In the case of the MPR node, if it has been the MPR once according to the evaluating node, its \(\alpha\) value will be  
Figure 5: System Design for a Lightweight Trust Blockchain. \(\frac{1}{1+1}=\frac{1}{2}=0.5\). If it contributes two times, this value will be \(\frac{2}{3}=0.67\), and so on. For honest nodes that are not MPRs, \(\alpha\) will be set to 0.1 and such nodes will accumulate high TVs over time. However, every node can have the trust value, \"1\" as the highest. The initial TV value for every node in the network is zero. * TV = Trust Value, \(0\leq TV\leq 1\)
* \(\alpha\) = additive factor
* \(\beta\) = multiplicative factor
* \(\sum_{k=1}^{n-1}M_{ij}{}^{k}\) = number at which node \(i\) chooses node \(j\) as its MPR node to forward packets for \(k\) iterations (starting from when \(j\) begins to have a connection with \(i\) to when \(i\) calculates \(j\)'s TV \[TV= \begin{cases}TV*\beta,&\text{if a node misbehaves.}\\ TV+\alpha,&\text{otherwise.}\end{cases} \] (1)  
\[\beta= \begin{cases}-1,&\text{if a node is an attacker according to DCFM.}\\ 0.5,&\text{otherwise.}\end{cases}  \tag{2}\]  
\[\alpha= \begin{cases}max\left[\frac{\sum_{k=1}^{n-1}M_{ij}{}^{k}}{\sum_{k=1}^{ n-1}M_{ij}{}^{k}+1},0.1\right],&\text{if a node is an MPR node.}\\ 0.1,&\text{otherwise.}\end{cases}  \tag{3}\]  
Furthermore, with the goal of making the proposed system more efficient, we introduce a cooperative mechanism for our security solution.