Disclosure of Invention
The invention mainly aims to provide a block chain-based digital currency transaction method and a related device, so as to solve the problems of privacy of both transaction parties and transaction information leakage caused by the adoption of the prior art for digital currency transaction.
In order to achieve the above object, the following solutions are proposed:
the invention provides a block chain-based digital currency transaction method in a first aspect, which comprises the following steps:
exchanging the de-blinded privacy currency into a first stable currency on a first blockchain, wherein the first stable currency and a reference currency have a first fixed exchange rate, and the first blockchain executes transaction based on a UTXO model;
exchanging the first stable currency with a second stable currency on a second blockchain based on a second fixed exchange rate, wherein the first stable currency and the second stable currency have the second fixed exchange rate therebetween, and the second blockchain executes a transaction based on an Account model;
exchanging the second stable currency to a target currency based on a smart contract, the second stable currency having a third fixed exchange rate with the reference currency.
Optionally, the process of unblinding the privacy currency includes:
and executing de-blinding operation on the privacy currency based on a currency mixing strategy to obtain the de-blinded privacy currency.
Optionally, the performing, based on the mixed banknote policy, a blind removal operation on the privacy banknote to obtain a blind-removed privacy banknote includes:
acquiring a plurality of UTXO addresses corresponding to the privacy currency, wherein the plurality of UTXO addresses comprise the real UTXO address and the non-real UTXO address;
and acquiring a real UTXO address from the plurality of UTXO addresses based on the public UTXO input address and the mixed coin strategy to obtain the de-blinded privacy coin.
Optionally, the swapping the first stable currency for a second stable currency on a second blockchain based on a second fixed exchange rate includes:
and exchanging the first stable currency with a second stable currency on a second block chain according to a second fixed exchange rate in a Hash Lock mode.
In a second aspect, the present invention discloses a digital currency conversion apparatus based on a blockchain, the digital currency conversion apparatus comprising:
the first exchange unit is used for exchanging the privacy currency after the blinding removal into a first stable currency on a first blockchain, wherein a first fixed exchange rate is formed between the first stable currency and a reference currency, and the first blockchain executes transaction based on a UTXO model;
the second exchange unit is used for exchanging the first stable currency into a second stable currency on a second blockchain based on a second fixed exchange rate, the first stable currency and the second stable currency have the second fixed exchange rate, and the second blockchain executes the transaction based on an Account model;
and the third exchange unit is used for exchanging the second stable currency into the target currency based on the intelligent contract, and the second stable currency and the reference currency have a third fixed exchange rate.
Optionally, the first exchanging unit is further configured to obtain a plurality of UTXO addresses corresponding to the private coin, where the plurality of UTXO addresses include the real UTXO address and the non-real UTXO address, and obtain the real UTXO address from the plurality of UTXO addresses based on the public UTXO input address and the coin mixing policy, so as to obtain the unblinded private coin.
Optionally, the second exchanging unit is specifically configured to exchange the first stable currency with a second stable currency on a second block chain according to a second fixed exchange rate in a Hash Lock mode.
In a third aspect, the invention discloses a blockchain-based digital currency conversion apparatus, which includes a memory and a processor, wherein the memory stores thereon a blockchain-based digital currency conversion program that can run on the processor, and when being executed by the processor, the blockchain-based digital currency conversion program implements the blockchain-based digital currency conversion method as disclosed in the first aspect of the invention.
A fourth aspect of the present invention discloses a computer-readable storage medium storing a blockchain-based digital currency conversion program executable by one or more processors to implement the method for blockchain-based digital currency conversion as disclosed in the first aspect of the present invention.
A fourth aspect of the present invention discloses a computer program product comprising computer instructions which, when run on a computer, cause the computer to perform the blockchain-based digital currency conversion method as disclosed in the first aspect of the present invention above.
According to the technical scheme, the invention discloses a block chain-based digital currency transaction method and a related device, a blinded privacy currency is exchanged into a first stable currency on a first block chain, a first fixed exchange rate is provided between the first stable currency and reference currency, and the first block chain executes transaction based on an unspent transaction Output model (UTXO); exchanging the first stable currency with a second stable currency on a second blockchain based on a second fixed exchange rate, wherein the first stable currency and the second stable currency have the second fixed exchange rate therebetween, and the second blockchain executes a transaction based on an Account model; exchanging the second stable currency to a target currency based on a smart contract, the second stable currency having a third fixed exchange rate with the reference currency. In the scheme, the block chain-based digital currency conversion is completed by utilizing the exchange relationship among the privacy currency, the first stable currency on the first block chain and the second stable currency on the second block chain, so that the privacy transaction between two transaction parties is realized.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit 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.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
In the current blockchain technology, there are two general types, i.e., the unspent transaction output UTXO model represented by bitcoin and the Account model represented by etherhouse.
The UTXO model is a stateless model that is embodied as a data structure containing transaction data and execution code. Each transaction on the blockchain is a transfer of UXTO. Each unspent UTXO model is only related to the last UTXO model and has no correlation to any other UTXOs. The UTXO model is suitable for privacy protection.
The Account model is a stateful model, with a global world state on each tile in the chain of tiles. The Account model is suitable for cross-chaining.
The invention discloses a digital currency conversion method based on a block chain based on an Account model and a UTXO model, which combines the Account model and the UTXO model together to ensure that the digital currency conversion based on the block chain completes the digital currency conversion on the premise of privacy protection, thereby achieving the purpose of private transaction between two parties.
As shown in fig. 1, a schematic flow chart of a block chain-based digital currency conversion method according to an embodiment of the present invention specifically includes the following steps:
s101: and exchanging the unblinded privacy currency into a first stable currency on a first blockchain.
In S101, the first blockchain performs a transaction based on the UTXO model. The first stable currency has a first fixed exchange rate with the reference currency.
That is, the first stable currency is a digital currency that is hooked to the reference currency at a first fixed exchange rate.
The reference currency is known as digital currency. The first fixed exchange rate is the previously agreed exchange rate between the first stable currency and the reference currency.
The UTXO address corresponding to the privacy currency is the address after the blinding, namely the UTXO outputting the privacy currency is hidden, so that when the transaction is carried out through the privacy currency, the privacy protection transaction can be realized.
The specific blinding process is as follows: and the UTXO address newly added into the system or the published UTXO address is used as input to initiate a privacy protection transaction and output as a ring consisting of a plurality of UTXO addresses. As shown in particular in fig. 2.
The public UTXO, ring-like private UTXO address is shown in fig. 2. The ring-shaped private UTXO address includes a real UTXO address and a non-real UTXO address. Through the privacy currency obtained in the blinding mode, other users or nodes cannot judge the UTXO address which really outputs the privacy currency. Therefore, privacy protection of account amount and account address is realized.
Therefore, the privacy coin needs to be unblinded before the privacy coin is exchanged into the first stable coin.
In the specific implementation process of S101, a blinding removal operation is performed on the private coin based on the mixed coin policy to obtain a blinded private coin, and the blinded private coin is exchanged for a first stable coin on the first blockchain.
The coin mixing strategy is a decentralized privacy function, and can enable a user to be quickly and efficiently mixed with funds of other users, and a random mapping relation is established between an existing user account and a new account after coin mixing, so that complete anonymity is realized.
Optionally, the above-mentioned unblinding operation is performed on the privacy currency based on the mixed currency policy, so as to obtain the unblinded privacy currency, which specifically includes:
firstly, a plurality of UTXO addresses corresponding to the privacy currency are obtained, and the plurality of UTXO addresses comprise real UTXO addresses and non-real UTXO addresses.
And then, acquiring a real UTXO address from the plurality of UTXO addresses based on the public UTXO input address and the mixed coin strategy to obtain the de-blinded privacy coin.
S102: exchanging the first stable currency for a second stable currency on a second blockchain based on a second fixed exchange rate.
In S102, the first stable currency and the second stable currency have a second fixed exchange rate therebetween, and the second blockchain executes a transaction based on an Account model.
Optionally, the second fixed exchange rate is 1: 1. Of course, the present invention is not limited thereto.
Optionally, the first stable currency on the first blockchain and the second stable currency on the second blockchain have the same reference currency exchange value, and the first stable currency of the first blockchain and the second stable currency of the second blockchain are exchanged through a second fixed exchange rate.
S103: exchanging the second stable currency for a target currency based on a smart contract.
In S103, the second stable currency has a third fixed exchange rate with the reference currency.
Smart contracts are a computer protocol that all propagate, validate or execute contracts in an informational manner, allowing trusted transactions to be conducted without third parties, which transactions are traceable and irreversible.
The reference currency is known as digital currency. The third fixed exchange rate is the previously agreed exchange rate between the second stable currency and the reference currency.
In the specific implementation of S103, based on the third fixed exchange rate between the second stable currency and the reference currency, the reference currency that the second stable currency can be exchanged currently may be determined, and similarly, how much reference currency the target currency obtained by exchanging the second stable currency based on the smart contract is equivalent to may also be known.
Likewise, in performing S101, having a first fixed exchange rate between the first stable currency and the reference currency may determine the reference currency that the first stable currency may be currently exchanged, and thus, may also determine how much of the reference currency the privacy currency exchanged corresponds to.
According to the digital currency transaction method based on the blockchain, disclosed by the embodiment of the invention, the privacy currency after being de-blinded is exchanged into a first stable currency on a first blockchain, a first fixed exchange rate is formed between the first stable currency and reference currency, and the first blockchain executes transaction based on a UTXO model; exchanging the first stable currency with a second stable currency on a second blockchain based on a second fixed exchange rate, wherein the first stable currency and the second stable currency have the second fixed exchange rate therebetween, and the second blockchain executes transaction based on an Account model; exchanging the second stable currency to a target currency based on a smart contract, the second stable currency having a third fixed exchange rate with the reference currency. In the scheme, the block chain-based digital currency conversion is completed by utilizing the exchange relationship among the privacy currency, the first stable currency on the first block chain and the second stable currency on the second block chain, so that the privacy transaction between two transaction parties is realized.
Furthermore, the embodiment of the invention combines the UTXO model and the Account model, so that the new block chain digital currency system can support an intelligent contract to meet the code execution with complete turing on the premise of supporting high-level privacy protection capability, and can support fragmentation/chain spanning at the same time, thereby realizing the high-efficiency expansion of the performance of the block chain system.
Based on the block chain-based digital currency transaction method disclosed in fig. 1, an embodiment of the present invention further discloses another digital currency transaction method, as shown in fig. 3, including the following steps:
s301: and acquiring a plurality of UTXO addresses corresponding to the privacy currency, wherein the plurality of UTXO addresses comprise real UTXO addresses and non-real UTXO addresses.
S302: and acquiring a real UTXO address from the plurality of UTXO addresses based on the public UTXO input address and the mixed coin strategy to obtain the de-blinded privacy coin.
S301 and S302 are processes of de-blinding.
S303: and exchanging the unblinded privacy currency into a first stable currency on a first blockchain.
Here, the execution process of S303 is the same as the execution process of S101 shown in fig. 1, and is not described again here.
S304: exchanging the first stable currency with a second stable currency on a second block chain according to a second fixed exchange rate in a Hash Lock (Hash Lock) mode.
In S304, the Hash Lock mode is a more sophisticated security and privacy technique for unauthorized access of the address tag.
Optionally, the first stable currency and the second stable currency are exchanged at an exchange ratio of 1: 1.
In the embodiment of the invention, in a Hash Lock mode, exchange operation is carried out on the first stable currency according to a second fixed exchange rate to obtain a second stable currency of a second block chain, so that the aim of mutually exchanging the first stable currency and the second stable currency is fulfilled.
S305: exchanging the second stable currency for a target currency based on a smart contract.
The execution process of S305 is the same as S103 disclosed in fig. 1, and is not described herein again.
According to the digital currency transaction method based on the blockchain, disclosed by the embodiment of the invention, the privacy currency after being de-blinded is exchanged into a first stable currency on a first blockchain, a first fixed exchange rate is formed between the first stable currency and reference currency, and the first blockchain executes transaction based on a UTXO model; exchanging the first stable currency with a second stable currency on a second blockchain based on a second fixed exchange rate, wherein the first stable currency and the second stable currency have the second fixed exchange rate therebetween, and the second blockchain executes transaction based on an Account model; exchanging the second stable currency to a target currency based on a smart contract, the second stable currency having a third fixed exchange rate with the reference currency. In the scheme, the block chain-based digital currency conversion is completed by utilizing the exchange relationship among the privacy currency, the first stable currency on the first block chain and the second stable currency on the second block chain, so that the privacy transaction between two transaction parties is realized.
Furthermore, the embodiment of the invention combines the UTXO model and the Account model, so that the new block chain digital currency system can support an intelligent contract to meet the code execution with complete turing on the premise of supporting high-level privacy protection capability, and can support fragmentation/chain spanning at the same time, thereby realizing the high-efficiency expansion of the performance of the block chain system.
Based on the digital currency transaction method based on the block chain disclosed in the embodiment of the present invention, the embodiment of the present invention further discloses a digital currency conversion apparatus based on the block chain correspondingly, as shown in fig. 4, the digital currency conversion apparatus 400 includes: a first redemption unit 401, a second redemption unit 402 and a third redemption unit.
A first exchanging unit 401, configured to exchange the unblinded privacy currency into a first stable currency on a first blockchain, where the first stable currency and the reference currency have a first fixed exchange rate therebetween, and the first blockchain executes a transaction based on the UTXO model.
A second exchanging unit 402, configured to exchange the first stable currency with a second stable currency on a second blockchain based on a second fixed exchange rate, where the first stable currency and the second stable currency have the second fixed exchange rate therebetween, and the second blockchain performs a transaction based on an Account model.
A third exchanging unit 403 for exchanging the second stable currency into a target currency based on a smart contract, the second stable currency having a third fixed exchange rate with the reference currency.
Optionally, the first exchange unit 401 is further configured to perform a blind removal operation on the privacy currency based on a currency mixing policy, so as to obtain a blind-removed privacy currency.
Optionally, the first exchanging unit 401 is further configured to obtain a plurality of UTXO addresses corresponding to the private coin, where the plurality of UTXO addresses include the real UTXO address and the untrue UTXO address, and obtain the real UTXO address from the plurality of UTXO addresses based on the public UTXO input address and the coin mixing policy, to obtain the unblinded private coin.
Optionally, the second exchanging unit 402 is specifically configured to exchange the first stable currency with a second stable currency on a second block chain according to a second fixed exchange rate in a Hash Lock mode.
The invention discloses a digital currency transaction device based on a block chain, which combines a UTXO model and an Account model, utilizes a first exchange unit to exchange a privacy currency after being blinded into a first stable currency on a first block chain, then utilizes a second exchange unit to exchange the first stable currency into a second stable currency on a second block chain based on a second fixed exchange rate, and then utilizes a third exchange unit to exchange the second stable currency into a target currency based on an intelligent contract.
The digital currency conversion device 50 comprises a memory 51 and a processor 52, as shown in fig. 5, the memory 51 stores a digital currency conversion program based on the blockchain that can run on the processor 52, and the digital currency conversion program based on the blockchain is executed by the processor 52 to implement the method for converting digital currency based on the blockchain disclosed in fig. 1 or fig. 2.
In the embodiment of the present invention, the digital currency exchanging device 50 based on the blockchain may be a PC (personal computer), a smart phone, a tablet computer, a palmtop computer, a portable computer, or a terminal device.
Optionally, the blockchain-based digital currency exchange device 50 may include a memory 51, a processor 52 and a bus 53.
The memory 51 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 51 may in some embodiments be an internal storage unit of the blockchain based digital currency exchange device 50, for example a hard disk of the blockchain based digital currency exchange device 50. The memory 51 may also be an external storage device of the blockchain-based Digital currency conversion apparatus 50 in other embodiments, such as a plug-in hard disk provided on the blockchain-based Digital currency conversion apparatus 50, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 51 may also include both an internal storage unit and an external storage device of the blockchain-based digital currency exchanging device 50. The memory 51 may be used not only to store application software installed in the blockchain-based digital currency conversion apparatus 50 and various types of data, such as codes of a blockchain-based digital currency conversion program, etc., but also to temporarily store data that has been output or will be output.
The processor 52 may be, in some embodiments, a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip for running program code stored in the memory 51 or Processing data, such as executing a block chain based digital currency exchange program.
The bus 53 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
Further, the blockchain based digital currency conversion apparatus 50 may also include a network interface, which may optionally include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the blockchain based digital currency conversion apparatus 50 and other electronic devices.
Optionally, the block chain based digital currency conversion apparatus 50 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may also comprise a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. Wherein the display may also be appropriately referred to as a display screen or display unit for displaying information processed in the blockchain based digital currency exchanging device 50 and for displaying a visualized user interface.
While fig. 5 shows only the blockchain based digital currency conversion apparatus 50 having the components 51 to 53 and the blockchain based digital currency conversion program, those skilled in the art will appreciate that the configuration shown in fig. 5 does not constitute a limitation of the blockchain based digital currency conversion apparatus 50 and may include fewer or more components than shown, or some components in combination, or a different arrangement of components.
Embodiments of the present invention also provide a computer-readable storage medium, on which a blockchain-based digital currency conversion program is stored, where the blockchain-based digital currency conversion program is executable by one or more processors to implement the blockchain-based digital currency conversion method disclosed in fig. 1 or fig. 2 according to the embodiments of the present invention described above.
Embodiments of the present invention also provide a computer program product, which includes computer instructions, when executed on a computer, enable the computer to execute the method for block chain-based digital currency exchange disclosed in fig. 1 or fig. 2 according to the embodiments of the present invention.
In summary, the embodiment of the present invention discloses a block chain-based digital currency transaction method and related apparatus, wherein a blinded privacy currency is exchanged into a first stable currency on a first block chain, the first stable currency and a reference currency have a first fixed exchange rate, and the first block chain executes a transaction based on a UTXO model; exchanging the first stable currency with a second stable currency on a second blockchain based on a second fixed exchange rate, wherein the first stable currency and the second stable currency have the second fixed exchange rate therebetween, and the second blockchain executes a transaction based on an Account model; exchanging the second stable currency to a target currency based on a smart contract, the second stable currency having a third fixed exchange rate with the reference currency. In the scheme, the block chain-based digital currency conversion is completed by utilizing the exchange relationship among the privacy currency, the first stable currency on the first block chain and the second stable currency on the second block chain, so that the privacy transaction between two transaction parties is realized.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.