WO2021088549A1 - Procédé et appareil de configuration de requête d'autorisation basés sur un code de chaîne - Google Patents

Procédé et appareil de configuration de requête d'autorisation basés sur un code de chaîne Download PDF

Info

Publication number
WO2021088549A1
WO2021088549A1 PCT/CN2020/117001 CN2020117001W WO2021088549A1 WO 2021088549 A1 WO2021088549 A1 WO 2021088549A1 CN 2020117001 W CN2020117001 W CN 2020117001W WO 2021088549 A1 WO2021088549 A1 WO 2021088549A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
query
code
contract
historical
Prior art date
Application number
PCT/CN2020/117001
Other languages
English (en)
Chinese (zh)
Inventor
刘琦
闫莺
Original Assignee
蚂蚁区块链科技(上海)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 蚂蚁区块链科技(上海)有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2021088549A1 publication Critical patent/WO2021088549A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/45Structures or tools for the administration of authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • One or more embodiments of this specification relate to the field of blockchain technology, and in particular to a method and device for permission query configuration based on chain code.
  • Blockchain technology is built on a transmission network (such as a peer-to-peer network).
  • the network nodes in the transmission network use chained data structures to verify and store data, and use distributed node consensus algorithms to generate and update data.
  • TEE Trusted Execution Environment
  • TEE can play the role of a black box in the hardware. Neither the code executed in the TEE nor the data operating system layer can be peeped, and only the pre-defined interface in the code can operate on it.
  • plaintext data is calculated in TEE instead of complex cryptographic operations in homomorphic encryption. There is no loss of efficiency in the calculation process. Therefore, the combination with TEE can achieve less performance loss. Under the premise, the security and privacy of the blockchain are greatly improved. At present, the industry is very concerned about the TEE solution.
  • TEE solutions including TPM (Trusted Platform Module) in software and Intel SGX (Software Guard Extensions) in hardware. , Software Protection Extension), ARM Trustzone (trust zone) and AMD PSP (Platform Security Processor, platform security processor).
  • one or more embodiments of this specification provide a smart contract-based permission query configuration method and device, electronic equipment, and storage medium.
  • a method for configuring permission query based on chain code is proposed, which is applied to a blockchain node; the method includes: reading the obtained distribution code into a trusted execution Environment, to update the chain code maintained in the trusted execution environment, and the distribution code is used to call the historical transaction when a query transaction for private data related to historical transactions is received from the querying party
  • the business contract executes the authority control code defined in the business contract to determine the query authority of the querying party; when a verification request for the distribution code initiated by the challenger is received, the trusted execution environment is read
  • the maintained distribution code generates 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.
  • a method for querying private data is proposed, which is applied to blockchain nodes; the method includes: when receiving private data related to historical transactions submitted by the querying party When querying transactions, read the distribution code maintained in the trusted execution environment, where the distribution code is part of the chain code maintained in the trusted execution environment; execute the distribution code in the trusted execution environment, Determine the query authority of the querying party according to the authority control code defined in the business contract called by the historical exchange; when the determined query authority is allowed to query, obtain the decrypted private data for the query After checking, the private data is read into the trusted execution environment for decryption.
  • a permission query configuration device based on chain code is proposed, which is applied to a blockchain node; the device includes:
  • the first update unit reads the obtained distribution code into the trusted execution environment to update the chain code maintained in the trusted execution environment.
  • the distribution code maintained in the trusted execution environment is read to generate a verification report, and the verification report is sent to the challenger, so that the challenger is based on the verification
  • the report verifies the distributed code in the trusted execution environment.
  • a device for querying private data which is applied to a blockchain node; the device includes: a code reading unit, when receiving the historical data submitted by the querying party During the query transaction of transaction-related privacy data, the distribution code maintained in the trusted execution environment is read, and the distribution code is part of the chain code maintained in the trusted execution environment; the authority determination unit is used in the trusted execution environment.
  • the distribution code is executed in the execution environment to determine the query authority of the query party according to the authority control code defined in the business contract called by the historical exchange; the data acquisition unit, when the determined query authority is allowed to query, The decrypted private data is obtained for viewing by the querying party, and the private data is read into a trusted execution environment for decryption.
  • an electronic device including: a processor; a memory for storing executable instructions of the processor; wherein the processor runs the executable instructions In order to realize the method as described in the first aspect.
  • an electronic device including: a processor; a memory for storing executable instructions of the processor; wherein the processor runs the executable instructions To achieve the method described in the second aspect.
  • a computer-readable storage medium is provided, and computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
  • a computer-readable storage medium is provided with computer instructions stored thereon, which when executed by a processor implements the steps of the method described in the second aspect.
  • Fig. 1 is a schematic diagram of creating a smart contract according to an exemplary embodiment.
  • Fig. 2 is a schematic diagram of invoking a smart contract provided by an exemplary embodiment.
  • Fig. 3 is a schematic diagram of invoking a business contract provided by an exemplary embodiment.
  • Fig. 4A is a flowchart of a chain code-based permission query configuration method provided by an exemplary embodiment.
  • Fig. 4B is a flowchart of a method for querying private data provided by an exemplary embodiment.
  • Fig. 5 is a schematic diagram of remote certification for distributed codes provided by an exemplary embodiment.
  • Figures 6-7 are flowcharts of another method for querying private data provided by an exemplary embodiment.
  • Fig. 8 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • Fig. 9 is a block diagram of a device for querying private data provided by an exemplary embodiment.
  • Fig. 10 is a schematic structural diagram of another device provided by an exemplary embodiment.
  • Fig. 11 is a block diagram of another device for querying private data provided by an exemplary embodiment.
  • the steps of the corresponding method are not necessarily executed in the order shown and described in this specification.
  • the method may include more or fewer steps than described in this specification.
  • a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step in other embodiments. description.
  • Block chains are generally divided into three types: Public Blockchain, Private Blockchain and Consortium Blockchain.
  • the public chain is represented by Bitcoin and Ethereum. Participants who join the public chain can read the data records on the chain, participate in transactions, and compete for the accounting rights of new blocks. Moreover, each participant (ie, node) can freely join and exit the network, and perform related operations.
  • the private chain is the opposite.
  • the write permission of the network is controlled by an organization or institution, and the data read permission is regulated by the organization.
  • the private chain can be a weakly centralized system with strict restrictions and few participating nodes.
  • This type of blockchain is more suitable for internal use by specific institutions.
  • Consortium chain is a block chain between public chain and private chain, which can realize "partial decentralization".
  • Each node in the alliance chain usually has a corresponding entity or organization; participants are authorized to join the network and form a stakeholder alliance to jointly maintain the operation of the blockchain.
  • a smart contract on the blockchain is a contract that can be triggered and executed by a transaction on the blockchain system.
  • Smart contracts can be defined in the form of codes.
  • EVM Ethereum Virtual Machine
  • Every Ethereum node can run EVM.
  • EVM is a Turing complete virtual machine, which means that various complex logic can be implemented through it.
  • Users who publish and call smart contracts in Ethereum run on the EVM.
  • virtual machine code virtual machine bytecode, hereinafter referred to as "bytecode"
  • the smart contract deployed on the blockchain can be in the form of bytecode.
  • the EVM of node 1 can execute the transaction and generate a corresponding contract instance.
  • the "0x6f8ae93" in Figure 1 represents the address of this contract, the data field of the transaction can be stored in bytecode, and the to field of the transaction is empty.
  • the contract is successfully created and can be called in the subsequent process.
  • a contract account corresponding to the smart contract appears on the blockchain, and has a specific address, and the contract code will be stored in the contract account.
  • the behavior of the smart contract is controlled by the contract code.
  • smart contracts enable virtual accounts containing contract codes and account storage (Storage) to be generated on the blockchain.
  • the EVM of a certain node can execute the transaction and generate a corresponding contract instance.
  • the from field of the transaction in Figure 2 is the address of the account of the transaction initiator (ie Bob), the "0x6f8ae93" in the to field represents the address of the called smart contract, and the value field in Ethereum is the value of Ether ,
  • the method and parameters of calling the smart contract are stored in the data field of the transaction.
  • the smart contract is executed independently on each node in the blockchain network in a prescribed manner. All execution records and data are stored on the blockchain. Therefore, when the transaction is completed, the blockchain will be stored on the blockchain that cannot be tampered with. Lost transaction certificate.
  • the receipt data obtained by a node executing a transaction can include the following content: Result field, indicating the execution result of the transaction; Gas used field, indicating the gas value consumed by the transaction; Logs field, indicating the log generated by the transaction, and the log can be It further includes the From field, To field, Topic field, Log data field, etc.
  • the From field represents the account address of the initiator of the call
  • the To field represents the account address of the called object (such as a smart contract)
  • the Topic field represents the subject of the log.
  • the Log data field indicates log data
  • the Output field indicates the output of the transaction.
  • the receipt data generated after the transaction is executed is stored in plain text, and anyone can see the contents of the above-mentioned receipt fields contained in the receipt data, and there is no privacy protection setting and ability.
  • the block chain is a data set stored in a database of a node and organized by a specific logic.
  • the physical carrier of the database may be a storage medium, such as a persistent storage medium.
  • only part of the content of the receipt data may be sensitive, while other content is not sensitive. Only sensitive content needs to be protected for privacy, and other content can be disclosed. In some cases, it may even be necessary to perform retrieval of part of the content to drive The implementation of related operations, then the implementation of privacy protection for this part of the content will affect the implementation of retrieval operations.
  • Step 302 User A creates a transaction for invoking a business contract, and sends the created transaction to the blockchain node.
  • User A can invoke the smart contract (ie, business contract) deployed on the blockchain by creating a transaction (including the account address of the called smart contract), so that the blockchain node executes the business contract to complete the corresponding business.
  • user A can use digital envelope encryption to encrypt the created transaction, which combines a symmetric encryption algorithm and an asymmetric encryption algorithm.
  • the transaction content is encrypted using a symmetric encryption algorithm (that is, the transaction content is encrypted using the symmetric key used by itself), and then the public key of the asymmetric encryption algorithm is used to encrypt the symmetric key.
  • Step 304 the blockchain node executes the business contract.
  • the blockchain node After receiving the encrypted transaction, the blockchain node reads the transaction into the TEE, first uses the private key of the asymmetric encryption algorithm to decrypt the symmetric key, and then uses the decrypted symmetric key to decrypt the transaction Obtain the transaction content, and then execute the business code of the business contract within the TEE.
  • step 306 the blockchain node stores private data related to the transaction.
  • the blockchain node after receiving the transaction, the blockchain node (after passing the consensus) will publish the transaction (encrypted in the form of a digital envelope) to the blockchain for certification.
  • the blockchain node executes the transaction, it will also encrypt and store the relevant data obtained from the execution of the transaction (publish it on the blockchain for certification, or store it locally); among them, for the transaction corresponding to the transaction
  • the receipt can be encrypted with the symmetric key used by user A, and the contract status data obtained in response to the execution of the business contract in response to the transaction can be encrypted with a specific symmetric key inside the TEE.
  • data such as user A's account attribute information, business contract account attribute information, and business contract contract code can also be encrypted using a specific symmetric key inside the TEE.
  • the data encrypted by these blockchain nodes above all belong to user A's private data on the blockchain, that is, private data related to the transaction created by user A in step 302.
  • the user may need to share the privacy data related to the business realized by the blockchain to some specific users for viewing, that is, these specific users can view the privacy related to the historical transactions initiated by the user. data.
  • the query authority can be set for the user's private data, so that other users who are allowed to query can view it. Therefore, the chain code can be improved to configure the blockchain with the function of querying permissions for private data.
  • the following describes the chain code-based permission query configuration scheme in this specification with reference to FIG. 4A.
  • FIG. 4A is a flowchart of a chain code-based permission query configuration method provided by an exemplary embodiment. As shown in Figure 4A, this method is applied to a blockchain node and may include the following steps:
  • Step 402A Read the obtained distribution code into the trusted execution environment to update the chain code maintained in the trusted execution environment.
  • the business contract called by the historical transaction is called to execute the authority control code defined in the business contract, and the query authority of the query party is determined.
  • the private data can be associated with the permission control code that controls the query permission of the private data, so that each business contract can control the private data related to the transaction calling itself.
  • the type of privacy data may include at least one of the following: historical transactions, transaction receipts corresponding to historical transactions, account attribute information of the initiator of historical transactions, account attribute information of business contracts invoked by historical transactions, and contract codes of business contracts , The contract status data of the business contract.
  • the development and deployment of business contracts can be completed by roles such as blockchain users, blockchain members, and blockchain administrators. Take the consortium chain as an example.
  • Blockchain members or blockchain users, administrators
  • accounting authority set up authority control rules, and define the authority control rules in the form of authority control codes in the business contract (also Defined the business code).
  • the blockchain member can publish the business contract to the alliance chain through any node device in the alliance chain, and the business contract is specified by the member node device in the alliance chain. (For example, several authoritative node devices with accounting authority designated in the consortium chain) After completing the consensus, they are included in the distributed database (ie, distributed ledger) of the consortium chain.
  • the deploying party of the business contract i.e., ordinary users or ordinary members with accounting authority
  • Related privacy data i.e., ordinary users or ordinary members with accounting authority
  • the consensus algorithms supported in the blockchain can include: the first type of consensus algorithm, that is, the consensus algorithm that node devices need to compete for the accounting right of each round of accounting cycle; for example, Proof of Work (POW) ), Proof of Stake (POS), Delegated Proof of Stake (DPOS) and other consensus algorithms; the second type of consensus algorithm, that is, pre-election of accounting nodes for each round of accounting cycle (no need to compete Accounting rights) consensus algorithms; for example, practical Byzantine Fault Tolerance (PBFT) and other consensus algorithms.
  • the first type of consensus algorithm that is, the consensus algorithm that node devices need to compete for the accounting right of each round of accounting cycle
  • POW Proof of Work
  • POS Proof of Stake
  • DPOS Delegated Proof of Stake
  • PBFT Practical Byzantine Fault Tolerance
  • all node devices that compete for the right to bookkeeping can execute the transaction after receiving the transaction.
  • one node device may win this round of contention for the right to bookkeeping and become the bookkeeping node.
  • the accounting node can package the received transaction with other transactions 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.
  • the node device with the right to book accounts has been agreed before this round of bookkeeping. Therefore, after the node device receives the transaction, if it is not the accounting node of this round, it can send the transaction to the accounting node.
  • the transaction can be executed during or before the process of packaging the transaction with other transactions to generate the latest block.
  • the accounting node After the accounting node generates the latest block, it can send the latest block or the block header of the latest block to other node devices for consensus.
  • the accounting node of this round can package the received transaction to generate the latest block, and the generated latest block or the latest block
  • the header of the block is sent to other node devices for consensus verification. If other node devices receive the latest block or the block header of the latest block, and there is no problem after verification, the latest block can be appended to the end of the original blockchain to complete the accounting process of the blockchain. In the process of verifying the new block or block header sent by the accounting node, other nodes can also execute the transaction contained in the block.
  • each business contract (including update contracts) only controls the query authority of private data related to the transaction that invokes 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 blockchain node needs to determine a business contract that controls the query authority for private data. Then the business contract can be invoked to achieve permission control.
  • the distribution code can be configured in the chain code of the blockchain node to identify whether the transaction received by the blockchain node is a query transaction, and when the transaction is received When the transaction of is a query transaction, the corresponding business contract is further called to execute the authority control code (it can be understood as distributing the query transaction to the corresponding business contract).
  • the distribution code can also be configured by other arbitrary methods to enable the blockchain node to obtain the distribution code and update the version of the chain code.
  • a specific calling address can be configured for the distribution code to identify the query transaction.
  • the query transaction created by the querying party is a transaction for calling the distribution code; then, when any transaction received by the blockchain node calls the distribution code through the specific calling address, any transaction can be used as a query transaction.
  • the querying party can write the specific calling address in the to field of the query transaction, then when the blockchain node receives the query transaction, it can recognize the received address according to the specific calling address recorded in the to field.
  • the transaction is a query transaction, and then the distribution code is executed to call the corresponding business contract.
  • the chain code on the blockchain node can also be version updated, so as to cooperate with the configured distribution code to jointly complete the permission query process.
  • the chain code upgrade push can be sent to each blockchain node through a specific server, so that the blockchain node obtains the new version of the chain code from the server, and then according to the obtained
  • the new version of the chain code updates the chain code (maintained in TEE).
  • any other way of updating the chain code can also be used to enable the blockchain node to obtain a new version of the chain code for version update.
  • the querying party may only write the transaction identifier of the historical transaction related to the private data to be queried in the query transaction.
  • the transaction identifier of the historical transaction can be obtained by offline sharing between the initiator and the inquiring party of the historical transaction, or obtained by any other means.
  • the new version of the chain code is used to obtain historical transactions based on the transaction identifier contained in the query transaction, and to determine the business contract invoked by the historical transaction based on the obtained historical transactions; the distribution code is used to call the new version of the chain The business contract determined by the code to execute the permission control code defined in the called business contract.
  • a querying party when a querying party creates a query transaction, it can record the hash value (as a transaction identifier) of the historical transaction notified by the initiator of the historical transaction in the data field of the query transaction. Then, when the blockchain node (updated chain code) receives the query transaction, it executes the new version of the chain code to obtain the historical transaction stored on the blockchain according to the hash value, and then according to the to field of the historical transaction (Used to record the contract address of the called smart contract) Determine the business contract called by the historical transaction. After determining the business contract called by the historical transaction, the blockchain node executes the distribution code to call the determined business contract execution authority control code.
  • the blockchain node executes the distribution code to call the determined business contract execution authority control code.
  • the querying party when constructing the query transaction, can write the transaction identifier of the historical transaction related to the private data to be queried and the contract address of the business contract called by the historical transaction in the query transaction; where, The transaction identifier of the historical transaction and the contract address of the business contract can be obtained by offline sharing between the initiator and the inquiring party of the historical transaction, or by any other means.
  • the distribution code is used to determine the corresponding business contract according to the contract address of the business contract called by the historical transaction contained in the query transaction, and call the determined business contract to execute the corresponding authority control code to determine the query of the querying party Permissions.
  • the query transaction is created by the querying party, and the contract address of the business contract called by the historical transaction contained in the query transaction is declared by the querying party, then the contract address is not necessarily the contract of the business contract actually called by the historical transaction Address, that is, there is a risk that the inquirer may forge the contract address. Therefore, when it is determined through the business contract that the query authority of the querying party is allowed to query, the new version of the chain code is used to obtain the historical transaction according to the transaction identifier (ie transaction ID, usually the hash value of the transaction) contained in the query transaction, and According to the acquired historical transaction, the contract address of the business contract actually called by the historical transaction is determined. When the determined contract address is inconsistent with the contract address of the business contract called by the historical transaction contained in the query transaction, the query authority of the query party is determined to prohibit query, which can effectively exclude the query party from stealing user privacy data by forging the contract address Case.
  • the transaction identifier ie transaction ID, usually the hash value of the transaction
  • the new version of the chain code is also used to obtain decrypted private data for viewing by the querying party; among them, the private data is read into the trusted execution environment for decryption.
  • the private data can be obtained according to the transaction identifier of the historical transaction included in the query transaction, and the obtained private data can be read into a trusted execution environment for decryption, so that the querying party can obtain it.
  • the blockchain node obtains private data for the querying party to view by executing the new version of the code.
  • the permission control rules defined in the form of permission control codes in the business contract can be flexibly set according to actual needs; of course, one or more embodiments of this specification do not limit the specific content of the permission control rules.
  • the identity information of the inquiring party can be used as the basis for authority control.
  • the query transaction should contain the identity information of the query party.
  • the identity information of the inquiring party is the account ID (ie account address) of the inquiring party, and the account ID may be recorded in the from field of the inquiry transaction.
  • the permission control rule can be set to allow the querying party to query corresponding private data when the identity information of the querying party meets specific conditions.
  • the inquiry authority of the inquiring party can be determined to allow the inquiry, or when the inquiring party's credit score exceeds the preset credit threshold, the inquiry authority of the inquiring party can be determined to be allowed Query and so on. Therefore, when determining the query authority of the querying party, the authority control code defined in the business contract can be executed to determine the querying party's query authority for private data according to the identity information of the querying party.
  • 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 authority control.
  • the permission control rule can be set to allow the querying party to query corresponding private data when the identity information of the querying party and the identity information of the initiator meet specific conditions.
  • the query group and the queried group are recorded in the permission control rules, and members belonging to the query group are allowed to view the private data of the members of the queried group; or, the permission control rules directly record the correspondence of which other users each user can view; or
  • the inquiry authority of the inquiry party can be determined to allow inquiry and so on.
  • the authority control code defined in the business contract can be executed to determine the querying party's query authority for private data according to the identity information of the querying party and the identity information of the initiator.
  • the query party can write the identity information of the initiator of the historical transaction in the created query transaction, or the blockchain node (by executing the new version of the chain code) obtains the historical transaction based on the transaction identifier contained in the query transaction. Obtained historical transactions.
  • the identity information of the initiator of the historical transaction can be used as the basis for authority control.
  • the permission control rule can be set to allow the querying party to query corresponding private data when the identity information of the initiator meets specific conditions. For example, when the initiator belongs to a pre-designated set of users that can be queried, the query authority of the inquiring party can be determined to allow the query, or when the credit score of the initiator exceeds the preset credit threshold, the query authority of the inquiring party can be determined to be allowed Query and so on. Therefore, when determining the query authority of the querying party, the authority control code defined in the business contract can be executed to determine the querying party's query authority for private data according to the identity information of the initiator.
  • the identity information of the initiator contained in the query transaction is only the identity information declared by the querying party, and the identity information is not necessarily the actual initiator of the historical transaction.
  • the identity information of the inquiring party may forge the identity information of the initiator. Therefore, the verification logic for the identity information of the historical transaction initiator contained in the query transaction can be added to the new version of the chain code executed by the blockchain node, that is, the query authority of the query party is determined according to the authority control code.
  • the blockchain node After the query, the blockchain node (by executing the new version of the chain code) can obtain the historical transaction according to the transaction identifier (ie transaction ID, usually the hash value of the transaction) contained in the query transaction, and thereby obtain the historical transaction according to the acquired history
  • the transaction determines the identity information of the initiator of the historical transaction (that is, the actual identity information of the initiator).
  • the operation of obtaining private data is prohibited (that is, the query authority is determined to prohibit query), which can effectively exclude the inquirer from forging the identity information of the initiator. The case of stealing user privacy data.
  • the inquiry authority of the inquiry party when it is determined that the inquiry authority of the inquiry party is forbidden to inquiry, there is no need to perform the above-mentioned steps of verifying the identity information of the initiator or verifying the contract address of the business contract by obtaining historical transactions.
  • the verification step is an unnecessary operation, so the occupation of the processing resources of the blockchain node can be reduced, thereby improving the performance of the blockchain node.
  • a contract receipt indicating that the querying party is prohibited from querying private data can be generated for the querying party to view.
  • the type of request initiated on the blockchain by a user who accesses the blockchain may specifically refer to a transaction used in a traditional blockchain.
  • the type of request initiated on the blockchain by a user who accesses the blockchain can also be other than a transaction, other forms of instructions, messages, etc. with a standard data structure, one or more embodiments of this specification It is not particularly limited.
  • the request initiated on the blockchain by the user accessing the blockchain is taken as an example for description.
  • Step 404A when receiving a verification request for the distribution code initiated by the challenger, read the distribution code maintained in the trusted execution environment to generate a verification report, and send the verification report to the challenger, So that the challenger verifies the distributed code in the trusted execution environment according to the verification report.
  • the chain code can be maintained in the TEE of the blockchain node, that is, the blockchain node executes the chain code (including the distribution code) in the TEE, so that the remote certification mechanism can be used to ensure that the distribution code is illegally tampered with , Thereby ensuring the authenticity and credibility of the distribution code maintained in the TEE.
  • the above-mentioned characteristic server that is, the source of the distribution code
  • the above-mentioned characteristic server can be used as the challenger to verify the distribution code maintained in the TEE of the blockchain node, so as to determine whether the distribution code maintained in the TEE of the blockchain node is the same as the distribution issued by itself The code is consistent, or whether it is consistent with the distribution code maintained by itself.
  • FIG. 4B is a flowchart of a method for querying private data according to an exemplary embodiment. As shown in Figure 4B, the method is applied to a blockchain node and may include the following steps.
  • Step 402B When receiving a query transaction of private data related to historical transactions submitted by the querying party, read the distribution code maintained in the trusted execution environment, where the distribution code belongs to the chain code maintained in the trusted execution environment a part of.
  • Step 404B Execute the distribution code in the trusted execution environment to determine the query authority of the query party according to the authority control code defined in the business contract called by the historical exchange.
  • Step 406B When the determined query authority is allowed to query, acquire the private data, and read the acquired private data into a trusted execution environment for decryption, so that the query can be obtained by the querying party.
  • the privacy data is encrypted and stored. Therefore, when it is determined that the query authority of the querying party is allowed to query, the blockchain node (by executing the updated chain code) can obtain private data according to the transaction identifier of the historical transaction contained in the query transaction, and the obtained privacy The data is read into the trusted execution environment for decryption to be obtained by the inquiring party. Depending on the type of data contained in the private data, the decryption method used is also different (because the encryption method is different).
  • the private data includes historical transactions and/or transaction receipts of historical transactions
  • both historical transactions and transaction receipts of historical transactions are encrypted with the symmetric key used by the initiator of the historical transaction. Therefore, after obtaining the historical transaction and/or the transaction receipt of the historical transaction, the symmetric key used by the initiator (user A in the embodiment shown in FIG. 3) can be obtained first, and then the symmetric key can be passed in the TEE. The key decrypts historical transactions and/or transaction receipts of historical transactions.
  • the symmetric key used to encrypt historical transactions can be obtained first (the symmetric key is encrypted by the public key used by the initiator, that is, the digital envelope is used in the embodiment shown in FIG. 3). Encryption), the symmetric key is decrypted in the TEE through the private key corresponding to the public key used by the initiator to obtain the decrypted symmetric key.
  • the process of obtaining historical transactions and decrypting historical transactions is performed when historical transactions are obtained according to the transaction identifier, that is, historical transactions are obtained according to the transaction identifier, and the historical transactions are decrypted to obtain the plaintext transaction content , So as to determine the business contract called by the historical transaction based on the content of the plaintext transaction. Therefore, when it is determined that the query permission is allowed to query, (no need to perform the operations of obtaining historical transactions and decrypting historical transactions) directly obtain the decrypted historical transactions for the querying party to view.
  • the symmetric key used by the initiator can be generated by the initiator through a symmetric encryption algorithm, or obtained through negotiation between the initiator and the blockchain node, or sent by the key management server.
  • the symmetric encryption algorithm for example, it may be the DES algorithm, the 3DES algorithm, the TDEA algorithm, the Blowfish algorithm, the RC5 algorithm, the IDEA algorithm, and so on.
  • the public key used by the initiator is sent to the initiator by the key management server through remote certification, the TEE of the blockchain node is established by the SGX architecture, and the private key corresponding to the public key is sent to the blockchain by the key management server through remote certification Enclave of nodes (enclave, also called enclave).
  • the asymmetric encryption algorithm used to generate the public key and the private key can be, for example, RSA, Elgamal, knapsack algorithm, Rabin, D-H, ECC (elliptic curve encryption algorithm), etc.
  • the privacy data includes at least one of the account attribute information of the initiator of the historical transaction, the account attribute information of the business contract, the contract code of the business contract, and the contract status data of the business contract.
  • the data is encrypted with a specific symmetric key inside the TEE. Therefore, after obtaining these private data, the private data can be decrypted by the specific symmetric key of the blockchain node in the TEE.
  • the SGX structure of the blockchain node is sent by the key management server after remote certification, or it is negotiated between the blockchain node and other blockchain nodes.
  • the querying party when the querying party initiates a query transaction, it can also use the symmetric key used by itself to encrypt the created query transaction, and use its own symmetric key to encrypt the created query transaction.
  • the public key encrypts the symmetric key. Therefore, after receiving the query transaction, the blockchain node first decrypts the symmetric key of the encrypted query transaction through the private key corresponding to the public key used by the querying party in the TEE, and then queries the transaction through the symmetric key pair obtained by decryption Decryption is performed to obtain the transaction content contained in the query transaction.
  • the blockchain node After obtaining the private data and decrypting the private data, the blockchain node can encrypt the decrypted private data with the symmetric key of the querying party, so that the querying party can perform the private data with the symmetric key used by the querying party. Decrypt and view, so as to avoid the leakage of private data.
  • the sources of the symmetric key, public key, and private key used for privacy protection of the query party are similar to those described above, and will not be repeated here.
  • the asymmetric keys (public key and private key) used in this process can be the asymmetric keys used for the privacy protection of the initiator as described above.
  • FIG. 5 is a schematic diagram of remote certification for distributed codes provided by an exemplary embodiment. As shown in Figure 5, the remote certification process may include the following steps.
  • step 502 the challenger 51 sends a verification request for the distributed code to the blockchain node 52.
  • the blockchain node 52 maintains the distribution code in the TEE.
  • TEE is a secure extension based on CPU hardware and a trusted execution environment that is completely isolated from the outside.
  • TEE was first proposed by Global Platform to solve the security isolation of resources on mobile devices, and parallel to the operating system to provide a trusted and secure execution environment for applications.
  • ARM's Trust Zone technology is the first to realize the real commercial TEE technology.
  • security requirements are getting higher and higher.
  • Not only mobile devices, cloud devices, and data centers have put forward more demands on TEE.
  • the concept of TEE has also been rapidly developed and expanded. Compared with the originally proposed concept, the TEE referred to now is a more generalized TEE.
  • TEE hardware-assisted TEE
  • enriched the concepts and features of TEE which has been widely recognized in the industry.
  • cloud access requires remote access, and the end user is invisible to the hardware platform. Therefore, the first step in using TEE is to confirm the authenticity of TEE. Therefore, a remote certification mechanism can be introduced for TEE technology, endorsed by hardware vendors (mainly CPU vendors) and digital signature technology to ensure that users can verify the state of TEE.
  • hardware vendors mainly CPU vendors
  • digital signature technology to ensure that users can verify the state of TEE.
  • TEEs including Intel SGX and AMD SEV also provide memory encryption technology to limit the trusted hardware to the CPU, and the data on the bus and memory are ciphertexts to prevent malicious users from snooping.
  • TEE technologies such as Intel’s Software Protection Extensions (SGX) isolate code execution, remote attestation, secure configuration, secure storage of data, and trusted paths for code execution.
  • the applications running in TEE are protected by security and are almost impossible to be accessed by third parties.
  • SGX provides a circle, that is, an encrypted trusted execution area in the memory, and the CPU protects data from being stolen.
  • the SGX-supported CPU used by the blockchain node as an example.
  • EPC Enclave Page Cache, Enclave Page Cache, Enclave Page Cache
  • the engine MEE Memory Encryption Engine
  • SGX users can distrust the operating system, VMM (Virtual Machine Monitor), and even BIOS (Basic Input Output System). They only need to trust the CPU to ensure that private data will not leakage.
  • the server issuing the distribution code can be used as a challenge to initiate a challenge to the blockchain node 52, and the blockchain node 52 is required to produce a verification report to prove that the distribution code maintained in the TEE of the blockchain node 52 is The distribution code issued by the server or consistent with the distribution code maintained by the server.
  • step 504 the blockchain node 52 generates a verification report and signs it with the private key of the SGX CPU.
  • step 506 the blockchain node 52 returns a verification report to the challenger 51.
  • step 508 the challenger 51 forwards the verification report to the IAS53.
  • the blockchain node 52 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.
  • the distribution code can be hashed to obtain the corresponding hash value, and the hash value can be stored in the quote (quote structure), and the private key of the SGX CPU can be used to sign the quote (as a verification report).
  • Intel configures a private key for the CPU when the CPU leaves the factory, but does not disclose the public key corresponding to the private key, but configures it in Intel's IAS (Intel Attestation Server). Then, after using the CPU's private key to sign the verification report, since there is no corresponding public key, after the challenger 51 obtains the quote returned by the blockchain node 52, it needs to forward it to the IAS for the IAS to verify the signature.
  • IAS Intelligent Attestation Server
  • step 510 the IAS53 uses the public key of the CPU of the SGX to verify the signature.
  • the verification result is returned to the challenger 51.
  • an AVR report can be generated.
  • "YES” is used to indicate that the verification signature is passed
  • "NO” is used to indicate that the verification signature is not passed.
  • IAS in order to prevent the AVR report from being intercepted or modified during transmission, in addition to using SSL (Secure Sockets Layer) encryption for the transmission link, IAS can also use its own certificate to sign the AVR report.
  • SSL Secure Sockets Layer
  • step 512 the IAS53 returns the verification result to the challenger 51.
  • step 514 the challenger 51 verifies the distribution code.
  • the challenger 51 after receiving the verification result, the challenger 51 first verifies the signature of the IAS, and then obtains the verification result recorded in the AVR report after the verification is passed. If it is YES, compare the hash value in the quote with the local hash value (obtained by hash calculation on the locally maintained distribution code). When the comparison results are consistent, it is determined that the remote certification verification is passed, and then it is 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.
  • FIG. 6 is a flowchart of another method for querying private data provided by an exemplary embodiment.
  • user A can share privacy data related to the transaction (in this scenario as a historical transaction) to user B, or user B can view the privacy Data needs.
  • the process of user B as the inquiring party inquiring about private data may include the following steps.
  • Step 602 User B creates a query transaction through the client terminal used.
  • the to field of the query transaction records the specific calling address of the distribution code.
  • the hash value (ie transaction ID) and from field of the historical transaction can 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 offline sharing between user B and user A, or obtained by any other means.
  • step 604 the user B uses the digital envelope encryption to query the transaction through the client.
  • step 606 the user B initiates a query transaction to the blockchain node through the client.
  • step 608 the blockchain node decrypts the query transaction in the TEE.
  • the key of the asymmetric encryption algorithm can be generated by the key management server.
  • the key management server sends the private key to the blockchain node, specifically, it can be passed into the circle of the blockchain node.
  • Blockchain nodes can contain multiple enclosures, and the above private key can be passed into the security enclosures in these enclosures; for example, the security enclosure can be a QE (Quoting Enclave) enclosure instead of AE (Application Enclave) ) Encircle the circle.
  • QE Quoting Enclave
  • AE Application Enclave
  • the client can use the symmetric encryption algorithm to encrypt the created transaction, that is, use the symmetric key of the symmetric encryption algorithm to encrypt the transaction content, and use the asymmetric encryption algorithm to encrypt the symmetric key used in the symmetric encryption algorithm.
  • the public key of the asymmetric encryption algorithm is used to encrypt the symmetric key used in the symmetric encryption algorithm.
  • the above encryption method is called digital envelope encryption.
  • step 610 the blockchain node determines that the received transaction is a query transaction.
  • the blockchain node after receiving any transaction, the blockchain node reads the content of the to field of the transaction.
  • the content of the to field is the specific calling address of the distribution code, it means that the transaction is used to call the distribution code, and then it can be determined that the transaction is a query transaction.
  • step 612 the blockchain node determines the business contract invoked by the historical transaction according to the to field of the historical transaction recorded in the query transaction.
  • Step 614 the blockchain node invokes the business contract.
  • Step 616 The business contract determines user B's query authority according to the from field of the query transaction and the from field of the historical transaction.
  • the identity information of the inquiring party and the initiator of the historical transaction are jointly used as the basis for permission control as an example.
  • the permission control rules (defined in the business contract in the form of permission control codes) record the query group and the queried group, and members belonging to the query group are allowed to view the private data of the queried group members; or, directly record in the permission control rules
  • Each user can view the corresponding relationship of which other users.
  • the account address is used as the user's identity information.
  • the blockchain node executes the authority control code defined in the business contract to determine according to the account address of the querying party (the content of the from field of the query transaction) and the account address of the initiator of the historical transaction (the content of the from field of the historical transaction) User B's query authority.
  • step 618 the business contract returns the query authority of user B to the blockchain node.
  • step 620 after determining that the query permission of user B is allowed to query, the blockchain node verifies the from field and the to field of the historical transaction.
  • the address of the initiator and the contract address of the business contract recorded in the query transaction are filled in by user B. Therefore, the address of the initiator should be understood as the address of the initiator of the historical transaction declared by user B.
  • the contract The address should be understood as the contract address of the business contract called by the historical transaction declared by user B.
  • the address of the actual initiator of the historical transaction is not necessarily the address of the initiator declared by user B
  • the contract address of the business contract actually called by the historical transaction is not necessarily the address of the contract declared by user B, that is, user B forged Possible.
  • user B can deploy a business contract on the blockchain by deploying a business contract as described above.
  • the permission control code defined in the business contract allows user B to view user A’s private data; then, user B can change
  • the contract address of the business contract invoked by the historical transaction initiated by the user A is filled in as the contract address of the aforementioned business contract deployed by the user B. Therefore, when it is determined that the query permission of user B is allowed to query, the blockchain node can further verify the address of the initiator of the historical transaction declared by user B and the contract address, thereby ensuring the security of private data.
  • the blockchain node After the blockchain node determines that user B's query permission is allowed to query, it can obtain historical transactions from the blockchain according to the hash value of the historical transaction (the certificate is stored on the blockchain), and read The content recorded in the from field of historical transactions and the to field of historical transactions. If the content of the read from field is the same as the content of the from field declared in the query transaction, the operation of obtaining private data can be further performed; otherwise, the obtaining is prohibited Operation of private data. In the same way, if the content of the read to field is the same as the content of the to field declared in the query transaction, the operation of obtaining private data can be further performed; otherwise, the operation of obtaining private data is prohibited.
  • the above verification step is an unnecessary operation, so there is no need to perform the above verification step, thereby reducing the occupation of the processing resources of the blockchain node. In turn, the performance of blockchain nodes is improved.
  • a contract receipt regarding user B's forbidden to query private data can be generated for user B to view.
  • the blockchain node returns to user B a query-forbidden receipt to inform user B that the query permission is forbidden to query.
  • step 622 the blockchain node obtains private data.
  • step 624 the blockchain node reads the private data into the TEE for decryption.
  • private data is encrypted and stored.
  • the encryption method used is also different. Therefore, after obtaining the private data (for example, obtaining the private data according to the hash value of the historical transaction), the obtained private data can be read into the trusted execution environment for decryption, so as to be obtained by the inquiring party.
  • both historical transactions and transaction receipts of historical transactions are encrypted with the symmetric key used by the initiator of the historical transaction. Therefore, after obtaining the historical transaction and/or transaction receipt of the historical transaction, the symmetric key used by user A can be obtained first, and then the transaction receipt of the historical transaction and/or historical transaction can be decrypted by the symmetric key in the TEE .
  • the symmetric key used to encrypt historical transactions (the symmetric key is encrypted by the public key used by user A) can be obtained first, and the public key used with user A can be used in the TEE The corresponding private key decrypts the symmetric key to obtain the decrypted symmetric key.
  • the specific symmetric key pair of the blockchain node can be used in the TEE These private data are decrypted.
  • the specific symmetric key can be a seal (Simple Encrypted Arithmetic Library) key, which can be sent to the blockchain node by the key management server after being remotely attested, or it can be between each blockchain node After negotiation, the blockchain node uses the seal key to encrypt and decrypt private data.
  • the key management server sends the symmetric key to the blockchain node, or the symmetric key negotiated between the various blockchain nodes may not be the above-mentioned seal key, but the root key (root key). ), and the above-mentioned seal key may be a derived key of the root key.
  • the root key can irreversibly derive several versions of derived keys in turn, and any two adjacent keys can irreversibly derive a low version key from a higher version key, thereby forming a chained key Derivative structure.
  • the root key and the version factor 0xFF the decimal value is 255, that is, the version number of the key that needs to be generated; of course, You can also use other values
  • hash calculation to obtain the key key-255 with the version number 255; by hashing the key key-255 and the version factor 0xFE, the key key- with the version number 254 is obtained. 254; ...
  • the key key-0 By hashing the key key-1 and the version factor 0x00, the key key-0 with the version number of 0 is obtained. 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 key-0 can be calculated from the key key-1 and the version factor 0x00, but the key cannot be passed through the key. -0 and version factor 0x00 deduces the key key-1.
  • a certain version of the derived key can be designated as the above-mentioned seal key to encrypt private data.
  • the seal key can also be version updated, and based on the above-mentioned features, it should be updated from the lower version key to the higher version key, so that even if the lower version key is leaked, the higher version key cannot be reversed. Version key to ensure sufficient data security.
  • step 626 the blockchain node uses the user B's symmetric key to encrypt the private data.
  • Step 628 User B views the private data.
  • the blockchain node after the blockchain node encrypts the private data, it can generate an event containing the private data and store it in the blockchain log. Then, user B can use the client to use the callback mechanism of the blockchain to Obtain the event to view the private data. After obtaining the private data, the user B uses the symmetric key used by the client to decrypt the private data to obtain the private data of the plaintext content.
  • the blockchain node after the blockchain node encrypts the private data, it can directly return the encrypted private data to the client used by the user B.
  • user B uses the symmetric key used by the client to decrypt the private data to obtain the private data of the plaintext content.
  • the query transaction created by user B contains the hash value, from field, and to field of the historical transaction. According to the above analysis, it can be seen that the query transaction can also only include the hash value of the historical transaction. , There is no need to write the contents of the from and to fields. Description will be given below in conjunction with FIG. 7. As shown in Fig. 7, the process of user B as the inquiring party inquiring about private data may include the following steps.
  • step 702 the user B creates a query transaction through the client terminal used.
  • the to field of the query transaction records the specific calling address of the distribution code, and the hash value (ie transaction ID) of the historical transaction can also be recorded in the data field (or other fields) of the query transaction.
  • the hash value of historical transactions can be obtained by offline sharing between user B and user A, or obtained by any other means.
  • step 704 the user B uses the digital envelope encryption to query the transaction through the client.
  • Step 706 User B initiates a query transaction to the blockchain node through the client.
  • step 708 the blockchain node decrypts the query transaction in the TEE.
  • step 710 the blockchain node determines that the received transaction is a query transaction.
  • the blockchain node after receiving any transaction, the blockchain node reads the content of the to field of the transaction.
  • the content of the to field is the specific calling address of the distribution code, it means that the transaction is used to call the distribution code, and then it can be determined that the transaction is a query transaction.
  • Step 712 the blockchain node obtains the from field and to field of the historical transaction according to the hash value.
  • 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 of the business contract invoked by the historical transaction address.
  • Step 714 The blockchain node determines the business contract invoked by the historical transaction according to the to field of the historical transaction.
  • step 716 the blockchain node invokes the business contract.
  • step 718 the business contract determines the query authority of the user B according to the from field of the query transaction and the from field of the historical transaction.
  • the identity information of the inquiring party and the initiator of the historical transaction are jointly used as the basis for permission control as an example.
  • the permission control rules (defined in the business contract in the form of permission control codes) record the query group and the queried group, and members belonging to the query group are allowed to view the private data of the queried group members; or, directly record in the permission control rules
  • Each user can view the corresponding relationship of which other users.
  • the account address is used as the user's identity information.
  • the blockchain node executes the authority control code defined in the business contract to determine according to the account address of the querying party (the content of the from field of the query transaction) and the account address of the initiator of the historical transaction (the content of the from field of the historical transaction) User B's query authority.
  • Step 720 The business contract returns user B's query authority to the blockchain node.
  • Step 722 When the query permission of user B is allowed to query, the blockchain node obtains private data.
  • a contract receipt regarding user B's forbidden to query private data can be generated for user B to view.
  • the blockchain node returns to user B a query-forbidden receipt to inform user B that the query permission is forbidden to query.
  • step 724 the blockchain node reads the private data into the TEE for decryption.
  • step 726 the blockchain node uses the user B's symmetric key to encrypt the private data.
  • step 712 the process of obtaining historical transactions and decrypting historical transactions is executed when step 712 is executed, that is, obtaining historical transactions according to the hash value of historical transactions, and decrypting historical transactions to obtain historical transaction information. Clear text transaction content, so as to read the from field and to field of historical transactions. Therefore, in this case, when it is determined that the query permission is allowed to query, (no need to perform the operations of obtaining historical transactions and decrypting historical transactions) directly obtain the decrypted historical transactions for the querying party to view.
  • step 728 user B views the private data.
  • this specification also provides an embodiment of a permission query configuration device based on a chain code.
  • the embodiment of the permission query configuration device based on chain code in this specification can be applied to electronic equipment.
  • the device embodiments can be implemented by software, or can be implemented by hardware or a combination of software and hardware. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory through the processor of the electronic device where it is located.
  • FIG. 8 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • the device includes a processor 802, an internal bus 804, a network interface 806, a memory 808, and a non-volatile memory 810.
  • the processor 802 reads the corresponding computer program from the non-volatile memory 810 to the memory 808 and then runs it to form a chain code-based permission query configuration device at the logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each
  • the logic unit can also be a hardware or a logic device.
  • the configuration device is applied to a blockchain node and may include the following units.
  • the first update unit 91 reads the obtained distribution code into the trusted execution environment to update the chain code maintained in the trusted execution environment.
  • the business contract called by the historical exchange is called to execute the authority control code defined in the business contract, and the inquiry authority of the inquirer is determined.
  • 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 distributed code in the trusted execution environment according to the verification report.
  • a specific calling address is configured for the distribution code; the device further includes: a transaction identification unit 93, when the distribution code is called by any transaction received through the specific calling address, the any One transaction is used as a query transaction.
  • a second update unit 94 which updates the chain code maintained in the trusted execution environment according to the obtained new version of the chain code, and the new version of the chain code is used to update the chain code according to the query transaction
  • the included transaction identifier obtains the historical transaction, and determines the business contract invoked by the historical transaction based on the historical transaction;
  • the distribution code is used to call the business contract determined by executing the new version of the chain code to execute the permission control code defined in the called business contract.
  • the distribution code is used to determine the corresponding business contract according to the contract address of the business contract called by the historical transaction contained in the query transaction, and call the determined business contract to execute the corresponding authority control code to Determine the query authority of the query party;
  • the device further includes: a third update unit 95, which updates the chain code maintained in the trusted execution environment according to the obtained new version chain code, the new version chain code It is used to obtain the historical transaction according to the transaction identifier contained in the query transaction when it is determined through the business contract that the query authority of the querying party is allowed to query, and to determine the actual call of the historical transaction according to the acquired historical transaction
  • the contract address of the business contract and when the determined contract address is inconsistent with the contract address included in the query transaction, it is determined that the query authority of the query party is forbidden to query.
  • the new version of the chain code is also used to obtain the decrypted private data for viewing by the querying party when it is determined that the querying authority of the querying party is allowed to query, and the private data is read Enter the trusted execution environment for decryption.
  • the privacy data includes at least one of the following: the historical transaction, the transaction receipt corresponding to the historical transaction, the account attribute information of the initiator of the historical transaction, and the information of the business contract invoked by the historical transaction Account attribute information, contract code of the business contract, and contract status data of the business contract.
  • FIG. 10 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • the device includes a processor 1002, an internal bus 1004, a network interface 1006, a memory 1008, and a non-volatile memory 1010, and of course, it may also include hardware required for other services.
  • the processor 1002 reads the corresponding computer program from the non-volatile memory 1010 to the memory 1008 and then runs it to form a private data query device on a logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each
  • the logic unit can also be a hardware or a logic device.
  • the query device is applied to a blockchain node, and may include:
  • the code reading unit 1101 when receiving a query transaction of private data related to historical transactions submitted by the querying party, reads the distribution code maintained in the trusted execution environment, where the distribution code belongs to the maintenance in the trusted execution environment Part of the chain code;
  • the authority determining unit 1102 executes the distribution code in the trusted execution environment to determine the query authority of the query party according to the authority control code defined in the business contract called by the historical transaction;
  • a typical implementation device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a cell phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Any combination of these devices.
  • the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • This specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • the computer includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
  • the memory may include non-permanent 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).
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, 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, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein can be interpreted as "when” or “when” or "in response to determination”.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Accounting & Taxation (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Medical Informatics (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Procédé et appareil de configuration de requête d'autorisation basés sur un code de chaîne. Le procédé est appliqué à un nœud de chaîne de blocs et peut consister à : lire un code de distribution acquis dans un environnement d'exécution de confiance, de façon à mettre à jour un code de chaîne conservé dans l'environnement d'exécution de confiance, le code de distribution étant utilisé pour appeler, lorsqu'une transaction de requête d'une partie requête pour des données privées relatives à une transaction historique est reçue, un contrat de service, qui est appelé par la transaction historique, de façon à exécuter un code de commande d'autorisation défini dans le contrat de service, et à déterminer une autorisation de requête de la partie requête (402A) ; et lorsqu'une requête de vérification initiée par une partie contestation pour le code de distribution est reçue, lire le code de distribution conservé dans l'environnement d'exécution de confiance pour générer un rapport de vérification, et envoyer le rapport de vérification à la partie contestation, de telle sorte que la partie contestation vérifie le code de distribution dans l'environnement d'exécution de confiance en fonction du rapport de vérification (404A).
PCT/CN2020/117001 2019-11-08 2020-09-23 Procédé et appareil de configuration de requête d'autorisation basés sur un code de chaîne WO2021088549A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911085167.1 2019-11-08
CN201911085167.1A CN110580412B (zh) 2019-11-08 2019-11-08 基于链代码的权限查询配置方法及装置

Publications (1)

Publication Number Publication Date
WO2021088549A1 true WO2021088549A1 (fr) 2021-05-14

Family

ID=68815544

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/117001 WO2021088549A1 (fr) 2019-11-08 2020-09-23 Procédé et appareil de configuration de requête d'autorisation basés sur un code de chaîne

Country Status (2)

Country Link
CN (2) CN110580412B (fr)
WO (1) WO2021088549A1 (fr)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113495924A (zh) * 2021-06-28 2021-10-12 成都金融梦工场投资管理有限公司 一种基于区块链的可防伪数据安全共享方法
CN113595732A (zh) * 2021-06-11 2021-11-02 上海淇玥信息技术有限公司 一种智能合约交互方法、装置和电子设备
CN114244851A (zh) * 2021-12-24 2022-03-25 四川启睿克科技有限公司 一种基于区块链的数据分发方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110580412B (zh) * 2019-11-08 2020-03-06 支付宝(杭州)信息技术有限公司 基于链代码的权限查询配置方法及装置
JP6830635B1 (ja) * 2020-02-21 2021-02-17 株式会社LayerX データ管理方法
CN111090875B (zh) * 2020-03-18 2020-10-02 支付宝(杭州)信息技术有限公司 部署合约的方法及装置
CN111092727B (zh) * 2020-03-18 2020-07-17 支付宝(杭州)信息技术有限公司 共享集群密钥的方法及装置
CN111090874B (zh) * 2020-03-18 2020-09-01 支付宝(杭州)信息技术有限公司 调用合约的方法及装置
CN111090876B (zh) * 2020-03-18 2020-07-17 支付宝(杭州)信息技术有限公司 调用合约的方法及装置
CN113015973B (zh) * 2020-06-17 2023-08-11 达闼机器人股份有限公司 数据处理方法、存储介质、电子设备及数据交易系统
CN114327759A (zh) * 2021-07-06 2022-04-12 支付宝(杭州)信息技术有限公司 区块链数据的处理方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106920169A (zh) * 2017-03-07 2017-07-04 中钞信用卡产业发展有限公司北京智能卡技术研究院 一种基于区块链和数字货币的数字票据交易方法及系统
CN109408461A (zh) * 2018-09-14 2019-03-01 中国农业大学 一种区块链的分布式存储系统及方法
CN109523385A (zh) * 2018-12-07 2019-03-26 深圳市智税链科技有限公司 在区块链网络中查询交易信息的方法、记账节点和介质
US20190173667A1 (en) * 2016-12-23 2019-06-06 Cloudminds (Shenzhen) Robotics Systems Co., Ltd. Block generation method, device and blockchain network
CN110580412A (zh) * 2019-11-08 2019-12-17 支付宝(杭州)信息技术有限公司 基于链代码的权限查询配置方法及装置

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107870788B (zh) * 2016-09-26 2020-10-02 展讯通信(上海)有限公司 多可信执行环境下终端设备的启动方法和终端设备
CN106534097B (zh) * 2016-10-27 2018-05-18 上海亿账通区块链科技有限公司 基于区块链交易的权限管制方法及系统
US10484346B2 (en) * 2017-02-07 2019-11-19 Microsoft Technology Licensing, Llc Establishment of consortium blockchain network
CN107038242B (zh) * 2017-04-24 2020-02-07 杭州趣链科技有限公司 一种面向区块链全局智能合约业务数据解析方法
US20190121669A1 (en) * 2017-10-20 2019-04-25 American Express Travel Related Services Company, Inc. Executing tasks using modular and intelligent code and data containers
US10601911B2 (en) * 2017-11-16 2020-03-24 International Business Machines Corporation Partitioning of a blockchain ledger
CN108632292B (zh) * 2018-05-16 2020-11-17 苏宁易购集团股份有限公司 基于联盟链的数据共享方法和系统
CN109255210A (zh) * 2018-09-27 2019-01-22 上海点融信息科技有限责任公司 在区块链网络中提供智能合约的方法、装置及存储介质
CN109829013A (zh) * 2018-12-27 2019-05-31 上海点融信息科技有限责任公司 用于在区块链网络中运行智能合约的方法、存储介质、计算设备
CN110032883B (zh) * 2019-01-31 2020-05-29 阿里巴巴集团控股有限公司 区块链中实现隐私保护的方法、系统和节点
CN111901402A (zh) * 2019-02-19 2020-11-06 创新先进技术有限公司 区块链中实现隐私保护的方法、节点和存储介质
CN110049111A (zh) * 2019-03-27 2019-07-23 厦门大学 一种基于区块链技术的工业控制系统远程指令控制方法
CN110245945B (zh) * 2019-05-20 2021-03-23 创新先进技术有限公司 结合代码标注与用户类型的收据存储方法和节点
CN113240519A (zh) * 2019-05-30 2021-08-10 创新先进技术有限公司 基于区块链的智能合约管理方法及装置、电子设备
CN110321721B (zh) * 2019-07-02 2021-03-30 石家庄铁道大学 基于区块链的电子病历访问控制方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190173667A1 (en) * 2016-12-23 2019-06-06 Cloudminds (Shenzhen) Robotics Systems Co., Ltd. Block generation method, device and blockchain network
CN106920169A (zh) * 2017-03-07 2017-07-04 中钞信用卡产业发展有限公司北京智能卡技术研究院 一种基于区块链和数字货币的数字票据交易方法及系统
CN109408461A (zh) * 2018-09-14 2019-03-01 中国农业大学 一种区块链的分布式存储系统及方法
CN109523385A (zh) * 2018-12-07 2019-03-26 深圳市智税链科技有限公司 在区块链网络中查询交易信息的方法、记账节点和介质
CN110580412A (zh) * 2019-11-08 2019-12-17 支付宝(杭州)信息技术有限公司 基于链代码的权限查询配置方法及装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113595732A (zh) * 2021-06-11 2021-11-02 上海淇玥信息技术有限公司 一种智能合约交互方法、装置和电子设备
CN113595732B (zh) * 2021-06-11 2024-03-19 上海淇玥信息技术有限公司 一种智能合约交互方法、装置和电子设备
CN113495924A (zh) * 2021-06-28 2021-10-12 成都金融梦工场投资管理有限公司 一种基于区块链的可防伪数据安全共享方法
CN113495924B (zh) * 2021-06-28 2024-06-07 成都金融梦工场投资管理有限公司 一种基于区块链的可防伪数据安全共享方法
CN114244851A (zh) * 2021-12-24 2022-03-25 四川启睿克科技有限公司 一种基于区块链的数据分发方法
CN114244851B (zh) * 2021-12-24 2023-07-07 四川启睿克科技有限公司 一种基于区块链的数据分发方法

Also Published As

Publication number Publication date
CN110580412B (zh) 2020-03-06
CN110580412A (zh) 2019-12-17
CN111523110A (zh) 2020-08-11
CN111523110B (zh) 2023-05-02

Similar Documents

Publication Publication Date Title
WO2021088547A1 (fr) Procédé et appareil d'interrogation de données privées de compte basés sur une chaîne de blocs
WO2021088546A1 (fr) Procédé et dispositif d'interrogation de données de confidentialité basés sur un compte de chaîne de blocs
WO2021088548A1 (fr) Procédé et appareil d'interrogation de données de confidentialité sur la base d'un contrat intelligent
WO2021088536A1 (fr) Procédé et appareil d'interrogation de données privées basés sur une autorisation hors chaîne
WO2021088549A1 (fr) Procédé et appareil de configuration de requête d'autorisation basés sur un code de chaîne
WO2021082664A1 (fr) Procédé et appareil d'interrogation de données de confidentialité de chaîne de blocs
WO2020238255A1 (fr) Procédé et appareil de gestion de contrat intelligent en fonction d'une chaîne de blocs et dispositif électronique
WO2021179743A1 (fr) Procédé et appareil d'interrogation d'informations de confidentialité de compte dans une chaîne de blocs
WO2021184963A1 (fr) Procédé et appareil d'appel de contrat
WO2021184975A1 (fr) Procédé et appareil de calcul de confidentialité hors chaîne pour données en chaîne
WO2021088533A1 (fr) Procédé et dispositif de partage de données privées
WO2021103794A1 (fr) Procédé permettant de réaliser une transaction de préservation de la vie privée hautement efficace dans une chaîne de blocs, et dispositif
WO2021088535A1 (fr) Procédé et dispositif d'interrogation de données privées basés sur un contrat intelligent
WO2021184970A1 (fr) Procédé et dispositif pour un appel de contrat
WO2021088543A1 (fr) Procédé et appareil de configuration d'interrogation d'autorisation basée sur un contrat intelligent
WO2020233631A1 (fr) Procédé et nœud de stockage de reçu basés sur le type de transaction
WO2020233625A1 (fr) Procédé de stockage de reçus combinant un type d'utilisateur, des conditions de détermination et un nœud
WO2020233635A1 (fr) Procédé de stockage de reçu combinant des restrictions conditionnelles de multiples types de dimensions et nœud
WO2020233628A1 (fr) Procédé et nœud de stockage de reçu basés sur une combinaison d'un type de fonction d'événement et d'une condition d'évaluation
WO2020233619A1 (fr) Procédé et nœud de stockage de reçu en combinaison avec un type d'utilisateur et un type de transaction
WO2020233624A1 (fr) Procédé de mémorisation de reçus et nœud utilisant un type de transaction en combinaison avec un type de fonction d'événement
WO2020233627A1 (fr) Procédé et nœud de stockage de reçu basés sur de multiples types de dimensions
WO2020233632A1 (fr) Procédé et nœud de stockage de reçu basés sur un type de fonction d'événement
WO2020233633A1 (fr) Procédé de stockage de reçus et nœud basé sur une condition de détermination

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20885684

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20885684

Country of ref document: EP

Kind code of ref document: A1