Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a data transaction method and a data transaction system based on an intelligent contract.
The invention provides a data transaction method based on intelligent contracts, which comprises the following steps:
step S1: creating a user Admin in a transaction System, and uploading data of the user to a Platform of a third party through the transaction System;
step S2: the transaction System respectively carries out data duplicate checking and data verification on the uploaded user data, after duplicate checking, integrals are issued to the user uploading the data according to an integral contract, the data needing to be paid for checking are encrypted, and chain link certificate storing is carried out after the encrypted data pass authentication;
step S3: the transaction System provides data retrieval service for the user, and for the paid data requested by the user, the transaction System deducts the corresponding credit of the user and transmits the corresponding paid data to the user.
Preferably, the transaction System in the step S1 implements a point transaction based on data uploading of a smart contract, and the Platform is used for storing data uploaded by a user.
Preferably, the step of creating the user information in the transaction System is as follows:
step S1.1: creating a user organization Org and creating an administrator user Admin for the user organization Org;
step S1.2: and completing the activation of the user Admin in Platform, creating a public key and a private key for an Org user, and storing all data of the user Admin in a database.
Preferably, the step of uploading data by the user to obtain the points is as follows:
step S2.1: a user Admin logs in a third-party Platform to select data of a local workstation to upload, and the third-party Platform receives user data;
step S2.2: the Platform of the third party calls a transaction System service, acquires a private key of a user mechanism where the user Admin is located, calls a point contract to calculate the point of current data, and stores the uploaded data and the point to a block chain;
step S2.3: platform calls a transaction System service, and a user organization Org where the user Admin is located acquires the credit of the uploaded data.
Preferably, the step of deducting points from the user purchase data is as follows:
step S3.1: the user who buys the data logs in the System to search for the data uploaded by other users;
step S3.2: the transaction System calls a credit contract to calculate the credit to be consumed by the data, if the remaining credit of the Org of the user organization where the data purchasing user is located is larger than the credit to be deducted currently, the remaining credit of the data purchasing user is stored, the data purchasing user obtains corresponding data, the data uploading user obtains the credit paid by the data purchasing user, and the latest credit of the data uploading user is stored;
step S3.3: respectively modifying data purchasing data users and uploading latest points and respective consumption records of the data users on a block chain through intelligent contracts;
step S3.4: the transaction System receives the credit contract, returns the consumption credit and the account balance of the data purchasing user, returns the consumption credit and the account balance of the data uploading user, saves the record in the database, marks that the data purchasing user purchases the data, and is used for checking the voucher whether the block chain is purchased or not again in the next data, and the purchased data does not need to be purchased again.
Preferably, the modifying of the integration contract comprises: and initiating the proposal modification of the integration contract by an administrator System-Admin of the transaction System, setting the proposal state as to-be-voted, and informing the user of voting, wherein the proposal takes effect when the voting proportion exceeds the preset proportion, and otherwise, the proposal does not take effect.
The invention provides a data transaction system based on intelligent contracts, which comprises the following systems:
module M1: creating a user Admin in a transaction System, and uploading data of the user to a Platform of a third party through the transaction System;
module M2: the transaction System respectively carries out data duplicate checking and data verification on the uploaded user data, after duplicate checking, integrals are issued to the user uploading the data according to an integral contract, the data needing to be paid for checking are encrypted, and chain link certificate storing is carried out after the encrypted data pass authentication;
module M3: the transaction System provides data retrieval service for the user, and for the paid data requested by the user, the transaction System deducts the corresponding credit of the user and transmits the corresponding paid data to the user.
Preferably, the transaction System in the module M1 implements point transaction based on data upload of a smart contract, and the Platform is used for storing data uploaded by a user.
Preferably, the step of creating the user information in the transaction System is as follows:
module M1.1: creating a user organization Org and creating an administrator user Admin for the user organization Org;
module M1.2: and completing the activation of the user Admin in Platform, creating a public key and a private key for an Org user, and storing all data of the user Admin in a database.
Preferably, the step of uploading data and acquiring points by the user Admin is as follows:
module M2.1: a user Admin logs in a third-party Platform to select data of a local workstation to upload, and the third-party Platform receives user data;
module M2.2: the Platform of the third party calls a transaction System service, acquires a private key of a user mechanism where the user Admin is located, calls a point contract to calculate the point of current data, and stores the uploaded data and the point to a block chain;
module M2.3: platform calls a transaction System service, and a user organization Org where the user Admin is located acquires the credit of the uploaded data.
Compared with the prior art, the invention has the following beneficial effects:
1. by adopting the intelligent contract, the encryption and decryption technology and the irreversible algorithm technology, the problem that the transaction records of uploading important data, uploading issued points and purchasing the points can be stored in the block chain network and cannot be tampered and forged is solved on the premise of protecting the privacy of the user.
2. The points can be traded and cleared in real time, so that the trading process is greatly simplified, the safe sharing of effective data and the absolute fairness and safety of trading are ensured.
3. The method is suitable for various commercial or non-commercial data, takes an organization as a unit, is flexible in logic modification of the intelligent contract, and is fair and transparent in disclosure.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
Example 1
The invention introduces a data transaction method based on an intelligent contract, which comprises the following steps:
step S1: the method comprises the steps of creating a User Admin in a trading System, uploading valuable data (such as scientific research data, stored in a server of an organization, belonging to research results of researchers) of the User to a third-party Platform through the trading System which realizes integration through data uploading based on an intelligent contract, wherein the valuable data of the User are stored in the third-party Platform main User, and the Platform must be a subject trusted by users.
The steps of the transaction System creating the user information are as follows:
step S1.1: creating a user organization Org and creating an administrator user Admin for the user organization Org;
step S1.2: and completing the activation of the user Admin in Platform, creating a public key and a private key for an Org user, and storing all data of the user Admin in a database.
The public key is used for generating an address and sending the address to the contract, and when the user obtains the work point or deducts the work point, the contract can carry out transaction on a chain according to the address generated by the public key. The private key is used for sending the private key to a contract to generate a signature when a user purchases data or uploads the data to obtain a score.
Step S2: and the transaction System respectively checks the uploaded user data for duplication and data verification. The data verification is to check whether the data has value or not and whether the data content has violation behavior or not, after the data is checked, credits are issued to a user uploading the data according to a credit contract, the data needing to be checked for payment is encrypted, the encrypted data is subjected to chain loading and storage after passing authentication, once the data is chain loaded, the data cannot be tampered, at the moment, the data of the user is permanently protected and the data is traced back, and the problems that the data ownership cannot be protected due to the fact that the user data is leaked and lost can be solved.
The steps of uploading data and acquiring points by a user Admin are as follows:
step S2.1: a user Admin logs in a third-party Platform to select data of a local workstation to upload, and the third-party Platform receives user data;
step S2.2: the Platform of the third party calls a transaction System service, acquires a private key of a user mechanism where the user Admin is located, calls a point contract to calculate the point of current data, and stores the uploaded data and the point to a block chain;
step S2.3: platform calls a transaction System service, and a user organization Org where the user Admin is located acquires the credit of the uploaded data.
Step S3: the transaction System provides data retrieval services to other users, and the users purchase using points acquired by uploading data for paid data. The System receives data uploaded by different users, the data source is gradually enlarged, the platform can provide a data retrieval platform for researchers at the moment, valuable research data can be provided for the researchers on the premise that the data are protected, and the research results of the researchers can be protected. If the user is interested in a certain topic or when the user encounters difficulty in a certain topic, the user can enter into the System for searching, and the user can use the credit of the uploaded data to purchase according to the paid data.
The steps of deducting points from the user purchase data are as follows:
step S3.1: the user who buys the data logs in the System to search for the data uploaded by other users;
step S3.2: the transaction System calls a credit contract to calculate the credit to be consumed by the data, if the remaining credit of the Org of the user organization where the data purchasing user is located is larger than the credit to be deducted currently, the remaining credit of the data purchasing user is stored, the data purchasing user obtains corresponding data, the data uploading user obtains the credit paid by the data purchasing user, and the latest credit of the data uploading user is stored;
step S3.3: respectively modifying data purchasing data users and uploading latest points and respective consumption records of the data users on a block chain through intelligent contracts;
step S3.4: the transaction System receives the credit contract, returns the consumption credit and the account balance of the data purchasing user, returns the consumption credit and the account balance of the data uploading user, saves the record in the database, marks that the data purchasing user purchases the data, and is used for checking the voucher whether the block chain is purchased or not again in the next data, and the purchased data does not need to be purchased again.
The platform administrator System-Admin can also initiate proposal modification to the contract only, other coalition members can vote for the proposal, if the voting proportion exceeds 50%, the proposal is successful, new calculation integral logic can be started, the modification of the contract needs multi-party restriction, the fairness and the justice of the System can be ensured, and the benefit of the user is maximized.
Example 2
The present invention is further explained below.
Step S1: registering users Admin-A and Admin-B in the System, as shown in FIG. 1;
step S1 specifically includes the following steps:
step S1.1: the System-Admin logs in the System and respectively logs in mechanisms Org-A and Org-B;
step S1.2: System-Admin selects Org-A, Org-B respectively, and creates a department administrator Admin-A, Admin-B for Org-A, Org-B respectively;
step S1.3: Admin-A, Admin-B respectively completes activation in the Platform, sets passwords, respectively creates a public key Pub-A and a private key Pr-A for Org-A, creates a public key Pub-B and a private key Pr-B for Org-B, creates all data of a user Admin-A, Admin-B, calls a back-end service and stores the back-end service to a database;
step S1.4: two proposals are generated for Admin-A, Admin-B, respectively, by invoking a backend service trigger contract, and the two proposals are updated to the blockchain.
Step S2: Admin-A and Admin-B are activated as coalition members, as shown in FIG. 2;
step S2 specifically includes the following steps:
step S2.1: the System-Admin logs in the System, votes for the proposal of Admin-A, Admin-B, calls contracts and stores data into a block chain;
step S2.2: the contract calculates the proportion of votes Admin-A, Admin-B voted for in excess of 50%, which become coalition members by Admin-A and Admin-B.
Step S3: Admin-A upload data to obtain an integral, as shown in FIG. 3;
step S3 specifically includes the following steps:
step S3.1: Admin-A logs in Platform to select data of a local workstation to upload, and the Platform receives user data;
step S3.2: platform calls System service, acquires department private keys of Admin-A, calls contracts to calculate current data points, and stores user points and data to a block chain;
step S3.3: and storing the user purchase record and the point information into a database.
Step S4: Admin-B uploads data to obtain points, as shown in FIG. 4;
step S4 specifically includes the following steps:
step S4.1: Admin-B logs in Platform to select data of a local workstation to upload, and the Platform receives user data;
step S4.2: the contract returns the integral, Platform calls the System service, and the department Org-B where Admin-B is located acquires the uploaded data integral;
step S4.3: and storing the user purchase record and the point information into a database.
Step S5: Admin-B logs in to the System to purchase non-Org-B uploaded data, as shown in FIG. 5;
step S5 specifically includes the following steps:
step S5.1: Admin-B logs in a System and checks data uploaded by a non-Admin-B department;
step S5.2: the System calls a contract to calculate and view points which need to be consumed by the data, if the remaining points of Org-B are larger than the points which need to be deducted currently, the remaining points of Org-B are stored, ORG-A obtains the points paid by ORG-B, and the latest points of ORG-A are stored;
step S5.3: through the intelligent contracts, the blockchain modifies the latest points of Org-A, Org-B on the chain and the respective consumption records, respectively.
Step 5.4: the System receives the contract and returns the Org-B consumption point and the account balance, the Org-A consumption point and the account balance are returned, the database stores records, and the Org-B purchased data is marked for next data to check the voucher for verifying whether the data is purchased or not again, and the purchased data does not need to be purchased again.
Step S6: System-Admin initiates contract modification calculation integration logic to inform the coalition members to vote, as shown in FIG. 6;
step S6 specifically includes the following steps:
step S6.1: logging in the System by the System-Admin and initiating contract proposal modification;
step S6.2: the System calls the contract to generate a contract modification proposal, and the proposal state is to be voted;
step S6.3: the user is notified that the proposal has been successfully created.
Step S7: and (4) voting by the coalition members on the proposal of the System-Admin, wherein if the voting proportion exceeds 50%, the proposal is effective, and otherwise, the proposal is invalid, as shown in FIG. 7.
Step S7 specifically includes the following steps:
step S7.1: respectively logging in Platform and System by alliance members and System-Admin in System and Platform, and voting for a proposal of contract proposal modification initiated by a Platform administrator;
step S7.2: the contract receives the vote passing notice, and modifies the voting state of the voter;
step S7.3: and (4) contract calculation of the vote passing proportion of the proposal, and if the notice that the vote proportion exceeds 50% is received and the contract modification is effective, the user uploads data to calculate the integral logic modification.
Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, units provided by the present invention as pure computer readable program code, the system and its various devices, modules, units provided by the present invention can be fully implemented by logically programming method steps in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system and various devices, modules and units thereof provided by the invention can be regarded as a hardware component, and the devices, modules and units included in the system for realizing various functions can also be regarded as structures in the hardware component; means, modules, units for performing the various functions may also be regarded as structures within both software modules and hardware components for performing the method.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.