WO2021103794A1 - Method for realizing highly efficient privacy-preserving transaction in blockchain, and device - Google Patents

Method for realizing highly efficient privacy-preserving transaction in blockchain, and device Download PDF

Info

Publication number
WO2021103794A1
WO2021103794A1 PCT/CN2020/117534 CN2020117534W WO2021103794A1 WO 2021103794 A1 WO2021103794 A1 WO 2021103794A1 CN 2020117534 W CN2020117534 W CN 2020117534W WO 2021103794 A1 WO2021103794 A1 WO 2021103794A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
verification
consensus
blockchain node
private
Prior art date
Application number
PCT/CN2020/117534
Other languages
French (fr)
Chinese (zh)
Inventor
刘琦
闫莺
魏长征
Original Assignee
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021103794A1 publication Critical patent/WO2021103794A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Storage Device Security (AREA)

Abstract

Provided in one or more embodiments of the present invention are a method for realizing a highly efficient privacy-preserving transaction in a blockchain, and a device. The method can comprise: a blockchain node transferring a private transaction submitted by a client to a trusted execution environment so as to subject the private transaction to pre-consensus validation, and buffering at least a portion of data used in the process of pre-consensus validation; if the private transaction passes the pre-consensus validation, the blockchain node and other blockchain nodes performing consensus processing on the private transaction; and the blockchain node transferring the private transaction that has undergone the consensus processing to the trusted execution environment to be executed, and using the at least one portion of buffered data in the process of executing the private transaction.

Description

在区块链中实现隐私保护的高效交易方法及装置High-efficiency transaction method and device for realizing privacy protection in blockchain 技术领域Technical field
本说明书一个或多个实施例涉及终端技术领域,尤其涉及一种在区块链中实现隐私保护的高效交易方法及装置。One or more embodiments of this specification relate to the field of terminal technology, and in particular to an efficient transaction method and device for realizing privacy protection in a blockchain.
背景技术Background technique
区块链技术构建在传输网络(例如点对点网络)之上。传输网络中的网络节点利用链式数据结构来验证与存储数据,并采用分布式节点共识算法来生成和更新数据。Blockchain technology is built on a transmission network (such as a peer-to-peer network). The network nodes in the transmission network use chained data structures to verify and store data, and use distributed node consensus algorithms to generate and update data.
目前企业级的区块链平台技术上最大的两个挑战就是隐私和性能,往往这两个挑战很难同时解决。大多解决方案都是通过损失性能换取隐私,或者不大考虑隐私去追求性能。常见的解决隐私问题的加密技术,如同态加密(Homomorphic encryption)和零知识证明(Zero-knowledge proof)等复杂度高,通用性差,而且还可能带来严重的性能损失。At present, the two biggest challenges in enterprise-level blockchain platform technology are privacy and performance, and it is often difficult to solve these two challenges at the same time. Most of the solutions are to lose performance in exchange for privacy, or do not consider privacy to pursue performance. Common encryption technologies to solve privacy problems, such as Homomorphic encryption and Zero-knowledge proof, are highly complex, have poor versatility, and may also cause serious performance losses.
可信执行环境(Trusted Execution Environment,TEE)是另一种解决隐私问题的方式。TEE可以起到硬件中的黑箱作用,在TEE中执行的代码和数据操作系统层都无法偷窥,只有代码中预先定义的接口才能对其进行操作。在效率方面,由于TEE的黑箱性质,在TEE中进行运算的是明文数据,而不是同态加密中的复杂密码学运算,计算过程效率没有损失,因此与TEE相结合可以在性能损失较小的前提下很大程度上提升区块链的安全性和隐私性。目前工业界十分关注TEE的方案,几乎所有主流的芯片和软件联盟都有自己的TEE解决方案,包括软件方面的TPM(Trusted Platform Module,可信赖平台模块)以及硬件方面的Intel SGX(Software Guard Extensions,软件保护扩展)、ARM Trustzone(信任区)和AMD PSP(Platform Security Processor,平台安全处理器)。Trusted Execution Environment (TEE) is another way to solve privacy issues. TEE can play the role of a black box in the hardware. Neither the code executed in the TEE nor the data operating system layer can be peeped, and only the pre-defined interface in the code can operate on it. In terms of efficiency, due to the black-box nature of TEE, what is calculated in TEE is plaintext data, rather than complex cryptographic operations in homomorphic encryption. There is no loss of efficiency in the calculation process. Therefore, the combination with TEE can achieve less performance loss. Under the premise, the security and privacy of the blockchain are greatly improved. At present, the industry is very concerned about the TEE solution. Almost all mainstream chip and software alliances have their own TEE solutions, including TPM (Trusted Platform Module) in software and Intel SGX (Software Guard Extensions) , Software Protection Extension), ARM Trustzone (trust zone) and AMD PSP (Platform Security Processor, platform security processor).
发明内容Summary of the invention
有鉴于此,本说明书一个或多个实施例提供一种在区块链中实现隐私保护的高效交易方法及装置。In view of this, one or more embodiments of this specification provide an efficient transaction method and device for realizing privacy protection in the blockchain.
为实现上述目的,本说明书一个或多个实施例提供技术方案如下。In order to achieve the foregoing objectives, one or more embodiments of the present specification provide the following technical solutions.
根据本说明书一个或多个实施例的第一方面,提出了一种在区块链中实现隐私保护的高效交易方法,包括:区块链节点将客户端提交的隐私交易传入可信执行环境中以对 所述隐私交易进行共识前校验,并对共识前校验的过程中使用的至少一部分数据进行缓存;在所述隐私交易通过共识前校验的情况下,所述区块链节点与其他区块链节点对所述隐私交易进行共识处理;所述区块链节点将经过共识的所述隐私交易传入所述可信执行环境中予以执行,并在交易执行的过程中使用缓存的所述至少一部分数据。According to the first aspect of one or more embodiments of this specification, an efficient transaction method for realizing privacy protection in the blockchain is proposed, including: the blockchain node transmits the private transaction submitted by the client to the trusted execution environment China and Israel perform pre-consensus verification on the private transaction, and cache at least part of the data used in the pre-consensus verification process; in the case that the private transaction passes the pre-consensus verification, the blockchain node Perform consensus processing on the privacy transaction with other blockchain nodes; the blockchain node transfers the consensus privacy transaction into the trusted execution environment for execution, and uses the cache in the transaction execution process At least part of the data.
根据本说明书一个或多个实施例的第二方面,提出了一种在区块链中实现隐私保护的高效交易方法,包括:区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验,并将所述隐私交易的信息与共识前校验的校验结果进行关联记录;在所述隐私交易通过共识前校验的情况下,所述区块链节点与其他区块链节点对所述隐私交易进行共识处理;所述区块链节点针对收到的经过共识的任一隐私交易,查询记录的对应于所述任一隐私交易的校验结果;在查询到的校验结果为通过校验的情况下,所述区块链节点将所述任一隐私交易传入所述可信执行环境中予以执行;在查询到的校验结果为未通过校验或未查询到校验结果的情况下,所述区块链节点将所述任一隐私交易传入所述可信执行环境中进行执行时校验,并在所述任一隐私交易通过执行时校验的情况下执行所述任一隐私交易。According to the second aspect of one or more embodiments of this specification, an efficient transaction method for realizing privacy protection in the blockchain is proposed, including: the blockchain node transmits the private transaction submitted by the client to the trusted execution environment China Israel performs pre-consensus verification on the private transaction, and associates the information of the private transaction with the verification result of the pre-consensus verification; in the case that the private transaction passes the pre-consensus verification, the The blockchain node and other blockchain nodes conduct consensus processing on the privacy transaction; the blockchain node queries and records the school for any private transaction that is received through consensus. Verification result; in the case that the verification result obtained is passed verification, the blockchain node transmits any of the privacy transactions to the trusted execution environment for execution; in the verification result obtained In the case that the verification fails or the verification result is not queried, the blockchain node transmits any one of the privacy transactions to the trusted execution environment for execution-time verification, and performs verification on any one of the Any one of the above-mentioned private transactions is executed when the private transaction passes the execution-time verification.
根据本说明书一个或多个实施例的第三方面,提出了一种在区块链中实现隐私保护的高效交易装置,包括:共识前校验单元,使区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验;缓存单元,使所述区块链节点对共识前校验的过程中使用的至少一部分数据进行缓存;共识单元,使所述区块链节点在所述隐私交易通过共识前校验的情况下,与其他区块链节点对所述隐私交易进行共识处理;执行单元,使所述区块链节点将经过共识的所述隐私交易传入所述可信执行环境中予以执行,并在交易执行的过程中使用缓存的所述至少一部分数据。According to the third aspect of one or more embodiments of this specification, an efficient transaction device for realizing privacy protection in the blockchain is proposed, including: a pre-consensus verification unit, which enables the blockchain node to submit the privacy of the client The transaction is passed into the trusted execution environment to perform pre-consensus verification on the private transaction; the cache unit enables the blockchain node to cache at least part of the data used in the pre-consensus verification process; the consensus unit enables The blockchain node performs consensus processing on the privacy transaction with other blockchain nodes in the case that the privacy transaction passes the consensus verification; the execution unit enables the blockchain node to pass the consensus process The private transaction is transferred to the trusted execution environment for execution, and the at least a part of the cached data is used during the execution of the transaction.
根据本说明书一个或多个实施例的第四方面,提出了一种在区块链中实现隐私保护的高效交易装置,包括:共识前校验单元,使区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验;记录单元,使所述区块链节点将所述隐私交易的信息与共识前校验的校验结果进行关联记录;共识单元,使所述区块链节点在所述隐私交易通过共识前校验的情况下,与其他区块链节点对所述隐私交易进行共识处理;查询单元,使所述区块链节点针对收到的经过共识的任一隐私交易,查询记录的对应于所述任一隐私交易的校验结果;执行单元,在查询到的校验结果为通过校验的情况下,使所述区块链节点将所述任一隐私交易传入所述可信执行环境中予以执行;在查询到的校验结果为未通过校验或未查询到校验结果的情况下,使所述区块链节点将所 述任一隐私交易传入所述可信执行环境中进行执行时校验,并在所述任一隐私交易通过执行时校验的情况下执行所述任一隐私交易。According to the fourth aspect of one or more embodiments of this specification, an efficient transaction device for implementing privacy protection in the blockchain is proposed, which includes: a pre-consensus verification unit that enables the blockchain node to submit the privacy of the client The transaction is passed into the trusted execution environment to perform pre-consensus verification on the private transaction; the recording unit enables the blockchain node to associate the information of the private transaction with the verification result of the pre-consensus verification; The consensus unit enables the blockchain node to perform consensus processing on the private transaction with other blockchain nodes when the private transaction passes the consensus verification; the query unit enables the blockchain node to target For any private transaction received through consensus, the query record corresponds to the verification result of any private transaction; the execution unit, in the case that the queried verification result is passed verification, makes the block The chain node transmits any of the privacy transactions to the trusted execution environment for execution; in the case that the checked verification result is not passed or the verification result is not checked, the blockchain The node transmits any one of the privacy transactions to the trusted execution environment for execution time verification, and executes any one of the privacy transactions in the case where the any one privacy transaction passes the execution time verification.
根据本说明书一个或多个实施例的第五方面,提出了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如第一方面或第二方面所述的方法。According to a fifth aspect of one or more embodiments of this specification, an electronic device is proposed, including: a processor; a memory for storing executable instructions of the processor; wherein the processor runs the executable instructions In order to realize the method as described in the first aspect or the second aspect.
根据本说明书一个或多个实施例的第六方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面或第二方面所述方法的步骤。According to a sixth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided, which stores computer instructions, which when executed by a processor, implements the method described in the first or second aspect A step of.
根据本说明书一个或多个实施例的第七方面,提出了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如第三方面或第四方面所述的方法。According to a seventh aspect of one or more embodiments of this specification, an electronic device is proposed, including: a processor; a memory for storing executable instructions of the processor; wherein the processor runs the executable instructions To achieve the method described in the third aspect or the fourth aspect.
根据本说明书一个或多个实施例的第八方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第三方面或第四方面所述方法的步骤。According to the eighth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided with computer instructions stored thereon, and when the instructions are executed by a processor, the method described in the third aspect or the fourth aspect is implemented A step of.
附图说明Description of the drawings
图1是一示例性实施例提供的一种区块链节点对交易进行处理的示意图。Fig. 1 is a schematic diagram of a blockchain node processing a transaction according to an exemplary embodiment.
图2是一示例性实施例提供的一种在区块链中实现隐私保护的高效交易方法的流程图。Fig. 2 is a flowchart of an efficient transaction method for realizing privacy protection in a blockchain according to an exemplary embodiment.
图3是一示例性实施例提供的一种创建智能合约的示意图。Fig. 3 is a schematic diagram of creating a smart contract according to an exemplary embodiment.
图4是一示例性实施例提供的一种调用智能合约的示意图。Fig. 4 is a schematic diagram of invoking a smart contract provided by an exemplary embodiment.
图5是一示例性实施例提供的另一种在区块链中实现隐私保护的高效交易方法的流程图。Fig. 5 is a flowchart of another efficient transaction method for implementing privacy protection in a blockchain provided by an exemplary embodiment.
图6是一示例性实施例提供的一种设备的结构示意图。Fig. 6 is a schematic structural diagram of a device provided by an exemplary embodiment.
图7是一示例性实施例提供的一种在区块链中实现隐私保护的高效交易装置的框图。Fig. 7 is a block diagram of an efficient transaction device for realizing privacy protection in a blockchain according to an exemplary embodiment.
图8是一示例性实施例提供的另一种设备的结构示意图。Fig. 8 is a schematic structural diagram of another device provided by an exemplary embodiment.
图9是一示例性实施例提供的另一种在区块链中实现隐私保护的高效交易装置的框图。Fig. 9 is a block diagram of another high-efficiency transaction device for implementing privacy protection in a blockchain according to an exemplary embodiment.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。The exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with one or more embodiments of this specification. Rather, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。It should be noted that in other embodiments, the steps of the corresponding method may not be executed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step in other embodiments. description.
区块链一般被划分为三种类型:公有链(Public Blockchain),私有链(Private Blockchain)和联盟链(Consortium Blockchain)。此外,还有多种类型的结合,比如私有链+联盟链、联盟链+公有链等不同组合形式。其中去中心化程度最高的是公有链。公有链以比特币、以太坊为代表,加入公有链的参与者可以读取链上的数据记录、参与交易以及竞争新区块的记账权等。而且,各参与者(即节点)可自由加入以及退出网络,并进行相关操作。私有链则相反,该网络的写入权限由某个组织或者机构控制,数据读取权限受组织规定。简单来说,私有链可以为一个弱中心化系统,参与节点具有严格限制且少。这种类型的区块链更适合于特定机构内部使用。联盟链则是介于公有链以及私有链之间的区块链,可实现“部分去中心化”。联盟链中各个节点通常有与之相对应的实体机构或者组织;参与者通过授权加入网络并组成利益相关联盟,共同维护区块链运行。Blockchain is generally divided into three types: Public Blockchain, Private Blockchain and Consortium Blockchain. In addition, there are many types of combinations, such as private chain + alliance chain, alliance chain + public chain and other different combinations. Among them, the most decentralized one is the public chain. The public chain is represented by Bitcoin and Ethereum. Participants who join the public chain can read the data records on the chain, participate in transactions, and compete for the accounting rights of new blocks. Moreover, each participant (ie, node) can freely join and exit the network, and perform related operations. The private chain is the opposite. The write permission of the network is controlled by an organization or institution, and the data read permission is regulated by the organization. In simple terms, the private chain can be a weakly centralized system with strict restrictions and few participating nodes. This type of blockchain is more suitable for internal use by specific institutions. Consortium chain is a block chain between public chain and private chain, which can realize "partial decentralization". Each node in the alliance chain usually has a corresponding entity or organization; participants are authorized to join the network and form a stakeholder alliance to jointly maintain the operation of the blockchain.
不论是公有链、私有链还是联盟链,区块链网络中的节点出于隐私保护的目的,均可能通过区块链与TEE(Trusted Execution Environment,可信执行环境)相结合的解决方案,在TEE内执行收到的交易。例如图1所示,区块链节点包括左侧的常规执行环境和右侧的可信执行环境(以下简称TEE),客户端(或其他来源)提交的交易首先进入常规执行环境中的“交易调度”接口进行类型识别,将识别出的明文交易留在常规执行环境中进行处理(对应于左侧的“交易执行”环节),而将识别出的隐私交易传递至TEE中进行处理(对应于右侧的“交易执行”环节)。Regardless of whether it is a public chain, a private chain, or a consortium chain, for the purpose of privacy protection, the nodes in the blockchain network may use a solution that combines the blockchain and TEE (Trusted Execution Environment). Execute received transactions within TEE. For example, as shown in Figure 1, the blockchain node includes the conventional execution environment on the left and the trusted execution environment (hereinafter referred to as TEE) on the right. The transaction submitted by the client (or other sources) first enters the "transaction" in the conventional execution environment. The "Scheduling" interface performs type identification, leaving the identified plaintext transactions in the regular execution environment for processing (corresponding to the "transaction execution" link on the left), and passing the identified private transactions to the TEE for processing (corresponding to The "transaction execution" link on the right).
TEE是基于CPU硬件的安全扩展,且与外部完全隔离的可信执行环境。TEE最早是由Global Platform提出的概念,用于解决移动设备上资源的安全隔离,平行于操作系统为应用程序提供可信安全的执行环境。ARM的Trust Zone技术最早实现了真正商用的TEE技术。伴随着互联网的高速发展,安全的需求越来越高,不仅限于移动设备,云端设备,数据中心都对TEE提出了更多的需求。TEE的概念也得到了高速的发展和扩充。现在所说的TEE相比与最初提出的概念已经是更加广义的TEE。例如,服务器芯片厂商Intel,AMD等都先后推出了硬件辅助的TEE并丰富了TEE的概念和特性,在工业界得到了广泛的认可。现在提起的TEE通常更多指这类硬件辅助的TEE技术。不同于移动端,云端访问需要远程访问,终端用户对硬件平台不可见,因此使用TEE的第一步就是要确认TEE的真实可信。因此现在的TEE技术都引入了远程证明机制,由硬件厂商(主要是CPU厂商)背书并通过数字签名技术确保用户对TEE状态可验证。同时仅仅是安全的资源隔离也无法满足的安全需求,进一步的数据隐私保护也被提出。包括Intel SGX,AMD SEV在内的商用TEE也都提供了内存加密技术,将可信硬件限定在CPU内部,总线和内存的数据均是密文防止恶意用户进行窥探。例如,英特尔的软件保护扩展(SGX)等TEE技术隔离了代码执行、远程证明、安全配置、数据的安全存储以及用于执行代码的可信路径。在TEE中运行的应用程序受到安全保护,几乎不可能被第三方访问。TEE is a secure extension based on CPU hardware and a trusted execution environment that is completely isolated from the outside. TEE was first proposed by Global Platform to solve the security isolation of resources on mobile devices, and parallel to the operating system to provide a trusted and secure execution environment for applications. ARM's Trust Zone technology is the first to realize the real commercial TEE technology. With the rapid development of the Internet, security requirements are getting higher and higher. Not only mobile devices, cloud devices, and data centers have put forward more demands on TEE. The concept of TEE has also been rapidly developed and expanded. Compared with the original concept, the TEE referred to now is a broader TEE. For example, server chip manufacturers Intel, AMD, etc. have successively introduced hardware-assisted TEE and enriched the concept and characteristics of TEE, which has been widely recognized in the industry. The TEE mentioned now usually refers more to this kind of hardware-assisted TEE technology. Unlike the mobile terminal, cloud access requires remote access, and the end user is invisible to the hardware platform. Therefore, the first step in using TEE is to confirm the authenticity of TEE. Therefore, the current TEE technology has introduced a remote certification mechanism, which is endorsed by hardware vendors (mainly CPU vendors) and digital signature technology ensures that users can verify the state of the TEE. At the same time, security needs that cannot be met by only secure resource isolation, further data privacy protection has also been proposed. Commercial TEEs, including Intel SGX and AMD SEV, also provide memory encryption technology to limit trusted hardware to the inside of the CPU. The data on the bus and memory are ciphertexts to prevent malicious users from snooping. For example, TEE technologies such as Intel’s Software Protection Extensions (SGX) isolate code execution, remote attestation, secure configuration, secure storage of data, and trusted paths for code execution. The applications running in the TEE are protected by security and are almost impossible to be accessed by third parties.
以Intel SGX技术为例,SGX提供了围圈(enclave,也称为飞地),即内存中一个加密的可信执行区域,由CPU保护数据不被窃取。以第一区块链节点采用支持SGX的CPU为例,利用新增的处理器指令,在内存中可以分配一部分区域EPC(Enclave Page Cache,围圈页面缓存或飞地页面缓存),通过CPU内的加密引擎MEE(Memory Encryption Engine)对其中的数据进行加密。EPC中加密的内容只有进入CPU后才会被解密成明文。因此,在SGX中,用户可以不信任操作系统、VMM(Virtual Machine Monitor,虚拟机监控器)、甚至BIOS(Basic Input Output System,基本输入输出系统),只需要信任CPU便能确保隐私数据不会泄漏。实际应用中,可以将隐私数据加密后以密文形式传递至围圈中,并通过远程证明将对应的秘钥也传入围圈。然后,在CPU的加密保护下利用数据进行运算,结果会以密文形式返回。这种模式下,既可以利用强大的计算力,又不用担心数据泄漏。Taking Intel SGX technology as an example, SGX provides an enclave (also called an enclave), which is an encrypted trusted execution area in the memory, and the CPU protects data from being stolen. Taking the first blockchain node using a CPU that supports SGX as an example, using the newly added processor instructions, a part of the area EPC (Enclave Page Cache, enclave page cache or enclave page cache) can be allocated in the memory, and through the CPU The encryption engine MEE (Memory Encryption Engine) encrypts the data in it. The encrypted content in the EPC will only be decrypted into plaintext after entering the CPU. Therefore, in SGX, users can distrust the operating system, VMM (Virtual Machine Monitor), and even BIOS (Basic Input Output System). They only need to trust the CPU to ensure that private data will not leakage. In practical applications, the private data can be encrypted and transmitted to the circle in cipher text, and the corresponding secret key can also be transmitted to the circle through remote attestation. Then, use the data to perform operations under the encryption protection of the CPU, and the result will be returned in the form of ciphertext. In this mode, powerful computing power can be used without worrying about data leakage.
区块链节点在收到客户端提交的交易后,需要对该交易进行共识前校验,并将通过校验的交易发送至其他区块链节点,使得各个区块链节点对该交易进行共识。共识前校验通常包括检查交易是否有效、格式是否正确、验证交易的签名是否合法等,本说明书 并不对此进行限制。未通过校验的交易可能无法通过共识或者在共识后无法正确执行,因而通过共识前校验排除未通过校验的交易,可以减少对这些交易进行共识或执行而造成的网络开销、其他区块链节点的运行开销等。After the blockchain node receives the transaction submitted by the client, it needs to verify the transaction before consensus, and send the verified transaction to other blockchain nodes, so that each blockchain node can agree on the transaction . Pre-consensus verification usually includes checking whether the transaction is valid, the format is correct, and whether the signature of the transaction is legal, etc. This manual does not limit this. Transactions that fail the verification may not pass the consensus or cannot be executed correctly after the consensus. Therefore, passing the pre-consensus verification to exclude the transactions that have not passed the verification can reduce the network overhead and other blocks caused by the consensus or execution of these transactions. The running cost of the chain node, etc.
对于如前所述的隐私交易而言,区块链节点需要在TEE中对该隐私交易进行共识前校验,并且在校验过程中需要使用一些数据,这些数据可能来自于该隐私交易中或者区块链节点自身的数据库中,并且出于隐私目的这些数据往往出于加密状态,使得区块链节点需要在TEE中对这些数据进行解密后才能够应用于实现共识前校验。同时,参与共识前校验的上述数据也可能被应用于上述隐私交易的执行过程中,但相关技术中的共识前校验与交易执行往往被作为相互独立的过程,那么区块链节点需要分别在共识前校验和交易执行过程中将上述数据读入TEE中并执行解密、处理等操作,给区块链节点造成额外的运行开销,也降低了交易执行效率。For the aforementioned private transactions, the blockchain node needs to verify the private transaction before consensus in the TEE, and some data needs to be used in the verification process. These data may come from the private transaction or In the blockchain node's own database, and for privacy purposes, these data are often in an encrypted state, so that the blockchain node needs to decrypt the data in the TEE before it can be used for verification before consensus. At the same time, the above data verified before participating in the consensus may also be used in the execution process of the above privacy transaction, but the pre-consensus verification and transaction execution in related technologies are often regarded as mutually independent processes, so the blockchain nodes need to be separated During the pre-consensus check and transaction execution process, the above data is read into the TEE and decryption, processing and other operations are performed, which causes additional operating overhead to the blockchain node and also reduces the transaction execution efficiency.
以下结合实施例介绍本说明书提供的一种在区块链中实现隐私保护的高效交易方案,可以相对减小区块链节点的运行开销、提升交易执行效率。In the following, in conjunction with embodiments, an efficient transaction scheme for realizing privacy protection in the blockchain provided by this specification is introduced, which can relatively reduce the operating overhead of blockchain nodes and improve transaction execution efficiency.
图2是一示例性实施例提供的一种在区块链中实现隐私保护的高效交易方法的流程图。如图2所示,该方法应用于区块链节点,可以包括以下步骤。Fig. 2 is a flowchart of an efficient transaction method for realizing privacy protection in a blockchain according to an exemplary embodiment. As shown in Figure 2, the method is applied to blockchain nodes and can include the following steps.
步骤202,区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验,并对共识前校验的过程中使用的至少一部分数据进行缓存。In step 202, the blockchain node transmits the private transaction submitted by the client to the trusted execution environment to perform pre-consensus verification on the private transaction, and caches at least a part of the data used in the pre-consensus verification process.
隐私交易可以理解为存在隐私需求的交易;除了隐私交易之外,区块链节点可能接收到明文交易,明文交易为不存在隐私需求的交易。隐私需求可以通过多种方式予以表达,本说明书并不对此进行限制。例如,每笔交易可以包含类型字段,该类型字段用于标注相应的交易属于隐私交易还是明文交易。如前所述,区块链节点可以在如图1所示的常规执行环境中的“交易调度”接口识别交易类型。在相关技术中,例如在以太坊网络中,交易通常包含to、value、data等字段;而本实施例在相关技术的基础上,在交易中增加一类型字段,比如表征为type字段,并基于该类型字段的取值,表明相关交易的类型:例如,当类型字段为第一取值时,表明相关交易为明文交易,当类型字段为第二取值时,表明相关交易为隐私交易。再例如,用户可以在创建交易的过程中在交易内添加加密标识,以表达上述的隐私需求。那么,当检查到交易中包含加密标识时,区块链节点可以判定该交易为隐私交易,否则判定该交易为明文交易。又例如,区块链节点可以识别交易所需调用的智能合约的类型,当被调用的智能合约属于隐私类型(比如智能合约包含隐私标识,或者智能合约的代码中包括隐私标识标注的合约状态等)时,可以 判定该交易属于隐私交易,否则判定该交易为明文交易。Privacy transactions can be understood as transactions that require privacy; in addition to privacy transactions, blockchain nodes may receive plaintext transactions, which are transactions that do not require privacy. Privacy requirements can be expressed in a variety of ways, and this manual does not limit this. For example, each transaction may include a type field, which is used to indicate whether the corresponding transaction is a private transaction or a plaintext transaction. As mentioned earlier, the blockchain node can identify the transaction type in the "transaction scheduling" interface in the conventional execution environment as shown in Figure 1. In related technologies, for example, in the Ethereum network, transactions usually contain fields such as to, value, and data; and this embodiment adds a type field to the transaction on the basis of related technologies, such as the type field, based on The value of this type field indicates the type of the related transaction: for example, when the type field is the first value, it indicates that the related transaction is a clear text transaction, and when the type field is the second value, it indicates that the related transaction is a private transaction. For another example, the user can add an encrypted identifier to the transaction in the process of creating a transaction to express the aforementioned privacy requirements. Then, when it is checked that the transaction contains an encrypted identifier, the blockchain node can determine that the transaction is a private transaction, otherwise it is determined that the transaction is a plaintext transaction. For another example, the blockchain node can identify the type of smart contract called for the transaction, when the smart contract called belongs to the privacy type (for example, the smart contract contains a privacy identifier, or the code of the smart contract includes the contract status marked by the privacy identifier, etc. ), the transaction can be determined to be a private transaction, otherwise the transaction is determined to be a plaintext transaction.
区块链节点收到的隐私交易可以来自于客户端;例如,用户可以在客户端生成该隐私交易后,通过客户端将该隐私交易提交至上述区块链节点。或者,客户端在生成隐私交易之后,可以通过其他区块链节点转发至上述区块链节点。上述的隐私交易被生成时即处于加密状态,以确保该隐私交易所含的内容不会被无关人员获得。The private transaction received by the blockchain node may come from the client; for example, the user can submit the private transaction to the above-mentioned blockchain node through the client after the private transaction is generated on the client. Alternatively, after the client generates a private transaction, it can be forwarded to the aforementioned blockchain node through other blockchain nodes. The aforementioned private transaction is encrypted when it is generated to ensure that the content contained in the private transaction will not be obtained by unrelated persons.
区块链节点对上述隐私交易进行共识前校验之前,需要将该隐私交易读入TEE中进行解密,然后对解密得到的明文内容执行共识前校验。共识前校验应当确保在TEE内执行,避免上述解密得到的明文内容暴露至TEE之外,以避免产生安全性风险。区块链节点可以对收到的隐私交易依次实施共识前校验,即针对各个隐私交易串行地实施共识前校验;或者,区块链节点可以对收到的隐私交易进行并行校验,即区块链节点可以对上述隐私交易和至少一件其他隐私交易并行地实施共识前校验,以提升区块链节点对隐私交易进行共识前校验的执行效率。为了能够并行地执行对上述隐私交易和至少一件其他隐私交易的共识前校验,该共识前校验的过程应当避免在不同隐私交易之间存在冲突,比如共识前校验的过程中避免涉及智能合约的合约代码及合约存储等,使得不同隐私交易不会由于涉及到同一智能合约的合约代码或合约存储而导致冲突;当然,这并不意味着共识前校验必然不涉及到合约代码或合约存储,比如不同隐私交易涉及到不同智能合约或同一智能合约的不同合约存储时,即便并行地执行共识前校验也并不会由此产生冲突。Before the blockchain node performs the pre-consensus verification on the above-mentioned private transaction, it needs to read the private transaction into the TEE for decryption, and then perform the pre-consensus verification on the decrypted plaintext content. The pre-consensus verification should be performed within the TEE to prevent the plaintext content obtained by the above decryption from being exposed to the outside of the TEE to avoid security risks. Blockchain nodes can sequentially perform pre-consensus verification on received private transactions, that is, perform pre-consensus verification serially for each private transaction; or, blockchain nodes can perform parallel verification on received private transactions, That is, the blockchain node can implement the pre-consensus verification on the above-mentioned private transaction and at least one other private transaction in parallel, so as to improve the execution efficiency of the blockchain node's pre-consensus verification on the private transaction. In order to be able to perform the pre-consensus verification of the above-mentioned private transaction and at least one other private transaction in parallel, the pre-consensus verification process should avoid conflicts between different private transactions, such as avoiding involvement in the pre-consensus verification process The smart contract's contract code and contract storage, etc., so that different privacy transactions will not cause conflicts due to the contract code or contract storage involving the same smart contract; of course, this does not mean that the pre-consensus verification does not necessarily involve the contract code or Contract storage, for example, when different privacy transactions involve different smart contracts or different contract storage of the same smart contract, even if the pre-consensus verification is performed in parallel, there will be no conflicts.
区块链节点对共识前校验的过程中使用的至少一部分数据进行缓存。区块链节点可以将相关数据缓存于TEE中,也可以将相关数据缓存于TEE之外的外部存储空间。通过缓存于TEE中,使得区块链节点在后续的交易执行过程中可以直接从TEE中读取已缓存的数据,相比于存储至外部存储空间而言,一方面可以免去TEE与外部存储空间之间进行交互操作,另一方面由于数据在TEE中采用明文形式进行缓存、在外部存储空间必须采用密文形式进行缓存,因而将数据缓存于TEE中可以省去对这些数据的加密、解密过程。但是,TEE被分配的内存空间可能相对较小,在区块链节点收到隐私交易的数量较多的情况下,尤其是在并行地对多笔隐私交易实施共识前校验的情况下,如果将所有隐私交易涉及到的数据均缓存于TEE中,TEE的内存空间可能无法满足要求,甚至可能影响TEE的正常运行,因而区块链节点可以将上述的相关数据全部或部分地缓存至外部存储空间,且这些数据应当预先在TEE内被加密,然后缓存至外部存储空间。The blockchain node caches at least part of the data used in the pre-consensus verification process. Blockchain nodes can cache related data in the TEE, or cache related data in an external storage space outside the TEE. By caching in the TEE, the blockchain node can directly read the cached data from the TEE during the subsequent transaction execution process. Compared with storing to the external storage space, on the one hand, it can eliminate the TEE and external storage. Interactive operations between spaces, on the other hand, because data is cached in plain text in TEE, and cipher text must be cached in external storage space, caching data in TEE can eliminate the need for encryption and decryption of these data. process. However, the memory space allocated to TEE may be relatively small. In the case where the blockchain node receives a large number of private transactions, especially in the case of multiple private transactions in parallel before consensus verification, if All data involved in private transactions are cached in the TEE. The memory space of the TEE may not meet the requirements, and may even affect the normal operation of the TEE. Therefore, the blockchain node can cache all or part of the above-mentioned related data to external storage The data should be encrypted in the TEE in advance, and then cached in the external storage space.
区块链节点对隐私交易进行共识前校验的过程中使用的至少一部分数据,可以包括从上述隐私交易中提取的数据,即该数据被包含于隐私交易中。区块链节点可以将从隐私交易中提取的上述数据加密后缓存至TEE之外,比如缓存至上述的外部存储空间,以避免影响TEE的正常运行并满足大量隐私交易对存储空间的需求。At least a part of the data used in the process of pre-consensus verification of the private transaction by the blockchain node may include data extracted from the above-mentioned private transaction, that is, the data is included in the private transaction. Blockchain nodes can encrypt the above-mentioned data extracted from private transactions and cache them outside of the TEE, such as in the above-mentioned external storage space, to avoid affecting the normal operation of the TEE and to meet the storage space requirements of a large number of private transactions.
例如,隐私交易可以包括加密后交易内容和加密后密钥,该加密后交易内容由交易发起方维护的第一对称密钥对明文交易内容进行加密得到,该加密后密钥由节点公钥对上述第一对称密钥进行加密得到。其中,第一对称密钥由交易发起方所维护,节点公钥与节点私钥为基于非对称加密算法的一组密钥,节点私钥由区块链节点维护而避免被交易发起方或客户端获得,交易发起方或客户端可以获知节点公钥;相应地,交易发起方可以在客户端处通过第一对称密钥对明文交易内容进行加密得到加密后交易内容,且通过节点公钥对第一对称密钥进行加密得到加密后密钥,即数字信封的加密方式,而上述的隐私交易即同时包括上述的加密后交易内容和加密后密钥。由于对称加密算法的加解密效率相对更高,而非对称加密算法的安全性相对更高,因而在数字信封的加密方式中,通过第一对称密钥对明文交易内容进行对称加密(以及后续通过第一对称密钥对加密后交易内容进行解密)可以实现相对更高的效率、通过节点公钥对第一对称密钥进行加密(以及后续通过节点私钥对第一对称密钥进行解密)可以实现相对更高的安全性,从而兼顾加解密效率与安全性。For example, a private transaction may include encrypted transaction content and an encrypted key. The encrypted transaction content is obtained by encrypting the plaintext transaction content with the first symmetric key maintained by the transaction initiator, and the encrypted key is paired by the node public key. The above-mentioned first symmetric key is obtained through encryption. Among them, the first symmetric key is maintained by the transaction initiator, the node public key and the node private key are a set of keys based on an asymmetric encryption algorithm, and the node private key is maintained by the blockchain node to avoid the transaction initiator or client The transaction initiator or the client can obtain the public key of the node; accordingly, the transaction initiator can encrypt the content of the transaction in plaintext with the first symmetric key at the client to obtain the encrypted transaction content, and the transaction content can be obtained through the node public key pair The first symmetric key is encrypted to obtain the encrypted key, that is, the encryption method of the digital envelope, and the above-mentioned private transaction includes both the above-mentioned encrypted transaction content and the encrypted key. Since the encryption and decryption efficiency of the symmetric encryption algorithm is relatively higher, and the security of the asymmetric encryption algorithm is relatively higher, in the encryption method of the digital envelope, the content of the plaintext transaction is symmetrically encrypted through the first symmetric key (and subsequently passed The first symmetric key decrypts the encrypted transaction content), which can achieve relatively higher efficiency. The first symmetric key is encrypted by the node public key (and the first symmetric key is subsequently decrypted by the node private key). To achieve relatively higher security, so as to take into account the efficiency and security of encryption and decryption.
相应地,区块链节点将上述隐私交易读入TEE后,可以采用节点私钥对加密后密钥进行解密得到的第一对称密钥,以及通过该第一对称密钥对加密后交易内容进行解密得到上述的明文交易内容,以针对该明文交易内容进行校验。由于在交易执行过程中,区块链节点仍然需要将隐私交易读入TEE中进行解密,并且如前文所述的非对称加密算法具有相对更低的加解密效率,因而区块链节点可以对共识前校验过程中得到的第一对称密钥进行缓存,以避免在交易执行过程中再次通过非对称加密算法进行解密。当然,区块链节点在将上述的第一对称密钥缓存至外部存储空间时,需要对该第一对称密钥进行加密存储,因而区块链节点可以采用TEE中维护的第二对称密钥对该第一对称密钥进行加密后缓存至外部存储空间。由于采用第二对称密钥对第一对称密钥进行加密,相比于采用上述的节点公钥对第一对称密钥进行加密而言,使得区块链节点后续在TEE中实施解密操作获得第一对称密钥的过程中,解密时长相对更短(对称加密算法的耗时相比非对称加密算法的耗时更短)。Correspondingly, after the blockchain node reads the above-mentioned private transaction into the TEE, the node's private key can be used to decrypt the encrypted key to obtain the first symmetric key, and the encrypted transaction content can be performed through the first symmetric key. The above-mentioned plaintext transaction content is obtained by decryption, so as to verify the plaintext transaction content. In the transaction execution process, the blockchain node still needs to read the private transaction into the TEE for decryption, and the asymmetric encryption algorithm described above has relatively lower encryption and decryption efficiency, so the blockchain node can agree on the consensus The first symmetric key obtained in the pre-verification process is cached to avoid decryption by the asymmetric encryption algorithm again in the transaction execution process. Of course, when the blockchain node caches the above-mentioned first symmetric key in the external storage space, the first symmetric key needs to be encrypted and stored, so the blockchain node can use the second symmetric key maintained in the TEE The first symmetric key is encrypted and then cached in the external storage space. Since the second symmetric key is used to encrypt the first symmetric key, compared to the use of the node public key to encrypt the first symmetric key, the blockchain node subsequently implements the decryption operation in the TEE to obtain the first symmetric key. In the process of a symmetric key, the decryption time is relatively shorter (the time consuming of the symmetric encryption algorithm is shorter than that of the asymmetric encryption algorithm).
区块链节点对隐私交易进行共识前校验的过程中使用的至少一部分数据,可以包括 该区块链节点将加密后数据读入TEE中进行解密得到的解密后数据。该加密后数据由区块链节点预先在TEE中对上述的解密后数据进行加密得到,并从TEE传出后存储至外部存储空间。例如,上述的解密后数据可以包括以下至少之一:外部账户的状态数据、合约账户的状态数据、合约账户对应的合约代码、所述合约代码对应的合约存储等,本说明书并不对此进行限制。区块链节点在TEE中对上述的解密后数据进行加密时,可以采用TEE中维护的对称密钥进行加密,该对称密钥譬如可以为上述的第二对称密钥或者其他对称密钥,本说明书并不对此进行限制。上述的加密后数据存储于区块链节点上的外部存储空间,而该加密后数据在TEE中被解密为相应的解密后数据并被应用于针对上述隐私交易的共识前校验后,区块链节点可以将该解密后数据缓存于TEE中,使得区块链节点后续在该隐私交易通过共识并执行该隐私交易的过程中,可以直接从TEE中读取和使用该解密后数据,而无需重新查找加密后数据、读入TEE并解密,可以提升后续的处理效率。At least part of the data used in the process of pre-consensus verification by the blockchain node on the privacy transaction may include the decrypted data obtained by the blockchain node reading the encrypted data into the TEE for decryption. The encrypted data is obtained by pre-encrypting the above-mentioned decrypted data in the TEE by the blockchain node, and is transmitted from the TEE and stored in the external storage space. For example, the above-mentioned decrypted data may include at least one of the following: status data of an external account, status data of a contract account, contract code corresponding to the contract account, contract storage corresponding to the contract code, etc. This specification does not limit this . When the blockchain node encrypts the above-mentioned decrypted data in the TEE, it can use the symmetric key maintained in the TEE for encryption. The symmetric key can be, for example, the above-mentioned second symmetric key or other symmetric keys. The instructions do not limit this. The above-mentioned encrypted data is stored in the external storage space on the blockchain node, and the encrypted data is decrypted into the corresponding decrypted data in the TEE and is applied to the pre-consensus verification for the above-mentioned private transactions. The chain node can cache the decrypted data in the TEE, so that the blockchain node can directly read and use the decrypted data from the TEE when the private transaction passes consensus and executes the private transaction, without the need Re-searching the encrypted data, reading it into the TEE and decrypting it can improve the subsequent processing efficiency.
本说明书中的隐私交易可能与智能合约相关,可以基于智能合约实现相对复杂的处理逻辑。当然,本说明书的隐私交易也可能与智能合约无关,仅用于实现相对简单的处理逻辑,比如相关技术中的转账逻辑等。以以太坊为例,支持用户在以太坊网络中创建和/或调用一些复杂的逻辑,这是以太坊区别于比特币区块链技术的最大挑战。以太坊作为一个可编程区块链的核心是以太坊虚拟机(EVM),每个以太坊节点都可以运行EVM。EVM是一个图灵完备的虚拟机,这意味着可以通过它实现各种复杂的逻辑。用户在以太坊中发布和调用智能合约就是在EVM上运行的。如图1所示,通过在常规执行环境中部署EVM,可以通过该EVM执行明文交易发布或调用的智能合约,以实现常规执行环境中的“交易执行”环节;以及,通过在TEE中部署EVM,可以通过该EVM执行隐私交易发布或调用的智能合约,以实现TEE中的“交易执行”环节。The privacy transactions in this manual may be related to smart contracts, and relatively complex processing logic can be implemented based on smart contracts. Of course, the privacy transactions in this manual may also have nothing to do with smart contracts, and are only used to implement relatively simple processing logic, such as transfer logic in related technologies. Taking Ethereum as an example, it supports users to create and/or call some complex logic in the Ethereum network. This is the biggest challenge that distinguishes Ethereum from Bitcoin blockchain technology. The core of Ethereum as a programmable blockchain is the Ethereum Virtual Machine (EVM), and every Ethereum node can run EVM. EVM is a Turing complete virtual machine, which means that various complex logic can be implemented through it. Users who publish and call smart contracts in Ethereum run on the EVM. As shown in Figure 1, by deploying the EVM in the conventional execution environment, the smart contract issued or called by the plaintext transaction can be executed through the EVM to realize the "transaction execution" link in the conventional execution environment; and, by deploying the EVM in the TEE , The smart contract issued or invoked by the private transaction can be executed through the EVM to realize the "transaction execution" link in the TEE.
例如图3所示,Bob将一个包含创建智能合约信息的交易发送到以太坊网络后,节点1的EVM可以执行这个交易并生成对应的合约实例。交易的data字段保存的可以是智能合约的代码(如字节码),交易的to字段为一个空的账户。节点间通过共识机制达成一致后,这个合约成功创建,后续用户可以调用这个合约。合约创建后,区块链上出现一个与该智能合约对应的合约账户,并拥有一个特定的地址,合约代码和账户存储将保存在该合约账户中。智能合约的行为由合约代码控制,而智能合约的账户存储则保存了合约的状态。换句话说,智能合约使得区块链上产生包含合约代码和账户存储(Storage)的虚拟账户。前文所述的合约存储通常理解为与合约代码相关的合约状态及其取值(通常为键值对形式),而与该合约代码相关的所有合约状态及其取值可以形成树状结构(如 以太坊中采用MPT树,即Merkle Patricia Tree),并将该树状结构的根哈希记录于上述的账户存储中。For example, as shown in Figure 3, after Bob sends a transaction containing the creation of a smart contract to the Ethereum network, the EVM of node 1 can execute the transaction and generate a corresponding contract instance. The data field of the transaction can be the code of the smart contract (such as bytecode), and the to field of the transaction is an empty account. After the nodes reach an agreement through the consensus mechanism, this contract is successfully created, and subsequent users can call this contract. After the contract is created, a contract account corresponding to the smart contract appears on the blockchain and has a specific address. The contract code and account storage will be stored in the contract account. The behavior of the smart contract is controlled by the contract code, and the account storage of the smart contract saves the state of the contract. In other words, the smart contract enables a virtual account containing contract code and account storage (Storage) to be generated on the blockchain. The contract storage mentioned above is usually understood as the contract state and its value related to the contract code (usually in the form of key-value pairs), and all the contract states and their values related to the contract code can form a tree structure (such as Ethereum adopts the MPT tree, namely Merkle Patricia Tree, and records the root hash of the tree structure in the aforementioned account storage.
进一步地,如图4所示,仍以以太坊为例,Bob将一个调用智能合约的交易发送到以太坊网络后,节点1的EVM可以执行这个交易并生成对应的合约实例。图中4中交易的from字段是发起调用智能合约的账户的地址,to字段中的“0x692a70d2…”代表了被调用的智能合约的地址,value字段在以太坊中是以太币的值,交易的data字段保存的调用智能合约的方法和参数。智能合约可以通过规定的方式在区块链网络中的每个节点独立地执行,所有执行记录和数据都保存在区块链上,所以当这样的交易完成后,区块链上就保存了无法篡改、不会丢失的交易凭证。Further, as shown in Figure 4, still taking Ethereum as an example, after Bob sends a transaction calling a smart contract to the Ethereum network, the EVM of node 1 can execute the transaction and generate a corresponding contract instance. The from field of the transaction in Figure 4 is the address of the account that initiated the call to the smart contract, the "0x692a70d2..." in the to field represents the address of the smart contract being called, and the value field is the value of the ether in Ethereum, the transaction is The method and parameters for calling the smart contract stored in the data field. Smart contracts can be independently executed on each node in the blockchain network in a prescribed manner. All execution records and data are stored on the blockchain, so when such a transaction is completed, the blockchain cannot be saved. A transaction certificate that is tampered with and will not be lost.
区块链网络中的各个区块链节点可以采用统一存储方案对隐私交易在共识前校验的过程中使用的至少一部分数据进行存储,比如全部存储于TEE中、全部存储于外部存储空间,或者部分存储于TEE中、另一部分存储于外部存储空间等。或者,区块链网络中的各个区块链节点可以采用独立存储方案,即各个区块链节点所采用的存储方案之间并不一定相同,以适应于各个区块链节点在存储空间分配和应用需求等方面可能存在的差异。Each blockchain node in the blockchain network can use a unified storage scheme to store at least part of the data used in the pre-consensus verification process of private transactions, such as all stored in TEE, all stored in external storage space, or Part of it is stored in TEE, the other part is stored in external storage space, etc. Alternatively, each block chain node in the block chain network can adopt an independent storage scheme, that is, the storage scheme adopted by each block chain node is not necessarily the same, so as to adapt to the storage space allocation and storage space of each block chain node. Possible differences in application requirements, etc.
步骤204,在所述隐私交易通过共识前校验的情况下,所述区块链节点与其他区块链节点对所述隐私交易进行共识处理。Step 204: In the case that the privacy transaction passes the pre-consensus verification, the blockchain node and other blockchain nodes perform consensus processing on the privacy transaction.
区块链节点对隐私交易进行共识前校验,可以筛除部分不满足要求的隐私交易,比如不合法交易等,这些被筛除的隐私交易不会参与共识、不会被各个区块链节点执行,而只有通过共识前校验的隐私交易才能够参与共识和执行过程,可以减少网络传输开销和其他区块链节点的校验开销。Blockchain nodes perform pre-consensus verification on private transactions, which can screen out some private transactions that do not meet the requirements, such as illegal transactions. These filtered private transactions will not participate in the consensus and will not be affected by each blockchain node. Execution, and only private transactions that pass the pre-consensus verification can participate in the consensus and execution process, which can reduce the network transmission overhead and the verification overhead of other blockchain nodes.
在采用工作量证明(Proof of Work,POW)以及股权证明(Proof of Stake,POS)、委任权益证明(Delegated Proof of Stake,DPOS)等共识算法的区块链网络中,共识过程包括区块链节点之间对于记账权的争夺。以以太坊为例,以太坊中的节点一般也是争夺记账权的节点,上述区块链节点作为争夺记账权的节点可以在本地执行上述的隐私交易。所有争夺记账权的节点中的某一节点如果在本轮争夺记账权的过程中胜出,则成为记账节点。假定上述区块链节点在本轮争夺记账权的过程中胜出,就成为记账节点;当然,如果该区块链节点在本轮争夺记账权的过程中没有胜出,则不是记账节点,而其它节点可能成为记账节点。对于上述争夺记账权的区块链网络,本说明书中的区块链节点对收到的隐私交易进行共识前校验后,如果校验通过则将该隐私交易广播至区块链网络 中的其他区块链节点,使得不论本轮的记账节点为哪个节点,该记账节点均可以将该隐私交易打包(或还包括其它交易一起打包)并生成新的区块,并将该新的区块发送至非记账节点进行共识,而非记账节点在对收到的上述新的区块进行验证没有问题的情况下,可以将该新的区块追加到原有的区块链末尾,从而完成记账过程、达成共识。而如果上述隐私交易在本说明书的区块链节点处未通过共识前校验,那么该区块链节点就不会向其他区块链节点广播该隐私交易。In a blockchain network that uses consensus algorithms such as Proof of Work (POW), Proof of Stake (POS), and Delegated Proof of Stake (DPOS), the consensus process includes blockchain The competition between nodes for the right to bookkeeping. Taking Ethereum as an example, the nodes in Ethereum are generally nodes competing for the right to bookkeeping. The above-mentioned blockchain nodes can execute the above-mentioned private transactions locally as nodes competing for the right to bookkeeping. If a certain node among all the nodes competing for the bookkeeping right wins in the process of the current round of competing for the bookkeeping right, it becomes the bookkeeping node. Assuming that the above-mentioned blockchain node wins in this round of competition for accounting rights, it becomes an accounting node; of course, if the blockchain node does not win in this round of competition for accounting rights, it is not an accounting node , And other nodes may become accounting nodes. For the above-mentioned blockchain networks competing for accounting rights, the blockchain nodes in this manual perform pre-consensus verification on the received private transactions, and if the verification passes, the private transactions will be broadcast to the blockchain network. Other blockchain nodes, so that no matter which node the billing node of this round is, the billing node can package the private transaction (or package other transactions together) and generate a new block, and add the new The block is sent to the non-booking node for consensus, and the non-booking node can append the new block to the end of the original blockchain if there is no problem in verifying the received new block. , So as to complete the accounting process and reach a consensus. And if the above-mentioned private transaction does not pass the pre-consensus verification at the blockchain node in this manual, then the blockchain node will not broadcast the private transaction to other blockchain nodes.
在采用实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)等机制的区块链网络中,具有记账权的节点在本轮记账前已经商定好。因此,上述区块链节点接收到前述的隐私交易后,假定该隐私交易通过了共识前校验,那么:在该区块链节点自身不是本轮的记账节点的情况下,将该隐私交易发送至记账节点;在该区块链节点自身是本轮的记账节点的情况下,将该隐私交易打包(或还包括其它交易一起打包)并生成新的区块后,将生成的新的区块发送至非记账节点进行共识。以及,上述区块链节点接收到前述的隐私交易后,假定该隐私交易未通过共识前校验,则该区块链节点在自身不是本轮的记账节点的情况下不会将该隐私交易发送至记账节点,该区块链节点在自身是本轮的记账节点的情况下不会将该隐私交易用于打包生成新的区块。对于上述记账节点生成的新的区块,非记账节点可以在对收到的上述新的区块进行验证没有问题的情况下,可以将该新的区块追加到原有的区块链末尾,从而完成记账过程、达成共识。In a blockchain network that uses mechanisms such as Practical Byzantine Fault Tolerance (PBFT), the nodes with the right to book accounts have been agreed before this round of bookkeeping. Therefore, after the above-mentioned blockchain node receives the aforementioned private transaction, assuming that the private transaction has passed the pre-consensus verification, then: if the blockchain node itself is not the accounting node of the current round, the private transaction Send to the accounting node; in the case that the blockchain node itself is the accounting node of this round, after packaging the private transaction (or including other transactions together) and generating a new block, the new block will be generated. The blocks are sent to non-booking nodes for consensus. And, after the above-mentioned blockchain node receives the aforementioned private transaction, assuming that the private transaction does not pass the pre-consensus verification, the blockchain node will not make the private transaction if it is not the accounting node of the current round. Sent to the accounting node, the blockchain node will not use the private transaction to package and generate a new block if it is the accounting node of the current round. For the new block generated by the above bookkeeping node, the non-bookkeeping node can add the new block to the original blockchain if there is no problem in verifying the received new block. At the end, to complete the bookkeeping process and reach a consensus.
步骤206,所述区块链节点将经过共识的所述隐私交易传入所述可信执行环境中予以执行,并在交易执行的过程中使用缓存的所述至少一部分数据。Step 206: The blockchain node transfers the consensus private transaction into the trusted execution environment for execution, and uses the cached at least part of the data during the execution of the transaction.
在隐私交易经过共识后,区块链网络中的各个区块链节点均会执行该隐私交易。以上述的区块链节点为例,该区块链节点可以将该隐私交易传入TEE中,并在TEE中执行该隐私交易。而通过在交易执行的过程中使用前文在共识前校验之后缓存的上述至少一部分数据,可以避免区块链节点重复实施用于获得该至少一部分数据的操作,譬如数据查询操作、将数据从外部读入TEE内部的操作、数据解密操作等,可以减少区块链节点的运行开销、提升区块链节点的交易执行效率。在隐私交易执行完毕后,区块链节点可以清除缓存的上述至少一部分数据,以释放相应的存储空间。After the privacy transaction has undergone a consensus, each blockchain node in the blockchain network will execute the privacy transaction. Taking the above-mentioned blockchain node as an example, the blockchain node can pass the private transaction into the TEE, and execute the private transaction in the TEE. By using the above-mentioned at least part of the data cached after the pre-consensus verification in the transaction execution process, it is possible to prevent the blockchain node from repeatedly performing operations for obtaining the at least part of the data, such as data query operations, and sending data from the outside. Reading into TEE internal operations, data decryption operations, etc., can reduce the operating overhead of blockchain nodes and improve the transaction execution efficiency of blockchain nodes. After the execution of the private transaction is completed, the blockchain node can clear at least a part of the above-mentioned cached data to release the corresponding storage space.
如前所述,隐私交易可以包括加密后交易内容和加密后密钥。按照相关技术中的处理流程,区块链节点需要首先基于节点私钥对加密后密钥进行解密、得到第一对称密钥,然后基于第一对称密钥对加密后交易内容进行解密、得到明文交易内容。而基于本说明书的技术方案,由于在前述的共识前校验之后,区块链节点缓存了第一对称密钥,因而 无需再次基于节点私钥对加密后密钥进行解密得到该第一对称密钥。其中,如果区块链节点将该第一对称密钥缓存于TEE中,那么该第一对称密钥可以处于明文状态,区块链节点可以直接从TEE中读取并使用该第一对称密钥,以用于对加密后交易内容进行解密得到相应的明文交易内容;如果区块链节点将该第一对称密钥缓存于TEE之外的外部存储空间,譬如采用如前所述的第二对称密钥对该第一对称密钥进行加密后存储至外部存储空间,那么区块链节点可以将加密后的第一对称密钥从外部存储空间读入TEE中,并通过第二对称密钥进行解密得到第一对称密钥,虽然也涉及到解密操作,但此处采用的是对称加密算法,相比于相关技术中采用节点私钥、通过非对称加密算法实施的解密操作,所带来的运行开销相对更低、效率相对更高。As mentioned earlier, private transactions can include encrypted transaction content and encrypted keys. According to the processing flow in the related technology, the blockchain node needs to first decrypt the encrypted key based on the node's private key to obtain the first symmetric key, and then decrypt the encrypted transaction content based on the first symmetric key to obtain the plaintext Transaction content. Based on the technical solution of this specification, since the blockchain node caches the first symmetric key after the aforementioned pre-consensus verification, there is no need to decrypt the encrypted key again based on the node’s private key to obtain the first symmetric key. key. Among them, if the blockchain node caches the first symmetric key in the TEE, then the first symmetric key can be in a plaintext state, and the blockchain node can directly read and use the first symmetric key from the TEE , To decrypt the encrypted transaction content to obtain the corresponding plaintext transaction content; if the blockchain node caches the first symmetric key in an external storage space outside the TEE, for example, the second symmetric key described above is used The key encrypts the first symmetric key and stores it in the external storage space, then the blockchain node can read the encrypted first symmetric key from the external storage space into the TEE, and use the second symmetric key to perform The first symmetric key is obtained by decryption. Although the decryption operation is also involved, the symmetric encryption algorithm is used here. Compared with the decryption operation implemented by the node private key and the asymmetric encryption algorithm in the related technology, the result is The operating cost is relatively lower and the efficiency is relatively higher.
区块链节点对隐私交易的执行流程可以包括:执行时校验操作和交易执行操作。区块链节点首先将该隐私交易传入TEE中进行校验,即执行时校验操作;以及,区块链节点可以在该隐私交易通过执行时校验的情况下,执行该隐私交易(即交易执行操作),否则拒绝执行该隐私交易或确定该隐私交易执行失败。执行时校验与前述的共识前校验的过程类似,譬如执行时校验可以包括检查交易是否有效、格式是否正确、验证交易的签名是否合法等,执行时校验可以涉及智能合约的合约代码及合约存储等,本说明书并不对此进行限制。由于执行时校验属于隐私交易的执行流程的一部分,而不同交易通常难以实现并行执行,因而不同交易的执行时校验通常采用串行执行。如果区块链节点可以实现多笔交易的并行执行,那么应当考虑不同交易的执行时校验之间可能存在的冲突问题,尤其是当执行时校验涉及到合约代码或合约存储的情况下。The execution process of a private transaction by a blockchain node may include: verification operations during execution and transaction execution operations. The blockchain node first transfers the private transaction to the TEE for verification, that is, the execution-time verification operation; and, the blockchain node can execute the private transaction (that is, when the private transaction passes the execution-time verification) Transaction execution operation), otherwise refuse to execute the private transaction or determine that the execution of the private transaction fails. The execution-time verification is similar to the aforementioned pre-consensus verification process. For example, the execution-time verification can include checking whether the transaction is valid, the format is correct, and verifying whether the transaction signature is legal, etc. The execution verification can involve the contract code of the smart contract. And contract storage, etc., this manual does not limit this. Since execution-time verification is part of the execution process of private transactions, and different transactions are usually difficult to implement in parallel, the execution-time verification of different transactions is usually executed in series. If the blockchain node can realize the parallel execution of multiple transactions, then the possible conflicts between the verifications during the execution of different transactions should be considered, especially when the verification during execution involves contract code or contract storage.
在一些情况下,区块链节点可以记录下每笔交易的共识前校验的校验结果。例如,在区块链节点确定上述的隐私交易经过共识后,可以查询该隐私交易对应的共识前校验的校验结果,如果校验结果为通过校验,则可以跳过执行时校验操作,而直接执行该隐私交易;如果校验结果为未通过校验或未查找到校验结果,则需要实施执行时校验。通常,区块链节点应当避免跳过执行时校验操作,因为区块链节点在执行各笔交易的过程中,前序交易的交易结果可能对后序交易造成一定影响,比如前序交易如果冻结了后序交易所涉及的账户,那么后序交易必然会交易失败,但这在共识前校验的过程中无法被校验出来。因此,区块链节点在针对诸如上述的隐私交易实施执行时校验,该校验过程除了前述的交易合法性等内容之外,还可以涉及到该隐私交易在交易过程中所涉及到的外部账户、合约账户等的状态数据,譬如前述的账户被冻结等异常状态将导致执行时校验的校验结果为不通过。In some cases, the blockchain node can record the verification result of the pre-consensus verification of each transaction. For example, after the blockchain node determines that the above-mentioned private transaction has passed the consensus, the verification result of the pre-consensus verification corresponding to the private transaction can be queried. If the verification result is passed, the verification operation during execution can be skipped , And execute the privacy transaction directly; if the verification result is that the verification is not passed or the verification result is not found, the execution-time verification is required. Generally, blockchain nodes should avoid skipping the verification operation during execution, because the transaction result of the previous transaction may have a certain impact on the subsequent transaction during the execution of each transaction by the blockchain node. For example, if the previous transaction is If the accounts involved in the subsequent transactions are frozen, the subsequent transactions will inevitably fail, but this cannot be verified during the pre-consensus verification process. Therefore, the blockchain node performs verification during the execution of the private transaction such as the above. In addition to the legality of the transaction mentioned above, the verification process can also involve the external involved in the private transaction in the transaction process. The status data of the account, contract account, etc., such as the aforementioned abnormal status such as the account being frozen, will cause the verification result of the verification to be failed during execution.
在隐私交易通过执行时校验的情况下,区块链节点可以执行该隐私交易。具体的,如果隐私交易涉及智能合约,那么执行该隐私交易具体在TEE内运行的虚拟机中执行。例如,以太坊中采用虚拟机(Ethereum Virtual Machine,EVM)。一般的,EVM执行字节码形式的智能合约。其中,如果隐私交易用于部署智能合约,那么区块链节点对该隐私交易所含的加密后交易内容进行解密、得到明文交易内容后,可以从该明文交易内容中获得待部署的合约代码;如果隐私交易用于调用智能合约,那么区块链节点可以从上述明文交易内容中获得目标智能合约的合约地址,使得区块链节点可以基于该合约地址从本地读取已部署的合约代码(如果部署在TEE内,该合约代码处于明文状态;如果部署在外部存储空间,该合约代码处于密文状态,需要读入TEE中进行解密后才能够在虚拟机中执行)。此外,明文交易内容中还可能包含执行合约代码所需的变量及其取值,区块链节点可以将该变量及其取值传入虚拟机,以配合对合约代码的执行。In the case that the private transaction passes the execution-time verification, the blockchain node can execute the private transaction. Specifically, if the private transaction involves a smart contract, the execution of the private transaction is specifically executed in a virtual machine running in the TEE. For example, a virtual machine (Ethereum Virtual Machine, EVM) is used in Ethereum. Generally, EVM executes smart contracts in the form of bytecodes. Among them, if a private transaction is used to deploy a smart contract, the blockchain node decrypts the encrypted transaction content contained in the privacy transaction and obtains the plaintext transaction content, and can obtain the contract code to be deployed from the plaintext transaction content; If a private transaction is used to call a smart contract, then the blockchain node can obtain the contract address of the target smart contract from the above plaintext transaction content, so that the blockchain node can read the deployed contract code locally based on the contract address (if Deployed in the TEE, the contract code is in plaintext state; if deployed in an external storage space, the contract code is in ciphertext state and needs to be read into the TEE for decryption before it can be executed in the virtual machine). In addition, the plaintext transaction content may also include variables and their values required to execute the contract code. Blockchain nodes can pass the variables and their values to the virtual machine to cooperate with the execution of the contract code.
合约代码存在相应的一个或多个合约状态。区块链节点执行合约代码之后,合约状态的取值可能发生变化。区块链节点可以将这些合约状态以明文形式存储于TEE中;或者,区块链节点可以将这些合约状态在TEE中加密后存储至外部存储空间。区块链节点可以采用前文所述的第二对称密钥对合约状态进行加密;或者,区块链节点可以采用其他的对称密钥对合约状态进行加密,本说明书并不对此进行限制。The contract code has corresponding one or more contract states. After the blockchain node executes the contract code, the value of the contract state may change. Blockchain nodes can store these contract states in TEE in plaintext; or, blockchain nodes can encrypt these contract states in TEE and store them in external storage space. The blockchain node can use the aforementioned second symmetric key to encrypt the state of the contract; or, the blockchain node can use other symmetric keys to encrypt the state of the contract, which is not limited in this specification.
本说明书中涉及到若干密钥。上述的节点私钥可由KMS(Key Management Service,密钥管理服务)服务器在确认区块链节点上的TEE通过远程证明后发放至该区块链节点,使得该区块链节点将该节点私钥维护于TEE中。而该节点私钥对应的节点公钥,可由KMS服务器发放至客户端,也可以通过其他方式向客户端公开。类似地,上述的第二对称密钥(或其他的对称密钥)也可以由KMS服务器在确认区块链节点上的TEE通过远程证明后发放至该区块链节点,使得该区块链节点将该第二对称密钥维护于TEE中。或者,KMS服务器可以在确认区块链节点上的TEE通过远程证明后向该区块链节点发放安全密钥,使得该区块链节点将该安全密钥维护于TEE中,而上述的第二对称密钥可以为该安全密钥或者由该安全密钥衍生得到。除此之外,节点公私钥对、第二对称密钥等也可以由上述区块链节点与其他区块链节点之间协商得到,或者通过其他方式得到,本说明书并不对此进行限制。其中,对称加密采用的加密算法,例如是DES算法,3DES算法,TDEA算法,Blowfish算法,RC5算法,IDEA算法等;非对称加密算法,例如是RSA、Elgamal、背包算法、Rabin、D-H、ECC(椭圆曲线加密算法)等。Several keys are involved in this manual. The above-mentioned node private key can be issued to the blockchain node by the KMS (Key Management Service) server after confirming that the TEE on the blockchain node has passed the remote certification, so that the blockchain node can use the node private key Maintained in TEE. The node public key corresponding to the node private key can be issued to the client by the KMS server, or can be disclosed to the client in other ways. Similarly, the above-mentioned second symmetric key (or other symmetric key) can also be issued to the blockchain node by the KMS server after confirming that the TEE on the blockchain node is remotely certified, so that the blockchain node Maintain the second symmetric key in the TEE. Alternatively, the KMS server can issue a security key to the blockchain node after confirming that the TEE on the blockchain node passes remote certification, so that the blockchain node maintains the security key in the TEE, and the second The symmetric key can be the security key or be derived from the security key. In addition, the node's public and private key pair, the second symmetric key, etc. can also be obtained through negotiation between the above-mentioned blockchain node and other blockchain nodes, or obtained in other ways, and this specification does not limit this. Among them, the encryption algorithm used in symmetric encryption, such as DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm, IDEA algorithm, etc.; asymmetric encryption algorithm, such as RSA, Elgamal, knapsack algorithm, Rabin, DH, ECC ( Elliptic curve encryption algorithm) and so on.
图5是一示例性实施例提供的另一种在区块链中实现隐私保护的高效交易方法的流 程图。如图5所示,该方法应用于区块链节点,可以包括以下步骤。Fig. 5 is a flowchart of another efficient transaction method for realizing privacy protection in the blockchain provided by an exemplary embodiment. As shown in Figure 5, this method is applied to a blockchain node and can include the following steps.
步骤502,区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验,并将所述隐私交易的信息与共识前校验的校验结果进行关联记录。Step 502: The blockchain node transmits the private transaction submitted by the client to the trusted execution environment to perform pre-consensus verification on the private transaction, and compares the information of the private transaction with the verification result of the pre-consensus verification Make associated records.
如前所述,隐私交易可以理解为存在隐私需求的交易;除了隐私交易之外,区块链节点可能接收到明文交易,明文交易为不存在隐私需求的交易。在本说明书中,可以通过在交易中增加一类型字段来表示交易的类型;或者,可以通过在交易中添加或不添加预设的加密标识,以表明该交易为隐私交易或明文交易;或者,可以基于交易调用的智能合约的类型,确定交易的类型等。As mentioned earlier, privacy transactions can be understood as transactions that require privacy; in addition to privacy transactions, blockchain nodes may receive plaintext transactions, which are transactions that do not require privacy. In this manual, you can add a type field to the transaction to indicate the type of transaction; or, you can add or not add a preset encryption identifier to the transaction to indicate that the transaction is a private transaction or a clear text transaction; or, The type of transaction can be determined based on the type of smart contract called by the transaction.
如前所述,区块链节点收到的隐私交易可以来自于客户端;例如,用户可以在客户端生成该隐私交易后,通过客户端将该隐私交易提交至上述区块链节点。或者,客户端在生成隐私交易之后,可以通过其他区块链节点转发至上述区块链节点。上述的隐私交易被生成时即处于加密状态,以确保该隐私交易所含的内容不会被无关人员获得。As mentioned above, the private transaction received by the blockchain node can come from the client; for example, the user can submit the private transaction to the above-mentioned blockchain node through the client after the private transaction is generated on the client. Alternatively, after the client generates a private transaction, it can be forwarded to the aforementioned blockchain node through other blockchain nodes. The aforementioned private transaction is encrypted when it is generated to ensure that the content contained in the private transaction will not be obtained by unrelated persons.
如前所述,区块链节点对上述隐私交易进行共识前校验之前,需要将该隐私交易读入TEE中进行解密,然后对解密得到的明文内容执行共识前校验。共识前校验应当确保在TEE内执行,避免上述解密得到的明文内容暴露至TEE之外,以避免产生安全性风险。区块链节点可以对收到的隐私交易依次实施共识前校验,即针对各个隐私交易串行地实施共识前校验;或者,区块链节点可以对收到的隐私交易进行并行校验,即区块链节点可以对上述隐私交易和至少一件其他隐私交易并行地实施共识前校验,以提升区块链节点对隐私交易进行共识前校验的执行效率。为了能够并行地执行对上述隐私交易和至少一件其他隐私交易的共识前校验,该共识前校验的过程应当避免在不同隐私交易之间存在冲突,比如共识前校验的过程中避免涉及智能合约的合约代码及合约存储等,使得不同隐私交易不会由于涉及到同一智能合约的合约代码或合约存储而导致冲突;当然,这并不意味着共识前校验必然不涉及到合约代码或合约存储,比如不同隐私交易涉及到不同智能合约或同一智能合约的不同合约存储时,即便并行地执行共识前校验也并不会由此产生冲突。As mentioned above, before the blockchain node performs the pre-consensus verification on the above-mentioned private transaction, it needs to read the private transaction into the TEE for decryption, and then perform the pre-consensus verification on the decrypted plaintext content. The pre-consensus verification should be performed within the TEE to prevent the plaintext content obtained by the above decryption from being exposed to the outside of the TEE to avoid security risks. Blockchain nodes can sequentially perform pre-consensus verification on received private transactions, that is, perform pre-consensus verification serially for each private transaction; or, blockchain nodes can perform parallel verification on received private transactions, That is, the blockchain node can implement the pre-consensus verification on the above-mentioned private transaction and at least one other private transaction in parallel, so as to improve the execution efficiency of the blockchain node's pre-consensus verification on the private transaction. In order to be able to perform the pre-consensus verification of the above-mentioned private transaction and at least one other private transaction in parallel, the pre-consensus verification process should avoid conflicts between different private transactions, such as avoiding involvement in the pre-consensus verification process The smart contract's contract code and contract storage, etc., so that different privacy transactions will not cause conflicts due to the contract code or contract storage involving the same smart contract; of course, this does not mean that the pre-consensus verification does not necessarily involve the contract code or Contract storage, for example, when different privacy transactions involve different smart contracts or different contract storage of the same smart contract, even if the pre-consensus verification is performed in parallel, there will be no conflicts.
如前所述,隐私交易可以包括加密后交易内容和加密后密钥,该加密后交易内容由交易发起方维护的第一对称密钥对明文交易内容进行加密得到,该加密后密钥由节点公钥对上述第一对称密钥进行加密得到。其中,第一对称密钥由交易发起方所维护,节点公钥与节点私钥为基于非对称加密算法的一组密钥,节点私钥由区块链节点维护而避免被交易发起方或客户端获得,交易发起方或客户端可以获知节点公钥;相应地,交易发 起方可以在客户端处通过第一对称密钥对明文交易内容进行加密得到加密后交易内容,且通过节点公钥对第一对称密钥进行加密得到加密后密钥,即数字信封的加密方式,而上述的隐私交易即同时包括上述的加密后交易内容和加密后密钥。由于对称加密算法的加解密效率相对更高,而非对称加密算法的安全性相对更高,因而在数字信封的加密方式中,通过第一对称密钥对明文交易内容进行对称加密(以及后续通过第一对称密钥对加密后交易内容进行解密)可以实现相对更高的效率、通过节点公钥对第一对称密钥进行加密(以及后续通过节点私钥对第一对称密钥进行解密)可以实现相对更高的安全性,从而兼顾加解密效率与安全性。As mentioned earlier, a private transaction can include encrypted transaction content and an encrypted key. The encrypted transaction content is obtained by encrypting the plaintext transaction content by the first symmetric key maintained by the transaction initiator, and the encrypted key is obtained by the node The public key is obtained by encrypting the above-mentioned first symmetric key. Among them, the first symmetric key is maintained by the transaction initiator, the node public key and the node private key are a set of keys based on an asymmetric encryption algorithm, and the node private key is maintained by the blockchain node to avoid the transaction initiator or client The transaction initiator or the client can obtain the public key of the node; accordingly, the transaction initiator can encrypt the content of the transaction in plaintext with the first symmetric key at the client to obtain the encrypted transaction content, and the transaction content can be obtained through the node public key pair The first symmetric key is encrypted to obtain the encrypted key, that is, the encryption method of the digital envelope, and the above-mentioned private transaction includes both the above-mentioned encrypted transaction content and the encrypted key. Since the encryption and decryption efficiency of the symmetric encryption algorithm is relatively higher, and the security of the asymmetric encryption algorithm is relatively higher, in the encryption method of the digital envelope, the content of the plaintext transaction is symmetrically encrypted through the first symmetric key (and subsequently passed The first symmetric key decrypts the encrypted transaction content), which can achieve relatively higher efficiency. The first symmetric key is encrypted by the node public key (and the first symmetric key is subsequently decrypted by the node private key). To achieve relatively higher security, so as to take into account the efficiency and security of encryption and decryption.
相应地,区块链节点将上述隐私交易读入TEE后,可以采用节点私钥对加密后密钥进行解密得到的第一对称密钥,以及通过该第一对称密钥对加密后交易内容进行解密得到上述的明文交易内容,以针对该明文交易内容进行校验。Correspondingly, after the blockchain node reads the above-mentioned private transaction into the TEE, the node's private key can be used to decrypt the encrypted key to obtain the first symmetric key, and the encrypted transaction content can be performed through the first symmetric key. The above-mentioned plaintext transaction content is obtained by decryption, so as to verify the plaintext transaction content.
步骤504,在所述隐私交易通过共识前校验的情况下,所述区块链节点与其他区块链节点对所述隐私交易进行共识处理。Step 504: In the case where the privacy transaction passes the pre-consensus verification, the blockchain node and other blockchain nodes perform consensus processing on the privacy transaction.
如前所述,区块链节点对隐私交易进行共识前校验,可以筛除部分不满足要求的隐私交易,比如不合法交易等,这些被筛除的隐私交易不会参与共识、不会被各个区块链节点执行,而只有通过共识前校验的隐私交易才能够参与共识和执行过程,可以减少网络传输开销和其他区块链节点的校验开销。As mentioned earlier, blockchain nodes perform pre-consensus verification on private transactions, which can screen out some private transactions that do not meet the requirements, such as illegal transactions. These screened out private transactions will not participate in the consensus and will not be Each blockchain node executes, and only private transactions that pass the pre-consensus verification can participate in the consensus and execution process, which can reduce the network transmission overhead and the verification overhead of other blockchain nodes.
如前所述,在采用工作量证明以及股权证明、委任权益证明等共识算法的区块链网络中,共识过程包括区块链节点之间对于记账权的争夺。以以太坊为例,以太坊中的节点一般也是争夺记账权的节点,上述区块链节点作为争夺记账权的节点可以在本地执行上述的隐私交易。所有争夺记账权的节点中的某一节点如果在本轮争夺记账权的过程中胜出,则成为记账节点。假定上述区块链节点在本轮争夺记账权的过程中胜出,就成为记账节点;当然,如果该区块链节点在本轮争夺记账权的过程中没有胜出,则不是记账节点,而其它节点可能成为记账节点。对于上述争夺记账权的区块链网络,本说明书中的区块链节点对收到的隐私交易进行共识前校验后,如果校验通过则将该隐私交易广播至区块链网络中的其他区块链节点,使得不论本轮的记账节点为哪个节点,该记账节点均可以将该隐私交易打包(或还包括其它交易一起打包)并生成新的区块,并将该新的区块发送至非记账节点进行共识,而非记账节点在对收到的上述新的区块进行验证没有问题的情况下,可以将该新的区块追加到原有的区块链末尾,从而完成记账过程、达成共识。而如果上述隐私交易在本说明书的区块链节点处未通过共识前校验,那么该区块 链节点就不会向其他区块链节点广播该隐私交易。As mentioned earlier, in a blockchain network that adopts consensus algorithms such as proof of work, equity proof, and appointed equity proof, the consensus process includes the struggle for bookkeeping rights between blockchain nodes. Taking Ethereum as an example, the nodes in Ethereum are generally nodes competing for the right to bookkeeping. The above-mentioned blockchain nodes can execute the above-mentioned private transactions locally as nodes competing for the right to bookkeeping. If a certain node among all the nodes competing for the bookkeeping right wins in the process of the current round of competing for the bookkeeping right, it becomes the bookkeeping node. Assuming that the above-mentioned blockchain node wins in this round of competition for accounting rights, it becomes an accounting node; of course, if the blockchain node does not win in this round of competition for accounting rights, it is not an accounting node , And other nodes may become accounting nodes. For the above-mentioned blockchain networks competing for accounting rights, the blockchain nodes in this manual perform pre-consensus verification on the received private transactions, and if the verification passes, the private transactions will be broadcast to the blockchain network. Other blockchain nodes, so that no matter which node the billing node of this round is, the billing node can package the private transaction (or package other transactions together) and generate a new block, and add the new The block is sent to the non-booking node for consensus, and the non-booking node can append the new block to the end of the original blockchain if there is no problem in verifying the received new block. , So as to complete the accounting process and reach a consensus. And if the above-mentioned private transaction does not pass the pre-consensus verification at the blockchain node in this manual, then the blockchain node will not broadcast the private transaction to other blockchain nodes.
如前所述,在采用实用拜占庭容错等机制的区块链网络中,具有记账权的节点在本轮记账前已经商定好。因此,上述区块链节点接收到前述的隐私交易后,假定该隐私交易通过了共识前校验,那么:在该区块链节点自身不是本轮的记账节点的情况下,将该隐私交易发送至记账节点;在该区块链节点自身是本轮的记账节点的情况下,将该隐私交易打包(或还包括其它交易一起打包)并生成新的区块后,将生成的新的区块发送至非记账节点进行共识。以及,上述区块链节点接收到前述的隐私交易后,假定该隐私交易未通过共识前校验,则该区块链节点在自身不是本轮的记账节点的情况下不会将该隐私交易发送至记账节点,该区块链节点在自身是本轮的记账节点的情况下不会将该隐私交易用于打包生成新的区块。对于上述记账节点生成的新的区块,非记账节点可以在对收到的上述新的区块进行验证没有问题的情况下,可以将该新的区块追加到原有的区块链末尾,从而完成记账过程、达成共识。As mentioned earlier, in a blockchain network that uses mechanisms such as practical Byzantine fault tolerance, the nodes with the right to book accounts have been agreed before this round of bookkeeping. Therefore, after the above-mentioned blockchain node receives the aforementioned private transaction, assuming that the private transaction has passed the pre-consensus verification, then: if the blockchain node itself is not the accounting node of the current round, the private transaction Send to the accounting node; in the case that the blockchain node itself is the accounting node of this round, after packaging the private transaction (or including other transactions together) and generating a new block, the new block will be generated. The blocks are sent to non-booking nodes for consensus. And, after the above-mentioned blockchain node receives the aforementioned private transaction, assuming that the private transaction does not pass the pre-consensus verification, the blockchain node will not make the private transaction if it is not the accounting node of the current round. Sent to the accounting node, the blockchain node will not use the private transaction to package and generate a new block if it is the accounting node of the current round. For the new block generated by the above bookkeeping node, the non-bookkeeping node can add the new block to the original blockchain if there is no problem in verifying the received new block. At the end, to complete the bookkeeping process and reach a consensus.
步骤506,所述区块链节点针对收到的经过共识的任一隐私交易,查询记录的对应于所述任一隐私交易的校验结果。In step 506, the blockchain node queries the recorded verification result corresponding to any private transaction that is received through consensus.
如前所述,区块链节点可以记录下每笔交易的共识前校验的校验结果。例如,在区块链节点确定上述的隐私交易经过共识后,可以查询该隐私交易对应的共识前校验的校验结果,如果校验结果为通过校验,则可以跳过执行时校验操作,而直接执行该隐私交易;如果校验结果为未通过校验或未查找到校验结果,则需要实施执行时校验。As mentioned earlier, the blockchain node can record the verification result of the pre-consensus verification of each transaction. For example, after the blockchain node determines that the above-mentioned private transaction has passed the consensus, the verification result of the pre-consensus verification corresponding to the private transaction can be queried. If the verification result is passed, the verification operation during execution can be skipped , And execute the privacy transaction directly; if the verification result is that the verification is not passed or the verification result is not found, the execution-time verification is required.
如前所述,区块链节点需要将该任一隐私交易读入TEE中,采用前文所述的方式对该任一隐私交易进行解密得到明文交易内容,从而据此确定出上述的校验结果。当然,如果区块链节点将校验结果与相应的隐私交易的信息(譬如隐私交易的hash值)进行关联存储,那么区块链节点甚至可以在无需对隐私交易进行解密的情况下,即可查询到相应的校验结果。As mentioned above, the blockchain node needs to read any private transaction into the TEE, and decrypt any private transaction in the manner described above to obtain the plaintext transaction content, thereby determining the above-mentioned verification result . Of course, if the blockchain node associates the verification result with the corresponding private transaction information (such as the hash value of the private transaction), then the blockchain node can even store the private transaction without decrypting the private transaction. Query the corresponding verification result.
步骤508a,在查询到的校验结果为通过校验的情况下,所述区块链节点将所述任一隐私交易传入所述可信执行环境中予以执行。 Step 508a: In the case where the queried verification result is a pass, the blockchain node transmits any of the privacy transactions to the trusted execution environment for execution.
如前所述,本说明书中的隐私交易可能与智能合约相关,可以基于智能合约实现相对复杂的处理逻辑。当然,本说明书的隐私交易也可能与智能合约无关,仅用于实现相对简单的处理逻辑,比如相关技术中的转账逻辑等。As mentioned earlier, the privacy transactions in this manual may be related to smart contracts, and relatively complex processing logic can be implemented based on smart contracts. Of course, the privacy transactions in this manual may also have nothing to do with smart contracts, and are only used to implement relatively simple processing logic, such as transfer logic in related technologies.
如果隐私交易涉及智能合约,那么执行该隐私交易具体在TEE内运行的虚拟机中执 行。例如,以太坊中采用虚拟机(Ethereum Virtual Machine,EVM)。一般的,EVM执行字节码形式的智能合约。其中,如果隐私交易用于部署智能合约,那么区块链节点对该隐私交易所含的加密后交易内容进行解密、得到明文交易内容后,可以从该明文交易内容中获得待部署的合约代码;如果隐私交易用于调用智能合约,那么区块链节点可以从上述明文交易内容中获得目标智能合约的合约地址,使得区块链节点可以基于该合约地址从本地读取已部署的合约代码(如果部署在TEE内,该合约代码处于明文状态;如果部署在外部存储空间,该合约代码处于密文状态,需要读入TEE中进行解密后才能够在虚拟机中执行)。此外,明文交易内容中还可能包含执行合约代码所需的变量及其取值,区块链节点可以将该变量及其取值传入虚拟机,以配合对合约代码的执行。If the private transaction involves a smart contract, the execution of the private transaction is specifically executed in a virtual machine running in the TEE. For example, a virtual machine (Ethereum Virtual Machine, EVM) is used in Ethereum. Generally, EVM executes smart contracts in the form of bytecodes. Among them, if a private transaction is used to deploy a smart contract, the blockchain node decrypts the encrypted transaction content contained in the privacy transaction and obtains the plaintext transaction content, and can obtain the contract code to be deployed from the plaintext transaction content; If a private transaction is used to call a smart contract, then the blockchain node can obtain the contract address of the target smart contract from the above plaintext transaction content, so that the blockchain node can read the deployed contract code locally based on the contract address (if Deployed in the TEE, the contract code is in plaintext state; if deployed in an external storage space, the contract code is in ciphertext state and needs to be read into the TEE for decryption before it can be executed in the virtual machine). In addition, the plaintext transaction content may also include variables and their values required to execute the contract code. Blockchain nodes can pass the variables and their values to the virtual machine to cooperate with the execution of the contract code.
合约代码存在相应的一个或多个合约状态。区块链节点执行合约代码之后,合约状态的取值可能发生变化。区块链节点可以将这些合约状态以明文形式存储于TEE中;或者,区块链节点可以将这些合约状态在TEE中加密后存储至外部存储空间。区块链节点可以采用前文所述的第二对称密钥对合约状态进行加密;或者,区块链节点可以采用其他的对称密钥对合约状态进行加密,本说明书并不对此进行限制。The contract code has corresponding one or more contract states. After the blockchain node executes the contract code, the value of the contract state may change. Blockchain nodes can store these contract states in TEE in plaintext; or, blockchain nodes can encrypt these contract states in TEE and store them in external storage space. The blockchain node can use the aforementioned second symmetric key to encrypt the state of the contract; or, the blockchain node can use other symmetric keys to encrypt the state of the contract, which is not limited in this specification.
步骤508b,在查询到的校验结果为未通过校验或未查询到校验结果的情况下,所述区块链节点将所述任一隐私交易传入所述可信执行环境中进行执行时校验,并在所述任一隐私交易通过执行时校验的情况下执行所述任一隐私交易。Step 508b, in the case that the queried verification result is not passed the verification or the verification result is not queried, the blockchain node transmits any of the privacy transactions to the trusted execution environment for execution Time verification, and execute any privacy transaction in the case that any privacy transaction passes the execution time verification.
如前所述,区块链节点对隐私交易的执行流程可以包括:执行时校验操作和交易执行操作。区块链节点首先将该隐私交易传入TEE中进行校验,即执行时校验操作;以及,区块链节点可以在该隐私交易通过执行时校验的情况下,执行该隐私交易(即交易执行操作),否则拒绝执行该隐私交易或确定该隐私交易执行失败。执行时校验与前述的共识前校验的过程类似,譬如执行时校验可以包括检查交易是否有效、格式是否正确、验证交易的签名是否合法等,执行时校验可以涉及智能合约的合约代码及合约存储等,本说明书并不对此进行限制。由于执行时校验属于隐私交易的执行流程的一部分,而不同交易通常难以实现并行执行,因而不同交易的执行时校验通常采用串行执行。如果区块链节点可以实现多笔交易的并行执行,那么应当考虑不同交易的执行时校验之间可能存在的冲突问题,尤其是当执行时校验涉及到合约代码或合约存储的情况下。As mentioned above, the execution process of a private transaction by a blockchain node may include: verification operations during execution and transaction execution operations. The blockchain node first transfers the private transaction to the TEE for verification, that is, the execution-time verification operation; and, the blockchain node can execute the private transaction (that is, when the private transaction passes the execution-time verification) Transaction execution operation), otherwise refuse to execute the private transaction or determine that the execution of the private transaction fails. The execution-time verification is similar to the aforementioned pre-consensus verification process. For example, the execution-time verification can include checking whether the transaction is valid, the format is correct, and verifying whether the transaction signature is legal, etc. The execution verification can involve the contract code of the smart contract. And contract storage, etc., this manual does not limit this. Since execution-time verification is part of the execution process of private transactions, and different transactions are usually difficult to implement in parallel, the execution-time verification of different transactions is usually executed in series. If the blockchain node can realize the parallel execution of multiple transactions, then the possible conflicts between the verifications during the execution of different transactions should be considered, especially when the verification during execution involves contract code or contract storage.
在隐私交易通过执行时校验的情况下,区块链节点可以执行该隐私交易,该执行过程可以参考步骤508a的相关描述,此处不再赘述。In the case that the private transaction passes the execution-time verification, the blockchain node can execute the private transaction. For the execution process, refer to the related description of step 508a, which will not be repeated here.
图6是一示例性实施例提供的一种设备的示意结构图。请参考图6,在硬件层面, 该设备包括处理器602、内部总线604、网络接口606、内存608以及非易失性存储器610,当然还可能包括其他业务所需要的硬件。处理器602从非易失性存储器610中读取对应的计算机程序到内存608中然后运行,在逻辑层面上形成在区块链中实现隐私保护的高效交易装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Fig. 6 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 6, at the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610. Of course, it may also include hardware required for other services. The processor 602 reads the corresponding computer program from the non-volatile memory 610 to the memory 608 and then runs it to form an efficient transaction device that realizes privacy protection in the blockchain at the logical level. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, and so on. That is to say, the execution subject of the following processing flow is not limited to each The logic unit can also be a hardware or a logic device.
请参考图7,在软件实施方式中,该在区块链中实现隐私保护的高效交易装置可以包括以下单元。Please refer to FIG. 7. In the software implementation, the high-efficiency transaction device for implementing privacy protection in the blockchain may include the following units.
共识前校验单元701,使区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验。The pre-consensus verification unit 701 enables the blockchain node to transfer the private transaction submitted by the client to the trusted execution environment to perform pre-consensus verification on the private transaction.
缓存单元702,使所述区块链节点对共识前校验的过程中使用的至少一部分数据进行缓存。The cache unit 702 enables the blockchain node to cache at least part of the data used in the pre-consensus verification process.
共识单元703,使所述区块链节点在所述隐私交易通过共识前校验的情况下,与其他区块链节点对所述隐私交易进行共识处理。The consensus unit 703 enables the blockchain node to perform consensus processing on the private transaction with other blockchain nodes when the private transaction passes the pre-consensus verification.
执行单元704,使所述区块链节点将经过共识的所述隐私交易传入所述可信执行环境中予以执行,并在交易执行的过程中使用缓存的所述至少一部分数据。The execution unit 704 is configured to enable the blockchain node to transfer the consensus private transaction into the trusted execution environment for execution, and use the cached at least part of the data during the execution of the transaction.
可选的,所述共识前校验单元701具体用于:使所述区块链节点对所述隐私交易和至少一件其他隐私交易并行地实施共识前校验。Optionally, the pre-consensus verification unit 701 is specifically configured to: enable the blockchain node to perform pre-consensus verification on the private transaction and at least one other private transaction in parallel.
可选的,所述缓存单元702具体用于:使所述区块链节点将从所述隐私交易中提取的数据加密后缓存至所述可信执行环境之外。Optionally, the caching unit 702 is specifically configured to: enable the blockchain node to encrypt the data extracted from the private transaction and cache it outside the trusted execution environment.
可选的,所述隐私交易包括加密后交易内容和加密后密钥,所述加密后交易内容由交易发起方维护的第一对称密钥对明文交易内容进行加密得到,所述加密后密钥由节点公钥对所述第一对称密钥进行加密得到;从所述隐私交易中提取的数据包括:采用节点私钥对所述加密后密钥进行解密得到的所述第一对称密钥。Optionally, the private transaction includes encrypted transaction content and an encrypted key, where the encrypted transaction content is obtained by encrypting the plaintext transaction content with a first symmetric key maintained by the transaction initiator, and the encrypted key The first symmetric key is obtained by encrypting the node public key; the data extracted from the private transaction includes: the first symmetric key obtained by using the node private key to decrypt the encrypted key.
可选的,所述缓存单元702具体用于:使所述区块链节点采用所述可信执行环境中维护的第二对称密钥对所述第一对称密钥进行加密后缓存至所述可信执行环境之外。Optionally, the caching unit 702 is specifically configured to: enable the blockchain node to use a second symmetric key maintained in the trusted execution environment to encrypt the first symmetric key, and then cache it to the Outside the trusted execution environment.
可选的,所述缓存单元702具体用于:使所述区块链节点将加密后数据读入所述可信执行环境中进行解密得到的解密后数据缓存于所述可信执行环境中,其中所述加密后 数据被所述区块链节点存储于所述可信执行环境之外的外部存储空间。Optionally, the caching unit 702 is specifically configured to: enable the blockchain node to read the encrypted data into the trusted execution environment for decryption and cache the decrypted data obtained in the trusted execution environment, The encrypted data is stored by the blockchain node in an external storage space outside the trusted execution environment.
可选的,所述解密后数据包括以下至少之一:外部账户的状态数据、合约账户的状态数据、合约账户对应的合约代码、所述合约代码对应的合约存储。Optionally, the decrypted data includes at least one of the following: status data of an external account, status data of a contract account, contract code corresponding to the contract account, and contract storage corresponding to the contract code.
可选的,所述执行单元704具体用于:使所述区块链节点将执行经过共识的所述隐私交易传入所述可信执行环境中进行执行时校验。Optionally, the execution unit 704 is specifically configured to: enable the blockchain node to transfer the consensus-based privacy transaction to the trusted execution environment for execution time verification.
在所述隐私交易通过执行时校验的情况下,使所述区块链节点执行所述隐私交易。In the case where the privacy transaction passes the execution-time verification, the blockchain node is caused to execute the privacy transaction.
可选的,还包括:清除单元705,使所述区块链节点在所述隐私交易执行完毕后,清除缓存的所述至少一部分数据。Optionally, it further includes: a clearing unit 705, configured to enable the blockchain node to clear the at least a part of the cached data after the execution of the private transaction is completed.
图8是一示例性实施例提供的一种设备的示意结构图。请参考图8,在硬件层面,该设备包括处理器802、内部总线804、网络接口806、内存808以及非易失性存储器810,当然还可能包括其他业务所需要的硬件。处理器802从非易失性存储器810中读取对应的计算机程序到内存808中然后运行,在逻辑层面上形成在区块链中实现隐私保护的高效交易装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Fig. 8 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 8. At the hardware level, the device includes a processor 802, an internal bus 804, a network interface 806, a memory 808, and a non-volatile memory 810. Of course, it may also include hardware required for other services. The processor 802 reads the corresponding computer program from the non-volatile memory 810 to the memory 808 and then runs it to form an efficient transaction device that realizes privacy protection in the blockchain at the logical level. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, and so on. That is to say, the execution subject of the following processing flow is not limited to each The logic unit can also be a hardware or a logic device.
请参考图9,在软件实施方式中,该在区块链中实现隐私保护的高效交易装置可以包括以下单元。Please refer to FIG. 9, in the software implementation, the high-efficiency transaction device for implementing privacy protection in the blockchain may include the following units.
共识前校验单元901,使区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验。The pre-consensus verification unit 901 enables the blockchain node to transfer the private transaction submitted by the client to the trusted execution environment to perform pre-consensus verification on the private transaction.
记录单元902,使所述区块链节点将所述隐私交易的信息与共识前校验的校验结果进行关联记录。The recording unit 902 enables the blockchain node to associate and record the information of the private transaction and the verification result of the pre-consensus verification.
共识单元903,使所述区块链节点在所述隐私交易通过共识前校验的情况下,与其他区块链节点对所述隐私交易进行共识处理。The consensus unit 903 enables the blockchain node to perform consensus processing on the private transaction with other blockchain nodes when the private transaction passes the verification before the consensus.
查询单元904,使所述区块链节点针对收到的经过共识的任一隐私交易,查询记录的对应于所述任一隐私交易的校验结果。The query unit 904 is configured to enable the blockchain node to query the recorded verification result corresponding to any private transaction that is received through consensus for any private transaction.
执行单元905,在查询到的校验结果为通过校验的情况下,使所述区块链节点将所述任一隐私交易传入所述可信执行环境中予以执行;在查询到的校验结果为未通过校验或未查询到校验结果的情况下,使所述区块链节点将所述任一隐私交易传入所述可信 执行环境中进行执行时校验,并在所述任一隐私交易通过执行时校验的情况下执行所述任一隐私交易。The execution unit 905, when the queried verification result is passed the verification, causes the blockchain node to pass any of the privacy transactions into the trusted execution environment for execution; If the verification result is that the verification is not passed or the verification result is not queried, the blockchain node is caused to pass any of the privacy transactions into the trusted execution environment for execution-time verification, and check it at all Any one of the aforementioned private transactions is executed in a case where the execution-time verification is passed.
可选的,所述共识前校验单元901具体用于:使所述区块链节点对所述隐私交易和至少一件其他隐私交易并行地实施共识前校验。Optionally, the pre-consensus verification unit 901 is specifically configured to enable the blockchain node to perform a pre-consensus verification on the private transaction and at least one other private transaction in parallel.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, devices, modules, or units illustrated in the above embodiments may be specifically implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. The specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computer includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media, can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, product or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or also include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity, or equipment that includes the element.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围 内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and/or" as used herein refers to and includes any or all possible combinations of one or more associated listed items.
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "when" or "in response to determination".
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。The above descriptions are only preferred embodiments of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. All within the spirit and principle of one or more embodiments of this specification, Any modification, equivalent replacement, improvement, etc. made should be included in the protection scope of one or more embodiments of this specification.

Claims (17)

  1. 一种在区块链中实现隐私保护的高效交易方法,包括:An efficient transaction method that realizes privacy protection in the blockchain, including:
    区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验,并对共识前校验的过程中使用的至少一部分数据进行缓存;The blockchain node transmits the private transaction submitted by the client to the trusted execution environment to perform pre-consensus verification on the private transaction, and caches at least a part of the data used in the pre-consensus verification process;
    在所述隐私交易通过共识前校验的情况下,所述区块链节点与其他区块链节点对所述隐私交易进行共识处理;In the case that the privacy transaction passes the pre-consensus verification, the blockchain node and other blockchain nodes perform consensus processing on the privacy transaction;
    所述区块链节点将经过共识的所述隐私交易传入所述可信执行环境中予以执行,并在交易执行的过程中使用缓存的所述至少一部分数据。The blockchain node transfers the consensus private transaction into the trusted execution environment for execution, and uses the at least a part of the cached data during the execution of the transaction.
  2. 根据权利要求1所述的方法,所述区块链节点对所述隐私交易进行共识前校验,包括:The method according to claim 1, wherein the blockchain node performs a pre-consensus verification on the private transaction, comprising:
    所述区块链节点对所述隐私交易和至少一件其他隐私交易并行地实施共识前校验。The blockchain node performs pre-consensus verification on the private transaction and at least one other private transaction in parallel.
  3. 根据权利要求1所述的方法,所述对共识前校验的过程中使用的至少一部分数据进行缓存,包括:The method according to claim 1, wherein the caching of at least a part of the data used in the pre-consensus verification process comprises:
    所述区块链节点将从所述隐私交易中提取的数据加密后缓存至所述可信执行环境之外。The blockchain node encrypts the data extracted from the private transaction and caches it outside the trusted execution environment.
  4. 根据权利要求3所述的方法,所述隐私交易包括加密后交易内容和加密后密钥,所述加密后交易内容由交易发起方维护的第一对称密钥对明文交易内容进行加密得到,所述加密后密钥由节点公钥对所述第一对称密钥进行加密得到;从所述隐私交易中提取的数据包括:采用节点私钥对所述加密后密钥进行解密得到的所述第一对称密钥。The method according to claim 3, wherein the private transaction includes encrypted transaction content and an encrypted key, and the encrypted transaction content is obtained by encrypting the plaintext transaction content by a first symmetric key maintained by the transaction initiator, so The encrypted key is obtained by encrypting the first symmetric key with the node public key; the data extracted from the private transaction includes: the first symmetric key obtained by decrypting the encrypted key with the node private key A symmetric key.
  5. 根据权利要求4所述的方法,所述对共识前校验的过程中使用的至少一部分数据进行缓存,包括:The method according to claim 4, wherein the caching of at least a part of the data used in the pre-consensus verification process comprises:
    所述区块链节点采用所述可信执行环境中维护的第二对称密钥对所述第一对称密钥进行加密后缓存至所述可信执行环境之外。The blockchain node uses the second symmetric key maintained in the trusted execution environment to encrypt the first symmetric key and caches the first symmetric key outside the trusted execution environment.
  6. 根据权利要求1所述的方法,所述对共识前校验的过程中使用的至少一部分数据进行缓存,包括:The method according to claim 1, wherein the caching of at least a part of the data used in the pre-consensus verification process comprises:
    所述区块链节点将加密后数据读入所述可信执行环境中进行解密得到的解密后数据缓存于所述可信执行环境中,其中所述加密后数据被所述区块链节点存储于所述可信执行环境之外的外部存储空间。The blockchain node reads the encrypted data into the trusted execution environment for decryption. The decrypted data is cached in the trusted execution environment, where the encrypted data is stored by the blockchain node External storage space outside the trusted execution environment.
  7. 根据权利要求6所述的方法,所述解密后数据包括以下至少之一:外部账户的状态数据、合约账户的状态数据、合约账户对应的合约代码、所述合约代码对应的合约存储。The method according to claim 6, wherein the decrypted data includes at least one of the following: status data of an external account, status data of a contract account, contract code corresponding to the contract account, and contract storage corresponding to the contract code.
  8. 根据权利要求1所述的方法,所述区块链节点将经过共识的所述隐私交易传入所述可信执行环境中予以执行,包括:The method according to claim 1, wherein the blockchain node transferring the consensus-based private transaction into the trusted execution environment for execution includes:
    所述区块链节点将执行经过共识的所述隐私交易传入所述可信执行环境中进行执行时校验;The blockchain node transmits the consensus-based privacy transaction to the trusted execution environment for execution-time verification;
    在所述隐私交易通过执行时校验的情况下,所述区块链节点执行所述隐私交易。In the case where the privacy transaction passes the execution-time verification, the blockchain node executes the privacy transaction.
  9. 根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:
    所述区块链节点在所述隐私交易执行完毕后,清除缓存的所述至少一部分数据。The blockchain node clears the at least part of the cached data after the execution of the privacy transaction is completed.
  10. 一种在区块链中实现隐私保护的高效交易方法,包括:An efficient transaction method that realizes privacy protection in the blockchain, including:
    区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验,并将所述隐私交易的信息与共识前校验的校验结果进行关联记录;The blockchain node transmits the private transaction submitted by the client to the trusted execution environment to perform pre-consensus verification on the private transaction, and associates the information of the private transaction with the verification result of the pre-consensus verification. ;
    在所述隐私交易通过共识前校验的情况下,所述区块链节点与其他区块链节点对所述隐私交易进行共识处理;In the case that the privacy transaction passes the pre-consensus verification, the blockchain node and other blockchain nodes perform consensus processing on the privacy transaction;
    所述区块链节点针对收到的经过共识的任一隐私交易,查询记录的对应于所述任一隐私交易的校验结果;The blockchain node queries and records the verification result corresponding to the any private transaction that is received through consensus;
    在查询到的校验结果为通过校验的情况下,所述区块链节点将所述任一隐私交易传入所述可信执行环境中予以执行;In the case where the queried verification result is passed verification, the blockchain node transmits any of the privacy transactions to the trusted execution environment for execution;
    在查询到的校验结果为未通过校验或未查询到校验结果的情况下,所述区块链节点将所述任一隐私交易传入所述可信执行环境中进行执行时校验,并在所述任一隐私交易通过执行时校验的情况下执行所述任一隐私交易。In the case that the queried verification result is not passed the verification or the verification result is not queried, the blockchain node transmits any of the privacy transactions to the trusted execution environment for execution-time verification , And execute any private transaction in the case where the any private transaction passes the execution-time verification.
  11. 根据权利要求10所述的方法,所述区块链节点对所述隐私交易进行共识前校验,包括:The method according to claim 10, wherein the blockchain node performs a pre-consensus verification on the private transaction, comprising:
    所述区块链节点对所述隐私交易和至少一件其他隐私交易并行地实施共识前校验。The blockchain node performs pre-consensus verification on the private transaction and at least one other private transaction in parallel.
  12. 一种在区块链中实现隐私保护的高效交易装置,包括:An efficient transaction device that realizes privacy protection in the blockchain, including:
    共识前校验单元,使区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验;The pre-consensus verification unit enables the blockchain node to pass the private transaction submitted by the client to the trusted execution environment to perform pre-consensus verification on the private transaction;
    缓存单元,使所述区块链节点对共识前校验的过程中使用的至少一部分数据进行缓存;A cache unit, which enables the blockchain node to cache at least a part of the data used in the pre-consensus verification process;
    共识单元,使所述区块链节点在所述隐私交易通过共识前校验的情况下,与其他区块链节点对所述隐私交易进行共识处理;The consensus unit enables the blockchain node to perform consensus processing on the private transaction with other blockchain nodes when the private transaction passes the verification before consensus;
    执行单元,使所述区块链节点将经过共识的所述隐私交易传入所述可信执行环境中予以执行,并在交易执行的过程中使用缓存的所述至少一部分数据。The execution unit is configured to enable the blockchain node to transfer the consensus private transaction into the trusted execution environment for execution, and use the cached at least part of the data during the execution of the transaction.
  13. 一种在区块链中实现隐私保护的高效交易装置,包括:An efficient transaction device that realizes privacy protection in the blockchain, including:
    共识前校验单元,使区块链节点将客户端提交的隐私交易传入可信执行环境中以对所述隐私交易进行共识前校验;The pre-consensus verification unit enables the blockchain node to pass the private transaction submitted by the client to the trusted execution environment to perform pre-consensus verification on the private transaction;
    记录单元,使所述区块链节点将所述隐私交易的信息与共识前校验的校验结果进行关联记录;A recording unit to enable the blockchain node to associate the information of the private transaction with the verification result of the pre-consensus verification;
    共识单元,使所述区块链节点在所述隐私交易通过共识前校验的情况下,与其他区块链节点对所述隐私交易进行共识处理;The consensus unit enables the blockchain node to perform consensus processing on the private transaction with other blockchain nodes when the private transaction passes the verification before consensus;
    查询单元,使所述区块链节点针对收到的经过共识的任一隐私交易,查询记录的对应于所述任一隐私交易的校验结果;The query unit is configured to enable the blockchain node to query and record the verification result corresponding to any private transaction that is received through consensus;
    执行单元,在查询到的校验结果为通过校验的情况下,使所述区块链节点将所述任一隐私交易传入所述可信执行环境中予以执行;在查询到的校验结果为未通过校验或未查询到校验结果的情况下,使所述区块链节点将所述任一隐私交易传入所述可信执行环境中进行执行时校验,并在所述任一隐私交易通过执行时校验的情况下执行所述任一隐私交易。The execution unit, in the case that the queried verification result is passed the verification, causes the blockchain node to pass any of the privacy transactions into the trusted execution environment for execution; in the case of the queried verification If the result is that the verification is not passed or the verification result is not queried, the blockchain node is caused to pass any of the privacy transactions into the trusted execution environment for execution-time verification, and perform the verification in the If any private transaction passes the execution time verification, the any private transaction is executed.
  14. 一种电子设备,包括:An electronic device including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;A memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-9中任一项所述的方法。Wherein, the processor executes the executable instruction to implement the method according to any one of claims 1-9.
  15. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-9中任一项所述方法的步骤。A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implements the steps of the method according to any one of claims 1-9.
  16. 一种电子设备,包括:An electronic device including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;A memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求10或11所述的方法。Wherein, the processor implements the method according to claim 10 or 11 by running the executable instruction.
  17. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求10或11所述方法的步骤。A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implements the steps of the method according to claim 10 or 11.
PCT/CN2020/117534 2019-11-29 2020-09-24 Method for realizing highly efficient privacy-preserving transaction in blockchain, and device WO2021103794A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911207025.8 2019-11-29
CN201911207025.8A CN110992027B (en) 2019-11-29 2019-11-29 Efficient transaction method and device for realizing privacy protection in block chain

Publications (1)

Publication Number Publication Date
WO2021103794A1 true WO2021103794A1 (en) 2021-06-03

Family

ID=70088769

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/117534 WO2021103794A1 (en) 2019-11-29 2020-09-24 Method for realizing highly efficient privacy-preserving transaction in blockchain, and device

Country Status (2)

Country Link
CN (1) CN110992027B (en)
WO (1) WO2021103794A1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113379419A (en) * 2021-06-25 2021-09-10 远光软件股份有限公司 Transaction information access method and system and computer equipment
CN113469811A (en) * 2021-07-05 2021-10-01 支付宝(杭州)信息技术有限公司 Block chain transaction processing method and device
CN113761067A (en) * 2021-09-10 2021-12-07 北京冲量在线科技有限公司 Decentralized joint modeling system based on block chain and trusted execution environment
CN113923093A (en) * 2021-10-29 2022-01-11 博雅正链(北京)科技有限公司 Novel Byzantine fault-tolerant consensus method based on trusted execution environment
CN114172667A (en) * 2021-06-15 2022-03-11 支付宝(杭州)信息技术有限公司 Privacy evidence storing method and device based on contract
CN114640462A (en) * 2022-02-17 2022-06-17 北京邮电大学 Block chain privacy protection method and device, electronic equipment and storage medium
CN114638685A (en) * 2022-03-07 2022-06-17 支付宝(杭州)信息技术有限公司 Risk identification method, device and equipment
CN117726343A (en) * 2024-02-06 2024-03-19 中国信息通信研究院 Method, device, equipment and medium for supervising execution of intelligent contracts in block chain
CN114640462B (en) * 2022-02-17 2024-05-17 北京邮电大学 Block chain privacy protection method and device, electronic equipment and storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110992027B (en) * 2019-11-29 2022-02-25 支付宝(杭州)信息技术有限公司 Efficient transaction method and device for realizing privacy protection in block chain
CN111656386B (en) 2020-04-22 2022-05-17 支付宝(杭州)信息技术有限公司 Managing transaction requests in ledger system
CN111630545B (en) 2020-04-22 2022-05-27 支付宝(杭州)信息技术有限公司 Managing transaction requests in ledger system
SG11202103218YA (en) 2020-04-22 2021-04-29 Alipay Hangzhou Inf Tech Co Ltd Managing transaction requests in ledger systems
CN112513914A (en) * 2020-07-03 2021-03-16 支付宝(杭州)信息技术有限公司 System and method for providing privacy and security protection in block chain based privacy transactions
CN112422500B (en) * 2020-09-25 2023-05-16 北京熠智科技有限公司 Cross-platform data transmission method and device, storage medium and electronic device
US20230081416A1 (en) * 2021-09-10 2023-03-16 International Business Machines Corporation Anonymous private shared partitions in blockchain networks
US11968307B2 (en) * 2021-09-27 2024-04-23 International Bisuness Machines Corporation Private ledger partitions in blockchain networks

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169765A (en) * 2017-05-11 2017-09-15 电子科技大学 A kind of method adjusted into Mobile state of being known together based on business degree of belief to block chain
CN108830733A (en) * 2018-06-21 2018-11-16 中国银行股份有限公司 A kind of information processing method, block scm cluster and system
KR101943228B1 (en) * 2017-12-27 2019-01-28 에이치닥테크놀로지 주식회사 한국영업소 Blockchain system for virtual currency
CN109936626A (en) * 2019-02-19 2019-06-25 阿里巴巴集团控股有限公司 Method, node and the storage medium of secret protection are realized in block chain
CN110060054A (en) * 2019-02-19 2019-07-26 阿里巴巴集团控股有限公司 Method, node, system and the storage medium of secret protection are realized in block chain
CN110335037A (en) * 2019-04-19 2019-10-15 矩阵元技术(深圳)有限公司 Method of commerce, device and the storage medium calculated based on block chain and Secure
CN110992027A (en) * 2019-11-29 2020-04-10 支付宝(杭州)信息技术有限公司 Efficient transaction method and device for realizing privacy protection in block chain

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10484346B2 (en) * 2017-02-07 2019-11-19 Microsoft Technology Licensing, Llc Establishment of consortium blockchain network
CN107196900B (en) * 2017-03-24 2020-04-24 创新先进技术有限公司 Consensus checking method and device
CN107911373B (en) * 2017-11-24 2019-09-06 中钞信用卡产业发展有限公司杭州区块链技术研究院 A kind of block chain right management method and system
CN110474865B (en) * 2018-05-11 2021-07-06 北京轻信科技有限公司 Block chain user authority system and implementation method
CN108960794A (en) * 2018-07-14 2018-12-07 上海分布信息科技有限公司 A kind of block generation method and block generate system
CN110020855B (en) * 2019-01-31 2020-05-29 阿里巴巴集团控股有限公司 Method, node and storage medium for realizing privacy protection in block chain
CN110071802A (en) * 2019-04-24 2019-07-30 西安纸贵互联网科技有限公司 Data processing method and device suitable for block chain
CN110309663B (en) * 2019-06-25 2023-03-03 湖南搜云网络科技股份有限公司 Privacy authentication method and system based on block chain

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169765A (en) * 2017-05-11 2017-09-15 电子科技大学 A kind of method adjusted into Mobile state of being known together based on business degree of belief to block chain
KR101943228B1 (en) * 2017-12-27 2019-01-28 에이치닥테크놀로지 주식회사 한국영업소 Blockchain system for virtual currency
CN108830733A (en) * 2018-06-21 2018-11-16 中国银行股份有限公司 A kind of information processing method, block scm cluster and system
CN109936626A (en) * 2019-02-19 2019-06-25 阿里巴巴集团控股有限公司 Method, node and the storage medium of secret protection are realized in block chain
CN110060054A (en) * 2019-02-19 2019-07-26 阿里巴巴集团控股有限公司 Method, node, system and the storage medium of secret protection are realized in block chain
CN110335037A (en) * 2019-04-19 2019-10-15 矩阵元技术(深圳)有限公司 Method of commerce, device and the storage medium calculated based on block chain and Secure
CN110992027A (en) * 2019-11-29 2020-04-10 支付宝(杭州)信息技术有限公司 Efficient transaction method and device for realizing privacy protection in block chain

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114172667A (en) * 2021-06-15 2022-03-11 支付宝(杭州)信息技术有限公司 Privacy evidence storing method and device based on contract
CN113379419A (en) * 2021-06-25 2021-09-10 远光软件股份有限公司 Transaction information access method and system and computer equipment
CN113379419B (en) * 2021-06-25 2022-08-16 远光软件股份有限公司 Transaction information access method and system and computer equipment
CN113469811A (en) * 2021-07-05 2021-10-01 支付宝(杭州)信息技术有限公司 Block chain transaction processing method and device
CN113761067A (en) * 2021-09-10 2021-12-07 北京冲量在线科技有限公司 Decentralized joint modeling system based on block chain and trusted execution environment
CN113761067B (en) * 2021-09-10 2023-06-16 北京冲量在线科技有限公司 De-centralized joint modeling system based on blockchain and trusted execution environment
CN113923093A (en) * 2021-10-29 2022-01-11 博雅正链(北京)科技有限公司 Novel Byzantine fault-tolerant consensus method based on trusted execution environment
CN113923093B (en) * 2021-10-29 2024-02-06 博雅正链(北京)科技有限公司 Novel Bayesian-preemption fault-tolerant consensus method based on trusted execution environment
CN114640462A (en) * 2022-02-17 2022-06-17 北京邮电大学 Block chain privacy protection method and device, electronic equipment and storage medium
CN114640462B (en) * 2022-02-17 2024-05-17 北京邮电大学 Block chain privacy protection method and device, electronic equipment and storage medium
CN114638685A (en) * 2022-03-07 2022-06-17 支付宝(杭州)信息技术有限公司 Risk identification method, device and equipment
CN117726343A (en) * 2024-02-06 2024-03-19 中国信息通信研究院 Method, device, equipment and medium for supervising execution of intelligent contracts in block chain

Also Published As

Publication number Publication date
CN110992027A (en) 2020-04-10
CN110992027B (en) 2022-02-25

Similar Documents

Publication Publication Date Title
WO2021103794A1 (en) Method for realizing highly efficient privacy-preserving transaction in blockchain, and device
WO2021179743A1 (en) Method and apparatus for querying account privacy information in blockchain
WO2020238255A1 (en) Smart contract management method and apparatus based on blockchain, and electronic device
WO2021088548A1 (en) Smart contract based privacy data query method and apparatus
WO2021088546A1 (en) Blockchain account-based privacy data query method and device
WO2021088547A1 (en) Blockchain-based account private data query method and apparatus
WO2021088536A1 (en) Off-chain authorization-based private data query method and apparatus
WO2021184963A1 (en) Contract calling method and apparatus
WO2021082664A1 (en) Blockchain privacy data query method and apparatus
WO2021088549A1 (en) Permission query configuration method and apparatus based on chain code
WO2020233631A1 (en) Transaction type-based receipt storage method and node
WO2021088533A1 (en) Method and device for sharing private data
WO2020233623A1 (en) Receipt storage method and node combining transaction type and judgment condition
WO2020238959A1 (en) Method and device for realizing dynamic encryption based on block height
WO2021088535A1 (en) Smart contract-based private data query method and device
WO2020233635A1 (en) Receipt storage method combining conditional restrictions of multiple types of dimensions and node
WO2020233625A1 (en) Receipt storage method combining user type and determination conditions and node
WO2020233626A1 (en) Receipt storage method and node in combination with conditional limitation of transaction and user types
WO2020233615A1 (en) Receipt storage method combining user type and event function type and node
WO2021088543A1 (en) Smart contract-based permission query configuration method and apparatus
WO2020233628A1 (en) Receipt storage method and node based on combination of event function type and judgment condition
WO2020233630A1 (en) User type-based receipt storing method and node
WO2020233619A1 (en) Receipt storage method and node in combination with user type and transaction type
WO2021057181A1 (en) Fpga-based key negotiation method and device
WO2020233624A1 (en) Receipt storage method and node employing transaction type in combination with event function type

Legal Events

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

Ref document number: 20892040

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20892040

Country of ref document: EP

Kind code of ref document: A1