WO2024092930A1 - 区块链系统中的交易执行方法和节点 - Google Patents

区块链系统中的交易执行方法和节点 Download PDF

Info

Publication number
WO2024092930A1
WO2024092930A1 PCT/CN2022/135287 CN2022135287W WO2024092930A1 WO 2024092930 A1 WO2024092930 A1 WO 2024092930A1 CN 2022135287 W CN2022135287 W CN 2022135287W WO 2024092930 A1 WO2024092930 A1 WO 2024092930A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
consensus
transaction
node
ciphertext
Prior art date
Application number
PCT/CN2022/135287
Other languages
English (en)
French (fr)
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 WO2024092930A1 publication Critical patent/WO2024092930A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the embodiments of this specification belong to the field of blockchain, and more particularly to a transaction execution method and node in a blockchain system.
  • Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc.
  • data blocks are combined into a chain data structure in a sequential manner according to time sequence, and a distributed ledger that cannot be tampered with or forged is guaranteed by cryptography. Due to the characteristics of blockchain such as decentralization, information cannot be tampered with, and autonomy, blockchain has also received more and more attention and application.
  • the purpose of the present invention is to provide a transaction execution method and node in a blockchain system, which is conducive to improving the performance of the blockchain system.
  • a transaction execution method in a blockchain system comprises a plurality of blockchain nodes, the plurality of blockchain nodes comprise a plurality of consensus nodes, the plurality of consensus nodes comprise a consensus proposal node, the blockchain nodes are configured with a trusted execution environment (TEE), the TEEs of the plurality of blockchain nodes are configured with the same public-private key pair, and the method is executed by the blockchain nodes.
  • TEE trusted execution environment
  • the method includes: receiving a transaction request from a user device, wherein the transaction request includes a transaction ciphertext obtained by symmetrically encrypting a first transaction using a first key, and a key ciphertext obtained by asymmetrically encrypting the first key using a public key of the TEE; in the TEE of the blockchain node, asymmetrically decrypting the key ciphertext using a private key of the TEE to obtain the first key, symmetrically encrypting target information using a second key to obtain a forwarding ciphertext, wherein the target information at least includes the first key, and providing the forwarding ciphertext to the outside of the TEE, so that the consensus proposal node generates a consensus proposal including the transaction request and the forwarding ciphertext, so that when the consensus node reaches a consensus on the consensus proposal, in its TEE, the forwarding ciphertext is symmetrically decrypted according to the second key to obtain the first key, the transaction ciphertext is symmetrically
  • a transaction execution method in a blockchain system includes multiple blockchain nodes, the multiple blockchain nodes include multiple consensus nodes, the multiple consensus nodes include consensus proposal nodes, the blockchain nodes are configured with TEEs, the TEEs of the multiple blockchain nodes are configured with the same public-private key pair, and the method is executed by the consensus nodes.
  • the method includes: reaching consensus on a consensus proposal generated by the consensus proposal node, the consensus proposal including a transaction request from a user device and its corresponding forwarding ciphertext, the transaction request including a transaction ciphertext obtained by symmetrically encrypting a first transaction using a first key, and a key ciphertext obtained by asymmetrically encrypting the first key using a public key of the TEE, the forwarding ciphertext is obtained by symmetrically encrypting target information by a target node in its TEE using a second key, the target information includes the first key obtained by asymmetrically decrypting the key ciphertext using a private key of the TEE, and the target node is a blockchain node that receives the transaction request from the user device; when consensus is reached on the consensus proposal, in the TEE of the consensus node, the forwarding ciphertext is symmetrically decrypted according to the second key to obtain the first key, the transaction ciphertext is symmetrically decrypted using the
  • a blockchain node in a blockchain system comprising multiple blockchain nodes, the multiple blockchain nodes comprising multiple consensus nodes, the multiple consensus nodes comprising consensus proposal nodes, the blockchain nodes being configured with TEEs, the TEEs of the multiple blockchain nodes being configured with the same public-private key pair, the blockchain node comprising: a communication processing unit, configured to receive a transaction request from a user device, the transaction request comprising a transaction ciphertext obtained by symmetrically encrypting a first transaction using a first key, and a key ciphertext obtained by asymmetrically encrypting the first key using a public key of the TEE; the TEE being configured to asymmetrically decrypt the key ciphertext using its private key to obtain the first key, symmetrically encrypt target information using a second key to obtain a forwarding ciphertext, the target information at least comprising the first key, and provide the forwarding ciphertext to the outside of the TEE, so that
  • a consensus node in a blockchain system includes multiple blockchain nodes, the multiple blockchain nodes include multiple consensus nodes, the multiple consensus nodes include consensus proposal nodes, the blockchain nodes are configured with TEEs, and the TEEs of the multiple blockchain nodes are configured with the same public-private key pair.
  • the consensus node includes: a consensus processing unit, configured to reach a consensus on a consensus proposal generated by the consensus proposal node, the consensus proposal including a transaction request from a user device and its corresponding forwarding ciphertext, the transaction request including a transaction ciphertext obtained by symmetrically encrypting a first transaction using a first key, and a key ciphertext obtained by asymmetrically encrypting the first key using a public key of the TEE, the forwarding ciphertext is obtained by symmetrically encrypting target information by a target node in its TEE using a second key, the target information includes the first key obtained by asymmetrically decrypting the key ciphertext using a private key of the TEE, and the target node is a blockchain node that receives the transaction request from the user device; TEE, configured to, when consensus is reached on the consensus proposal, symmetrically decrypt the forwarding ciphertext according to the second key to obtain the first key, symmetrically decrypt the transaction ciphertext
  • the private key of the TEE can be used in its TEE to asymmetrically decrypt the key ciphertext in the transaction request to obtain the first key for encrypting the corresponding transaction, and then the second key corresponding to the transaction request is used to symmetrically encrypt the first key to obtain the forwarding ciphertext corresponding to the transaction request, so that the transaction request and the corresponding forwarding ciphertext are provided to the consensus proposal node.
  • the consensus node can reach a consensus on the consensus proposal generated by the consensus proposal node, which includes the transaction request and the corresponding forwarding ciphertext, and after reaching a consensus on the consensus proposal, in its TEE, the forwarding ciphertext corresponding to the transaction request is symmetrically decrypted using the second ciphertext corresponding to the transaction request to obtain the first key for symmetrically decrypting the transaction ciphertext in the transaction request, and then the first key is used to decrypt the corresponding transaction ciphertext to obtain the corresponding transaction, and execute the transaction.
  • the consensus node does not need to spend too much time to asymmetrically decrypt the key ciphertexts respectively included in each transaction request in the consensus proposal, and the process of asymmetrically decrypting each key ciphertext is essentially distributed to multiple blockchain nodes in the entire blockchain system for execution, which is conducive to improving the performance of the blockchain system.
  • FIG1 is an architecture diagram of a blockchain system provided in an embodiment of this specification.
  • FIG. 2 is a schematic diagram of the consensus process in the PBFT consensus algorithm
  • FIG3 is one of the flow charts of a transaction execution method in a blockchain system provided in an embodiment of this specification.
  • FIG4 is a second flowchart of a transaction execution method in a blockchain system provided in an embodiment of this specification.
  • FIG5 is a schematic diagram of the structure of a blockchain node in a blockchain system provided in an embodiment of this specification.
  • FIG6 is a schematic diagram of the structure of a consensus node in a blockchain system provided in an embodiment of this specification.
  • FIG. 1 is an architecture diagram of a blockchain system exemplarily provided in the embodiments of this specification.
  • the blockchain system 100 may include, for example, N blockchain nodes, wherein FIG. 1 exemplarily shows 8 blockchain nodes such as node 1 to node 8.
  • the connection between the nodes schematically represents a P2P (Peer to Peer, point-to-point) connection, and the aforementioned connection may be, for example, a transmission control protocol (TCP) connection, which is used to support data transmission between different nodes.
  • P2P Peer to Peer, point-to-point
  • TCP transmission control protocol
  • a transaction in a blockchain system can refer to a task unit executed and recorded in the blockchain system.
  • a transaction usually includes a send field (From), a receive field (To), and a data field (Data).
  • the From field indicates the account address that initiates the transaction (i.e., initiates a transfer task to another account)
  • the To field indicates the account address that receives the transaction (i.e., receives the transfer)
  • the Data field includes the transfer amount.
  • the blockchain system can provide the function of smart contracts.
  • Smart contracts on the blockchain system are contracts that can be triggered and executed by transactions on the blockchain system.
  • Smart contracts can be defined in the form of code. Calling a smart contract in the blockchain system is to initiate a transaction pointing to the smart contract address, so that the nodes in the blockchain system can run the smart contract code in a distributed manner.
  • Bob sends a transaction containing information about creating a smart contract (i.e., deploying a contract) to the blockchain shown in Figure 1.
  • the data field of the transaction includes the code of the contract to be created (such as bytecode or machine code), and the to field of the transaction is empty to indicate that the transaction is used to deploy a contract.
  • the contract address "0x6f8ae93" of the contract is determined.
  • Each node adds a contract account corresponding to the contract address of the smart contract to the state database, allocates the state storage corresponding to the contract account, and stores the contract code.
  • the hash value of the contract code is saved in the state storage of the contract, so that the contract is created successfully.
  • Bob sends a transaction for calling a smart contract to the blockchain shown in Figure 1.
  • the from field of the transaction is the address of the account of the transaction initiator (i.e. Bob), and the to field is, for example, the above-mentioned "0x6f8ae93", i.e. the address of the smart contract being called.
  • the data field of the transaction includes the method and parameters for calling the smart contract.
  • the consensus mechanism in the blockchain system is a mechanism for blockchain nodes to reach the same consensus on block information (or block data) across the entire network, which can ensure that the latest block is accurately added to the blockchain.
  • the current mainstream consensus mechanisms include: Proof of Work (POW), Proof of Stake (POS), Delegated Proof of Stake (DPOS), Practical Byzantine Fault Tolerance (PBFT) algorithm, etc.
  • PW Proof of Work
  • POS Proof of Stake
  • DPOS Delegated Proof of Stake
  • PBFT Practical Byzantine Fault Tolerance
  • each node in the blockchain system can generate the same state in the blockchain system by executing the same transaction, so that each node in the blockchain system stores the same state database.
  • FIG2 is a schematic diagram of the consensus process in the PBFT consensus algorithm.
  • the consensus process can be divided into four stages: request, pre-prepare (PP), prepare (P) and commit (C).
  • a blockchain includes four consensus nodes, node n1-node n4, wherein node n1 is, for example, a master node, and node n2-node n4 are, for example, slave nodes.
  • f 1 malicious nodes can be tolerated in node n1-node n4.
  • a user of the blockchain can send a request to node n1 through his user device, and the request is, for example, in the form of a blockchain transaction.
  • node n1 can package the multiple transactions into a consensus proposal, and send the consensus proposal and the signature of node n1 on the consensus proposal to other consensus nodes (i.e., node n2-node n4) for generating blocks.
  • the consensus proposal may include information such as the transaction body of the multiple transactions and the submission order of the multiple transactions.
  • each slave node can sign the consensus proposal and send it to each other node.
  • each consensus node signs the consensus proposal in the submission phase and sends it to other consensus nodes.
  • each consensus node can determine that the submission phase is completed and the consensus is successful. For example, after receiving and verifying the signatures of the submission phase of nodes n2 and n3, node n1 determines that the submission phase is completed, so that node n1 can execute the multiple transactions according to the consensus proposal, generate and store blocks (such as block N) including the multiple transactions, update the world state according to the execution results of the multiple transactions, and return the execution results of the multiple transactions to the user device.
  • blocks such as block N
  • nodes n2 and n3 execute the multiple transactions, update the world state according to the execution results of the multiple transactions, and generate and store block N.
  • the storage identity of nodes n1, n2, and n3 is achieved.
  • nodes n1-n4 can still achieve consensus on the consensus proposal successfully and complete the execution of the block in the presence of a malicious node.
  • the blockchain node can be configured with TEE.
  • the transaction request sent by the user device to the blockchain system may be encrypted by envelope encryption; for example, the user device may select a symmetric key to symmetrically encrypt the transaction to be sent to obtain the transaction ciphertext, use the public key of the TEE in the blockchain node to asymmetrically encrypt the selected symmetric key to obtain the key ciphertext, and send a transaction request containing the transaction ciphertext and the key ciphertext to the blockchain system instead of directly sending the corresponding transaction.
  • the consensus proposal may include multiple transaction requests.
  • the node that reaches consensus on the consensus proposal can decrypt the multiple transaction requests included in the consensus proposal in its TEE, obtain multiple transactions corresponding to the multiple transaction requests, and then complete the execution of the multiple transactions.
  • different transaction requests/user devices usually select different symmetric keys to symmetrically encrypt the corresponding transactions.
  • the node that reaches consensus on the consensus proposal needs to use the private key of the TEE in its TEE to asymmetric decrypt the key ciphertext included in each of the multiple transaction requests in the consensus proposal.
  • the time required to perform the asymmetric decryption process is substantially longer than the time required to perform the symmetric decryption process, resulting in the consensus node needing to spend a lot of time to complete the asymmetric decryption of the key ciphertext included in each of the multiple transaction requests in the consensus proposal.
  • the embodiments of this specification provide a transaction execution method and node in a blockchain system.
  • the private key of the TEE can be used in its TEE to asymmetrically decrypt the key ciphertext in the transaction request to obtain a first key for encrypting the corresponding transaction, and then the second key corresponding to the transaction request is used to symmetrically encrypt the first key to obtain the forwarding ciphertext corresponding to the transaction request, so that the transaction request and the corresponding forwarding ciphertext are provided to the consensus proposal node.
  • the consensus node can reach a consensus on the consensus proposal generated by the consensus proposal node, which includes the transaction request and the corresponding forwarding ciphertext, and after reaching a consensus on the consensus proposal, in its TEE, the second ciphertext corresponding to the transaction request is used to symmetrically decrypt the forwarding ciphertext corresponding to the transaction request, obtain the first key for symmetrically decrypting the transaction ciphertext in the transaction request, and then use the first key to decrypt the corresponding transaction ciphertext to obtain the corresponding transaction, and execute the transaction.
  • the consensus node does not need to spend too much time to asymmetric decrypt the key ciphertext included in each transaction request in the consensus proposal.
  • the process of asymmetric decryption of each key ciphertext is essentially distributed to multiple blockchain nodes in the entire blockchain system, which is conducive to improving the performance of the blockchain system.
  • FIG3 is one of the flow charts of a transaction execution method in a blockchain system provided in an embodiment of this specification.
  • the blockchain system includes multiple blockchain nodes configured with TEE, and the TEEs of the multiple blockchain nodes are configured with the same public-private key pair.
  • Some of the multiple blockchain nodes can be used as consensus nodes, that is, the multiple blockchain nodes may include multiple consensus nodes, and the multiple consensus nodes include consensus proposal nodes.
  • the method can be executed by any blockchain node among the aforementioned multiple blockchain nodes. Through this method, the blockchain node in the blockchain system that serves as a consensus proposal node can obtain any transaction request Q1 from a user device and its corresponding forwarding ciphertext ED. As shown in FIG3, the method may include, but is not limited to, part or all of the following steps S31 to S37.
  • Step S31 the blockchain node receives a transaction request Q1 from a user device, which at least includes a transaction ciphertext ET obtained by symmetric encryption of the transaction Tx1 using the key key1, and a key ciphertext EK obtained by asymmetric encryption of the transaction ciphertext ET using the public key of the TEE.
  • the user device when it wishes to send a transaction Tx1 (i.e., the first transaction) to the blockchain system, it can generate/select a key key1 (i.e., the first key) for symmetrically encrypting the transaction Tx1 according to a certain rule, use key1 to symmetrically encrypt the transaction Tx1 to obtain the transaction ciphertext ET, use the public key of the TEE in the blockchain node to asymmetrically encrypt key1 to obtain the key ciphertext EK, and then send a transaction request Q1 to the blockchain node connected to the user device.
  • the transaction request Q1 includes at least the transaction ciphertext ET and the key ciphertext EK, and may also include the hash value of the transaction Tx1 calculated by the user device.
  • Step S32 the blockchain node provides a transaction request Q1 to its TEE.
  • Step S33 the TEE of the blockchain node uses its private key to asymmetrically decrypt the key ciphertext EK to obtain the key key1.
  • the TEE of the blockchain node can execute the following step S34 to determine the key key2 corresponding to the transaction request Q1.
  • the key key2 (i.e., the second key) corresponding to the transaction request Q1 can be obtained by processing the transaction request Q1 based on a certain preset rule. For example, when the transaction request Q1 includes the hash value of the transaction Tx1, the key key2 corresponding to the transaction request Q1 can be calculated based on the hash value of the transaction Tx1 and the private key of the TEE.
  • Step S35 the TEE of the blockchain node uses the key key2 to symmetrically encrypt the target information to obtain the forwarding ciphertext ED.
  • the key key2 in step S35 is, for example, the key key2 determined in step S34, or may be the private key of the TEE.
  • the target information includes at least the key key1, and may also include the hash value of the transaction Tx1 in the transaction request Q1 and/or a random number obtained by the TEE of the blockchain node.
  • the purpose of adding the random number to the target information is to prevent the intruder from cracking the private key of the TEE based on the forwarded ciphertext ED.
  • Step S36 the TEE of the blockchain node provides the forwarding ciphertext ED to the outside.
  • the consensus proposal node can obtain the transaction request Q1 and its corresponding forwarding ciphertext ED by executing the aforementioned steps S31 to S36.
  • the blockchain node may further proceed to execute the following step S37 to send a transaction request Q1 and its corresponding forwarding ciphertext ED to the consensus proposal node.
  • the consensus proposal node in the blockchain system can obtain the transaction request and its corresponding forwarding ciphertext through the same/similar process as the aforementioned steps S31 to S37.
  • the consensus proposal node can initiate a consensus proposal containing multiple transaction requests and their respective corresponding forwarding ciphertexts, and execute the subsequent transaction execution process.
  • FIG4 is a flowchart of a transaction execution method in a blockchain system provided in an embodiment of this specification.
  • the blockchain system includes multiple blockchain nodes configured with TEE, and the TEEs of the multiple blockchain nodes are configured with the same public-private key pair.
  • the multiple blockchain nodes include multiple consensus nodes, and the multiple consensus nodes include consensus proposal nodes.
  • the consensus proposal node can obtain multiple transaction requests and their corresponding forwarding ciphertexts, for example, through the method shown in FIG3.
  • the method can be executed by any consensus node among the aforementioned multiple consensus nodes, and the blockchain node as a consensus node in the blockchain system can complete the execution of multiple transactions through this method.
  • the method may include, but is not limited to, part or all of the following steps S41 to S48.
  • step S41 When a consensus node is used as a consensus proposal node, it is necessary to execute step S41 to generate a consensus proposal, which includes multiple transaction requests arranged in sequence and their corresponding forwarding ciphertexts. Then, the following step S42 is executed.
  • step S42 can be directly executed to reach a consensus with the remaining consensus nodes in the plurality of consensus nodes on the consensus proposal generated by the consensus proposal node.
  • the process of reaching a consensus on the consensus proposal can be, for example, referred to the various stages of the consensus process based on the PBFT consensus algorithm mentioned above, which will not be repeated here.
  • step S43 When consensus is reached on the consensus proposal, the consensus node executes step S43 to provide its TEE with multiple transaction requests in the consensus proposal and their respective corresponding forwarding ciphertexts.
  • the TEE of the consensus node can execute part or all of the following steps S44 to S48 for any transaction request Q1 among the multiple transaction requests to complete the execution of the transaction Tx1 corresponding to the transaction request Q1.
  • step S44 a key key2 corresponding to the transaction request Q1 is determined.
  • the key key2 can be obtained by the same method as the aforementioned step S34.
  • the TEE of the consensus node can obtain the hash value of the transaction Tx1 from the transaction request Q1, and then calculate the key key2 based on the hash value of the transaction Tx1 and the private key of the TEE.
  • Step S45 using the key key2 to symmetrically decrypt the forwarded ciphertext ED corresponding to the transaction request Q1 to obtain the target information, which at least includes the key key1.
  • the target information includes at least the key key1, and may also include the hash value and/or random number of the transaction Tx1.
  • the key key2 in the aforementioned step S45 is, for example, the key key2 determined in step S45, or may be the private key of the TEE.
  • the transaction request Q1 received by the consensus node's TEE from the outside should also include the hash value of transaction Tx1.
  • the consensus node's TEE can also execute the following step S46.
  • Step S46 verify the hash value of transaction Tx1. In other words, verify whether the hash value of transaction Tx1 included in transaction request Q1 is the same as the hash value of transaction Tx1 included in the target information. If they are different, it means that the intruder outside the TEE may have forged the forwarding ciphertext ED corresponding to transaction request Q1 provided to the TEE of the consensus node; if they are the same, it means that the hash value of transaction Tx1 has passed the verification, and the TEE of the consensus node can continue to execute the following step S47.
  • Step S47 using key key1 to symmetrically decrypt the transaction ciphertext ET in the transaction request Q1 to obtain transaction Tx1.
  • Step S48 execute transaction Tx1.
  • the consensus node may not provide the forwarding ciphertext corresponding to the transaction request Q1 to its TEE.
  • the TEE of the consensus node does not need to execute steps S44 to S46, but uses its private key to asymmetrically decrypt the key ciphertext EK in the transaction request Q1 to obtain the key key1, and then executes subsequent steps S47 and S48.
  • the TEE of the consensus node can also use its private key to asymmetric decrypt the key ciphertext EK in the transaction request Q1 to obtain the key key1, and then execute steps S47 and S48.
  • the consensus node does not need to spend too much time to asymmetric decrypt the key ciphertext included in each transaction request in the consensus proposal.
  • the process of asymmetric decryption of each key ciphertext is essentially distributed to multiple blockchain nodes in the entire blockchain system for execution, which is beneficial to improving the performance of the blockchain system.
  • an embodiment of the present specification provides a blockchain node in a blockchain system, wherein the blockchain system includes multiple blockchain nodes, the multiple blockchain nodes include multiple consensus nodes, the multiple consensus nodes include consensus proposal nodes, the blockchain nodes are configured with TEEs, and the TEEs of the multiple blockchain nodes are configured with the same public-private key pair.
  • the blockchain node includes: a communication processing unit 51, configured to receive a transaction request from a user device, the transaction request includes a transaction ciphertext obtained by symmetrically encrypting a first transaction with a first key, and a key ciphertext obtained by asymmetrically encrypting the first key with a public key of the TEE; TEE 53, configured to asymmetrically decrypt the key ciphertext with its private key to obtain the first key, symmetrically encrypt target information with a second key to obtain a forwarding ciphertext, the target information at least includes the first key, and provide the forwarding ciphertext to the outside, so that the consensus proposal node generates a consensus proposal including the transaction request and the forwarding ciphertext, so that the consensus node, when reaching a consensus on the consensus proposal, symmetrically decrypts the forwarding ciphertext according to the second key in its TEE to obtain the first key, symmetrically decrypts the transaction ciphertext with the first key to
  • the transaction request also includes a hash value of the first transaction
  • the second key is calculated based on the private key of the TEE and the hash value of the first transaction.
  • the target information also includes a random number and a hash value of the first transaction.
  • the blockchain node is not the consensus proposal node, and the communication processing unit 51 is further used to send the transaction request and the forwarding ciphertext to the consensus proposal node.
  • the embodiment of this specification also provides a consensus node in a blockchain system, wherein the blockchain system includes multiple blockchain nodes, the multiple blockchain nodes include multiple consensus nodes, the multiple consensus nodes include consensus proposal nodes, the blockchain nodes are configured with TEEs, and the TEEs of the multiple blockchain nodes are configured with the same public-private key pair.
  • the consensus node includes: a consensus processing unit 61, configured to reach a consensus on a consensus proposal generated by the consensus proposal node, the consensus proposal including a transaction request from a user device and its corresponding forwarding ciphertext, the transaction request including a transaction ciphertext obtained by symmetrically encrypting a first transaction using a first key, a key ciphertext obtained by asymmetrically encrypting the first key using a public key of the TEE, the forwarding ciphertext is obtained by symmetrically encrypting target information by a target node in its TEE using a second key, the target information includes asymmetrically decrypting the key ciphertext using a private key of the TEE to obtain the first key, and the target node is a blockchain node that receives the transaction request from the user device; TEE 63, configured to, when consensus is reached on the consensus proposal, symmetrically decrypt the forwarding ciphertext according to the second key to obtain the first key, symmetrically de
  • the transaction request also includes a hash value of the first transaction
  • the TEE 63 of the consensus node is further configured to calculate the second key based on its private key and the hash value of the first transaction.
  • the TEE 63 of the consensus node is configured to symmetrically decrypt the forwarded ciphertext according to the second key to obtain the target information, wherein the target information includes the first key, the hash value of the first transaction, and a random number.
  • the TEE 63 of the consensus node is further configured to verify the hash value of the first transaction; and, when the hash value of the first transaction fails the verification, asymmetrically decrypt the key ciphertext according to the private key of the TEE to obtain the first key.
  • the consensus node is the consensus proposal node, and the consensus node further includes: a communication processing unit 65, configured to receive the transaction request and the forwarding ciphertext from other blockchain nodes; and the consensus processing unit 61, further configured to generate the consensus proposal.
  • a computer-readable storage medium is also provided in an embodiment of the present specification, on which a computer program is stored.
  • the computer program is executed in a computer, the computer is caused to execute the various method steps performed by the TEE in the blockchain node or consensus node in the aforementioned method embodiment.
  • a programmable logic device such as a field programmable gate array (FPGA)
  • FPGA field programmable gate array
  • HDL Hardware Description Language
  • HDL Very-High-Speed Integrated Circuit Hardware Description Language
  • ABEL Advanced Boolean Expression Language
  • AHDL Altera Hardware Description Language
  • HDCal Joint CHDL
  • JHDL Java Hardware Description Language
  • Lava Lava
  • Lola MyHDL
  • PALASM RHDL
  • VHDL Very-High-Speed Integrated Circuit Hardware Description Language
  • Verilog Verilog
  • the controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer readable medium storing a computer readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory.
  • a computer readable program code e.g., software or firmware
  • the controller may be implemented in the form of a logic gate, a switch, an application specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the means for implementing various functions included therein may also be considered as a structure within the hardware component. Or even, the means for implementing various functions may be considered as both a software module for implementing the method and a structure within the hardware component.
  • the systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.
  • a typical implementation device is a server system.
  • the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
  • one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means.
  • the order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order.
  • the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment).
  • each module can be implemented in the same or more software and/or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc.
  • the device embodiments described above are only schematic.
  • the division of the units is only a logical function division. There may be other division methods in actual implementation.
  • multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • each process and/or box in the flowchart and/or block diagram, as well as the combination of the process and/or box in the flowchart and/or block diagram can be implemented by computer program instructions.
  • These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
  • These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
  • a computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
  • processors CPU
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information.
  • 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, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
  • computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
  • one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network.
  • program modules may be located in local and remote computer storage media, including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

一种区块链系统中的交易执行方法和节点,区块链系统包括配置有TEE的多个区块链节点,多个区块链节点中包括多个共识节点。由区块链节点执行的方法包括:从用户设备接收交易请求,其包括利用第一密钥对第一交易进行加密以获得的交易密文、利用TEE的公钥对第一密钥进行加密以得到的密钥密文;在区块链节点的TEE中,利用TEE的私钥对密钥密文进行解密以获得第一密钥,利用第二密钥对目标信息进行加密以获得转发密文,目标信息包括第一密钥,使得多个共识节点中的共识提议节点生成包含交易请求和转发密文的共识提议,以便共识节点在其TEE中,根据第二密钥对转发密文进行解密以获得第一密钥,利用第一密钥对交易密文进行解密以获得第一交易,并执行第一交易。

Description

区块链系统中的交易执行方法和节点
本申请要求于2022年10月31日提交中国国家知识产权局、申请号202211346008.4、申请名称为“区块链系统中的交易执行方法和节点”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本说明书实施例属于区块链领域,尤其涉及一种区块链系统中的交易执行方法和节点。
背景技术
区块链(Blockchain)是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链系统中按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。由于区块链具有去中心化、信息不可篡改、自治性等特性,区块链也受到人们越来越多的重视和应用。
发明内容
本发明的目的在于提供一种区块链系统中的交易执行方法和节点,有利于提高区块链系统的性能。
第一方面,提供了一种区块链系统中的交易执行方法,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多个共识节点,所述多个共识节点中包括共识提议节点,所述区块链节点配置有可信执行环境(trusted execution environment,TEE),所述多个区块链节点的TEE配置有相同的公私钥对,所述方法由所述区块链节点执行。所述方法包括:从用户设备接收交易请求,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文;在所述区块链节点的TEE中,利用所述TEE的私钥对所述密钥密文进行非对称解密以获得所述第一密钥,利用第二密钥对目标信息进行对称加密以获得转发密文,所述目标信息至少包括所述第一密钥,并向所述TEE的外部提供所述转发密文,使得所述共识提议节点生成包含所述交易请求和所述转发密文的共 识提议,以便所述共识节点在对所述共识提议达成共识的情况下,在其TEE中,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
第二方面,提供了一种区块链系统中的交易执行方法,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多个共识节点,所述多个共识节点中包括共识提议节点,所述区块链节点配置有TEE,所述多个区块链节点的TEE配置有相同的公私钥对,所述方法由所述共识节点执行。所述方法包括:对由所述共识提议节点生成的共识提议进行共识,所述共识提议包括来自用户设备的交易请求以及其对应的转发密文,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文,所述转发密文由目标节点在其TEE中利用第二密钥对目标信息进行对称加密以获得,所述目标信息中包括利用所述TEE的私钥对所述密钥密文进行非对称解密以获得的所述第一密钥,所述目标节点是从所述用户设备接收到所述交易请求的区块链节点;在对所述共识提议达成共识的情况下,在所述共识节点的TEE中,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
第三方面,提供了一种区块链系统中的区块链节点,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多个共识节点,所述多个共识节点中包括共识提议节点,所述区块链节点配置有TEE,所述多个区块链节点的TEE配置有相同的公私钥对,所述区块链节点包括:通信处理单元,配置为从用户设备接收交易请求,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文;TEE,配置为利用其私钥对所述密钥密文进行非对称解密以获得所述第一密钥,利用第二密钥对目标信息进行对称加密以获得转发密文,所述目标信息至少包括所述第一密钥,并向所述TEE的外部提供所述转发密文,使得所述共识提议节点生成包含所述交易请求和所述转发密文的共识提议,以便所述共识节点在对所述共识提议达成共识的情况下,在其TEE中,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
第四方面,提供了一种区块链系统中的共识节点,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多个共识节点,所述多个共识节点中包括共识提 议节点,所述区块链节点配置有TEE,所述多个区块链节点的TEE配置有相同的公私钥对。所述共识节点包括:共识处理单元,配置为对由所述共识提议节点生成的共识提议进行共识,所述共识提议包括来自用户设备的交易请求以及其对应的转发密文,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文,所述转发密文由目标节点在其TEE中利用第二密钥对目标信息进行对称加密以获得,所述目标信息中包括利用所述TEE的私钥对所述密钥密文进行非对称解密以获得的所述第一密钥,所述目标节点是从所述用户设备接收到所述交易请求的区块链节点;TEE,配置为在对所述共识提议达成共识的情况下,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
在本说明书实施例的方案中,对于从用户设备接收到交易请求的区块链节点,可以在其TEE中利用TEE的私钥对交易请求中的密钥密文进行非对称解密以获得用于加密相应交易的第一密钥,进而利用与该交易请求对应的第二密钥对该第一密钥进行对称加密以获得与该交易请求对应的转发密文,使得交易请求以及其对应的转发密文均被提供给共识提议节点。与之相应的是,共识节点可以对共识提议节点生成的、包含交易请求以及其对应的转发密文的共识提议进行共识,并在对共识提议达成共识后,在其TEE中,利用与交易请求对应的第二密文对与交易请求对应的转发密文进行对称解密,获得用于对交易请求中的交易密文进行对称解密的第一密钥,进而利用第一密钥对相应的交易密文进行解密以获得相应的交易,并执行该交易。如此,共识节点无需花费过多的时间对共识提议中的各个交易请求所分别包括的密钥密文进行非对称解密,对各个密钥密文进行非对称解密的过程实质上被分散到整个区块链系统中的多个区块链节点执行,有利于提高区块链系统的性能。
附图说明
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本说明书实施例中提供的一种区块链系统的架构图;
图2为PBFT共识算法中的共识过程示意图;
图3为本说明书实施例中提供的一种区块链系统中的交易执行方法的流程图之一;
图4为本说明书实施例中提供的一种区块链系统中的交易执行方法的流程图之二;
图5为本说明书实施例中提供的一种区块链系统中的区块链节点的结构示意图;
图6为本说明书实施例中提供的一种区块链系统中的共识节点的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。
图1为本说明书实施例中示例性提供的一种区块链系统的架构图。在图1所示的区块链系统的架构图中,区块链系统100中例如可以包括N个区块链节点,其中图1中示例性的示出了节点1-节点8等8个区块链节点。节点之间的连线示意性的表示P2P(Peer to Peer,点对点)连接,前述连接例如可以为传输控制协议(transmission control trotocol,TCP)连接,前述连接用于支持在不同节点之间传输数据。
区块链系统中的交易可以指在区块链系统中执行并记录在区块链系统中的任务单元。交易中通常包括发送字段(From)、接收字段(To)和数据字段(Data)。其中,在交易为转账交易的情况中,From字段表示发起该交易(即发起对另一个账户的转账任务)的账户地址,To字段表示接收该交易(即接收转账)的账户地址,Data字段中包括转账金额。
区块链系统中可提供智能合约的功能。区块链系统上的智能合约是在区块链系统上可以被交易触发执行的合约。智能合约可以通过代码的形式定义。在区块链系统中调用智能合约,是发起一笔指向智能合约地址的交易,使得区块链系统中的节点分布式地运行智能合约代码。
在部署合约的场景中,例如,Bob将一个包含创建智能合约信息(即部署合约)的交易发送到如图1所示的区块链中,该交易的data字段包括待创建的合约的代码(如字节码或者机器码),交易的to字段为空,以表示该交易用于部署合约。节点间通过共识机制达成相同后,确定合约的合约地址“0x6f8ae93…”,各个节点在状态数据库中添加与该智能合约的合约地址对应的合约账户,分配与该合约账户对应的状态存储,并存储合约代码,将合约代码的哈希值保存在该合约的状态存储中,从而合约创建成 功。
在调用合约的场景中,例如,Bob将一个用于调用智能合约的交易发送到如图1所示的区块链中,该交易的from字段是交易发起方(即Bob)的账户的地址,to字段例如为上述“0x6f8ae93…”,即被调用的智能合约的地址,交易的data字段包括调用智能合约的方法和参数。在区块链中对该交易进行共识之后,区块链中的各个节点可分别执行该交易,从而分别执行该合约,基于该合约的执行更新状态数据库。
区块链系统中的共识机制是区块链节点就区块信息(或称区块数据)达成全网相同共识的机制,可以保证最新区块被准确添加至区块链。当前主流的共识机制包括:工作量证明(Proof of Work,POW)、股权证明(Proof of Stake,POS)、委任权益证明(Delegated Proof of Stake,DPOS)、实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)算法等。其中,在各种共识算法中,通常在预设数目的共识节点对待共识的数据(即共识提议)达成相同之后,从而确定对该共识提议的共识成功。具体是,在PBFT算法中,对于N≥3f+1个共识节点,可容忍f个恶意节点,也就是说,当N个共识节点中2f+1个节点达成相同时,可确定共识成功。在相关技术中,为了实现共识功能,在共识节点上存储全量的账本,即存储全部区块和全部账户的状态。从而,区块链系统中的每个节点可通过执行相同的交易而产生区块链系统中的相同的状态,以使得区块链系统中的每个节点存储相同的状态数据库。
图2为PBFT共识算法中的共识过程示意图。如图2所示,根据PBFT共识算法,可将共识过程划分为请求(Request)、预备(Pre-Prepare,PP)、准备(Prepare,P)和提交(Commit,C)四个阶段。假设一区块链中包括节点n1-节点n4四个共识节点,其中,节点n1例如为主节点,节点n2-节点n4例如为从节点,根据PBFT算法,在节点n1-节点n4中可容忍f=1个恶意节点。具体是,在请求阶段,区块链的用户可通过其用户设备向节点n1发送请求,该请求例如为区块链交易的形式。在预备阶段,节点n1在从一个或多个用户设备接收到多个交易之后,可将该多个交易打包为共识提议,将该共识提议及节点n1对该共识提议的签名发送给其他共识节点(即节点n2-节点n4),以用于生成区块,该共识提议中可包括该多个交易的交易体和该多个交易的提交顺序等信息。在准备阶段,各个从节点可对共识提议进行签名并发送给其他各个节点。假设节点n4为恶意节点,节点n1、节点n2和节点n3在分别接收到2f=2个其他共识节点的对共识提议的签名之后,可确定准备阶段完成,可进入提交阶段。例如,如图2中所示,节点n1在接收到节点n2和节点n3的签名之后,验证节点n2和节点n3的签名都是正确的对共识 提议的签名,则确定准备阶段完成,节点n2在接收到节点n3的签名和预备阶段节点n1的签名并验证通过之后,确定准备阶段完成。在提交阶段,各个共识节点对共识提议进行提交阶段的签名并发送给其他各个共识节点,各个共识节点在接收到2f=2个其他共识节点的提交阶段的签名之后,可确定提交阶段完成,共识成功。例如,节点n1在接收到节点n2和节点n3的提交阶段的签名并验证之后,确定提交阶段完成,从而,节点n1可根据共识提议执行所述多个交易,生成并存储包括所述多个交易的区块(例如区块N),根据多个交易的执行结果更新世界状态,并将多个交易的执行结果返回给用户设备。类似地,节点n2和节点n3在确定提交阶段完成之后,执行所述多个交易,根据多个交易的执行结果更新世界状态,并生成并存储区块N。通过上述过程,实现了节点n1、节点n2和节点n3的存储相同性。也就是说,节点n1-节点n4在存在一个恶意节点的情况下仍可以实现对共识提议的共识成功,完成对区块的执行。
区块链系统中为了确保交易和状态数据的安全性,区块链节点可以配置TEE。进而,在共识过程的请求阶段,用户设备向区块链系统发送的交易请求可能采用信封加密的方式对相应交易进行加密;例如用户设备可能选择某个对称密钥对期望发送的交易进行对称加密以得到交易密文,利用区块链节点中TEE的公钥对被选择的对称密钥进行非对称加密以得到密钥密文,并且向区块链系统发送包含交易密文和密钥密文的交易请求而并不直接发送相应交易。在共识过程的预备阶段,共识提议中可以包括多个交易请求。与之相应的是,对共识提议达成共识的节点可以在其TEE中,对共识提议所包括的多个交易请求进行信封解密,获得与该多个交易请求对应的多个交易,进而完成对该多个交易的执行。其中需要特别说明的是,不同的交易请求/用户设备通常会选择不同的对称密钥来对相应交易进行对称加密。
相关技术中,对共识提议达成共识的节点需要在其TEE中,使用TEE的私钥对共识提议中的多个交易请求各自包括的密钥密文进行非对称解密。然而,执行非对称解密的过程所需消耗的时间,实质上远大于执行对称解密的过程所需消耗的时间,从而导致共识节点需要花费大量的时间来完成对共识提议中的多个交易请求各自包括的密钥密文进行非对称解密。
鉴于以上问题,本说明书实施例中提供了一种区块链系统中的交易执行方法和节点。对于从用户设备接收到交易请求的区块链节点,可以在其TEE中利用TEE的私钥对交易请求中的密钥密文进行非对称解密以获得用于加密相应交易的第一密钥,进而利用与该交易请求对应的第二密钥对该第一密钥进行对称加密以获得与该交易请求对 应的转发密文,使得交易请求以及其对应的转发密文均被提供给共识提议节点。与之相应的是,共识节点可以对共识提议节点生成的、包含交易请求以及其对应的转发密文的共识提议进行共识,并在对共识提议达成共识后,在其TEE中,利用与交易请求对应的第二密文对与交易请求对应的转发密文进行对称解密,获得用于对交易请求中的交易密文进行对称解密的第一密钥,进而利用第一密钥对相应的交易密文进行解密以获得相应的交易,并执行该交易。如此,共识节点无需花费过多的时间对共识提议中的各个交易请求所分别包括的密钥密文进行非对称解密,对各个密钥密文进行非对称解密的过程实质上被分散到整个区块链系统中的多个区块链节点执行,有利于提高区块链系统的性能。
图3为本说明书实施例中提供的一种区块链系统中的交易执行方法的流程图之一。其中该区块链系统中包括配置有TEE的多个区块链节点,该多个区块链节点的TEE配置有相同的公私钥对,该多个区块链节点中的部分区块链节点可以作为共识节点,即该多个区块链节点中可以包括多个共识节点,此外该多个共识节点中包括共识提议节点。该方法可以由前述多个区块链节点中的任意区块链节点执行,通过该方法可以使区块链系统中作为共识提议节点的区块链节点获得来自用户设备的任意交易请求Q1以及其对应的转发密文ED。参见图3所示,该方法可以包括但不限于如下步骤S31~步骤S37中的部分或全部。
步骤S31,区块链节点接收来自用户设备的交易请求Q1,该交易请求Q1中至少包括利用密钥key1对交易Tx1进行对称加密以获得的交易密文ET、利用TEE的公钥对交易密文ET进行非对称加密以获得的密钥密文EK。
用户设备例如可以在期望向区块链系统发送交易Tx1(即第一交易)时,按照某种规则生成/选择用于对交易Tx1进行对称加密的密钥key1(即第一密钥),利用key1对交易Tx1进行对称加密以获得交易密文ET,利用区块链节点中TEE的公钥对key1进行非对称加密以获得密钥密文EK,进而向与该用户设备连接的区块链节点发送交易请求Q1。其中交易请求Q1至少包括交易密文ET和密钥密文EK,此外还可以包括由用户设备计算的交易Tx1的哈希值。
步骤S32,区块链节点向其TEE提供交易请求Q1。
步骤S33,区块链节点的TEE利用其私钥对密钥密文EK进行非对称解密以获得密钥key1。
可选地,区块链节点的TEE可以执行如下步骤S34,确定与交易请求Q1对应的密钥 key2。
与交易请求Q1对应的密钥key2(即第二密钥)可以基于某种预设的规则对交易请求Q1进行处理得到,例如在交易请求Q1中包括交易Tx1的哈希值的情况下,可以基于交易Tx1的哈希值和TEE的私钥计算得到与交易请求Q1对应的密钥key2。
步骤S35,区块链节点的TEE利用密钥key2对目标信息进行对称加密以获得转发密文ED。
其中步骤S35中的密钥key2例如是步骤S34中确定的密钥key2,或者可以是TEE的私钥。
目标信息中至少包括密钥key1,此外还可以包括位于交易请求Q1中的交易Tx1的哈希值和/或由区块链节点的TEE获取的随机数,其中在目标信息中增加随机数的作用在于避免入侵者根据转发密文ED破解TEE的私钥。
步骤S36,区块链节点的TEE向其外部提供转发密文ED。
当执行前述步骤S31~步骤S36的区块链节点是共识提议节点的情况下,该共识提议节点通过执行前述步骤S31~步骤S36即可获得交易请求Q1以及其对应的转发密文ED。
当执行前述步骤S31~步骤S36的区块链节点并非共识提议节点的情况下,该区块链节点还可以进继续执行如下步骤S37,向共识提议节点发送交易请求Q1以及其对应的转发密文ED。
可以理解的是,对于由用户设备发出的每个交易请求,均可通过与前述步骤S31~步骤S37相同/相似的过程,使得区块链系统中的共识提议节点能够获得该交易请求以及其对应的转发密文。与之相应的是,共识提议节点在获得多个交易请求以及其各自对应的转发密文后,可以发起包含多个交易请求以及其各自对应的转发密文的共识提议,并执行后续交易执行过程。
图4为本说明书实施例中提供的一种区块链系统中的交易执行方法的流程图之二。其中该区块链系统中包括配置有TEE的多个区块链节点,该多个区块链节点的TEE配置有相同的公私钥对,该多个区块链节点中包括多个共识节点,该多个共识节点中包括共识提议节点,此外该共识提议节点例如可以通过前述图3所示的方法获得多个交易请求以及其各自对应的转发密文。该方法可以由前述多个共识节点中的任意共识节点执行,通过该方法可以使区块链系统中作为共识节点的区块链节点完成对多个交易的执行。参见图4所示,该方法可以包括但不限于如下步骤S41~步骤S48中的部分或全部。
共识节点被作为共识提议节点时,需要执行步骤S41,生成共识提议,该共识提议中包括按顺序排列的多个交易请求以及其各自对应的转发密文。然后接着执行如下步骤S42。
共识节点未被作为共识提议节点时,可以直接执行步骤S42,与多个共识节点中的其余共识节点对由共识提议节点生成的共识提议进行共识。其中对共识提议进行共识的过程例如可以参见前文基于PBFT共识算法的共识过程中的各个阶段,此处不再赘述。
在对共识提议达成共识的情况下,共识节点执行步骤S43,向其TEE提供位于共识提议中的多个交易请求以及其各自对应的转发密文。
共识节点的TEE可以对该多个交易请求中的任意交易请求Q1,执行如下步骤S44~步骤S48中的部分或全部,完成对交易请求Q1所对应的交易Tx1的执行。
可选地,在步骤S44,确定与交易请求Q1对应的密钥key2。
可以通过与前述步骤S34相同的方法获得密钥key2,例如共识节点的TEE可以从交易请求Q1中获取交易Tx1的哈希值,进而基于交易Tx1的哈希值和TEE的私钥计算得到密钥key2。
步骤S45,利用密钥key2对与交易请求Q1对应的转发密文ED进行对称解密以获得目标信息,目标信息中至少包括密钥key1。
参照前文,目标信息中至少包括密钥key1,此外还可能包括交易Tx1的哈希值和/或随机数。前述步骤S45中的密钥key2例如是步骤S45中确定的密钥key2,或者可以是TEE的私钥。
当目标信息中包括交易Tx1的哈希值的情况下,共识节点的TEE从其外部接收的交易请求Q1中也应当包含有交易Tx1的哈希值,此种情况下共识节点的TEE还可以执行如下步骤S46。
步骤S46,验证交易Tx1的哈希值。换而言之即验证交易请求Q1中所包括的交易Tx1的哈希值与目标信息中所包括的交易Tx1的哈希值是否相同,如果不同则说明TEE外的入侵者可能伪造了向共识节点的TEE提供的与交易请求Q1对应的转发密文ED;如果相同则说明交易Tx1的哈希值通过验证,共识节点的TEE可以继续执行如下步骤S47。
步骤S47,利用密钥key1对交易请求Q1中的交易密文ET进行对称解密以获得交易Tx1。
步骤S48,执行交易Tx1。
需要说明的是,共识节点可能并不向其TEE提供与交易请求Q1对应的转发密文, 此种情况下该共识节点的TEE无需执行步骤S44~步骤S46,而是利用其私钥对交易请求Q1中的密钥密文EK进行非对称解密以获得密钥key1,进而执行后续步骤S47和步骤S48。
需要说明的是,如果交易Tx1的哈希值未通过验证,则共识节点的TEE还可以利用其私钥对交易请求Q1中的密钥密文EK进行非对称解密以获得密钥key1,进而执行步骤S47和步骤S48。
以上各个方法实施例中,共识节点无需花费过多的时间对共识提议中的各个交易请求所分别包括的密钥密文进行非对称解密,对各个密钥密文进行非对称解密的过程实质上被分散到整个区块链系统中的多个区块链节点执行,有利于提高区块链系统的性能。
与前述方法实施例基于相同的构思,本说明书实施例中提供了一种区块链系统中的区块链节点,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多个共识节点,所述多个共识节点中包括共识提议节点,所述区块链节点配置有TEE,所述多个区块链节点的TEE配置有相同的公私钥对。如图5所示,所述区块链节点包括:通信处理单元51,配置为从用户设备接收交易请求,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文;TEE 53,配置为利用其私钥对所述密钥密文进行非对称解密以获得所述第一密钥,利用第二密钥对目标信息进行对称加密以获得转发密文,所述目标信息至少包括所述第一密钥,并向其外部提供所述转发密文,使得所述共识提议节点生成包含所述交易请求和所述转发密文的共识提议,以便所述共识节点在对所述共识提议达成共识的情况下,在其TEE中,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
在一种可能的实施方式中,所述交易请求中还包括所述第一交易的哈希值,所述第二密钥基于所述TEE的私钥和所述第一交易的哈希值计算得到。
在一种可能的实施方式中,所述目标信息中还包括随机数和所述第一交易的哈希值。
在一种可能的实施方式中,所述区块链节点不是所述共识提议节点,所述通信处理单元51,还用于向所述共识提议节点发送所述交易请求和所述转发密文。
与前述方法实施例基于相同的构思,本说明书实施例中还提供了一种区块链系统中的共识节点,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多 个共识节点,所述多个共识节点中包括共识提议节点,所述区块链节点配置有TEE,所述多个区块链节点的TEE配置有相同的公私钥对。如图6所示,所述共识节点包括:共识处理单元61,配置为对由所述共识提议节点生成的共识提议进行共识,所述共识提议包括来自用户设备的交易请求以及其对应的转发密文,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文,所述转发密文由目标节点在其TEE中利用第二密钥对目标信息进行对称加密以获得,所述目标信息中包括利用所述TEE的私钥对所述密钥密文进行非对称解密以获得的所述第一密钥,所述目标节点是从所述用户设备接收到所述交易请求的区块链节点;TEE 63,配置为在对所述共识提议达成共识的情况下,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
在一种可能的实施方式中,所述交易请求中还包括所述第一交易的哈希值,所述共识节点的TEE 63,还配置为根据其私钥和所述第一交易的哈希值计算所述第二密钥。
在一种可能的实施方式中,所述共识节点的TEE 63,配置为根据所述第二密钥对所述转发密文进行对称解密以获得所述目标信息,所述目标信息中包括所述第一密钥、所述第一交易的哈希值和随机数。
在一种可能的实施方式中,所述共识节点的TEE 63,还配置为验证所述第一交易的哈希值;以及,在所述第一交易的哈希值未通过验证的情况下,根据所述TEE的私钥对所述密钥密文进行非对称解密以获得所述第一密钥。
在一种可能的实施方式中,所述共识节点是所述共识提议节点,所述共识节点还包括:通信处理单元65,配置为从其它区块链节点接收所述交易请求和所述转发密文;所述共识处理单元61,还配置为生成所述共识提议。
本说明书实施例中还提供了一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行前述方法实施例中由区块链节点或者共识节点中的TEE所执行的各个方法步骤。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到 相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本申 请不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本 说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。

Claims (18)

  1. 一种区块链系统中的交易执行方法,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多个共识节点,所述多个共识节点中包括共识提议节点,所述区块链节点配置有可信执行环境TEE,所述多个区块链节点的TEE配置有相同的公私钥对,所述方法由所述区块链节点执行,所述方法包括:
    从用户设备接收交易请求,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文;
    在所述区块链节点的TEE中,利用其私钥对所述密钥密文进行非对称解密以获得所述第一密钥,利用第二密钥对目标信息进行对称加密以获得转发密文,所述目标信息至少包括所述第一密钥,并向所述TEE的外部提供所述转发密文,使得所述共识提议节点生成包含所述交易请求和所述转发密文的共识提议,以便所述共识节点在对所述共识提议达成共识的情况下,在其TEE中,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
  2. 根据权利要求1所述的方法,所述交易请求中还包括所述第一交易的哈希值,所述第二密钥基于所述TEE的私钥和所述第一交易的哈希值计算得到。
  3. 根据权利要求1所述的方法,所述目标信息中还包括随机数和所述第一交易的哈希值。
  4. 根据权利要求1-3中任一项所述的方法,所述区块链节点不是所述共识提议节点,所述方法还包括:向所述共识提议节点发送所述交易请求和所述转发密文。
  5. 一种区块链系统中的交易执行方法,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多个共识节点,所述多个共识节点中包括共识提议节点,所述区块链节点配置有可信执行环境TEE,所述多个区块链节点的TEE配置有相同的公私钥对,所述方法由所述共识节点执行,所述方法包括:
    对由所述共识提议节点生成的共识提议进行共识,所述共识提议包括来自用户设备的交易请求以及其对应的转发密文,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文,所述转发密文由目标节点在其TEE中利用第二密钥对目标信息进行对称加密以获得,所述目标信息中包括利用所述TEE的私钥对所述密钥密文进行 非对称解密以获得的所述第一密钥,所述目标节点是从所述用户设备接收到所述交易请求的区块链节点;
    在对所述共识提议达成共识的情况下,在所述共识节点的TEE中,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
  6. 根据权利要求5所述的方法,所述交易请求还包括所述第一交易的哈希值;所述方法还包括:在所述共识节点的TEE中,根据其私钥和所述第一交易的哈希值计算所述第二密钥。
  7. 根据权利要求5所述的方法,所述根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,包括:根据所述第二密钥对所述转发密文进行对称解密以获得所述目标信息,所述目标信息中包括所述第一密钥、所述第一交易的哈希值和随机数。
  8. 根据权利要求7所述的方法,所述方法还包括:
    在所述共识节点的TEE中,验证所述第一交易的哈希值;
    在所述共识节点的TEE中,在所述第一交易的哈希值未通过验证的情况下,根据所述TEE的私钥对所述密钥密文进行非对称解密以获得所述第一密钥。
  9. 根据权利要求5-8中任一项所述的方法,所述共识节点是所述共识提议节点;所述方法还包括:从其它区块链节点接收所述交易请求和所述转发密文;以及,生成所述共识提议。
  10. 一种区块链系统中的区块链节点,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多个共识节点,所述多个共识节点中包括共识提议节点,所述区块链节点配置有可信执行环境TEE,所述多个区块链节点的TEE配置有相同的公私钥对,所述区块链节点包括:
    通信处理单元,配置为从用户设备接收交易请求,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文;
    TEE,配置为利用其私钥对所述密钥密文进行非对称解密以获得所述第一密钥,利用第二密钥对目标信息进行对称加密以获得转发密文,所述目标信息至少包括所述第一密钥,并向所述TEE的外部提供所述转发密文,使得所述共识提议节点生成包含所述交易请求和所述转发密文的共识提议,以便所述共识节点在对所述共识提议达成 共识的情况下,在其TEE中,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
  11. 根据权利要求10所述的区块链节点,所述交易请求中还包括所述第一交易的哈希值,所述第二密钥基于所述TEE的私钥和所述第一交易的哈希值计算得到。
  12. 根据权利要求10所述的区块链节点,所述目标信息中还包括随机数和所述第一交易的哈希值。
  13. 根据权利要求10所述的区块链节点,所述区块链节点不是所述共识提议节点,所述通信处理单元,还用于向所述共识提议节点发送所述交易请求和所述转发密文。
  14. 一种区块链系统中的共识节点,所述区块链系统包括多个区块链节点,所述多个区块链节点中包括多个共识节点,所述多个共识节点中包括共识提议节点,所述区块链节点配置有可信执行环境TEE,所述多个区块链节点的TEE配置有相同的公私钥对,所述共识节点包括:
    共识处理单元,配置为对由所述共识提议节点生成的共识提议进行共识,所述共识提议包括来自用户设备的交易请求以及其对应的转发密文,所述交易请求中包括利用第一密钥对第一交易进行对称加密以获得的交易密文、利用所述TEE的公钥对所述第一密钥进行非对称加密以得到的密钥密文,所述转发密文由目标节点在其TEE中利用第二密钥对目标信息进行对称加密以获得,所述目标信息中包括利用所述TEE的私钥对所述密钥密文进行非对称解密以获得的所述第一密钥,所述目标节点是从所述用户设备接收到所述交易请求的区块链节点;
    TEE,配置为在对所述共识提议达成共识的情况下,根据所述第二密钥对所述转发密文进行对称解密以获得所述第一密钥,利用所述第一密钥对所述交易密文进行对称解密以获得所述第一交易,并执行所述第一交易。
  15. 根据权利要求14所述的共识节点,所述交易请求中还包括所述第一交易的哈希值,所述共识节点的TEE,还配置为根据其私钥和所述第一交易的哈希值计算所述第二密钥。
  16. 根据权利要求14所述的共识节点,所述共识节点的TEE,配置为根据所述第二密钥对所述转发密文进行对称解密以获得所述目标信息,所述目标信息中包括所述第一密钥、所述第一交易的哈希值和随机数。
  17. 根据权利要求16所述的共识节点,所述共识节点的TEE,还配置为验证所述 第一交易的哈希值;以及,在所述第一交易的哈希值未通过验证的情况下,根据所述TEE的私钥对所述密钥密文进行非对称解密以获得所述第一密钥。
  18. 根据权利要求16所述的共识节点,所述共识节点是所述共识提议节点,所述共识节点还包括:通信处理单元,配置为从其它区块链节点接收所述交易请求和所述转发密文;所述共识处理单元,还配置为生成所述共识提议。
PCT/CN2022/135287 2022-10-31 2022-11-30 区块链系统中的交易执行方法和节点 WO2024092930A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211346008.4 2022-10-31
CN202211346008.4A CN115941262A (zh) 2022-10-31 2022-10-31 区块链系统中的交易执行方法和节点

Publications (1)

Publication Number Publication Date
WO2024092930A1 true WO2024092930A1 (zh) 2024-05-10

Family

ID=86653473

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135287 WO2024092930A1 (zh) 2022-10-31 2022-11-30 区块链系统中的交易执行方法和节点

Country Status (2)

Country Link
CN (1) CN115941262A (zh)
WO (1) WO2024092930A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200162269A1 (en) * 2018-11-20 2020-05-21 Iot And M2M Technologies, Llc Mutually authenticated ecdhe key exchange for a device and a network using multiple pki key pairs
CN111680326A (zh) * 2020-06-09 2020-09-18 联想(北京)有限公司 一种数据处理方法及装置
CN112400299A (zh) * 2019-06-17 2021-02-23 华为技术有限公司 一种数据交互方法及相关设备
CN114357482A (zh) * 2021-12-30 2022-04-15 支付宝(杭州)信息技术有限公司 将区块链网络中的历史明文交易转为隐私交易的方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200162269A1 (en) * 2018-11-20 2020-05-21 Iot And M2M Technologies, Llc Mutually authenticated ecdhe key exchange for a device and a network using multiple pki key pairs
CN112400299A (zh) * 2019-06-17 2021-02-23 华为技术有限公司 一种数据交互方法及相关设备
CN111680326A (zh) * 2020-06-09 2020-09-18 联想(北京)有限公司 一种数据处理方法及装置
CN114357482A (zh) * 2021-12-30 2022-04-15 支付宝(杭州)信息技术有限公司 将区块链网络中的历史明文交易转为隐私交易的方法

Also Published As

Publication number Publication date
CN115941262A (zh) 2023-04-07

Similar Documents

Publication Publication Date Title
US11049099B2 (en) Methods for implementing privacy protection in blockchain
CN113438289B (zh) 基于云计算的区块链数据处理方法及装置
EP3779830B1 (en) Blockchain-based transaction method, device, and remitting apparatus
CN110020855B (zh) 区块链中实现隐私保护的方法、节点、存储介质
CN110032883B (zh) 区块链中实现隐私保护的方法、系统和节点
CN110033267B (zh) 区块链中实现隐私保护的方法、节点、系统和存储介质
CN110245490B (zh) 有条件的结合代码标注与类型维度的收据存储方法和节点
CN110060054B (zh) 区块链中实现隐私保护的方法、节点、系统和存储介质
CN110266644B (zh) 结合代码标注与交易类型的收据存储方法和节点
US11616636B2 (en) Hash updating methods and apparatuses of blockchain integrated station
CN110263544B (zh) 结合交易类型和判断条件的收据存储方法和节点
CN110020856B (zh) 区块链中实现混合交易的方法、节点和存储介质
CN110264198B (zh) 结合代码标注与交易类型的有条件的收据存储方法和节点
CN110245945B (zh) 结合代码标注与用户类型的收据存储方法和节点
CN110245942B (zh) 结合用户类型和判断条件的收据存储方法和节点
CN110245944B (zh) 基于用户类型的收据存储方法和节点
CN110245947B (zh) 结合交易与用户类型的条件限制的收据存储方法和节点
CN110245489B (zh) 基于明文日志的收据存储方法、节点和系统
CN111612462B (zh) 区块链中实现隐私保护的方法、节点和存储介质
CN110264193B (zh) 结合用户类型与交易类型的收据存储方法和节点
CN111541725A (zh) 区块链一体机及其密码加速卡、密钥管理方法和装置
CN110276684B (zh) 结合交易类型和事件函数类型的收据存储方法和节点
CN110245943B (zh) 基于判断条件的收据存储方法和节点
CN110263089B (zh) 结合交易与事件类型的条件限制的收据存储方法和节点
CN111639362B (zh) 区块链中实现隐私保护的方法、节点和存储介质