A cross-chain data synchronization and verification system and method
Through the cross-chain data synchronization and verification system, the data link storage and tailoring technology is used to solve the universality and security problems of cross-chain transaction verification, efficient data management and storage, and improved the scalability and security of the system .
Patent Information
- Application Number
- CN202411329219.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The existing cross-chain transaction existence proof technology lacks universality, and cannot effectively deal with the problem of re-verification and data reliance on a single node, and its security is insufficient.
A cross-chain data synchronization and verification system is proposed, including a synchronous data module, a verification data module and a folded data module. Blockchain data is stored and cut through data links to ensure the verification and storage efficiency of cross-chain transactions.
It realizes universal verification of cross-chain transactions, saves storage space, improves verification efficiency and scalability, and enhances the security and connectivity of the data link.
Smart Images

Figure CN118862186B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain cross-chain technology, and specifically to a cross-chain data synchronization and verification system and method. Background Art
[0002] Cross-chain transaction existence proof technology is a method used to verify that transactions across different blockchain networks exist and are valid on two or more blockchains. This is to ensure that the legitimacy and integrity of transactions can be effectively verified when assets or data are transferred between different blockchains. The following are some common cross-chain transaction existence proof schemes:
[0003] 1. SPV (Simple Payment Verification) Proof: SPV is a lightweight blockchain verification method, commonly used in blockchains based on the UTXO model. SPV proof allows a smaller or secondary chain blockchain network to verify whether the transaction on it has occurred on the main chain. This is achieved by tracking the Merkle tree proof on the blockchain without downloading and verifying all the blocks of the main chain.
[0004] 2. Relay Chain: Some cross-chain platforms or blockchain ecosystems use relay chains to connect different blockchain networks. A relay chain is a chain that hosts multiple blockchains and acts as a bridge between these blockchains. By generating proof of transaction existence on the relay chain, participants can transfer assets or data between different blockchains.
[0005] 3. On-chain verification: Some cross-chain protocols adopt an on-chain verification method. This means creating a smart contract or other form of protocol on the target chain, which is responsible for verifying the validity of the cross-chain transaction. Participants can submit proofs to the smart contract to verify the existence of the transaction.
[0006] 4. Multi-signature transactions: Multi-signature transactions require multiple participants to sign transactions on different blockchains to ensure the existence and security of cross-chain transactions. These signatures are proof of the existence of the transaction because they prove that multiple participants have agreed to the transaction.
[0007] The above solutions are all designed for certain types of blockchain features and lack universality; most verifications are real-time and one-time, without considering re-verification; cross-chain data mostly relies on a single node to obtain, and security needs to be strengthened. Summary of the invention
[0008] The cross-chain data synchronization and verification system and method proposed in the present invention can solve at least one of the technical problems in the background technology.
[0009] To achieve the above object, the present invention adopts the following technical solutions:
[0010] Cross-chain data synchronization and verification system, including synchronization data module, verification data module, and folding data module;
[0011] The synchronization data module is responsible for continuously synchronizing the verification data of each application chain data, storing it in the blockchain network in a data chain manner, and providing a verification data source for the verification data module;
[0012] The verification data module is responsible for providing verification of cross-chain transaction results for nodes or users, ensuring that cross-chain transactions have completed consensus on the application chain and that transaction rollback will not occur. After the verification is completed, the data chain block is moved to the folded data module;
[0013] The folding data module is responsible for cutting data chain blocks that are no longer needed by nodes or users to provide cross-chain transaction verification, saving storage space.
[0014] Furthermore, the synchronization data module of the present invention includes a synchronization contract submodule and a data chain submodule;
[0015] The synchronization contract submodule maintains the synchronization data verification rules, data consensus rules and node sets with the authority to call synchronization contracts for each application chain data according to the application chain ID;
[0016] The data chain submodule is used to define the data chain data block generation logic and data block chain logic, and to classify and store the synchronization data of the synchronization contract submodule. Different application chains correspond to different verification data and verification rules.
[0017] Furthermore, the verification data module of the present invention includes a verification contract submodule and a verification rule submodule;
[0018] The verification contract submodule maintains the data chain call information corresponding to the application chain and the node set with the authority to call the verification contract according to the application chain chain ID. The data chain corresponding to the application chain comes from the data chain generated by the synchronization data module.
[0019] The verification rule submodule defines the verification rules of various application chains, which correspond to the verification data in the data block on the corresponding data chain, and provides verification rules for the verification contract submodule.
[0020] Furthermore, the folding data module of the present invention includes a cutting data block submodule and a switching data block submodule;
[0021] The data chain trimming submodule mainly finds the trimming height interval through the trimming algorithm. For the data blocks verified by the verification contract submodule, it ensures that no node will verify the application chain transactions contained in the trimmed block height.
[0022] The transfer data link submodule is responsible for determining the block interval cut by the cutting data link submodule, generating a transfer block according to the interval height, taking over the previous data link block at the lower limit height of the interval, and transferring the next data link block at the upper limit height of the interval to ensure the connectivity and traceability of the data link.
[0023] Furthermore, the synchronization data verification rules of the present invention are as follows: the node monitors the new verification data on the application chain. When the new verification data is monitored, the node calls the synchronization contract on the relay chain to initiate a transaction and synchronizes the new verification data to the data chain.
[0024] Furthermore, the specific steps for the node in the present invention to call a synchronous contract on the relay chain to initiate a transaction are as follows:
[0025] Step 1: The node triggers the transaction to call the synchronization contract;
[0026] Step 2: Check whether the transaction caller belongs to the set of nodes that have the authority to call the synchronization contract;
[0027] If it does not, it means that the node does not have the authority to synchronize data, and the transaction execution procedure ends; if it does, it means that the node has the authority to synchronize data, and data entry is performed;
[0028] Step 3: Record the new verification data and caller information input into the contract;
[0029] Step 4: Determine whether the hash of the new verification data is consistent with the hash of the data recorded by other nodes calling the synchronization contract;
[0030] If there is inconsistency, it means that new verification data inconsistency has occurred between nodes and the transaction execution procedure is terminated; if there is consistency, data consensus is carried out;
[0031] Step 5: The contract triggers the generation of the data block of the data chain, throws a data block append event, and waits for the consensus of the block containing the transaction to succeed;
[0032] If successful, proceed to the next step; otherwise, the data block cache is deleted and the transaction is waiting to be re-executed;
[0033] Step 6: The node detects the data block append event, submits the data block, and completes the disk.
[0034] Furthermore, the data chain data block generation logic of the present invention is specifically as follows: when the synchronization contract transaction is executed successfully, a synchronization data success event is thrown, and the node generates a data block according to the verification data contained in the synchronization data success event.
[0035] Furthermore, the specific process of data verification described in the present invention is as follows:
[0036] Step 1: When the node receives a cross-chain transaction result or a cross-chain event, it parses the application chain transaction data in the cross-chain transaction result or cross-chain event, and calls the verification contract to verify the cross-chain transaction;
[0037] Step 2: The verification contract obtains verification data from the data chain corresponding to the application chain, and obtains verification rules from the verification rule submodule, and uses the verification rules and verification data to verify whether the transaction data is on the application chain and has been agreed not to be rolled back.
[0038] Furthermore, the specific process of the clipping algorithm described in the present invention is as follows:
[0039] Step 1: Confirm the set of nodes that have the right to call the verification contract and record the data chain block height that these nodes rely on when conducting verification;
[0040] Step 2: Start the first round of verification, and each node executes the transaction according to the current data chain status;
[0041] Step 3: After completing the first round of verification, wait for all nodes with permission to call the contract to be ready and start the second round of verification transactions;
[0042] Step 4: Collect the maximum data chain block height used by all routing nodes in the first round of verification, and record it as the clipping height interval;
[0043] Step 5: Perform data link trimming operations based on the trimming height interval to optimize storage and improve efficiency;
[0044] Step 6: Start the transfer data chain submodule to process the trimmed data management or archiving;
[0045] Step 7: Update the record of the second round of verification as the first round of verification preparation for the new rolling cycle, and notify all relevant nodes to update their verification status and prepare to enter the next round of verification cycle.
[0046] Furthermore, the transfer block generation process of the present invention is as follows:
[0047] Step 1: During the verification contract execution process, the system checks the set of all nodes with verification authority to confirm whether all nodes have successfully completed the second round of verification transactions in the current rolling cycle;
[0048] Step 2: Confirm that all nodes have completed the second round of verification, and the system automatically generates a transfer block, triggering the "cut data chain" event, indicating that it is ready to enter the data cleaning stage;
[0049] Step 3: Wait for the current verification contract transaction to be fully confirmed and placed on disk (i.e. written to the blockchain) along with the relevant relay chain block. After confirmation, formally submit the previously generated transfer block to the system as part of the new data chain.
[0050] Step 4: Based on the previously determined clipping height interval, the system begins to delete the data chain blocks within the specified interval, ensuring that the deletion operation is safe and does not affect subsequent verification or data integrity, and performs data cleanup;
[0051] Step 5: Update the system status, mark the pruning operation as completed, and prepare for the next rolling cycle. Notify all nodes about the pruning completion and the starting conditions of the new cycle to maintain the consistency of the verification process.
[0052] In another aspect, the present invention provides a cross-chain data synchronization and verification method, the specific steps are as follows:
[0053] S1. Synchronize the transaction verification data of each application chain contract and store the verification data in the corresponding data chain block in the relay chain network;
[0054] S2. Verify the cross-chain transaction results;
[0055] S3. If the transaction is completed, the data chain blocks that are no longer needed by nodes or users to provide cross-chain transaction verification are pruned;
[0056] S4. Update the system status and prepare for the next verification process.
[0057] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0058] It can be seen from the above technical scheme that the cross-chain data synchronization and verification system and method of the present invention includes a synchronization data module, a verification data module, and a folding data module. The verification data of each application chain is stored in the corresponding data chain block in the relay chain network through synchronization data, and then the cross-chain transaction verification is performed by the verification data module. At the end of the transaction, the data chain block is trimmed by the folding data module to ensure the connectivity of the next verification. Compared with traditional cross-chain transactions, the present invention solves the problem of single data source of the data chain, and uses a dynamically changing chain instead of a static data chain to enable it to have flexible service capabilities, save storage space, improve verification efficiency, and enhance scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a structural block diagram of the present invention;
[0060] Figure 2This is the entire synchronization flow chart for the synchronization data module. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0062] like Figure 1 As shown, the cross-chain data synchronization and verification system described in this embodiment specifically includes a synchronization data module, a verification data module, and a folding data module;
[0063] The synchronization data module is responsible for continuously synchronizing the verification data of each application chain data, storing it in the blockchain network in the form of a data chain, and providing a verification data source for the verification data module. The trimming data module trims the data chain of each application chain according to the verification records triggered by the verification data module, saving unnecessary on-chain storage space.
[0064] The synchronization data module includes a synchronization contract submodule and a data chain submodule;
[0065] The synchronization contract submodule maintains the synchronization data verification rules, data consensus rules and node sets with the authority to call synchronization contracts for each application chain data according to the application chain ID.
[0066] Synchronous data verification rules: monitor new verification data on the application chain through nodes;
[0067] When new verification data is monitored, the node calls the synchronization contract on the relay chain to initiate a transaction and synchronize the new verification data to the data chain.
[0068] like Figure 2 As shown, the specific method of synchronous contract transaction is as follows:
[0069] Step 1: The node triggers the transaction to call the synchronization contract;
[0070] Step 2: Check whether the transaction caller belongs to the set of nodes that have the authority to call the synchronization contract;
[0071] If it does not, it means that the node does not have the authority to synchronize data, and the transaction execution procedure ends; if it does, it means that the node has the authority to synchronize data, and proceed to the next step;
[0072] Step 3: Record the new verification data and caller information entered in this call in the contract;
[0073] For example, info=[ ]map{"hash":"data"}, nodeInfo=[ ]map{"hash":nodeSet}, where info refers to the new verification data record set, data is the verification data, hash is the verification data hash, nodeInfo is the node record set for synchronizing the new verification data, and nodeSet is the node set that calls the synchronization contract to input the verification data corresponding to the hash.
[0074] Step 4: Determine whether the hash of the new verification data is consistent with the hash of the data recorded by other nodes calling the synchronization contract;
[0075] If there is an inconsistency, it means that new verification data inconsistency has occurred between the nodes and the transaction execution procedure is terminated; if there is a consistency, data consensus is carried out.
[0076] Among them, the data consensus rule is: traverse the node record set that synchronizes the new verification data;
[0077] Check whether the caller set corresponding to each verification data hash meets the consensus conditions. If so, enter the data chain submodule.
[0078] Step 5: The contract triggers the generation of the data block of the data chain, throws a data block append event, and waits for the consensus of the block containing the transaction to succeed;
[0079] If successful, proceed to the next step; otherwise, the data block cache is deleted and the transaction is waiting to be re-executed;
[0080] Step 6: The node detects the data block append event, submits the data block, and completes the disk.
[0081] At this point, the block height on the data chain increases by 1, and the entire synchronization process ends.
[0082] There are four nodes in the node set that have the authority to call the synchronous contract, namely nodes 1, 2, 3, and 4;
[0083] ,nodeInfo=[ ]map{"hashA":[1,2,3], "hashB": [4]}, indicates that there are two verification data situations. The input verification data are dataA and dataB, and the corresponding verification data hashes are hashA and hashB. The synchronization data of nodes 1, 2, and 3 is the verification data corresponding to hashA, and the synchronization data of node 4 is the verification data corresponding to hashB. In this case, the verification data dataA corresponding to hashA reaches a consensus and will be stored in the data block and stored on the data chain with the data block.
[0084] The data chain submodule is used to define the data chain data block generation logic and data block chain logic. Different application chains correspond to different verification data and verification rules. Therefore, the application chain and the data chain are one-to-one, that is, one application chain corresponds to a data chain in the relay chain network.
[0085] The data chain data block generation logic is as follows:
[0086] When the synchronization contract transaction is executed successfully, a synchronization data success event is thrown, and the node generates a data block based on the verification data contained in the synchronization data success event.
[0087] For example, syncSuccessEvent{appChainId, appData}, where syncSuccessEvent indicates a successful data synchronization event, appChainId indicates the unique identifier of the application chain, and appData indicates the verification data of the application chain.
[0088] The node generates dataBlock{appChainId, hash, preHash, data, extra}, where dataBlock represents the data block, appChainId represents the chain unique identifier of the application chain, preHash represents the hash of the previous data block on the data chain, data represents the verification data of the application chain, and the verification data content of different application chains is different. Extra represents a reserved field where additional information can be entered. Hash represents the hash of the data block, which is generated by hash calculation of dataBlock.
[0089] The specific logic of data chain data block on-chain is as follows:
[0090] When a data block is generated, the node submits and confirms the data block and appends it to the data chain. The data chain submodule is triggered by the relay chain node when the relay chain block consensus is completed and the synchronization data success event thrown by the transaction in the relay chain block is checked. Therefore, each relay chain node will execute the data chain submodule and maintain the data chain ledger.
[0091] The verification data module is responsible for providing cross-chain transaction verification for nodes or users. When the node receives the cross-chain transaction result of the application chain, it verifies the cross-chain transaction result to ensure that the cross-chain transaction has completed consensus on the application chain and that transaction rollback will not occur. The application chain verification data required by the verification data module comes from the data chain generated in the synchronization data module.
[0092] The verification data module includes the verification contract submodule and the verification rule submodule;
[0093] The verification contract submodule maintains the data chain call information corresponding to the application chain and the set of nodes that have the authority to call the verification contract based on the application chain chain ID.
[0094] The verification rule submodule defines the verification rules of various application chains, which correspond to the verification data in the data block on the corresponding data chain, and provide verification rules for the verification contract submodule.
[0095] Step 1: When the node receives a cross-chain transaction result or a cross-chain event, it parses the application chain transaction data in the cross-chain transaction result or cross-chain event, and calls the verification contract to verify the cross-chain transaction.
[0096] Step 2: The verification contract obtains verification data from the data chain corresponding to the application chain, and obtains verification rules from the verification rule submodule, and uses the verification rules and verification data to verify whether the transaction data is on the application chain and has been agreed not to be rolled back.
[0097] The folding data module is responsible for cutting data chain blocks that are no longer needed by nodes or users to provide cross-chain transaction verification, saving storage space. The folding data module needs to verify that the contract is called with permission. When the node that verifies the contract calls, it records the data chain block height required for each node verification.
[0098] The folding data module mainly includes the cutting data block submodule and the transferring data block submodule;
[0099] The data chain trimming submodule mainly finds the trimming height interval through the trimming algorithm. For the data blocks verified by the verification contract submodule, it ensures that no node will verify the application chain transactions contained in the trimmed block height.
[0100] The specific contents of the clipping algorithm are as follows:
[0101] Step 1: Confirm the set of nodes that have the right to call the verification contract and record the data chain block height that these nodes rely on when conducting verification;
[0102] Step 2: Start the first round of verification, and each node executes the transaction according to the current data chain status;
[0103] Step 3: After completing the first round of verification, wait for all nodes with permission to call the contract to be ready and start the second round of verification transactions;
[0104] Step 4: Collect the maximum data chain block height used by all routing nodes in the first round of verification, and record it as the clipping height interval;
[0105] Step 5: Perform data link trimming operations based on the trimming height interval to optimize storage and improve efficiency;
[0106] Step 6: Start the transfer data chain submodule to process the trimmed data management or archiving;
[0107] Step 7: Update the record of the second round of verification as the first round of verification preparation for the new rolling cycle, and notify all relevant nodes to update their verification status and prepare to enter the next round of verification cycle.
[0108] Among them, one call is called a round, and every two rounds of calls are a rolling cycle.
[0109] The transfer data link submodule is responsible for determining the block interval cut by the cutting data link submodule, generating a transfer block according to the interval height, taking over the previous data link block at the lower limit height of the interval, and transferring the next data link block at the upper limit height of the interval to ensure the connectivity and traceability of the data link.
[0110] The transfer block structure is {appChainId, hash, preHash, number}
[0111] Where appChainId represents the unique identifier of the application chain, preHash represents the hash of the previous data chain block at the lower limit height of the clipping block interval, hash represents the hash of the data chain block at the upper limit height of the clipping block interval, and number represents the clipping block interval.
[0112] The transfer block generation process is as follows:
[0113] Step 1: During the verification contract execution process, the system checks the set of all nodes with verification permissions to confirm whether all nodes have successfully completed the second round of verification transactions in the current rolling cycle.
[0114] Step 2: Confirm that all nodes have completed the second round of verification, and the system automatically generates a transfer block, triggering the "cut data chain" event, indicating that it is ready to enter the data cleaning stage;
[0115] Step 3: Wait for the current verification contract transaction to be fully confirmed and placed on disk (i.e. written to the blockchain) along with the relevant relay chain block. After confirmation, formally submit the previously generated transfer block to the system as part of the new data chain.
[0116] Step 4: Based on the previously determined clipping height interval, the system begins to delete the data chain blocks within the specified interval, ensuring that the deletion operation is safe and does not affect subsequent verification or data integrity, and performs data cleanup;
[0117] Step 5: Update the system status, mark the pruning operation as completed, and prepare for the next rolling cycle. Notify all nodes about the pruning completion and the starting conditions of the new cycle to maintain the consistency of the verification process.
[0118] Correspondingly, a cross-chain data synchronization and verification method is also proposed in the embodiment of the present invention, and the specific steps are as follows:
[0119] S1. Synchronize the transaction verification data of each application chain contract and store the verification data in the corresponding data chain block in the relay chain network;
[0120] S2. Verify the cross-chain transaction results;
[0121] S3. If the transaction is completed, the data chain blocks that are no longer needed by nodes or users to provide cross-chain transaction verification are pruned;
[0122] S4. Update the system status and prepare for the next verification process.
[0123] In summary, the present invention proposes a method for cross-chain synchronization and verification, including a synchronization data module, a verification data module, and a folding data module. The verification data of each application chain is stored in the corresponding data chain block in the relay chain network through synchronization data, and then the cross-chain transaction verification is performed by the verification data module. At the end of the transaction, the data chain block is trimmed by the folding data module to ensure the connectivity of the next verification.
[0124] Compared with traditional cross-chain verification, it has the following advantages:
[0125] (1) One application chain connects to one data chain, which is applicable to various blockchain architectures, has a good degree of technical generalization, and has flexible service capabilities;
[0126] (2) The data chain can be based on the "one data chain, multiple verification rules" model, which enhances the diversity of verification rules;
[0127] (3) The data source of the data chain is not a single node. After consensus is reached, storage on the chain is triggered to ensure the authenticity of the data source;
[0128] (4) The application chain verification data is always synchronized and stored on the data chain. The verification process is based on the data chain, which decouples the two and improves scalability.
[0129] (5) The data link is a dynamically changing link, and its shape is to grow forward and fold backward. The forward growth ensures the real-time verification efficiency.
[0130] (6) The data link is a dynamically changing link. Its shape is that it grows forward and folds backward. Folding backward saves storage space.
[0131] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0132] In another embodiment provided in the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any cross-chain data synchronization and verification method in the above embodiments.
[0133] It is understandable that the system, device and storage medium provided in the embodiments of the present invention correspond to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above methods.
[0134] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0135] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0136] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0137] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cross-chain data synchronization and verification system, characterized in that: Including synchronization data module, verification data module, folding data module; The synchronization data module is responsible for continuously synchronizing the verification data of each application chain data, storing it in the blockchain network in a data chain manner, and providing a verification data source for the verification data module; The verification data module is responsible for providing verification of cross-chain transaction results for nodes or users, ensuring that cross-chain transactions have completed consensus on the application chain and that transaction rollback will not occur. After the verification is completed, the data chain block is moved to the folding data module; The folding data module is responsible for cutting data chain blocks that are no longer needed by nodes or users to provide cross-chain transaction verification, saving storage space; The synchronization data module includes a synchronization contract submodule and a data chain submodule; The synchronization contract submodule maintains the synchronization data verification rules, data consensus rules and node sets with the authority to call synchronization contracts for each application chain data according to the application chain ID; The data chain submodule is used to define the data chain data block generation logic and data block chain logic, and to classify and store the synchronization data of the synchronization contract submodule. Different application chains correspond to different verification data and verification rules. The synchronization data verification rules are as follows: the node monitors the new verification data on the application chain. When the new verification data is monitored, the node calls the synchronization contract on the relay chain to initiate a transaction and synchronizes the new verification data to the data chain; The specific steps for the node to call the synchronization contract on the relay chain to initiate a transaction are as follows: Step 1: The node triggers the transaction to call the synchronization contract; Step 2: Check whether the transaction caller belongs to the set of nodes that have the authority to call the synchronization contract; If not, it means that the transaction caller node does not have the authority to synchronize data, and the transaction execution procedure ends; If yes, it means the node has the authority to synchronize data and enter data; Step 3: Record the new verification data and caller information input into the contract; Step 4: Determine whether the hash of the new verification data is consistent with the hash of the data recorded by other nodes calling the synchronization contract; If there is inconsistency, it means that new verification data inconsistency has occurred between nodes and the transaction execution procedure is terminated; if there is consistency, data consensus is carried out; Step 5: The contract triggers the generation of the data block of the data chain corresponding to the source application chain of the verification data, throws a data block append event, and waits for the consensus of the block containing the transaction that calls the synchronization contract to succeed; If successful, proceed to the next step; otherwise, the data block cache is deleted and the transaction is waiting to be re-executed; Step 6: The node detects the data block append event, submits the data block, and completes the disk.
2. The cross-chain data synchronization and verification system according to claim 1, characterized in that: The verification data module includes the verification contract submodule and the verification rule submodule; The verification contract submodule maintains the data chain call information corresponding to the application chain and the node set with the authority to call the verification contract according to the application chain chain ID. The data chain corresponding to the application chain comes from the data chain generated by the synchronization data module. The verification rule submodule defines the verification rules of various application chains, which correspond to the verification data in the data block on the corresponding data chain, and provides verification rules for the verification contract submodule.
3. The cross-chain data synchronization and verification system according to claim 1, characterized in that: The folding data module includes a cutting data block submodule and a switching data block submodule; The data chain trimming submodule finds the trimming height interval through the trimming algorithm, and ensures that no node will verify the application chain transactions contained in the trimmed block height for the data blocks verified by the verification contract submodule; The transfer data link submodule is responsible for determining the block interval cut by the cutting data link submodule, generating a transfer block according to the interval height, taking over the previous data link block at the lower limit height of the interval, and transferring the next data link block at the upper limit height of the interval to ensure the connectivity and traceability of the data link.
4. The cross-chain data synchronization and verification system according to claim 1, characterized in that: The data chain data block generation logic is specifically as follows: when the synchronization contract transaction is executed successfully, a synchronization data success event is thrown, and the node generates a data block according to the verification data contained in the synchronization data success event.
5. The cross-chain data synchronization and verification system according to claim 2, characterized in that: The specific process of data verification is as follows: Step 1: When the node receives a cross-chain transaction result or a cross-chain event, it parses the application chain transaction data in the cross-chain transaction result or cross-chain event, and calls the verification contract to verify the cross-chain transaction; Step 2: The verification contract obtains verification data from the data chain corresponding to the source application chain of the cross-chain transaction, and obtains verification rules from the verification rule submodule. It uses the verification rules and verification data to verify whether the transaction data is on the source application chain of the cross-chain transaction and has been agreed not to be rolled back.
6. The cross-chain data synchronization and verification system according to claim 3, characterized in that: The specific process of the clipping algorithm is as follows: Step 1: Confirm the set of nodes that have the right to call the verification contract and record the data chain block height that these nodes rely on when conducting verification; Step 2: Start the first round of verification, and each node executes the transaction according to the current data chain status; Step 3: After completing the first round of verification, wait for all nodes with permission to call the contract to be ready and start the second round of verification transactions; Step 4: Collect the maximum data chain block height used by all routing nodes in the first round of verification, and record it as the clipping height interval; Step 5: Perform data link trimming operations based on the trimming height interval to optimize storage and improve efficiency; Step 6: Start the transfer data chain submodule to process the trimmed data management or archiving; Step 7: Update the record of the second round of verification as the first round of verification preparation for the new rolling cycle, and notify all relevant nodes to update their verification status and prepare to enter the next round of verification cycle.
7. The cross-chain data synchronization and verification system according to claim 3, characterized in that: The transfer block generation process is as follows: Step 1: During the verification contract execution process, the system checks the set of all nodes with verification authority to confirm whether all nodes have successfully completed the second round of verification transactions in the current rolling cycle; Step 2: Confirm that all nodes have completed the second round of verification, and the system automatically generates a transfer block, triggering the "cut data chain" event, indicating that it is ready to enter the data cleaning stage; Step 3: Wait for the current verification contract transaction to be fully confirmed and written to the blockchain along with the relevant relay chain block. After confirmation, formally submit the previously generated transfer block to the system as part of the new data chain. Step 4: Based on the previously determined clipping height interval, the system begins to delete the data chain blocks within the specified interval, ensuring that the deletion operation is safe and does not affect subsequent verification or data integrity, and performs data cleanup; Step 5: Update the system status, mark the pruning operation as completed, and prepare for the next rolling cycle. Notify all nodes about the pruning completion and the starting conditions of the new cycle to maintain the consistency of the verification process.
8. A cross-chain data synchronization and verification method, implemented by the cross-chain data synchronization and verification system according to any one of claims 1 to 7, characterized in that: The specific steps are as follows: S1. Synchronize the transaction verification data of each application chain contract and store the verification data in the corresponding data chain block in the relay chain network; S2. Verify the cross-chain transaction results; S3. If the transaction is completed, the data chain blocks that are no longer needed by nodes or users to provide cross-chain transaction verification are pruned; S4. Update the system status and prepare for the next verification process.
