+

CN110602138B - Data processing method and device for block chain network, electronic equipment and storage medium - Google Patents

Data processing method and device for block chain network, electronic equipment and storage medium Download PDF

Info

Publication number
CN110602138B
CN110602138B CN201910919440.XA CN201910919440A CN110602138B CN 110602138 B CN110602138 B CN 110602138B CN 201910919440 A CN201910919440 A CN 201910919440A CN 110602138 B CN110602138 B CN 110602138B
Authority
CN
China
Prior art keywords
key
white
transaction
node
box
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910919440.XA
Other languages
Chinese (zh)
Other versions
CN110602138A (en
Inventor
温伟力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911298223.XA priority Critical patent/CN110933108B/en
Priority to CN201910919440.XA priority patent/CN110602138B/en
Publication of CN110602138A publication Critical patent/CN110602138A/en
Application granted granted Critical
Publication of CN110602138B publication Critical patent/CN110602138B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/16Obfuscation or hiding, e.g. involving white box
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a data processing method, a data processing device, electronic equipment and a storage medium of a block chain network; the method comprises the following steps: receiving an original key sent by a client through an intelligent contract in a node of a block chain network, and calling a white box key library deployed in the node to generate a white box key corresponding to the original key in the white box key library; receiving a transaction submitted by a client for updating data, and packaging the received transaction into a new block; carrying out consensus verification on the new blocks; when the consensus verification passes, calling the white-box key library deployed in the node to symmetrically encrypt the new block based on the white-box key, and updating the account book of the node through the new block symmetrically encrypted by the white-box key. The method and the device can ensure the safety of the sensitive data uplink.

Description

区块链网络的数据处理方法、装置、电子设备及存储介质Data processing method, device, electronic device and storage medium of blockchain network

技术领域technical field

本发明涉及区块链技术,尤其涉及一种区块链网络的数据处理方法、装置、电子设备及存储介质。The present invention relates to block chain technology, in particular to a data processing method, device, electronic device and storage medium of a block chain network.

背景技术Background technique

区块链网络从最初被设计用来进行加密数字货币的交易,到目前已经发展为支持各种应用场景的通用性的服务,例如依托于云端服务的链即服务平台(BaaS,Blockchainas a Service),通过在区块链网络中部署的智能合约,可以对支持客户端以提交交易的形式上链数据、针对数据进行业务逻辑相关的处理和查询链上的数据,并在这个过程中实现数据的不可篡改和可追溯的特性,因而在不同行业中得到日益普遍地使用。The blockchain network was originally designed to conduct encrypted digital currency transactions, and has now developed into a universal service supporting various application scenarios, such as a chain-as-a-service platform (BaaS, Blockchain as a Service) relying on cloud services. , through the smart contract deployed in the blockchain network, it is possible to support the client to upload the data in the form of submitting transactions, perform business logic-related processing for the data, and query the data on the chain, and realize the data in the process. Non-tamperable and traceable properties are increasingly used in different industries.

敏感数据是出于各种安全原因而只能向接入区块链网络的部分客户端(而非全部客户端)公开的数据,例如涉及个人信息、商业机密等情况的数据。Sensitive data is data that can only be disclosed to some (but not all) clients accessing the blockchain network for various security reasons, such as data involving personal information, business secrets, etc.

实际应用中会遇到上链敏感数据的场景,由于敏感数据在区块链网络中是分布式存储的,为了保证敏感数据的安全,相关技术采用了将敏感数据的摘要上链的方案以代替直接将敏感数据上链的方案,这就导致区块链网络只能向客户端提供敏感数据校验的功能,但是不能直接提供可靠的敏感数据,对客户端的基于敏感数据的应用造成较大的限制,因为客户端不得不转向其他数据库或文件系统去获取敏感数据并进行校验,而如果采用将敏感数据采用对称加密或不对称加密并上链的方案,则当密钥泄露时敏感数据的安全性无法得到保证。In practical applications, there will be scenarios where sensitive data is uploaded on the chain. Since sensitive data is stored in a distributed manner in the blockchain network, in order to ensure the security of sensitive data, the related technology adopts the scheme of uploading the summary of sensitive data to the chain instead of The scheme of directly uploading sensitive data to the chain results in that the blockchain network can only provide the client with the function of verifying sensitive data, but cannot directly provide reliable sensitive data, which will cause great harm to the client's application based on sensitive data. Limitation, because the client has to turn to other databases or file systems to obtain sensitive data and verify it, and if the sensitive data is encrypted with symmetric or asymmetric encryption and uploaded to the chain, when the key is leaked, the sensitive data will be lost. Security cannot be guaranteed.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种区块链网络的数据处理方法、装置、电子设备及存储介质,能够有效保证敏感数据上链的安全性。The embodiments of the present invention provide a data processing method, device, electronic device and storage medium of a blockchain network, which can effectively ensure the security of sensitive data on the chain.

本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is realized as follows:

本发明实施例提供一种区块链网络的数据处理方法,包括:Embodiments of the present invention provide a data processing method for a blockchain network, including:

通过区块链网络的节点中的智能合约,接收客户端发送的原始密钥,并调用所述节点中部署的白盒密钥库,以在所述白盒密钥库中生成对应所述原始密钥的白盒密钥;Through the smart contract in the node of the blockchain network, the original key sent by the client is received, and the white-box keystore deployed in the node is called to generate a corresponding original key in the white-box keystore. the white-box key for the key;

接收所述客户端提交的用于进行数据的更新操作的交易,将所述接收的交易打包为新区块;Receive the transaction for performing the data update operation submitted by the client, and package the received transaction into a new block;

对所述新区块进行共识验证;Perform consensus verification on the new block;

当共识验证通过时,调用所述节点中部署的所述白盒密钥库,以通过以下方式对所述新区块进行对称加密:通过所述白盒密钥和白盒密钥算法,对所述新区块中的交易进行对称加密,以替换所述新区块中原有的交易;从所述新区块的交易中读取所述更新操作的键值对数据,通过所述白盒密钥和所述白盒密钥算法对所述键值对数据进行对称加密;When the consensus verification is passed, the white-box keystore deployed in the node is called to perform symmetric encryption on the new block in the following way: through the white-box key and the white-box key algorithm, all The transaction in the new block is symmetrically encrypted to replace the original transaction in the new block; the key-value pair data of the update operation is read from the transaction in the new block, and the key-value pair data of the update operation is read from the transaction of the new block, and the The white-box key algorithm performs symmetric encryption on the key-value pair data;

通过被所述白盒密钥对称加密的新区块更新所述节点的账本。The node's ledger is updated with a new block symmetrically encrypted by the white-box key.

本发明实施例提供一种区块链网络的数据处理装置,包括:An embodiment of the present invention provides a data processing device for a blockchain network, including:

部署在区块链网络的节点中的智能合约、白盒密钥库和共识服务;其中,Smart contracts, white-box keystores and consensus services deployed in nodes of a blockchain network; among them,

所述智能合约,用于接收客户端发送的原始密钥,并调用所述节点中部署的所述白盒密钥库,以在所述白盒密钥库中生成对应所述原始密钥的白盒密钥;The smart contract is used to receive the original key sent by the client, and call the white-box keystore deployed in the node to generate a key corresponding to the original key in the white-box keystore. white box key;

所述智能合约,用于接收所述客户端提交的用于进行数据的更新操作的交易,调用所述共识服务执行以下操作:将所述接收的交易打包为新区块,并对所述新区块进行共识验证;The smart contract is configured to receive a transaction submitted by the client for performing a data update operation, and invoke the consensus service to perform the following operations: package the received transaction into a new block, and perform the following operations on the new block. Perform consensus verification;

所述智能合约,用于当共识验证通过时,调用所述白盒密钥库以基于所述白盒密钥对所述新区块进行对称加密,并调用所述共识服务,以通过被所述白盒密钥对称加密的新区块更新所述节点的账本。The smart contract is used to call the white-box keystore to symmetrically encrypt the new block based on the white-box key when the consensus verification is passed, and call the consensus service to pass the The new block encrypted with the white-box key symmetric updates the node's ledger.

上述方案中,所述智能合约还用于调用所述节点中部署的白盒密钥库,以生成对应所述原始密钥的白盒密钥时,采用以下实现方式:调用所述节点中的白盒密钥库,以进行以下操作:根据所述原始密钥中各个字段的取值,确定与所述原始密钥对应的变换方式;根据所述确定的变换方式对所述原始密钥进行变换得到对应的白盒密钥。In the above solution, when the smart contract is also used to call the white-box keystore deployed in the node to generate a white-box key corresponding to the original key, the following implementation method is adopted: calling the white-box key in the node. The white-box key library is used to perform the following operations: determine the transformation mode corresponding to the original key according to the value of each field in the original key; perform the following operations on the original key according to the determined transformation mode. Transform to get the corresponding white-box key.

上述方案中,所述智能合约还用于调用所述节点中的白盒密钥库时,进行以下操作:根据所述原始密钥中各个字段的取值,确定对白盒密钥算法进行变换时所使用的计算方式,以使针对不同的原始密钥对所述白盒密钥算法进行变换时,所使用的计算方式存在差异。In the above solution, when the smart contract is also used to call the white-box keystore in the node, the following operations are performed: according to the values of each field in the original key, it is determined when the white-box key algorithm is transformed The calculation method used is such that when the white-box key algorithm is transformed for different original keys, there are differences in the calculation method used.

上述方案中,所述智能合约还用于接收所述客户端提交的用于进行数据的更新操作的交易时,采用以下实现方式:通过所述节点中的智能合约调用所述节点中的传输密钥库,以进行以下操作:与所述客户端进行基于数字证书的身份验证,并在身份验证通过后进行协商操作,以确定所使用的加密套接字密钥算法和传输密钥;接收所述客户端的用于进行数据的更新操作的交易,所述交易被所述客户端通过所述加密套接字密钥算法和所述传输密钥进行了对称加密。In the above solution, when the smart contract is also used to receive the transaction submitted by the client for performing the data update operation, the following implementation method is adopted: calling the transmission secret in the node through the smart contract in the node. keystore to perform the following operations: perform digital certificate-based authentication with the client, and perform a negotiation operation after the authentication is passed to determine the encrypted socket key algorithm and transmission key used; receive all A transaction of the client for performing a data update operation, the transaction is symmetrically encrypted by the client through the encrypted socket key algorithm and the transmission key.

上述方案中,所述智能合约还用于调用共识服务将所述接收的交易打包为新区块时,采用以下实现方式:将对应所述区块链网络中每个通道接收的多个交易,按照所述多个交易的时间戳进行排序,并打包为相应通道的新区块。In the above solution, when the smart contract is also used to call the consensus service to package the received transaction into a new block, the following implementation method is adopted: the multiple transactions corresponding to each channel received in the blockchain network are The timestamps of the multiple transactions are sorted and packaged into new blocks for the corresponding channels.

上述方案中,所述智能合约还用于调用共识服务对所述新区块进行共识验证,采用以下实现方式:对所述新区块中的交易进行以下的验证操作:交易格式正确;数字签名合法;符合背书策略;接收到所述新区块的节点加入了所述交易中所指示的通道。In the above scheme, the smart contract is also used to call the consensus service to perform consensus verification on the new block, and the following implementation methods are adopted: perform the following verification operations on the transactions in the new block: the transaction format is correct; the digital signature is legal; The endorsement policy is complied with; the node that received the new block joins the channel indicated in the transaction.

上述方案中,所述智能合约还用于调用传输密钥库进行协商操作,以确定所使用的加密套接字密钥算法和传输密钥时,采用以下实现方式:与所述客户端之间传输通过超文本传输安全协议的握手消息,以通过所述握手操作消息使所述节点和所述客户端均获得相同的随机数和加密套接字密钥算法,并通过所述加密套接字密钥算法对所述随机数进行对称加密得到所述传输密钥。In the above solution, when the smart contract is also used to call the transmission key store for negotiation operation to determine the encrypted socket key algorithm and transmission key used, the following implementation methods are adopted: transmits a handshake message through the Hypertext Transport Security Protocol, so that both the node and the client obtain the same random number and encrypted socket key algorithm through the handshake operation message, and pass the encrypted socket The key algorithm performs symmetric encryption on the random number to obtain the transmission key.

上述方案中,所述智能合约还用于调用白盒密钥库以基于所述白盒密钥对所述新区块进行对称加密时,采用以下实现方式:调用所述节点中的白盒密钥库,以执行以下操作:通过所述白盒密钥和白盒密钥算法,对所述新区块中的交易进行对称加密,以替换所述新区块中原有的交易;从所述新区块的交易中,读取所述更新操作的键值对数据,通过所述白盒密钥和所述白盒密钥算法对所述键值对数据进行对称加密。In the above solution, when the smart contract is also used to call the white-box key store to perform symmetric encryption on the new block based on the white-box key, the following implementation method is adopted: calling the white-box key in the node The library is used to perform the following operations: symmetrically encrypt the transactions in the new block through the white-box key and the white-box key algorithm to replace the original transactions in the new block; In the transaction, the key-value pair data of the update operation is read, and the key-value pair data is symmetrically encrypted by the white-box key and the white-box key algorithm.

上述方案中,所述智能合约还用于调用白盒密钥库以对所述新区块中的交易进行对称加密之前,调用所述节点中的传输密钥库,以通过加密套接字密钥算法和传输密钥对所述新区块中的交易进行解密;其中,所述新区块中交易被所述客户端通过所述加密套接字密钥算法和所述传输密钥进行了对称加密。In the above solution, the smart contract is also used to call the transmission key store in the node before calling the white box key store to symmetrically encrypt the transactions in the new block to encrypt the socket key. The algorithm and the transmission key decrypt the transactions in the new block; wherein the transactions in the new block are symmetrically encrypted by the client through the encrypted socket key algorithm and the transmission key.

上述方案中,所述智能合约还用于调用白盒密钥库,以通过所述白盒密钥和白盒密钥算法,对所述新区块中的交易进行对称加密时,采用以下实现方式:通过所述白盒密钥以及所述白盒密钥算法,对所述交易的明文形式的二进制数据进行映射,并根据对所述白盒密钥算法进行变换使用的计算方式,对所述映射进行变换,以得到对应所述交易的密文形式的二进制数据。In the above solution, the smart contract is also used to call the white-box keystore, so that the following implementation methods are used to symmetrically encrypt the transactions in the new block through the white-box key and the white-box key algorithm. : Map the binary data in the plaintext form of the transaction through the white-box key and the white-box key algorithm, and according to the calculation method used for transforming the white-box key algorithm, the The mapping is transformed to obtain binary data in ciphertext form corresponding to the transaction.

上述方案中,所述智能合约还用于调用白盒密钥库,以通过所述白盒密钥和白盒密钥库对所述键值对数据进行对称加密时,采用以下实现方式:通过所述白盒密钥以及所述白盒密钥算法对所述键值对数据的明文形式的二进制数据进行映射,并根据对所述白盒密钥算法进行变换使用的计算方式,对所述映射进行变换,以得到对应所述键值对数据的密文形式的二进制数据。In the above solution, the smart contract is also used to call the white-box key store, so that the key-value pair data is symmetrically encrypted by the white-box key and the white-box key store, and the following implementation methods are adopted: The white-box key and the white-box key algorithm map the plaintext binary data of the key-value pair data, and according to the calculation method used for transforming the white-box key algorithm, the The mapping is transformed to obtain binary data in the form of ciphertext corresponding to the key-value pair data.

上述方案中,所述智能合约还用于调用共识服务,以通过被所述白盒密钥对称加密的新区块更新所述节点的账本时,采用以下实现方式:将通过所述白盒密钥和白盒密钥算法对称加密的新区块,添加到所述节点的账本中的区块链的尾部;将所述新区块的交易中对应所述更新操作的键值对数据,更新到所述节点的账本中的状态数据库,其中,所述键值对数据被所述白盒密钥和白盒密钥算法进行了对称加密。In the above solution, the smart contract is also used to invoke a consensus service to update the ledger of the node through a new block symmetrically encrypted by the white-box key, using the following implementation method: A new block symmetrically encrypted with the white-box key algorithm is added to the end of the blockchain in the ledger of the node; the key-value pair data corresponding to the update operation in the transaction of the new block is updated to the A state database in a node's ledger, wherein the key-value pair data is symmetrically encrypted by the white-box key and the white-box key algorithm.

上述方案中,所述智能合约还用于接收客户端发送的原始密钥之前,当所述节点中的智能合约的实例部署完成时,接收所述客户端提交的包括白盒密钥库和传输密钥库的交易,并调用所述节点中的链码服务,以将所述白盒密钥库和所述传输密钥库部署到所述节点的虚拟化运行环境中;或者,响应于所述客户端提交的用于部署智能合约镜像文件的交易,调用所述节点中的链码服务,以将所述智能合约镜像文件中包括的智能合约、白盒密钥库和传输密钥库部署到所述节点的虚拟化运行环境中。In the above solution, before the smart contract is also used to receive the original key sent by the client, when the instance of the smart contract in the node is deployed, receive the white-box keystore and transmission submitted by the client. keystore transaction, and invoke the chaincode service in the node to deploy the white-box keystore and the transport keystore into the virtualized runtime environment of the node; or, in response to the The transaction submitted by the client for deploying the smart contract image file, and the chaincode service in the node is called to deploy the smart contract, white box keystore and transmission keystore included in the smart contract image file. into the virtualized operating environment of the node.

上述方案中,所述智能合约还用于调用共识服务接收所述客户端提交的用于进行数据的查询操作的交易提案;调用所述共识服务,以针对所述节点的账本中的状态数据库执行所述查询操作,得到对应的键值对数据;通过所述交易提案携带的所述原始密钥,调用所节点中的白盒密钥库,以对所述原始密钥进行变换得到所述白盒密钥,并通过所述白盒密钥对所述查询到的键值对数据进行解密;调用所述节点中的传输密钥库,以通过传输密钥和加密套接字密钥算法对所述解密后的键值对数据进行对称加密;调用所述共识服务,将所述加密后的键值对数据构造为提案响应,并返回所述客户端。In the above solution, the smart contract is also used to call the consensus service to receive the transaction proposal submitted by the client for querying data; call the consensus service to execute against the state database in the node's ledger. The query operation obtains the corresponding key-value pair data; through the original key carried in the transaction proposal, the white-box keystore in the node is called to transform the original key to obtain the white-box. box key, and decrypt the queried key-value data through the white box key; call the transmission key store in the node to pair the transmission key and the encrypted socket key algorithm with the The decrypted key-value pair data is symmetrically encrypted; the consensus service is invoked, the encrypted key-value pair data is constructed as a proposal response, and returned to the client.

上述方案中,所述智能合约还用于调用所述共识服务,以针对所述节点的账本中的状态数据库执行所述查询操作之前,对所述交易提案执行背书验证,所述背书验证包括以下至少之一:所述交易提案携带的数字证书由受信任的认证中心签发;所述交易提案的数字签名有效;所述交易提案的格式正确;所述交易提案没有被重复提交。In the above solution, the smart contract is also used to call the consensus service to perform endorsement verification on the transaction proposal before performing the query operation on the state database in the ledger of the node, and the endorsement verification includes the following: At least one of: the digital certificate carried by the transaction proposal is issued by a trusted certification center; the digital signature of the transaction proposal is valid; the format of the transaction proposal is correct; the transaction proposal has not been submitted repeatedly.

上述方案中,所述智能合约还用于接收所述客户端提交的用于进行数据的更新操作的交易之前,接收所述客户端提交的用于进行数据的更新操作的交易提案,调用所述共识服务执行以下操作:对所述交易提案进行验证通过,验证通过后针对所述节点中账本的状态数据库模拟执行所述更新操作,得到对应的键值对数据;In the above solution, the smart contract is further configured to receive the transaction proposal submitted by the client for updating the data before receiving the transaction for updating the data submitted by the client, and calling the transaction proposal for updating the data. The consensus service performs the following operations: verifies the transaction proposal and passes the verification, and simulates the update operation on the state database of the ledger in the node after the verification is passed to obtain the corresponding key-value pair data;

调用所述节点中的传输密钥库,以通过传输密钥和加密套接字密钥算法对所述键值对数据进行对称加密,构造为提案响应并返回所述客户端,以使所述客户端根据所述交易提案和所述提案响应构造所述交易。Invoke the transport keystore in the node to symmetrically encrypt the key-value pair data with the transport key and encrypted socket key algorithm, construct a proposal response and return to the client to enable the The client constructs the transaction from the transaction proposal and the proposal response.

本发明实施例提供一种运行区块链网络中节点的电子设备,包括:An embodiment of the present invention provides an electronic device for running a node in a blockchain network, including:

存储器,用于存储可执行指令;memory for storing executable instructions;

处理器,用于执行所述存储器中存储的可执行指令时,实现本发明实施例提供的区块链网络的数据处理方法。The processor is configured to implement the data processing method of the blockchain network provided by the embodiment of the present invention when executing the executable instructions stored in the memory.

本发明实施例提供一种存储介质,存储有可执行指令,用于引起处理器执行时,实现本发明实施例提供的区块链网络的数据处理方法。The embodiment of the present invention provides a storage medium storing executable instructions for implementing the data processing method of the blockchain network provided by the embodiment of the present invention when the processor is caused to execute.

本发明实施例具有以下有益效果:The embodiment of the present invention has the following beneficial effects:

通过在区块链网络中部署白盒密钥库以维护对应客户端的白盒密钥,使得客户端需要上链更新的数据能够在不需要原始密钥的情况下进行加密,由于不会泄露原始密钥,即使客户端处于白盒环境中时也能够有效保证原始密钥的安全,保证了敏感数据上链后的安全性,便于客户端直接基于链上的敏感数据进行各种业务逻辑。By deploying a white-box keystore in the blockchain network to maintain the white-box key of the corresponding client, the data that the client needs to be updated on the chain can be encrypted without the original key. The key, even when the client is in a white box environment, can effectively ensure the security of the original key, which ensures the security of sensitive data after being uploaded to the chain, and facilitates the client to directly perform various business logic based on the sensitive data on the chain.

附图说明Description of drawings

图1A是相关技术提供的静态白盒密钥库的原理示意图;1A is a schematic diagram of a static white-box keystore provided by the related art;

图1B是本发明实施例中应用的动态白盒密钥库的原理示意图;1B is a schematic diagram of the principle of a dynamic white-box keystore applied in an embodiment of the present invention;

图2是本发明实施例提供的区块链网络200的示例性的应用系统100的架构示意图;FIG. 2 is a schematic structural diagram of an exemplary application system 100 of a blockchain network 200 provided by an embodiment of the present invention;

图3是本发明实施例提供的基于区块链网络200的交易处理的原理示意图;FIG. 3 is a schematic diagram of the principle of transaction processing based on the blockchain network 200 provided by an embodiment of the present invention;

图4是本发明实施例提供的区块链网络针对非敏感数据的交易处理流程示意图;4 is a schematic diagram of a transaction processing flow of a blockchain network for non-sensitive data provided by an embodiment of the present invention;

图5是本发明实施例提供的区块链网络200中节点的逻辑功能架构示意图;5 is a schematic diagram of a logical functional architecture of a node in a blockchain network 200 provided by an embodiment of the present invention;

图6是本发明实施例提供的运行区块链网络200中的共识节点的电子设备的结构示意图;6 is a schematic structural diagram of an electronic device for running a consensus node in a blockchain network 200 provided by an embodiment of the present invention;

图7是本发明实施例提供的区块链网络的数据处理方法的流程示意图;7 is a schematic flowchart of a data processing method for a blockchain network provided by an embodiment of the present invention;

图8是本发明实施例提供的密钥体系的示意图;8 is a schematic diagram of a key system provided by an embodiment of the present invention;

图9是本发明实施例提供的敏感数据上链的原理示意图。FIG. 9 is a schematic diagram of the principle of uploading sensitive data to the chain according to an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,所描述的实施例不应视为对本发明的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. All other embodiments obtained under the premise of creative work fall within the protection scope of the present invention.

在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same or a different subset of all possible embodiments, and Can be combined with each other without conflict.

除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本发明实施例的目的,不是旨在限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terms used herein are for the purpose of describing the embodiments of the present invention only, and are not intended to limit the present invention.

对本发明实施例进行进一步详细说明之前,对本发明实施例中涉及的名词和术语进行说明,本发明实施例中涉及的名词和术语适用于如下的解释。Before further describing the embodiments of the present invention in detail, the terms and terms involved in the embodiments of the present invention are described. The terms and terms involved in the embodiments of the present invention are applicable to the following explanations.

1)白盒(White Box)攻击,是指攻击者在白盒环境(即对攻击者而言是可见的运行环境,例如智能手机的运行环境有各种客户端,对于攻击者而言是可见的)中能够拥有对设备完全的控制能力,能够观测和更改程序运行时的内部数据。1) White Box attack, which refers to the attacker in the white box environment (that is, the operating environment that is visible to the attacker, for example, the operating environment of a smartphone has various clients, which are visible to the attacker. ) can have complete control over the device, and can observe and change the internal data when the program is running.

2)白盒密钥库,用于在抵御白盒攻击的技术,通过把密钥和用于对称加密的密钥算法(即白盒密钥算法)进行混淆,使得攻击者无法得知具体的加解密流程,防止攻击者在白盒环境中获得原始密钥,从而保证数据的安全。白盒密钥库包括静态白盒密钥库和动态白盒密钥库。白盒密钥库可以在设备中以各种形式运行,例如操作系统的动态链接库、静态链接库或内置于客户端的软件开发套件(SDK,Software Development Kit)。2) White-box keystore, a technology used to defend against white-box attacks. By confusing the key with the key algorithm used for symmetric encryption (ie, the white-box key algorithm), the attacker cannot know the specific The encryption and decryption process prevents attackers from obtaining the original key in a white-box environment, thereby ensuring data security. White-box keystores include static white-box keystores and dynamic white-box keystores. The white-box keystore can run in various forms in the device, such as a dynamic link library of an operating system, a static link library, or a software development kit (SDK, Software Development Kit) built into the client.

3)静态白盒密钥库,将原始密钥和白盒密钥库密钥算法(例如高级加密标准(AES,Advanced Encryption Standard)算法,数据加密(DES,Data Encryption Standard)算法,三重数据加密(TDES,Triple Data Encryption Standard)算法和分组密码(SM4)算法等标准密钥算法)绑定在一起进行混淆的库文件。例如,包括对基于原始密钥和密钥算法从明文到密文的映射进行变换,得到查找表形式的库文件。3) Static white-box keystore, which combines the original key with the white-box keystore key algorithm (such as Advanced Encryption Standard (AES, Advanced Encryption Standard) algorithm, Data Encryption (DES, Data Encryption Standard) algorithm, triple data encryption (TDES, Triple Data Encryption Standard) algorithm and block cipher (SM4) algorithm and other standard key algorithms) are bound together for obfuscation library files. For example, it includes transforming the mapping from plaintext to ciphertext based on the original key and the key algorithm to obtain a library file in the form of a lookup table.

参见图1A,图1A是相关技术提供的静态白盒密钥库的原理示意图,静态白盒密钥库被运行时,具备密钥功能,包括:通过原始密钥和白盒密钥算法对明文的加密,以及从密文中解密出明文,从而使得攻击者无法从查找表中分析得到原始密钥,在白盒攻击环境下有效保护原始密钥的安全。静态白盒密钥库是通过原始密钥生成的,因此原始密钥更新时需要重新生成静态白盒密钥库。Referring to FIG. 1A , FIG. 1A is a schematic diagram of the principle of a static white-box key store provided by the related art. When the static white-box key store is run, it has a key function, including: using the original key and the white-box key algorithm to encrypt the plaintext , and decrypt the plaintext from the ciphertext, so that the attacker cannot analyze the original key from the lookup table, and effectively protect the security of the original key in the white-box attack environment. The static white-box keystore is generated from the original key, so the static white-box keystore needs to be regenerated when the original key is updated.

4)动态白盒密钥库,用于供节点中的智能合约调用,以将原始密钥经过白盒密钥库技术处理(例如混淆编码等变换技术)变换为不同于原始密钥的白盒密钥,在对原始密钥进行变换的基础上,还可以对基于白盒密钥和密钥算法从明文到密文的映射进行变换,动态白盒密钥库可以为用于实现上述变换的查找表形式的库文件,支持通过查表的方式来实现上述变换。4) Dynamic white-box keystore, which is used for invocation by smart contracts in nodes to transform the original key into a white-box different from the original key after being processed by the white-box keystore technology (such as obfuscation coding and other transformation technologies). The key, on the basis of transforming the original key, can also transform the mapping from plaintext to ciphertext based on the white-box key and key algorithm. The dynamic white-box keystore can be used to realize the above transformation. The library file in the form of a lookup table supports the above transformation by means of a lookup table.

参见图1B,图1B是本发明实施例中应用的动态白盒密钥库的原理示意图,在动态白盒密钥库运行的任何阶段,原始密钥完全融入到加解密的过程中,即只能向动态白盒密钥库来输入明文和白盒密钥来得到密文,或者向动态白盒密钥库来输入密文和白盒密钥来得到明文。由于同时由于加/解密的过程是与原始密钥解耦的,因此可以在保持动态白盒密钥库不变的情况下动态地更换原始密钥;同时,即使动态白盒密钥库被攻击造成白盒密钥泄露,也能够保证原始密钥的安全性。Referring to FIG. 1B, FIG. 1B is a schematic diagram of the principle of the dynamic white-box key store applied in the embodiment of the present invention. At any stage of the operation of the dynamic white-box key store, the original key is completely integrated into the encryption and decryption process, that is, only the You can input the plaintext and whitebox key to the dynamic whitebox keystore to get the ciphertext, or you can input the ciphertext and the whitebox key to the dynamic whitebox keystore to get the plaintext. At the same time, since the encryption/decryption process is decoupled from the original key, the original key can be dynamically replaced while keeping the dynamic white-box keystore unchanged; at the same time, even if the dynamic white-box keystore is attacked The white box key is leaked, and the security of the original key can also be guaranteed.

5)传输密钥库,用于供节点中的智能合约调用,以与客户端协商传输的消息(例如交易和交易提案的消息)使用的对称密钥算法(也称为传输对称密钥算法)和密钥(也称为传输密钥)。5) Transport keystore, used for calls by smart contracts in nodes to negotiate with clients the symmetric key algorithm (also known as transport symmetric key algorithm) to use for transmitted messages (such as messages for transactions and transaction proposals) and key (also called transport key).

6)交易提案(Proposal),是执行交易中所包括的智能合约调用(下文简称为执行交易)的请求,包括接收交易的通道的标识、在通道中需要调用的智能合约的标识、以及需要向调用的智能合约传递的参数信息。6) A transaction proposal (Proposal) is a request to execute a smart contract call included in a transaction (hereinafter referred to as executing a transaction), including the identification of the channel that receives the transaction, the identification of the smart contract to be invoked in the channel, and the identification of the smart contract that needs to be called in the channel. The parameter information passed by the calling smart contract.

7)交易,也称为交易请求,等同于计算机术语事务(Transaction),交易包括了需要提交到区块链网络执行的操作,以及对应的交易结果。并非单指商业语境中的交易,鉴于在区块链技术中约定俗成地使用了“交易”这一术语,本发明实施例遵循了这一习惯。7) Transaction, also known as transaction request, is equivalent to the computer term transaction (Transaction), which includes the operations that need to be submitted to the blockchain network for execution, as well as the corresponding transaction results. It does not only refer to a transaction in a business context, and since the term "transaction" is conventionally used in the blockchain technology, the embodiment of the present invention follows this convention.

例如,交易可以包括部署(Deploy)交易和调用(Invoke)交易,部署交易用于将智能合约到区块链网络的节点中并准备好被调用;调用(Invoke)交易用于对账本中的状态数据库进行查询操作(即读操作)、更新操作(包括写操作(增加和修改)和删除操作)。For example, a transaction may include a Deploy transaction for placing a smart contract into a node of the blockchain network and ready to be invoked, and an Invoke transaction for reconciling the state in the ledger The database performs query operations (ie read operations), update operations (including write operations (add and modify) and delete operations).

8)区块链(Blockchain),是由区块(Block)形成的加密的、链式的交易的存储结构。每个区块的头部既可以包括区块中所有交易的哈希值,同时也包含前一个区块中所有交易的哈希值,从而基于哈希值实现区块中交易的防篡改和防伪造;新产生的交易被填充到区块并经过区块链网络中节点的共识后,会被追加到区块链的尾部从而形成链式的增长。8) Blockchain is a storage structure for encrypted and chained transactions formed by blocks. The header of each block can include not only the hash values of all transactions in the block, but also the hash values of all transactions in the previous block, so as to realize tamper-proof and anti-tampering of transactions in the block based on the hash value. Forgery; newly generated transactions are added to the block and after the consensus of the nodes in the blockchain network, they will be appended to the end of the blockchain to form a chain growth.

9)区块链网络(Blockchain Network),通过共识的方式将新区块纳入区块链的一系列的节点的集合。9) Blockchain Network, a set of nodes that incorporate new blocks into the blockchain through consensus.

10)账本(Ledger),是区块链(也称为账本数据)、以及与区块链同步的状态数据库的统称。其中,区块链是以文件系统中的文件的形式来记录交易;状态数据库是以不同类型的键(Key)值(Value)对的形式来记录区块链中的交易,用于支持对区块链中交易的快速查询。10) Ledger is a general term for the blockchain (also known as ledger data) and the state database synchronized with the blockchain. Among them, the blockchain records transactions in the form of files in the file system; the state database records transactions in the blockchain in the form of different types of key (Key) value (Value) pairs to support Quick lookup of transactions in the blockchain.

11)智能合约(Smart Contracts),也称为链码(Chaincode)或应用代码,部署在区块链网络的节点中的程序,承载了交易相关的业务逻辑,不同节点的智能合约运行在相互隔离的虚拟化运行环境中(例如容器或虚拟机)。11) Smart Contracts, also known as Chaincode or application code, are programs deployed in the nodes of the blockchain network, which carry the business logic related to transactions, and the smart contracts of different nodes run in isolation from each other. in a virtualized runtime environment (such as a container or virtual machine).

12)共识(Consensus),是区块链网络中的一个过程,用于在涉及的多个节点之间对区块中的交易达成一致,达成一致的区块将被追加到区块链的尾部。实现共识的机制包括工作量证明(PoW,Proof of Work)、权益证明(PoS,Proof of Stake)、股份授权证明(DPoS,Delegated Proof-of-Stake)、消逝时间量证明(PoET,Proof of Elapsed Time)等。12) Consensus is a process in the blockchain network used to reach agreement on the transactions in the block among the multiple nodes involved, and the agreed block will be appended to the end of the blockchain . The mechanisms for achieving consensus include Proof of Work (PoW, Proof of Work), Proof of Stake (PoS, Proof of Stake), Proof of Delegated Proof-of-Stake (DPoS, Delegated Proof-of-Stake), Proof of Elapsed Time (PoET, Proof of Elapsed) Time), etc.

13)成员(Member),也称为业务主体,代表某个具体的实体身份(例如公司、企业和社会团体等),在区块链网络中有自己的根证书,区块链中的节点属于某个成员,同一个成员可以在同一个通道中拥有多个节点。13) Member, also known as business subject, represents a specific entity identity (such as a company, enterprise and social group, etc.), has its own root certificate in the blockchain network, and the nodes in the blockchain belong to A member, the same member can have multiple nodes in the same channel.

14)组织(Organization),部分成员(接入区块链网络中的所有成员的子集)为实现特定业务(不需要所有成员参与)而形成的域,组织内的成员拥有相同的根证书。14) Organization, a domain formed by some members (a subset of all members accessing the blockchain network) to achieve a specific business (without the participation of all members), the members in the organization have the same root certificate.

15)通道(Channel),区块链网络中向组织中成员的节点提供的私有隔离环境,通道是一个逻辑结构,由物理存在的各种节点组成;通道中的智能合约和账本只对加入(也称为订阅)通道的成员的节点可见,同一个节点可以加入多个通道,并对应每个通道维护一个账本。15) Channel, a private isolation environment provided to the nodes of members of the organization in the blockchain network. The channel is a logical structure composed of various nodes that exist physically; the smart contracts and ledgers in the channel are only valid for joining ( Also known as subscription) channel members are visible to nodes, the same node can join multiple channels and maintain a ledger corresponding to each channel.

下面说明本发明实施例提供的区块链网络的示例性应用,参见图2,图2是本发明实施例提供的区块链网络200的示例性的应用系统100的架构示意图,包括区块链网络200(包括多个节点)、客户端510/410和认证中心(CA,Certificate Authority)300。The following describes an exemplary application of the blockchain network provided by the embodiment of the present invention. Referring to FIG. 2, FIG. 2 is a schematic diagram of the architecture of the exemplary application system 100 of the blockchain network 200 provided by the embodiment of the present invention, including the blockchain network. Network 200 (including multiple nodes), clients 510/410 and Certificate Authority (CA, Certificate Authority) 300 .

区块链网络200中的节点具有一个或多个功能,其中账本是节点的默认功能;在一些实施例中,节点还可以部署有共识服务、智能合约、白盒密钥库和传输密钥库中的一个或多个。A node in the blockchain network 200 has one or more functions, where the ledger is the default function of the node; in some embodiments, the node may also be deployed with consensus services, smart contracts, white-box keystores, and transport keystores one or more of.

区块链网络200的类型是灵活多样的,例如可以为公有链、私有链或联盟链中的任意一种。以公有链为例,任何业务主体的终端或服务器中运行的客户端,都可以在无需授权的情况下接入区块链网络200而成为一类特殊的节点,称为客户端节点;以联盟链为例,业务主体在被授权成为区块链网络200的成员后,对应的客户端可以接入区块链网络200而成为客户端节点,为方便描述,下文中客户端节点也简称为客户端。The type of the blockchain network 200 is flexible and diverse, for example, it can be any one of a public chain, a private chain or a consortium chain. Taking the public chain as an example, the terminal of any business entity or the client running in the server can access the blockchain network 200 without authorization and become a special kind of node, called client node; Taking the blockchain as an example, after a business entity is authorized to become a member of the blockchain network 200, the corresponding client can access the blockchain network 200 and become a client node. For the convenience of description, the client node is also referred to as a client in the following. end.

作为示例,客户端可以与业务主体的业务相关的各种用途的应用程序,例如社交网络客户端、物流客户端;客户端可以是各种平台的应用程序,例如移动APP(安卓APP和iOSAPP)、桌面软件(Widow系统软件和MAC系统软件)等。As an example, the client can be an application for various purposes related to the business of the business entity, such as a social network client, a logistics client; the client can be an application on various platforms, such as a mobile APP (Android APP and iOS APP) , desktop software (Widow system software and MAC system software) and so on.

需要指出,归属于同一业务主体的客户端节点的数量不存在限制,图2中示出了业务主体500使用的一个客户端510,且可以接入区块链网络200而成为客户端节点,同理,业务主体400使用的一个客户端410可以接入区块链网络200而成为客户端节点。It should be pointed out that there is no limit to the number of client nodes belonging to the same business entity. FIG. 2 shows a client 510 used by the business entity 500 and can access the blockchain network 200 to become a client node. Therefore, a client 410 used by the business entity 400 can access the blockchain network 200 to become a client node.

客户端节点是一类区别于区块链网络200中原生的记账节点的特殊节点,默认可以缺省区块链网络200中的原生的记账节点具有的账本,从而降低客户端的开发难度并实现客户端的轻量化。客户端与区块链网络200之间支持事件的传递,例如客户端通过可以监听/订阅区块链网络200运行中与智能合约调用相关的事件,例如生成新区块的事件,从而当区块链网络200中产生特定事件时,触发本地或外部系统的相关的业务逻辑。The client node is a special kind of node that is different from the native accounting node in the blockchain network 200. By default, the account book owned by the native accounting node in the blockchain network 200 can be defaulted, thereby reducing the development difficulty of the client and not Realize the lightweight of the client. The transmission of events between the client and the blockchain network 200 is supported. For example, the client can monitor/subscribe events related to smart contract calls in the operation of the blockchain network 200, such as the event of generating a new block, so that when the blockchain When a specific event occurs in the network 200, the relevant business logic of the local or external system is triggered.

在一些实施例中,客户端针对区块链网络200中账本的操作主要包括账本查询与账本更新两种类型。对于账本查询来说,客户端向区块链网络200发起交易提案,交易提案中的交易数据(即与查询操作相关的智能合约调用),由区块链网络200的节点执行交易提案中包括的智能合约调用以查询账本,并将查询到的数据作为交易结果携带在提案响应中以返回客户端。In some embodiments, the operations performed by the client on the ledger in the blockchain network 200 mainly include two types of ledger query and ledger update. For the ledger query, the client initiates a transaction proposal to the blockchain network 200, and the transaction data in the transaction proposal (ie, the smart contract invocation related to the query operation) is executed by the nodes of the blockchain network 200 included in the transaction proposal. The smart contract is called to query the ledger, and the queried data is carried in the proposal response as the transaction result to return to the client.

对于账本更新来说,客户端节点向区块链网络200发起交易提案,其中的交易数据包括与状态数据库的更新操作(包括增加、删除和修改键值对数据的操作)相关的智能合约调用,由区块链网络200的节点对账本模拟执行(即账本不会被改变)交易提案中包括的交易数据,将模拟执行得到的键值对作为交易结果携带在提案响应中以返回客户端,客户端节点进而将交易提案、提案响应构造为交易,并提交到区块链网络200,由区块链网络200的节点将交易记录到账本中。For the ledger update, the client node initiates a transaction proposal to the blockchain network 200, and the transaction data includes the smart contract calls related to the update operation of the state database (including the operation of adding, deleting and modifying key-value pair data), The nodes of the blockchain network 200 simulate the execution of the ledger (that is, the ledger will not be changed) the transaction data included in the transaction proposal, and carry the key-value pair obtained by the simulated execution as the transaction result in the proposal response to return to the client, the client The end node then constructs the transaction proposal and the proposal response into a transaction, and submits it to the blockchain network 200, and the nodes of the blockchain network 200 record the transaction in the ledger.

区块链网络200外部的认证中心300用于响应客户端410/510(下面简称为客户端)的注册申请,返回注册密钥用于登录,以便获取用于声明客户端所属成员的身份信息的数字证书。作为认证中心(CA,Certificate Authority)300的替换方案,区块链网络200中可以设置有CA节点以实现认证中心(CA,Certificate Authority)300的功能。The authentication center 300 outside the blockchain network 200 is used to respond to the registration application of the client 410/510 (hereinafter referred to as the client), and return the registration key for logging in, so as to obtain the identity information used to declare the member to which the client belongs. digital certificate. As an alternative to the certificate authority (CA, Certificate Authority) 300 , a CA node may be set in the blockchain network 200 to implement the function of the certificate authority (CA, Certificate Authority) 300 .

在一些实施例中,区块链网络200中的记账节点根据在账本和共识服务之外实现的功能可以划分为不同的类型,作为图2中示出的区块链网络200的划分为不同类型的示例,参见图3,图3是本发明实施例提供的基于区块链网络200的交易处理的原理示意图,除了客户端节点(客户端410/510),区块链网络200中的节点默认都具有共识服务和账本功能,其中仅具有验证交易并记账功能的节点称为记账节点(Committer)或共识节点,还包括一些特殊类型的记账节点:具有背书服务的背书节点(Endorser)、具有排序服务的排序节点(Orderer)和代表通道中的记账节点与排序节点通道的主节点(Leader Peer)。In some embodiments, the accounting nodes in the blockchain network 200 can be divided into different types according to the functions implemented outside the ledger and consensus services, as the division of the blockchain network 200 shown in FIG. 2 is different For an example of the type, see FIG. 3. FIG. 3 is a schematic diagram of the principle of transaction processing based on the blockchain network 200 provided by the embodiment of the present invention. Except for the client node (client 410/510), the nodes in the blockchain network 200 By default, they all have consensus services and ledger functions. The nodes that only have the functions of verifying transactions and accounting are called account nodes (Committer) or consensus nodes, and also include some special types of account nodes: Endorser nodes with endorsement services (Endorser) ), an orderer with an ordering service (Orderer), and a leader peer (Leader Peer) that represents the accounting node in the channel and the orderer channel.

区块链网络200中的上述节点可以加入不同组织的通道,每个组织(组织1和组织2)的通道内包括归属于组织成员的多个记账节点,如图3示出了开展不同业务的组织1和组织2,区块链网络200中归属于组织1/2的成员的节点可以对应加入组织1/2的通道,每个通道内的节点接收与所属组织的客户端提交的业务相关的交易,并将交易到账本中,账本对于通道外的节点是隔离的。The above-mentioned nodes in the blockchain network 200 can join the channels of different organizations, and the channels of each organization (organization 1 and organization 2) include multiple accounting nodes belonging to the members of the organization, as shown in FIG. 3 to carry out different services. In the blockchain network 200, the nodes belonging to the members of Organization 1/2 can join the channels of Organization 1/2 correspondingly, and the nodes in each channel receive business-related services submitted by clients of the organization to which they belong. , and transfer the transaction to the ledger, which is isolated from nodes outside the channel.

在一些实施例中,客户端中内置软件开发套件(SDK,Software Development Kit)来实现由区块链网络200的交互,从而客户端的原生代码可以只关注实现业务相关的逻辑,忽略区块链网络200的内部运行细节,降低客户端的开发难度。In some embodiments, a software development kit (SDK, Software Development Kit) is built in the client to realize the interaction by the blockchain network 200, so that the native code of the client can only focus on implementing business-related logic, ignoring the blockchain network 200 internal operation details to reduce the development difficulty of the client.

作为示例,SDK向客户端提供了与区块链网络200的节点之间的基于远程过程调用(RPC,Remote Procedure Call)连接的一系列应用编程接口(API,ApplicationProgramming Interface),用于供客户端管理和使用区块链网络200的功能,这些功能包括:身份管理、账本管理、交易管理、智能合约、交易管理、成员管理、共识服务、智能合约服务、安全和密钥服务和事件处理等,将在下文具体说明上述功能。As an example, the SDK provides the client with a series of application programming interfaces (APIs, Application Programming Interfaces) based on remote procedure call (RPC, Remote Procedure Call) connections between nodes of the blockchain network 200 for the client Manage and use the functions of the blockchain network 200 including: identity management, ledger management, transaction management, smart contracts, transaction management, membership management, consensus services, smart contract services, security and key services, and event processing, etc., The above-mentioned functions will be described in detail below.

本发明实施例提供客户端向区块链网络提交非敏感数据和敏感数据的方案,其中非敏感数据是可以接入区块链网络的任意客户端公开的数据,可以理解地,非敏感数据和敏感数据的区分方式是灵活多样的,取决于接入区块链网络的成员的业务需求,例如,成员的业务属性要求保护用户的个人信息、商业机密等情况的数据,这些数据需要上链且只能对归属于成员自身的客户端开放查询权限,则这些数据属于敏感数据;成员的业务属性不要求保护的数据,例如业务范围、业务介绍信息,这些数据也需要上链存储,则这些数据为非敏感数据。Embodiments of the present invention provide a solution for a client to submit non-sensitive data and sensitive data to a blockchain network, where non-sensitive data is data disclosed by any client that can access the blockchain network. It is understandable that non-sensitive data and The way of distinguishing sensitive data is flexible and diverse, depending on the business needs of the members accessing the blockchain network. For example, the business attributes of the members require the protection of users’ personal information, business secrets, etc., these data need to be on the chain and Only open query permissions to clients belonging to members themselves, then these data are sensitive data; data whose business attributes of members do not require protection, such as business scope and business introduction information, these data also need to be stored on the chain, then these data for non-sensitive data.

下面,结合图4,以向区块链网络发起用于提交基于非敏感数据以更新区块链网络的状态数据库的交易和提交查询区块链网络的状态数据库中非敏感数据的交易为例,说明区块链网络的交易管理的示例。In the following, in conjunction with FIG. 4 , taking as an example a transaction for submitting a transaction based on non-sensitive data to update the state database of the blockchain network and a transaction for submitting a query for non-sensitive data in the state database of the blockchain network to the blockchain network, An example illustrating transaction management for a blockchain network.

在一些实施例中,客户端提交基于非敏感数据以更新区块链网络的状态数据库的操作包括提交交易提案和提交交易两个阶段,客户端提交的用于查询区块链网络状态数据库中非敏感数据的操作包括提交交易提案一个阶段。In some embodiments, the operation of the client submitting the non-sensitive data to update the state database of the blockchain network includes two stages: submitting a transaction proposal and submitting a transaction. Operations on sensitive data include a stage of submitting a transaction proposal.

参见图4,图4是本发明实施例提供的区块链网络针对非敏感数据的交易处理流程示意图,结合图4示出的交易提案和提交交易两个阶段的处理过程,就上述不同类型的节点的功能进行说明。Referring to FIG. 4, FIG. 4 is a schematic diagram of a transaction processing flow of a blockchain network for non-sensitive data provided by an embodiment of the present invention. Combined with the two-stage processing process of transaction proposal and transaction submission shown in FIG. The function of the node is explained.

客户端向区块链网络200中一个或多个通道中的背书节点发起交易提案,交易提案包括交易号、时间戳(发起交易提案的时间)和交易数据。其中交易数据包括:执行交易的通道(即交易中的调用的智能合约的所在的通道)的标识(例如序号或名称)、以及需要在通道中需要执行的与基于非敏感数据更新状态数据库/查询状态数据库中敏感数据的智能合约调用(包括基于非敏感数据更新状态数据库/查询状态数据库中敏感数据时,需要调用的智能合约的标识例如名称或序列号、智能合约的版本和需要向智能合约传递的参数信息等)。智能合约和参数与客户端需要执行的操作相关,例如智能合约可以用于增加、删除、查询或修改操作,参数信息可以是增加、删除、查询或修改操作的数据。The client initiates a transaction proposal to an endorsing node in one or more channels in the blockchain network 200, and the transaction proposal includes a transaction number, a timestamp (the time when the transaction proposal was initiated), and transaction data. The transaction data includes: the identification (such as the serial number or name) of the channel that executes the transaction (that is, the channel where the smart contract called in the transaction is located), and the status database/queries that need to be executed in the channel and updated based on non-sensitive data Smart contract calls for sensitive data in the state database (including updating the state database/querying sensitive data in the state database based on non-sensitive data, the identification of the smart contract that needs to be called, such as the name or serial number, the version of the smart contract, and the need to pass to the smart contract. parameter information, etc.). Smart contracts and parameters are related to the operations that the client needs to perform. For example, smart contracts can be used to add, delete, query or modify operations, and parameter information can be data for adding, deleting, querying or modifying operations.

交易提案还携带认证中心向客户端签发的客户端数字证书、以及客户端针对交易提案中交易数据签署的数字签名,客户端数字证书包括:客户端所属的成员的身份信息、客户端的公钥,认证中心使用认证中心的私钥(与客户端和节点预先向认证中心请求的根证书中的公钥对应)对客户端的身份信息和客户端的公钥签署的数字签名。客户端数字证书用于声明客户端所属的成员的身份信息,客户端数字签名用于证明交易提案中的交易数据没有被篡改。The transaction proposal also carries the client digital certificate issued to the client by the certification center, and the digital signature signed by the client for the transaction data in the transaction proposal. The client digital certificate includes: the identity information of the member to which the client belongs, the client's public key, The authentication center uses the authentication center's private key (corresponding to the public key in the root certificate that the client and the node request from the authentication center in advance) to sign the client's identity information and the client's public key. The client digital certificate is used to declare the identity information of the member to which the client belongs, and the client digital signature is used to prove that the transaction data in the transaction proposal has not been tampered with.

背书节点在收到交易提案后会根据背书策略进行一些背书验证,包括:交易提案携带的数字证书是否是由受信任的认证中心签发;交易提案的数字签名是否有效;交易提案的格式是否正确;交易提案是否重复提交过;客户端在请求执行智能合约调用的通道中是否已被授权有写权限。当判断均为是时背书验证成功。After receiving the transaction proposal, the endorsement node will perform some endorsement verification according to the endorsement strategy, including: whether the digital certificate carried by the transaction proposal is issued by a trusted certification center; whether the digital signature of the transaction proposal is valid; whether the format of the transaction proposal is correct; Whether the transaction proposal has been submitted repeatedly; whether the client has been authorized to have write permission in the channel requesting to execute the smart contract call. When the judgments are all yes, the endorsement verification is successful.

在一些实施例中,背书节点验证交易提案成功时,背书节点会基于本地所维护的账本的状态数据库来模拟执行交易数据,即执行交易提案中包括的智能合约调用以得到交易结果。背书节点使用自己的私钥对交易结果进行签名(即背书),将背书节点的数字签名结合背书节点的数字证书(包括背书节点的公钥、以及认证中心使用认证中心的私钥对背书节点的公钥和身份信息签署的数字签名)、以及其他的相关信息构造成为提案响应(Proposal Response),然后返回给客户端。In some embodiments, when the endorsement node verifies that the transaction proposal is successful, the endorsement node simulates the execution of transaction data based on the state database of the ledger maintained locally, that is, executes the smart contract invocation included in the transaction proposal to obtain the transaction result. The endorsement node uses its own private key to sign the transaction result (that is, endorsement), and combines the endorsement node's digital signature with the endorsement node's digital certificate (including the endorsement node's public key, and the certification center uses the certification center's private key to endorse the node's signature). The digital signature signed by the public key and identity information), and other related information are constructed as a proposal response (Proposal Response), and then returned to the client.

作为示例,当交易提案中包括用于非敏感数据的查询操作的智能合约调用时,交易结果是读集(Read Set),包含模拟执行过程中从账本数据库读取的键值对;当交易提案中包括用于非敏感数据的更新操作的智能合约调用时,交易结果是写集(Write Set)也包含了一个唯一键的列表,还有在模拟执行过程中对账本数据库写入的键值对。As an example, when a transaction proposal includes a smart contract invocation for query operations on non-sensitive data, the transaction result is a read set (Read Set), which contains key-value pairs read from the ledger database during the simulation execution process; when the transaction proposal When a smart contract is invoked that includes an update operation for non-sensitive data, the transaction result is that the Write Set also contains a list of unique keys, as well as the key-value pairs written to the ledger database during the simulation execution. .

作为示例,上文所述的其他的相关信息可以包括:成功码(指示验证交易提案成功)、时间戳(生成提案响应的时间)、接收交易的通道的标识(例如序列号或名称)和交易提案的哈希值(用于与交易提案一对一地绑定,避免在提交交易阶段交易被客户端篡改)。As an example, other relevant information described above may include: a success code (indicating that the verification of the transaction proposal was successful), a timestamp (the time the proposal response was generated), the identification of the channel that received the transaction (eg, serial number or name), and the transaction The hash value of the proposal (used to bind one-to-one with the transaction proposal to avoid the transaction being tampered by the client during the commit transaction phase).

在一些实施例中,背书节点验证交易提案失败时,会向客户端返回携带失败码(指示验证交易提案失败的错误类型)的提案响应。In some embodiments, when the endorsement node fails to verify the transaction proposal, it will return to the client a proposal response with a failure code (indicating the error type of the failure to verify the transaction proposal).

当客户端收到提案响应时,首先会通过验证交易提案携带的数字证书和数字签名以确认提案响应的有效性。当客户端收集到足够数量(预定数量)的背书节点的提案响应,且提案响应中的交易结果一致时,会根据交易提案以及提案响应来构造交易。When the client receives the proposal response, it first confirms the validity of the proposal response by verifying the digital certificate and digital signature carried by the transaction proposal. When the client collects a sufficient number (predetermined number) of proposal responses from endorsing nodes, and the transaction results in the proposal responses are consistent, a transaction will be constructed based on the transaction proposal and the proposal responses.

作为示例,交易包括:时间戳(构造交易的时间)、接收交易的通道的标识、需要在通道中调用的智能合约的标识(例如名称或序列号)、智能合约的版本和向智能合约传递的参数等和交易结果(例如读/写集)、以及背书节点针对交易结果的数字签名。As an example, a transaction includes: a timestamp (the time the transaction was constructed), the identity of the channel that received the transaction, the identity of the smart contract that needs to be invoked in the channel (such as a name or serial number), the version of the smart contract, and the information passed to the smart contract. Parameters, etc. and transaction results (such as read/write sets), and the digital signature of the endorsing node for the transaction results.

需要指出,如果客户端提交的交易提案中的智能合约调用仅用于查询账本(而不用于更新账本),则客户端不会构造交易,仅将提案响应中的交易结果作为账本查询结果来完成相关的业务逻辑。It should be pointed out that if the smart contract invocation in the transaction proposal submitted by the client is only used to query the ledger (and not to update the ledger), the client will not construct the transaction, and only use the transaction result in the proposal response as the ledger query result to complete related business logic.

客户端构造交易后,将交易广播给区块链网络200中的排序节点,对于所接收的交易,排序节点从交易中读取交易所属的通道的标识,按照交易中时间戳(例如发起交易提案的时间戳、生成提案响应的时间戳)的先后顺序,将对应各个通道接收的交易构造相应通道的区块,并将区块发送到相应通道中的主节点。After the client constructs the transaction, it broadcasts the transaction to the ordering node in the blockchain network 200. For the received transaction, the ordering node reads the identifier of the channel to which the transaction belongs from the transaction, and according to the timestamp in the transaction (such as initiating a transaction proposal) The order of the timestamp of the corresponding channel and the timestamp of generating the proposal response), construct the block of the corresponding channel corresponding to the transaction received by each channel, and send the block to the master node in the corresponding channel.

以图3为例,排序节点接收到交易时,根据交易中的通道的标识确定需要接收交易的通道是组织1的通道还是组织2的通道,根据对应各个通道的接收交易的先后顺序,构造对应组织1的通道的区块以及对应组织2的通道的区块,对应发送到组织1/组织2的通道中的主节点。Taking Figure 3 as an example, when the ordering node receives a transaction, it determines whether the channel that needs to receive the transaction is the channel of Organization 1 or the channel of Organization 2 according to the identifier of the channel in the transaction. The block of the channel of organization 1 and the block corresponding to the channel of organization 2 correspond to the master node in the channel of organization 1/organization 2.

主节点是代表通道内的其他记账节点和排序节点通信的节点,用于从排序节点获取最新的区块并在通道内部同步;主节点可以是被强制设置的,也可以是动态选举产生的。The master node is the node that communicates with the ordering node on behalf of other accounting nodes in the channel, and is used to obtain the latest block from the ordering node and synchronize within the channel; the master node can be set by force or dynamically elected .

通道内的记账节点各自对接收的区块中的各个交易进行共识验证,并在验证通过后追加到各自维护的区块链的尾部,并利用区块中交易的交易结果更新账本数据库。The accounting nodes in the channel each perform consensus verification on each transaction in the received block, and append to the end of the blockchain they maintain after passing the verification, and update the ledger database with the transaction result of the transaction in the block.

在一些实施例中,记账节点对区块中交易的共识验证包括:交易格式是否正确,是否有合法的签名(包括客户端的数字签名和背书节点的数字签名),即验证交易内容是否被篡改;记账节点是否加入交易中所指示的接收交易的通道;交易是否符合背书策略。背书策略是背书节点对交易进行背书的规则,指定一个交易在提交前需要的背书所来自的组织、相应组织内节点的类型和有效背书的数量。当判断结果均为是时表示共识验证通过。In some embodiments, the consensus verification of the transaction in the block by the accounting node includes: whether the transaction format is correct and whether there is a legal signature (including the digital signature of the client and the digital signature of the endorsing node), that is, verifying whether the transaction content has been tampered with ; Whether the accounting node joins the channel indicated in the transaction to receive the transaction; whether the transaction complies with the endorsement policy. The endorsement policy is the rule for the endorsement node to endorse the transaction, specifying the organization from which the endorsement required for a transaction before it is submitted, the type of nodes in the corresponding organization, and the number of valid endorsements. When the judgment results are all yes, it means that the consensus verification is passed.

下面说明本发明实施例提供的区块链网络中节点的示例性的逻辑功能架构,参见图5,图5是本发明实施例提供的区块链网络200中节点的逻辑功能架构示意图,下面分别进行说明。The following describes an exemplary logical functional architecture of a node in a blockchain network provided by an embodiment of the present invention. Referring to FIG. 5, FIG. 5 is a schematic diagram of a logical functional architecture of a node in a blockchain network 200 provided by an embodiment of the present invention. Be explained.

区块链网络200中节点的上层对接客户端,客户端410/510中提供了标准的RPC接口,并在API的基础之上封装了SDK,从而使得开发人员可以在SDK中开发基于区块链的各种业务逻辑;客户端的事件机制能够使得客户端接收区块链网络200的各种事件时,例如当接收到创建新区块的事件时、执行智能合约的事件时,执行预先定义的回调函数,从而使得各个节点之间达成共识的执行时间尽量缩短。The upper layer of the node in the blockchain network 200 is connected to the client. The client 410/510 provides a standard RPC interface, and encapsulates the SDK on the basis of the API, so that developers can develop blockchain-based development in the SDK. various business logics; the client's event mechanism enables the client to execute a predefined callback function when receiving various events of the blockchain network 200, such as when receiving an event of creating a new block or executing a smart contract , so that the execution time for reaching a consensus among each node is shortened as much as possible.

在一些实施例中,从区块链网络200对接客户端的顶层的角度,区块链网络200中节点的功能包括身份管理、账本管理、交易管理和智能合约,下面分别进行说明。In some embodiments, from the perspective of the top layer of the blockchain network 200 connecting to the client, the functions of the nodes in the blockchain network 200 include identity management, ledger management, transaction management and smart contracts, which will be described separately below.

(1)身份管理(1) Identity management

客户端的用户注册和登录认证中心后,客户端获取到成员的数字证书(ECert),其他所有的操作都需要与数字证书关联的私钥进行签名,消息接收方与成员持有来自认证中心的相同的根证书,消息接收方首先会进行签名和数字证书的验证,才进行后续的消息处理。节点同样会用到认证中心颁发的数字证书,比如接入区块链网络的成员启动下辖的节点的系统和对下辖的节点进行管理时,身份管理功能都会对成员的身份信息进行认证和授权。After the client's user registers and logs in to the certification center, the client obtains the member's digital certificate (ECert), and all other operations need to be signed with the private key associated with the digital certificate. The message recipient and the member hold the same certificate from the certification center. The root certificate of the message recipient will first perform signature and digital certificate verification before proceeding with subsequent message processing. Nodes will also use digital certificates issued by the certification center. For example, when members accessing the blockchain network start the system of the nodes under their jurisdiction and manage the nodes under their jurisdiction, the identity management function will authenticate and verify the identity information of the members. authorized.

(2)账本管理(2) Ledger management

维护账本,并授权接入区块链网络200的成员查询账本,可以通过多种方式查询,包括根据区块号查询区块、根据区块哈希查询区块、根据交易号查询区块和根据交易号查询交易,还可以根据通道名称获取查询到的区块链。Maintain the ledger and authorize members accessing the blockchain network 200 to query the ledger, which can be queried in various ways, including querying blocks based on block numbers, querying blocks based on block hashes, querying blocks based on transaction numbers, and querying blocks based on transaction numbers. The transaction number can be used to query the transaction, and the queried blockchain can also be obtained according to the channel name.

(3)交易管理(3) Transaction management

账本只能通过提交交易的方式更新,客户端通过区块链网络200的交易管理功能提交交易提案,并获取到交易的背书后,再向排序节点提交交易,然后由排序节点构造为区块。The ledger can only be updated by submitting transactions. The client submits a transaction proposal through the transaction management function of the blockchain network 200, and after obtaining the endorsement of the transaction, submits the transaction to the ordering node, and then the ordering node constructs a block.

(4)智能合约(4) Smart Contract

实现“可编程的账本”(Programmable Ledger),通过智能合约调用执行交易,实现基于区块链的智能合约业务逻辑,例如,执行交易中的更新或查询状态数据库中的键值对数据相关的智能合约调用;又例如,执行交易中的与白盒密钥库或传输密钥库相关的智能合约调用。Implement "Programmable Ledger", execute transactions through smart contract calls, and implement blockchain-based smart contract business logic, such as executing updates in transactions or querying key-value pair data in the state database. Contract invocation; another example, executing a smart contract invocation in a transaction that is related to a whitebox keystore or a transport keystore.

在一些实施例中,从区块链网络200对接底层的角度,区块链网络200的功能包括成员管理、共识服务、链码服务、安全和密钥服务,下面分别进行说明。In some embodiments, from the perspective of connecting the blockchain network 200 to the bottom layer, the functions of the blockchain network 200 include member management, consensus service, chain code service, security and key service, which will be described separately below.

(1)成员管理(1) Member management

通过根信任证书(Root of Trust Certificate)体系,利用(PKI,Public KeyInfrastructure)对成员的身份信息进行认证,验证成员的数字签名。结合区块链网络内部的认证中心或者第三方认证中心,提供成员的注册功能,并对成员的数字证书进行管理,例如证书新增和撤销。示例性地,数字的证书分为注册证书(ECert)、交易证书(TCert)和TLS证书(TLS Cert),它们分别用于用户身份、交易签名和安全传输层协议(TLS,TransportLayer Security Protocol)传输。Through the Root of Trust Certificate system, use (PKI, Public Key Infrastructure) to authenticate members' identity information and verify members' digital signatures. Combined with the certification center or third-party certification center within the blockchain network, it provides members' registration functions and manages members' digital certificates, such as certificate addition and revocation. Exemplarily, digital certificates are divided into registration certificate (ECert), transaction certificate (TCert) and TLS certificate (TLS Cert), which are respectively used for user identity, transaction signature and TransportLayer Security Protocol (TLS, TransportLayer Security Protocol) transmission. .

(2)共识服务(2) Consensus service

共识服务由3个阶段构成:客户端向背书节点(提供背书验证)提交提案以获得背书,客户端获得背书后提交交易给排序节点(提供排序服务)进行排序生成区块,之后广播给记账节点进行验证区块中交易后,写入记账节点本地的账本。The consensus service consists of 3 stages: the client submits a proposal to the endorsement node (providing endorsement verification) to obtain an endorsement, and after the client obtains the endorsement, it submits the transaction to the ordering node (providing the ordering service) to sort and generate blocks, and then broadcast to the bookkeeping. After the node verifies the transaction in the block, it is written into the local ledger of the accounting node.

(3)链码服务(3) Chain code service

提供智能合约的安全的虚拟化运行环境,例如容器(Docker)或虚拟机,以确保安全的执行过程和用户数据的隔离;能够响应部署交易中指定的智能合约镜像文件,从镜像文件仓库中读取智能合约镜像文件,部署到节点上并实例化智能合约。Provides a secure virtualized runtime environment for smart contracts, such as containers (Docker) or virtual machines, to ensure secure execution and isolation of user data; it can respond to the smart contract image file specified in the deployment transaction and read from the image file repository Take the smart contract image file, deploy it on the node and instantiate the smart contract.

(4)安全和密钥服务(4) Security and Key Services

实现密钥生成、哈希运算、签名验签、加密解密等基础功能。Implement basic functions such as key generation, hash operation, signature verification, encryption and decryption.

下面说明本发明实施例提供的运行区块链网络的节点的电子设备的示例性结构,参见图6,图6是本发明实施例提供的运行区块链网络200中的节点的电子设备的结构示意图,电子设备可以是终端(例如PC)、服务器或服务器的集群,提供虚拟化的节点运行环境,图6所示的电子设备600包括:至少一个处理器610、存储器650和至少一个网络接口620。电子设备中的各个组件通过总线系统640耦合在一起。可理解,总线系统640用于实现这些组件之间的连接通信。The following describes an exemplary structure of an electronic device for running a node of a blockchain network provided by an embodiment of the present invention. Referring to FIG. 6 , FIG. 6 is a structure of an electronic device for running a node in the blockchain network 200 provided by an embodiment of the present invention. In the schematic diagram, the electronic device can be a terminal (eg PC), a server or a cluster of servers, providing a virtualized node operating environment, the electronic device 600 shown in FIG. 6 includes: at least one processor 610 , memory 650 and at least one network interface 620 . The various components in the electronic device are coupled together by a bus system 640 . It can be understood that the bus system 640 is used to implement the connection communication between these components.

处理器610可以是一种集成电路芯片,具有信号的处理能力,例如通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等,其中,通用处理器可以是微处理器或者任何常规的处理器等。The processor 610 may be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where a general-purpose processor may be a microprocessor or any conventional processor or the like.

存储器650可以是可移除的,不可移除的或其组合。存储器650包括易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。Memory 650 may be removable, non-removable, or a combination thereof. Memory 650 includes volatile memory or non-volatile memory, and may also include both volatile and non-volatile memory.

在一些实施例中,存储器650能够存储数据以支持各种操作,这些数据的示例包括程序、模块和数据结构或者其子集或超集,例如操作系统651,经由一个或多个(有线或无线)网络接口620到达其他计算设备的通信模块652。In some embodiments, memory 650 is capable of storing data to support various operations, examples of such data including programs, modules, and data structures, or subsets or supersets thereof, such as operating system 651, via one or more (wired or wireless) ) network interface 620 to the communication module 652 of the other computing device.

在一些实施例中,本发明实施例提供的区块链网络的数据处理装置655可以采用软件方式实现,图6示出了存储在存储器650中的区块链网络的数据处理装置655,其可以是程序和插件等形式的软件,包括以下软件模块:部署在区块链网络的节点中的智能合约、白盒密钥库和共识服务;这些模块是逻辑上的,因此根据所实现的功能可以进行任意的组合或进一步拆分。将在下文中说明各个模块的功能。In some embodiments, the data processing apparatus 655 of the blockchain network provided by the embodiments of the present invention may be implemented in software. FIG. 6 shows the data processing apparatus 655 of the blockchain network stored in the memory 650, which may It is software in the form of programs and plug-ins, including the following software modules: smart contracts, white-box keystores and consensus services deployed in the nodes of the blockchain network; these modules are logical and therefore can be Make any combination or split further. The function of each module will be explained below.

下面,再以向区块链网络发起用于提交基于敏感数据更新状态数据库的交易和提交查询状态数据库中的敏感数据的交易为例,说明本发明实施例提供的区块链网络的数据处理方法用于敏感数据的交易管理的示例。需要指出,与非敏感数据相关的交易管理方案相比,与敏感数据相关的交易管理方案中除了涉及节点中的智能合约、白盒密钥库和传输密钥库,而对于交易管理的过程中所涉及的共识服务(例如背书服务和排序服务)的实现是类似的,因此下文中省略了与共识服务相关的细节。In the following, the data processing method of the blockchain network provided by the embodiment of the present invention will be described by taking as an example initiating a transaction for updating the state database based on sensitive data and submitting a transaction for querying the sensitive data in the state database to the blockchain network. Example of transaction management for sensitive data. It should be pointed out that, compared with the transaction management scheme related to non-sensitive data, in the transaction management scheme related to sensitive data, in addition to involving the smart contract, white box keystore and transmission keystore in the node, the process of transaction management The implementation of the involved consensus services (such as the endorsement service and the ordering service) is similar, so the details related to the consensus service are omitted below.

参见图7,图7是本发明实施例提供的区块链网络的数据处理方法的流程示意图,以区块链网络中的节点(例如排序节点、客户端所加入通道中的主节点、记账节点和背书节点)均部署有智能合约、白盒密钥库和传输密钥库为例进行说明。Referring to FIG. 7, FIG. 7 is a schematic flowchart of a data processing method of a blockchain network provided by an embodiment of the present invention. Nodes in the blockchain network (such as a sorting node, a master node in a channel added by a client, accounting Nodes and Endorsing Nodes) are deployed with smart contracts, white-box keystores and transmission keystores as an example to illustrate.

在步骤101中,客户端发送的原始密钥到区块链网络的节点中的智能合约。In step 101, the client sends the original key to the smart contract in the node of the blockchain network.

在一些实施例中,当客户端需要将与自身的业务相关的敏感数据上链时,初始化针对敏感数据进行加密的原始密钥,并发送给区块链网络中的节点(例如包括排序节点、客户端所加入通道中的主节点、记账节点和背书节点),以通过步骤101接收原始密钥。In some embodiments, when the client needs to upload sensitive data related to its own business on the chain, it initializes the original key for encrypting the sensitive data, and sends it to the nodes in the blockchain network (for example, including ordering nodes, The master node, billing node and endorsement node in the channel that the client joins) to receive the original key through step 101 .

例如,客户端中提供原始密钥的设置界面,以接收用户针对敏感数据设置的原始密钥;或者,通过运行自动生成密钥的库来生成原始密钥,支持用户设置用于保护敏感数据的原始密钥的长度和字符类型。For example, a setting interface for raw keys is provided in the client to receive the raw keys set by users for sensitive data; or, by running a library that automatically generates keys to generate raw keys, users can set up a key to protect sensitive data. The length and character type of the original key.

在一些实施例中,为了保证原始密钥传输的安全性(不被攻击者截获),在步骤101之前,客户端可以与节点进行协商以确定用于对原始密钥进行对称加密的加密套接字密钥算法和对应的传输密钥,并利用加密套接字密钥算法和传输密钥对原始密钥进行对称加密,并传输加密原始密钥到节点的智能合约,当节点的智能合约在步骤101中接收到加密原始密钥时,通过调用传输密钥库可以利用加密套接字密钥算法和加密原始密钥进行解密。In some embodiments, in order to ensure the security of the original key transmission (not to be intercepted by an attacker), before step 101, the client may negotiate with the node to determine an encrypted socket for symmetric encryption of the original key The word key algorithm and the corresponding transmission key, and use the encrypted socket key algorithm and the transmission key to symmetrically encrypt the original key, and transmit the encrypted original key to the node's smart contract. When the node's smart contract is in When the encrypted original key is received in step 101, the encrypted socket key algorithm and the encrypted original key can be used for decryption by calling the transmission key store.

例如,当节点中的智能合约通过调用节点中部署的传输密钥库与客户端进行协商确定对称密钥算法和对应的传输密钥时,可以采用这样的方式实现:节点中的智能合约与客户端之间传输通过超文本传输安全协议(HTTPS,HyperText Transfer ProtocolSecure)的握手消息,通过握手消息交易在节点和客户端之间交换随机数和加密套接字密钥算法(其中,加密套接字密钥算法是基于加密套接字协议层(SSL,Secure SocketsLayer)交换的任意一种对称加密算法),使节点和客户端均获得的相同的随机数和加密套接字密钥算法,从而通过加密套接字密钥算法对随机数进行计算得到传输密钥。For example, when the smart contract in the node negotiates with the client by calling the transmission keystore deployed in the node to determine the symmetric key algorithm and the corresponding transmission key, it can be implemented in this way: the smart contract in the node communicates with the client The handshake message through the HyperText Transfer Protocol Secure (HTTPS, HyperText Transfer ProtocolSecure) is transmitted between the peers, and the random number and the encrypted socket key algorithm (among which, the encrypted socket is exchanged between the node and the client through the handshake message transaction) The key algorithm is any symmetric encryption algorithm exchanged based on the Secure Sockets Layer (SSL, Secure Sockets Layer), so that both the node and the client obtain the same random number and encrypted socket key algorithm, so that through The encrypted socket key algorithm calculates the random number to obtain the transmission key.

作为示例,节点通过智能合约与客户端协商的用于加密原始密钥的加密套接字密钥算法和传输密钥可以是永久有效的,也可以定期重新协商以进行更新,又或者,当传输密钥的实际使用次数的达到次数阈值时重新协商以进行更新,从而保证原始密钥的安全性。As an example, the encrypted socket key algorithm and transmission key used to encrypt the original key negotiated by the node through the smart contract with the client may be permanently valid, or may be renegotiated periodically for renewal, or, when the transmission When the actual number of key uses reaches the threshold, renegotiation is performed to update, thereby ensuring the security of the original key.

在步骤101之前,还涉及到区块链网络中白盒密钥库的实例化和传输密钥库的实例化,下面进行说明。Before step 101, it also involves the instantiation of the white box keystore and the instantiation of the transmission keystore in the blockchain network, which will be described below.

在一些实施例中,白盒密钥库和传输密钥库可以是区块链网络内置的,白盒密钥库和传输密钥库的实例化可以与节点中智能合约的实例化同步完成。In some embodiments, the whitebox keystore and the transport keystore may be built into the blockchain network, and the instantiation of the whitebox keystore and the transport keystore may be done synchronously with the instantiation of the smart contract in the node.

例如,客户端可以向区块链网络节点提交用于部署智能合约镜像文件的交易(即部署交易,携带需要部署的智能合约镜像文件的ID),由节点中的链码服务从镜像文件仓库中读取对应的智能合约镜像文件(智能合约镜像文件中包括智能合约和白盒密码库),并部署在节点的虚拟化运行环境中,至此完成智能合约和白盒密钥库的实例化。For example, a client can submit a transaction for deploying a smart contract image file to a blockchain network node (ie, a deployment transaction, carrying the ID of the smart contract image file to be deployed), and the chaincode service in the node can retrieve the image file from the image file repository. Read the corresponding smart contract image file (the smart contract image file includes the smart contract and the white-box cryptographic library), and deploy it in the virtualized operating environment of the node. At this point, the instantiation of the smart contract and the white-box keystore is completed.

可以理解地,传输密钥库也可以集成在智能合约镜像文件中,采用上述类似的实例化方式,从而一旦节点中部署了智能合约,则白盒密钥库和传输密钥库也同步在节点中被实例化从而提升部署效率。It is understandable that the transmission keystore can also be integrated in the smart contract image file, using a similar instantiation method as above, so that once the smart contract is deployed in the node, the white box keystore and the transmission keystore are also synchronized on the node. It is instantiated in the system to improve deployment efficiency.

当然,白盒密钥库和传输密钥库的实例化可以是独立于智能合约的实例化过程的,镜像文件仓库中可以包括传输密钥库镜像文件以及白盒密钥库镜像文件,从而客户端可以通过提交部署交易,使链码服务将传输密钥库镜像文件和白盒密钥库镜像文件部署到节点的虚拟化运行环境中,以完成传输密钥库和白盒密钥库的实例化。Of course, the instantiation of the white-box keystore and the transmission keystore can be independent of the instantiation process of the smart contract, and the image file warehouse can include the transmission keystore image file and the white-box keystore image file, so that customers can By submitting a deployment transaction, the terminal can make the chaincode service deploy the transmission keystore image file and the white-box keystore image file to the virtualized operating environment of the node, so as to complete the instance of the transmission keystore and the white-box keystore. change.

在另一些实施例中,白盒密钥库可以由客户端建立(或从链下的镜像文件仓库获取)并上传到节点中的链码服务,并由链码服务将白盒密钥库部署在节点的虚拟化进行环境中以完成实例化。In other embodiments, the white-box keystore can be established by the client (or obtained from an off-chain image file repository) and uploaded to the chaincode service in the node, and the white-box keystore can be deployed by the chaincode service In the environment where the virtualization of the node takes place to complete the instantiation.

例如,智能合约镜像文件中可以只包括智能合约,节点中的链码服务响应于客户端提交的用于部署智能合约镜像文件的交易,根据交易中携带的智能合约镜像文件的ID从镜像文件仓库中读取对应的智能合约镜像文件,并部署在节点的虚拟化运行环境中以完成智能合约的实例化;客户端继续向节点提交用于部署传输密钥镜像文件的部署交易(携带了传输密钥库镜像文件的ID),由智能合约来调用链码服务,以将镜像文件仓库中相应的传输密钥库镜像文件部署到节点的虚拟运行环境中,完成传输密钥库的实例化;可以理解地,传输密钥库可以与智能合约集成在智能合约镜像文件中,从而与智能合约被同步部署到节点的虚拟化运行环境中以完成实例化。For example, a smart contract image file can only include smart contracts, and the chaincode service in the node responds to the transaction submitted by the client for deploying the smart contract image file, according to the ID of the smart contract image file carried in the transaction. Read the corresponding smart contract image file in the node, and deploy it in the virtualized operating environment of the node to complete the instantiation of the smart contract; the client continues to submit a deployment transaction to the node for deploying the transmission key image file (carrying the transmission key The ID of the keystore image file), the chaincode service is called by the smart contract to deploy the corresponding transmission keystore image file in the image file warehouse to the virtual operating environment of the node to complete the instantiation of the transmission keystore; Understandably, the transmission keystore can be integrated with the smart contract in the smart contract image file, so that the smart contract is deployed to the virtualized runtime environment of the node in synchronization with the smart contract to complete the instantiation.

继续上述示例,节点中的智能合约调用传输密钥库与客户端协商加密套接字密钥算法和传输密钥,之后,客户端将利用协商得到的传输密钥和加密套接字密钥算法加密部署交易,其中包括客户端待上传的白盒密钥库,并将加密的部署交易发送到节点,由节点中的智能合约调用传输密钥库,以利用加密套接字密钥算法和传输密钥解密部署交易得到白盒密钥库,继续调用链码服务以将客户端上传的白盒密钥库部署到节点的虚拟化运行环境中,至此完成白盒密钥库的实例化。Continuing the above example, the smart contract in the node calls the transmission keystore to negotiate the encrypted socket key algorithm and the encrypted socket key algorithm with the client, after which the client will use the negotiated transmission key and encrypted socket key algorithm Encrypt deployment transaction, which includes the white-box keystore to be uploaded by the client, and send the encrypted deployment transaction to the node, which is invoked by the smart contract in the node to transmit the keystore to utilize the encrypted socket key algorithm and transmission The key decryption deployment transaction obtains the white-box keystore, and continues to call the chaincode service to deploy the white-box keystore uploaded by the client to the virtualized operating environment of the node, thus completing the instantiation of the white-box keystore.

在步骤102中,区块链网络节点中的智能合约调用节点中部署的白盒密钥库,以在白盒密钥库中生成对应原始密钥的白盒密钥。In step 102, the smart contract in the blockchain network node invokes the white-box keystore deployed in the node to generate a white-box key corresponding to the original key in the white-box keystore.

在一些实施例中,智能合约调用区块链网络的节点中部署的白盒密钥库,以进行以下操作:根据原始密钥中各个字段的取值,确定通过原始密钥生成白盒密钥的方式,即变换方式(也称为生成方式);根据确定的变换方式对原始密钥进行变换得到对应的白盒密钥。In some embodiments, the smart contract invokes the white-box keystore deployed in the nodes of the blockchain network to perform the following operations: determine to generate the white-box key by using the original key according to the values of each field in the original key method, that is, the transformation method (also called the generation method); the original key is transformed according to the determined transformation method to obtain the corresponding white-box key.

其中,白盒密钥是在原始密钥的基础上进行变换得到的,在长度、字符类型中的至少一个维度与原始密钥存在差异,本发明实施例不限定具体的变换方式,例如,可以采用逻辑计算(包括异或、置换、代换和移位)、置乱编码和插入扰乱信息等变换方式。The white box key is obtained by transforming the original key, and there is a difference between the original key in at least one dimension of length and character type. The embodiment of the present invention does not limit the specific transformation method. For example, it can be Transformation methods such as logical calculation (including XOR, permutation, substitution and shift), scrambling coding and insertion of scrambling information are adopted.

例如,原始密钥的待变换字段的二进制数据为1时对应的变换方式为:待变换字段与(前一位或后一位)的异或;字段为0时对应的变换方式为相邻位的与或;则遍历原始密钥的各个字段进行变换得到白盒密钥。For example, when the binary data of the to-be-transformed field of the original key is 1, the corresponding transformation method is: the XOR of the to-be-transformed field and (the previous bit or the next bit); when the field is 0, the corresponding transformation method is the adjacent bit and or; then traverse each field of the original key to transform to obtain the white-box key.

由于针对原始密钥的变换是通过原始密钥的各个字段的取值来实现的,从而对原始密钥实现了理想地混淆,即使白盒环境被攻击者侵入并获取到了白盒密钥,也难以从白盒密钥还原出原始密钥,从而保障了原始密钥的安全性。Since the transformation of the original key is realized by the values of the various fields of the original key, the original key is ideally obfuscated. Even if the white-box environment is invaded by an attacker and the white-box key is obtained, the It is difficult to restore the original key from the white-box key, thus ensuring the security of the original key.

在一些实施例中,在步骤102中通过智能合约调用白盒密钥库除了生成对应原始密钥的白盒密钥,还确定对密钥算法进行变换所使用的计算方式,即,对于结合密钥算法和白盒密钥对明文(即交易的明文的二进制数据)到密文的映射,确定对映射进行变换所使用的计算方式。In some embodiments, calling the white-box keystore through the smart contract in step 102 not only generates the white-box key corresponding to the original key, but also determines the calculation method used to transform the key algorithm, that is, for the combined key The key algorithm and the white-box key pair the mapping of plaintext (ie, the binary data of the plaintext of the transaction) to the ciphertext, and determine the calculation method used to transform the mapping.

例如,智能合约调用白盒密钥库以进行以下操作:针对不同客户端提交的不同的原始密钥,确定对密钥算法进行变换时使用相同的计算方式,采用统一的计算方式能够根据提升加密效率。For example, the smart contract calls the white-box keystore to perform the following operations: for different original keys submitted by different clients, it is determined to use the same calculation method when transforming the key algorithm, and the unified calculation method can improve the encryption according to the efficiency.

又例如,智能合约调用白盒密钥库以进行以下操作:根据原始密钥中各个字段的取值,对于结合白盒密钥和密钥算法进行的从明文到密文的映射,确定针对映射进行变换时所使用的计算方式。For another example, the smart contract invokes the white-box keystore to perform the following operations: According to the value of each field in the original key, for the mapping from plaintext to ciphertext by combining the white-box key and the key algorithm, determine the mapping for the mapping. The calculation method to use when making the transformation.

作为确定计算方式的示例,相关技术提供的各种密钥算法,从明文到密文的映射中都包括多种计算方式(例如异或、置换、代换和移位),根据原始密钥中各个字段的取值,对密钥算法中依次出现的计算方式进行变换,当原始密钥的第1个字段的二进制数据为1时,将密钥算法中第1次出现的计算方式变换为异或,当原始密钥的第1个字段的二进制数据为0时,将密钥算法中第1次出现的计算方式变换为与或,以此类推直至密钥算法中所有的计算方式都变换完毕,从而得到对密钥算法进行变换所使用的计算方式。As an example of determining the calculation method, various key algorithms provided in the related art include various calculation methods (such as XOR, permutation, substitution and shift) in the mapping from plaintext to ciphertext. The value of each field transforms the calculation methods that appear in sequence in the key algorithm. When the binary data of the first field of the original key is 1, the first occurrence of the calculation method in the key algorithm is transformed into an exclusive one. Or, when the binary data of the first field of the original key is 0, transform the calculation method of the first occurrence in the key algorithm into AND or, and so on until all the calculation methods in the key algorithm are transformed. , so as to obtain the calculation method used to transform the key algorithm.

从而,使原始密钥中不同的字段所对应的计算方式存在差异,攻击者难以依赖于已经破解的白盒密钥去破解其他客户端的白盒密钥,提升了安全性。Therefore, the calculation methods corresponding to different fields in the original key are different, and it is difficult for an attacker to rely on the cracked white-box key to crack the white-box keys of other clients, which improves the security.

下面说明通过传输密钥库和白盒密钥库上链敏感数据以及查询敏感数据的方案。The following describes the scheme of on-chain sensitive data and query of sensitive data through the transmission keystore and the white-box keystore.

在步骤103中,区块链网络的节点通过智能合约接收客户端提交的用于进行数据的更新操作的交易。In step 103, the node of the blockchain network receives the transaction submitted by the client for performing the data update operation through the smart contract.

在一些实施例中,区块链网络中的节点(例如客户端所加入通道的主节点)在接收客户端提交的用于进行数据的更新操作的交易之前,区块链网络中的节点(例如,客户端所加入通道中的背书节点)接收客户端提交的用于进行数据的更新操作的交易提案,对交易提案进行验证通过后,针对节点中账本的状态数据库模拟执行交易提案中的更新操作,得到对应的键值对数据,例如更新的键值对数据、新增的键值对数据和删除的键值对数据中的至少一个;调用节点中部署的传输密钥库,通过传输密钥加密提案响应后返回客户端,以使客户端根据交易提案和提案响应构造交易。In some embodiments, before a node in the blockchain network (eg, the master node of the channel to which the client joins) receives the transaction submitted by the client for performing the data update operation, the node in the blockchain network (eg, , the endorsement node in the channel joined by the client) receives the transaction proposal submitted by the client for the data update operation, and after the transaction proposal is verified and passed, the state database of the ledger in the node is simulated to execute the update operation in the transaction proposal , obtain the corresponding key-value pair data, such as at least one of the updated key-value pair data, the newly added key-value pair data, and the deleted key-value pair data; call the transmission keystore deployed in the node, through the transmission key The proposal response is encrypted and returned to the client, so that the client can construct a transaction based on the transaction proposal and the proposal response.

在一些实施例中,区块链网络中的节点(例如客户端所加入通道中的主节点)接收客户端提交的用于进行数据的更新操作的交易,可以通过以下方式实现:节点中的智能合约调用节点中的传输密钥库以进行以下操作:与客户端进行通过数字证书的身份验证,在身份验证通过后进行协商操作,以确定所使用的加密套接字密钥算法和传输密钥;以在步骤103中接收客户端通过加密套接字密钥算法和传输密钥加密的、且用于进行数据的更新操作的交易。In some embodiments, the node in the blockchain network (for example, the master node in the channel joined by the client) receives the transaction submitted by the client for performing the data update operation, which can be implemented by the following methods: intelligent The contract calls the transport keystore in the node to perform the following operations: authenticate with the client through a digital certificate, and perform a negotiation operation after the authentication is passed to determine the encrypted socket key algorithm and transport key used ; to receive in step 103 the transaction encrypted by the client through the encrypted socket key algorithm and the transmission key and used for performing the data update operation.

作为进行协商操作以确定所使用的加密套接字密钥算法和传输密钥的示例,节点中的智能合约调用传输密钥库,以与客户端之间传输通过超文本传输安全协议的握手消息,通过握手操作消息在节点和客户端之间交换随机数和加密套接字密钥算法,使节点和客户端均获得的相同的随机数和加密套接字密钥算法,并加密套接字密钥算法对随机数进行计算得到传输密钥。As an example of a negotiation operation to determine the encrypted socket key algorithm and transport key to use, the smart contract in the node calls the transport keystore to transmit the handshake message over the Hypertext Transport Security Protocol with the client , the random number and encrypted socket key algorithm are exchanged between the node and the client through the handshake operation message, so that the node and the client both obtain the same random number and encrypted socket key algorithm, and encrypt the socket The key algorithm calculates the random number to obtain the transmission key.

作为示例,节点通过智能合约与客户端协商的用于加密交易提案/交易的加密套接字密钥算法和传输密钥可以是永久有效的,也可以定期重新协议以进行更新,又或者,当传输密钥的实际使用次数的达到次数阈值时重新协商以进行更新,从而保证原始密钥的安全性。As an example, the encrypted socket key algorithm and transport key for encrypted transaction proposals/transactions negotiated by the node and the client through the smart contract may be permanently valid, or may be periodically re-agreed to update, or, when When the actual usage times of the transmission key reaches the threshold, renegotiation is performed to update, so as to ensure the security of the original key.

需要指出地,节点通过智能合约与客户端协商的用于加密交易提案/交易的加密套接字密钥算法和传输密钥,与上文记载的节点通过智能合约与客户端协商的用于加密原始密钥的加密套接字密钥算法和传输密钥可以相同,也可以不同。It should be pointed out that the encrypted socket key algorithm and transmission key negotiated by the node and the client through the smart contract for encrypting the transaction proposal/transaction are the same as the encrypted socket key algorithm and transmission key negotiated by the node and the client through the smart contract described above. The encrypted socket key algorithm for the raw key and the transport key can be the same or different.

在步骤104中,区块链网络的节点将接收的交易打包为新区块。In step 104, the nodes of the blockchain network package the received transaction into a new block.

在一些实施例中,区块链网络的节点(例如排序节点)将对应所述区块链网络中每个通道接收的多个交易,按照多个交易的时间戳进行排序(例如升序或降序),并打包为相应通道的新区块。In some embodiments, a node (eg, ordering node) of the blockchain network will sort (eg, ascending or descending) multiple transactions received by each channel in the blockchain network according to the timestamps of the multiple transactions. , and packaged as a new block for the corresponding channel.

特别地,当交易被客户端基于加密套接字密钥算法和传输密钥进行了对称加密时,节点可以调用传输密钥库,基于相同的加密套接字密钥算法和传输密钥对交易进行解密后进行打包;当然,也可以直接将加密套接字密钥算法和传输密钥加密的交易进行打包为新区块。In particular, when the transaction is symmetrically encrypted by the client based on the encrypted socket key algorithm and the transport key, the node can call the transport keystore to pair the transaction based on the same encrypted socket key algorithm and transport key. Packing after decryption; of course, the encrypted socket key algorithm and transmission key encrypted transaction can also be directly packed into a new block.

在步骤105中,区块链网络的节点对新区块进行共识验证。In step 105, the nodes of the blockchain network perform consensus verification on the new block.

在一些实施例中,区块链网络中的排序节点将接收的交易打包为对各个通道的新区块后,对应发送到新区块中交易所归属的通道中的主节点,由主节点将新区块广播到通道中的各个记账节点,通道中的各个节点(包括主节点和记账节点)对新区块中的交易进行以下的验证操作:交易格式正确;数字签名合法;符合背书策略;接收到所述新区块的节点加入了所述交易中所指示的通道。In some embodiments, the ordering node in the blockchain network packages the received transaction into a new block for each channel, and sends it to the master node in the channel to which the transaction belongs in the new block, and the master node stores the new block. Broadcast to each accounting node in the channel, each node in the channel (including the master node and the accounting node) performs the following verification operations on the transaction in the new block: the transaction format is correct; the digital signature is legal; it conforms to the endorsement policy; received The node of the new block joins the channel indicated in the transaction.

可以理解地,对于在步骤104中新区块中的交易被加密套接字密钥算法和传输密钥加密的情况,在步骤105中,节点可以调用本地的传输密钥库,以基于预先协商的加密套接字密钥算法和传输密钥进行解密,然后进行共识验证。Understandably, for the case where the transaction in the new block is encrypted by the encrypted socket key algorithm and the transport key in step 104, in step 105, the node can call the local transport keystore to The encrypted socket key algorithm and transport key are decrypted, followed by consensus verification.

在步骤106中,当新区块的共识验证通过时,区块链网络的节点通过智能合约调用节点中部署的白盒密钥库,以基于白盒密钥对新区块进行对称加密。In step 106, when the consensus verification of the new block is passed, the node of the blockchain network invokes the white-box keystore deployed in the node through the smart contract to symmetrically encrypt the new block based on the white-box key.

在一些实施例中,区块链网络节点中的智能合约调用节点中部署的白盒密钥库,以进行以下操作:通过白盒密钥和白盒密钥算法,对新区块中的交易进行对称加密,以替换新区块中原有的交易;从所述新区块的交易中读取所述更新操作的键值对数据,通过所述白盒密钥和所述白盒密钥算法对所述键值对数据进行对称加密。In some embodiments, a smart contract in a blockchain network node invokes a white-box keystore deployed in the node to perform the following operations: perform the following operations on transactions in a new block through a white-box key and a white-box key algorithm Symmetric encryption to replace the original transaction in the new block; read the key-value pair data of the update operation from the transaction of the new block, and use the white-box key and the white-box key algorithm for the The key-value pair encrypts the data symmetrically.

作为对新区块中交易进行加密的示例,通过所述白盒密钥以及所述白盒密钥算法,对所述交易的明文形式的二进制数据(可以是交易数据、交易提案或全部数据)进行映射,并根据对所述白盒密钥算法进行变换使用的计算方式,对所述映射进行变换,以得到对应所述交易的密文形式的二进制数据;其中,交易中被加密的二进制数据可以是交易的提案响应中的交易结果,即键值对数据,也可以提案响应,又或者是交易的全部二进制数据。As an example of encrypting a transaction in a new block, through the white-box key and the white-box key algorithm, the binary data (which may be transaction data, transaction proposal, or all data) in plaintext form of the transaction is performed. mapping, and transform the mapping according to the calculation method used to transform the white-box key algorithm to obtain binary data in the form of ciphertext corresponding to the transaction; wherein, the encrypted binary data in the transaction can be It is the transaction result in the proposal response of the transaction, that is, the key-value pair data, or the proposal response, or all the binary data of the transaction.

作为对键值对数据进行加密的示例,通过所述白盒密钥以及所述白盒密钥算法对所述键值对数据的明文形式的二进制数据进行映射,并根据对所述白盒密钥算法进行变换使用的计算方式,对所述映射进行变换,以得到对应所述键值对数据的密文形式的二进制数据。As an example of encrypting key-value pair data, the white-box key and the white-box key algorithm are used to map the plaintext binary data of the key-value pair data, and according to the white-box encryption The key algorithm is used to transform the calculation method, and the mapping is transformed to obtain binary data in the form of ciphertext corresponding to the key-value pair data.

作为对解密后的交易进行通过白盒密钥的加密的示例,通过所述白盒密钥以及密钥算法对所述交易的明文形式的二进制数据进行映射,并根据对所述密钥算法进行变换使用的计算方式对所述映射进行变换,以得到对应所述交易的密文形式的二进制数据。As an example of encrypting the decrypted transaction with a white-box key, the white-box key and the key algorithm are used to map the binary data of the transaction in the form of plaintext, and according to the encryption of the key algorithm The calculation method used for the transformation transforms the mapping to obtain binary data in the form of ciphertext corresponding to the transaction.

在步骤107中,区块链网络中的节点通过被所述白盒密钥对称加密的新区块更新节点的账本。In step 107, the node in the blockchain network updates the node's ledger with the new block symmetrically encrypted by the white-box key.

在一些实施例中,将通过所述白盒密钥和白盒密钥算法对称加密的新区块,添加到所述节点的账本中的区块链的尾部;将所述新区块的交易中对应所述更新操作的键值对数据,更新到所述节点的账本中的状态数据库,其中,所述键值对数据在白盒密钥库中所述白盒密钥和白盒密钥算法进行了对称加密。In some embodiments, a new block symmetrically encrypted by the white-box key and the white-box key algorithm is added to the end of the blockchain in the ledger of the node; the transaction of the new block corresponds to The key-value pair data of the update operation is updated to the state database in the ledger of the node, wherein the key-value pair data is performed by the white-box key and the white-box key algorithm in the white-box key store. symmetric encryption.

在一些实施例中,区块链网络还支持客户端对存储在账本中的敏感数据进行查询,例如,在步骤108中,客户端向区块链网络的节点提交用于进行数据的查询操作的交易提案,交易提案还可以使用传输密钥和加密套接字密钥算法进行了加密;在步骤109中,区块链网络中的节点(例如背书节点)接收到加密的交易提案时,调用传输密钥库,以通过加密套接字密钥算法和传输密钥对交易提案进行解密操作,从而可以针对解密得到的交易提案进行背书验证。In some embodiments, the blockchain network also supports the client to query the sensitive data stored in the ledger. For example, in step 108, the client submits a data query to the nodes of the blockchain network for querying the data. The transaction proposal, the transaction proposal can also be encrypted using the transmission key and the encrypted socket key algorithm; in step 109, when a node in the blockchain network (such as an endorsing node) receives the encrypted transaction proposal, it calls the transmission The keystore is used to decrypt the transaction proposal through the encrypted socket key algorithm and the transmission key, so that the decrypted transaction proposal can be endorsed and verified.

作为交易提案的背书的示例,执行以下验证操作至少之一:交易提案携带的数字证书由受信任的认证中心签发;交易提案的数字签名有效;交易提案的格式正确;交易提案没有被重复提交。As an example of an endorsement of a transaction proposal, at least one of the following verification operations is performed: the digital certificate carried by the transaction proposal is issued by a trusted certification authority; the digital signature of the transaction proposal is valid; the format of the transaction proposal is correct; the transaction proposal has not been submitted repeatedly.

在步骤110中,当针对交易提案进行背书验证通过时,区块链网络的节点针对本地的账本中的状态数据库模拟执行查询操作,得到对应的键值对数据(即读集)。In step 110, when the endorsement verification for the transaction proposal is passed, the nodes of the blockchain network simulate the query operation against the state database in the local ledger to obtain the corresponding key-value pair data (ie read set).

在步骤111中,区块链网络的节点调用节点中部署的白盒密钥库,以通过白盒密钥和白盒密钥算法对查询到的键值对数据执行解密操作;在步骤112中,区块链网络的节点将解密后得到的键值对数据、节点针对键值对数据的数字签名、节点的数字证书构造为提案响应,并调用节点中部署的传输密钥库,以使用传输密钥和加密套接字密钥算法对提案响应加密,然后在步骤113中发送加密的提案响应到客户端。In step 111, the node of the blockchain network calls the white-box keystore deployed in the node to decrypt the queried key-value data through the white-box key and the white-box key algorithm; in step 112 , the node of the blockchain network constructs the decrypted key-value pair data, the node's digital signature for the key-value pair data, and the node's digital certificate as a proposal response, and calls the transmission keystore deployed in the node to use the transmission The key and encrypted socket key algorithm encrypts the proposal response, and then sends the encrypted proposal response to the client in step 113.

例如,区块链网络中的节点将键值对数据、节点针对键值对数据的数字签名、节点的数字证书构造为提案响应返回客户端;在步骤114中,客户端解密提案响应,验证提案响应携带的数字证书和数字签名,比对多个提案响应中携带的键值对数据是否一致,如果一致,则确定键值对数据为查询操作的目标数据。例如,客户端收集到来自多个节点的提案响应后,首先根据协商得到的加密套接字密钥算法和传输密钥解密提案响应,然后验证提案响应携带的数字证书和数字签名,验证通过后,继续比对多个提案响应中携带的键值对数据是否一致,如果一致,则确定键值对数据为查询操作的目标数据;进而可以在步骤115中,通过键值对数据直接执行与客户端中相关的业务逻辑。For example, the node in the blockchain network constructs the key-value pair data, the node's digital signature for the key-value pair data, and the node's digital certificate as a proposal response and returns it to the client; in step 114, the client decrypts the proposal response and verifies the proposal. The digital certificate and digital signature carried in the response are compared to whether the key-value pair data carried in multiple proposal responses are consistent. If they are consistent, the key-value pair data is determined as the target data of the query operation. For example, after collecting the proposal responses from multiple nodes, the client first decrypts the proposal responses according to the encrypted socket key algorithm and transmission key obtained through negotiation, and then verifies the digital certificate and digital signature carried in the proposal responses. , continue to compare the key-value pair data carried in the multiple proposal responses to see if they are consistent, and if they are consistent, determine that the key-value pair data is the target data of the query operation; related business logic in the terminal.

可以看出,基于敏感数据更新账本的过程中,智能合约本身不持有白盒密钥,基于白盒密钥的加解密操作都由智能合约调用白盒密钥库的方式实现,从而利用白盒密钥库有效避免了白盒攻击,即使白盒密钥泄露,也不会对客户端生成的原始密钥造成安全隐患。It can be seen that in the process of updating the ledger based on sensitive data, the smart contract itself does not hold the white-box key, and the encryption and decryption operations based on the white-box key are realized by the smart contract calling the white-box keystore, so as to utilize the white-box key. The box keystore effectively avoids white box attacks. Even if the white box key is leaked, it will not cause security risks to the original key generated by the client.

下面结合一个具体的区块链网络说明本发明实施例提供的区块链网络的数据处理方案。相关技术需要对上链的数据进行摘要,只能比对敏感数据是否发生改变,对业务本身有较大的限制;常规的数据安全方式不能满足这种需求,由于链上的数据有被长期公开的可能,非对称加密存在效率低下的问题,对称加密则存在被破解的风险。本发明实施例技术方案提出了一种通过白盒密钥的区块链安全解决方案,可以有效解决区块链和状态数据库中的数据存储安全问题。The following describes the data processing solution of the blockchain network provided by the embodiment of the present invention in conjunction with a specific blockchain network. The related technology needs to summarize the data on the chain, and can only compare whether the sensitive data has changed, which has great restrictions on the business itself; conventional data security methods cannot meet this demand, because the data on the chain has been disclosed for a long time. The possibility of asymmetric encryption has the problem of inefficiency, and the symmetric encryption has the risk of being cracked. The technical solution of the embodiment of the present invention proposes a blockchain security solution through a white box key, which can effectively solve the data storage security problem in the blockchain and the state database.

参见图8,图8是本发明实施例提供的密钥体系的示意图,非对称密钥(包括公钥和私钥)用于实现客户端和节点之间的消息传输中形成数字签名,结合数字证书来保证消息的可靠性,例如,客户端向节点的传输的消息中携带客户端基于私钥签署的数字签名和数字证书,供节点验证以确定消息是来自客户端的并且没有被篡改。Referring to FIG. 8, FIG. 8 is a schematic diagram of a key system provided by an embodiment of the present invention. Asymmetric keys (including public and private keys) are used to form digital signatures in message transmission between clients and nodes. The certificate is used to ensure the reliability of the message. For example, the message transmitted from the client to the node carries the digital signature and digital certificate signed by the client based on the private key, for the node to verify that the message is from the client and has not been tampered with.

继续参见图9,图9是本发明实施例提供的敏感数据上链的原理示意图,本发明实施例在区块链网络的节点的虚拟化运行环境(即智能合约VM)部署了白盒密钥库、传输密钥库和智能合约,保证客户端上链的数据的安全性,即使区块链或者状态数据库中的数据对外可见,由于敏感数据是基于白盒密钥加密的,从而保证只有持有原始密钥的客户端可以解密和使用敏感数据,从而保证数据的安全性。下面进行说明。Continuing to refer to FIG. 9 , FIG. 9 is a schematic diagram of the principle of uploading sensitive data to the chain provided by an embodiment of the present invention. An embodiment of the present invention deploys a white-box key in a virtualized operating environment (ie, a smart contract VM) of a node of a blockchain network. library, transmission keystore and smart contract to ensure the security of the data on the client chain, even if the data in the blockchain or state database is visible to the outside world, since the sensitive data is encrypted based on the white box key, it is guaranteed that only Clients with the original key can decrypt and use sensitive data, keeping the data secure. The following description will be made.

在区块链智能合约的基础镜像文件内置白盒密钥库,或者由客户端上传自己的白盒密钥库以实例化到区块链网络的节点中。客户端在上链数据的时候,向区块链网络节点中部署的智能合约传入数据的原始密钥。客户端传输原始密钥前可以使用基于传输密钥库协商的加密套接字密钥算法和传输密钥进行对称加密,智能合约收到加密的原始密钥后可以基于加密套接字密钥算法和传输密钥解密得到原始密钥。The white-box keystore is built into the basic image file of the blockchain smart contract, or the client uploads its own white-box keystore to instantiate it into the nodes of the blockchain network. When the client uploads the data on the chain, it transmits the original key of the data to the smart contract deployed in the blockchain network node. Before the client transmits the original key, it can use the encrypted socket key algorithm and transmission key negotiated based on the transmission keystore to perform symmetric encryption. After the smart contract receives the encrypted original key, it can use the encrypted socket key algorithm based on the encrypted socket key algorithm. And the transmission key is decrypted to get the original key.

智能合约调用节点的虚拟运行环境中的白盒密钥库,对原始密钥处理后得到白盒密钥,使用白盒密钥算法和白盒密钥对客户端上链的数据进行对称加密,并存储到账本中区块链和状态数据库,其他客户端没有办法通过原始密钥破解白盒密钥加密后的数据,从而保证上链数据的安全。The smart contract calls the white-box keystore in the virtual operating environment of the node, processes the original key to obtain the white-box key, and uses the white-box key algorithm and the white-box key to symmetrically encrypt the data on the client chain. And stored in the blockchain and state database in the ledger, other clients have no way to crack the data encrypted by the white box key through the original key, thus ensuring the security of the data on the chain.

白盒密钥库可以是动态白盒密钥库,可以根据不同的原始密钥,采用不同的白盒密钥的生成方式和加密计算方式(即对白盒密钥算法从明文到密文的映射进行变换的计算方式)。The white-box key store can be a dynamic white-box key store, which can use different white-box key generation methods and encryption calculation methods according to different original keys (that is, the mapping of the white-box key algorithm from plaintext to ciphertext). how the transformation is calculated).

当节点的智能合约被实例化后,客户端初始化一个原始密钥,上传原始密钥到节点的智能合约,通过智能合约调用白盒密钥库来对原始密钥变换以生成白盒密钥;白盒密钥库有很多种实现方式,一般是会根据原始密钥的字段,对标准的白盒密钥算法如AES/DES等进行变换,如原始密钥的第一个字段是0,对密钥算法对明文到密文的映射进行变换采用的计算方式可以是异或,第一个字段是1,对密钥算法对明文到密文的映射进行变换采用的计算方式可以是与操作。需要指出地,本发明实施例并不针对具体的白盒密钥库的白盒密钥的生成方式、以及对白盒密钥算法进行变换的具体实现进行限定。When the node's smart contract is instantiated, the client initializes an original key, uploads the original key to the node's smart contract, and calls the white-box keystore through the smart contract to transform the original key to generate a white-box key; There are many ways to implement the white-box keystore. Generally, standard white-box key algorithms such as AES/DES are transformed according to the fields of the original key. For example, the first field of the original key is 0. The calculation method used by the key algorithm to transform the mapping from plaintext to ciphertext can be XOR, the first field is 1, and the calculation method used by the key algorithm to transform the mapping from plaintext to ciphertext can be AND operation. It should be pointed out that the embodiments of the present invention do not limit the specific method of generating the white-box key of the white-box key store and the specific implementation of transforming the white-box key algorithm.

客户端使用数字证书与安装智能合约的节点协商传输密钥tk(使用对称加密)和加密套接字密钥算法,用于保护敏感数据传输到智能合约的安全,传输密钥和加密套接字密钥算法可以定期更新。The client uses the digital certificate to negotiate the transfer key tk (using symmetric encryption) and the encrypted socket key algorithm with the node where the smart contract is installed, which is used to secure the transmission of sensitive data to the smart contract, the transfer key and the encrypted socket The key algorithm can be updated periodically.

智能合约对使用tk加密的敏感数据进行转加密:使用tk解密敏感数据后,使用白盒密钥wk和白盒密钥算法进行对称加密。The smart contract trans-encrypts the sensitive data encrypted with tk: after decrypting the sensitive data with tk, symmetric encryption is performed using the white-box key wk and the white-box key algorithm.

将使用白盒密钥加密的敏感数据保存到账本的区块链和状态数据库中,具体是,将用于存储敏感数据的交易打包为新区块,共识并追加到区块链的尾部,将新区块中交易的交易结果(即写集)中的键值对数据来更新状态数据库,至此,敏感数据上链的过程结束。Save sensitive data encrypted with white-box keys to the blockchain and state database of the ledger, specifically, package the transactions used to store sensitive data into new blocks, agree and append to the end of the blockchain, and store the new block The key-value pair data in the transaction result (ie write set) of the transaction in the block is used to update the state database. At this point, the process of uploading sensitive data to the chain ends.

在敏感数据上链的过程中,敏感数据只在智能合约的内存中出现过,而上链后的敏感数据是基于白盒密钥加密的,由于没有办法被其他客户端破解,保证了敏感数据的安全性。In the process of uploading sensitive data to the chain, the sensitive data has only appeared in the memory of the smart contract, and the sensitive data after the chain is encrypted based on the white box key. Since there is no way to be cracked by other clients, the sensitive data is guaranteed. security.

当客户端需要使用数据时,将原始密钥提交到智能合约,智能合约调用白盒密钥库将原始密钥转换为白盒密钥,将从状态数据库中查询到的敏感数据基于白盒密钥wk和白盒密钥算法进行解密,然后使用传输密钥tk和加密套接字密钥算法进行对称加密,传输到客户端,客户端基于传输密钥tk和加密套接字密钥算法进行解密,进而可以基于敏感数据执行相关的业务逻辑。When the client needs to use the data, the original key is submitted to the smart contract, and the smart contract calls the white-box keystore to convert the original key into a white-box key, and the sensitive data queried from the state database is based on the white-box key The key wk and the white box key algorithm are decrypted, and then symmetric encryption is performed using the transport key tk and the encrypted socket key algorithm, and transmitted to the client. Decryption, and then the relevant business logic can be executed based on the sensitive data.

下面继续说明本发明实施例提供的区块链网络的数据处理装置655实施为软件模块的示例性结构,在一些实施例中,如图6所示,存储在存储器650中的区块链网络的数据处理装置655中的软件模块可以包括:部署在区块链网络的节点中的智能合约、白盒密钥库和共识服务,分别进行说明;还可以包括传输密钥库和链码服务,下面分别进行说明。The following continues to describe an exemplary structure in which the data processing apparatus 655 of the blockchain network provided by the embodiment of the present invention is implemented as a software module. In some embodiments, as shown in FIG. The software modules in the data processing device 655 may include: smart contracts, white-box keystores and consensus services deployed in the nodes of the blockchain network, which will be described respectively; and may also include transmission keystores and chaincode services, which are described below. Explain separately.

部署在区块链网络的节点中的智能合约、白盒密钥库和共识服务;其中,Smart contracts, white-box keystores and consensus services deployed in nodes of a blockchain network; among them,

智能合约,用于通过接收客户端发送的原始密钥,并调用节点中部署的白盒密钥库,以在白盒密钥库中生成对应原始密钥的白盒密钥;The smart contract is used to generate the white-box key corresponding to the original key in the white-box keystore by receiving the original key sent by the client and calling the white-box keystore deployed in the node;

智能合约,用于接收客户端提交的用于进行数据的更新操作的交易,调用共识服务执行以下操作:将接收的交易打包为新区块,并对新区块进行共识验证;The smart contract is used to receive the transaction submitted by the client for data update operation, and call the consensus service to perform the following operations: package the received transaction into a new block, and perform consensus verification on the new block;

智能合约,用于当共识验证通过时,调用白盒密钥库以基于白盒密钥对新区块进行对称加密,并调用共识服务,以通过被白盒密钥对称加密的新区块更新节点的账本。The smart contract is used to call the white-box keystore to symmetrically encrypt the new block based on the white-box key when the consensus verification is passed, and call the consensus service to update the node's ledger.

上述方案中,智能合约还用于调用节点中部署的白盒密钥库,以生成对应原始密钥的白盒密钥时,采用以下实现方式:调用节点中的白盒密钥库,以进行以下操作:根据原始密钥中各个字段的取值,确定与原始密钥对应的变换方式;根据确定的变换方式对原始密钥进行变换得到对应的白盒密钥。In the above scheme, the smart contract is also used to call the white-box keystore deployed in the node to generate the white-box key corresponding to the original key, using the following implementation method: calling the white-box keystore in the node to perform The following operations: determine the transformation mode corresponding to the original key according to the value of each field in the original key; transform the original key according to the determined transformation mode to obtain the corresponding white-box key.

上述方案中,智能合约还用于调用节点中的白盒密钥库时,进行以下操作:根据原始密钥中各个字段的取值,确定对白盒密钥算法进行变换时所使用的计算方式,以使针对不同的原始密钥对白盒密钥算法进行变换时,所使用的计算方式存在差异。In the above scheme, when the smart contract is also used to call the white-box keystore in the node, the following operations are performed: according to the value of each field in the original key, the calculation method used when transforming the white-box key algorithm is determined, In order to transform the white-box key algorithm for different original keys, there are differences in the calculation methods used.

上述方案中,智能合约还用于接收客户端提交的用于进行数据的更新操作的交易时,采用以下实现方式:通过节点中的智能合约调用节点中的传输密钥库,以进行以下操作:与客户端进行基于数字证书的身份验证,并在身份验证通过后进行协商操作,以确定所使用的加密套接字密钥算法和传输密钥;接收客户端的用于进行数据的更新操作的交易,交易被客户端通过加密套接字密钥算法和传输密钥进行了对称加密。In the above solution, when the smart contract is also used to receive the transaction submitted by the client for data update operation, the following implementation method is adopted: The smart contract in the node calls the transmission keystore in the node to perform the following operations: Perform digital certificate-based authentication with the client, and negotiate after the authentication is passed to determine the encrypted socket key algorithm and transmission key used; receive the client's transaction for data update operations , the transaction is symmetrically encrypted by the client through the encrypted socket key algorithm and the transport key.

上述方案中,智能合约还用于调用共识服务将接收的交易打包为新区块时,采用以下实现方式:将对应区块链网络中每个通道接收的多个交易,按照多个交易的时间戳进行排序,并打包为相应通道的新区块。In the above scheme, when the smart contract is also used to call the consensus service to package the received transaction into a new block, the following implementation method is adopted: the multiple transactions received by each channel in the corresponding blockchain network are processed according to the timestamps of the multiple transactions. Sorted and packed as new blocks for the corresponding channel.

上述方案中,智能合约还用于调用共识服务对新区块进行共识验证,采用以下实现方式:对新区块中的交易进行以下的验证操作:交易格式正确;数字签名合法;符合背书策略;接收到新区块的节点加入了交易中所指示的通道。In the above scheme, the smart contract is also used to call the consensus service to perform consensus verification on the new block, which is implemented in the following way: perform the following verification operations on the transactions in the new block: the transaction format is correct; the digital signature is legal; it conforms to the endorsement policy; The nodes of the new block join the channel indicated in the transaction.

上述方案中,智能合约还用于调用传输密钥库进行协商操作,以确定所使用的加密套接字密钥算法和传输密钥时,采用以下实现方式:与客户端之间传输通过超文本传输安全协议的握手消息,以通过握手操作消息使节点和客户端均获得相同的随机数和加密套接字密钥算法,并通过加密套接字密钥算法对随机数进行对称加密得到传输密钥。In the above scheme, the smart contract is also used to call the transmission keystore for negotiation operation to determine the encrypted socket key algorithm and transmission key to be used. The handshake message of the transmission security protocol is used to enable the node and the client to obtain the same random number and encrypted socket key algorithm through the handshake operation message, and the random number is symmetrically encrypted by the encrypted socket key algorithm to obtain the transmission key. key.

上述方案中,智能合约还用于调用白盒密钥库以基于白盒密钥对新区块进行对称加密时,采用以下实现方式:调用节点中的白盒密钥库,以执行以下操作:通过白盒密钥和白盒密钥算法,对新区块中的交易进行对称加密,以替换新区块中原有的交易;从新区块的交易中,读取更新操作的键值对数据,通过白盒密钥和白盒密钥算法对键值对数据进行对称加密。In the above scheme, when the smart contract is also used to call the white-box keystore to encrypt the new block symmetrically based on the white-box key, the following implementation method is adopted: calling the white-box keystore in the node to perform the following operations: White-box key and white-box key algorithm, symmetrically encrypt the transaction in the new block to replace the original transaction in the new block; read the key-value pair data of the update operation from the transaction in the new block, and pass the white box Key and white-box key algorithms symmetric encryption of key-value pair data.

上述方案中,智能合约还用于调用白盒密钥库以对新区块中的交易进行对称加密之前,调用节点中的传输密钥库,以通过加密套接字密钥算法和传输密钥对新区块中的交易进行解密;其中,新区块中交易被客户端通过加密套接字密钥算法和传输密钥进行了对称加密。In the above scheme, the smart contract is also used to call the transmission keystore in the node before calling the white box keystore to symmetrically encrypt the transaction in the new block, so as to pass the encrypted socket key algorithm and the transmission key pair. The transaction in the new block is decrypted; the transaction in the new block is symmetrically encrypted by the client through the encrypted socket key algorithm and the transmission key.

上述方案中,智能合约还用于调用白盒密钥库,以通过白盒密钥和白盒密钥算法,对新区块中的交易进行对称加密时,采用以下实现方式:通过白盒密钥以及白盒密钥算法,对交易的明文形式的二进制数据进行映射,并根据对白盒密钥算法进行变换使用的计算方式,对映射进行变换,以得到对应交易的密文形式的二进制数据。In the above scheme, the smart contract is also used to call the white-box keystore, so as to encrypt the transactions in the new block symmetrically through the white-box key and the white-box key algorithm, the following implementation methods are adopted: through the white-box key And the white-box key algorithm, which maps the binary data in the plaintext form of the transaction, and transforms the mapping according to the calculation method used to transform the white-box key algorithm to obtain the binary data in the ciphertext form of the corresponding transaction.

上述方案中,智能合约还用于调用白盒密钥库,以通过白盒密钥和白盒密钥库对键值对数据进行对称加密时,采用以下实现方式:通过白盒密钥以及白盒密钥算法对键值对数据的明文形式的二进制数据进行映射,并根据对白盒密钥算法进行变换使用的计算方式,对映射进行变换,以得到对应键值对数据的密文形式的二进制数据。In the above scheme, the smart contract is also used to call the white-box keystore to encrypt the key-value data symmetrically through the white-box key and the white-box keystore. The box key algorithm maps the plaintext binary data of the key-value pair data, and transforms the mapping according to the calculation method used to transform the white-box key algorithm to obtain the ciphertext binary data of the corresponding key-value pair data. data.

上述方案中,智能合约还用于调用共识服务,以通过被白盒密钥对称加密的新区块更新节点的账本时,采用以下实现方式:将通过白盒密钥和白盒密钥算法对称加密的新区块,添加到节点的账本中的区块链的尾部;将新区块的交易中对应更新操作的键值对数据,更新到节点的账本中的状态数据库,其中,键值对数据被白盒密钥和白盒密钥算法进行了对称加密。In the above scheme, the smart contract is also used to call the consensus service to update the ledger of the node through the new block symmetrically encrypted by the white-box key. The new block is added to the end of the blockchain in the node's ledger; the key-value pair data corresponding to the update operation in the transaction of the new block is updated to the state database in the node's ledger, wherein the key-value pair data is blanked The box key and white box key algorithms are encrypted symmetrically.

上述方案中,智能合约还用于接收客户端发送的原始密钥之前,当节点中的智能合约的实例部署完成时,接收客户端提交的用于部署白盒密钥库和传输密钥库的交易,并调用节点中的链码服务,以将白盒密钥库和传输密钥库部署到节点的虚拟化运行环境中;或者,响应于客户端提交的用于部署智能合约镜像文件的交易,调用节点中的链码服务,以将智能合约镜像文件中包括的智能合约、白盒密钥库和传输密钥库部署到节点的虚拟化运行环境中。In the above solution, before the smart contract is also used to receive the original key sent by the client, when the deployment of the instance of the smart contract in the node is completed, it receives the information submitted by the client for deploying the white-box keystore and transmitting the keystore. transaction, and call the chaincode service in the node to deploy the white-box keystore and transport keystore to the node's virtualized runtime environment; or, in response to the transaction submitted by the client for deploying the smart contract image file , call the chaincode service in the node to deploy the smart contract, white box keystore and transmission keystore included in the smart contract image file to the virtualized operating environment of the node.

上述方案中,智能合约还用于调用共识服务接收客户端提交的用于进行数据的查询操作的交易提案;调用共识服务,以针对节点的账本中的状态数据库执行查询操作,得到对应的键值对数据;通过交易提案携带的原始密钥,调用所节点中的白盒密钥库,以对原始密钥进行变换得到白盒密钥,并通过白盒密钥对查询到的键值对数据进行解密;调用节点中的传输密钥库,以通过传输密钥和加密套接字密钥算法对解密后的键值对数据进行对称加密;调用共识服务,将加密后的键值对数据构造为提案响应,并返回客户端。In the above solution, the smart contract is also used to call the consensus service to receive the transaction proposal submitted by the client for data query operation; call the consensus service to perform the query operation on the state database in the node's ledger to obtain the corresponding key value For data; through the original key carried by the transaction proposal, call the white-box keystore in the node to transform the original key to obtain the white-box key, and use the white-box key to query the key-value pair data. Decrypt; call the transmission keystore in the node to symmetrically encrypt the decrypted key-value pair data through the transmission key and encrypted socket key algorithm; call the consensus service to construct the encrypted key-value pair data Respond to the proposal and return it to the client.

上述方案中,智能合约还用于调用共识服务,以针对节点的账本中的状态数据库执行查询操作之前,对交易提案执行背书验证,背书验证包括以下至少之一:交易提案携带的数字证书由受信任的认证中心签发;交易提案的数字签名有效;交易提案的格式正确;交易提案没有被重复提交。In the above scheme, the smart contract is also used to call the consensus service to perform endorsement verification on the transaction proposal before performing the query operation on the state database in the ledger of the node. The endorsement verification includes at least one of the following: the digital certificate carried by the transaction proposal is trusted The digital signature of the transaction proposal is valid; the format of the transaction proposal is correct; the transaction proposal has not been submitted repeatedly.

上述方案中,智能合约还用于接收客户端提交的用于进行数据的更新操作的交易之前,接收客户端提交的用于进行数据的更新操作的交易提案,调用共识服务执行以下操作:对交易提案进行验证通过,验证通过后针对节点中账本的状态数据库模拟执行更新操作,得到对应的键值对数据;In the above solution, the smart contract is also used to receive the transaction proposal submitted by the client for updating the data before receiving the transaction for updating the data submitted by the client, and call the consensus service to perform the following operations: The proposal is verified and passed, and after the verification is passed, the update operation is simulated on the state database of the ledger in the node to obtain the corresponding key-value pair data;

调用节点中的传输密钥库,以通过传输密钥和加密套接字密钥算法对键值对数据进行对称加密,并构造为提案响应后返回客户端,以使客户端根据交易提案和提案响应构造交易。Invoke the transport keystore in the node to symmetrically encrypt the key-value pair data through the transport key and encrypted socket key algorithm, and construct it as a proposal response and return it to the client, so that the client can base the transaction on the proposal and the proposal The response constructs the transaction.

本发明实施例提供一种存储有可执行指令的存储介质,其中存储有可执行指令,当可执行指令被处理器执行时,将引起处理器执行本发明实施例提供的区块链网络的数据处理方法。Embodiments of the present invention provide a storage medium storing executable instructions, where executable instructions are stored, and when the executable instructions are executed by a processor, the processor will cause the processor to execute the data of the blockchain network provided by the embodiments of the present invention Approach.

在一些实施例中,存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、闪存、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。In some embodiments, the storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; it may also be various devices including one or any combination of the above-mentioned memories .

作为示例,可执行指令可被部署为在一个计算设备上执行,或者在位于一个地点的多个计算设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算设备上执行。As an example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or alternatively, distributed across multiple sites and interconnected by a communication network execute on.

综上所述,本发明实施例针对非敏感数据和敏感数据采用了差异化的解决方案,尤其是对于敏感数据的处理,通过传输密钥库和白盒密钥库保证了数据传输、数据在区块链网络的不同处理阶段的安全性,解决了客户端链上存放敏感数据的限制,更方便客户端的各种业务扩展,并提升了提升链上敏感数据的安全性,防止敏感被盗用。To sum up, the embodiments of the present invention adopt differentiated solutions for non-sensitive data and sensitive data, especially for the processing of sensitive data. The security of the different processing stages of the blockchain network solves the limitation of storing sensitive data on the client chain, which is more convenient for various business expansion of the client, and improves the security of sensitive data on the chain to prevent sensitive data from being stolen.

以上所述,仅为本发明的实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和范围之内所作的任何修改、等同替换和改进等,均包含在本发明的保护范围之内。The above descriptions are merely examples of the present invention, and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements and improvements made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (13)

1. A method of data processing in a blockchain network, the method comprising:
receiving an original key sent by a client through an intelligent contract in a node of a block chain network, and calling a white box key library deployed in the node to generate a white box key corresponding to the original key in the white box key library;
receiving a transaction submitted by the client and used for updating data, and packaging the received transaction into a new block;
carrying out consensus verification on the new blocks;
when consensus verification passes, invoking the white-box keystore deployed in the node to symmetrically encrypt the new chunk by:
mapping the binary data in the form of the plaintext of the transaction in the new block through the white-box key and the white-box key algorithm, and transforming the mapping according to a calculation mode used for transforming the white-box key algorithm to obtain the binary data in the form of the ciphertext corresponding to the transaction so as to replace the original transaction in the new block; reading the key value pair data of the updating operation from the transaction of the new block, mapping the binary data of the key value pair data in a plain text form through the white-box key and the white-box key algorithm, and transforming the mapping according to a calculation mode used for transforming the white-box key algorithm to obtain the binary data of the key value pair data in a cipher text form;
updating the ledger of the node with new blocks symmetrically encrypted by the white-box key.
2. The method of claim 1, wherein the invoking a white-box keystore deployed in the node to generate a white-box key in the white-box keystore corresponding to the original key comprises:
invoking a white-box keystore in the node to:
determining a transformation mode corresponding to the original key according to the value of each field in the original key;
and transforming the original key according to the determined transformation mode to obtain a corresponding white box key.
3. The method of claim 2, further comprising:
invoking a white-box keystore in the node to:
determining a calculation mode used for transforming a white box key algorithm according to the value of each field in the original key so as to ensure that
When the white-box key algorithm is transformed according to different original keys, the used calculation modes are different.
4. The method of claim 1, wherein receiving a transaction submitted by the client for performing an update operation on data comprises:
invoking, by a smart contract in the node, a transport keystore in the node to:
performing identity authentication based on a digital certificate with the client, and performing negotiation operation after the identity authentication is passed so as to determine a used transmission key algorithm and a used transmission key;
receiving a transaction of the client for updating data, wherein the transaction is symmetrically encrypted by the client through the transmission key algorithm and the transmission key;
said packaging said received transaction into a new block comprising:
sequencing a plurality of transactions received by each channel in the block chain network according to the timestamps of the plurality of transactions, and packaging the transactions into a new block of the corresponding channel;
the performing consensus verification on the new block comprises:
performing the following verification operations on the transaction in the new block:
the transaction format is correct; the digital signature is legal; the endorsement strategy is met; the node receiving the new tile joins the channel indicated in the transaction.
5. The method of claim 4, wherein negotiating to determine the transport key algorithm and transport key used comprises:
transmitting handshake messages with the client through a hypertext transfer security protocol, so that the node and the client obtain the same random number and encryption socket key algorithm through the handshake messages, and
and symmetrically encrypting the random number through the encryption socket key algorithm to obtain the transmission key.
6. The method of claim 1, wherein prior to symmetrically encrypting the transaction in the new block, the method further comprises:
calling a transmission key library in the node to decrypt the transaction in the new block through an encryption socket key algorithm and a transmission key;
wherein the transaction in the new chunk is symmetrically encrypted by the client through the secure socket key algorithm and the transport key.
7. The method of claim 1, wherein the updating the ledger of the node with the new block symmetrically encrypted by the white-box key comprises:
adding new blocks symmetrically encrypted through the white-box key and the white-box key algorithm to the tail of a block chain in the account book of the node;
and updating key value pair data corresponding to the updating operation in the transaction of the new block to a state database in an account book of the node, wherein the key value pair data is symmetrically encrypted by the white-box key and the white-box key algorithm.
8. The method of claim 1, wherein prior to receiving the original key sent by the client via the smart contract in the node of the blockchain network, the method further comprises:
when the instance deployment of the intelligent contract in the node is completed, receiving a transaction which is submitted by the client and comprises a white-box key library and a transmission key library through the intelligent contract, and calling a chain code service in the node to deploy the white-box key library and the transmission key library into a virtualized running environment of the node;
or, in response to a transaction submitted by the client for deploying the intelligent contract image file, invoking a chain code service in the node to deploy an intelligent contract, a white-box keystore and a transport keystore included in the intelligent contract image file into a virtualized operating environment of the node.
9. The method of claim 1, further comprising:
receiving a transaction proposal submitted by the client for data query operation;
executing the query operation aiming at a state database in an account book of the node to obtain corresponding key value pair data;
calling a white box key library in the node through the original key carried by the transaction proposal to transform the original key to obtain a white box key, and decrypting the inquired key value data through the white box key and a white box key algorithm;
calling a transmission key library in the node to symmetrically encrypt the decrypted key value to data through a transmission key and an encryption socket key algorithm;
constructing the symmetrically encrypted key value pair data into a proposal response, and returning the proposal response to the client;
before the query operation is performed on the state database in the ledger of the node, the method further comprises:
performing endorsement verification on the transaction proposal, the endorsement verification comprising at least one of:
the digital certificate carried by the transaction proposal is issued by a trusted authentication center;
the digital signature of the transaction proposal is valid;
the format of the transaction proposal is correct;
the transaction proposal is not repeatedly submitted.
10. The method of any of claims 1 to 9, wherein prior to receiving a transaction submitted by the client for performing an update operation on data, the method further comprises:
receiving a transaction proposal submitted by the client and used for updating data, simulating and executing the updating operation aiming at a state database of an account book in the node after the transaction proposal is verified, and obtaining corresponding key value pair data;
and calling a transmission key library in the node to symmetrically encrypt the key value pair data through a transmission key and an encryption socket key algorithm, constructing the encrypted key value pair data as a proposal response and returning the proposal response to the client, so that the client constructs the transaction according to the transaction proposal and the proposal response.
11. A data processing apparatus of a blockchain network, the apparatus comprising:
an intelligent contract, a white-box keystore, and a consensus service deployed in a node of a blockchain network; wherein,
the intelligent contract is used for receiving an original key sent by a client and calling the white-box key library to generate a white-box key corresponding to the original key;
the intelligent contract is used for receiving the transaction submitted by the client for updating the data and calling the consensus service to execute the following operations: packaging the received transaction into a new block, and carrying out consensus verification on the new block;
the intelligent contract is used for calling the white-box key library when the consensus verification is passed so as to symmetrically encrypt the new block in the following way:
mapping the binary data in the form of the plaintext of the transaction in the new block through the white-box key and the white-box key algorithm, and transforming the mapping according to a calculation mode used for transforming the white-box key algorithm to obtain the binary data in the form of the ciphertext corresponding to the transaction so as to replace the original transaction in the new block; reading the key value pair data of the updating operation from the transaction of the new block, mapping the binary data of the key value pair data in a plain text form through the white-box key and the white-box key algorithm, and transforming the mapping according to a calculation mode used for transforming the white-box key algorithm to obtain the binary data of the key value pair data in a cipher text form;
invoking the consensus service to update the ledger of the node with a new block symmetrically encrypted by the white-box key.
12. An electronic device for operating a node in a blockchain network, the electronic device comprising:
a memory for storing executable instructions;
a processor for implementing the data processing method of a blockchain network of any one of claims 1 to 10 when executing executable instructions stored in the memory.
13. A storage medium storing executable instructions for causing a processor to perform a method of data processing of a blockchain network according to any one of claims 1 to 10 when executed.
CN201910919440.XA 2019-09-26 2019-09-26 Data processing method and device for block chain network, electronic equipment and storage medium Active CN110602138B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911298223.XA CN110933108B (en) 2019-09-26 2019-09-26 Data processing method and device based on block chain network, electronic equipment and storage medium
CN201910919440.XA CN110602138B (en) 2019-09-26 2019-09-26 Data processing method and device for block chain network, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910919440.XA CN110602138B (en) 2019-09-26 2019-09-26 Data processing method and device for block chain network, electronic equipment and storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201911298223.XA Division CN110933108B (en) 2019-09-26 2019-09-26 Data processing method and device based on block chain network, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110602138A CN110602138A (en) 2019-12-20
CN110602138B true CN110602138B (en) 2021-06-11

Family

ID=68863944

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201911298223.XA Active CN110933108B (en) 2019-09-26 2019-09-26 Data processing method and device based on block chain network, electronic equipment and storage medium
CN201910919440.XA Active CN110602138B (en) 2019-09-26 2019-09-26 Data processing method and device for block chain network, electronic equipment and storage medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201911298223.XA Active CN110933108B (en) 2019-09-26 2019-09-26 Data processing method and device based on block chain network, electronic equipment and storage medium

Country Status (1)

Country Link
CN (2) CN110933108B (en)

Families Citing this family (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111046088A (en) * 2019-12-23 2020-04-21 山东爱城市网信息技术有限公司 Block chain-based information delay providing method, equipment and medium
CN111124617B (en) * 2019-12-24 2021-03-16 腾讯科技(深圳)有限公司 Method and device for creating block chain system, storage medium and electronic device
CN111163084B (en) * 2019-12-27 2021-11-09 清创网御(合肥)科技有限公司 Safe storage method based on dynamic election and consensus mechanism
CN111127021B (en) * 2019-12-31 2020-10-30 蚂蚁区块链科技(上海)有限公司 Service request method and device based on block chain
CN111210348B (en) * 2019-12-31 2024-04-19 远光软件股份有限公司 Block chain transaction method, electronic device and storage medium
CN111275438B (en) * 2020-01-14 2023-04-28 北京众享比特科技有限公司 Consensus method, device, equipment and storage medium of block chain network
CN111294205A (en) * 2020-02-24 2020-06-16 联想(北京)有限公司 Key management method and device, computer system and readable storage medium
CN111459672B (en) * 2020-03-30 2023-09-29 百度国际科技(深圳)有限公司 Transaction processing method, device, equipment and medium based on block chain network
CN111669267B (en) * 2020-05-15 2024-02-20 西安纸贵互联网科技有限公司 Blockchain consensus mechanism configuration and endorsement strategy configuration method
CN111353175B (en) * 2020-05-22 2021-01-22 腾讯科技(深圳)有限公司 Data processing method, device, equipment, block chain system and storage medium
CN114116883A (en) * 2020-08-28 2022-03-01 京东方科技集团股份有限公司 Data management method, data management device, block chain network and system
CN112039987B (en) * 2020-08-28 2022-05-20 平安科技(深圳)有限公司 Method and device for processing blocks in block chain, node equipment and storage medium
CN111814203B (en) * 2020-09-08 2020-12-29 江苏神彩科技股份有限公司 Method, device and equipment for processing environmental data and storage medium
CN112634034B (en) * 2020-11-17 2024-06-11 中信银行股份有限公司 Reservation method, reservation device, electronic equipment and computer readable storage medium
CN112732801B (en) * 2021-03-30 2021-08-20 支付宝(杭州)信息技术有限公司 Method and device for querying Fabric Block Link book data
CN112734431B (en) * 2021-03-30 2021-06-25 支付宝(杭州)信息技术有限公司 Method and device for querying Fabric Block Link book data
CN112732799B (en) * 2021-03-30 2021-11-02 支付宝(杭州)信息技术有限公司 Method and device for querying Fabric Block Link book data
CN113079025A (en) * 2021-04-07 2021-07-06 上海万向区块链股份公司 Method and system compatible with multiple public key algorithm signatures
CN115344559A (en) * 2021-05-14 2022-11-15 中国移动通信集团浙江有限公司 Data auditing method, device, equipment and storage medium based on block chain
CN113515534B (en) * 2021-05-18 2023-09-01 深圳大学 Block chain-based concurrent transaction data processing method, device, equipment and medium
CN113630475A (en) * 2021-09-17 2021-11-09 无锡井通网络科技有限公司 Block chain system cluster based on interfacing block chain system and operation method thereof
CN113570465B (en) * 2021-09-18 2022-01-07 杭州远境互联科技有限公司 Block chain signature processing method based on POS (Point of sale) consensus mechanism
CN114022285A (en) * 2021-11-10 2022-02-08 中国科学院计算机网络信息中心 Cross-enterprise cloud computing resource metering method and system based on alliance block chain
CN114564735A (en) * 2022-03-02 2022-05-31 信弈数(北京)科技有限责任公司 Database encryption and complete matching retrieval system
CN114331443B (en) * 2022-03-10 2022-06-21 南京金宁汇科技有限公司 Method and device for deleting block chain data
CN115396103B (en) * 2022-10-26 2023-03-24 杭州海康威视数字技术股份有限公司 AI data sharing method, system and device based on white box key
CN115967527A (en) * 2022-10-27 2023-04-14 航天信息股份有限公司 Internet of things information data transmission method based on white box key
US12045826B1 (en) 2023-02-28 2024-07-23 Blockaid Ltd Techniques for decentralized application discovery and scanning
US11930043B1 (en) 2023-02-28 2024-03-12 Blockaid Ltd Techniques for digital wallet integration and for scanning transactions using integrated modules
CN117527832A (en) * 2024-01-03 2024-02-06 杭州趣链科技有限公司 Transaction ordering method and device for blockchain, electronic equipment and storage medium
CN119831740A (en) * 2024-12-17 2025-04-15 中国工商银行股份有限公司 User data processing method and device based on block chain and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018162628A1 (en) * 2017-03-10 2018-09-13 Irdeto B.V. Secured system operation
CN109768866A (en) * 2019-03-05 2019-05-17 同济大学 An inseparable signature method for blockchain smart contracts based on elliptic curve digital signatures
CN109802962A (en) * 2019-01-16 2019-05-24 广东辰宜信息科技有限公司 Encryption and decryption method in a kind of block chain technology
CN110086633A (en) * 2019-05-13 2019-08-02 广东辰宜信息科技有限公司 Ciphertext tamper resistant method in a kind of block chain technology

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268477B (en) * 2014-09-26 2017-09-26 华为技术有限公司 A kind of method of controlling security and the network equipment
KR20170097509A (en) * 2016-02-18 2017-08-28 한국전자통신연구원 Operation method based on white-box cryptography and security apparatus for performing the method
CN106411518B (en) * 2016-09-26 2019-05-07 北京梆梆安全科技有限公司 A kind of unfixed symmetrical whitepack encryption method of key and device
US10140612B1 (en) * 2017-12-15 2018-11-27 Clover Network, Inc. POS system with white box encryption key sharing
CN108123794A (en) * 2017-12-20 2018-06-05 上海众人网络安全技术有限公司 The generation method and encryption method of whitepack key, apparatus and system
WO2019127278A1 (en) * 2017-12-28 2019-07-04 深圳达闼科技控股有限公司 Safe access blockchain method, apparatus, system, storage medium, and electronic device
US11831409B2 (en) * 2018-01-12 2023-11-28 Nok Nok Labs, Inc. System and method for binding verifiable claims
CN108898412A (en) * 2018-05-08 2018-11-27 广东奥园奥买家电子商务有限公司 A kind of block chain member device digital assets processing platform
CN108769173B (en) * 2018-05-21 2021-11-09 阿里体育有限公司 Block chain implementation method and equipment for running intelligent contracts
CN109033855B (en) * 2018-07-18 2020-02-11 腾讯科技(深圳)有限公司 Data transmission method and device based on block chain and storage medium
CN109325855B (en) * 2018-08-16 2021-01-26 北京京东尚科信息技术有限公司 Block chain network, deployment method and storage medium
CN109257162A (en) * 2018-11-02 2019-01-22 北京京东金融科技控股有限公司 The method and apparatus of Encryption Algorithm whitepack
CN109598616B (en) * 2018-12-09 2023-08-22 大连飞创信息技术有限公司 Method for protecting privacy of blockchain data by introducing arbitration mechanism
CN109660542A (en) * 2018-12-25 2019-04-19 百度在线网络技术(北京)有限公司 Data processing method, device and terminal
CN109728914B (en) * 2019-01-23 2022-04-08 北京奇艺世纪科技有限公司 Digital signature verification method, system, device and computer readable storage medium
CN110162992B (en) * 2019-05-31 2022-06-28 联想(北京)有限公司 Data processing method, data processing device and computer system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018162628A1 (en) * 2017-03-10 2018-09-13 Irdeto B.V. Secured system operation
CN109802962A (en) * 2019-01-16 2019-05-24 广东辰宜信息科技有限公司 Encryption and decryption method in a kind of block chain technology
CN109768866A (en) * 2019-03-05 2019-05-17 同济大学 An inseparable signature method for blockchain smart contracts based on elliptic curve digital signatures
CN110086633A (en) * 2019-05-13 2019-08-02 广东辰宜信息科技有限公司 Ciphertext tamper resistant method in a kind of block chain technology

Also Published As

Publication number Publication date
CN110602138A (en) 2019-12-20
CN110933108B (en) 2021-05-11
CN110933108A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
CN110602138B (en) Data processing method and device for block chain network, electronic equipment and storage medium
US12273470B2 (en) Data processing method and apparatus, intelligent device, and storage medium
EP3721603B1 (en) System and method for creating decentralized identifiers
US12189793B2 (en) Cryptographically secure post-secrets-provisioning services
CN111090875B (en) Contract deployment method and device
EP3688930B1 (en) System and method for issuing verifiable claims
Li et al. FADB: A fine-grained access control scheme for VANET data based on blockchain
CN113609222B (en) Certificate processing method, device, electronic device and storage medium for blockchain network
CN110572398B (en) Block chain network control method, device, equipment and storage medium
CN109617699B (en) A key generation method, blockchain network service platform and storage medium
WO2019179535A2 (en) System and method for verifying verifiable claims
CN110544095A (en) Transaction processing method of block chain network and block chain network
WO2021036183A1 (en) Method and apparatus for carrying out secure multi-party computation by means of certificate issuing
CN118764201A (en) A trusted authentication security chip system and control method for the Internet of Things
CN118826998A (en) A method and device for secure storage and sharing of key privacy data
CN116015856A (en) Data transfer method and device based on blockchain digital identity
CN117014176A (en) Block chain-based data processing method, device, equipment and readable storage medium
CN115361147A (en) Device registration method and device, computer device and storage medium
HK40018310A (en) Method, apparatus, electronic device, and storage medium for data processing based on blockchain network
HK40018310B (en) Method, apparatus, electronic device, and storage medium for data processing based on blockchain network
HK40015596A (en) Method, apparatus, electronic device, and storage medium for processing data of blockchain network
HK40015596B (en) Method, apparatus, electronic device, and storage medium for processing data of blockchain network
TWM585941U (en) Account data processing system
CN115987526B (en) A data sharing method, system and device based on business chain
EP4287560A1 (en) Encryption and decryption of transactions of a distributed ledger

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40015596

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载