## 3 V2X System Architecture When Integrating Blockchain Technology and MEC
### Application of Blockchain Technology between Road Users and RSUs
#### 3.2.4 Messaging  
When transmitting information, the device forms a message in the form of a transaction, while writing the reputation rating value and the priority of the situation into it. Transactions are written to a block and transmitted to all participants in the network. The higher the reputation and priority of the message are, the faster the decision to accept it. A block is fixed when more than \(2/3\) of validators pre-fix the same block in the same round for transactions with coefficient (\(k\)) below 0.6 and \(2/4\) for transactions with coefficient (\(k\)) above or equal to 0.6.  
\[k=(\frac{1}{\textit{prio}})*rep \tag{1}\]  
If the message is compromised or incorrect, the message sender's behavior is then transmitted to the blockchain and reported to the trusted authority. Thus, the reputation of the sender of the message is degraded.  
Most modern blockchain systems are a single-chain architecture. Thus, each node has to perform multiple duplicate computational tasks, resulting in a loss of energy. In addition, its performance degradation becomes more evident when traffic peaks occur [26].  
In the case of V2X, there is no need to share blocks beyond the region. To solve the scalability problem, the proposed architecture uses a segmentation approach. Segmentation is the division of the workload of a blockchain network over a peer-to-peer network, so that each node is not responsible for the transaction load of the entire network [27]. This allows different segments to process transactions in parallel to increase throughput, which speeds up validation processes as well as block validation in time-dependent situations while maintaining interoperability. According to the high mobility of independent subnetnodes, different subnets can have different numbers of nodes and block generation times. The Chameleon, OmniLedger [28], or Elastico [29] solution is proposed as the basis for object interconnection in segmentation.  
The architecture of the main chain (multi-chain) is shown in Figure 2. The architecture is based on a main chain, which manages multiple semi-independent segments.  
When a subchain is created, the relevant information is reflected from the main chain to the corresponding subchains in such a way that the subchains correspond to the states of the main chain. The algorithm for generating data chains is presented in Algorithm 1. In the chains of segments, the data of one block are stored in a complete chain of a certain period of time, for example, one day or one week, and the previous blocks are stored in multi-chains. It is worth noting that a segmented system model must account for the negligible probability that any segment is compromised.  
Additionally, the authors do not deny that, in the future, a Cosmos network-type protocol could be used instead of segmentation [30], but, at the time of writing, these types of solutions are only in the development stage and have no final solution.  
If we consider the procedure of selecting the entry and exit of the segment, the need to dynamically update the information based on such parameters as the number of devices in the segment and the distance from the RSU should be noted.  
Figure 2: Multi-chain architecture.