## 6 Proposed Cross-Domain Authentication Method
### Intra-Domain Device Mutual Authentication  
After the registration phase of Device \(D_{i}^{A}\) is completed, it can perform mutual authentication with Edge Gateway \(EG_{i}^{A}\) in the same Domain A. Here, we use Domain A as a concrete example of Domain X. As shown in Figure 2, the authentication process is as follows:  
**(1) Initial authentication message from the device to the edge gateway.** Device \(D_{i}^{A}\) retrieves the registration information of Edge Gateway \(EG_{i}^{A}\) from the blockchain through the blockchain anchor node, generates a random number \(a_{i}\) and a timestamp \(T_{1}\), and then computes  
\[B_{it}=T_{SK_{D_{i}^{A}}}(PK_{EG_{i}^{A}})\]  
\[E_{i}=T_{a_{i}}(x)\]  
\[M_{1}=PDID_{i}^{A}\oplus h(EID_{i}^{A}||B_{it})\]  
\[M_{2}=h(PDID_{i}^{A}||B_{it}||E_{i}||T_{1})\]  
Device \(D_{i}\) sends \((M_{1},M_{2},PK_{D_{i}^{A}},E_{i},T_{1})\) to \(EG_{i}^{A}\), where \(EID_{i}^{A}\) is the identifier of Edge Gateway \(EG_{i}^{A}\).  
**(2) Authentication verification by the edge gateway.** Upon receiving the message, Edge Gateway \(EG_{i}^{A}\) verifies whether the timestamp is within the valid range, i.e., \(|T_{-}-T_{1;}|<\Delta_{t}\), where \(T\) is the current timestamp and \(\Delta_{t}\) is the valid time that represents the maximum allowable round-trip time for messages under normal conditions. Its value should be determined through statistical analysis based on the specific scenario. If the timestamp is valid, \(EG_{i}^{A}\) computes  
\[B_{it}=T_{SK_{EG_{i}^{A}}}(PK_{D_{i}^{A}})\]  
\[PDID_{i}^{A}=M_{1}\oplus h(EID_{i}^{A}||B_{it})\]  
Edge Gateway \(EG_{i}^{A}\) checks whether \(\{PDID_{i}^{A},PK_{D_{i}^{A}}\}\) exists on the blockchain through the anchor node. If \(\{PDID_{i}^{A},PK_{D_{i}^{A}}\}\) exists on the blockchain and \(M_{2}=h(PDID_{i}^{A}||B_{it}||E_{i}||T_{1})\), then \(D_{i}^{A}\) is successfully authenticated. Edge Gateway \(EG_{i}^{A}\) then generates two random numbers \(a_{i}\) and \(b_{t}\), along with \(a\) timestamp \(T_{2}\), and computes  
\[U_{H}=T_{a_{t}}(E_{i})\]  
\[V_{t}=T_{a_{t}}(x)\]\[TID_{i}=h(b_{i}||EID_{i}^{A}||PDID_{i}^{A})\] \[M_{3}=TID_{i}\oplus h(U_{it}||PDID_{i}^{A})\] \[SK_{it}=h(U_{it}||TID_{i}||PDID_{i}^{A})\] \[M_{4}=h(SK_{it}||T_{2})\]  
\(EG_{i}\) sends \((M_{3},M_{4},V_{t},T_{2})\) to \(D_{i}\). Then, \(EG_{i}^{A}\) generates a new timestamp \(T_{3}\) and computes  
\[Y_{t}=h(TID_{i}||EID_{i}^{A}||S||T_{3})\oplus PDID_{i}^{A}\]  
Edge Gateway \(EG_{i}^{A}\) uploads \(TID_{i},EID_{i}^{A},Y_{t},T_{3}\) to the blockchain with the help of the associated anchor node. The successful recording of the message on the blockchain indicates that Device \(D_{i}^{A}\) has successfully passed authentication by \(EG_{i}^{A}\) at time \(T_{3}\). Leveraging the immutability and transparency of the blockchain, edge gateways in other domains can quickly perform handover authentication for device Device \(D_{i}^{A}\) via anchor nodes based on its initial authentication record stored on the blockchain.  
Figure 2: The workflow of intra-domain device mutual authentication.  
**(3) Authentication verification by the device.** Upon receiving the message, Device \(D_{i}^{A}\) first checks the validity of the timestamp \(T_{2}\), ensuring that \(|T-T_{2}|<\Delta_{t}\), where \(T\) is the current timestamp.  
\[U_{it}=T_{a_{i}}(V_{t})\]  
\[TID_{i}=M_{3}\oplus h(U_{it}||PDID_{i}^{A})\]  
\[SK_{it}=h(U_{it}||TID_{i}||PDID_{i}^{A})\]  
Device \(D_{i}^{A}\) verifies whether \(M_{4}=h(SK_{it}||T_{2})\). If the values match, the authentication is successful, and the vehicle stores the session key \(SK_{it}\) and the temporary identity \(TID_{i}\).