Disclosure of Invention
In order to solve the problems, the application provides a data transaction method and equipment on a block chain, the method can link the data transaction chain, realize win-win of the owner and the buyer of the data, and guarantee the benefits of both the owner and the buyer of the data.
A first aspect of the present application discloses a method for data transaction on a blockchain, the method comprising:
the method comprises the steps that a business server receives a data uplink request sent by a first client, wherein the data uplink request comprises data encrypted by a public key of the first client, data encrypted by the public key of the business server and a preset price of the data;
the business server executes uplink operation of the data uplink request;
the business server receives a data purchase request sent by a second client, wherein the data purchase request comprises a data purchase price, and the data purchase price comprises a preset price of the data;
triggering a verification intelligent contract, verifying the balance corresponding to the second client address by the verification intelligent contract, and freezing the data purchase price after the verification is passed;
the service server decrypts the data encrypted by the service server public key by using a self private key and encrypts the data by using the second client public key;
triggering a transaction intelligent contract, wherein the transaction intelligent contract executes the transfer of the data purchase price and executes the data uplink operation encrypted by the second customer public key.
In one possible embodiment, the method comprises:
the service server receives a data query request sent by the second client;
and the service server sends a data query response to the second client, wherein the data query response comprises data encrypted by the public key of the second client, so that the second client can decrypt the data encrypted by the public key of the second client by using a private key of the second client.
In one possible embodiment, the data purchase price further includes a transaction service fee, and the transaction service fee includes a service fee of the service server.
In a possible implementation manner, the data is service data, and the service data includes a service data associated attribute and a service data non-associated attribute; wherein,
and automatically associating and superposing the values of the business data association attributes.
In a possible implementation manner, the first client encrypts the data by using its own public key, specifically: the first client encrypts the data in a preset proportion by using a self public key; and/or
The service server encrypts the data by using the public key of the second client, specifically: and the business server encrypts the data in a preset proportion by using the public key of the second client.
The second aspect of the present application discloses a data transaction device on a blockchain, where the device is a service server, the service server is also a blockchain node, and the service server includes a receiving unit and a processing unit; wherein,
the receiving unit receives a data uplink request sent by a first client, wherein the data uplink request comprises data encrypted by a public key of the first client, data encrypted by a public key of a service server and a preset price of the data;
the processing unit is used for executing uplink operation of the data uplink request;
the receiving unit is used for receiving a data purchase request sent by a second client, wherein the data purchase request comprises a data purchase price, and the data purchase price comprises a preset price of the data;
the processing unit triggers a check intelligent contract, the check intelligent contract checks the balance corresponding to the second client address, and after the check is passed, the data purchase price is frozen;
the processing unit decrypts the data encrypted by the service server public key by using the service server private key and encrypts the data by using the second client public key;
and the processing unit is used for triggering a transaction intelligent contract, executing the transfer of the data purchase price by the transaction intelligent contract and executing the data uplink operation encrypted by the second customer public key.
In a possible implementation, the apparatus further comprises a transmitting unit; wherein,
the receiving unit is used for receiving a data query request sent by the second client;
the sending unit sends a data query response to the second client, where the data query response includes data encrypted by the public key of the second client, so that the second client decrypts the data encrypted by the public key of the second client by using its own private key.
In one possible embodiment, the data purchase price further includes a transaction service fee, and the transaction service fee includes a service of the business server.
In a possible implementation manner, the data is service data, and the service data includes a service data associated attribute and a service data non-associated attribute; wherein,
and automatically associating and superposing the values of the business data association attributes.
In a possible implementation manner, the first client encrypts the data by using its own public key, specifically: the first client encrypts the data in a preset proportion by using a self public key; and/or
The service server encrypts the data by using the public key of the second client, specifically: and the business server encrypts the data in a preset proportion by using the public key of the second client.
The method can link the data transaction, and meanwhile, the transaction process is transparent and credible, thereby ensuring the benefits of a data owner and a data buyer; users can conduct data transaction on the blockchain, and each piece of data can generate value.
Detailed Description
In order to more clearly explain the overall concept of the present application, the following detailed description is given by way of example in conjunction with the accompanying drawings.
The terms "first," "second," and the like in the description and in the claims of the present application and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the order of such use may be interchanged under appropriate circumstances such that embodiments of the invention described herein may be practiced in other orders than those illustrated or described herein.
Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The node referred to in the embodiment of the present application may be understood as an abstract machine that responds to an external specific trigger condition and performs state conversion according to a certain rule, and may be a device that can be networked according to application software, such as a mobile phone, a tablet computer, a palm computer, a personal PC, and the like.
As shown in fig. 1, the data transaction method on the blockchain includes S101-S106.
S101, a service server receives a data uplink request sent by a first client, wherein the data uplink request comprises data encrypted by a public key of the first client, data encrypted by the public key of the service server and a preset price of the data.
S102, the service server performs an uplink operation of the data uplink request.
S103, the service server receives a data purchase request sent by a second client, wherein the data purchase request comprises a data purchase price, and the data purchase price comprises a preset price of the data.
And S104, triggering a verification intelligent contract, verifying the balance corresponding to the second client address by the verification intelligent contract, and freezing the data purchase price after the verification is passed.
S105, the service server decrypts the data encrypted by the service server public key by using a self private key and encrypts the data by using the second client public key.
And S106, triggering a transaction intelligent contract, wherein the transaction intelligent contract executes the transfer of the data purchase price and executes the data uplink operation encrypted by the public key of the second client.
In one example, the service server receives a data query request sent by the second client; and the service server sends a data query response to the second client, wherein the data query response comprises data encrypted by the public key of the second client, so that the second client can decrypt the data encrypted by the public key of the second client by using a private key of the second client.
In one example, the data purchase price further includes a transaction service fee including a service fee of the business server.
In one example, the business data comprises business data associated attributes and business data non-associated attributes; and automatically associating and superposing the values of the business data association attributes.
In one example, the first client encrypts the data with its own public key, specifically: the first client encrypts the data in a preset proportion by using a self public key; and/or the service server encrypts the data by using the public key of the second client, specifically: and the business server encrypts the data in a preset proportion by using the public key of the second client.
Taking fig. 2 as an example, the case where the service server is a blockchain node is explained, and the data transaction method includes steps S201 to S212.
S201, the first client encrypts data by using a self public key and encrypts data by using a service server public key.
The data in the present application is service data. The service data is divided into two attributes, namely an associated attribute and a non-associated attribute. For example: the user comment content belongs to the non-associated attribute, and the comment content of each user can be stored in the block chain; when one merchant needs to purchase the evaluation of a certain commodity, the merchant can purchase the evaluation of the commodity for a plurality of users, the operation is carried out from the block chain, the disclosure is transparent, and the benefits of the merchant and the users can be guaranteed at the same time. For example: the number of the user comment contents is the correlation attribute, the business data format of a commodity comprises the comment number, and the comment number of the commodity can be automatically superposed as long as a user comments on the commodity; another example is: the transaction frequency of the business data in the application is an associated attribute, and the attribute value is automatically increased by 1 every time the business data is transacted.
S202, the first client sends a data uplink request to the service server, where the data uplink request includes the two pieces of data and a preset price of the data.
S203, the service server performs uplink operation of the data uplink request.
At this time, the service data uplink process, which is not described in this application, is as follows: under the consensus mechanism of workload certification PoW, after packaging and verification, the nodes broadcast to all nodes for data synchronization.
S204, the block node sends a data uplink response to the first client.
And S205, the second client sends a data purchase request to the business fortune server, wherein the data purchase request comprises a data purchase price, and the data purchase price comprises a preset price of the data.
The second client is a data purchaser and issues a purchase request of the business data on the blockchain; after inquiring the service data, the purchase request can be sent to the block chain node. At this time, the purchase request also includes data to be purchased, and here, the way of indicating the data to be purchased may be data identification; or the user can be the user corresponding to the second client, and the user directly clicks for purchase after looking up the data which is wanted to be purchased on the second client.
At this time, the first client encrypts the service data by using its own public key, which may be partial key field encryption, or encryption according to a preset ratio (for example, encrypting two thirds of the service data), and the purchaser of the service data cannot view the service data without purchasing the service data.
The purchase request comprises the price predetermined by the owner of the business data and also comprises a transaction service fee, namely the transaction service fee of the business server; the transaction service fee is paid by a purchaser of the transaction data.
The purchaser of the business data needs to have digital currency to purchase the business data on the block chain; the digital currency owned by the business data buyer can be digital currency obtained by selling the other business data as the owner of the other business data; the digital currency can be used on the blockchain. This is not explained in detail in the present application.
And S206, triggering a verification intelligent contract, verifying the balance corresponding to the second client address by the verification intelligent contract, and freezing the purchase price after the verification is passed.
At this time, the purchase price of the data needs to be frozen after the verification is passed; if the verification fails, the balance of the second client address does not need to be frozen, and subsequent steps are not executed.
S207, the service server decrypts the data encrypted by the service server public key by using a self private key, and then encrypts the data by using a second client public key.
S208, triggering a transaction intelligent contract, wherein the transaction intelligent contract executes the transfer of the purchase price and the data chaining encrypted by the public key of the second client.
S209, the service server sends a data purchase response to the second client.
S210, the second client sends a data query request to the service server.
S211, the service server sends a data response to the second client, wherein the data response comprises the data encrypted by the public key of the second client.
S212, the second client decrypts the data encrypted by the public key of the second client using its own private key.
It should be noted that, in the transaction process of the present application, the verification intelligent contract and the transaction intelligent contract may be the same intelligent contract or two different intelligent contracts.
In the data transaction process, all transaction process data are stored on a chain, and the data are public and transparent, so that the benefits of both transaction parties are guaranteed.
As shown in fig. 3, the data transaction device on the blockchain is a service server, and the service server is also a blockchain node, and the service server includes a receiving unit and a processing unit.
The receiving unit receives a data uplink request sent by a first client, wherein the data uplink request comprises data encrypted by a public key of the first client, data encrypted by a public key of a service server and a preset price of the data.
The processing unit executes an uplink operation of the data uplink request.
The receiving unit receives a data purchase request sent by a second client, wherein the data purchase request comprises a data purchase price, and the data purchase price comprises a preset price of the data.
And the processing unit triggers a verification intelligent contract, the verification intelligent contract verifies the balance corresponding to the second client address, and after the verification is passed, the data purchase price is frozen.
And the processing unit decrypts the data encrypted by the service server public key by using the service server private key and encrypts the data by using the second client public key.
And the processing unit is used for triggering a transaction intelligent contract, executing the transfer of the data purchase price by the transaction intelligent contract and executing the data uplink operation encrypted by the second customer public key.
In one example, the receiving unit receives a data query request sent by the second client; the sending unit sends a data query response to the second client, where the data query response includes data encrypted by the public key of the second client, so that the second client decrypts the data encrypted by the public key of the second client by using its own private key.
In one example, the data purchase price further includes a transaction service fee including a service fee of the business server.
In one example, the data is service data, and the service data comprises a service data associated attribute and a service data non-associated attribute; and automatically associating and superposing the values of the business data association attributes.
In one example, the first client encrypts the data with its own public key, specifically: the first client encrypts the data in a preset proportion by using a self public key; and/or the service server encrypts the data by using the public key of the second client, specifically: and the business server encrypts the data in a preset proportion by using the public key of the second client.
The method can link the data transaction, and meanwhile, the transaction process is transparent and credible, thereby ensuring the benefits of a data owner and a data buyer; users can conduct data transaction on the blockchain, and each piece of data can generate value.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.