Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
Blockchains are generally divided into three types: public chain (Public Blockchain), private chain (PrivateBlockchain) and alliance chain (Consortium Blockchain). In addition, there are various types of combinations, such as private chain + federation chain, federation chain + public chain, and other different combinations. The most decentralized of these is the public chain. The public chain is represented by bitcoin and ether house, and the participators joining the public chain can read the data record on the chain, participate in transaction, compete for accounting right of new blocks, and the like. Furthermore, each participant (i.e., node) is free to join and leave the network and perform related operations. Private chains are the opposite, with the network's write rights controlled by an organization or organization and the data read rights specified by the organization. Briefly, a private chain can be a weakly centralized system with strictly limited and few participating nodes. This type of blockchain is more suitable for use within a particular establishment. A federation chain is a block chain between a public chain and a private chain, and "partial decentralization" can be achieved. Each node in a federation chain typically has a physical organization or organization corresponding to it; participants jointly maintain blockchain operation by authorizing to join the network and forming a benefit-related alliance.
Whether public, private, or alliance, may provide the functionality of an intelligent contract. An intelligent contract on a blockchain is a contract that can be executed on a blockchain system triggered by a transaction. An intelligent contract may be defined in the form of code.
Taking the ethernet as an example, the support user creates and invokes some complex logic in the ethernet network, which is the biggest challenge of ethernet to distinguish from bitcoin blockchain technology. The core of the ethernet plant as a programmable blockchain is the ethernet plant virtual machine (EVM), each ethernet plant node can run the EVM. The EVM is a well-behaved virtual machine, which means that a variety of complex logic can be implemented through it. The user issuing and invoking smart contracts in the etherhouse is running on the EVM. In fact, what the virtual machine directly runs is virtual machine code (virtual machine bytecode, hereinafter referred to as "bytecode"). The intelligent contracts deployed on the blockchain may be in the form of bytecodes.
For example, as shown in fig. 1, after Bob sends a transaction containing information to create an intelligent contract to the ethernet network, the EVM of node 1 may execute the transaction and generate a corresponding contract instance. The "0 x6f8ae93 …" in fig. 1 represents the address of the contract, the data field of the transaction holds the byte code, and the to field of the transaction is empty. After agreement is reached between the nodes through the consensus mechanism, this contract is successfully created and can be invoked in subsequent procedures. After the contract is created, a contract account corresponding to the intelligent contract appears on the blockchain and has a specific address, and the contract code is stored in the contract account. The behavior of the intelligent contract is controlled by the contract code. In other words, an intelligent contract causes a virtual account to be generated on a blockchain that contains a contract code and an account store (Storage).
As shown in fig. 2, still taking an ethernet house as an example, after Bob sends a transaction for invoking an intelligent contract to the ethernet house network, the EVM of a certain node may execute the transaction and generate a corresponding contract instance. The from field of the transaction in fig. 2 is the address of the account of the transaction initiator (i.e., Bob), the "0 x6f8ae93 …" in the to field represents the address of the smart contract called, and the value field is the value of tai-currency in the etherhouse, and the data field of the transaction holds the method and parameters for calling the smart contract. The intelligent contract is independently executed at each node in the blockchain network in a specified mode, and all execution records and data are stored on the blockchain, so that after the transaction is completed, transaction certificates which cannot be tampered and cannot be lost are stored on the blockchain.
After executing Bob-initiated transaction, a node in the blockchain network generates corresponding receipt (receipt) data for recording receipt information related to the transaction. In this way, information regarding the results of the execution of the transaction may be obtained by querying the receipt of the transaction. Taking the ether house as an example, the receipt data obtained by the node executing the transaction may include the following:
a Result field indicating the execution Result of the transaction;
a Gas used field representing a Gas value consumed by the transaction;
a Logs field for representing a Log generated by the transaction, wherein the Log may further comprise a From field for representing an account address of an initiator of the call, a To field for representing an account address of an object (such as a smart contract) To be called, a Topic field for representing a subject of the Log, a Log data field for representing Log data, and the like;
an Output field, representing the Output of the transaction.
Generally, receipt data generated after a transaction is executed is stored in a clear text form, so that anyone can see the contents of the receipt fields contained in the receipt data, and the setting and the capability of privacy protection are not provided. In some combined blockchain and TEE solutions, the entire content of the receipt data is stored on the blockchain as data requiring privacy protection in order to achieve privacy protection. The block chain is a data set organized by specific logics stored in a database of nodes. The physical carrier of the database, as described later, may be a storage medium, such as a persistent storage medium. In fact, only part of the receipt data may be sensitive, while other content is not sensitive, only privacy protection is required for the sensitive content, other content can be disclosed, and even in some cases, retrieval of part of the content may be required to drive implementation of relevant operations, and then implementing privacy protection for the part of the content will affect implementation of the retrieval operations.
The process of protecting the privacy of the user may be as shown in fig. 3:
step 302, the user a creates a transaction for invoking the service contract and sends the created transaction to the blockchain node.
User a may invoke a smart contract (i.e., a business contract) deployed on the blockchain by creating a transaction (including the account address of the invoked smart contract) to cause the blockchain node to execute the business contract to complete the corresponding business. For privacy protection, user a may encrypt the created transaction using digital envelope encryption that combines a symmetric encryption algorithm and an asymmetric encryption algorithm. Specifically, the transaction content is encrypted by using a symmetric encryption algorithm (i.e., the transaction content is encrypted by using a symmetric key used by itself), and then the symmetric key is encrypted by using a public key of an asymmetric encryption algorithm.
At step 304, the block link points execute the service contract.
After receiving the encrypted transaction, the blockchain node reads the transaction into the TEE, decrypts by using the private key of the asymmetric encryption algorithm to obtain a symmetric key, decrypts the transaction by using the symmetric key obtained by decryption to obtain transaction content, and then executes a service code of a service contract in the TEE.
At step 306, the block nodes store privacy data associated with the transaction.
In one aspect, the blockchain nexus, upon receiving the transaction (after consensus), issues the transaction (encrypted in the form of a digital envelope) onto the blockchain for crediting. On the other hand, after the block chain link point executes the transaction, the related data obtained by executing the transaction is encrypted and stored (issued to the block chain for storage or stored locally); where the transaction receipt corresponding to the transaction may be encrypted using a symmetric key used by user a and the contract status data obtained in response to executing the business contract in response to the transaction may be encrypted using a particular symmetric key internal to the TEE. In addition, data such as account attribute information of the user a, account attribute information of a service contract, and a contract code of the service contract may also be encrypted by using a specific symmetric key inside the TEE. These encrypted data at the blockchain nodes belong to the private data of user a on the blockchain, i.e. the private data related to the transaction created by user a in step 302.
In the above-described scenario of privacy protection, a user may need to share private data related to a service implemented by the user using a blockchain to some specific users for viewing, that is, the specific users may view private data related to a historical transaction initiated by the user. Then, query permissions may be set for the user's private data for other users that are allowed to query. Therefore, the function of inquiring the authority aiming at the private data can be configured for the block chain by improving the chain code. The permission query configuration scheme based on chain codes in the present specification is described below with reference to fig. 4A.
Referring to fig. 4A, fig. 4A is a flowchart of a method for configuring a permission query based on chain codes according to an exemplary embodiment. As shown in fig. 4A, the method applied to the blockchain node may include the following steps:
step 402A, reading the obtained distribution code into a trusted execution environment to update a chain code maintained in the trusted execution environment, where the distribution code is used to invoke a service contract invoked by a historical transaction to execute an authority control code defined in the service contract when receiving an inquiry transaction of an inquiring party for private data related to the historical transaction, and determine an inquiry authority of the inquiring party.
In the present embodiment, when developing a service contract, in addition to defining a service code in the service contract, an authority control code of private data related to a transaction invoking the service contract needs to be defined in the service contract for determining whether a querying party for the private data is allowed to query. Through the mode of defining the authority control code in the service contract, the association relationship can be established between the private data and the authority control code for controlling the inquiry authority of the private data, so that each service contract can control the private data related to the transaction for calling the service contract. Wherein the type of the private data may include at least one of: historical transactions, transaction receipts corresponding to the historical transactions, account attribute information of an initiator of the historical transactions, account attribute information of business contracts invoked by the historical transactions, contract codes of the business contracts, and contract status data of the business contracts.
The development and deployment of business contracts can be accomplished by the roles of blockchain users, blockchain members, blockchain administrators, and the like. Taking a federation chain as an example, a member of the blockchain (or a user or an administrator of the blockchain) with accounting authority sets the authority control rule, and the authority control rule is defined in a service contract (service codes are also defined) in the form of an authority control code. After the development of the business contract is completed, the blockchain member can issue the business contract to the federation chain through any node device in the federation chain, and after the business contract is identified by member node devices (such as a plurality of authority node devices with accounting authority) specified by parts in the federation chain, the business contract is collected to a distributed database (namely a distributed ledger) of the federation chain. Based on the manner in which the service contract is deployed, the deployer of the service contract (i.e., the general user or general member with billing authority) may control whether others are permitted to query for private data associated with the transaction sent to the service contract (i.e., the transaction that invoked the service contract).
The consensus algorithm supported in the blockchain may include:
the first kind of consensus algorithm, namely the consensus algorithm that the node device needs to contend for the accounting right of each round of accounting period; consensus algorithms such as Proof of Work (POW), Proof of equity (POS), Proof of commission rights (DPOS), etc.;
the second kind of consensus algorithm, namely the consensus algorithm which elects accounting nodes in advance for each accounting period (without competing for accounting right); for example, a consensus algorithm such as a Practical Byzantine Fault Tolerance (PBFT) is used.
In a blockchain network employing a first type of consensus algorithm, node devices competing for billing rights can execute a transaction upon receipt. One of the node devices competing for the accounting right may win in the process of competing for the accounting right in the current round, and become an accounting node. The accounting node may package the received transaction with other transactions to generate a latest block and send the generated latest block or a block header of the latest block to other node devices for consensus.
In the block chain network adopting the second type of consensus algorithm, the node equipment with the accounting right is agreed before accounting in the current round. Thus, the node device, after receiving the transaction, may send the transaction to the accounting node if it is not the accounting node of its own round. For the accounting node of the current round, the transaction may be performed during or before packaging the transaction with other transactions to generate the latest block. After generating the latest block, the accounting node may send the latest block or a block header of the latest block to other node devices for consensus.
As described above, regardless of which consensus algorithm is used by the blockchain, the accounting node of the current round may pack the received transaction to generate the latest block, and send the generated latest block or the block header of the latest block to other node devices for consensus verification. If no problem is verified after other node equipment receives the latest block or the block header of the latest block, the latest block can be added to the tail of the original block chain, so that the accounting process of the block chain is completed. The transaction contained in the block may also be performed during the verification of a new block or block header from the accounting node by other nodes.
Based on the above-described manner of deploying the service contracts for controlling the query authority, each service contract (including the update contract) controls only the query authority of the private data related to the transaction invoking itself. Therefore, when a user (as a query party) initiates a query transaction for private data related to a historical transaction (initiated by any other user), the block link points need to determine a service contract for controlling the query authority of the private data, and then the service contract can be invoked to realize authority control.
And aiming at the mode that the block chain node calls the service contract to realize the authority control, a distribution code can be configured in the chain code of the block chain node for identifying whether the transaction received by the block chain node is a query transaction, and when the received transaction is the query transaction, the corresponding service contract is further called to execute the authority control code (which can be understood as distributing the query transaction to the corresponding service contract). For example, after the distribution code is developed, a push of the configuration distribution code may be issued to each blockchain node through a specific server, so that the blockchain node acquires the distribution code from the server. Of course, the block chain node can acquire the distribution code and perform version update on the chain code by any other way of configuring the distribution code.
In particular, a specific calling address may be configured for the distribution code for identifying the query transaction. In other words, the query transaction created by the querying party is a transaction for invoking the distribution code; then any transaction received by a block node may be treated as a query transaction when it calls the dispatch code through that particular call address. Taking an ether house as an example, the inquiring party can write the specific calling address in the to field of the inquiry transaction, and then the blockchain node can identify the received transaction as the inquiry transaction according to the specific calling address recorded in the to field when receiving the inquiry transaction, and further execute the distribution code to call the corresponding service contract. The distribution logic of the 'distribution query transaction' is solidified into the chain code in the form of the distribution code and issued together with the chain code, so that the subsequent redeployment of an administrator is not needed, and the contract code is solidified in the chain code, so that the contract code is controllable, and the safety is effectively improved. In other words, the distribution of query transactions to the respective business contracts is accomplished by the block link points themselves, without having to do so by invoking intelligent contracts.
In this embodiment, besides configuring the distribution codes in the chain codes, version updating may be performed on the chain codes at the link points of the blocks, so as to complete the process of authority query together with the configured distribution codes. For example, after a new version of chain code is developed, a specific server can send a push for upgrading the chain code to each block chain link point, so that the block chain node acquires the new version of chain code from the server, and updates the chain code (maintained in the TEE) according to the acquired new version of chain code. Of course, the block chain node can also acquire the new version chain code for version updating through any other mode of updating the chain code.
In one case, the inquiring party may write only the transaction identification of the historical transaction related to the private data to be inquired in the inquiry transaction when constructing the inquiry transaction. The transaction identifier of the historical transaction can be obtained by offline sharing between the initiator and the inquirer of the historical transaction, or by any other means. In this case, the new version chain code is used for acquiring the historical transaction according to the transaction identifier included in the inquiry transaction, and determining the service contract called by the historical transaction based on the acquired historical transaction; the distribution code is used for calling the service contract determined by executing the new version chain code so as to execute the authority control code defined in the called service contract.
Taking the ether house as an example, when the inquiring party creates the inquiry transaction, the hash value (as the transaction identifier) of the history transaction, which is notified by the initiator of the history transaction, can be recorded in the data field of the inquiry transaction. Then, when receiving the query transaction, the blockchain node (updated chain code) executes the new version chain code to obtain the historical transaction stored on the blockchain according to the hash value, and further determines the service contract invoked by the historical transaction according to the to field (contract address for recording the invoked intelligent contract) of the historical transaction. And after determining the service contract invoked by the historical transaction, the blockchain node executes the distribution code to invoke the determined service contract execution authority control code.
In another case, when constructing the query transaction, the querying party may write in the query transaction a transaction identifier of a historical transaction related to the private data to be queried and a contract address of a service contract invoked by the historical transaction; the transaction identifier of the historical transaction and the contract address of the service contract can be obtained by offline sharing between the initiator and the inquirer of the historical transaction or any other method. In this case, the distribution code is used to determine a corresponding service contract according to a contract address of a service contract called by the historical transaction included in the query transaction, and call the determined service contract to execute a corresponding authority control code to determine the query authority of the querying party. It should be noted that the query transaction is created by the querying party, the contract address of the business contract invoked by the historical transaction included in the query transaction is declared by the querying party, and then the contract address is not necessarily the contract address of the business contract actually invoked by the historical transaction, i.e. there is a risk that the querying party falsifies the contract address. Therefore, when the inquiry authority of the inquiring party is determined to be allowed to be inquired through the service contract, the new version chain code is used for acquiring the historical transaction according to the transaction identifier (namely the transaction ID, which is usually the hash value of the transaction) contained in the inquiry transaction, and determining the contract address of the service contract actually called by the historical transaction according to the acquired historical transaction. When the determined contract address is inconsistent with the contract address of the service contract called by the historical transaction included in the query transaction, the query authority of the query party is judged to be query forbidding, so that the condition that the query party steals the user private data by forging the contract address can be effectively eliminated.
Further, when the inquiry authority of the inquiring party is finally determined to be allowed to inquire, the new version chain code is also used for acquiring the decrypted private data to be checked by the inquiring party; wherein the private data is read into the trusted execution environment for decryption. For example, the private data may be obtained according to a transaction identifier of a historical transaction included in the query transaction, and the obtained private data may be read into the trusted execution environment and decrypted to be obtained by the querying party. In other words, when the query authority of the querier is finally determined to be allowed to be queried, the block chain node acquires the private data for the querier to view by executing the new version code.
In this embodiment, the authority control rule defined in the form of the authority control code in the service contract can be flexibly set according to the actual requirement; of course, one or more embodiments of the present description are not limited to the specific content of the entitlement control rules. In one case, the identity information of the inquiring party can be used as the basis for the authority control. Correspondingly, when the inquiring party creates the inquiring transaction, the inquiring transaction should include the identity information of the inquiring party. For example, the identity information of the inquiring party is the account ID (i.e., account address) of the inquiring party, which may be recorded in the from field of the inquiry transaction. Further, the authority control rule may be set to allow the inquiring party to inquire the corresponding private data when the identity information of the inquiring party meets a specific condition. For example, when the inquiring party belongs to a pre-specified inquiring user set, the inquiring authority of the inquiring party can be determined as allowing to inquire, or when the credit score of the inquiring party exceeds a preset credit threshold value, the inquiring authority of the inquiring party can be determined as allowing to inquire, and the like. Therefore, when determining the query authority of the inquirer, the authority control code defined in the service contract can be executed to determine the query authority of the inquirer for the private data according to the identity information of the inquirer.
In another case, the identity information of the inquiring party and the identity information of the initiator of the historical transaction can be used together as the basis for the authority control. Then, the authority control rule may be set to allow the querying party to query the corresponding privacy data when the identity information of the querying party and the identity information of the initiator meet a specific condition. For example, an inquiry group and an inquired group are recorded in the authority control rule, and members belonging to the inquiry group allow to view the private data of the inquired group members; or directly recording the corresponding relation of other users which can be checked by each user in the authority control rule; or when the inquirer and the initiator belong to the same team, the inquiry authority of the inquirer can be determined as allowing inquiry, and the like. Therefore, when determining the query authority of the inquirer, the authority control code defined in the service contract can be executed to determine the query authority of the inquirer for the private data according to the identity information of the inquirer and the identity information of the initiator. The inquiring party can write the identity information of the initiator of the historical transaction in the created inquiry transaction, or the block chain node (by executing the new version chain code) acquires the historical transaction according to the transaction identifier contained in the inquiry transaction and acquires the historical transaction based on the acquired historical transaction.
In yet another case, the identity information of the originator of the historical transaction may be used as a basis for the right control. Then, the authority control rule may be set to allow the inquiring party to inquire the corresponding privacy data when the identity information of the initiator meets a specific condition. For example, when the initiator belongs to a pre-specified set of users that can be queried, the query authority of the querying party can be determined as being allowed to be queried, or when the credit score of the initiator exceeds a preset credit threshold, the query authority of the querying party can be determined as being allowed to be queried, and the like. Therefore, when determining the query authority of the inquirer, the authority control code defined in the service contract can be executed to determine the query authority of the inquirer for the private data according to the identity information of the initiator.
When the basis of the authority control includes the identity information of the initiator of the historical transaction, since the identity information of the initiator included in the query transaction is only the identity information declared by the query party, the identity information is not necessarily the actual identity information of the initiator of the historical transaction, that is, there is a risk that the query party falsifies the identity information of the initiator. Therefore, a check logic for the identity information of the historical transaction initiator included in the inquiry transaction can be added to the new version chain code executed by the block chain node, that is, after the inquiry authority of the inquirer is determined to be allowed to inquire according to the authority control code, the block chain node (by executing the new version chain code) can acquire the historical transaction according to the transaction identifier (i.e., transaction ID, usually, hash value of the transaction) of the historical transaction included in the inquiry transaction, so that the identity information (i.e., actual identity information of the initiator) of the historical transaction can be determined according to the acquired historical transaction. When the determined identity information is inconsistent with the identity information of the initiator contained in the query transaction, the operation of obtaining the private data is prohibited (namely, the query authority is judged to be prohibited), so that the condition that the user private data is stolen by the inquirer through forging the identity information of the initiator can be effectively eliminated.
In this embodiment, when it is determined that the query right of the querying party is query prohibition, the step of verifying the identity information of the initiator or verifying the contract address of the service contract by obtaining the historical transaction does not need to be performed. Since the checking step is unnecessary operation under the condition that the inquiry authority of the inquirer is the inquiry prohibition, the occupation of processing resources of the block chain nodes can be reduced, and the performance of the block chain nodes is improved. Meanwhile, when the inquiry authority of the inquirer is determined as inquiry prohibition, contract receipt data for indicating that the inquirer prohibits inquiring the private data can be generated to be viewed by the inquirer.
It should be noted that the type of the request initiated on the blockchain by the user accessing the blockchain may specifically refer to a transaction (transaction) adopted in a conventional blockchain. Of course, the type of the request initiated on the blockchain by the user accessing the blockchain may be other than a transaction, and other forms of instructions, messages, and the like with a standard data structure may also be used. In the following embodiments, a request initiated on a blockchain by a user accessing the blockchain will be described as an example of a transaction.
Step 404A, when a verification request for the distribution code initiated by a challenger is received, reading the distribution code maintained in the trusted execution environment to generate a verification report, and sending the verification report to the challenger, so that the challenger verifies the distribution code in the trusted execution environment according to the verification report.
In this embodiment, the chain code may be maintained in the TEE at the block chain node, that is, the block chain node executes the chain code (including the distribution code) in the TEE, so that a remote attestation mechanism may be used to ensure that the distribution code is illegally tampered, thereby ensuring the authenticity and credibility of the distribution code maintained in the TEE. For example, the distribution code maintained within the TEE of the blockchain node may be verified by the above-described feature server (i.e., at the source of the distribution code) as a challenger to determine whether the distribution code maintained within the TEE of the blockchain node is consistent with the distribution code issued by itself or consistent with the distribution code maintained by itself.
Accordingly, based on the above process of solidifying the distribution code into the chain code, the present specification further provides a query scheme for the private data. Referring to fig. 4B, fig. 4B is a flowchart illustrating a method for querying private data according to an exemplary embodiment. As shown in fig. 4B, the method applied to the blockchain node may include the following steps:
step 402B, when receiving a query transaction of private data related to a historical transaction submitted by a querying party, reading a distribution code maintained in a trusted execution environment, the distribution code belonging to a part of a chain code maintained in the trusted execution environment.
Step 404B, executing the distribution code in the trusted execution environment to determine the query authority of the querying party according to the authority control code defined in the service contract invoked by the historical transaction.
And step 406B, when the determined inquiry authority is allowed to be inquired, acquiring the private data, reading the acquired private data into a trusted execution environment, and decrypting the private data so as to acquire the private data by the inquiring party.
In this embodiment, the private data is stored in an encrypted manner for the protection of the user private data described above. Therefore, when the inquiry authority of the inquiring party is determined to be allowed to inquire, the blockchain node (by executing the updated chain code) can acquire the private data according to the transaction identifier of the historical transaction included in the inquiry transaction, and read the acquired private data into the trusted execution environment for decryption, so as to be acquired by the inquiring party. The decryption method used is different (because the encryption method is different) according to the data type contained in the private data.
When the private data includes the historical transaction and/or the transaction receipts for the historical transaction, as can be seen from the embodiment shown in fig. 3 described above, both the historical transaction and the transaction receipts for the historical transaction are encrypted using the symmetric key used by the initiator of the historical transaction. Thus, after the historical transaction and/or transaction receipts for the historical transaction are obtained, the symmetric key used by the initiator (i.e., user a in the embodiment shown in fig. 3) may be obtained, and then the historical transaction and/or transaction receipts for the historical transaction may be decrypted within the TEE using the symmetric key. For the acquisition of the symmetric key used by the initiator, a symmetric key used for encrypting the historical transaction may be acquired first (the symmetric key is encrypted by a public key used by the initiator, that is, in the embodiment shown in fig. 3, a digital envelope is used for encryption), and the symmetric key is decrypted in the TEE by using a private key corresponding to the public key used by the initiator to obtain a decrypted symmetric key. It should be noted that, when the privacy data is history transaction, the process of acquiring history transaction and decrypting history transaction is performed when acquiring history transaction according to the transaction identifier, that is, acquiring history transaction according to the transaction identifier, and decrypting history transaction to obtain plaintext transaction content, so as to determine the service contract invoked by history transaction according to the plaintext transaction content. Therefore, when the inquiry authority is determined to be allowed to inquire, the decrypted historical transaction can be directly acquired for the inquiring party to view (without performing the operations of acquiring the historical transaction and decrypting the historical transaction).
The symmetric key used by the initiator can be generated by the initiator through a symmetric encryption algorithm, or obtained by negotiation between the initiator and the block link node, or obtained by sending through a key management server. For example, the symmetric encryption algorithm may be DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm, IDEA algorithm, or the like. A public key used by the initiator is sent to the initiator through remote certification by the key management server, the TEE of the block chain node is established by the SGX framework, and a private key corresponding to the public key is sent to a ring (also called enclave) of the block chain node through remote certification by the key management server. And the asymmetric encryption algorithm for generating the public key and the private key may be, for example, RSA, Elgamal, knapsack algorithm, Rabin, D-H, ECC (elliptic curve encryption algorithm), etc.
When the private data includes at least one of account attribute information of the initiator of the historical transaction, account attribute information of the service contract, contract code of the service contract, and contract status data of the service contract, as can be seen from the embodiment shown in fig. 3, the private data is encrypted by using a specific symmetric key inside the TEE. Thus, after obtaining these private data, they may be decrypted within the TEE by the specific symmetric key of the blockchain node. And for a specific symmetric key in the TEE, the SGX architecture at the block chain link point is remotely certified and then sent by a key management server, or is obtained by negotiation between the block chain link point and other block chain nodes.
In this embodiment, similar to the above-mentioned manner of encrypting the historical transaction to protect privacy, when the inquiring party initiates the inquiry transaction, the inquiring party may also encrypt the created inquiry transaction by using the symmetric key used by itself, and encrypt the symmetric key by using the public key used by itself. Therefore, after receiving the query transaction, the blockchain node decrypts the symmetric key of the encrypted query transaction by using the private key corresponding to the public key used by the querying party in the TEE, and then decrypts the query transaction by using the symmetric key obtained by decryption to obtain the transaction content contained in the query transaction. After the private data are obtained and decrypted, the decrypted private data can be encrypted through the symmetric key of the inquiring party by the block chain nodes, so that the inquiring party can decrypt and check the private data through the symmetric key used by the inquiring party, and the private data are prevented from being leaked.
The sources of the symmetric key, the public key and the private key used for privacy protection for the inquiring party are similar to those described above, and are not described herein again. Of course, the asymmetric keys (public key and private key) used in the process may be the asymmetric keys used for privacy protection for the initiator.
For easy understanding, the technical solutions in the present specification will be described in detail below with reference to fig. 5 to 7.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating remote attestation of distribution code according to an example embodiment. As shown in fig. 5, the process of remote attestation may include the following steps:
at step 502, the challenger 51 sends a verification request for the dispense code to the block chain node 52.
In this embodiment, block link points 52 maintain distribution codes within the TEE. The TEE is a trusted execution environment that is based on a secure extension of the CPU hardware and is completely isolated from the outside. TEE was originally proposed by Global Platform to address the secure isolation of resources on mobile devices, providing a trusted and secure execution environment for applications parallel to the operating system. The Trust Zone technology of ARM realizes the real commercial TEE technology at the earliest. Along with the rapid development of the internet, the security requirement is higher and higher, and more requirements are provided for the TEE by mobile equipment, cloud equipment and a data center. The concept of TEE has also been developed and expanded at a high rate. The concept now referred to as TEE has been a more generalized TEE than the concept originally proposed. For example, server chip manufacturers Intel, AMD, etc. have introduced hardware-assisted TEE in turn and enriched the concept and characteristics of TEE, which have gained wide acceptance in the industry. The mention of TEE now is more generally directed to such hardware assisted TEE techniques. Unlike the mobile terminal, the cloud access requires remote access, and the end user is not visible to the hardware platform, so the first step of using the TEE is to confirm the authenticity and credibility of the TEE. A remote attestation mechanism may therefore be introduced for TEE technology, endorsed by a hardware vendor (mainly the CPU vendor) and ensured by digital signature techniques that the user is verifiable for the TEE state. Meanwhile, the security requirement which cannot be met by only safe resource isolation is also met, and further data privacy protection is also provided. Commercial TEE including Intel SGX, AMD SEV also provide memory encryption techniques, limiting trusted hardware within the CPU, with the data of the bus and memory being ciphertext to prevent snooping by malicious users. For example, TEE technology such as intel's software protection extensions (SGX) isolates code execution, remote attestation, secure configuration, secure storage of data, and trusted paths for executing code. Applications running in the TEE are secured and are almost impossible to access by third parties.
Taking the Intel SGX technology as an example, SGX provides a bounding box, i.e., an encrypted trusted execution area in the memory, and the CPU protects data from being stolen. Taking a block link point using a CPU supporting SGX as an example, a part of an area EPC (enclosure Page Cache, Enclave Page Cache, or Enclave Page Cache) may be allocated in a memory by using a newly added processor instruction, and data therein is encrypted by an Encryption engine mee (memory Encryption engine) in the CPU. The encrypted content in the EPC is decrypted into plaintext only after entering the CPU. Therefore, in the SGX, a user may not trust an operating system, a VMM (Virtual Machine Monitor), or even a BIOS (Basic Input output system), and only need to trust the CPU to ensure that private data is not leaked.
Based on the manner in which the distribution code is maintained, a challenge may be initiated by the server issuing the distribution code as a challenger to blockchain node 52, requiring blockchain node 52 to present a verification report to prove that the distribution code maintained within the TEE of blockchain node 52 was issued by the server, or is consistent with the distribution code maintained by the server.
Block link point 52 generates a verification report and signs with the SGX CPU's private key, step 504.
Block chain node 52 returns a verification report to challenger 51, step 506.
At step 508, challenger 51 forwards the verification report to IAS 53.
Taking the Intel SGX technology as an example, after receiving the verification request, the blockchain node 52 derives the distribution code maintained in the SGX to generate a verification report based on the distribution code. For example, the hash value of the distribution code may be obtained by performing hash calculation, the hash value may be stored in a quote (reference structure), and the quote (serving as a verification report) may be signed by using a private key of the CPU of the SGX.
Intel is configured with a private key to a CPU when the CPU is shipped, but is configured in an IAS (Intel authentication Server) of Intel without disclosing a public key corresponding to the private key. Then, after the verification report is signed by using the private key of the CPU, since there is no corresponding public key, the challenger 51 needs to forward to the IAS after obtaining the quote returned by the block chain node 52, so as to verify the signature by the IAS.
At step 510, the IAS53 verifies the signature using the public key of the CPU of the SGX.
In this embodiment, if the verification passes, the verification result is returned to the challenger 51. For example, an AVR report may be generated in which a "YES" is used to indicate that the verification signature passed and a "NO" is used to indicate that the verification signature failed. In order to prevent the AVR report from being intercepted or modified during transmission, the IAS may sign the AVR report with its own certificate, in addition to using SSL (Secure socket layer) encryption for the transmitted link.
At step 512, the IAS53 returns the verification result to the challenger 51.
At step 514, the challenger 51 verifies the distribution code.
In this embodiment, after receiving the verification result, the challenger 51 authenticates the signature of the IAS, and acquires the verification result recorded in the AVR report after the verification is passed. If YES, comparing the hash value in the qote with the local hash value (obtained by performing hash calculation on the locally maintained distribution code). When the comparison result is consistent, it is determined that the verification by the remote certification is passed, and it is further determined that the distribution code maintained in the TEE of the blockchain node 52 is issued by the challenger 51 or is consistent with the distribution code maintained by the challenger 51.
Referring to fig. 6, fig. 6 is a flowchart illustrating another private data query method according to an exemplary embodiment. As adapted to the scenario of fig. 3, after the user a initiates a transaction for invoking a service contract, the user a may share the privacy data related to the transaction (as a historical transaction in this scenario) with the user B, or the user B may have a need to view the privacy data. As shown in fig. 6, the process of querying the private data by the user B as the querying party may include the following steps:
user B creates a query transaction through the client used, step 602.
In this embodiment, the to field of the query transaction records the specific invocation address of the distribution code, and the hash value of the historical transaction (i.e., the transaction ID), the content of the from field (the address of the initiator of the historical transaction), and the content of the to field (the contract address of the service contract invoked by the historical transaction) may also be recorded in the data field (or other fields) of the query transaction. The hash value of the historical transaction and the address of the initiator can be obtained by the user B and the user a through offline sharing, or obtained by any other method.
In step 604, user B encrypts the query transaction with the digital envelope via the client.
In step 606, user B initiates a query transaction to the block nodes via the client.
At step 608, the blockchain node decrypts the query transaction within the TEE.
In this embodiment, the key of the asymmetric encryption algorithm may be generated by the key management server. Through a remote certification mode, the key management server sends the private key to the blockchain node, specifically, the private key can be transmitted into a surrounding ring of the blockchain node. The blockchain node may comprise a plurality of enclosures, and the private key may be passed into a security enclosure of the enclosures; for example, the security enclosure may be a qe (queuing enclosure) enclosure, rather than an ae (application enclosure) enclosure. For asymmetrically encrypted public keys, they may be sent by the key management server to the user's client. Then, the client may encrypt the created transaction using a symmetric encryption algorithm, that is, encrypt the transaction content using the symmetric key of the symmetric encryption algorithm, and encrypt the symmetric key used in the symmetric encryption algorithm using the asymmetric encryption algorithm. Generally, a public key of an asymmetric encryption algorithm is used to encrypt a symmetric key used in a symmetric encryption algorithm. The above encryption mode is called digital envelope encryption, so that after the block chain nodes receive the encrypted transaction, the block chain nodes can firstly decrypt by using the private key of the asymmetric encryption algorithm to obtain the symmetric key of the symmetric encryption algorithm, and then decrypt by using the symmetric key of the symmetric encryption algorithm to obtain the transaction content.
At step 610, the block nodes determine that the received transaction is a query transaction.
In this embodiment, the to field content of any transaction is read by the tile link point after the transaction is received. When the content of the to field is a specific calling address of the distribution code, the transaction is used for calling the distribution code, and then the transaction can be determined as a query transaction.
In step 612, the block nodes determine the service contract invoked by the historical transaction according to the to field of the historical transaction recorded in the query transaction.
At step 614, the block link points invoke service contracts.
At step 616, the business contract determines the query authority of user B based on the from field of the query transaction and the from field of the historical transaction.
In this embodiment, the identity information of the inquiring party and the initiator of the historical transaction are taken as the basis of the permission control together. For example, the right control rule (defined in the service contract in the form of right control code) records the query group and the queried group, and the members belonging to the query group are allowed to view the private data of the members of the queried group; or directly recording the corresponding relation of other users which can be checked by each user in the authority control rule. Wherein, the account address is used as the identity information of the user. Then, the block node executes the authority control code defined in the service contract, so as to determine the inquiry authority of the user B according to the account address of the inquiring party (from field content of inquiry transaction) and the account address of the initiator of the historical transaction (from field content of historical transaction).
At step 618, the service contract returns the query authority of user B to the chunk link point.
In step 620, after determining that the query authority of the user B is allowed to query, the block nodes check the from field and the to field of the historical transaction.
In this embodiment, the address of the initiator and the contract address of the service contract recorded in the query transaction are filled in by user B, so that the address of the initiator is understood to be the address of the initiator of the historical transaction declared by user B, and the contract address is understood to be the contract address of the service contract invoked by the historical transaction declared by user B. However, the address of the initiator actually used for the historical transaction is not necessarily the address of the initiator stated by the user B, and the contract address of the service contract actually invoked for the historical transaction is not necessarily the contract address stated by the user B, that is, there is a possibility that the user B forges. For example, the user B may deploy the service contract on the blockchain by the above-mentioned manner of deploying the service contract, and the authority control code defined in the service contract allows the user B to view the private data of the user a; then, the user B may fill in the contract address of the service contract invoked by the historical transaction initiated by the user a as the contract address of the service contract deployed by the user B. Therefore, under the condition that the query authority of the user B is determined to be allowed to be queried, the block chain node can further verify the address of the initiator of the historical transaction and the contract address declared by the user B, and therefore the security of the private data is guaranteed.
For example, after determining that the query authority of the user B is allowed to query, the block link point may obtain a history transaction (stored in the block chain) from the block chain according to a hash value of the history transaction, and read a content of a from field record of the history transaction and a to field content of the history transaction, and if the read from field content is the same as a content of a from field declared in the query transaction, may further perform an operation of obtaining the private data; otherwise, the operation of obtaining the private data is prohibited. Similarly, if the read to field content is the same as the to field content declared in the query transaction, the operation of obtaining the private data can be further executed; otherwise, the operation of obtaining the private data is prohibited.
It should be noted that, when it is determined that the query authority of the querying party is query prohibition, the checking step is unnecessary, and therefore the checking step is not required to be performed, so that the occupation of processing resources of the block chain nodes can be reduced, and the performance of the block chain nodes can be improved.
Further, after the inquiry authority of the user B is determined to be inquiry prohibition by using the service contract, a contract receipt about the inquiry prohibition private data of the user B can be generated for the user B to check. Or returning a receipt of the query inhibition to the user B by the block chain node to inform the user B that the query authority is the query inhibition.
At step 622, the block nodes obtain the private data.
In step 624, the block node reads the private data into the TEE for decryption.
In the present embodiment, as can be seen from the embodiment shown in fig. 3, the private data is stored in an encrypted manner for the purpose of privacy protection. Meanwhile, the encryption modes adopted are different according to different data types contained in the private data. Thus, after obtaining the private data (e.g., from a hash value of the historical transaction), the obtained private data may be read into the trusted execution environment for decryption for acquisition by the querying party.
When the private data includes the historical transaction and/or the transaction receipts for the historical transaction, as can be seen from the embodiment shown in fig. 3 described above, both the historical transaction and the transaction receipts for the historical transaction are encrypted using the symmetric key used by the initiator of the historical transaction. Thus, after the historical transaction and/or transaction receipts for the historical transaction are obtained, the symmetric key used by user a may be obtained and then the historical transaction and/or transaction receipts for the historical transaction may be decrypted within the TEE using the symmetric key. For the acquisition of the symmetric key used by the initiator, a symmetric key used for encrypting the historical transaction (the symmetric key is encrypted by the public key used by the user a) may be acquired first, and the symmetric key is decrypted in the TEE by the private key corresponding to the public key used by the user a to obtain the decrypted symmetric key.
When the private data includes at least one of account attribute information of the user a, account attribute information of the service contract, contract code of the service contract, contract status data of the service contract, these private data may be decrypted within the TEE by the specific symmetric key of the blockchain node.
For example, the specific symmetric key may be a seal (simple Encrypted authenticated identity) key, which may be sent to the blockchain node by the key management server after passing the remote attestation, or may be negotiated among the various blockchain nodes, and then the blockchain nodes encrypt and decrypt the private data using the seal key. Of course, the symmetric key sent by the key management server to the blockchain node after the remote certification or obtained by negotiation between the blockchain nodes may be a root key (root key) instead of the above-mentioned seal key, and the above-mentioned seal key may be a derivative key of the root key. For example, root keys may irreversibly derive several versions of derived keys in turn, and any two adjacent keys irreversibly derive a low version of key from a high version of key, thereby forming a chained key derivation structure. For example, if 256 versions of keys with version numbers of 0-255 need to be derived, hash calculation can be performed on the root key and a version factor 0xFF (a decimal value is 255, that is, the version number of the key needs to be generated; of course, other values can also be adopted) to obtain a key-255 with the version number of 255; carrying out hash calculation on the key-255 and the version factor 0xFE to obtain the key-254 with the version number of 254; … … the key-0 with version number 0 is obtained by hashing the key-1 with a version factor of 0x 00. Due to the characteristics of the hash algorithm, the calculation between the high-version key and the low-version key is irreversible, for example, the key-0 can be calculated by the key-1 and the version factor 0x00, but the key-1 cannot be reversely deduced by the key-0 and the version factor 0x 00.
Then a version of the derived key may be specified as the seal key described above to encrypt the private data. Further, the version of the seal key may be updated, and based on the above characteristics, the seal key should be updated from the low version key to the high version key, so that even if the low version key is leaked, the high version key cannot be deduced reversely, and sufficient data security is ensured.
In step 626, the block chain node encrypts the private data with the symmetric key of user B.
User B views the private data, step 628.
In one embodiment, after encrypting the private data, the blockchain node may generate an event containing the private data and store the event in the blockchain log, and then, the user B may use the client to obtain the event through a callback mechanism of the blockchain, so as to view the private data. After the private data is obtained, the user B decrypts the private data by adopting the symmetric key used by the user B through the client side, and then the private data of the plaintext content can be obtained.
In another embodiment, after encrypting the private data, the chunk chain node may directly return the encrypted private data to the client used by user B. Similarly, the user B decrypts the private data by using the symmetric key used by the user B through the client, so as to obtain the private data of the plaintext content.
In the embodiment shown in fig. 5, the query transaction created by the user B includes the hash value, the from field, and the to field of the historical transaction, but as can be seen from the above analysis, the query transaction may also include only the hash value of the historical transaction, and the contents of the from field and the to field need not be written. This will be explained with reference to fig. 7. As shown in fig. 7, the process of querying the private data by the user B as the querying party may include the following steps:
user B creates a query transaction through the client used, step 702.
In this embodiment, the to field of the query transaction records the specific calling address of the distribution code, and the hash value (i.e., transaction ID) of the historical transaction is also recorded in the data field (or other field) of the query transaction. The hash value of the historical transaction can be obtained by offline sharing between the user B and the user a, or by any other means.
In step 704, user B encrypts the query transaction with the digital envelope via the client.
In step 706, user B initiates a query transaction to the block node via the client.
At step 708, the blockchain node decrypts the query transaction within the TEE.
It should be noted that the encryption and decryption processes in this embodiment are similar to those in the embodiment shown in fig. 5, and are not described again here.
At step 710, the block node determines the received transaction as a query transaction.
In this embodiment, the to field content of any transaction is read by the tile link point after the transaction is received. When the content of the to field is a specific calling address of the distribution code, the transaction is used for calling the distribution code, and then the transaction can be determined as a query transaction.
In step 712, the block chain node obtains the from field and the to field of the historical transaction according to the hash value.
In this embodiment, the content of the from field of the historical transaction is the address of the initiator of the historical transaction (in this embodiment, the identity information of the initiator), and the content of the to field of the historical transaction is the contract address of the service contract invoked by the historical transaction.
In step 714, the block nodes determine the service contract invoked by the historical transaction according to the to field of the historical transaction.
At step 716, the block link point invokes the service contract.
At step 718, the business contract determines the query permissions of user B based on the from field of the query transaction and the from field of the historical transaction.
In this embodiment, the identity information of the inquiring party and the initiator of the historical transaction are taken as the basis of the permission control together. For example, the right control rule (defined in the service contract in the form of right control code) records the query group and the queried group, and the members belonging to the query group are allowed to view the private data of the members of the queried group; or directly recording the corresponding relation of other users which can be checked by each user in the authority control rule. Wherein, the account address is used as the identity information of the user. Then, the block node executes the authority control code defined in the service contract, so as to determine the inquiry authority of the user B according to the account address of the inquiring party (from field content of inquiry transaction) and the account address of the initiator of the historical transaction (from field content of historical transaction).
Step 720, the service contract returns the query authority of the user B to the block link point.
In step 722, when the query permission of the user B is allowed, the block link node acquires the private data.
In this embodiment, after determining that the query right of the user B is query prohibition by using the service contract, a contract receipt about the query prohibition private data of the user B may be generated for the user B to view. Or returning a receipt of the query inhibition to the user B by the block chain node to inform the user B that the query authority is the query inhibition.
In step 724, the block node reads the private data into the TEE for decryption.
At step 726, the block chain node encrypts the private data with the symmetric key of user B.
It should be noted that, when the private data is a history transaction, the process of acquiring the history transaction and decrypting the history transaction is executed when step 712 is executed, that is, the history transaction is acquired according to the hash value of the history transaction, and the history transaction is decrypted to obtain the plaintext transaction content of the history transaction, so as to read the from field and the to field of the history transaction. Therefore, in this case, when the query authority is determined as allowing the query, the decrypted history transaction is directly acquired (without performing the operations of acquiring the history transaction and decrypting the history transaction) and is viewed by the querying party.
User B views the private data, step 728.
Therefore, according to the private data query scheme in the specification, the user A can share the private data between the user A and the user B without sharing the symmetric key used by the user A with the user B, so that the safety and the convenience are improved.
Corresponding to the above method embodiments, the present specification further provides an embodiment of a permission query configuration device based on chain codes.
The embodiment of the authority inquiry configuration device based on the chain code can be applied to the electronic equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation.
Referring to fig. 8, fig. 8 is a schematic block diagram of an apparatus according to an exemplary embodiment. As shown in fig. 8, at the hardware level, the apparatus includes a processor 802, an internal bus 804, a network interface 806, a memory 808, and a non-volatile memory 810, but may also include hardware required for other services. The processor 802 reads a corresponding computer program from the non-volatile memory 810 into the memory 808 and then runs the computer program to form a permission query configuration device based on chain codes on a logic level. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 9, in a software implementation, the configuration apparatus applied to a blockchain node may include:
the first updating unit 91 reads the acquired distribution code into a trusted execution environment to update a chain code maintained in the trusted execution environment, where the distribution code is used to invoke a service contract invoked by a historical transaction to execute an authority control code defined in the service contract when receiving an inquiry transaction of an inquirer for private data related to the historical transaction, and determine an inquiry authority of the inquirer;
and the verification unit 92, when receiving a verification request for the distribution code initiated by the challenger, reads the distribution code maintained in the trusted execution environment to generate a verification report, and sends the verification report to the challenger, so that the challenger verifies the distribution code in the trusted execution environment according to the verification report.
Optionally, a specific calling address is configured for the distribution code; the device further comprises:
the transaction identification unit 93 takes any received transaction as an inquiry transaction when the distribution code is called by the specific calling address.
Alternatively to this, the first and second parts may,
further comprising: a second updating unit 94, configured to update the chain code maintained in the trusted execution environment according to the obtained new version chain code, where the new version chain code is used to obtain the historical transaction according to the transaction identifier included in the inquiry transaction, and determine a service contract called by the historical transaction based on the historical transaction;
the distribution code is used for calling the service contract determined by executing the new version chain code so as to execute the authority control code defined in the called service contract.
Optionally, the distribution code is configured to determine a corresponding service contract according to a contract address of a service contract called by the historical transaction included in the query transaction, and call the determined service contract to execute a corresponding permission control code to determine the query permission of the querying party; the device further comprises:
a third updating unit 95, configured to update the chain code maintained in the trusted execution environment according to the obtained new version chain code, where the new version chain code is used to obtain the historical transaction according to the transaction identifier included in the query transaction when it is determined that the query authority of the querying party is allowed to be queried through the service contract, determine a contract address of a service contract actually invoked by the historical transaction according to the obtained historical transaction, and determine that the query authority of the querying party is prohibited from being queried when the determined contract address is inconsistent with the contract address included in the query transaction.
Optionally, the new version chain code is further configured to, when it is determined that the query authority of the querying party is allowed to query, obtain the decrypted private data to be viewed by the querying party, and read the private data into a trusted execution environment for decryption.
Optionally, the privacy data includes at least one of:
the historical transaction, a transaction receipt corresponding to the historical transaction, account attribute information of an originator of the historical transaction, account attribute information of a business contract invoked by the historical transaction, a contract code of the business contract, contract status data of the business contract.
Referring to fig. 10, fig. 10 is a schematic block diagram of an apparatus according to an exemplary embodiment. As shown in fig. 10, at the hardware level, the device includes a processor 1002, an internal bus 1004, a network interface 1006, a memory 1008, and a non-volatile storage 1010, although other hardware required for services may be included. The processor 1002 reads a corresponding computer program from the non-volatile memory 1010 into the memory 10010 and runs the computer program, thereby forming a query device for the private data on a logical level. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 11, in a software implementation, the querying device applied to the blockchain node may include:
a code reading unit 1101 that, when receiving a query transaction of private data related to a historical transaction submitted by a querying party, reads a distribution code maintained in a trusted execution environment, the distribution code belonging to a part of a chain code maintained in the trusted execution environment;
an authority determining unit 1102, configured to execute the distribution code in the trusted execution environment to determine the query authority of the querying party according to an authority control code defined in a service contract invoked by the historical transaction;
the data obtaining unit 1103 obtains the private data when the determined inquiry authority is allowed to be inquired, and reads the obtained private data into the trusted execution environment to be decrypted, so that the private data is obtained by the inquiring party.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.