## 5 Our Improved Protocol
### Blockchain-Based Handover Authentication  
When vehicle \(V_{i}\) successfully authenticates with \(RSU_{j}\) and enters the coverage area of \(RSU_{k}\), it is essential to initiate a new round of mutual authentication between \(V_{i}\) and  
Figure 3: Initial V2I authentication phase.  
\(RSU_{k}\). The blockchain-based handover authentication procedure is illustrated in Figure 4 and proceeds as follows:  
\begin{tabular}{l l} Step 1: & \(V_{i}\) generates a random value \(c_{i}\) and computes \(M_{7}=h(RID_{i}||TID_{i}||ID_{k}||T_{3})\oplus c_{i}\), along with \(M_{8}=h(c_{i}||RID_{i}||TID_{i})\). \(V_{i}\) then transmits \((TID_{i},M_{7},M_{8},T_{3})\) to \(RSU_{k}\). \\ Step 2: & On receiving this message, \(RSU_{k}\) retrieves the transaction \((TID_{i},n_{j},h(TID_{i}\)\(||RID_{i}||k))\) from the blockchain. It then calculates \(RID_{i}=TID_{i}\oplus h(n_{i}||k)\) and verifies whether \(h(TID_{i}||RID_{i}||k)\stackrel{{?}}{{=}}h(TID_{i}||RID_{i}||k)\). \\ Step 3: & If the verification is successful, \(RSU_{k}\) computes \(c_{i}=h(RID_{i}||TID_{i}||ID_{k}||T_{3})\oplus M_{7}\) and checks if \(M_{8}\stackrel{{?}}{{=}}h(c_{i}||RID_{i}||TID_{i})\). Upon confirmation, \(RSU_{k}\) generates random values \(c_{k}\) and \(n_{k}\), and calculates \(TID_{k}=RID_{i}\oplus h(n_{k}||k)\), \(M_{9}=TID_{k}\oplus h(c_{i}||RID_{i})\), \(M_{10}=c_{k}\oplus h(c_{i}||TID_{k}||RID_{i})\), \(SK_{ik}=h(c_{k}||c_{i}||TID_{k}||RID_{i})\), and \(M_{11}=h(SK_{ik}||T_{4})\). \(RSU_{k}\) then transmits \((M_{9},M_{10},M_{11},T_{4})\) to \(V_{i}\). \\ Step 4: & Upon receipt, \(V_{i}\) calculates \(TID_{k}=M_{9}\oplus h(c_{i}||RID_{i})\), \(c_{k}=M_{10}\oplus h(c_{i}||TID_{k}||RID_{i})\), and \(SK_{ik}=h(c_{k}||c_{i}||TID_{k}||RID_{i})\). \(V_{i}\) then verifies if \(M_{11}\stackrel{{?}}{{=}}h(SK_{ik}||T_{4})\). The successful completion of these steps confirms mutual authentication between \(V_{i}\) and \(RSU_{k}\), after which \(RSU_{k}\) uploads \((TID_{k},n_{k},h(TID_{k}||RID_{i}||n_{k}))\) to the blockchain. \\ \hline \hline \multicolumn{2}{c}{\(V_{i}\)} & \multicolumn{2}{c}{\(RSU_{k}\)} \\ \hline Generates \(c_{i}\) & \\ Calculates & \\ \(M_{7}\)\(=h(RID_{i}||TID_{i}||TID_{i})\oplus c_{i}\) & \\ \(M_{8}\)\(=h(c_{i}||RID_{i}||TID_{i})\) & \\ \(\xrightarrow{(TID_{k},M_{7},M_{8},T_{3})}\) & Checks \(T_{3}\) & \\  & Retrieves \((TID_{i},n_{j},h(TID_{i}||RID_{i}||k))\) & \\  & Computes \(RID_{i}^{*}=TID_{i}\oplus h(n_{j}||k)\) & \\  & Checks \(h(TID_{i}||RID_{i}||k)\stackrel{{?}}{{=}}h(TID_{i}||RID_{i}||k)\) & \\  & Checks \(c_{i}=h(RID_{i}||TID_{i}||RID_{i})\) & \\  & Generates \(c_{i},n_{k}\) & \\  & Computes \(TID_{k}=RID_{i}\oplus h(n_{k}||k)\) & \\  & \(M_{9}\)\(=TID_{k}\oplus h(c_{i}||RID_{i})\) & \\  & \(M_{10}=c_{k}\oplus h(c_{k}||TID_{i}||RID_{i})\) & \\  & \(SK_{ik}=h(c_{k}||c_{k}||TID_{k}||RID_{i})\) & \\  & Checks \(M_{11}=h(SK_{ik}||T_{4})\) & \\ Checks \(T_{4}\) & \\ Computes & \\ \(TID_{k}\)\(=M_{9}\oplus h(c_{k}||RID_{i})\) & \\ \(c_{k}\)\(=M_{10}\oplus h(c_{k}||TID_{i}||RID_{i})\) & \\ \(SK_{ik}=h(c_{k}||c_{k}||TID_{k}||RID_{i})\) & \\ \(SK_{ik}=h(c_{k}||c_{k}||TID_{k}||RID_{i})\) & \\ Checks \(M_{11}\stackrel{{?}}{{=}}h(SK_{ik}||T_{4})\) & \\ \hline \hline \end{tabular}