# 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
Although cooperative networking has been considered previously for MANETs [22], in most of the security mechanisms available for proactive routing protocols, nodes perform individual detection processes. In DCFM, detection occurs in every hello interval. However, in our solution, the detection interval is decreased according to the number of neighbors in the node vicinity. By taking advantage of the synergistic effects of nearby neighboring nodes, the detection interval can be increased. Nodes that fulfill the following principles can perform collaborative detection instead of working individually. * \(\mathcal{N}_{1}\), \(\mathcal{N}_{2}\), \(\mathcal{N}_{3}\),... = residential nodes in the network,
* \(\mathcal{S}_{1}\), \(\mathcal{S}_{2}\),... = number of nodes in the neighbor set of \(\mathcal{N}_{1}\), \(\mathcal{N}_{2}\),..., respectively,
* \(\mathcal{I}_{0}\) = the initial checking interval (same as the hello interval, typically 2 s),
* \(\mathcal{I}_{1}\) = the increased detection interval when collaboration can be performed,
* \(f\) = multiplicative factor used for increasing the detection interval  
1. At least three nodes should have mutual connections (i.e., nodes \(\mathcal{N}_{1}\), \(\mathcal{N}_{2}\), and \(\mathcal{N}_{3}\) are exchanging control messages with each other). A collaborating node should not be a node that just joined the network. 2. For determining the length of the interval, a node should consider the number of nodes involved in the hello messages with other neighbors (see Equations (4) and (5) for the calculation of a new detection interval). \[f=min[\,\mathcal{S}_{1}\text{, }\mathcal{S}_{2}\text{, }\mathcal{S}_{3}\,].\] (4) \[\mathcal{I}_{1}=\mathcal{I}_{0}*f.\] (5)
3. After determining the new detection interval, task assignment will be performed based on the order of node addresses (e.g., IP addresses of nodes). The assigned order increases from the smallest to the largest address. For example, among three nodes \(\mathcal{N}_{1}\), \(N_{2}\), and \(\mathcal{N}_{3}\), the detection-duty order = \([\mathcal{N}_{1},N_{2},N_{3}]\). As discussed in Principle 1, for realizing fully protective and collaborative detection, at least three nodes must work together so that even if node \(\mathcal{N}_{1}\) is being manipulated by an attacker and \(\mathcal{N}_{2}\) is taking a break from detection duty, node \(\mathcal{N}_{3}\), which is connected to both nodes, can still detect the attacker. However, for complete security, new nodes should not be included in the collaboration process. A node should only perform detection in this situation if it has been contributing to the network for a specific amount of time and earned a reasonably high TV. The new interval for a node is based on the number of nodes mentioned in the hello messages of its neighbors. According to the first principle, the multiplicative factor \(f\) will start from a minimum value of two, which is the minimal count of required collaborators in addition to the target node itself. After multiplying the value of \(f\) by the initial interval \(\mathcal{I}_{0}\), the resulting value \(\mathcal{I}_{1}\) will be utilized as the new detection interval. Therefore, it can be concluded that the greater the minimum number of neighbors, the longer the detection interval for nodes. For a value of \(\mathcal{I}_{1}\), collaborating nodes should determine the task assignment order in the same manner as a peer-to-peer network. In this context, the network may be vulnerable to malicious attacks based on misunderstandings between nodes. Task assignment should be performed based on a global value that is unique for every node. Therefore, we set the node address to a value suitable for determining the task assignment order. The node with the smallest address number is responsible for the first interval and the node with the greatest address number is responsible for the final interval. In Figure 6, we demonstrate phase 1 with two attackers in MANET. After phase 1 is completed, the trust tables of the nodes will be updated.