Blockchain asset and contract processing method, system and device based on oracle
By digitizing and storing assets in IPFS system and using oracles to expand smart contract functions, the problems of high storage costs of blockchain and flexible application of smart contracts are solved, and flexible processing and efficient storage of asset digitization are realized, and large-scale data storage is supported. and flexible applications of smart contracts.
Patent Information
- Application Number
- CN202110950464.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-18
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2041-08-18
AI Technical Summary
The high storage costs on blockchain and the performance bottlenecks of traditional centralized storage systems limit large-scale data storage applications. The flexible application of smart contracts in decentralized networks is limited, making it difficult to repeat multiple processes of operating the same asset business.
Digitalize assets and store them in the IPFS system, generate smart contracts through blockchain storage modules, use oracles to expand contract functions, realize cross-chain data interaction and signature updates, reduce the burden of blockchain storage, and improve storage security and reliability sex.
It realizes flexible processing of asset digitalization, reduces blockchain storage costs, improves storage performance and security, and supports flexible applications of large-scale data storage and smart contracts.
Smart Images

Figure CN113628052B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of blockchain technology, and specifically relates to a blockchain asset and contract processing method, system and device based on an oracle. Background Art
[0002] When developing DAPP on the blockchain, various forms of data need to be stored in the smart contract, but the storage cost on the blockchain is very high, requiring a lot of handling fees. It is only suitable for storing some critical small amounts of data, and is not suitable for large-scale data storage, which is undoubtedly not conducive to the large-scale application of the blockchain. In the process of asset digitization, for applications such as electronic contracts that need to store a large amount of large text, the expensive storage cost will make it difficult for assets to be put on the chain.
[0003] Traditional network storage systems use centralized storage servers to store all data. Storage servers become the bottleneck of system performance and cannot meet the needs of large-scale storage applications. Distributed network storage systems use a scalable system structure, use multiple storage servers to share the storage load, and use location servers to locate storage information. It not only improves the reliability, availability and access efficiency of the system, but also makes it easy to expand. The IPFS system is a distributed storage network and a distributed file system that can shard files. Compared with traditional centralized storage systems, it has the advantages of high security and fast access speed.
[0004] Oracle is the interface between blockchain and the outside world, and is a development direction of blockchain technology. For smart contracts, the oracle is equivalent to the input parameters of the smart contract, and the input parameters have a direct impact on the output results of the smart contract. Smart contracts based on the blockchain execution platform are usually in a decentralized and tamper-proof network environment. Smart contracts are distributed and stored in the blockchain network and automatically execute transactions and other activities according to trigger conditions. Once deployed, they cannot be modified. This is to ensure the absoluteness of the consensus protocol involving events such as asset transactions on the blockchain network. However, there are problems such as control difficulties and the inability to flexibly apply smart contracts according to scenarios, which limits the application of smart contracts. How to repeatedly operate smart contracts to flexibly apply multiple processes of the same asset business has always been a key issue facing smart contracts. Summary of the invention
[0005] Based on the above background and the problems existing in the prior art, the present invention intends to design a blockchain asset and contract processing method, system and device based on an oracle, which can realize flexible processing of digital assets. Other advantages, objectives and features of the present invention will be reflected in part through the following description, and in part will be understood by those skilled in the art through research and practice of the present invention.
[0006] In order to achieve these purposes and other advantages of the present invention, a blockchain asset and contract processing method based on an oracle is provided, and the specific implementation steps include:
[0007] Convert assets (in the form of documents) into deposits or certificates and upload them to the IPFS system in the form of digital assets. The digital form of assets, that is, digital assets are mainly converted into PDF or TXT formats in the form of images;
[0008] The first storage module of the blockchain obtains, generates and stores the basic information of the digital asset, generates a first smart contract as a contract controller, controls or calls or generates a sub-contract;
[0009] The second storage module of the blockchain obtains the basic information of the digital asset from the first storage module to generate a token credential, and triggers the first smart contract to obtain the token credential and generate a second smart contract;
[0010] The first signature module obtains the basic information of the token credential and the file for authentication and generates an electronic signature, stores the electronic signature on the chain in the signature storage module through the oracle, and calls the first smart contract to generate a third smart contract;
[0011] The first storage module of the blockchain binds the first smart contract, the second smart contract and the third smart contract to the oracle interface to form an association relationship, uploads the electronic signature update information to the third smart contract through the first signature module of the oracle interface, and the first smart contract controls, calls or generates one or more of the second smart contract and the third smart contract;
[0012] When the second smart contract needs to verify the transaction, it obtains the electronic signature through the third smart contract. When the electronic signature expires, the third smart contract is triggered by the signature storage module to call the oracle interface to obtain the updated electronic signature. The first signature module obtains and returns the source file of the digital asset in the IPFS system through the external smart contract to verify and update the electronic signature. Among them, the first signature module is an authoritative financial certification center outside the blockchain or a certified trading market, etc., to obtain transaction information such as the sale of assets, or execute corresponding transactions through the second smart contract.
[0013] In the above scheme, the assets in the IPFS system are digitized and stored in the IPFS system in the form of files. At the same time, the summary in the form of files and the belonging information are stored in the first storage module of the blockchain, and a first smart contract containing the summary is generated accordingly for obtaining the digital assets stored in the IPFS.
[0014] Furthermore, the first smart contract updates the smart contract in response to the need of the first signature module to update the electronic signature, and the first signature module obtains the data flow of digital asset information on the IPFS system before triggering the external smart contract. The oracle expands the function of the smart contract. The oracle accesses the third smart contract so that the signature storage module on the blockchain takes over the first signature module. The data request and data reception of the first signature module will interact with the third smart contract connected to the oracle through a cross-contract method, and the third smart contract interacting with the oracle is responsible for communicating with the second smart contract. At the same time, the first smart contract communicates with the node service of the IPFS system, that is, triggers the data request event, and receives the data uploaded by the node outside the chain, so as to complete the interaction of events and data on and off the chain.
[0015] In the above scheme, the specific implementation steps of the data flow of obtaining the IPFS system include:
[0016] The contract controller automatically connects to the first smart contract and requests data;
[0017] The oracle subscribes to the data request event on the blockchain, and the off-chain oracle starts the node service;
[0018] The node service is connected to the IPFS system, and the IPFS system authenticates the node service to identify the request type and responds to the request;
[0019] The IPFS system passes the digital asset data to the oracle interface based on the node service through the first smart contract and the third smart contract and returns it to the first signing module.
[0020] On the other hand, the present invention provides a blockchain asset processing system based on an oracle, which specifically comprises:
[0021] IPFS system: digitize assets and convert them into deposits or certificates for storage;
[0022] The first storage module of the blockchain: generates a first smart contract; associates the first smart contract, the second smart contract and the third smart contract based on the oracle; obtains, generates and stores the basic information of the digital asset, and stores the summary and belonging information in the form of a file;
[0023] The second storage module of the blockchain: obtains the basic information of the digital asset from the first storage module to generate a token credential, triggers the first smart contract to obtain the token credential, and generates a second smart contract;
[0024] Signature storage module: obtain the electronic signature generated by the first signature module, and transmit the electronic signature to the second storage module through the third smart contract;
[0025] The first signature module: based on the oracle, obtains the basic information of the token credential and the asset file, transmits or updates the electronic signature, and triggers the external smart contract to obtain the source file of the digital asset in the IPFS system.
[0026] The above-mentioned blockchain asset processing system also includes a blockchain contract processing system based on an oracle. When an operation on a digital asset is performed, the asset processing system triggers a corresponding smart contract, including:
[0027] The first smart contract: acts as a contract controller to control, call or generate sub-contracts; obtains and returns the source files of digital assets in the IPFS system through the first smart contract;
[0028] Second smart contract: execute digital asset transactions, that is, execute the digital asset transfer process;
[0029] The third smart contract: binds to the oracle interface to obtain the electronic signature, and transmits the electronic signature required for the second smart contract to execute the transaction;
[0030] External smart contract: the data flow of obtaining digital asset information on the IPFS system; passing the digital asset source file to the first signature module.
[0031] In a third aspect, the present invention proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above methods and steps can be implemented.
[0032] In a fourth aspect, the present invention proposes a blockchain asset and contract processing device based on an oracle, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can implement any one of the above methods and steps when executing the computer program.
[0033] The present invention has at least the following beneficial effects:
[0034] (1) The present invention converts assets into deposits or documents and uploads them to the IPFS system for storage, and stores digital signatures and summaries on the blockchain. On the one hand, this reduces the storage burden of the blockchain, and on the other hand, the IPFS system is separated from the blockchain system to provide more secure and reliable storage performance;
[0035] (2) Furthermore, the first storage module of the blockchain of the present invention deploys the first smart contract as a contract controller, and the second storage module generates the second smart contract for executing the asset transaction process by controlling, calling or generating a sub-contract. The first signature module can obtain asset information and source files safely and legally through the oracle interface, perform comparison authentication or issue a transaction request, and is used to generate a digital signature of the asset on the blockchain through the oracle interface, thereby ensuring the legitimacy of the asset on the blockchain, ensuring the asset security of the second storage module when executing the transaction under the second smart contract, and realizing the digital circulation and management of assets. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The specific implementation processes that can be obviously used in the drawings can be taken as further specific embodiments of the present invention and fall within the protection scope of the present invention.
[0037] Figure 1 This is a structural diagram of the blockchain asset and contract processing flow based on the oracle of the present invention;
[0038] Figure 2 Obtain the off-chain IPFS system data flow diagram for the present invention;
[0039] Figure 3 This is an overall system diagram of blockchain assets and contract processing based on the oracle of the present invention. DETAILED DESCRIPTION
[0040] In order to clearly explain the present invention and make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the following is combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solution in the embodiments of the present invention, so that those skilled in the art can implement it according to the description. The following is a detailed description of the technology of the present invention in combination with the drawings and specific embodiments.
[0041] In one embodiment, the present invention proposes a blockchain asset and contract processing method based on an oracle. The present invention is based on Figure 1 The process structure diagram shown in the figure realizes the digital processing of assets. The specific implementation steps include:
[0042] Step 1: Convert the asset into a deposit certificate or document in the form of a file and upload it to the IPFS system (InterPlanetary File System, distributed file system) in the form of a digital asset (the digital form of the asset, i.e., the digital asset, is mainly converted into PDF in the form of an image or converted into TXT format through OCR technology (Optical Character Recognition, a type of image text recognition technology); the asset in the IPFS system is digitized and stored in the IPFS system in the form of a file, and the summary of the file and the belonging information are stored in the first storage module of the blockchain, and a first smart contract containing the summary is generated accordingly for obtaining the digital asset stored in the IPFS;
[0043] Step 2: The first storage module of the blockchain obtains, generates and stores the basic information of the digital assets, generates the first smart contract as a contract controller, controls or calls or generates sub-contracts including the second smart contract and the third smart contract; the third smart contract is bound to the oracle interface, responds to the needs of the first signature module to update the smart contract, and the first signature module triggers the external smart contract to obtain the data flow of digital asset information on the IPFS system. The oracle plays the role of expanding the function of the third smart contract, giving the third smart contract the ability to update the electronic signature of the digital asset, thereby satisfying the purpose of the second smart contract to smoothly execute the transaction. The oracle accesses the signature storage module on the blockchain of the third smart contract to undertake the first signature module. The data request and data reception of the first signature module will interact with the third smart contract connected to the oracle in a cross-contract manner, and the third smart contract interacting with the oracle is responsible for communicating with the second smart contract. At the same time, the first smart contract communicates with the node service of the IPFS system, that is, triggering data request events, and receiving data uploaded by off-chain nodes, so as to complete the interaction of events and data on and off the chain.
[0044] The process of obtaining data on the IPFS system is as follows: Figure 2 As shown, the specific implementation steps include:
[0045] S21: The contract controller automatically connects to the first smart contract and requests data;
[0046] S22: The oracle subscribes to the data request event on the blockchain, and the off-chain oracle starts the node service;
[0047] S23: The node service is connected to the IPFS system, and the IPFS system authenticates the node service to identify the request type and responds to the request;
[0048] S24: The IPFS system passes the digital asset data to the oracle interface based on the node service through the first smart contract and the third smart contract and returns it to the first signing module.
[0049] Step 3: The second storage module of the blockchain obtains the basic information of the digital asset from the first storage module to generate a token credential, and triggers the first smart contract to obtain the token credential and generate a second smart contract;
[0050] Step 4: The first signature module obtains the basic information of the token credential and the file for authentication and generates an electronic signature, stores the electronic signature in the signature storage module through the oracle, and calls the first smart contract to generate a third smart contract; wherein the first signature module is an authoritative financial certification center outside the blockchain or a certified trading market, etc., to obtain transaction information such as the sale of assets, or execute corresponding transactions through the second smart contract.
[0051] Step 5: The first storage module of the blockchain binds the first smart contract, the second smart contract and the third smart contract to the oracle interface to form an association relationship, and uploads the electronic signature update information to the third smart contract through the first signature module of the oracle interface. The first smart contract controls, calls or generates one or more of the second smart contract and the third smart contract;
[0052] Step 6: When the second smart contract executes the transaction for verification, it obtains the electronic signature through the third smart contract. When the electronic signature expires, the signature storage module triggers the third smart contract to call the oracle interface to update the electronic signature. The first signature module obtains and returns the source file of the digital asset in the IPFS system through the external smart contract to verify and update the electronic signature.
[0053] The embodiment of the present invention also provides a blockchain asset and contract processing system based on an oracle, such as Figure 3 As shown, it includes a blockchain asset processing system based on an oracle and a contract processing system therein, as follows:
[0054] (A) IPFS system: digitize assets and convert them into deposits or certificates for storage;
[0055] (B) The first storage module of the blockchain: generates a first smart contract; associates the first smart contract, the second smart contract and the third smart contract; obtains, generates and stores basic information of the digital asset, and stores the summary and belonging information in the form of a file; wherein:
[0056] The first smart contract: acts as a contract controller to control, call or generate sub-contracts; obtains and returns the source files of digital assets in the IPFS system through the first smart contract;
[0057] (C) The second storage module of the blockchain: obtains the basic information of the digital asset from the first storage module to generate a token credential, triggers the first smart contract to obtain the token credential, and generates a second smart contract; including:
[0058] Second smart contract: execute digital asset transactions, that is, execute the digital asset transfer process;
[0059] (D) Signature storage module: obtains the electronic signature generated by the first signature module, and transmits the electronic signature to the second storage module by triggering the third smart contract; wherein:
[0060] The third smart contract: binds to the oracle interface to obtain the electronic signature, and transmits the electronic signature required for the second smart contract to execute the transaction;
[0061] (E) The first signature module: based on the oracle, obtains the basic information of the token certificate and the asset file, transmits or updates the electronic signature, and triggers the external smart contract to obtain the source file of the digital asset in the IPFS system; wherein:
[0062] External smart contract: the data flow of obtaining digital asset information on the IPFS system; passing the digital asset source file to the first signature module.
[0063] The number of modules and processing scale described here are used to simplify the description of the present invention. The application, modification and variation of the blockchain asset and contract processing system based on the oracle of the present invention are obvious to those skilled in the art.
[0064] Based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any one of the method steps described above is implemented. As for the storage medium 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.
[0065] Based on the same inventive concept, a blockchain asset and contract processing device based on an oracle includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the method steps described above when executing the computer program.
[0066] As for the device 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.
[0067] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0068] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0069] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0070] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0071] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0072] The above description of the embodiments is to facilitate the understanding and application of the present invention by those skilled in the art. It is obvious that those skilled in the art can easily make various modifications to the above embodiments and apply the general principles described herein to other embodiments without creative work. Therefore, the present invention is not limited to the above embodiments, and improvements and modifications made to the present invention by those skilled in the art based on the disclosure of the present invention should be within the scope of protection of the present invention.
Claims
1. A blockchain asset and contract processing method based on an oracle, characterized in that: include: Convert assets into deposits or certificates and upload them to the IPFS system in the form of digital assets; The first storage module of the blockchain acquires, generates and stores the basic information of the digital asset, and generates a first smart contract as a contract controller; The second storage module of the blockchain obtains the basic information of the digital asset from the first storage module of the blockchain to generate a token credential, and triggers the first smart contract to obtain the token credential and generate a second smart contract; The first signature module obtains the token credential and the basic information of the digital asset for authentication and generates an electronic signature, stores the electronic signature on the chain in the signature storage module through the oracle, and calls the first smart contract to generate a third smart contract; The first storage module of the blockchain binds the first smart contract, the second smart contract and the third smart contract to the oracle interface to form an association relationship, and uploads the electronic signature update information to the third smart contract through the first signature module of the oracle interface; When the second smart contract performs transaction verification, it triggers the third smart contract to obtain the electronic signature. When the electronic signature expires, the third smart contract is triggered by the signature storage module to call the oracle interface to obtain the updated electronic signature. The first signature module obtains and returns the source file of the digital asset in the IPFS system through the external smart contract to verify and update the electronic signature. The third smart contract is bound to the oracle interface, and the smart contract is updated in response to the need of the first signature module to update the electronic signature. The first signature module obtains the data flow of digital asset information on the IPFS system before triggering the external smart contract; Among them, the specific implementation steps of the data flow on the IPFS system include: the contract controller automatically connects to the first smart contract and requests data; the oracle subscribes to the data request event on the blockchain, and the off-chain oracle starts the node service; the node service is connected to the IPFS system, and the IPFS system authenticates the node service to identify the request type and responds to the request; the IPFS system passes the digital asset data to the oracle interface based on the node service through the first smart contract and the third smart contract and returns it to the first signature module; The oracle accesses the signature storage module on the third smart contract blockchain to take over the first signature module. The data request and data reception of the first signature module will interact with the third smart contract connected to the oracle in a cross-contract manner. The third smart contract interacting with the oracle is responsible for communicating with the second smart contract. At the same time, the first smart contract communicates with the node service of the IPFS system, that is, triggering data request events and receiving data uploaded by off-chain nodes, completing the interaction of events and data on and off the chain.
2. The method for processing blockchain assets and contracts based on an oracle according to claim 1, characterized in that: After the assets in the IPFS system are digitized, they are stored in the IPFS system in the form of files. At the same time, the summary of the file and the corresponding information are stored in the first storage module of the blockchain, and a first smart contract containing the summary is generated accordingly for obtaining the digital assets stored in the IPFS.
3. The method for processing blockchain assets and contracts based on an oracle according to claim 1, characterized in that: The first signature module is one or more of an authoritative financial certification center or a certified trading market outside the blockchain.
4. A blockchain asset processing system based on an oracle, characterized in that: The specific composition includes: IPFS system: digitize assets and convert them into deposits or certificates for storage; The first storage module of the blockchain: generates a first smart contract; associates the first smart contract, the second smart contract and the third smart contract based on the oracle; obtains, generates and stores the basic information of the digital asset, and stores the summary and belonging information in the form of a file; The second storage module of the blockchain: obtains the basic information of the digital asset from the first storage module to generate a token credential, triggers the first smart contract to obtain the token credential, and generates a second smart contract; Signature storage module: obtains the electronic signature generated by the first signature module, and transmits the electronic signature to the second storage module through the third smart contract; The first signature module: based on the oracle, obtains the basic information of the token credential and the digital asset, transmits or updates the electronic signature, and triggers the external smart contract to obtain the source file of the digital asset in the IPFS system; When performing operations on digital assets, the asset processing system triggers the corresponding smart contract, including: The first smart contract: acts as a contract controller to control, call or generate sub-contracts; obtains and returns the source files of digital assets in the IPFS system through the first smart contract; Second smart contract: execute digital asset transactions; The third smart contract: binds to the oracle interface to obtain the electronic signature, and transmits the electronic signature required for the second smart contract to execute the transaction; External smart contract: The data flow of obtaining digital asset information on the IPFS system, wherein the specific implementation steps include: the contract controller automatically connects to the first smart contract and requests data; the oracle subscribes to the data request event on the blockchain, and the off-chain oracle starts the node service; the node service connects to the IPFS system, and the IPFS system authenticates the node service to identify the request type and responds to the request; the IPFS system passes the digital asset data to the oracle interface based on the node service through the first smart contract and based on the third smart contract, and returns to the first signature module; the digital asset source file is passed to the first signature module; The third smart contract is bound to the oracle interface, and the smart contract is updated in response to the need of the first signature module to update the electronic signature. The first signature module obtains the data flow of digital asset information on the IPFS system before triggering the external smart contract; Among them, the oracle accesses the signature storage module on the third smart contract blockchain to take over the first signature module. The data request and data reception of the first signature module will interact with the third smart contract connected to the oracle in a cross-contract manner, and the third smart contract interacting with the oracle is responsible for communicating with the second smart contract. At the same time, the first smart contract communicates with the node service of the IPFS system, that is, triggering data request events and receiving data uploaded by off-chain nodes, so as to complete the interaction of events and data on and off the chain.
5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
6. A blockchain asset and contract processing device based on an oracle, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Digital certificate issuing system and method based on block chain platform
CN108768657A
Original work transaction method and device based on block chain and electronic equipment
CN111476667A
Blockchain data registration method and device
CN112363991A
