On-chain and off-chain cooperative interaction system based on block chain
By designing a blockchain-based off-chain collaborative interaction system, using Merkle tree management data structure, distributed storage and transmission technology, the automated management and synchronization of data is achieved, and the shortcomings of off-chain data management are solved, and the authenticity, reliability and security of data are improved.
Patent Information
- Application Number
- CN202510668429.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-05
AI Technical Summary
In the prior art, the data storage capacity on the blockchain chain is limited, the processing efficiency is low, and the off-chain data lacks effective verification and management, resulting in insufficient data authenticity and reliability, which is easy to be tampered with and forged.
Design a blockchain-based on-chain and off-chain collaborative interaction system, adopts Merkle tree management data structure, combines distributed storage and transmission technology to realize two-way data synchronization and verification, and automatically manage it through smart contracts.
Ensure data authenticity and non-tamperability, improve data processing efficiency and reliability, adapt to data growth, reduce manual intervention, and ensure data security and privacy.
Smart Images

Figure CN120602125A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of blockchain technology, and specifically relates to a collaborative interaction system based on blockchain and off-chain. Background Art
[0002] With the rapid development of information technology, the scale and complexity of data continue to rise. In many business scenarios, how to manage and process data efficiently and reliably has become a key issue that needs to be solved urgently.
[0003] Blockchain technology, with its unique advantages such as decentralization, immutability, and traceability, has opened up new paths and provided new solutions for data management. However, in actual application, relying solely on on-chain data processing has obvious limitations. For example, on-chain storage capacity is limited and processing efficiency is relatively low. At the same time, due to the lack of effective verification and management mechanisms, the authenticity and reliability of off-chain data are greatly reduced, and data tampering and forgery often occur.
[0004] In order to fully unleash the advantages of blockchain technology, make up for the shortcomings of on-chain and off-chain data management, and achieve efficient collaborative processing of data, it is urgent to build a system that can realize collaborative interaction of on-chain and off-chain data. Although there have been some research and practices on on-chain and off-chain data interaction, there are still many problems in many aspects such as data structure design, distributed data storage and transmission, and data synchronization strategies. It is difficult to meet the strict requirements of data authenticity, reliability and immutability in complex business scenarios. To this end, this application proposes an on-chain and off-chain collaborative interaction system based on blockchain. Summary of the Invention
[0005] The purpose of the present invention is to provide an on-chain and off-chain collaborative interaction system based on the blockchain in order to solve the above problems. By studying the authenticated data structure, distributed data storage and transmission technology, data synchronization strategy and technology, a data collaborative system on the chain and off-chain is constructed to ensure that the data is authentic, reliable and cannot be tampered with, and support verification to meet the strict requirements for data management in complex business scenarios, thereby solving the problems mentioned in the background technology.
[0006] In order to solve the above problems, the present invention provides a technical solution:
[0007] A blockchain-based on-chain and off-chain collaborative interaction system, including:
[0008] Data structure module: used to design a composite data structure containing metadata, data content, hash value and timestamp, and use Merkle tree to manage data;
[0009] Distributed storage and transmission module: used to store data using a distributed file system off-chain, store key data on-chain using blockchain, and design a secure transmission protocol;
[0010] Data synchronization module: realizes two-way synchronization based on timestamp and hash value, combining state synchronization and transaction synchronization;
[0011] Data verification module: Verify data integrity through hash value and Merkle tree, and verify authenticity through digital signature;
[0012] Smart Contract Module: Used to write smart contracts to achieve automated management of on-chain and off-chain data collaboration, and automatically manage data collaboration and access rights through smart contracts.
[0013] Preferably, in the data structure module, metadata information is used to describe data attributes, data content is actual stored data, hash value is generated by data content, and timestamp is used to record data creation or update time.
[0014] Preferably, the Merkle tree groups data to calculate hash values, and constructs a tree structure by combining them layer by layer to achieve efficient management.
[0015] Preferably, in the distributed data storage and transmission module, the off-chain distributed file system stores data in a dispersed manner across multiple storage nodes and ensures security through a redundancy mechanism.
[0016] Preferably, in the distributed data storage and transmission module, the chain is used to store hash values, metadata and association identifiers of key data with off-chain data.
[0017] Preferably, in the distributed data storage and transmission module, encryption technology is used to encrypt data during data transmission, and P2P network technology is used to achieve distributed data transmission.
[0018] Preferably, in the data synchronization strategy and technology module, a two-way data synchronization strategy based on timestamps and hash values is formulated. When off-chain data is updated, the new hash value and timestamp are uploaded to the chain for verification; changes in on-chain data are synchronized to off-chain nodes to update local data.
[0019] Preferably, in the data synchronization strategy and technology module, data synchronization is achieved by combining state synchronization and transaction synchronization. State synchronization is used to synchronize the overall state of data, and transaction synchronization is used to synchronize specific data operations.
[0020] Preferably, in the data verification module, the hash value of the off-chain data is calculated and compared with the hash value stored on the chain to verify whether the data has been tampered with, and the characteristics of the Merkle tree are used to quickly verify the integrity of large-scale data.
[0021] Preferably, in the smart contract module, a smart contract is written to realize the collaborative and automated management of on-chain and off-chain data. It automatically performs data storage, synchronization, verification and other operations according to preset rules, and manages data access rights. Based on user identity and permissions, it controls user access and operations to on-chain and off-chain data.
[0022] The beneficial effects of the present invention are: with the help of the Merkle tree structure and the hash value-based verification method, data integrity can be verified quickly and accurately, and data tampering can be detected in time. By designing distributed data storage, transmission technology and two-way data synchronization strategy, efficient collaborative interaction of on-chain and off-chain data can be achieved, and data processing efficiency and reliability can be improved. Relying on the tamper-proof and distributed ledger characteristics of blockchain, combined with encryption, digital signature and other security technologies, data security and privacy are guaranteed to prevent data from being stolen, tampered with, and forged. At the same time, distributed storage and P2P network transmission technology enable the system to easily expand storage nodes and processing capabilities to adapt to data growth. The introduction of smart contracts realizes collaborative and automated management of on-chain and off-chain data, reduces manual intervention, improves efficiency and reduces risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] For ease of explanation, the present invention is described in detail with reference to the following specific implementations and accompanying drawings.
[0024] Figure 1 It is a block diagram of the data structure module of the present invention.
[0025] Figure 2 This is a block diagram of the distributed storage and transmission module of the present invention.
[0026] Figure 3 It is a block diagram of the data synchronization module of the present invention.
[0027] Figure 4 It is a block diagram of the data verification module of the present invention.
[0028] Figure 5 This is a block diagram of the smart contract module of the present invention. DETAILED DESCRIPTION
[0029] like Figure 1-5 As shown, this specific embodiment adopts the following technical solutions:
[0030] Example:
[0031] A blockchain-based on-chain and off-chain collaborative interaction system, including:
[0032] Data structure module: used to design a composite data structure that includes metadata information, data content, hash value and timestamp. Metadata information is used to describe the basic attributes of data, such as data type, source, creator, etc.; data content is the actual stored data; hash value is generated by hashing the data content and is used to quickly verify the integrity of the data; timestamp records the time when the data was created or updated; Merkle tree structure is used to organize and manage data, grouping data according to certain rules, calculating a hash value for each data group, and further combining these hash values to form higher-level hash values, ultimately constructing a Merkle tree. The Merkle tree can efficiently verify the integrity and consistency of data and quickly locate tampered data;
[0033] Distributed data storage and transmission module: The off-chain uses a distributed file system for data storage, and stores data in multiple storage nodes in a dispersed manner to improve the reliability and scalability of data storage. Each storage node saves part of the data and ensures the security of the data through a redundant storage mechanism. Even if some nodes fail, the data can still be accessed and used normally. The on-chain uses the distributed ledger characteristics of the blockchain to store key data, and stores the hash value, metadata information and associated identifiers of the data with the off-chain data on the blockchain to ensure the immutability and traceability of key data. A safe and efficient distributed data transmission protocol is designed. During the data transmission process, encryption technology is used to encrypt the data to prevent the data from being stolen or tampered with during transmission. At the same time, P2P network technology is used to realize distributed data transmission, improving the efficiency and reliability of data transmission.
[0034] Data synchronization strategy and technology module: used to formulate a two-way data synchronization strategy based on timestamps and hash values. When off-chain data is updated, the hash value and timestamp of the updated data are calculated and sent to the chain together with the updated data. After the on-chain node receives the data, it verifies the hash value and timestamp to ensure the integrity and update order of the data. At the same time, the changes in on-chain data will also be synchronized to the off-chain. The off-chain node updates the local data according to the updated information on the chain. Data synchronization is achieved by combining state synchronization and transaction synchronization. State synchronization is used to synchronize the overall state of the data to ensure the consistency of on-chain and off-chain data; transaction synchronization is used to synchronize specific data operations, such as data creation, update, deletion, etc., to ensure the integrity and traceability of data operations.
[0035] Data verification module: Data integrity verification is performed based on hash values and Merkle trees. For off-chain data, the hash value of the data is calculated and compared with the hash value stored on the chain to verify whether the data has been tampered with. For large-scale data, the characteristics of the Merkle tree can be used to quickly verify the integrity of the data. Digital signature technology is introduced to verify the authenticity of the data. The creator or owner of the data digitally signs the data. During the data transmission and storage process, the recipient verifies the digital signature to ensure that the data comes from a legitimate source and has not been tampered with.
[0036] Smart contract module: Write smart contracts to realize the automated management of on-chain and off-chain data collaboration. Smart contracts can automatically perform data storage, synchronization, verification and other operations according to preset rules and conditions. For example, when off-chain data meets certain conditions, the smart contract automatically synchronizes the data to the chain and performs data verification. Smart contracts are used to manage data access rights. Based on the user's identity and permissions, smart contracts control the user's access and operation to on-chain and off-chain data to ensure data security and privacy.
[0037] In summary:
[0038] The data structure module starts quickly when data is generated or entered, breaking down the data into core parts and constructing a composite data structure. Metadata information serves as the "identity tag" of the data, describing attributes such as data type (such as transactions, file data, etc.), source (device, system or user), and creator, providing basic information for subsequent management. Data content is the core object processed by the system. At the same time, the module uses a hash algorithm to calculate the data content and generate a unique hash value as the "digital fingerprint" of the data for integrity verification. The timestamp records the time when data is created or updated, clarifies the temporal relationship, and plays an important role in data synchronization and traceability. In order to efficiently manage and quickly verify massive data, the module uses a Merkle tree structure to group data and calculate hash values, combining them layer by layer to form a complete Merkle tree. When verifying data integrity, it is only necessary to verify the relevant hash path, which greatly improves efficiency and locates tampered groups.
[0039] Off-chain data storage uses a distributed file system to disperse data across multiple nodes. A redundant storage mechanism ensures that data can still be obtained when some nodes fail, ensuring security and reliability, and making it easy to expand storage nodes. On-chain data storage utilizes the distributed ledger characteristics of the blockchain to store data hash values, metadata information, and association identifiers with off-chain data. The blockchain's tamper-proof nature ensures data authority and traceability. The on-chain hash value can verify the integrity of off-chain data. Metadata and association identifiers build a bridge for on-chain and off-chain collaborative interaction. During data transmission, encryption technology is used to ensure security. Encrypted data is transmitted over the network to prevent theft or tampering. P2P network technology is used to achieve distributed transmission, reduce transmission delays, improve efficiency and reliability, and enhance the system's anti-attack capabilities.
[0040] The data synchronization module adopts a two-way data synchronization strategy based on timestamps and hash values, combining state synchronization with transaction synchronization to ensure the consistency of on-chain and off-chain data. When off-chain data is updated, a new hash value and timestamp are calculated, packaged and sent to the chain, and the node verifies the hash value and timestamp to ensure data integrity and update order. When on-chain data changes, the node synchronizes the updated information to the off-chain, and the off-chain node adjusts the local data to achieve two-way synchronization. State synchronization regularly compares the overall status of on-chain and off-chain data, and transaction synchronization records and synchronizes data operations in detail. The two together ensure accurate and efficient data synchronization;
[0041] The data verification module ensures data authenticity and integrity. For integrity verification, hash values are calculated before and after off-chain data storage and transmission, and compared with the on-chain hash values. If there is any inconsistency, an alarm is issued and measures are taken. Large-scale data utilizes the Merkle tree feature to verify the root hash value to determine overall integrity. If there is any inconsistency, specific groups are checked to locate tampered data. For authenticity verification, the data creator digitally signs with a private key, and the recipient verifies the signature with a public key. Passing the signature indicates that the data is from a legitimate source and has not been tampered with.
[0042] The smart contract module realizes the collaborative automation of on-chain and off-chain data and data access rights management by writing smart contracts. In terms of collaborative automation of data management, smart contracts preset rules and conditions. For example, when off-chain data meets specific conditions (such as update frequency threshold, data size limit), it automatically triggers data synchronization to the chain and verification. It can also automatically perform data storage operations and select storage methods according to data type and importance. In terms of data access rights management, smart contracts assign different permissions (such as read, write, and modify permissions) to different users or user groups. When users access or operate data, smart contracts verify their identities and permissions to ensure data security and privacy. It is used to synchronize the overall status of data and ensure that on-chain and off-chain data are consistent at the macro level; transaction synchronization focuses on synchronizing specific data operations, such as data creation, update, deletion, etc., to ensure the integrity and traceability of data operations, so that every change in data can be traced;
[0043] The data verification module performs data integrity verification based on hash values and Merkle trees, and also introduces digital signature technology to verify data authenticity. For off-chain data, by calculating the data's hash value and comparing it with the hash value stored on the chain, it can be verified whether the data has been tampered with. For large-scale data, the characteristics of the Merkle tree can play a huge advantage, quickly verifying data integrity and greatly improving verification efficiency. In terms of data authenticity verification, digital signature technology is introduced. The creator or owner of the data digitally signs the data. During the data transmission and storage process, the recipient can verify the digital signature to ensure that the data comes from a legitimate source and has not been tampered with, providing another layer of protection for data security.
[0044] The smart contract module realizes the automated management of on-chain and off-chain data collaboration by writing smart contracts. Smart contracts can automatically perform data storage, synchronization, verification and other operations according to preset rules and conditions. For example, when off-chain data meets certain conditions, the smart contract can automatically synchronize the data to the chain and perform data verification without human intervention, thereby improving the efficiency and accuracy of data processing. Smart contracts can also be used to manage data access rights. Based on the user's identity and permissions, smart contracts strictly control the user's access and operation of on-chain and off-chain data, ensuring that only authorized users can access and operate the corresponding data, thereby effectively protecting the security and privacy of the data.
[0045] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A blockchain-based on-chain and off-chain collaborative interaction system, characterized by: include: Data structure module: used to design a composite data structure containing metadata, data content, hash value and timestamp, and use Merkle tree to manage data; Distributed storage and transmission module: used to store data using a distributed file system off-chain, store key data on-chain using blockchain, and design a secure transmission protocol; Data synchronization module: realizes two-way synchronization based on timestamp and hash value, combining state synchronization and transaction synchronization; Data verification module: Verify data integrity through hash value and Merkle tree, and verify authenticity through digital signature; Smart Contract Module: Used to write smart contracts to achieve automated management of on-chain and off-chain data collaboration, and automatically manage data collaboration and access rights through smart contracts.
2. The blockchain-based on-chain and off-chain collaborative interaction system according to claim 1 is characterized in that: In the data structure module, metadata information is used to describe data attributes, data content is the actual stored data, hash value is generated by data content, and timestamp is used to record data creation or update time.
3. The blockchain-based on-chain and off-chain collaborative interaction system according to claim 1 is characterized in that: The Merkle tree groups data to calculate hash values, and constructs a tree structure layer by layer to achieve efficient management.
4. The blockchain-based on-chain and off-chain collaborative interaction system according to claim 1, characterized in that: In the distributed data storage and transmission module, the off-chain distributed file system stores data in multiple storage nodes and ensures security through a redundancy mechanism.
5. The blockchain-based on-chain and off-chain collaborative interaction system according to claim 1 is characterized in that: In the distributed data storage and transmission module, the chain is used to store the hash value, metadata and association identifier of key data with the off-chain data.
6. The blockchain-based on-chain and off-chain collaborative interaction system according to claim 1, characterized in that: In the distributed data storage and transmission module, encryption technology is used to encrypt data during data transmission, and P2P network technology is used to achieve distributed data transmission.
7. The blockchain-based on-chain and off-chain collaborative interaction system according to claim 1, characterized in that: In the data synchronization strategy and technology module, a two-way data synchronization strategy based on timestamps and hash values is formulated. When off-chain data is updated, the new hash value and timestamp are uploaded to the chain for verification; On-chain data changes are synchronized to off-chain nodes to update local data.
8. The blockchain-based on-chain and off-chain collaborative interaction system according to claim 1, characterized in that: In the data synchronization strategy and technology module, data synchronization is achieved by combining state synchronization and transaction synchronization. State synchronization is used to synchronize the overall state of data, and transaction synchronization is used to synchronize specific data operations.
9. The blockchain-based on-chain and off-chain collaborative interaction system according to claim 1, characterized in that: In the data verification module, the hash value of the off-chain data is calculated and compared with the hash value stored on the chain to verify whether the data has been tampered with, and the characteristics of the Merkle tree are used to quickly verify the integrity of large-scale data.
10. The blockchain-based on-chain and off-chain collaborative interaction system according to claim 1, characterized in that: In the smart contract module, smart contracts are written to achieve collaborative and automated management of on-chain and off-chain data. They automatically perform data storage, synchronization, verification and other operations according to preset rules, and manage data access rights. Based on user identity and permissions, they control user access and operations to on-chain and off-chain data.
Citation Information
Cited By
Data synchronization method, device, equipment, medium and product
CN121681675A
Data synchronization method, apparatus, device, medium, and product
CN121681675B