Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a cross-chain method and an intermediate system for combining a chain up-chain and a chain down-chain with a file block chain.
The invention is realized in such a way that a cross-chain method facing to 'the chain up-chain and the down-chain combined file block chain' comprises the following steps:
step one, new chain registration;
step two, initiating a cross-link request, and entering information cross-link on a link;
step three, the notary group verifies and negotiates, carries out information cross-link on the chain, prepares the file cross-link under the chain;
step four, the files under the chain cross the chain;
and fifthly, feeding back records through the link.
Further, in the first step, the new chain registration includes:
the new chain needs to complete a registration process before crossing the chain, so that a notary intermediate system knows the existence and necessary information of the chain; when the new chain is registered for access, submitting registration information to a notary group; and after the notary group passes the examination, corresponding identity evidence and public and private key information are generated for the new chain and recorded.
The new link registration access flow includes:
(1) The method comprises the steps that a terminal agent is installed On a node to participate in a cross-chain, and in the initial stage of a registration access flow, a new chain sends an access request to a notary group, wherein the registration access request comprises under-chain storage mechanism information store_information, new-chain practise evidence employee_authentication, an On-chain agent node information list On-chain agent node list for registration and an Off-chain agent node information list for registration.
(2) The notary group receives the new chain request and verifies the request content; if the verification is passed, then:
(1) the notary group selects the on-chain proxy node and the off-chain proxy node which are registered at this time according to the access request content, and distributes identification id and communication public and private key peer-to-peer identity information for the new chain and the nodes;
(2) the notary group refers to Off-chain nodesList content information to form an encryption algorithm and a transmission protocol negotiation set;
(3) the notary group puts the generated identity information and negotiation set content into a request response packet and returns the request response packet to the new chain;
(4) the registrant selects the protocol supported by the registrant from the negotiation set, returns a confirmation packet to complete registration, and the negotiation of the registration content by the two parties is confirmed.
If the verification is not passed, returning a reason that the verification is not passed by the notary group; after the registrant modifies the content of the registration access request again, the request is submitted again.
The under-link storage mechanism information store_information comprises the technology of file data storage, namely IPFS distributed storage or other database storage, wherein the technology is similar to a public network, files are all in the same addressing space, and the files can be handed over only by transmitting the file HASH; the latter databases are similar to private networks and do not interwork, requiring actual under-chain file cross-chain.
The on-chain agent node refers to a node positioned in a blockchain network, key information stored under a file chain is stored in a block, the key information comprises addressing HASH and an index number, and the key information interacts with other cross-chain components through a terminal agent program.
The under-chain agent node refers to one or more agent nodes which are needed to be provided in a registration stage for transferring the following under-chain file data no matter the file blockchain system relies on IPFS distributed storage or other database storage; the link agent node can interact with the link storage mechanism by installing the terminal agent program, finish file data uploading and downloading operations, and support a certain number of file encryption algorithms and transmission protocols.
The new chain submits registered On-chain proxy node information list On-chain nodesList contains the IP address set of the On-chain proxy nodes.
The new chain submits registered proxy node information list Off-chain nodesList content format is as follows:
Off-chain nodesList{IP,Storage,Bandwidth,Encryption,Transport};
the meaning of each field of the list is as follows:
IP means proxy node IP address;
storage represents the proxy node Storage size;
bandwidth represents proxy node Bandwidth;
encryptions represent a set of Encryption algorithms supported by the proxy node;
Transport represents the set of Transport protocols supported by the proxy node.
Wherein, the encryption algorithm, the transmission protocol consults the set: when the notary group is initialized, a series of usable encryption algorithms and transmission protocols are selected according to encryption and transmission requirements of a file cross-chain process, and the notary group is stored in a candidate list form; after the new link-in application passes the audit, the notary group selects a part of encryption algorithms and transmission protocols to form a negotiation set according to the candidate list and referring to Encryption, transport fields in the Off-chain nodesList, and the negotiation set is used for negotiating with the new link to determine the encryption algorithms and transmission protocols used by the subsequent file to cross the link.
The notary group generates corresponding identity evidence for the new chain, and the notary group signs the registration information after auditing the registration information submitted by the new chain to form a digital certificate of the new chain; the digital certificate is used in a cross-chain process, and the chain performs identification.
Further, in the second step, the initiating a cross-link request, entering the on-link information cross-link includes:
when a new file cross-link is initiated, the proxy node on the chain of the sender submits the information on the chain of the file in the block to a notary group, and adds the necessary information including the identification of the receiver, the identification and the under-chain file cross-link expectation as the main content of the file cross-link application.
The cross-chain application consists of information on a file chain, a receiver blockchain identifier, sender blockchain identification and sender chain file cross-chain expectations, and the receiver information is inquired in a notary intermediate system.
The File chain information file_info comprises a File name, a File type, a File size, a File integrity HASH and a File index number; the file information is provided by the registered on-chain proxy node in the sender blockchain, read from its own block.
The sender under-chain file cross-chain expected prospect_transmission refers to the opinion and the Expectation of the sender on the under-chain file cross-chain of the present cross-chain task, and the format content is as follows:
the Expected information field expected_nodes indicates that the own party is Expected to participate in a cross-chain agent node candidate list;
the Expected information field expected_encryption represents the encryption algorithm Expected to be used;
the Expected information field expected_transport, indicates the transport protocol that is Expected to be used;
the Expected information field expected_maxperiod indicates the longest deadline for the Expected under-chain file to traverse the chain phase.
Further, in the third step, the notary group authentication negotiation is performed, and the on-chain information cross-chain is prepared, and the under-chain file cross-chain is prepared, including:
After verifying the identity of a sender, the notary group judges the file cross-link type according to the under-link storage mechanism of the current cross-link parties; combining the number and the volume of the files, negotiating with a receiver by using the under-chain file cross-chain expectations of the sender, and formulating an under-chain file cross-chain strategy; in the negotiation process, the information on the file chain is forwarded to the receiver.
The file cross-link type is divided into the following 4 types according to different storage mechanisms under the links of the cross-link and the two sides:
the file cross-chain type 1, the sender under-chain storage mechanism is IPFS, and the receiver under-chain storage mechanism is IPFS;
the file cross-chain type 2, the sender under-chain storage mechanism is IPFS, and the receiver under-chain storage mechanism is other databases;
the file cross-chain type 3, the sender under-chain storage mechanism is other databases, and the receiver under-chain storage mechanism is IPFS;
the file cross-chain type 4, the sender under-chain storage mechanism is other databases, and the receiver under-chain storage mechanism is other databases.
The under-link file cross-link policy OCFTS includes the following format contents:
OCFTS_1:{Across_type,Sender_Agent,Receiver_Agent,Encryption_selection,Transfer_selection,Encryption_key,Maximum_period};
wherein across_type = cross-chain type number; senders_agent = Sender proxy node selection list; receiver_agent=receiver proxy node selection list; encryption_selection=the current file data Encryption algorithm selection; transfer_selection=the current file Transfer protocol selection; encryption_key=the current cross-chain task Encryption key; maximum_period = Maximum period of the transmission phase under the chain.
The Sender and receiver Agent node selection list senders_ Agent, receiver _agent refers to recording node identification, IP address and public key information of Agent nodes participating in the file cross-link; according to the number of files of the current cross-link task, the notary group can select a plurality of registered proxy nodes on the two cross-link sides to form a plurality of transmission links for parallel transmission of multiple files.
The file data encryption algorithm selection and file transmission protocol refers to proxy node registration information recorded by notary group reference, and the encryption algorithm and transmission protocol supported by both cross-chain parties are selected on the premise of considering safety and high efficiency.
The encryption key of the cross-link task refers to an encryption key generated by a notary group according to a selected encryption algorithm, and is only used for encrypting source file data in the cross-link task of the current file, and is immediately expired for being invalidated after the cross-link is completed.
Wherein, the negotiation between the notary group and the receiver comprises the following steps:
(1) The notary group judges the cross-chain type according to a storage mechanism under the chain of a sender and a receiver; if the type 1 is judged, the fact that both cross-link parties use IPFS to store file data is indicated, and only the addressing HASH of the file in the IPFS is required to be transmitted; the notary group extracts the corresponding field value from the File information File_Info and transmits the corresponding field value to the proxy node on the receiver chain; the receiving party can acquire file data through the addressing HASH, and then enters a cross-link fruit feedback stage; if the type is judged to be other cross-chain type, the subsequent process is carried out.
(2) The notary group integrates the contents of the on-chain File information File_Info and the off-chain File cross-chain expected prospect_transmission of the sender to form a negotiation inquiry message, and the negotiation inquiry message is sent to the on-chain proxy node of the receiver.
(3) The proxy node on the receiver chain comprehensively considers the conditions of own block chain, bandwidth of the proxy node and Storage capacity Storage, and judges whether source file cross-chain receiving conditions are met.
(4) If the source file cross-chain receiving condition is judged to be currently provided, a message with the same structure as the expected prospect_transmission of the source file under the source chain is generated and submitted to a notary group.
(5) If the source file cross-chain receiving condition is judged not to be present, the failure reason explanation is submitted.
(6) After receiving the expected Transmission of the under-chain file of the receiver, the notary group comprehensively sends and receives the expected contents of the two parties, formulates an under-chain file cross-chain strategy OCFTS, distributes the under-chain file cross-chain strategy OCFTS to the two parties, and finishes negotiation; if the failure reason is received, the notary records and informs the sender of the failure of the cross-link negotiation.
Further, in the fourth step, the under-link file spans links, and includes:
after both the sender and the receiver acquire the under-chain file cross-chain strategy, entering an under-chain file cross-chain stage; according to the under-chain file cross-chain strategy, the under-chain proxy nodes of the two cross-chain parties perform file cross-chain; after the receiving party finishes receiving the file data, the receiving party performs integrity check, and the under-chain file cross-chain stage is finished.
The method for performing file cross-linking by the chain agent node under the chain of the cross-linking parties comprises the following steps:
(1) Across_type field of OCFTS according to the under-chain file cross-chain strategy; if the source file is of the cross-chain type 2, the sender proxy node downloads source file data from the IPFS and verifies the integrity of the source file; if the data is of the cross-chain type 3 and 4, reading file data from other types of databases;
(2) The sender proxy node encrypts source file data by using an Encryption algorithm encryption_selection specified in the under-chain file cross-chain policy;
(3) The sender proxy node establishes an under-chain file cross-chain link according to communication information such as the receiver proxy node IP, the public key and the like appointed in the under-chain file cross-chain strategy;
(4) The method comprises the steps that under-link agent nodes of both cross-link parties use a transmission protocol transfer_selection specified in an under-link file cross-link strategy to carry out file cross-link;
(5) After the under-chain file is crossed, the receiving party proxy node verifies the integrity and correctness of the data; if the source file is of the cross-chain type 3, the proxy node of the receiving party uploads the source file data to the storage in the storage mechanism under the chain for storing and the information of the file is uplink; if the data is of the cross-chain type 4, storing the file data into other types of databases; the process belongs to the internal work of the file block chain system, and the cross-chain stage of the file under the chain is finished.
Further, in step five, the cross-link fruit feedback record includes:
after the receiving party correctly receives the file, entering a cross-link fruit feedback stage; the receiving party provides the feedback proof of the cross-chain, and the notary group records, and the transmitting party carries out the subsequent data processing.
The receiving party provides a feedback proof of the cross-chain, namely, after the receiving party correctly receives the source file data, the receiving party sends a proof to the notary group and the sending party, and the proof indicates that the receiving party has correctly received the file.
The sender performs subsequent data processing, namely that the file cross-chain is different from the currency cross-chain, and after the receiver finishes receiving the file data, the sender selects to delete the file data stored in the storage mechanism under the own chain, thereby achieving the effect of transferring the file; therefore, the method is divided into copy file cross-links and transfer file cross-links according to whether the sender deletes own file data after the cross-links are completed.
The copy type file cross-chain means that after the receiver correctly receives the source file data, the sender does not delete the source file data stored by the receiver, namely, after the file cross-chain is completed, the source file data exist in the under-chain storage mechanisms of the sender and the receiver at the same time.
The transferring type cross-chain refers to that after a receiver correctly receives source file data, a sender deletes the source file data in an under-chain storage mechanism of the sender due to various factors, namely, after the file cross-chain is completed, the source file data only exists in the under-chain storage mechanism of the receiver.
The cross-link fruit feedback stage comprises:
(1) After the receiving party correctly receives the file data, forming a cross-chain feedback certificate according to the receiving, storing and uplink conditions of the file data, and submitting the cross-chain feedback certificate to a notary group;
(2) After receiving the feedback evidence, the notary group archives the current cross-link record and forwards the cross-link feedback evidence to a sender;
(3) After receiving the feedback proof of the cross-link, the sender carries out subsequent file processing according to the copy cross-link and the transfer cross-link, namely if the sub-file cross-link is the copy cross-link, the sender does not delete the source file data; if the source file is a transfer type cross-chain, the sender deletes the source file data.
The invention further aims to provide a cross-chain intermediate system facing to the cross-chain method of the 'under-chain combined file blockchain', which comprises a notary group and a terminal agent, and a communication module, a key management module, an identity verification module, a registration management module, a CA certificate generation module, a cross-chain recording module, a data verification module, an encryption and decryption module, an under-chain storage module, a file transmission module, an under-chain file cross-chain module and a system conventional general module which are used by the notary group and the terminal agent.
The notary group is used for functioning as a cross-chain middleware, verifying new chain qualification in a registration stage and generating an identification; the file cross-link process is responsible for cross-link application verification, on-link information forwarding, under-link transmission strategy negotiation and cross-link fruit feedback;
the terminal agent is used for joining the blockchain system of the cross-chain system and providing a terminal agent program of the node installation cross-chain system so as to execute the cross-chain related function;
they contain the following specific functional modules:
the communication module is used for transmitting information between the two parties of the cross-link and the notary group and managing communication addresses and identification information of all the parties;
the key management module is used for managing public and private keys of all parties crossing a chain and comprises key acquisition and expiration revocation functions;
the identity verification module is used for verifying the identities of all the cross-chain parties and managing identity information;
the registration management module is used for storing and managing new chain registration content by the notary group;
the CA certificate generation module is used for generating certificate information for the newly registered file blockchain and the proxy node to be registered;
the cross-link recording module is used for recording basic information of a file cross-link process;
the data verification module is used for verifying the integrity and correctness of the file data in the under-chain file crossing process;
The encryption and decryption module is used for encrypting and decrypting file data through corresponding transmission strategies before and after the under-chain file spans the chain;
the under-chain storage module is used for interacting the node with the under-chain storage mechanism;
and the file transmission module is used for managing and calling the selected file transmission protocol.
It is a further object of the present invention to provide a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of:
registering a new chain; initiating a cross-link request, and entering information on a link to cross links; notary group authentication negotiation, executing on-chain information cross-chain, and preparing off-chain file cross-chain; the under-chain files cross the chain; the record is fed back across the link.
Another object of the present invention is to provide a computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
registering a new chain; initiating a cross-link request, and entering information on a link to cross links; notary group authentication negotiation, executing on-chain information cross-chain, and preparing off-chain file cross-chain; the under-chain files cross the chain; the record is fed back across the link.
The invention further aims at providing an information data processing terminal which is used for realizing the inter-chain intermediate system facing to the 'chain up-chain and down-chain combined file block chain'.
By combining all the technical schemes, the invention has the advantages and positive effects that: the invention designs a cross-chain scheme and an intermediate system suitable for the characteristics of a 'chain up-chain and down-chain combined' file blockchain system on the basis of researching the advantages and disadvantages of the existing file management field and blockchain technology combined scheme.
In the current file blockchain system, an operation mode of combining a blockchain and an under-chain storage mechanism is generally adopted, key information of a file is stored in an uplink mode, a file body is stored in an under-chain mode, and the under-chain storage mechanisms of different systems are different. The file blockchain must be cross-linked with the information on the chain and the data under the chain. The main stream cross-link mechanism is mainly aimed at the field of virtual currency transaction, and only cross-links data on the links, so that the cross-link requirement of file block chains cannot be met. Aiming at the problems, the cross-chain method and the intermediate system for the 'chain up-chain and down-chain combined file block chain' provided by the invention finish the following design:
(1) According to different file chain-crossing types, a notary mechanism is combined, a complete chain-crossing middleware structure and function are designed, and a complete chain-crossing flow is designed: the on-chain information is fed back across chains, the off-chain files are fed back across chains, and the on-chain information is fed back across the chains.
(2) The technology of cryptography identity verification, encryption algorithm, network file transmission protocol and the like is combined to design a targeted under-chain file cross-chain mechanism, so that the safety and the integrity of the cross-chain file are ensured.
(3) Aiming at the special construction and operation mode of the system of combining the chain up-chain and the chain down-chain and the file blockchain, the file cross-chain type is divided: replication-type cross-chains, transfer-type cross-chains.
Detailed Description
The present invention will be described in further detail with reference to the following examples in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Aiming at the problems in the prior art, the invention provides a cross-chain method and an intermediate system for 'chain up-chain and down-chain combined file block chain', and the invention is described in detail below with reference to the accompanying drawings.
As shown in fig. 1 and fig. 2, the method for crossing links facing to "link up and link down combined file blockchains" provided by the embodiment of the present invention includes the following steps:
s101, new chain registration;
s102, initiating a cross-link request, and entering information cross-link on a link;
s103, the notary group verifies and negotiates, executes information cross-link on the chain, and prepares a file cross-link under the chain;
S104, crossing the chain of the under-chain file;
s105, the record is fed back by the cross-link fruits.
The schematic diagram of the cross-chain method for combining the chain upper chain and the chain lower chain with the file block chain provided by the embodiment of the invention is shown in fig. 3.
The technical scheme of the invention is further described below with reference to specific embodiments.
The implementation method of the cross-chain scheme and the intermediate system for the 'chain up-chain down-file block chain' provided by the embodiment of the invention is as follows:
s1-1: the following processes are all run under the system architecture shown in fig. 4, and the notary group and the terminal agent have the functional modules shown in fig. 5.
In the registration phase: the new chain issues an access request to the notary group containing the information as shown in table 1.
Table 1 access request information
S1-2: the notary group receives the new chain request and verifies passing. Then the new chain and the nodes are distributed with identification id and communication public and private key pairs; signing the certificate.doc content through a CA certificate generation module, generating a new chain digital certificate, selecting an encryption algorithm, and transmitting protocol negotiation set content. The content is stored through the registration management module and filled into the response packet.
S1-3: the registrant selects the protocol supported by the registrant from the negotiation set, returns a confirmation packet, installs a terminal agent program, adds information such as identification id, public and private key pair, digital certificate and the like distributed by a notary group into a communication module and a key management module of the terminal agent program, starts an encryption algorithm selected by negotiation in an encryption and decryption module, and completes registration by the new chain.
File cross-linking between registration chains follows the following procedure, with reference to fig. 3.
S2-1: and initiating a file cross-link once, and entering an information cross-link stage on the link.
The agent node on the chain of the sender submits the information on the chain of the file in the block to a notary group, and adds necessary information such as a receiver identifier, an identification, an under-chain file cross-chain desire and the like through a key management module and an identity verification module to serve as main content of the file cross-chain application. The cross-chain application content is shown in table 2.
TABLE 2 Cross-chain application content
Desired information field
|
Field data
|
Expected_nodes
|
Proxy node candidate list
|
Expected_encryption
|
Encryption algorithm intended for use
|
Expected_transport
|
Transport protocol for intended use
|
Expected_maxperiod
|
Anticipating the longest deadline of the under-chain file cross-chain phase |
S3-1: after verifying the sender identification, the notary group judges that the current file cross-chain is of type 2. And then, the notary group negotiates with the receiver according to the quantity and the volume of the current cross-link files and the cross-link expectations of the files under the chain of the sender, formulates a cross-link strategy of the files under the chain, and forwards the information on the file chain in the cross-link application to the receiver in the negotiation process.
S3-2: the notary group integrates the contents of File information File_Info on the chain and the expected Transmission of the File under the chain of the sender, forms a negotiation inquiry message in the communication module and sends the negotiation inquiry message to the on-chain proxy node of the receiver.
S3-3: the agent node on the receiver chain comprehensively considers the conditions of own block chain, bandwidth of the agent node, storage capacity Storage and the like, and judges whether source file cross-chain receiving conditions are provided.
S3-4: if the source file cross-chain receiving condition is judged to be currently provided, a message with the same structure as the expected prospect_transmission of the source file under the source chain is generated and submitted to a notary group. If the source file cross-chain receiving condition is judged not to be present, the failure reason explanation is submitted.
S3-5: after receiving the under-chain file cross-chain expected Transmission of the receiver, the notary group comprehensively sends and receives the expected contents of the two parties, formulates an under-chain file cross-chain strategy OCFTS, distributes the under-chain file cross-chain strategy OCFTS to the two parties, and finishes negotiation. If the failure reason is received, the notary records and informs the sender of the failure of the cross-link negotiation.
S4-1: the agent nodes of the two straddling sides carry out the straddling of the under-chain files: the sender proxy node downloads source file data from the IPFS and verifies source file integrity through a data verification module, specified in the under-chain file cross-chain policy OCFTS.
S4-2: the sender proxy node encrypts the source file data in the Encryption and decryption module using an Encryption algorithm encryption_selection specified in the under-chain file cross-chain policy.
S4-3: and the sender proxy node establishes a link through the under-link file cross-link module according to communication information such as the receiver proxy node IP, the public key and the like appointed in the under-link file cross-link strategy.
S4-4: and the proxy nodes of the two straddling sides use the Transfer protocol transfer_selection specified in the under-chain file straddling policy to carry out under-chain file straddling.
S4-5: after the under-chain file is finished, the receiving agent node verifies the integrity and the correctness of the data in the data verification module. And uploading the source file data to a local database for storage, and uploading file information, wherein the under-chain file cross-chain stage is finished.
S5-1: after the receiving party receives the file correctly, the receiving party enters a cross-link fruit feedback stage. The receiver forms a cross-chain feedback certificate according to the receiving, storing and uplink conditions of the self file data and submits the cross-chain feedback certificate to a notary group.
S5-2: and after receiving the feedback evidence, the notary group archives the current cross-chain record through a cross-chain record module.
S5-3: the cross-chain feedback proof is forwarded to the sender.
S5-4: after receiving the feedback proof of the cross-link, the sender processes the subsequent file according to the copy cross-link and the transfer cross-link.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When used in whole or in part, is implemented in the form of a computer program product comprising one or more computer instructions. When loaded or executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. 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 one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL), or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
The foregoing is merely illustrative of specific embodiments of the present invention, and the scope of the invention is not limited thereto, but any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention will be apparent to those skilled in the art within the scope of the present invention.