# A Proof-of-Multiple-State Consensus Mechanism for Mobile Nodes in Internet of Vehicles
## 5 Security Analysis
### Attack Methods  
The consensus mechanism works within a federated blockchain and requires a license from all participating nodes. In this framework, the vehicles communicate exclusively with other nodes and vehicles in the federated blockchain. Despite these precautions, potential threats [25; 26; 27] that can disrupt the blockchain network still exist. The next section explains how the PoMS algorithm counteracts such attacks.  
Double Spending Attack: The double spending attack is a widespread form of attack in blockchain technology. The PoMS consensus mechanism verifies every transaction message. For a double-spending attack to be successful, the initiator of the fraudulent message must be verified as legitimate, which means that the initiator has a number of votes that exceeds the threshold set by the system, as follows. By adjusting the value threshold for successful message validation, we can change the difficulty of successful message validation, challenging attackers who want to perform a double-spending attack. At the same time, manipulating a malicious node to obtain voting rights is not possible because the value calculation relies on predicting relative speed and position. Given the frequent changes in a vehicle's motion state within a consensus round, it is difficult to ensure that the state factor of a malicious node exceeds the state of normal nodes, so the algorithm can effectively prevent double-spending attacks.  
False message attack: Malicious nodes can significantly disrupt network communications by sending false messages, including false status factors or numerous invalid message frames. The algorithm presented here encodes the sender's identity in each broadcast message frame along with a unique sequence number to identify the message, allowing RSUs to easily locate the sender vehicle. Penalties are imposed on malicious activities by reducing the network weight of the node, thereby curbing further adverse actions.  
Malicious rating attack: Malicious nodes can negatively rate other nodes to reduce their weight and increase their chances of becoming a miner node. However, the consensus algorithm presented in this article includes a voting mechanism. The presence of sufficient honest nodes participating in the voting ensures the integrity of the algorithm and renders the voting of a single malicious node ineffective in changing the outcome.  
Sybil attack: A hex attack is an attack in which an attacker using multiple virtual identities sends false messages in the system, compromising the security of the system. However, no matter how the malicious nodes forge the identity information and message IDs, the status factor of the message sender is calculated in the same way, and a large number of similar \(SF\) values can be easily detected by the RSU and then recorded, and the conflict mechanism is triggered, when the miner node compares the received values. When the miner nodes compare the received values, the conflict mechanism is triggered. If the relay node cannot be selected after frequent triggering of this mechanism, the consensus in this round will be reset. This effectively prevents switching.