CN113298508B - Digital currency transaction method and system - Google Patents
Digital currency transaction method and system Download PDFInfo
- Publication number
- CN113298508B CN113298508B CN202110672626.7A CN202110672626A CN113298508B CN 113298508 B CN113298508 B CN 113298508B CN 202110672626 A CN202110672626 A CN 202110672626A CN 113298508 B CN113298508 B CN 113298508B
- Authority
- CN
- China
- Prior art keywords
- transaction
- information
- transaction information
- signed
- transaction device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000012795 verification Methods 0.000 claims abstract description 25
- 230000002776 aggregation Effects 0.000 claims abstract description 21
- 238000004220 aggregation Methods 0.000 claims abstract description 21
- 238000004590 computer program Methods 0.000 claims description 10
- 238000006243 chemical reaction Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 abstract description 11
- 230000006399 behavior Effects 0.000 abstract description 5
- 230000004931 aggregating effect Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 15
- 238000004891 communication Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000015572 biosynthetic process Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000003795 chemical substances by application Substances 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 241000408529 Libra Species 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000013467 fragmentation Methods 0.000 description 1
- 238000006062 fragmentation reaction Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000013011 mating Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
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
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/04—Payment circuits
- G06Q20/06—Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
- G06Q20/065—Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
-
- 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/08—Payment architectures
- G06Q20/10—Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
-
- 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
-
- 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/40—Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
- G06Q20/401—Transaction verification
-
- 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
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Engineering & Computer Science (AREA)
- Finance (AREA)
- General Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- Strategic Management (AREA)
- Theoretical Computer Science (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Computer Security & Cryptography (AREA)
- Marketing (AREA)
- Technology Law (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention discloses a digital currency transaction method and a digital currency transaction system, and relates to the technical field of computers. One embodiment of the method comprises the following steps: the method comprises the steps of matching transactions between first transaction equipment and second transaction equipment through a matching device to generate transaction information, adding respective signatures to the transaction information by the first transaction equipment and the second transaction equipment to obtain signed transaction information with the signatures of both parties, carrying out transaction verification on the signed transaction information by using each accounting node of a distributed accounting system to obtain verified transaction information, respectively aggregating the verified transaction information of the distributed accounting system by the first transaction equipment and the second transaction equipment, and updating account information of a corresponding transaction party by the distributed accounting system according to an aggregation result. According to the embodiment, the control of transaction funds by both transaction parties can be ensured, and malicious behaviors of the matchmaker in the transaction process are avoided, so that the security of digital currency transaction is effectively ensured.
Description
Technical Field
The present invention relates to the field of computer technology, and in particular, to a digital currency transaction method and system.
Background
With the rapid development of science and technology, particularly the wide application of internet technology, the transaction mode in the global scope has changed greatly, various electronic currencies, virtual digital currencies, digital currency products and transaction schemes thereof are endless, and in the current digital currency project, the scheme and protocol for improving the transaction performance are continuously emerging, but no good solution exists on how to avoid the malicious behaviors of the matchmaker in the transaction process.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
the existing scheme can not ensure that both parties of the transaction control the transaction funds, and the possibility that the matchmaker is wrongly involved in the transaction process exists, so that the security of the digital currency transaction can not be ensured.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a digital currency transaction method and a digital currency transaction system, which can ensure that both parties of the transaction control funds of the transaction, avoid malicious behaviors of a matchmaker in the transaction process, and further effectively ensure the security of the digital currency transaction.
To achieve the above object, according to one aspect of an embodiment of the present invention, there is provided a digital money transaction method.
A digital money transaction method, comprising: matching the transaction between the first transaction device and the second transaction device through the matching device so as to generate transaction information; the first transaction device and the second transaction device add respective signatures to the transaction information to obtain signed transaction information with the signatures of the first transaction device and the second transaction device; carrying out transaction verification on the signed transaction information by using each accounting node of the distributed accounting system to obtain verified transaction information; the first transaction device and the second transaction device aggregate the verified transaction information of the distributed accounting system respectively; updating account information of a corresponding transaction party by the distributed accounting system according to the aggregation result sent by the first transaction device and the second transaction device, wherein the transaction party is the first transaction device or the second transaction device.
Optionally, the first transaction device and the second transaction device add respective signatures to the transaction information to obtain signed transaction information with signatures of both the first transaction device and the second transaction device, including: the first transaction device and the second transaction device respectively receive the transaction information returned by the matching device; the first transaction device generates first transaction information to be signed according to the transaction information and a transaction serial number corresponding to the transaction information in the first transaction device, adds a signature of the first transaction device to the first transaction information to be signed to obtain first signature transaction information, and sends the first signature transaction information to the second transaction device; the second transaction device generates second transaction information to be signed according to the first signature transaction information and the transaction serial number corresponding to the transaction information in the second transaction device, adds the signature of the second transaction device to the second transaction information to be signed, obtains the signed transaction information, and sends the signed transaction information to the distributed accounting system.
Optionally, the transaction verification of the signed transaction information by each billing node of the distributed billing system includes: and each billing node respectively verifies the item to be verified in the signed transaction information, adds a billing node signature to the signed transaction information after the item to be verified passes the verification, obtains the verified transaction information, and returns the verified transaction information to the first transaction device and the second transaction device.
Optionally, the item to be verified in the signed transaction information includes: the first transaction device and the second transaction device are signed by both sides, account amount information of both sides, incomplete transaction information of both sides and transaction serial numbers of both sides.
Optionally, the first transaction device and the second transaction device aggregate the validated transaction information of the distributed billing system, respectively, including: the first transaction device and the second transaction device aggregate the verified transaction information under the condition that the quantity of the received verified transaction information is larger than a preset value, and the aggregation comprises the generation of a joint signature according to the accounting node signature in each piece of the received verified transaction information; the first transaction device and the second transaction device respectively send the generated joint signatures to the distributed accounting system as the result of aggregation.
Optionally, the transaction between the first transaction device and the second transaction device is a digital currency conversion.
According to another aspect of an embodiment of the present invention, a digital money transaction system is provided.
A digital money transaction system, comprising: the system comprises a matching device, first transaction equipment, second transaction equipment and a distributed accounting system; wherein: the matching device is used for matching the transaction between the first transaction equipment and the second transaction equipment so as to generate transaction information; the first transaction device and the second transaction device are used for adding respective signatures to the transaction information to obtain signed transaction information with the signatures of the first transaction device and the second transaction device; the distributed accounting system is used for carrying out transaction verification on the signed transaction information through each accounting node to obtain verified transaction information; the first transaction device and the second transaction device are further configured to aggregate the validated transaction information of the distributed billing system, respectively; the distributed accounting system is further used for updating account information of a corresponding transaction party according to the aggregation result, wherein the transaction party is the first transaction device or the second transaction device.
Optionally, the first transaction device and the second transaction device are further configured to receive the transaction information returned by the matching device respectively; the first transaction device is further configured to generate first transaction information to be signed according to the transaction information and a transaction sequence number corresponding to the transaction information in the first transaction device, add a signature of the first transaction device to the first transaction information to be signed, obtain first signature transaction information, and send the first signature transaction information to the second transaction device; the second transaction device is further configured to generate second transaction information to be signed according to the first signature transaction information and a transaction sequence number corresponding to the transaction information in the second transaction device, add a signature of the second transaction device to the second transaction information to be signed, obtain the signed transaction information, and send the signed transaction information to the distributed accounting system.
Optionally, the distributed accounting system is further configured to verify the item to be verified in the signed transaction information through each accounting node, and for each accounting node, after the item to be verified is verified, add an accounting node signature to the signed transaction information to obtain the verified transaction information, and return the verified transaction information to the first transaction device and the second transaction device.
Optionally, the item to be verified in the signed transaction information includes: the first transaction device and the second transaction device are signed by both sides, account amount information of both sides, incomplete transaction information of both sides and transaction serial numbers of both sides.
Optionally, the first transaction device and the second transaction device are further configured to aggregate the verified transaction information if the number of the received verified transaction information is greater than a preset value, where the aggregation includes generating a joint signature according to the accounting node signature in each of the received verified transaction information; the first transaction device and the second transaction device are further configured to send the generated joint signatures to the distributed accounting system as a result of the aggregation.
According to yet another aspect of an embodiment of the present invention, an electronic device is provided.
An electronic device, comprising: one or more processors; and a memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the digital money transaction method provided by the embodiments of the present invention.
According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer readable medium having stored thereon a computer program which when executed by a processor implements a digital money transaction method provided by an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of matching transactions between first transaction equipment and second transaction equipment through a matching device to generate transaction information, adding respective signatures to the transaction information by the first transaction equipment and the second transaction equipment to obtain signed transaction information with the signatures of the first transaction equipment and the second transaction equipment, carrying out transaction verification on the signed transaction information by using each accounting node of a distributed accounting system to obtain verified transaction information, respectively aggregating the verified transaction information returned by the distributed accounting system by the first transaction equipment and the second transaction equipment, and updating account information of a corresponding transaction party by the distributed accounting system according to an aggregation result. The control of transaction funds by both transaction parties can be ensured, and malicious behaviors of the matchmaker in the transaction process are avoided, so that the security of digital currency transaction is effectively ensured.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a digital money transaction method according to one embodiment of the invention;
FIG. 2 is a schematic diagram of a digital money transaction flow according to one embodiment of the invention;
FIG. 3 is a schematic flow diagram of an implementation of a digital currency conversion protocol according to one embodiment of the present invention;
FIG. 4 is a schematic diagram of the principal components of a digital money transaction system according to one embodiment of the invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 6 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 is a schematic diagram of the main steps of a digital money transaction method according to one embodiment of the invention.
As shown in fig. 1, the digital money transaction method according to an embodiment of the present invention mainly includes the following steps S101 to S105.
Step S101: matching the transaction between the first transaction device and the second transaction device through the matching device so as to generate transaction information;
the transaction information may include transaction amount, information of both parties to the transaction, and so forth.
Step S102: the first transaction device and the second transaction device add respective signatures to the transaction information to obtain signed transaction information with the signatures of the first transaction device and the second transaction device;
step S103: carrying out transaction verification on the signed transaction information by utilizing each accounting node of the distributed accounting system to obtain verified transaction information;
step S104: the first transaction device and the second transaction device respectively aggregate the verified transaction information returned by the distributed accounting system;
step S105: updating account information of the corresponding transaction party by the distributed accounting system according to the aggregation result, wherein the transaction party is the first transaction device or the second transaction device. The step of adding respective signatures to the transaction information by the first transaction device and the second transaction device to obtain signed transaction information with the signatures of the two parties of the first transaction device and the second transaction device specifically comprises the following steps: the first transaction device and the second transaction device respectively receive the transaction information returned by the matching device; the first transaction device generates first transaction information to be signed according to the transaction information and a transaction serial number corresponding to the transaction information in the first transaction device, adds a signature of the first transaction device to the first transaction information to be signed to obtain first signature transaction information, and sends the first signature transaction information to the second transaction device; the second transaction device generates second transaction information to be signed according to the first transaction information to be signed and the corresponding transaction serial number of the transaction information in the second transaction device, adds the signature of the second transaction device to the second transaction information to be signed to obtain signed transaction information, and sends the signed transaction information to the distributed accounting system.
The step of transaction verification of the signed transaction information by each accounting node of the distributed accounting system specifically comprises the following steps: each billing node respectively verifies the item to be verified in the signed transaction information, and for each billing node, after the item to be verified passes the verification, the billing node signature is added to the signed transaction information to obtain verified transaction information, and the verified transaction information is returned to the first transaction device and the second transaction device.
The item to be verified in the signed transaction information may include: the signature of the first transaction device and the second transaction device, account amount information of the two parties, unfinished transaction information of the two parties and transaction serial numbers of the two parties.
The method comprises the steps that first transaction equipment and second transaction equipment respectively aggregate verified transaction information returned by a distributed accounting system, and specifically, under the condition that the number of the received verified transaction information is larger than a preset value, the first transaction equipment and the second transaction equipment respectively aggregate the verified transaction information, wherein the aggregation comprises the step of generating joint signatures according to accounting node signatures in the received verified transaction information; the first transaction device and the second transaction device each use the respective generated joint signature as a result of the aggregation and send to the distributed accounting system.
The aggregation includes generating a joint signature according to the received accounting node signature in each verified transaction information, and specifically, the joint signature can be obtained by splicing the accounting node signatures in each verified transaction information.
In one embodiment, the transaction between the first transaction device and the second transaction device is a digital currency conversion.
FIG. 2 is a schematic diagram of a digital money transaction flow according to one embodiment of the invention.
As shown in fig. 2, the digital money transaction flow according to one embodiment of the present invention includes steps S201 to S204.
Step S201: the trading party sends the currency exchange trade quotation information to the matching device, and the matching device sends the trade information which can be exchanged to the trading party;
the transaction parties of the present embodiment are respectively designated as transaction party a and transaction party B, for example, the currency conversion transaction offer information of transaction party a may include offer information about y B tokens of transaction party B to be exchanged with x a tokens by transaction party a.
The matching device is a matching merchant, and is specifically a program for matching transactions.
Transaction party a is the first transaction device and transaction party B is the second transaction device.
Step S202: the transaction party A signs the transaction and sends the transaction to the transaction party B, and after the verification (specifically, the verification of the signature of the party A) is successful, the transaction party B signs the transaction on the basis of the transaction signature of the transaction party A and sends the transaction to the transaction party A and the FastPay committee;
the information which is sent to the transaction party B after the transaction party A signs the transaction is the first signed transaction information. After successful verification, the transaction party B signs the transaction on the basis of the transaction party A, and the obtained information is signed transaction information.
The FastPay Committee is a distributed billing system that consists of a plurality of billing nodes.
Step S203: the FastPay committee verifies the signed transaction information of both transaction parties, and the verified contents comprise the correctness of the signature, whether account funds are enough or not, and the like;
specifically, the accounting node can verify the to-be-verified item in the transaction information after the signature of the transaction both sides, the account funds and the like, and the signature of the accounting node is added after the verification is passed. The post-signature transaction information is the post-verification transaction information which is obtained after verification, and the post-verification transaction information is returned to the transaction party A and the transaction party B by the FastPay committee, wherein the post-verification transaction information comprises the signature of the accounting node.
Step S204: after receiving enough accounting node signatures, the transaction parties respectively aggregate to generate joint signatures, and the joint signatures are sent to the Fastpay committee, and the Fastpay committee updates account information of the transaction parties.
For example, the total number of accounting nodes is 3f+1, and enough accounting nodes are signed 2f+1.
The embodiment of the invention utilizes the centralized matching and the decentralization formation exchange to perform the centralized matching on the two transaction parties participating in the digital currency conversion by utilizing the matching quotient, and completes the decentralization formation exchange of the transaction by combining with a consensus mechanism in the FastPay scheme so as to ensure the safety and the high efficiency of the transaction.
Fig. 3 is a flow diagram of an implementation of a digital currency conversion protocol according to one embodiment of the present invention.
The embodiment of the invention provides a FastSwap protocol applied to digital currency conversion, and the security and the high efficiency of the transaction are ensured by 'centralizing matching and decentralizing formation transaction' based on the digital currency transaction flow of the FastSwap protocol.
As shown in fig. 3, the digital currency exchange protocol of the embodiment of the present invention relates to three roles of a matcher, a transaction party (transaction parties a and B), and a FastPay committee, and the matcher or the matcher device. Loopring is based on zkRollup (a two-Layer (Layer 2) dilatation scheme) technology based on zero knowledge proof, and the core idea is that Layer1 is only responsible for verifying a final result by using zero knowledge proof, and sequencing and packaging work is finished by Layer 2. The time required by the main chain to verify the zero knowledge proof is far lower than the time required by verifying each transaction once, so that the aim of Layer1 capacity expansion is effectively achieved. The FastPay Committee consists of accounting nodes. FastPay is the latest dilatation scheme of cross-border payment project Libra led by Facebook corporation, which supports efficient distributed billing, and the consensus mechanism can accommodate up to 1/3 of malicious billboards, while combined with the fragmentation technique, fastPay reaches 80000 in TPS (System throughput) in laboratory environment, which is already more efficient than traditional settlement systems. The digital currency exchange protocol of the present embodiment may use a bayer fault tolerance (Byzantine Fault Tolerance, BFT) consensus mechanism, assuming that the number of committee billing nodes in the system is 3f+1, when 2f+1 billing agents are honest, the security of the system can be ensured, and meanwhile, since there is no need for consensus among the billing agents, the efficiency of the system can be greatly improved. The Bayesian fault tolerance system aims to solve the problems of consistency, correctness and the like of a system when malicious nodes (namely Bayesian nodes) exist in a distributed system. Assuming that the distributed system has n nodes, and assuming that the Bayesian nodes of the whole system are not more than m, the Bayesian fault-tolerant system needs to satisfy two conditions: all non-bayer nodes use the same input information, produce the same result, if the input information is correct, all non-bayer nodes must receive this message and calculate the corresponding result. The bayer fault-tolerant system needs to achieve two indexes of safety and activity.
The implementation flow of the digital currency exchange protocol (FastSwap protocol) of the embodiment of the invention is as follows:
(1) first, transaction quotations (for example, A quotations, x a tokens, and y B tokens) are made by both parties A and B, and the quotation information, that is, the currency exchange transaction quotation information, is transmitted to the matchmaker.
(2) After judging that a pair of transaction parties can be successfully matched, the matchmaker sends transaction information which can be achieved to the transaction parties, namely: transaction information o= (a to B x a tokens and B to a to y B tokens), it should be noted that no transfer of any tokens (digital money) occurs at this time.
(3) Transaction party A transmits transaction information O and transaction serial number N A (N A For trade information at trade partyCorresponding transaction serial number in A) signature to generate < O, N A >Sig A Namely, the first signed transaction information, and sends the first signed transaction information to the transaction party B, and the transaction party B signs the first signed transaction information received from the transaction party a: o, N A >Sig A ,N B >Sig B Obtain the transaction information after signature, N B And the transaction serial number corresponds to the transaction information in the transaction party B.
(4) The transacting party B sends the signed transaction information to the FastPay committee and transacting party a.
(5) The accounting node in FastPay committee verifies the received signed transaction information signed by both parties to the transaction, including verifying the correctness of the signature of both parties to the transaction, whether the funds of the account of both parties to the transaction are sufficient, whether the transaction exists in the pending queue (the queue of both parties not completed the transaction), and whether the transaction sequence number value is correct. The post-signature transaction information is verified, signed by the post-accounting node and returned to the transaction parties A and B, and the information returned to the transaction parties A and B is the post-verification transaction information.
(6) After the transaction parties respectively receive the verified transaction information signed by 2f+1 (preset value) billed persons, the verified transaction information is aggregated to generate a joint signature C.
(7) The transaction parties respectively send the joint signature C to the FastPay committee, and the accounting node updates account information of the transaction parties.
In the FastSwap protocol of the embodiment of the invention, the matcher is only responsible for carrying out the matching, and the specific funds are transferred in the FastPay system by the accounting node in the FastPay committee, so that the control right of the funds is ensured to be completely mastered in the hands of both parties of the transaction, and the matcher is only responsible for the work in the aspect of information release, thereby avoiding the possibility that the matcher is wrongly involved in the transaction process.
Fig. 4 is a schematic diagram of the main constitution of a digital money transaction system according to an embodiment of the present invention.
As shown in fig. 4, the digital money transaction system 400 according to one embodiment of the present invention mainly includes: a matching means 401, a first transaction device 402, a second transaction device 403, a distributed accounting system 404; wherein:
the matching device is used for matching the transaction between the first transaction equipment and the second transaction equipment so as to generate transaction information;
the first transaction device and the second transaction device are used for adding respective signatures to the transaction information to obtain signed transaction information with the signatures of the two parties of the first transaction device and the second transaction device;
the distributed accounting system is used for carrying out transaction verification on the signed transaction information through each accounting node to obtain verified transaction information;
the first transaction device and the second transaction device are also used for respectively aggregating the verified transaction information returned by the distributed accounting system;
the distributed accounting system is further used for updating account information of a corresponding transaction party according to the aggregation result sent by the first transaction device and the second transaction device, wherein the transaction party is the first transaction device or the second transaction device.
The first transaction device and the second transaction device are specifically used for respectively receiving transaction information returned by the matching device; the first transaction device is further used for generating first transaction information to be signed according to the transaction information and the corresponding transaction serial number of the transaction information in the first transaction device, adding the signature of the first transaction device to the first transaction information to be signed to obtain first signature transaction information, and sending the first signature transaction information to the second transaction device; the second transaction device is further configured to generate second transaction information to be signed according to the first transaction information to be signed and a transaction serial number corresponding to the transaction information in the second transaction device, add a signature of the second transaction device to the second transaction information to be signed, obtain signed transaction information, and send the signed transaction information to the distributed accounting system.
The distributed accounting system is further used for verifying the to-be-verified items in the signed transaction information through each accounting node respectively, adding accounting node signatures to the signed transaction information after the to-be-verified items pass verification for each accounting node, obtaining verified transaction information, and returning the verified transaction information to the first transaction device and the second transaction device.
The item to be verified in the signed transaction information may include: the first transaction device and the second transaction device are signed by both sides, account amount information of both sides, unfinished transaction information of both sides and transaction serial numbers of both sides.
The first transaction device and the second transaction device may aggregate the authenticated transaction information when the number of the received authenticated transaction information is greater than a preset value, respectively, the aggregate including generating a joint signature based on the accounting node signature in each of the received authenticated transaction information. And the first transaction device and the second transaction device each use the respective generated joint signature as a result of the aggregation and send to the distributed accounting system.
In one embodiment, the transaction between the first transaction device and the second transaction device is a digital currency conversion.
In addition, the implementation of the digital money transaction system in the embodiment of the present invention has been described in detail in the above digital money transaction method, and thus, the description thereof will not be repeated here.
Fig. 5 illustrates an exemplary system architecture 500 for a digital money transaction method or digital money transaction system to which embodiments of the invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 505 via the network 504 using the terminal devices 501, 502, 503 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 501, 502, 503, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using the terminal devices 501, 502, 503. The background management server may analyze and process the received data such as the product information query request, and feed back the processing result (e.g., transaction information—only an example) to the terminal device.
It should be noted that, the digital money transaction method provided by the embodiment of the present invention is generally executed by the server 505 and the terminal devices 501, 502, 503, and accordingly, the digital money transaction system includes the server 505 and the terminal devices 501, 502, 503.
It should be understood that the number of terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing a terminal device or server of an embodiment of the present application. The terminal device or server illustrated in fig. 6 is merely an example, and should not impose any limitation on the functionality and scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 601.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The apparatus described in the embodiments of the present invention may be implemented by software or by hardware. The described apparatus may also be provided in a processor, for example, described as: a processor includes a mating device. The name of the device does not in any way constitute a limitation of the device itself, for example, the matching device may also be described as "a device for matching a transaction between the first transaction device and the second transaction device to generate transaction information".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: matching the transaction between the first transaction device and the second transaction device through the matching device so as to generate transaction information; the first transaction device and the second transaction device add respective signatures to the transaction information to obtain signed transaction information with the signatures of the first transaction device and the second transaction device; carrying out transaction verification on the signed transaction information by using each accounting node of the distributed accounting system to obtain verified transaction information; the first transaction device and the second transaction device aggregate the verified transaction information of the distributed accounting system respectively; updating account information of a corresponding transaction party by the distributed accounting system according to the aggregation result sent by the first transaction device and the second transaction device, wherein the transaction party is the first transaction device or the second transaction device.
According to the technical scheme of the embodiment of the invention, the matching device is used for matching the transaction between the first transaction device and the second transaction device so as to generate transaction information, the first transaction device and the second transaction device are used for adding respective signatures to the transaction information to obtain signed transaction information with the signatures of the first transaction device and the second transaction device, each accounting node of the distributed accounting system is used for carrying out transaction verification on the signed transaction information to obtain verified transaction information, the first transaction device and the second transaction device are used for respectively aggregating the verified transaction information returned by the distributed accounting system, and the distributed accounting system is used for updating the account information of the corresponding transaction party according to the aggregation result. The control of transaction funds by both transaction parties can be ensured, and malicious behaviors of the matchmaker in the transaction process are avoided, so that the security of digital currency transaction is effectively ensured.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (11)
1. A digital money transaction method, comprising:
matching the transaction between the first transaction device and the second transaction device through the matching device so as to generate transaction information;
the first transaction device and the second transaction device add respective signatures to the transaction information to obtain signed transaction information with the signatures of the first transaction device and the second transaction device;
carrying out transaction verification on the signed transaction information by using each accounting node of a distributed accounting system to obtain verified transaction information, and returning the verified transaction information to the first transaction device and the second transaction device;
the first transaction device and the second transaction device aggregate the verified transaction information of the distributed accounting system respectively;
updating account information of a corresponding transaction party by the distributed accounting system according to the aggregation result sent by the first transaction device and the second transaction device, wherein the transaction party is the first transaction device or the second transaction device;
wherein the first transaction device and the second transaction device aggregate the validated transaction information of the distributed billing system, respectively, comprising: the first transaction device and the second transaction device aggregate the verified transaction information under the condition that the quantity of the received verified transaction information is larger than a preset value, and the aggregation comprises the generation of a joint signature according to the accounting node signature in each piece of the received verified transaction information; the first transaction device and the second transaction device respectively send the generated joint signatures to the distributed accounting system as the result of aggregation.
2. The method of claim 1, wherein the first transaction device and the second transaction device add respective signatures to the transaction information to obtain signed transaction information with both the first transaction device and the second transaction device signatures, comprising:
the first transaction device and the second transaction device respectively receive the transaction information returned by the matching device;
the first transaction device generates first transaction information to be signed according to the transaction information and a transaction serial number corresponding to the transaction information in the first transaction device, adds a signature of the first transaction device to the first transaction information to be signed to obtain first signature transaction information, and sends the first signature transaction information to the second transaction device;
the second transaction device generates second transaction information to be signed according to the first signature transaction information and the transaction serial number corresponding to the transaction information in the second transaction device, adds the signature of the second transaction device to the second transaction information to be signed, obtains the signed transaction information, and sends the signed transaction information to the distributed accounting system.
3. The method of claim 1, wherein said transaction verification of said signed transaction information with each billing node of a distributed billing system comprises:
and each billing node respectively verifies the item to be verified in the signed transaction information, and for each billing node, after the item to be verified is verified, the billing node signature is added to the signed transaction information to obtain the verified transaction information.
4. A method according to claim 3, wherein the item to be verified in the signed transaction information comprises: the first transaction device and the second transaction device are signed by both sides, account amount information of both sides, incomplete transaction information of both sides and transaction serial numbers of both sides.
5. The method of claim 1, wherein the transaction between the first transaction device and the second transaction device is a digital currency conversion.
6. A digital money transaction system, comprising: the system comprises a matching device, first transaction equipment, second transaction equipment and a distributed accounting system; wherein:
the matching device is used for matching the transaction between the first transaction equipment and the second transaction equipment so as to generate transaction information;
the first transaction device and the second transaction device are used for adding respective signatures to the transaction information to obtain signed transaction information with the signatures of the first transaction device and the second transaction device;
the distributed accounting system is used for carrying out transaction verification on the signed transaction information through each accounting node to obtain verified transaction information;
the first transaction device and the second transaction device are further configured to aggregate the validated transaction information of the distributed billing system, respectively;
the distributed accounting system is further used for updating account information of a corresponding transaction party according to the aggregation result, wherein the transaction party is the first transaction device or the second transaction device;
wherein the distributed billing system is further configured to return the validated transaction information to the first transaction device and the second transaction device; the first transaction device and the second transaction device are further configured to aggregate the verified transaction information when the number of the received verified transaction information is greater than a preset value, where the aggregate includes generating a joint signature according to the accounting node signature in each of the received verified transaction information; the first transaction device and the second transaction device are further configured to send the generated joint signatures to the distributed accounting system as a result of the aggregation.
7. The system of claim 6, wherein the first transaction device and the second transaction device are further configured to receive the transaction information returned by the matching device, respectively;
the first transaction device is further configured to generate first transaction information to be signed according to the transaction information and a transaction sequence number corresponding to the transaction information in the first transaction device, add a signature of the first transaction device to the first transaction information to be signed, obtain first signature transaction information, and send the first signature transaction information to the second transaction device;
the second transaction device is further configured to generate second transaction information to be signed according to the first signature transaction information and a transaction sequence number corresponding to the transaction information in the second transaction device, add a signature of the second transaction device to the second transaction information to be signed, obtain the signed transaction information, and send the signed transaction information to the distributed accounting system.
8. The system of claim 6, wherein the distributed billing system is further configured to verify the item to be verified in the signed transaction message by the billing nodes, respectively, and to add a billing node signature to the signed transaction message after the item to be verified is verified by each billing node, to obtain the verified transaction message.
9. The system of claim 8, wherein the item to be verified in the signed transaction information comprises: the first transaction device and the second transaction device are signed by both sides, account amount information of both sides, incomplete transaction information of both sides and transaction serial numbers of both sides.
10. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
11. A computer readable medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110672626.7A CN113298508B (en) | 2021-06-17 | 2021-06-17 | Digital currency transaction method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110672626.7A CN113298508B (en) | 2021-06-17 | 2021-06-17 | Digital currency transaction method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113298508A CN113298508A (en) | 2021-08-24 |
CN113298508B true CN113298508B (en) | 2024-03-22 |
Family
ID=77328562
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110672626.7A Active CN113298508B (en) | 2021-06-17 | 2021-06-17 | Digital currency transaction method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113298508B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108596619A (en) * | 2018-04-26 | 2018-09-28 | 深圳怡化电脑股份有限公司 | For the method for commerce of block catenary system, device, Centroid and system |
CN109961286A (en) * | 2017-12-26 | 2019-07-02 | 库币科技有限公司 | Digital asset method of commerce |
WO2020022531A1 (en) * | 2018-07-23 | 2020-01-30 | 주식회사 더볼터 | Method and system for dynamic time delay-based chain connection in pop-based blockchain |
CN111445334A (en) * | 2020-03-30 | 2020-07-24 | 北京数字认证股份有限公司 | Aggregation signature method and device for block chain system and storage medium |
CN111612453A (en) * | 2019-02-22 | 2020-09-01 | 北京趣块远扬科技有限公司 | Decentralized transaction method and device based on block chain and electronic equipment |
CN112734421A (en) * | 2020-12-23 | 2021-04-30 | 巨建华 | Asset hosting and clearing method and system based on three-party multi-signature and credible signature transaction |
-
2021
- 2021-06-17 CN CN202110672626.7A patent/CN113298508B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109961286A (en) * | 2017-12-26 | 2019-07-02 | 库币科技有限公司 | Digital asset method of commerce |
CN108596619A (en) * | 2018-04-26 | 2018-09-28 | 深圳怡化电脑股份有限公司 | For the method for commerce of block catenary system, device, Centroid and system |
WO2020022531A1 (en) * | 2018-07-23 | 2020-01-30 | 주식회사 더볼터 | Method and system for dynamic time delay-based chain connection in pop-based blockchain |
CN111612453A (en) * | 2019-02-22 | 2020-09-01 | 北京趣块远扬科技有限公司 | Decentralized transaction method and device based on block chain and electronic equipment |
CN111445334A (en) * | 2020-03-30 | 2020-07-24 | 北京数字认证股份有限公司 | Aggregation signature method and device for block chain system and storage medium |
CN112734421A (en) * | 2020-12-23 | 2021-04-30 | 巨建华 | Asset hosting and clearing method and system based on three-party multi-signature and credible signature transaction |
Also Published As
Publication number | Publication date |
---|---|
CN113298508A (en) | 2021-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7512294B2 (en) | COMPUTER-IMPLEMENTED SYSTEM AND METHOD FOR PERFORMING TRANSFERS VIA A BLOCKCHAIN NETWORK | |
US10592985B2 (en) | Systems and methods for a commodity contracts market using a secure distributed transaction ledger | |
CN109146490B (en) | Block generation method, device and system | |
Ferrer-Gomila et al. | A fair contract signing protocol with blockchain support | |
CN113657900B (en) | Cross-chain transaction verification method and system and cross-chain transaction system | |
JP2022533396A (en) | Blockchain consensus method, device and system | |
CN109831501B (en) | Information distribution method and system based on block chain | |
CN110874742B (en) | Payment method and device based on block chain and intelligent contract | |
US20240281802A1 (en) | Digital Currency-Based Payment Method, Platform and System, and Terminal | |
CN110400217A (en) | The regular changing process method and device of intelligent contract | |
CN110599264A (en) | Card and ticket data processing method and device and electronic equipment | |
CN113873004A (en) | Task execution method and device and distributed computing system | |
CN112101919A (en) | Data processing method and device, electronic equipment and storage medium | |
EP4131112A1 (en) | Electronic wallet and method for atomic swapping of two different blockchain tokens by using electronic wallet | |
CN113298508B (en) | Digital currency transaction method and system | |
CN117952747A (en) | Block chain-based equity voucher transaction method, device, equipment and readable medium | |
Zaman et al. | Design of a Peer-to-Peer Energy Trading Platform Using Multilayered Semi-Permissioned Blockchain | |
CN112968769A (en) | Method and device for generating random number in block chain | |
CN111857876A (en) | Service processing method and device, electronic equipment and computer readable medium | |
US20240193594A1 (en) | Method, Terminal and System for Splitting and Managing Digital Currency in Transaction | |
US12126732B2 (en) | Blockchain consensus method, device and system | |
CN115103034A (en) | Message protocol conversion method and device | |
CN113592644A (en) | Transaction method and device based on block chain UTXO model | |
CN115222528A (en) | Method, terminal and system for splitting digital currency in transaction process | |
CN113643157A (en) | Intelligent contract execution method and device |
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 |