## 5 Analysis and Results
### Unpredictability in the Algorithm  
This consensus algorithm uses three integral multiples (\(m\)) for five validating nodes (\(v\)), which could be changed according to our scenario requirements. The selection of the master node is random by voting, and its probability is 0.0625 in case of a total of 16 nodes and goes on decreasing by increasing the total number of nodes. The master node selects  
Figure 5: Remote management system.  
additional five nodes with a probability \(p(v)\) of 0.3333 for validation, making it impossible for the attacker to compromise a node. For example, in the worst-case scenario, one or two validating nodes are compromised. Still, they cannot validate the block because the other three nodes will validate and verify the block due to the majority (discussed in the case study section of this chapter).  
In this study, one node is selected as a master node, and validating nodes (\(v\)) and multiple (\(m\)) could be selected according to Equation (1) in the previous section. However, if we consider more than 5 validating nodes (\(v\)), blockchain working becomes less efficient, and computational power is increased, as we have seen in the Bitcoin scenario. Selecting \(v\) less than 5 for validating will lead the blockchain to compromise its security and fewer block verifications as security is not tested. Still, we have to assume this due to vulnerabilities present in IoT. Suppose one node produces a block and three nodes are selected for verification of this produced block. In that case, only three verifications are considered to be received in an ideal scenario. These block verifications can be decreased if one or more nodes are malicious or do not agree upon a newly generated block.  
Randomness can be increased by increasing the integral multiple of validating nodes (\(m\)), increasing \(N-1\) nodes by \(m\) times for a specific number of validating nodes (\(v\)). For example, in this study, we are using \(m=3\) and \(v=5\) which means (\(N-1\)) = 15, i.e., 3 times 5. By decreasing \(m\), randomness could be decreased, and the probability of validating nodes selection by master \(p(v)\) will increase and leads towards less security of the blockchain. In this case, master node selection by voting will also become more probable (e.g., \(1/16\) for \(m=3\), \(1/11\) for \(m=2\) and \(1/6\) for \(m=1\)). That is why the value of \(m\) is greater than 2. If we select \(m=2\), then validating the node's selection probability becomes exactly half. The value of \(m\) could not be one because the probability of validating nodes selection is equal to 1. It is much easier for the attacker to manipulate the transactions by compromising 60 percent BCIoT, validating nodes and guessing the master node. Compromising a master node could be much more harmful in our CBCIoT scenario.  
The probability of validating nodes selection by master \(p(v)\) decreased by increasing the number of integral multiple (\(m\)) and \(v=5\) (constant). In our scenario, for \(m=3\), probability is 0.33; this is also shown in Figure 7 and goes on decreasing for greater values of \(m\).  
Figure 8 shows the total approximate time for validation and verification per block, which goes on increasing \(v\) and \(m=3\) for 7000 samples. A time delay of 30 s is included in the graph as it can be seen that every block is validated more than 30 seconds. If the master takes more nodes for validation, then one node creates a block first, and the remaining nodes verify it and send the verified block back to the master for broadcasting in IoT blockchain. Every node on the blockchain will store this new block into its ledger. So, the  
Figure 6: CBCIoT flow chart.  
number of verifications is increased by increasing \(v\), but the block producing time is also climbing up.