# A Cross-Chain Solution to Connect Multiple DNS Blockchains in Consensus Roots System
## 4 Construction of Our System
### Cross-Chain Domain Name Synchronization  
We propose Algorithm 1, which is designed to facilitate the cross-chain domain name synchronization between the two distinct blockchains (referred to as the source chain (_chainA_) and the target chain (_chainB_)). The algorithm aims to streamline the transfer and updating of the domain name information across these chains, involving a sequence of meticulously structured steps:  
\begin{table}
\begin{tabular}{c l} \hline \hline
**Notation** & **Description** \\ \hline \(A\) & Represents Chain A in the blockchain network \\ \(B\) & Represents Chain B in the blockchain network \\ domain & The domain name to be synchronized between chains \\ res & The resolved state of the domain after processing \\ \(req\) & The request sent from Chain A to Chain B or vice versa \\ \(fb\) & Feedback sent from Chain B to Chain A or vice versa \\ \(tx\) & Transaction object that holds domain-related data \\ \(result\) & The result of the transaction \\ time & The timestamp when the transaction occurs \\ \hline \hline \end{tabular}
\end{table}
Table 1: Notation.  
1. Initiation by Source Chain: chainA starts the process by sending a synchronization request to chainB. The request contains the IDs of both chains and the domain name information (domain.info).
2. Initial Request Validation by Relay Node: A relay node obtains the request and validates its legitimacy. If it is valid, the process continues; otherwise, the request is rejected, and chainA is notified.
3. Request Forwarding and Validation by Target Chain: If the validation is successful, the relay node sends the request to chainB. Then, chainB validates the request according to its own rules and protocols.
4. Processing and Feedback by Target Chain: After validation, chainB performs the operations related to the domain name information. Then, chainB sends feedback, with its ID and either the result of the domain name operation (domain.result) or the rejection reason, to chainA.
5. Feedback Forwarding and Validation by Source Chain: The relay node forwards the feedback to chainA, which also validates the feedback to check its authenticity.
6. Confirmation by Source Chain: If the feedback is valid, chainA sends a confirmation message, with its ID and marking the synchronization status as either \"completed\" or \"failed\" based on the feedback, to chainB.
7. Proof Generation by Relay Node: The relay node generates a proof message (proof) that contains the IDs of both chains and the results of the domain name operation. This proof is an immutable record, providing evidence for the process and its outcome.  
```
1:procedureSync(\(A.ID,B.ID,domain.info\))
2:\(A.send.req(A.ID,B.ID,domain.info)\)
3:\(relay.verify.req(A.ID,B.ID,domain.info)\)
4:if\(req.valid\)then
5:\(relay.forward.req(A.ID,B.ID,domain.info)\)
6:\(B.receive.req(A.ID,B.ID,domain.info)\)
7:\(B.verify.req(A.ID,B.ID,domain.info)\)
8:if\(req.valid\)then
9:\(B.send.fb(B.ID,domain.result)\)
10:else
11:\(B.send.fb(B.ID,\"rejected\")\)
12:endif
13:\(relay.forward.fb(B.ID,domain.result)\)
14:\(A.receive.fb(B.ID,domain.result)\)
15:\(A.verify.fb(B.ID,domain.result)\)
16:if\(fb.valid\)then
17:\(A.send.confirm(A.ID,\"completed\")\)
18:else
19:\(A.send.confirm(A.ID,\"failed\")\)
20:endif
21:\(relay.generate.proof(A.ID,B.ID,domain.result)\)
22:else
23:\(relay.reject.req(A.ID,B.ID,domain.info)\)
24:endif
25:endprocedure
```  
**Algorithm 1** Cross-chain domain name synchronization