CN113902431A - Block chain transaction method and device, storage medium and electronic equipment - Google Patents

Block chain transaction method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113902431A
CN113902431A CN202111131516.6A CN202111131516A CN113902431A CN 113902431 A CN113902431 A CN 113902431A CN 202111131516 A CN202111131516 A CN 202111131516A CN 113902431 A CN113902431 A CN 113902431A
Authority
CN
China
Prior art keywords
transaction
node
target
transaction data
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111131516.6A
Other languages
Chinese (zh)
Inventor
刘思瀚
徐石成
何光宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN202111131516.6A priority Critical patent/CN113902431A/en
Publication of CN113902431A publication Critical patent/CN113902431A/en
Pending legal-status Critical Current

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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Bioethics (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Strategic Management (AREA)
  • General Health & Medical Sciences (AREA)
  • General Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The present disclosure relates to a blockchain transaction method, apparatus, storage medium, and electronic device, where the method is applied to a target mixed currency node in a blockchain network, where the target mixed currency node is any one of a plurality of mixed currency nodes in the blockchain network, and the method includes: after receiving a transaction request of a transaction initiator node, decrypting encrypted transaction data in the transaction request, and storing the decrypted transaction data into a private data storage space under a link, wherein the private data storage space is used for storing transaction data written by each mixed money node; acquiring target transaction data from the private data storage space, wherein the target transaction data comprises transaction data written by other mixed money nodes except the target mixed money node; analyzing the mark of a transaction receiver node corresponding to the transaction request from the target transaction data; encrypting the target transaction data and sending a transaction request including the encrypted target transaction data to a transaction receiver node corresponding to the identification.

Description

Block chain transaction method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a blockchain transaction method, an apparatus, a storage medium, and an electronic device.
Background
Blockchain technology is a technology that can collectively maintain a reliable database through decentralized and distrust. In the block chain network, even nodes which are not trusted with each other can conveniently verify data, and a certain consensus mechanism is relied on to achieve consistency. Therefore, the blockchain technology can obviously reduce trust cost among multiple nodes, and has wide application scenes and application values in cross-border payment, credential business and financial fields.
In some scenarios, trading participants in a blockchain network may not wish to have trade data published. In this case, the transaction data can be obfuscated and hidden by mixing coins, thereby protecting the privacy of the transaction participants. However, the mixed currency transaction mode in the related art may also present a security risk, for example, in case of being attacked, the transaction data may be leaked.
Disclosure of Invention
The present disclosure is directed to a method, an apparatus, a storage medium, and an electronic device for blockchain transaction, so as to solve the above related technical problems.
In order to achieve the above object, according to a first aspect of embodiments of the present disclosure, there is provided a blockchain transaction method applied to a target mixed coin node in a blockchain network, where the target mixed coin node is any one of a plurality of mixed coin nodes in the blockchain network, the method including:
after a transaction request of a transaction initiator node is received, decrypting encrypted transaction data in the transaction request, and storing the decrypted transaction data into a private data storage space under a link, wherein the private data storage space is used for storing the transaction data written by each mixed currency node;
target transaction data are obtained from the private data storage space, wherein the target transaction data comprise transaction data written by other mixed currency nodes except the target mixed currency node;
analyzing the mark of a transaction receiver node corresponding to the transaction request from the target transaction data;
encrypting the target transaction data and sending a transaction request including the encrypted target transaction data to a transaction receiver node corresponding to the identification.
Optionally, the transaction nodes in the blockchain network correspond to money mixing nodes, and an analysis rule for analyzing the identifiers of the transaction nodes is preset in the money mixing node corresponding to any one of the transaction nodes.
Optionally, the method further comprises:
acquiring a transaction examination model;
saving the transaction review model to a blockchain of the blockchain network;
in response to receiving a transaction review request, granting access to the private data storage space by a trusted execution environment;
receiving an audit result of the trusted execution environment, the audit result being generated by the trusted execution environment based on the transaction audit model obtained from the blockchain and the transaction data in the private data storage space;
and signing the examination result, and storing the signed examination result into the block chain.
Optionally, the method further comprises:
in response to receiving the transaction review request, sending a public key of a reviewed node to the trusted execution environment;
the receiving of the review result of the trusted execution environment comprises:
receiving an encrypted review result of the trusted execution environment, wherein the encrypted review result is obtained by encrypting a raw review result by the trusted execution environment based on a public key of the reviewed node, and the raw review result is generated by the trusted execution environment based on a transaction review model acquired from the blockchain and transaction data of the reviewed node in the private data storage space.
Optionally, a homomorphic key pair is respectively maintained between each mixed coin node and each transaction node in the blockchain network, and after receiving a transaction request from the transaction initiator node, decrypting encrypted transaction data in the transaction request and storing the decrypted transaction data in a private data storage space under the chain includes:
receiving a transaction request sent by a transaction initiator node, wherein the transaction request comprises encrypted transaction data, the encrypted transaction data is obtained by encrypting original transaction data by the transaction initiator node based on an encryption key in a first homomorphic key pair, and the first homomorphic key pair is a homomorphic key pair between the target mixed currency node and the transaction initiator node;
decrypting the encrypted transaction data through the first homomorphic secret key to obtain original transaction data;
and saving the original transaction data to the private data storage space.
Optionally, the encrypting the target transaction data and sending a transaction request including the encrypted target transaction data to a transaction receiver node corresponding to the identifier includes:
encrypting the target transaction data based on an encryption key in a second homomorphic key pair to obtain target encrypted transaction data, wherein the second homomorphic key pair is a homomorphic key pair between the target mixed currency node and the transaction receiver node;
sending a transaction request including the target encrypted transaction data to the transaction recipient node.
Optionally, a homomorphic key pair between the target mixed currency node and the transaction node is generated by:
determining a plurality of target prime numbers according to the state parameters of the block chain network;
determining a first target value by taking the public key of the transaction node as a first initial value, wherein the first target value is greater than or equal to the first initial value and cannot divide any target prime number;
determining a second target value by taking the public key of the target mixed currency node as a second initial value, wherein the second target value is greater than or equal to the second initial value and cannot divide any target prime number;
and generating a homomorphic secret key pair between the target mixed currency node and the transaction node according to the first target value and the second target value.
Optionally, the state parameter of the blockchain network includes a number value of nodes in the blockchain network and a length value of a hash value obtained by the blockchain network during encryption calculation, and determining a plurality of target prime numbers according to the state parameter of the blockchain network includes:
calculating the product of the number value and the length value to obtain a first product;
and determining a first product prime number which is larger than the target numerical value as the target prime number by taking a preset target numerical value as an initial numerical value.
Optionally, the generating a homomorphic key pair between the target mixed currency node and the transaction node according to the first target value and the second target value includes:
calculating the product of the first target value and the second target value to obtain a first secret key parameter n;
determining a target random integer as a second secret key parameter g, wherein,
Figure BDA0003280707100000031
and the first key parameter n divides the second key parameter g by the whole order,
Figure BDA0003280707100000032
if the multiplication inverse exists under the remaining system, the homomorphic secret key of the trading node is (n, g);
calculating a homomorphic key lambda of the target mixed currency node by the following calculation formula:
λ=lcm(p-1,q-1)
wherein p is the first target value, q is the second target value, and lcm () is the least common multiple function.
According to a second aspect of the embodiments of the present disclosure, there is provided a blockchain transaction apparatus, applied to a target mixed currency node in a blockchain network, where the target mixed currency node is any one of a plurality of mixed currency nodes in the blockchain network, the apparatus including:
the transaction data storage module is used for decrypting encrypted transaction data in a transaction request after a transaction request of a transaction initiator node is received by a target mixed currency node, and storing the decrypted transaction data into a private data storage space under a link, wherein the private data storage space is used for storing the transaction data written by each mixed currency node;
the transaction data acquisition module is used for acquiring target transaction data from the private data storage space, wherein the target transaction data comprises transaction data written by other mixed currency nodes except the target mixed currency node;
the transaction data analysis module is used for analyzing the identification of the transaction receiver node corresponding to the transaction request from the target transaction data;
and the first sending module is used for encrypting the target transaction data and sending a transaction request comprising the encrypted target transaction data to a transaction receiver node corresponding to the identifier.
Optionally, the transaction nodes in the blockchain network correspond to money mixing nodes, and an analysis rule for analyzing the identifiers of the transaction nodes is preset in the money mixing node corresponding to any one of the transaction nodes.
Optionally, the apparatus further comprises:
the model acquisition module is used for acquiring a transaction examination model;
the model saving module is used for saving the transaction examination model into a block chain of the block chain network;
the authorization module is used for responding to the received transaction examination request and granting the access authority of the trusted execution environment to the private data storage space;
a review result receiving module, configured to receive a review result of the trusted execution environment, where the review result is generated by the trusted execution environment based on the transaction review model obtained from the blockchain and the transaction data in the private data storage space;
and the signature module is used for signing the examination result and storing the signed examination result into the block chain.
Optionally, the apparatus further comprises:
a second sending module, configured to send, in response to receiving the transaction review request, a public key of a reviewed node to the trusted execution environment;
the examination result receiving module comprises:
a first receiving sub-module, configured to receive an encrypted review result of the trusted execution environment, where the encrypted review result is obtained by encrypting, by the trusted execution environment, a raw review result based on a public key of the reviewed node, and the raw review result is generated by the trusted execution environment based on the transaction review model obtained from the blockchain and the transaction data of the reviewed node in the private data storage space.
Optionally, a homomorphic key pair is maintained between each mixed coin node and each transaction node in the block chain network, and the transaction data saving module includes:
the second receiving submodule is used for receiving a transaction request sent by a transaction initiator node, wherein the transaction request comprises encrypted transaction data, the encrypted transaction data is obtained by encrypting original transaction data by the transaction initiator node based on an encryption key in a first homomorphic key pair, and the first homomorphic key pair is a homomorphic key pair between the target mixed coin node and the transaction initiator node;
the decryption submodule is used for decrypting the encrypted transaction data through the first homomorphic secret key to obtain original transaction data;
and the storage submodule is used for storing the original transaction data into the private data storage space.
Optionally, the first sending module includes:
the encryption submodule is used for encrypting the target transaction data based on an encryption key in a second homomorphic key pair to obtain target encrypted transaction data, and the second homomorphic key pair is a homomorphic key pair between the target mixed currency node and the transaction receiver node;
a sending submodule, configured to send a transaction request including the target encrypted transaction data to the transaction receiver node.
Optionally, the apparatus further includes a key generation module, configured to generate a homomorphic key pair between the target mixed currency node and the transaction node, where the key generation module includes:
the first determining submodule is used for determining a plurality of target prime numbers according to the state parameters of the block chain network;
the second determining submodule is used for determining a first target value by taking the public key of the transaction node as a first initial value, wherein the first target value is greater than or equal to the first initial value and cannot divide any target prime number;
a third determining submodule, configured to determine a second target value by using the public key of the target mixed banknote node as a second initial value, where the second target value is greater than or equal to the second initial value and cannot divide any target prime number;
and the key generation submodule is used for generating a homomorphic key pair between the target mixed currency node and the transaction node according to the first target value and the second target value.
Optionally, the state parameter of the blockchain network includes a number value of nodes in the blockchain network and a length value of a hash value obtained by the blockchain network during encryption calculation, and the first determining sub-module includes:
the first calculating subunit is used for calculating the product of the quantity value and the length value to obtain a first product;
the first determining subunit is configured to determine, as the target prime number, a first product prime number greater than the target value, with a preset target value as an initial value.
Optionally, the key generation sub-module includes:
the second calculating subunit is configured to calculate a product of the first target value and the second target value to obtain a first secret key parameter n;
a second determining subunit, configured to determine a target random integer as a second secret key parameter g, wherein,
Figure BDA0003280707100000061
and the first key parameter n divides the second key parameter g by the whole order,
Figure BDA0003280707100000062
if the multiplication inverse exists under the remaining system, the homomorphic secret key of the trading node is (n, g);
a third computing subunit, configured to compute a homomorphic key λ of the target mixed banknote node according to the following calculation formula:
λ=lcm(p-1,q-1)
wherein p is the first target value, q is the second target value, and lcm () is the least common multiple function.
According to a third aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the above first aspects.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any of the first aspects above.
According to the technical scheme, a plurality of mixed coin nodes are arranged in a blockchain network, any mixed coin node can decrypt encrypted transaction data in a transaction request after receiving the transaction request of a transaction initiator node, and the transaction data obtained through decryption is stored in a private data storage space under the chain. Thus, the transaction data is stored in the private data storage space, and the ciphertext of the transaction data is stored in the blockchain. In addition, any mixed coin node can acquire the transaction data written by other mixed coin nodes from the private data storage space and analyze the transaction data. After the mixed currency node successfully analyzes the identification of the transaction receiver node from the transaction data, the transaction data can be encrypted, and a transaction request comprising the encrypted target transaction data is sent to the transaction receiver node corresponding to the identification, so that the transaction between the transaction initiator node and the transaction receiver node is completed.
By adopting the technical scheme, the transaction process between the transaction initiator node and the transaction receiver node comprises the following steps: the method comprises a chain on-line interaction process between a transaction initiator node and a mixed currency node, a chain off-line interaction process between the mixed currency nodes based on a private data storage space, and a chain on-line interaction process between the mixed currency node and a transaction receiver node. That is, the transaction is divided into a plurality of stages in the chain and a plurality of stages in the chain, and the data in a certain stage cannot be monitored or known independently, so that the complete transaction data content cannot be obtained. Therefore, the transaction mode can ensure the privacy of the transaction data and simultaneously improve the anti-attack capability of the transaction system, thereby ensuring the security of the transaction data. Moreover, the mode of storing the transaction data into the private data storage space under the chain also provides an implementation basis for related transaction supervision.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
fig. 1 is a flowchart illustrating a blockchain transaction method according to an exemplary embodiment of the disclosure.
Fig. 2 is a block diagram of a blockchain transaction system shown in an exemplary embodiment of the present disclosure.
Fig. 3 is a flowchart illustrating a blockchain transaction method according to an exemplary embodiment of the disclosure.
FIG. 4 is a flow diagram illustrating a transaction review, according to an exemplary embodiment of the present disclosure.
Fig. 5 is a flowchart illustrating a blockchain transaction method according to an exemplary embodiment of the disclosure.
Fig. 6 is a flowchart illustrating a generation process of a homomorphic key pair according to an exemplary embodiment of the disclosure.
Fig. 7 is a block diagram of a blockchain transaction device according to an exemplary embodiment of the present disclosure.
Fig. 8 is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Before introducing the blockchain transaction method, apparatus, storage medium, and electronic device of the present disclosure, an application scenario of each embodiment provided by the present disclosure is first introduced. The present disclosure may be used in a transaction scenario in a blockchain network, thereby enabling anonymous transactions in the blockchain network. Here, the type of blockchain network may be, for example, a public chain, a federation chain, and so on, which is not limited by the present disclosure.
In order to realize anonymous transactions, the related scenes mix the transactions through a mixed currency technology. For example, a master node may be provided to mix multiple transactions from multiple users into a single transaction. With transaction blending, a certain number of users receive the consolidated transfers, and it is therefore difficult for the outside world to determine the details of a transaction from the obfuscated transactions.
However, in such a transaction mode, the master node becomes a new privacy security bottleneck, and when the master node is attacked, the transaction data may be leaked. In addition, the requirement of supervision and audit is not considered in the transaction mode, and convenience is provided for illegal transactions.
Therefore, the block chain transaction method is applied to a target mixed currency node in a block chain network, and the target mixed currency node is any one of a plurality of mixed currency nodes in the block chain network. Wherein the coin mixing node can be set by a supervisor, for example. For example, in a case where there are a plurality of transaction managers, each transaction manager may set a corresponding mixed currency node.
Referring to fig. 1, a flow chart of a blockchain transaction method is shown, the method comprising:
in step 11, after receiving the transaction request of the transaction initiator node, the encrypted transaction data in the transaction request is decrypted, and the decrypted transaction data is stored in the private data storage space under the chain.
The private data storage space may be commonly maintained by a plurality of mixed currency nodes, for example, and is used for storing the transaction data written by each mixed currency node. In some implementation scenarios, to improve the security of the private data storage space, the private data storage space may also be provided in a trusted environment.
Illustratively, fig. 2 is a block diagram of a blockchain transaction system shown in the present disclosure, when the mixed currency node 1 is a target mixed currency node and the transaction node 1 needs to initiate a transaction to the transaction node 6, the transaction node 1 may encrypt transaction data (such as transaction content, an identifier of the transaction node 6, etc.) by using the key 1 and send a transaction request including the encrypted transaction data to the mixed currency node 1. Here, the key 1 may be, for example, a private key of a key pair applied by the transaction node 1, and the transaction node 1 may synchronize a public key of the key pair with the mixed currency node 1. It should be noted that, in order to enhance the security of the transaction, the key pair may be configured to be used only in the anonymous transaction process.
After receiving the transaction request, the target mixed currency node can decrypt the encrypted transaction data through the public key sent by the transaction node 1, so that the plaintext of the transaction data is obtained. Then, the target mixed currency node can store the clear text of the transaction data obtained by decryption into the private data storage space.
It is noted that the transaction between the transaction node 1 and the target mixed currency node is still conducted in the blockchain network. Therefore, the encrypted transaction data in the transaction request can also be stored in a blockchain ledger of a blockchain network to be used as a certificate of the transaction, so that the authenticity of a transaction result is ensured.
In addition, in some implementation scenarios, to facilitate verification and auditing of transaction data, the transaction data may also be encrypted based on a homomorphic encryption, which will be described in subsequent examples of the present disclosure.
In step 12, target transaction data is retrieved from the private data storage space.
The target transaction data comprises transaction data written by other mixed currency nodes except the target mixed currency node. For example, in the example of fig. 2, the mixed currency node 2 may obtain the transaction data written by the mixed currency node 1. Of course, in some scenarios, the mixed coin node 2 may obtain the transaction data written by the mixed coin node 2, which is not limited by this disclosure.
In step 13, the identifier of the transaction receiver node corresponding to the transaction request is parsed from the target transaction data. For example, if the target transaction data represents that the transaction node 1 initiates a transaction to the transaction node 6, the target mixed currency node may parse and determine that the transaction receiver node is the transaction node 6 from the target transaction data.
In addition, in a possible implementation manner, the transaction nodes in the block chain network correspond to coin mixing nodes, and an analysis rule for analyzing the identifier of the transaction node is preset in the coin mixing node corresponding to any one of the transaction nodes.
Taking fig. 2 as an example for illustration, the transaction nodes 1 to 3 may correspond to the mixed currency node 1, and the transaction nodes 4 to 6 may correspond to the mixed currency node 2. The mixed currency node 1 may maintain an analysis rule for analyzing the identifiers of the transaction nodes 1 to 3, and the mixed currency node 2 may maintain an analysis rule for analyzing the identifiers of the transaction nodes 4 to 6. Here, the parsing rule may be presented in the form of a key, for example, and the parsing rule may also be a mapping relationship between an identification field and a node identity, which is not limited by the present disclosure.
In this way, the mixed money node 1 cannot recognize the identifiers of the transaction nodes 4 to 6, and the mixed money node 2 cannot recognize the identifiers of the transaction nodes 1 to 3. Therefore, even if the mixed currency node 1 is broken, the attacker cannot acquire the information of the receiver of the transaction; even if the mixed coin node 2 is broken, the attacker cannot acquire the information of the transaction initiator. That is, the transaction data acquired from the single mixed currency node side is stateless intermediate data, and complete transaction data cannot be acquired from the intermediate data. Therefore, the technical scheme can improve the anti-attack performance of the transaction system and the security of the transaction.
In step 14, the target transaction data is encrypted and a transaction request including the encrypted target transaction data is sent to a transaction receiver node corresponding to the identification.
The target transaction data may be encrypted based on a public and private key system, or the target transaction data may also be encrypted in a homomorphic encryption manner, which is not limited in this disclosure.
According to the technical scheme, a plurality of mixed coin nodes are arranged in a blockchain network, any mixed coin node can decrypt encrypted transaction data in a transaction request after receiving the transaction request of a transaction initiator node, and the transaction data obtained through decryption is stored in a private data storage space under the chain. Thus, the transaction data is stored in the private data storage space, and the ciphertext of the transaction data is stored in the blockchain. In addition, any mixed coin node can acquire the transaction data written by other mixed coin nodes from the private data storage space and analyze the transaction data. After the mixed currency node successfully analyzes the identification of the transaction receiver node from the transaction data, the transaction data can be encrypted, and a transaction request comprising the encrypted target transaction data is sent to the transaction receiver node corresponding to the identification, so that the transaction between the transaction initiator node and the transaction receiver node is completed.
By adopting the technical scheme, the transaction process between the transaction initiator node and the transaction receiver node comprises the following steps: the method comprises a chain on-line interaction process between a transaction initiator node and a mixed currency node, a chain off-line interaction process between the mixed currency nodes based on a private data storage space, and a chain on-line interaction process between the mixed currency node and a transaction receiver node. That is, the transaction is divided into a plurality of stages in the chain and a plurality of stages in the chain, and the data in a certain stage cannot be monitored or known independently, so that the complete transaction data content cannot be obtained. Therefore, the transaction mode can ensure the privacy of the transaction data and simultaneously improve the anti-attack capability of the transaction system, thereby ensuring the security of the transaction data. Moreover, the mode of storing the transaction data into the private data storage space under the chain also provides an implementation basis for related transaction supervision.
It is worth noting that in some scenarios, the resolution rules of the identification of the transaction node may also be public in the mixed currency node. Therefore, each mixed currency node may resolve the identification of the transaction receiver node corresponding to the transaction request from the target transaction data. In this case, the above steps 13 and 14 may be repeatedly performed in a plurality of mixed money nodes, and thus the transaction receiver node corresponding to the identification receives transaction requests from the plurality of mixed money nodes, and the transaction requests may be triggered by the same transaction data in the private data storage space.
To this end, in some embodiments, the transaction nodes in the blockchain network may also correspond to a mixed currency node (for example, a mixed currency node set by a bank may correspond to each organization node under the bank), and the mixed currency node corresponding to any one of the transaction nodes is used for forwarding the transaction initiated by the transaction node. After the target mixed currency node analyzes the identification of the transaction receiver node from the target transaction data, whether the transaction receiver node corresponding to the identification is the transaction node corresponding to the target mixed currency node can be further determined.
Taking fig. 2 as an example for illustration, the transaction nodes 1 to 3 may correspond to the mixed currency node 1, and the transaction nodes 4 to 6 may correspond to the mixed currency node 2. Thus, when the identifier parsed by the mixed currency node 2 is different from the identifiers of the transaction nodes 4 to 6, the mixed currency node 2 can determine that the transaction data does not need to be forwarded. When the identifier obtained by the analysis of the mixed currency node 2 is the same as the identifier of the transaction node 6, the transaction data can be forwarded to the transaction node 6, that is, a transaction request including encrypted transaction data is sent to the transaction node 6. By the mode, the mixed currency node corresponding to any transaction node can forward the transaction initiated by the transaction node, so that the phenomenon of repeated forwarding of the transaction can be reduced.
Fig. 3 is a flowchart of a blockchain transaction method shown in the present disclosure, and as shown in fig. 3, the method further includes, on the basis of fig. 1:
and S15, acquiring a transaction examination model. The transaction review model may include, for example, relevant transaction review policies, transaction review rules, and the like.
S16, the transaction examination model is saved in a block chain of the block chain network. In this manner, the transaction review model may be maintained and supervised by the participants of the blockchain network together.
S17, responding to the received transaction examination request, and granting the access right of the trusted execution environment to the private data storage space.
The trusted execution environment is a secure area that runs in a separate environment and in parallel with the operating system. The trusted execution environment may ensure that the confidentiality and integrity of code and data loaded in the trusted execution environment are protected. By using both hardware and software to protect data and code, the trusted execution environment has a high level of security.
Here, the target mixed currency node may grant the trusted execution environment access right to the private data storage space after receiving the transaction review request, so as to facilitate the transaction review through the trusted execution environment.
For example, the trusted execution environment may obtain a transaction vetting model in the blockchain and transaction data in the private data storage space. In this way, the transaction data in the private data storage space can be input into a transaction review model, so as to obtain a review result, and the review result is returned to the target mixed currency node. It should be noted that, in order to read the transaction data, the trusted execution environment may also request the associated key of the mixed currency node, so as to obtain the plaintext of the transaction data.
S18, receiving the examination result of the trusted execution environment.
And S19, signing the examination result, and storing the signed examination result into the block chain. For example, the target mixed currency node may sign the examination result through its own private key. In this way, other nodes in the blockchain network can verify the signature through the public key of the target mixed currency node, so that the credibility of the examination result is ensured.
According to the technical scheme, the mixed currency transaction can be carried out based on the private data storage space under the chain, so that the privacy of transaction participants is guaranteed. In addition, the mode of setting the private data storage space also enables the transaction data in the private data storage space to be checked through the trusted execution environment in the subsequent transaction checking process, so that the checking requirement is met under the condition of considering the privacy requirement of the transaction. In addition, in the technical scheme, the transaction review is performed in the trusted execution environment, so that privacy leakage in the review process can be avoided.
In order to further protect privacy, in a possible implementation, on the basis of fig. 3, the method further includes:
in response to receiving the transaction review request, sending a public key of a reviewed node to the trusted execution environment;
the receiving of the review result of the trusted execution environment comprises:
receiving an encrypted review result of the trusted execution environment, wherein the encrypted review result is obtained by encrypting a raw review result by the trusted execution environment based on a public key of the reviewed node, and the raw review result is generated by the trusted execution environment based on a transaction review model acquired from the blockchain and transaction data of the reviewed node in the private data storage space.
Fig. 4 is a flow chart of a transaction review shown in the present disclosure, and the transaction review process described above is described in conjunction with fig. 4. For transaction review, the mixed currency node may formulate a transaction review model and upload the transaction review model into the blockchain. In this way, the transaction review model is disclosed on the chain and maintained by each participant together, thereby reducing the doubt of each participant on the supervision strategy.
After the transaction review model is uploaded to the blockchain, the trusted execution environment may synchronize the transaction review model from the blockchain. In some scenarios, the trusted execution environment may also obtain the transaction review model from a blockchain by interacting with a mixed currency node. The credibility of the transaction review model can be ensured by the mode of acquiring the transaction review model on the chain.
The mixed currency node may grant access to the private data storage space to the trusted execution environment in response to receiving the transaction review request. And writing the secret key for reading the transaction data in the private data storage space and the public key of the examined node into the trusted execution environment.
In this way, the trusted execution environment can read the transaction data of the inspected node in the private data storage space, and perform abnormal transaction tracking on the inspected node through the transaction inspection model, thereby obtaining an inspection result. It is to be noted that, in order to protect the privacy of the inspected node, the inspection result may also be encrypted by the public key of the inspected node during transaction inspection, and the encrypted inspection result is returned to the mixed currency node.
In this way, the examination result received by the mixed currency node is encrypted, that is, the mixed currency node cannot acquire the content in the examination result, so that the privacy of the examined node can be protected. In addition, the mixed currency node can also sign the encrypted examination result and upload the signed encrypted examination result to the block chain. In this way, the credibility of the examination result can be ensured.
In some embodiments, a corresponding review intelligence contract may also be deployed in the blockchain network, such that after the review results of a reviewed node are uplinked, the review intelligence contract may send a review result notification to the reviewed node.
In the technical scheme, the transaction data in the private data storage space can be examined through the trusted execution environment, so that the examination requirement is met under the condition of considering the privacy requirement of the transaction. In addition, since the transaction examination is performed in the trusted execution environment, and the examination result is encrypted by the public key of the examined node, the content in the examination result cannot be known by the mixed currency node. In this way, privacy disclosure during the review process can be further avoided.
It should be noted that, in the process of transaction examination, the plaintext of the transaction data in the private data storage space and the ciphertext of the transaction data on the chain may also be compared and verified. However, the related encryption may cause the verification process to be cumbersome, thereby reducing the efficiency of the review. For example, transaction data encrypted based on the public-private key system requires that the corresponding encrypted transaction data be downloaded from the chain when authentication is performed. When the data volume of the transaction data is large, the downloading process takes a long time.
For this reason, in one possible embodiment of the present disclosure, a homomorphic key pair is maintained between each mixed coin node and each transaction node in the blockchain network, so that the transaction data can be encrypted by means of homomorphic encryption.
Fig. 5 is a flowchart of a blockchain transaction method shown in this disclosure, and as shown in fig. 5, on the basis of fig. 1, after receiving a transaction request from a transaction initiator node, the method decrypts encrypted transaction data in the transaction request and stores the decrypted transaction data in a private data storage space under a chain (step S11), including:
s111, receiving a transaction request sent by a transaction initiator node, wherein the transaction request comprises encrypted transaction data.
The encrypted transaction data is obtained by encrypting original transaction data by the transaction initiator node based on an encryption key in a first homomorphic key pair, wherein the first homomorphic key pair is a homomorphic key pair between the target mixed currency node and the transaction initiator node.
For example, the first peer key pair includes the key (n, g) of the transaction initiator node and the key λ of the target escrow node. Thus, when the transaction initiator node encrypts the original transaction data, the random number r can be determined, and r belongs to Zn,ZnIs an integer field. The transaction initiator node may then calculate the encrypted transaction data c by:
c=E(m,r)=gmrnmodn2,r∈Zn
where m is the original transaction data.
And S112, decrypting the encrypted transaction data through the first homomorphic secret key to obtain original transaction data. Following the above example, the target mixed currency node may decrypt the encrypted transaction data by:
m=D(c,λ)=(L(cλmodn2)/L(gλmodn2))mod n
where l (u) u-1/n, mod is the remainder function.
S113, storing the original transaction data into the private data storage space.
And S12, acquiring the target transaction data from the private data storage space.
And S13, analyzing the identification of the transaction receiver node corresponding to the transaction request from the target transaction data.
S14, the target transaction data is encrypted, and a transaction request including the encrypted target transaction data is sent to the transaction receiver node corresponding to the identification.
According to the technical scheme, the transaction data are encrypted in a homomorphic encryption mode, so that the ciphertext of the original transaction data obtained through homomorphic encryption can be stored in the block chain, and the original transaction data can be stored in the private data storage space. The encryption mode has the following properties: the sum a + B of the encrypted data a (encrypted from the original data a) and B (encrypted from the original data B) is equal to the result of encrypting the original data (a + B). Therefore, by adopting the technical scheme, when transaction examination and verification are carried out, the ciphertext of the transaction data on the chain and the plaintext of the transaction data under the chain can be verified in a homomorphic encryption sum calculation mode without downloading the ciphertext of the transaction data from the chain. Therefore, the technical scheme can improve the efficiency of transaction examination.
Based on the concept, the target mixed currency node can also perform homomorphic encryption when sending the transaction to the transaction receiver node. In this case, the encrypting the target transaction data and sending a transaction request including the encrypted target transaction data to a transaction recipient node corresponding to the identification (S14) includes:
encrypting the target transaction data based on an encryption key in a second homomorphic key pair to obtain target encrypted transaction data, wherein the second homomorphic key pair is a homomorphic key pair between the target mixed currency node and the transaction receiver node;
sending a transaction request including the target encrypted transaction data to the transaction recipient node.
In this way, the efficiency of transaction review can be improved.
Next, a description will be given of a generation method of a homomorphic key pair of the present disclosure, fig. 6 is a generation flow chart of a homomorphic key pair shown in the present disclosure, and referring to fig. 6, a homomorphic key pair between a target mixed currency node and a transaction node may be generated as follows:
and S61, determining a plurality of target prime numbers according to the state parameters of the block chain network.
For example, in some implementation scenarios, the state parameter of the blockchain network includes a quantity value of a node in the blockchain network, in which case the plurality of target prime numbers may be determined based on the quantity value of the node in the blockchain network.
In other implementation scenarios, the state parameter of the blockchain network includes a length value of a hash value obtained by the blockchain network during the encryption calculation, such as 32, 128, and the like. In this case, the plurality of target prime numbers may be determined based on a length value of a hash value obtained by the blockchain network at the time of cryptographic calculation.
In some implementation scenarios, the plurality of target prime numbers may also be determined by simultaneously combining the number value of the nodes in the blockchain network and the length value of the hash value obtained by the blockchain network during the encryption calculation. For example, a product of the magnitude value and the length value may be calculated, resulting in a first product.
In this way, a preset target value (for example, 2) may be used as a starting value, and a first product prime number greater than the target value may be sequentially determined as the target prime number.
S62, determining a first target value by taking the public key of the transaction node as a first initial value, wherein the first target value is greater than or equal to the first initial value and cannot divide any target prime number.
For example, a public key of the transaction node may be obtained as the first starting value P, and when the public key is an even number, the first starting value P is taken as P + 1. In this way, the first starting value P may be sequentially used to obtain a remainder for each target prime number, and if the remainder is 0, the value of P may be incremented by one until it is determined that the first target value P of any target prime number cannot be divided exactly.
And S63, determining a second target value by taking the public key of the target mixed currency node as a second initial value, wherein the second target value is greater than or equal to the second initial value and cannot divide any target prime number.
For example, the public key of the target coin-mixing node may be acquired as the first start value Q, and when the public key is an even number, the first start value Q is taken as Q + 1. In this way, the first starting value Q may be sequentially used to obtain the remainder for each target prime number, and if the remainder is 0, the value of Q may be incremented by one until it is determined that the first target value Q of any target prime number cannot be divided exactly.
And S64, generating a homomorphic key pair between the target mixed currency node and the trading node according to the first target value and the second target value.
For example, a product of the first target value and the second target value may be calculated to obtain a first secret key parameter n. Following the above example, n ═ p × q.
In this way, a target random integer may be determined as the second secret key parameter g, wherein,
Figure BDA0003280707100000151
and the first key parameter n divides the second key parameter g by the whole order,
Figure BDA0003280707100000152
the multiplicative inverse exists for the remaining system. The homomorphic key of the transaction node is (n, g).
In addition, the homomorphic key λ of the target mixed currency node can be calculated by the following calculation formula:
λ=lcm(p-1,q-1)
wherein p is the first target value, q is the second target value, and lcm () is the least common multiple function. It should be understood that gcd (L (g)λmodn2) N) is 1, gcd () is the greatest common divisor function.
The technical scheme can generate homomorphic key pairs based on the state parameters of the block chain network, for example, homomorphic key pairs with lower complexity can be generated for the block chain network with lower encryption strength and less participation nodes. By the mode, the calculation amount of the transaction process can be reduced, so that the influence on the performance of the blockchain network is reduced, and the transaction processing efficiency is improved.
It should be noted that, in some possible embodiments, the homomorphic key pair may also be generated by the transaction node and synchronized to the mixed currency node, which is not limited by the present disclosure.
Based on the same inventive concept, the disclosure also provides a blockchain transaction device, which is applied to a target mixed coin node in a blockchain network, wherein the target mixed coin node is any one of a plurality of mixed coin nodes in the blockchain network. Fig. 7 is a block diagram of a blockchain transaction apparatus 700 shown in the present disclosure, the apparatus 700 including:
the transaction data storage module 701 is configured to decrypt encrypted transaction data in a transaction request after a transaction request of a transaction initiator node is received by a target mixed currency node, and store the decrypted transaction data in a private data storage space under a link, where the private data storage space is used to store transaction data written by each mixed currency node;
a transaction data obtaining module 702, configured to obtain target transaction data from the private data storage space, where the target transaction data includes transaction data written by other mixed currency nodes except the target mixed currency node;
a transaction data analysis module 703, configured to analyze, from the target transaction data, an identifier of a transaction receiver node corresponding to the transaction request;
a first sending module 704, configured to encrypt the target transaction data and send a transaction request including the encrypted target transaction data to a transaction receiver node corresponding to the identifier.
According to the technical scheme, a plurality of mixed coin nodes are arranged in a blockchain network, any mixed coin node can decrypt encrypted transaction data in a transaction request after receiving the transaction request of a transaction initiator node, and the transaction data obtained through decryption is stored in a private data storage space under the chain. Thus, the transaction data is stored in the private data storage space, and the ciphertext of the transaction data is stored in the blockchain. In addition, any mixed coin node can acquire the transaction data written by other mixed coin nodes from the private data storage space and analyze the transaction data. After the mixed currency node successfully analyzes the identifier of the transaction receiver node from the transaction data, a transaction request comprising the transaction data can be sent to the transaction receiver node corresponding to the identifier, so that the transaction between the transaction initiator node and the transaction receiver node is completed.
By adopting the technical scheme, the transaction process between the transaction initiator node and the transaction receiver node comprises the following steps: the method comprises a chain on-line interaction process between a transaction initiator node and a mixed currency node, a chain off-line interaction process between the mixed currency nodes based on a private data storage space, and a chain on-line interaction process between the mixed currency node and a transaction receiver node. That is to say, the transaction is divided into a plurality of stages on the chain and a plurality of stages under the chain, and the data in a certain stage can not be monitored or known independently to obtain the content of the complete transaction data, so that the above transaction mode can improve the anti-attack capability of the transaction system while ensuring the privacy of the transaction data, thereby ensuring the security of the transaction data. Moreover, the mode of storing the transaction data into the private data storage space under the chain also provides an implementation basis for related transaction supervision.
Optionally, the transaction nodes in the blockchain network correspond to money mixing nodes, and an analysis rule for analyzing the identifiers of the transaction nodes is preset in the money mixing node corresponding to any one of the transaction nodes.
Optionally, the apparatus 700 further comprises:
the model acquisition module is used for acquiring a transaction examination model;
the model saving module is used for saving the transaction examination model into a block chain of the block chain network;
the authorization module is used for responding to the received transaction examination request and granting the access authority of the trusted execution environment to the private data storage space;
a review result receiving module, configured to receive a review result of the trusted execution environment, where the review result is generated by the trusted execution environment based on the transaction review model obtained from the blockchain and the transaction data in the private data storage space;
and the signature module is used for signing the examination result and storing the signed examination result into the block chain.
Optionally, the apparatus 700 further comprises:
a second sending module, configured to send, in response to receiving the transaction review request, a public key of a reviewed node to the trusted execution environment;
the examination result receiving module comprises:
a first receiving sub-module, configured to receive an encrypted review result of the trusted execution environment, where the encrypted review result is obtained by encrypting, by the trusted execution environment, a raw review result based on a public key of the reviewed node, and the raw review result is generated by the trusted execution environment based on the transaction review model obtained from the blockchain and the transaction data of the reviewed node in the private data storage space.
Optionally, a homomorphic key pair is respectively maintained between each mixed coin node and each transaction node in the blockchain network, and the transaction data saving module 701 includes:
the second receiving submodule is used for receiving a transaction request sent by a transaction initiator node, wherein the transaction request comprises encrypted transaction data, the encrypted transaction data is obtained by encrypting original transaction data by the transaction initiator node based on an encryption key in a first homomorphic key pair, and the first homomorphic key pair is a homomorphic key pair between the target mixed coin node and the transaction initiator node;
the decryption submodule is used for decrypting the encrypted transaction data through the first homomorphic secret key to obtain original transaction data;
and the storage submodule is used for storing the original transaction data into the private data storage space.
Optionally, the first sending module 704 includes:
the encryption submodule is used for encrypting the target transaction data based on an encryption key in a second homomorphic key pair to obtain target encrypted transaction data, and the second homomorphic key pair is a homomorphic key pair between the target mixed currency node and the transaction receiver node;
a sending submodule, configured to send a transaction request including the target encrypted transaction data to the transaction receiver node.
Optionally, the apparatus 700 further includes a key generation module, configured to generate a homomorphic key pair between the target mixed currency node and the transaction node, where the key generation module includes:
the first determining submodule is used for determining a plurality of target prime numbers according to the state parameters of the block chain network;
the second determining submodule is used for determining a first target value by taking the public key of the transaction node as a first initial value, wherein the first target value is greater than or equal to the first initial value and cannot divide any target prime number;
a third determining submodule, configured to determine a second target value by using the public key of the target mixed banknote node as a second initial value, where the second target value is greater than or equal to the second initial value and cannot divide any target prime number;
and the key generation submodule is used for generating a homomorphic key pair between the target mixed currency node and the transaction node according to the first target value and the second target value.
Optionally, the state parameter of the blockchain network includes a number value of nodes in the blockchain network and a length value of a hash value obtained by the blockchain network during encryption calculation, and the first determining sub-module includes:
the first calculating subunit is used for calculating the product of the quantity value and the length value to obtain a first product;
the first determining subunit is configured to determine, as the target prime number, a first product prime number greater than the target value, with a preset target value as an initial value.
Optionally, the key generation sub-module includes:
the second calculating subunit is configured to calculate a product of the first target value and the second target value to obtain a first secret key parameter n;
a second determining subunit for determining the target randomAn integer as the second secret key parameter g, wherein,
Figure BDA0003280707100000181
and the first key parameter n divides the second key parameter g by the whole order,
Figure BDA0003280707100000182
if the multiplication inverse exists under the remaining system, the homomorphic secret key of the trading node is (n, g);
a third computing subunit, configured to compute a homomorphic key λ of the target mixed banknote node according to the following calculation formula:
λ=lcm(p-1,q-1)
wherein p is the first target value, q is the second target value, and lcm () is the least common multiple function.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The present disclosure also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the blockchain transaction method provided by the present disclosure.
The present disclosure also provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the blockchain transaction method provided by the present disclosure.
Fig. 8 is a block diagram illustrating an electronic device 800 in accordance with an example embodiment. As shown in fig. 8, the electronic device 800 may include: a processor 801, a memory 802. The electronic device 800 may also include one or more of a multimedia component 803, an input/output (I/O) interface 804, and a communications component 805.
The processor 801 is configured to control the overall operation of the electronic device 800 to complete all or part of the steps of the blockchain transaction method. The memory 802 is used to store various types of data to support operation at the electronic device 800, such as instructions for any application or method operating on the electronic device 800 and application-related data, such as transceived messages, pictures, block chain book data, videos, and so forth. The Memory 802 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 803 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 802 or transmitted through the communication component 805. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 804 provides an interface between the processor 801 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the electronic device 800 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 805 may therefore include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the block chain transaction method described above.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the blockchain transaction method described above is also provided. For example, the computer readable storage medium may be the memory 802 described above that includes program instructions that are executable by the processor 801 of the electronic device 800 to perform the blockchain transaction method described above.
In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-described blockchain transaction method when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (12)

1. A blockchain transaction method is applied to a target mixed currency node in a blockchain network, wherein the target mixed currency node is any one of a plurality of mixed currency nodes in the blockchain network, and the method comprises the following steps:
after a transaction request of a transaction initiator node is received, decrypting encrypted transaction data in the transaction request, and storing the decrypted transaction data into a private data storage space under a link, wherein the private data storage space is used for storing the transaction data written by each mixed currency node;
target transaction data are obtained from the private data storage space, wherein the target transaction data comprise transaction data written by other mixed currency nodes except the target mixed currency node;
analyzing the mark of a transaction receiver node corresponding to the transaction request from the target transaction data;
encrypting the target transaction data and sending a transaction request including the encrypted target transaction data to a transaction receiver node corresponding to the identification.
2. The method according to claim 1, wherein the transaction nodes in the blockchain network correspond to coin-mixing nodes, and a coin-mixing node corresponding to any one of the transaction nodes is preset with an analysis rule for analyzing the identifier of the transaction node.
3. The method of claim 1, further comprising:
acquiring a transaction examination model;
saving the transaction review model to a blockchain of the blockchain network;
in response to receiving a transaction review request, granting access to the private data storage space by a trusted execution environment;
receiving an audit result of the trusted execution environment, the audit result being generated by the trusted execution environment based on the transaction audit model obtained from the blockchain and the transaction data in the private data storage space;
and signing the examination result, and storing the signed examination result into the block chain.
4. The method of claim 3, further comprising:
in response to receiving the transaction review request, sending a public key of a reviewed node to the trusted execution environment;
the receiving of the review result of the trusted execution environment comprises:
receiving an encrypted review result of the trusted execution environment, wherein the encrypted review result is obtained by encrypting a raw review result by the trusted execution environment based on a public key of the reviewed node, and the raw review result is generated by the trusted execution environment based on a transaction review model acquired from the blockchain and transaction data of the reviewed node in the private data storage space.
5. The method according to any one of claims 1 to 4, wherein a homomorphic key pair is maintained between each mixed currency node and each transaction node in the blockchain network, and after a transaction request of a transaction initiator node is received, encrypted transaction data in the transaction request is decrypted and the decrypted transaction data is stored in a private data storage space under the chain, the method includes:
receiving a transaction request sent by a transaction initiator node, wherein the transaction request comprises encrypted transaction data, the encrypted transaction data is obtained by encrypting original transaction data by the transaction initiator node based on an encryption key in a first homomorphic key pair, and the first homomorphic key pair is a homomorphic key pair between the target mixed currency node and the transaction initiator node;
decrypting the encrypted transaction data through the first homomorphic secret key to obtain original transaction data;
and saving the original transaction data to the private data storage space.
6. The method of claim 5, wherein encrypting the target transaction data and sending a transaction request including the encrypted target transaction data to a transaction recipient node corresponding to the identification comprises:
encrypting the target transaction data based on an encryption key in a second homomorphic key pair to obtain target encrypted transaction data, wherein the second homomorphic key pair is a homomorphic key pair between the target mixed currency node and the transaction receiver node;
sending a transaction request including the target encrypted transaction data to the transaction recipient node.
7. The method of claim 5, wherein the homomorphic key pair between the target mixed currency node and the transaction node is generated by:
determining a plurality of target prime numbers according to the state parameters of the block chain network;
determining a first target value by taking the public key of the transaction node as a first initial value, wherein the first target value is greater than or equal to the first initial value and cannot divide any target prime number;
determining a second target value by taking the public key of the target mixed currency node as a second initial value, wherein the second target value is greater than or equal to the second initial value and cannot divide any target prime number;
and generating a homomorphic secret key pair between the target mixed currency node and the transaction node according to the first target value and the second target value.
8. The method according to claim 7, wherein the state parameters of the blockchain network include a number value of nodes in the blockchain network and a length value of a hash value obtained by the blockchain network during encryption calculation, and the determining a plurality of target prime numbers according to the state parameters of the blockchain network includes:
calculating the product of the number value and the length value to obtain a first product;
and determining a first product prime number which is larger than the target numerical value as the target prime number by taking a preset target numerical value as an initial numerical value.
9. The method of claim 7, wherein generating a homomorphic key pair between the target coinage node and the transaction node based on the first target value and the second target value comprises:
calculating the product of the first target value and the second target value to obtain a first secret key parameter n;
determining a target random integer as a second secret key parameter g, wherein,
Figure FDA0003280707090000041
and the first key parameter n divides the second key parameter g by the whole order,
Figure FDA0003280707090000042
if the multiplication inverse exists under the remaining system, the homomorphic secret key of the trading node is (n, g);
calculating a homomorphic key lambda of the target mixed currency node by the following calculation formula:
λ=lcm(p-1,q-1)
wherein p is the first target value, q is the second target value, and lcm () is the least common multiple function.
10. A blockchain transaction apparatus, applied to a target mixed currency node in a blockchain network, wherein the target mixed currency node is any one of a plurality of mixed currency nodes in the blockchain network, and the apparatus comprises:
the transaction data storage module is used for decrypting encrypted transaction data in a transaction request after a transaction request of a transaction initiator node is received by a target mixed currency node, and storing the decrypted transaction data into a private data storage space under a link, wherein the private data storage space is used for storing the transaction data written by each mixed currency node;
the transaction data acquisition module is used for acquiring target transaction data from the private data storage space, wherein the target transaction data comprises transaction data written by other mixed currency nodes except the target mixed currency node;
the transaction data analysis module is used for analyzing the identification of the transaction receiver node corresponding to the transaction request from the target transaction data;
and the first sending module is used for encrypting the target transaction data and sending a transaction request comprising the encrypted target transaction data to a transaction receiver node corresponding to the identifier.
11. A non-transitory computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 9.
12. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 9.
CN202111131516.6A 2021-09-26 2021-09-26 Block chain transaction method and device, storage medium and electronic equipment Pending CN113902431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111131516.6A CN113902431A (en) 2021-09-26 2021-09-26 Block chain transaction method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111131516.6A CN113902431A (en) 2021-09-26 2021-09-26 Block chain transaction method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113902431A true CN113902431A (en) 2022-01-07

Family

ID=79029347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111131516.6A Pending CN113902431A (en) 2021-09-26 2021-09-26 Block chain transaction method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113902431A (en)

Similar Documents

Publication Publication Date Title
US8396218B2 (en) Cryptographic module distribution system, apparatus, and program
WO2019098941A1 (en) System and method for private integration of datasets
JP2023500570A (en) Digital signature generation using cold wallet
CN112073196B (en) Service data processing method and device, electronic equipment and storage medium
Sathya et al. A comprehensive study of blockchain services: future of cryptography
CN112632574A (en) Multi-mechanism data processing method and device based on alliance chain and related equipment
CN112272088A (en) Auditable signature method based on multiple secure parties and related components
CN112734423A (en) Transaction method based on block chain and terminal equipment
Faust et al. Generic compiler for publicly verifiable covert multi-party computation
US20210392177A1 (en) Secure multi-party random bit generation
Bray Implementing cryptography using Python
EP1361693B1 (en) Handle deciphering system and handle deciphering method, and program
WO2022024182A1 (en) Knowledge proof method, knowledge proof program, and information processing apparatus
CN117436043A (en) Method and device for verifying source of file to be executed and readable storage medium
Zhang et al. Data security in cloud storage
CN111245594B (en) Homomorphic operation-based collaborative signature method and system
Li et al. An auditable confidentiality protocol for blockchain transactions
Malina et al. Assessment of cryptography support and security on programmable smart cards
Chen et al. How to bind a TPM’s attestation keys with its endorsement key
Hou et al. Blockchain-based efficient verifiable outsourced attribute-based encryption in cloud
CN113902431A (en) Block chain transaction method and device, storage medium and electronic equipment
Soler et al. A privacy-preserving key transmission protocol to distribute QRNG keys using zk-SNARKs
CN117979051B (en) Audio anti-counterfeiting method, equipment and medium
Mols et al. ethVote: Towards secure voting with distributed ledgers
CN116132185B (en) Data calling method, system, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination