CN113570369A - Block chain privacy transaction method, device, equipment and readable storage medium - Google Patents
Block chain privacy transaction method, device, equipment and readable storage medium Download PDFInfo
- Publication number
- CN113570369A CN113570369A CN202110866406.8A CN202110866406A CN113570369A CN 113570369 A CN113570369 A CN 113570369A CN 202110866406 A CN202110866406 A CN 202110866406A CN 113570369 A CN113570369 A CN 113570369A
- Authority
- CN
- China
- Prior art keywords
- data
- expenditure
- path
- transaction
- encrypted 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3825—Use of electronic signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3829—Payment protocols; Details thereof insuring higher security of transaction involving key management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/389—Keeping log of transactions for guaranteeing non-repudiation of a transaction
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Engineering & Computer Science (AREA)
- Finance (AREA)
- Physics & Mathematics (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Technology Law (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention relates to the technical field of block chains, in particular to a block chain privacy transaction method, a block chain privacy transaction device, block chain privacy transaction equipment and a readable storage medium, wherein first transaction data are obtained and are information reflecting receipt and payment details of two transaction parties; encrypting the first transaction data to obtain first encrypted data; the first encrypted data are sent to a first upper node, second encrypted data published by the block chain network are received, and a user account book is modified according to the second encrypted data.
Description
Technical Field
The invention relates to the technical field of block chains, in particular to a block chain privacy transaction method, a block chain privacy transaction device, block chain privacy transaction equipment and a readable storage medium.
Background
The blockchain technology is based on decentralized distributed protocol, consensus algorithm, asymmetric key signature, Hash and other technologies, can safely store digital asset information, information cannot be forged and falsified, all nodes on a blockchain network execute transactions respectively and complete result confirmation together, and the consensus algorithm ensures the consistency of the transactions executed by all the nodes.
The existing block chain transaction is transparent, and related privacy protection of transaction details is lacked, so that asset information of a user can be obtained by collecting a plurality of transaction details of the user, the asset information of the user is illegally used, and great inconvenience is brought to the user.
Disclosure of Invention
The invention aims to provide a block chain private transaction method, a block chain private transaction device, a block chain private transaction equipment and a readable storage medium, so as to improve the problems.
In order to achieve the above object, the embodiments of the present application provide the following technical solutions:
in one aspect, an embodiment of the present application provides a method for a blockchain private transaction, where the method is applied to any node in a blockchain network, and the method includes:
acquiring first transaction data, wherein the first transaction data is information reflecting receipt and payment details of both transaction parties;
encrypting the first transaction data to obtain first encrypted data, wherein the first encrypted data is the transaction data which can be decrypted only by a node on a transaction path, and the transaction path is a path connecting an expenditure node, an income node and a first upper node;
sending the first encrypted data to a first upper node, wherein the first upper node is used for checking the validity of the first encrypted data and uploading the first encrypted data to a block chain network;
and receiving second encrypted data published by the blockchain network, and modifying a user account book according to the second encrypted data, wherein the second encrypted data is first encrypted data which achieves consensus in the blockchain network.
Optionally, the encrypting the first transaction data to obtain first encrypted data includes:
retrieving first transaction data and organizational structure data, the first transaction data including expense data and revenue data, the expense data including expense account data, the revenue data including revenue account data, the organizational structure data reflecting hierarchical affiliations between a plurality of nodes;
calculating the transaction path according to the expenditure account data, the income account data and the organization architecture data, wherein the transaction path comprises an expenditure sub-path and an income sub-path, the expenditure sub-path is a path connecting the expenditure node and the first upper node, and the income sub-path is a path connecting the income node and the first upper node;
encrypting the expenditure data according to the expenditure sub-path to obtain first expenditure encrypted data, wherein the first expenditure encrypted data can be decrypted and viewed only by nodes on the expenditure sub-path;
and encrypting the income data according to the income sub-path to obtain first income encrypted data, wherein the first income encrypted data can be decrypted and viewed only by nodes on the income sub-path, and the first income encrypted data form the first encrypted data.
Optionally, the sending the first encrypted data to a first upper node includes:
calling the first encrypted data and a expenditure sub-path, wherein the first encrypted data comprises an expenditure user signature, the expenditure sub-path comprises at least two nodes, one end of the expenditure sub-path is an expenditure node, and the other end of the expenditure sub-path is a first upper node;
and verifying the validity of the signature of the expenditure user, if the signature of the expenditure user is valid, executing a first signature operation and a first sending operation, wherein the first signature operation is that the current node signs the first encrypted data, the first sending operation is that the current node sends the first encrypted data and the expenditure sub-path to a next node adjacent to the current node according to the expenditure sub-path, the expenditure sub-path is used for triggering the current node to execute a second signature verification operation, the second signature verification operation is that the current node verifies the validity of the signature of the previous node according to the expenditure sub-path, and if the signature of the previous node is valid, executing the first signature operation and the first sending operation until the first encrypted data is sent to the first upper node.
Optionally, the receiving second encrypted data published by the blockchain network, and modifying a user account book according to the second encrypted data includes:
acquiring second encrypted data issued by the blockchain network;
decrypting the second encrypted data to obtain second transaction data, wherein the second transaction data comprise expenditure data and a change amount, the expenditure data comprise expenditure account data and expenditure amount, the change amount is an amount which is obtained after the income data are locally decrypted and used for returning to a expenditure user, and the local decryption is that the current node decrypts partial income data according to the identity key of the current node;
calling a corresponding user account book according to the expenditure account data;
and modifying the corresponding user account book according to the expenditure amount and the change amount.
In a second aspect, an embodiment of the present application provides a blockchain privacy transaction apparatus, including:
the first acquisition module is used for acquiring first transaction data, wherein the first transaction data is information reflecting receipt and payment details of both transaction parties;
the first encryption module is used for encrypting the first transaction data to obtain first encrypted data, the first encrypted data is the transaction data which can be decrypted only by a node on a transaction path, and the transaction path is a path connecting an expenditure node, an income node and a first upper node;
the first sending module is used for sending the first encrypted data to a first upper node, and the first upper node is used for checking the validity of the first encrypted data and uploading the first encrypted data to a block chain network;
the first computing module is used for receiving second encrypted data published by the blockchain network and modifying a user account book according to the second encrypted data, wherein the second encrypted data is first encrypted data which achieves consensus in the blockchain network.
Optionally, the first encryption module includes:
the system comprises a first calling unit, a second calling unit and a third calling unit, wherein the first calling unit is used for calling first transaction data and organization architecture data, the first transaction data comprises expenditure data and income data, the expenditure data comprises expenditure account data, the income data comprises income account data, and the organization architecture data reflects the hierarchy affiliation relationship among a plurality of nodes;
the first calculation unit is used for calculating the transaction path according to the expenditure account data, the income account data and the organization architecture data, wherein the transaction path comprises an expenditure sub-path and an income sub-path, the expenditure sub-path is a path connecting the expenditure node and the first upper node, and the income sub-path is a path connecting the income node and the first upper node;
the second calculation unit is used for encrypting the expenditure data according to the expenditure sub-path to obtain first expenditure encrypted data, and the first expenditure encrypted data is only decipherable and viewable for nodes on the expenditure sub-path;
and the third calculation unit is used for encrypting the income data according to the income sub-path to obtain first income encrypted data, the first income encrypted data can be decrypted and viewed only by nodes on the income sub-path, and the first income encrypted data form the first encrypted data.
Optionally, the first sending module includes:
the second calling unit is used for calling the first encrypted data and a expenditure sub-path, wherein the first encrypted data comprises an expenditure user signature, the expenditure sub-path comprises at least two nodes, one end of the expenditure sub-path is an expenditure node, and the other end of the expenditure sub-path is a first upper node;
and the fourth calculation unit is used for verifying the validity of the signature of the expenditure user, if the signature of the expenditure user is valid, executing a first signature operation and a first sending operation, wherein the first signature operation is that the current node signs the first encrypted data, the first sending operation is that the current node sends the first encrypted data and the expenditure sub-path to a next node adjacent to the current node according to the expenditure sub-path, the expenditure sub-path is used for triggering the current node to execute a second signature verification operation, the second signature verification operation is that the current node verifies the validity of the signature of the previous node according to the expenditure sub-path, and if the signature of the previous node is valid, the first signature operation and the first sending operation are executed until the first encrypted data is sent to the first upper node.
Optionally, the first computing module includes:
a first obtaining unit, configured to obtain second encrypted data issued by the blockchain network;
a fifth calculating unit, configured to decrypt the second encrypted data to obtain second transaction data, where the second transaction data includes expenditure data and a change amount, the expenditure data includes expenditure account data and expenditure amount, the change amount is an amount obtained after locally decrypting revenue data and used for returning to a expenditure user, and the locally decrypting is partial revenue data decrypted by the current node according to an identity key of the current node;
the sixth calculating unit is used for calling a corresponding user account book according to the expenditure account data;
and the seventh calculating unit is used for modifying the corresponding user account book according to the expenditure amount and the change amount.
In a third aspect, embodiments of the present application provide a blockchain privacy transaction apparatus, which includes a memory and a processor. The memory is used for storing a computer program; the processor is used for realizing the steps of the block chain privacy transaction method when executing the computer program.
In a fourth aspect, the present application provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the above-mentioned blockchain privacy transaction method.
The invention has the beneficial effects that:
according to the invention, the first transaction data is encrypted based on the hierarchical identity, so that the first transaction data can be decrypted and checked only for the nodes on the transaction path, the situation that other nodes except the nodes on the transaction path check the first transaction data is effectively avoided, the single transaction details of the user are effectively protected, other people cannot obtain complete transaction details of the user, and other people cannot obtain asset information of the user.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic flow chart of a method for block chain privacy transaction according to an embodiment of the present invention;
FIG. 2 is a block chain privacy transaction apparatus according to an embodiment of the present invention;
FIG. 3 is a block chain privacy transaction apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a multi-layer fabric architecture according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers or letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
As shown in fig. 1 and 4, the present embodiment provides a blockchain privacy transaction method, which includes step S1, step S2, step S3, and step S4.
Step S1, acquiring first transaction data, wherein the first transaction data is information reflecting details of receipts and payments of both parties of a transaction, the first transaction data comprises expenditure data and income data, the expenditure data comprises expenditure denomination and expenditure account data, the expenditure denomination cannot be split (similar to a 100-element RMB, and cannot be split), and the expenditure denomination can also be formed by piecing together a plurality of other denominations (for example, a 20-element expenditure denomination is added with a 10-element expenditure denomination, and pieced together into 30-element expenditure denomination), and the expenditure account data reflects information of a money issuer, such as a special account ID, a user signature, a user password and the like; similarly, where the revenue data includes a plurality of revenue denominations, this embodiment provides a solution with two revenue denominations, and other numbers of revenue denominations can be analogized according to this embodiment. For example, the revenue data includes a first revenue denomination corresponding to the first revenue account data (similar to the first payee and first payee's amount of collection), a first revenue denomination corresponding to the second revenue account data (similar to the second payee and second payee's amount of collection), a second revenue denomination, and a second revenue account data, the first revenue account data and the second revenue account data comprising the revenue account data.
Step S2, encrypting the first transaction data to obtain first encrypted data, where the first encrypted data is transaction data that can be decrypted only by a node on a transaction path, and the transaction path is a path connecting an expenditure node, an income node, and a first upper node, where the step S2 includes:
s21, calling first transaction data and organization architecture data, wherein the first transaction data comprise expenditure data and income data, the expenditure data comprise expenditure account data, the income data comprise income account data, and the organization architecture data reflect the hierarchical affiliation relationship among a plurality of nodes;
step s22, calculating to obtain the transaction path according to the expenditure account data (such as the user a), the income account data (such as the user b and the user a), and the multi-layer organization structure data (see fig. 4), where the transaction path includes a expenditure sub-path and an income sub-path, the expenditure sub-path is a path connecting the expenditure node and the first upper node, and the income sub-path is a path connecting the income node and the first upper node;
s23, encrypting the expenditure data according to the expenditure sub-path to obtain first expenditure encrypted data, wherein the first expenditure encrypted data can be decrypted and viewed only for nodes on the expenditure sub-path;
and S24, encrypting the income data according to the income sub-path to obtain first income encrypted data, wherein the first income encrypted data can be decrypted and viewed only by nodes on the income sub-path, and the first income encrypted data form the first encrypted data.
In the present embodiment, a principle explanation will be given by taking an example in which one user a in the escrow mechanism 1 transfers 20 denominations to one user b in the escrow mechanism 4; the user a has a bond with a denomination of 50 on the account, in the transaction, the user a needs to transfer the denomination of 20 to the user b, and the rest 30 denominations are returned to the user b (the above steps are transaction data generated by the hosting agency 1 according to the transaction requirement of the user a, and the hosting agency 1 calls the denomination of 50 from the account of the user a), the expenditure data included in the transaction data is the expenditure amount 50, the expenditure account data is the user a (or the ID of the user a, the signature of the user a, the account password of the user a, and the like, which can verify the identity of the user a, and the invention is not limited to this), and the income data included in the transaction data includes the first income denomination 20, the first income account data-the identity information of the user b (such as the signature of the user b), the second income denomination 30, and the second income account data-the identity information of the user a (such as the signature of the user a); as shown in fig. 4, for the hierarchical affiliation relationship among multiple nodes (hosting institutions) of the organizational structure data reaction in this embodiment, the hosting institution 1 acquires the transaction data sent by the user a in the current transaction;
according to the user a, the user b and the hierarchical relationship shown in fig. 4, the payout sub-path can be obtained as follows: hosting facility 1-hosting facility a, the first revenue sub-path being: escrow mechanism a-escrow mechanism b-escrow mechanism 4, second revenue sub-path: the hosting mechanism A is a hosting mechanism a and a hosting mechanism 1, wherein the hosting mechanisms can be regarded as nodes in a block chain network, expenditure data are encrypted according to expenditure sub-paths, the expenditure data can only be decrypted and viewed by the nodes (hosting mechanisms) on the expenditure sub-paths, and then first income encrypted data are obtained, similarly, first income data (comprising a first income denomination 20, first income account data-identity information of a user b) are encrypted according to the first income sub-paths to obtain first income encrypted data a, and second income data (a second income denomination 30, second income account data-identity information of the user a) are encrypted according to the second income sub-paths to obtain first income encrypted data b.
Through the encryption transaction, the payee of the transaction only knows the information of the payee and the information of the paying party, but cannot know other transaction data irrelevant to the payee, and the transaction privacy of the paying party on a block chain is greatly protected.
Step S3, sending the first encrypted data to a first upper node, where the first upper node is configured to check validity of the first encrypted data, and upload the first encrypted data to a blockchain network, where the step S3 further includes:
step S31, calling the first encrypted data and a expenditure sub-path, wherein the first encrypted data comprises an expenditure user signature, the expenditure sub-path comprises at least two nodes, one end of the expenditure sub-path is an expenditure node, and the other end of the expenditure sub-path is a first upper-layer node;
step S32, checking the validity of the signature of the expenditure user, if the signature of the expenditure user is valid, executing a first signature operation and a first sending operation, wherein the first signature operation is that the current node signs the first encrypted data, the first sending operation is that the current node sends the first encrypted data and the expenditure sub-path to a next node adjacent to the current node according to the expenditure sub-path, the expenditure sub-path is used for triggering the current node to execute a second signature checking operation, the second signature checking operation is that the current node checks the validity of the signature of the previous node according to the expenditure sub-path, and if the signature of the previous node is valid, executing the first signature operation and the first sending operation until the first encrypted data is sent to the first upper node.
In this embodiment, as shown in fig. 4, by taking an example that a user a in the hosting organization 1 transfers 20 denominations to a user b in the hosting organization 4, the hosting organization 1 verifies whether the signature of the user a is authentic after receiving transaction data submitted by the user a, performs signature 1 on the transaction data after passing the verification, then sends the transaction data to the hosting organization a, the hosting organization a verifies whether the signature a is authentic, performs signature a on the transaction data after passing the verification, then sends the transaction data to the hosting organization a, the hosting organization a verifies the authenticity and validity of the signature a, and simultaneously checks the balance of income and expenditure of the transaction data (as the income sub-path, the first income sub-path, and the second income sub-path all include a node-the hosting organization a, therefore, the hosting organization can see the complete transaction data, only the hosting organization A can perform balance check), when the check and balance check are passed, the hosting organization A signs the transaction data A, then uploads the transaction data to the blockchain network for consensus voting, when the consensus voting passes, the blockchain network verifies the authenticity and validity of the denomination 50 again, if the denomination 50 is valid, the denomination 50 is destroyed according to the transaction data, a new denomination 30 and a new denomination 20 are generated, the transaction formed by the operation is recorded in the public account of each node on the blockchain network, namely the public account on the blockchain network records the generation and the deletion of any denomination, and then all the different denominations are recorded on the chain, and when the specific numerical value of the denomination and the denomination belonging to the chain cannot be known, the transaction data is sent to each node by the blockchain network, at this time, the escrow mechanism 4 can only decrypt the first income encrypted data b to obtain second income data including the second income denomination 30 and second income account data, namely identity information of the user a, and then the escrow mechanism 4 places the second income denomination 30 in an account corresponding to the user b, because other nodes except nodes on the expenditure subpath, the first income subpath and the second income subpath cannot decrypt the first encrypted data (namely encrypted transaction data), the transaction data is effectively prevented from being disclosed and transparent on the blockchain network, and the transaction privacy of the user is effectively protected, for example, the escrow mechanism 2 and the escrow mechanism 3 in fig. 4 cannot decrypt the transaction data.
Step S4, receiving second encrypted data published by the blockchain network, and modifying a user account book according to the second encrypted data, where the second encrypted data is first encrypted data that achieves consensus in the blockchain network, and step S4 includes:
s41, acquiring second encrypted data issued by the block chain network;
s42, decrypting the second encrypted data to obtain second transaction data, wherein the second transaction data comprise expenditure data and change making amount, the expenditure data comprise expenditure account data and expenditure amount, the change making amount is an amount obtained after incoming data are locally decrypted and used for returning to a expenditure user, and the local decryption is partial incoming data decrypted by a current node according to an identity key of the current node;
s43, calling a corresponding user account book according to the expenditure account data;
and S44, modifying the corresponding user account book according to the expenditure amount and the change amount.
In the present embodiment, a principle explanation will be given by taking an example in which one user a in the escrow mechanism 1 transfers 20 denominations to one user b in the escrow mechanism 4; as shown in fig. 4, at this time, the escrow mechanism 1 receives the second transaction data (encrypted transaction data, including the first revenue encryption data a and the first revenue encryption data b) issued by the blockchain network, at this time, the escrow mechanism 1 can decrypt the first revenue encryption data b (the second revenue denomination 30, the second revenue account data — the identity information of the user a) (because the escrow mechanism 1 is a node on the second revenue subpath) to obtain the revenue denomination 30, the revenue account is the user a, then call the account corresponding to the user a, and deposit the denomination 30 into the account corresponding to the user a.
Example 2
As shown in fig. 2, the present embodiment provides a blockchain privacy transaction system, which includes:
a first obtaining module 71, configured to obtain first transaction data, where the first transaction data is information reflecting details of receipt and payment of both parties of a transaction;
a first encryption module 72, configured to encrypt the first transaction data to obtain first encrypted data, where the first encrypted data is transaction data that can be decrypted only by a node on a transaction path, and the transaction path is a path connecting an expenditure node, an income node, and a first upper node;
a first sending module 73, configured to send the first encrypted data to a first upper node, where the first upper node is configured to check validity of the first encrypted data, and upload the first encrypted data to a blockchain network;
the first calculating module 74 is configured to receive second encrypted data published by the blockchain network, and modify the user account book according to the second encrypted data, where the second encrypted data is first encrypted data that achieves consensus in the blockchain network.
In a specific embodiment of the present disclosure, the first encryption module 72 includes:
a first retrieving unit 721, configured to retrieve first transaction data and organizational structure data, where the first transaction data includes expenditure data and income data, the expenditure data includes expenditure account data, the income data includes income account data, and the organizational structure data reflects a hierarchical affiliation relationship between a plurality of nodes;
a first calculating unit 722, configured to calculate the transaction path according to the expenditure account data, the income account data, and the organization structure data, where the transaction path includes an expenditure sub-path and an income sub-path, the expenditure sub-path is a path connecting the expenditure node and the first upper node, and the income sub-path is a path connecting the income node and the first upper node;
the second calculating unit 723 is configured to encrypt the expenditure data according to the expenditure sub-path to obtain first export encrypted data, where the first export encrypted data is only decipherable and viewable by nodes on the expenditure sub-path;
a third calculating unit 724, configured to encrypt the incoming data according to the incoming sub-path to obtain first incoming encrypted data, where the first incoming encrypted data is only decryptable for nodes on the incoming sub-path, and the first outgoing encrypted data and the first incoming encrypted data constitute the first encrypted data.
In a specific embodiment of the present disclosure, the first sending module 73 includes:
a second retrieving unit 731, configured to retrieve the first encrypted data and a payout sub-path, where the first encrypted data includes a payout user signature, the payout sub-path includes at least two nodes, and one end of the payout sub-path is a payout node and the other end of the payout sub-path is a first upper node;
a fourth calculating unit 732, configured to verify validity of the signature of the expenditure user, and if the signature of the expenditure user is valid, execute a first signature operation and a first sending operation, where the first signature operation is to sign the first encrypted data by a current node, the first sending operation is to send, by the current node, the first encrypted data and the expenditure sub-path to a next node adjacent to the current node according to the expenditure sub-path, the expenditure sub-path is used to trigger the current node to execute a second signature verification operation, the second signature verification operation is to verify validity of a signature of a previous node by the current node according to the expenditure sub-path, and if the signature of the previous node is valid, execute the first signature operation and the first sending operation until the first encrypted data is sent to the first upper node.
In one embodiment of the present disclosure, the first calculating module 74 includes:
a first obtaining unit 741, configured to obtain second encrypted data issued by the blockchain network;
a fifth calculating unit 742, configured to decrypt the second encrypted data to obtain second transaction data, where the second transaction data includes expenditure data and a change amount, the expenditure data includes expenditure account data and expenditure amount, the change amount is an amount obtained by locally decrypting revenue data and used for returning to a expenditure user, and the local decryption is partial revenue data decrypted by the current node according to the own identity key;
a sixth calculating unit 743, retrieving a corresponding user account book according to the expenditure account data;
a seventh calculating unit 744, configured to modify the corresponding user account book according to the expenditure amount and the change amount.
It should be noted that, regarding the apparatus in the above 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 herein.
Example 3
Corresponding to the above method embodiment, the present disclosure also provides a blockchain privacy transaction device, and a blockchain privacy transaction device described below and a blockchain privacy transaction method described above may be referred to in correspondence with each other.
Fig. 3 is a block diagram illustrating a blockchain privacy transaction device 800 according to an example embodiment. As shown in fig. 3, 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, so as to complete all or part of the steps in the above block chain privacy 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 contact data, transmitted and received messages, pictures, audio, video, 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, or 4G, or a combination of one or more of them, so that the corresponding communication component 805 may include: Wi-Fi module, bluetooth module, NFC module.
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 above-described block chain privacy transaction method.
In another exemplary embodiment, a computer readable storage medium comprising program instructions that when executed by a processor implement the steps of the blockchain privacy 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 executable by the processor 801 of the electronic device 800 to perform the blockchain privacy transaction method described above.
Example 4
Corresponding to the above method embodiment, the disclosed embodiment also provides a readable storage medium, and a readable storage medium described below and a blockchain privacy transaction method described above may be referred to correspondingly.
A readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the blockchain privacy transaction method of the above-described method embodiments.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for private transaction in a blockchain network, applied to any node in the blockchain network, includes:
acquiring first transaction data, wherein the first transaction data is information reflecting receipt and payment details of both transaction parties;
encrypting the first transaction data to obtain first encrypted data, wherein the first encrypted data is the transaction data which can be decrypted only by a node on a transaction path, and the transaction path is a path connecting an expenditure node, an income node and a first upper node;
sending the first encrypted data to a first upper node, wherein the first upper node is used for checking the validity of the first encrypted data and uploading the first encrypted data to a block chain network;
and receiving second encrypted data published by the blockchain network, and modifying a user account book according to the second encrypted data, wherein the second encrypted data is first encrypted data which achieves consensus in the blockchain network.
2. The blockchain private transaction method according to claim 1, wherein the encrypting the first transaction data to obtain first encrypted data includes:
retrieving first transaction data and organizational structure data, the first transaction data including expense data and revenue data, the expense data including expense account data, the revenue data including revenue account data, the organizational structure data reflecting hierarchical affiliations between a plurality of nodes;
calculating the transaction path according to the expenditure account data, the income account data and the organization architecture data, wherein the transaction path comprises an expenditure sub-path and an income sub-path, the expenditure sub-path is a path connecting the expenditure node and the first upper node, and the income sub-path is a path connecting the income node and the first upper node;
encrypting the expenditure data according to the expenditure sub-path to obtain first expenditure encrypted data, wherein the first expenditure encrypted data can be decrypted and viewed only by nodes on the expenditure sub-path;
and encrypting the income data according to the income sub-path to obtain first income encrypted data, wherein the first income encrypted data can be decrypted and viewed only by nodes on the income sub-path, and the first income encrypted data form the first encrypted data.
3. The blockchain private transaction method according to claim 1, wherein the sending the first encrypted data to a first upper node includes:
calling the first encrypted data and a expenditure sub-path, wherein the first encrypted data comprises an expenditure user signature, the expenditure sub-path comprises at least two nodes, one end of the expenditure sub-path is an expenditure node, and the other end of the expenditure sub-path is a first upper node;
and verifying the validity of the signature of the expenditure user, if the signature of the expenditure user is valid, executing a first signature operation and a first sending operation, wherein the first signature operation is that the current node signs the first encrypted data, the first sending operation is that the current node sends the first encrypted data and the expenditure sub-path to a next node adjacent to the current node according to the expenditure sub-path, the expenditure sub-path is used for triggering the current node to execute a second signature verification operation, the second signature verification operation is that the current node verifies the validity of the signature of the previous node according to the expenditure sub-path, and if the signature of the previous node is valid, executing the first signature operation and the first sending operation until the first encrypted data is sent to the first upper node.
4. The blockchain private transaction method of claim 1, wherein receiving second encrypted data published by the blockchain network and modifying a user ledger according to the second encrypted data comprises:
acquiring second encrypted data issued by the blockchain network;
decrypting the second encrypted data to obtain second transaction data, wherein the second transaction data comprise expenditure data and a change amount, the expenditure data comprise expenditure account data and expenditure amount, the change amount is an amount which is obtained after the income data are locally decrypted and used for returning to a expenditure user, and the local decryption is that the current node decrypts partial income data according to the identity key of the current node;
calling a corresponding user account book according to the expenditure account data;
and modifying the corresponding user account book according to the expenditure amount and the change amount.
5. A blockchain privacy transaction apparatus, comprising:
the first acquisition module is used for acquiring first transaction data, wherein the first transaction data is information reflecting receipt and payment details of both transaction parties;
the first encryption module is used for encrypting the first transaction data to obtain first encrypted data, the first encrypted data is the transaction data which can be decrypted only by a node on a transaction path, and the transaction path is a path connecting an expenditure node, an income node and a first upper node;
the first sending module is used for sending the first encrypted data to a first upper node, and the first upper node is used for checking the validity of the first encrypted data and uploading the first encrypted data to a block chain network;
the first computing module is used for receiving second encrypted data published by the blockchain network and modifying a user account book according to the second encrypted data, wherein the second encrypted data is first encrypted data which achieves consensus in the blockchain network.
6. The blockchain privacy transaction apparatus of claim 5, wherein the first encryption module comprises:
the system comprises a first calling unit, a second calling unit and a third calling unit, wherein the first calling unit is used for calling first transaction data and organization architecture data, the first transaction data comprises expenditure data and income data, the expenditure data comprises expenditure account data, the income data comprises income account data, and the organization architecture data reflects the hierarchy affiliation relationship among a plurality of nodes;
the first calculation unit is used for calculating the transaction path according to the expenditure account data, the income account data and the organization architecture data, wherein the transaction path comprises an expenditure sub-path and an income sub-path, the expenditure sub-path is a path connecting the expenditure node and the first upper node, and the income sub-path is a path connecting the income node and the first upper node;
the second calculation unit is used for encrypting the expenditure data according to the expenditure sub-path to obtain first expenditure encrypted data, and the first expenditure encrypted data is only decipherable and viewable for nodes on the expenditure sub-path;
and the third calculation unit is used for encrypting the income data according to the income sub-path to obtain first income encrypted data, the first income encrypted data can be decrypted and viewed only by nodes on the income sub-path, and the first income encrypted data form the first encrypted data.
7. The blockchain privacy transaction apparatus of claim 5, wherein the first sending module includes:
the second calling unit is used for calling the first encrypted data and a expenditure sub-path, wherein the first encrypted data comprises an expenditure user signature, the expenditure sub-path comprises at least two nodes, one end of the expenditure sub-path is an expenditure node, and the other end of the expenditure sub-path is a first upper node;
and the fourth calculation unit is used for verifying the validity of the signature of the expenditure user, if the signature of the expenditure user is valid, executing a first signature operation and a first sending operation, wherein the first signature operation is that the current node signs the first encrypted data, the first sending operation is that the current node sends the first encrypted data and the expenditure sub-path to a next node adjacent to the current node according to the expenditure sub-path, the expenditure sub-path is used for triggering the current node to execute a second signature verification operation, the second signature verification operation is that the current node verifies the validity of the signature of the previous node according to the expenditure sub-path, and if the signature of the previous node is valid, the first signature operation and the first sending operation are executed until the first encrypted data is sent to the first upper node.
8. The blockchain privacy transaction apparatus of claim 5, wherein the first computing module includes:
a first obtaining unit, configured to obtain second encrypted data issued by the blockchain network;
a fifth calculating unit, configured to decrypt the second encrypted data to obtain second transaction data, where the second transaction data includes expenditure data and a change amount, the expenditure data includes expenditure account data and expenditure amount, the change amount is an amount obtained after locally decrypting revenue data and used for returning to a expenditure user, and the locally decrypting is partial revenue data decrypted by the current node according to an identity key of the current node;
the sixth calculating unit is used for calling a corresponding user account book according to the expenditure account data;
and the seventh calculating unit is used for modifying the corresponding user account book according to the expenditure amount and the change amount.
9. A blockchain privacy transaction device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the blockchain privacy transaction method of any one of claims 1 to 4 when executing the computer program.
10. A readable storage medium, characterized by: the readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the blockchain privacy transaction method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110866406.8A CN113570369B (en) | 2021-07-29 | 2021-07-29 | Block chain privacy transaction method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110866406.8A CN113570369B (en) | 2021-07-29 | 2021-07-29 | Block chain privacy transaction method, device, equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113570369A true CN113570369A (en) | 2021-10-29 |
CN113570369B CN113570369B (en) | 2024-05-28 |
Family
ID=78169165
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110866406.8A Active CN113570369B (en) | 2021-07-29 | 2021-07-29 | Block chain privacy transaction method, device, equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113570369B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114596092A (en) * | 2022-02-24 | 2022-06-07 | 成都质数斯达克科技有限公司 | Charging method, device and equipment based on block chain and readable storage medium |
Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108781161A (en) * | 2016-02-23 | 2018-11-09 | 区块链控股有限公司 | Method for controlling and distributing blockchain implementation of digital content |
US10320569B1 (en) * | 2018-04-05 | 2019-06-11 | HOTYB, Inc. | Systems and methods for authenticating a digitally signed assertion using verified evaluators |
CN110149322A (en) * | 2019-05-06 | 2019-08-20 | 山东公链信息科技有限公司 | A kind of block chain encryption method that irreversible dynamic failure re-examination is rebuild |
CN110147996A (en) * | 2019-05-21 | 2019-08-20 | 中央财经大学 | A kind of data trade localization difference method for secret protection and device based on block chain |
CN110392888A (en) * | 2017-01-16 | 2019-10-29 | E·马伊姆 | Method and system for executing smart contracts in a secure environment |
CN110473105A (en) * | 2019-08-20 | 2019-11-19 | 深圳市网心科技有限公司 | A kind of block chain transaction settlement method, system and relevant device |
CN110569668A (en) * | 2019-09-11 | 2019-12-13 | 北京邮电大学 | Block chain-based data encryption storage method, device, equipment and medium |
CN110610442A (en) * | 2019-09-09 | 2019-12-24 | 深圳四方精创资讯股份有限公司 | Traffic accident handling method, device and system based on block chain and storage medium |
CN110659110A (en) * | 2018-06-28 | 2020-01-07 | 厦门本能管家科技有限公司 | Block chain based distributed computing method and system |
CN110719176A (en) * | 2019-10-22 | 2020-01-21 | 黑龙江工业学院 | Blockchain-based logistics privacy protection method, system and readable storage medium |
CN111126988A (en) * | 2019-12-24 | 2020-05-08 | 深圳前海微众银行股份有限公司 | Block chain-based transfer method, device, equipment and computer medium |
CN111192054A (en) * | 2020-04-15 | 2020-05-22 | 傲林科技有限公司 | Multi-block chain linkage method and device and storage medium |
CN111371785A (en) * | 2020-03-02 | 2020-07-03 | 杭州溪塔科技有限公司 | Block chain privacy transaction method and device and electronic equipment |
CN111585767A (en) * | 2020-04-30 | 2020-08-25 | 卓尔智联(武汉)研究院有限公司 | Data exchange method and device for main chain and side chain |
CN112150144A (en) * | 2020-08-12 | 2020-12-29 | 江苏大学 | Block chain anonymous transaction method based on cross-node multi-hop payment |
CN112911002A (en) * | 2021-02-02 | 2021-06-04 | 上海华盖科技发展股份有限公司 | Block chain data sharing encryption method |
CN113128999A (en) * | 2019-12-31 | 2021-07-16 | 航天信息股份有限公司 | Block chain privacy protection method and device |
-
2021
- 2021-07-29 CN CN202110866406.8A patent/CN113570369B/en active Active
Patent Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108781161A (en) * | 2016-02-23 | 2018-11-09 | 区块链控股有限公司 | Method for controlling and distributing blockchain implementation of digital content |
CN110392888A (en) * | 2017-01-16 | 2019-10-29 | E·马伊姆 | Method and system for executing smart contracts in a secure environment |
US10320569B1 (en) * | 2018-04-05 | 2019-06-11 | HOTYB, Inc. | Systems and methods for authenticating a digitally signed assertion using verified evaluators |
CN110659110A (en) * | 2018-06-28 | 2020-01-07 | 厦门本能管家科技有限公司 | Block chain based distributed computing method and system |
CN110149322A (en) * | 2019-05-06 | 2019-08-20 | 山东公链信息科技有限公司 | A kind of block chain encryption method that irreversible dynamic failure re-examination is rebuild |
CN110147996A (en) * | 2019-05-21 | 2019-08-20 | 中央财经大学 | A kind of data trade localization difference method for secret protection and device based on block chain |
CN110473105A (en) * | 2019-08-20 | 2019-11-19 | 深圳市网心科技有限公司 | A kind of block chain transaction settlement method, system and relevant device |
CN110610442A (en) * | 2019-09-09 | 2019-12-24 | 深圳四方精创资讯股份有限公司 | Traffic accident handling method, device and system based on block chain and storage medium |
CN110569668A (en) * | 2019-09-11 | 2019-12-13 | 北京邮电大学 | Block chain-based data encryption storage method, device, equipment and medium |
CN110719176A (en) * | 2019-10-22 | 2020-01-21 | 黑龙江工业学院 | Blockchain-based logistics privacy protection method, system and readable storage medium |
CN111126988A (en) * | 2019-12-24 | 2020-05-08 | 深圳前海微众银行股份有限公司 | Block chain-based transfer method, device, equipment and computer medium |
CN113128999A (en) * | 2019-12-31 | 2021-07-16 | 航天信息股份有限公司 | Block chain privacy protection method and device |
CN111371785A (en) * | 2020-03-02 | 2020-07-03 | 杭州溪塔科技有限公司 | Block chain privacy transaction method and device and electronic equipment |
CN111192054A (en) * | 2020-04-15 | 2020-05-22 | 傲林科技有限公司 | Multi-block chain linkage method and device and storage medium |
CN111585767A (en) * | 2020-04-30 | 2020-08-25 | 卓尔智联(武汉)研究院有限公司 | Data exchange method and device for main chain and side chain |
CN112150144A (en) * | 2020-08-12 | 2020-12-29 | 江苏大学 | Block chain anonymous transaction method based on cross-node multi-hop payment |
CN112911002A (en) * | 2021-02-02 | 2021-06-04 | 上海华盖科技发展股份有限公司 | Block chain data sharing encryption method |
Non-Patent Citations (1)
Title |
---|
柳晶婷: "基于区块链技术的P2P网贷平台风险控制与评估研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 07, 15 July 2020 (2020-07-15), pages 138 - 489 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114596092A (en) * | 2022-02-24 | 2022-06-07 | 成都质数斯达克科技有限公司 | Charging method, device and equipment based on block chain and readable storage medium |
CN114596092B (en) * | 2022-02-24 | 2024-05-28 | 成都质数斯达克科技有限公司 | Charging method, device and equipment based on blockchain and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113570369B (en) | 2024-05-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220084022A1 (en) | Multi-approval system using m of n keys to restore a customer wallet | |
US20230093581A1 (en) | Method for directly transferring electronic coin data sets between terminals, payment system, currency system and monitoring unit | |
JP3329432B2 (en) | Hierarchical electronic cash execution method and apparatus used therefor | |
CN113468602B (en) | Data inspection method, device and equipment | |
US20060123465A1 (en) | Method and system of authentication on an open network | |
WO1981002655A1 (en) | A system for authenticating users and devices in on-line transaction networks | |
US20230259899A1 (en) | Method, participant unit, transaction register and payment system for managing transaction data sets | |
CN109978533B (en) | Offline secure payment system and method for resisting two-dimension code theft | |
CN116720839B (en) | Financial information management method based on blockchain technology and supervision system thereof | |
CN113595724B (en) | Block chain-based accounting method, device, equipment and readable storage medium | |
KR102085997B1 (en) | Method and system for real estate transaction service based on block chain | |
KR102376783B1 (en) | The blockchain-based transaction history confirmation system | |
US20230091509A1 (en) | Method for directly transmitting electronic coin datasets between terminals, payment system, protection system and monitoring entity | |
CN113570369B (en) | Block chain privacy transaction method, device, equipment and readable storage medium | |
WO2019035470A2 (en) | Data structure, transmission device, reception device, settlement device, method, and computer program | |
CN114841684B (en) | Digital currency dual offline transaction method based on security unit and trusted execution environment | |
US20230267426A1 (en) | Payment system, coin register, participant unit, transaction register, monitoring register and method for payment with electronic coin data sets | |
EP3667595B1 (en) | Virtual currency data issuing system, user terminal, management device, method, and computer program | |
CN114418769A (en) | Block chain transaction charging method and device and readable storage medium | |
CN113592650B (en) | Transaction method, device and equipment based on blockchain intelligent contract | |
CN113570370B (en) | UTXO-based blockchain transaction supervision method and device and readable storage medium | |
US20240403869A1 (en) | Systems and methods for generation and use of a distributed private key with a distributed ledger network | |
US20230141014A1 (en) | System and method for distribution of digital currency using a centralized system | |
EP4440029A1 (en) | Cryptographic service provision | |
EP4432141A1 (en) | Credential management in a decentralized heterogeneous transaction system |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |