[go: up one dir, main page]

CN108876335A - A kind of management of balance method and system, equipment and storage medium - Google Patents

A kind of management of balance method and system, equipment and storage medium Download PDF

Info

Publication number
CN108876335A
CN108876335A CN201811041379.5A CN201811041379A CN108876335A CN 108876335 A CN108876335 A CN 108876335A CN 201811041379 A CN201811041379 A CN 201811041379A CN 108876335 A CN108876335 A CN 108876335A
Authority
CN
China
Prior art keywords
utxo
transaction
public key
container
wallet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811041379.5A
Other languages
Chinese (zh)
Inventor
何正军
桑后贵
吴思进
王志文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201811041379.5A priority Critical patent/CN108876335A/en
Publication of CN108876335A publication Critical patent/CN108876335A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention discloses a kind of management of balance method and system, equipment and storage mediums, belong to block chain technical field.The method includes that the input UTXO that uses of wallet building transaction is included in by wallet and freezes in UTXO container;If after transaction is performed successfully, input UTXO of the wallet in transaction is from freezing UTXO container and be moved to have spent in UTXO container;The output UTXO that wallet receives in transaction is admitted in available UTXO container;If transaction, which is performed failure, or transaction is not performed for a long time causes to trade expired, input UTXO of the wallet in transaction is moved in available UTXO container from UTXO container is freezed.The scalability of account balance way to manage, flexibility problem can be improved in it, can also increase privacy of user safety, reduce the risk of privacy leakage.

Description

Method, system, equipment and storage medium for managing balance
Technical Field
The present invention relates to the field of block chain technology, and in particular, to a method, a system, a device, and a storage medium for managing a balance.
Background
The function of the balance management of the privacy wallet is mainly to realize that the money in the wallet is effectively managed on the premise of protecting the privacy and the safety of an initiator of the transaction and a receiver of the transaction by adopting a one-time address as a balance address in the block chain privacy transaction process of an account and UTXO mixed model.
There are two existing system schemes, account balance management and UTXO balance management. The account balance management means that the user account balance is recorded through a blockchain, the total user balance information is finally summarized by counting account balance changes on the blockchain, and the function is single by directly adopting an account balance mode and is not easy to expand; when the UTXO is directly adopted for balance management, because the address of the receiver is filled in the UTXO, certain privacy disclosure risk exists.
Disclosure of Invention
1. Technical problem to be solved by the invention
In order to overcome the technical problem, the invention provides a balance management method, a balance management system, balance management equipment and a storage medium. The account balance management method can improve the expansibility and flexibility of an account balance management mode, can also increase the privacy safety of a user, and reduces the risk of privacy disclosure.
2. Technical scheme
In order to solve the problems, the technical scheme provided by the invention is as follows:
a balance management method comprising the following:
s101, an input UTXO used for wallet construction transaction is listed in a frozen UTXO container by a wallet;
s102, if the transaction is successfully executed, the input UTXO of the wallet in the transaction is moved from the frozen UTXO container to the spent UTXO container; the output UTXO received by the wallet during the transaction is recorded into an available UTXO container;
s103, if the transaction is failed to be executed or the transaction is expired, the input UTXO of the wallet in the transaction is moved from the frozen UTXO container to the available UTXO container.
Preferably, if the transaction is rolled back, the wallet executes the following, not in sequence:
A. checking whether the output UTXO of the transaction is given to the wallet, and if so, removing the UTXO from the usable UTXO container of the wallet;
B. checking the currently spent UTXO container and moving from the spent UTXO container to the frozen UTXO container if the input UTXO for the transaction is present in the wallet spent UTXO container;
C. the frozen UTXO container is checked and if the input UTXO for the transaction is in the wallet frozen UTXO container, the transfer is from the frozen UTXO container to the available UTXO container.
Preferably, the transaction is a privacy transaction, and in the privacy transaction, a one-time public key P is generated by using the private address of the receiver as a public key pair, so that the receiver is ensured not to be tracked by others, because only the receiver can generate the one-time private key x to spend the UTXO.
Preferably, in step S102, if the transaction is successfully executed, the wallet traverses the output UTXO received in the transaction according to the one-time address algorithm, and if the verification is passed, the output UTXO is recorded in an available UTXO container for subsequent use.
Preferably, the one-time address algorithm is as follows:
by the formula P ═ Hs(rA) G + B calculates the disposable public key of the receiver;
by the formula P ═ Hs(aR) the G + B receiver calculates a one-time public key validation value;
if P is equal to P', the receiver of the transaction is considered as the expected target of the sender, and the verification is passed; wherein,
r is an elliptic curve public key, R is a first random number, G is a base point on an elliptic curve, A is a first public key in a first public key pair (A, B) of a receiver, B is a second public key in the first public key pair (A, B) of the receiver, and a is a first private key corresponding to the first public key A; b is a first private key corresponding to the first public key B; hs() Is a hash function.
A balance management system comprising a balance management method according to any one of the above, a transaction creation module for creating a transaction, and a UTXO mobile module for inputting a transfer of UTXO in a frozen UTXO container and a spent UTXO container and outputting a transfer of UTXO in an available UTXO container.
Preferably, the transaction creation module further comprises a one-time public key generation module for generating an elliptic curve public key R and a one-time public key P, wherein,
R=rG;
P=Hs(rA)G+B;
wherein, R is an elliptic curve public key, R is a first random number R, G is a base point on the elliptic curve, A is a first public key in a first public key pair (A, B), B is a second public key in the first public key pair (A, B), Hs() Is a hash function.
Preferably, the system further comprises a transaction verification module for calculating a one-time public key verification value P':
P'=Hs(aR)G+B;
wherein, a is a first private key corresponding to the first public key A; judging whether the verification one-time public key verification value P' is the same as the one-time public key P in the privacy transaction: if yes, the verification is passed; the UTXO mobile module is convenient to adjust the transfer of the UTXO.
An apparatus comprising a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of the above.
A computer readable storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of any one of the above.
3. Advantageous effects
Compared with the prior art, the technical scheme provided by the invention has the following beneficial effects:
the invention changes the address of the receiving party of the UTXO into a disposable address through the mixing of the account balance management and the UTXO balance management, thereby solving the problems of expansibility and flexibility of an account balance management mode, increasing the privacy safety of a user and reducing the risk of privacy disclosure.
Drawings
FIG. 1 is a schematic flow chart of example 1;
FIG. 2 is a schematic flow chart of example 2;
FIG. 3 is a schematic structural view of example 6;
FIG. 4 is a schematic structural view of example 7;
FIG. 5 is a schematic structural view of example 8;
FIG. 6 is a schematic structural view of example 9;
fig. 7 is a flowchart of a privacy transaction method provided in example 12;
FIG. 8 is a schematic illustration of S12 and S13 in a preferred embodiment of the method of FIG. 7;
FIG. 9 is a schematic diagram of S14 in a preferred embodiment of the method of FIG. 7;
fig. 10 is a schematic structural diagram of a privacy transaction system provided in embodiment 12;
figure 11 is a schematic diagram of the input UTXO transfer direction of the wallet during a transaction;
figure 12 is a schematic diagram of wallet and address distribution in a client on a node.
Detailed Description
For further understanding of the contents of the present invention, the present invention will be described in detail with reference to the accompanying drawings and embodiments, and all possible reasonable combinations and substitutions of the following embodiments are technical solutions of the present invention. As shown in fig. 12, a node in the prior art may include multiple wallets, and a wallet may include multiple addresses, and it should be noted that a balance management method and a balance management system described in the embodiments are both directed to management of a balance change at a specific address in a wallet.
Example 1
As shown in fig. 1, a balance management method includes the following steps:
s101, an input UTXO used for wallet construction transaction is listed in a frozen UTXO container by a wallet;
s102, if the transaction is successfully executed, the input UTXO of the wallet in the transaction is moved from the frozen UTXO container to the spent UTXO container; the output UTXO received by the wallet during the transaction is recorded into an available UTXO container;
s103, if the transaction is not executed for a long time or the transaction is not executed for a long time, resulting in the transaction being expired, the wallet input UTXO in the transaction is moved from the frozen UTXO container to the available UTXO container, as shown in fig. 11.
The case where the transaction is not successfully executed in fig. 1 means that the transaction is unsuccessfully executed or the transaction is not executed for a long time, resulting in the transaction being expired.
It should be noted that: 1. in the privacy transaction, the wallet only manages UTXO information related to the wallet, and the information which is not related to the wallet is not processed; 2. the wallet records transactions issued to and spent from the wallet, and the associated UTXO change records.
Example 2
As shown in fig. 2, the balance management method of this embodiment is further improved on the basis of embodiment 1, and includes the following steps:
s101, an input UTXO used for wallet construction transaction is listed in a frozen UTXO container by a wallet;
s102, if the transaction is successfully executed, the input UTXO of the wallet in the transaction is moved from the frozen UTXO container to the spent UTXO container; the output UTXO received by the wallet during the transaction is recorded into an available UTXO container;
s103, if the transaction is failed to be executed or the transaction is not executed for a long time, so that the transaction is expired, the input UTXO of the wallet in the transaction is moved from the frozen UTXO container to the available UTXO container;
s104, if the transaction is returned, the wallet executes the following contents in no sequence:
A. the output UTXO of the transaction is checked for being given to the wallet and if so, the UTXO is removed from the wallet available UTXO container.
B. The currently spent UTXO container is checked and if the input UTXO for the transaction is present in the wallet spent UTXO container, the transaction is moved from the spent UTXO container to the frozen UTXO container as shown in fig. 11.
C. The frozen UTXO container is checked and if the input UTXO for the transaction is in the wallet frozen UTXO container, the transfer is from the frozen UTXO container to the available UTXO container as shown in fig. 11.
In step S104, considering that the block needs to be backed up due to the branch of the block chain during the operation process, the transaction will be backed up during the block backing process. When the transaction quit occurs, whether the output UTXO of the transaction is given to the wallet or not is judged, or whether the input UTXO of the transaction exists in the UTXO container which is spent by the wallet or in the frozen UTXO container is judged, so that the further rollback operation of the UTXO is executed, as shown in figure 2.
When the block chain detects that the chain has a bifurcation, the chain adjustment is performed to select the most suitable chain on the bifurcation chain as the main chain. In the processing process, the current chain is retreated, after the chain is retreated to a bifurcation point, the block is synchronized from the bifurcation point to a new main chain direction, and after synchronization is finished, block execution and packing operations are performed according to a normal flow.
Checking the output of the transaction, wherein whether the output UTXO information of the current transaction exists in the available UTXO and frozen UTXO queues of the wallet; if so, the UTXO information is removed from the available or frozen UTXO queue.
The system will coordinate to specifically detect the list of frozen UTXO information in the wallet and move it to the list of available UTXOs if the frozen UTXO is detected to be expired. Because the frozen UTXO expires, meaning that the corresponding transaction also expires, it is not packed for execution in the node.
The amount information on the user privacy contract can automatically return to the last correct amount along with the return of the block without additional processing by a wallet; the privacy balance information is directly written on the block chain, so when the block is returned, the user privacy balance information is also directly returned; when the blocks are synchronized from the bifurcation node, the privacy balance information is synchronously updated, and finally the privacy balance information of the user is updated to the latest value. No additional processing is required.
The balance change of address D in the wallet (change of the number of UTXOs in the UTXO container available) results from the following:
1. after the transaction is successfully executed, the address in the other wallet, or other address of the wallet, initiates a private transfer operation to the wallet address D, the wallet checks the transaction information and places the transaction output UTXO in the available UTXO container at the wallet address D.
2. The transaction is failed to execute or the transaction expires, and the wallet input UTXO in the transaction is moved from the frozen UTXO container to the available UTXO container.
3. When the block in the block chain returns, the transaction returns, and the wallet executes the following contents in no order:
A. checking whether the output UTXO of the transaction is given to the wallet, and if so, removing the UTXO from the usable UTXO container of the wallet;
B. checking the currently spent UTXO container and if the input UTXO for the transaction is present in the wallet spent UTXO container, moving from the spent UTXO container to the frozen UTXO container, which is unchanged by the amount of UTXO in the UTXO container;
C. the frozen UTXO container is checked and if the input UTXO for the transaction is in the wallet frozen UTXO container, the transfer is from the frozen UTXO container to the available UTXO container.
Example 3
The balance management method of the embodiment is further improved on the basis of the embodiments 1 and 2, the transactions in the embodiments 1 and 2 refer to privacy transactions, and the one-time public key P is generated by using the private address of the receiver as the public key pair in the privacy transactions, so that the receiver is ensured not to be tracked by others, and because only the receiver can generate the one-time private key x to spend the UTXO, the privacy safety of the user is ensured.
Example 4
In step S102, if the transaction is successfully executed, the wallet may traverse the output UTXO received in the transaction according to a one-time public key algorithm, and if the verification passes, the output UTXO is recorded in an available UTXO container for subsequent use.
Example 5
The balance management method of this embodiment is further improved on the basis of embodiments 1, 2, 3, and 4, and the one-time public key algorithm is as follows:
elliptic curve public key R: r ═ rG;
by the formula P ═ Hs(rA) G + B calculates a one-time public key P of the receiver;
by the formula P ═ Hs(aR) the receiver G + B calculates a one-time public key validation value P';
if P is equal to P', the receiver of the transaction is considered as the expected target of the sender, and the verification is passed; wherein,
r is an elliptic curve public key, R is a first random number, G is a base point on an elliptic curve, A is a first public key in a first public key pair (A, B) of a receiver, B is a second public key in the first public key pair (A, B) of the receiver, and a is a first private key corresponding to the first public key A; b is a first private key corresponding to the first public key B; hs() Is a hash function. The public key of the receiver is obfuscated through the algorithm, so that the receiver cannot be traced, and the privacy and safety of the user are protected.
Example 6
As shown in fig. 3, a balance management system, a balance management method according to any one of embodiments 1 to 5, a package transaction creation module for creating a transaction, and a UTXO mobile module for inputting a transfer of the UTXO in the frozen UTXO container and the spent UTXO container and transferring an output UTXO in the available UTXO container.
Example 7
As shown in fig. 4, a balance management system of this embodiment is further improved on the basis of embodiment 6, and the transaction creation module further includes a one-time public key generation module, configured to generate an elliptic curve public key R and a one-time public key P, where,
R=rG;
P=Hs(rA)G+B;
wherein, R is an elliptic curve public key, R is a first random number R, G is a base point on the elliptic curve, A is a first public key in a first public key pair (A, B), B is a second public key in the first public key pair (A, B), Hs() Is a hash function.
Example 8
As shown in fig. 5, the balance management system of this embodiment is further improved on the basis of embodiments 6 and 7, and further includes a transaction verification module, configured to calculate a one-time public key verification value P':
P'=Hs(aR)G+B;
wherein, a is a first private key corresponding to the first public key A; judging whether the verification one-time public key verification value P' is the same as the one-time public key P in the privacy transaction: if yes, the verification is passed; the UTXO mobile module is convenient to adjust the transfer of the UTXO.
Example 9
As shown in fig. 6, an apparatus comprising a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method according to any one of claims 1 to 5.
Example 10
A computer-readable storage medium, storing a computer program comprising program instructions, which when executed by a processor, cause the processor to perform the method of any one of claims 1-5.
Example 11
UTXO: an unspent transaction output; available UTXO: checking to confirm that the UTXO belongs to a current wallet that has a UTXO combination that costs the right of the UTXO; freezing the UTXO container: after the wallet system has constructed the transaction, the UTXOs used in the transaction are recorded by a data structure to indicate that the UTXOs have been frozen and cannot be used in subsequent transaction operations of the wallet. The frozen UTXO container may be divided into a frozen UTXO queue and a back-off frozen UTXO queue according to a specific scenario. The UTXO container has been spent: if a transaction is detected to be validated in the wallet system, the UTXO that is the input portion of the transaction is stored via a data structure that indicates that the UTXO has been spent and is no longer available for use in subsequent transactions.
The method for the UTXO management available to the user in this embodiment is as follows:
after the wallet system detects that the transaction is confirmed and the transaction is successfully executed, it will go through the output UTXO information in the transaction according to the one-time public key algorithm described in embodiment 5 or 8, and if the verification passes, it is deemed that the UTXO belongs to the wallet, and the wallet system can include it in the UTXO list available in the system (the list is one of the implementations of the container) for subsequent use.
The method for managing the transaction frozen UTXO in this embodiment is as follows:
after the wallet system constructs a transaction, the input UTXO used for the transaction will be listed by the wallet in the frozen UTXO list.
If the transaction is signed and sent to the blockchain, and executed successfully by the blockchain, the UTXO information is moved from the frozen UTXO container to the spent UTXO container.
These UTXO information are moved from the frozen UTXO container to the available UTXO container if the transaction fails to be executed by the blockchain.
If the transaction is expired because the transaction has not been executed for a long time, the UTXO information is moved from the frozen UTXO container to the available UTXO container;
the method for transaction rollback UTXO management in this embodiment is as follows:
the block chain may be forked during operation, so that the block needs to be rolled back, and the transaction can be rolled back during the block rolling back process. When a transaction is rolled back, the wallet checks whether the output UTXO of the transaction is given to the wallet, and if so, the UTXO information is removed from the usable UTXO container of the wallet. At the same time, the wallet also checks the current spent UTXO information, if the input UTXO information of the transaction exists in the spent UTXO of the wallet, the UTXO information is moved to a frozen UTXO container; the frozen UTXO container is checked and if the input UTXO for the transaction is in the wallet frozen UTXO container, the transfer is from the frozen UTXO container to the available UTXO container.
Example 12
The privacy transaction method of embodiment 3 is further described in detail with reference to fig. 7, 8, 9, and 10. FIG. 7 is a flow chart diagram of a method of privacy trading.
As shown in fig. 7, in this embodiment, the present invention provides a privacy transaction method, including:
s11, transferring accounts to the privacy contract;
s12, acquiring a first public key pair (A, B) of a receiver, generating a first random number R, generating an elliptic curve public key R according to the first random number R, and generating a disposable public key P according to the first random number R and the first public key pair (A, B);
s13, the one-time public key P is used as an output purpose public key of the privacy transaction, the elliptic curve public key R is used as input information of the privacy transaction, and the privacy transaction is packaged according to the balance of the privacy contract;
s14, sending the private transactions to the blockchain network for consensus and execution, so that a user side of a receiving party traverses all the private transactions, verifies each private transaction through a first private key pair corresponding to the first public key pair (A, B), and generates a disposable private key x according to the first private key pair and the elliptic curve public key R after the private transactions are verified; where the one-time private key x is used to spend the transfer amount.
Specifically, if the sender a wants to send a transfer with an amount of N to the receiver B, in step S11, the sender first transfers the transfer with the amount of N from its public account to the privacy contract, at this time, there is an asset with the amount of N in the privacy contract, in step S12, the sender acquires the first public key pair (a, B) of the receiver, the sender locally generates the first random number r, and generates the one-time public key P according to a certain algorithm according to the first public key pair (a, B) and the first random number r.
In steps S13 and S14, the sender uses the one-time public key P as the output destination public key of the privacy transaction and uses the elliptic curve public key R as the output information of the privacy transaction, the sender packs the private transaction according to the balance N in the privacy contract, and generates UTXO equal to N in the one-time destination address after sending the transaction, and the transfer amount N in the privacy contract disappears. And sending the transaction to a blockchain network for consensus and execution, traversing the received output transaction by a receiver, verifying the disposable public key P by using a certain algorithm, and generating a disposable private key x by using a preset algorithm to spend the received UTXO after the verification is passed.
In more embodiments, the manner of obtaining the first public key pair (a, B) of the receiver in step S12 may be that the sender splits the privacy address of the receiver to generate the first public key pair (a, B), may also be that the receiver actively gives the first public key pair (a, B) to the sender, and may also be another manner of generating the first public key pair (a, B), which is not limited by any one of the manners.
FIG. 8 is a schematic view of S12 and S13 in a preferred embodiment of the method shown in FIG. 7. Specifically, the generation method of the elliptic curve public key R is as follows:
R=rG;
the generation mode of the disposable public key P is as follows:
P=Hs(rA)G+B;
wherein, R is an elliptic curve public key, R is a first random number, G is a base point on the elliptic curve, A is a first public key in a first public key pair (A, B), B is a second public key in the first public key pair (A, B), Hs() Is a hash function.
Fig. 9 is a schematic diagram of S14 in a preferred embodiment of the method shown in fig. 7.
Specifically, after receiving the private transaction, the user traverses all output transactions, and calculates P' ═ H through the first private key pair (a, b) and the elliptic curve public key Rs(aR) G + B if P 'is the same as the public one-time key P (since aR arG rA, P' Hs(aR)G+B=Hs(aA) G + B ═ P), the verification is passed, which indicates that the UTXO belongs to the address, and the one-time private key x ═ H is calculateds(aR) + b to cost the pen UTXO.
Fig. 10 is a schematic structural diagram of a privacy transaction system according to this embodiment. As shown in fig. 10, a transaction privacy system 04 includes:
a transfer unit 041 configured to transfer money to the privacy contract; a one-time public key P generating unit 042 configured to obtain a first public key pair (a, B) of the receiving party, generate a first random number R, generate an elliptic curve public key R according to the first random number R, and generate a one-time public key P according to the first random number R and the first public key pair (a, B);
the transaction packaging unit 043 is configured to use the one-time public key P as an output destination public key of the privacy transaction, use the elliptic curve public key R as output information of the privacy transaction, and package the privacy transaction according to the balance of the privacy contract;
a transaction sending unit 044 configured to send the private transactions to a blockchain network for consensus, so that a user side of a receiving party traverses all the private transactions, verifies each private transaction by a first private key pair corresponding to the first public key pair (a, B), and generates a one-time private key x according to the first private key pair (a, B) and the elliptic curve public key R after the verification is passed; where the one-time private key x is used to spend the transfer amount.
Further preferably, the one-time public key P generating unit 042 includes: an elliptic curve public key R generation subunit 0421 configured to calculate R ═ rG; the generation mode of the disposable public key P is as follows:
P=Hs(rA)G+B;
wherein, R is an elliptic curve public key, R is a first random number R, G is a base point on the elliptic curve, A is a first public key in a first public key pair (A, B), B is a second public key in the first public key pair (A, B), Hs() Is a hash function.
Further preferably, the transaction sending unit 044 includes: a verification subunit 0441 configured to calculate a verification public key P':
P'=Hs(aR)G+B;
wherein, a is a first private key corresponding to the first public key A;
it is determined whether the verification public key P' is the same as the one-time public key P in the private transaction.
The present invention and its embodiments have been described above schematically, without limitation, and what is shown in the drawings is only one of the embodiments of the present invention, and the actual structure is not limited thereto. Therefore, if the person skilled in the art receives the teaching, without departing from the spirit of the invention, the person skilled in the art shall not inventively design the similar structural modes and embodiments to the technical solution, but shall fall within the scope of the invention.

Claims (10)

1. A balance management method, comprising:
s101, an input UTXO used for wallet construction transaction is listed in a frozen UTXO container by a wallet;
s102, if the transaction is successfully executed, the input UTXO of the wallet in the transaction is moved from the frozen UTXO container to the spent UTXO container; the output UTXO received by the wallet during the transaction is recorded into an available UTXO container;
s103, if the transaction is failed to be executed or the transaction is expired, the input UTXO of the wallet in the transaction is moved from the frozen UTXO container to the available UTXO container.
2. A balance management method according to claim 1, wherein if a transaction is rolled back, the wallet performs the following:
A. checking whether the output UTXO of the transaction is given to the wallet, and if so, removing the UTXO from the usable UTXO container of the wallet;
B. checking the currently spent UTXO container and moving from the spent UTXO container to the frozen UTXO container if the input UTXO for the transaction is present in the wallet spent UTXO container;
C. the frozen UTXO container is checked and if the input UTXO for the transaction is in the wallet frozen UTXO container, the transfer is from the frozen UTXO container to the available UTXO container.
3. The method of claim 1, wherein the transaction is a private transaction, and a one-time public key P is generated by using a public key pair for a private address of the receiving party in the private transaction, so that the receiving party is not tracked by others.
4. The method of claim 1, wherein in step S102, if the transaction is successfully executed, the wallet traverses the output UTXO received in the transaction according to a one-time public key algorithm, and if the verification passes, the output UTXO is recorded in an available UTXO container for subsequent use.
5. A balance management method according to claim 3 or 4, wherein said one-time public key algorithm is:
elliptic curve public key R: r ═ rG;
by the formula P ═ Hs(rA) G + B calculates a one-time public key P of the receiver;
by the formula P ═ Hs(aR) the receiver G + B calculates a one-time public key validation value P';
if P is equal to P', the receiver of the transaction is considered as the expected target of the sender, and the verification is passed; wherein,
r is an elliptic curve public key, R is a first random number, G is a base point on an elliptic curve, A is a first public key in a first public key pair (A, B) of a receiver, B is a second public key in the first public key pair (A, B) of the receiver, and a is a first private key corresponding to the first public key A; b is a first private key corresponding to the first public key B; hs() Is a hash function.
6. A balance management system, characterized by a balance management method according to any one of claims 1 to 5, a package transaction creation module for creating a transaction, and a UTXO mobile module for inputting a transfer of the UTXO in the frozen UTXO container and the spent UTXO container and outputting a transfer of the UTXO in the available UTXO container.
7. The balance management system of claim 6, wherein the transaction creation module further comprises a one-time public key generation module for generating an elliptic curve public key R and a one-time public key P, wherein,
R=rG;
P=Hs(rA)G+B;
wherein, R is an elliptic curve public key, R is a first random number R, G is a base point on the elliptic curve, A is a first public key in a first public key pair (A, B), B is a second public key in the first public key pair (A, B), Hs() Is a hash function.
8. The balance management system according to claim 6, further comprising a transaction verification module for calculating a one-time public key verification value P':
P'=Hs(aR)G+B;
wherein, a is a first private key corresponding to the first public key A; judging whether the verification one-time public key verification value P' is the same as the one-time public key P in the privacy transaction: if yes, the verification is passed; the UTXO mobile module is convenient to adjust the transfer of the UTXO.
9. An apparatus comprising a processor, an input device, an output device, and a memory, the processor, the input device, the output device, and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1-5.
10. A computer-readable storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to carry out the method according to any one of claims 1-5.
CN201811041379.5A 2018-09-07 2018-09-07 A kind of management of balance method and system, equipment and storage medium Pending CN108876335A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811041379.5A CN108876335A (en) 2018-09-07 2018-09-07 A kind of management of balance method and system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811041379.5A CN108876335A (en) 2018-09-07 2018-09-07 A kind of management of balance method and system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN108876335A true CN108876335A (en) 2018-11-23

Family

ID=64323346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811041379.5A Pending CN108876335A (en) 2018-09-07 2018-09-07 A kind of management of balance method and system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108876335A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805712A (en) * 2018-05-29 2018-11-13 阿里巴巴集团控股有限公司 Backspacing processing method of extensive makeup and device, the electronic equipment of assets transfer
CN109727030A (en) * 2018-12-18 2019-05-07 杭州茂财网络技术有限公司 Account data storage method in a kind of block chain
CN109783478A (en) * 2019-03-12 2019-05-21 长沙理工大学 A UTXO data storage method, device, device and storage medium
CN110675147A (en) * 2019-09-11 2020-01-10 上海唯链信息科技有限公司 Block chain transaction method, electronic equipment and storage device
CN111027947A (en) * 2019-12-06 2020-04-17 湖北文理学院 UTXO wallet selection method, UTXO wallet selection equipment, UTXO wallet storage medium and UTXO wallet selection device
CN111709742A (en) * 2020-05-18 2020-09-25 杜晓楠 Method for preventing root address exposure in blockchain system, computer readable storage medium and blockchain system
CN112488725A (en) * 2020-12-25 2021-03-12 杭州复杂美科技有限公司 Private authorized transfer method, device and storage medium
CN113269639A (en) * 2021-05-06 2021-08-17 众连智能科技有限公司 Business processing method, device, equipment and medium based on block chain intelligent contract
US11328303B2 (en) 2018-05-29 2022-05-10 Advanced New Technologies Co., Ltd. Asset transfer method and apparatus, and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297241A (en) * 2013-05-31 2013-09-11 中国人民武装警察部队工程大学 Construction method for one-time anonymous signcryption of public key
CN106779704A (en) * 2016-12-06 2017-05-31 杭州趣链科技有限公司 A kind of block chain anonymous deal method based on ring signatures
CN107769920A (en) * 2017-10-11 2018-03-06 深圳大学 Encrypt the method and system of the traceable client public key of currency conditional
WO2018078519A1 (en) * 2016-10-25 2018-05-03 nChain Holdings Limited Method and system for directing an exchange associated with an anonymously held token on a blockchain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297241A (en) * 2013-05-31 2013-09-11 中国人民武装警察部队工程大学 Construction method for one-time anonymous signcryption of public key
WO2018078519A1 (en) * 2016-10-25 2018-05-03 nChain Holdings Limited Method and system for directing an exchange associated with an anonymously held token on a blockchain
CN106779704A (en) * 2016-12-06 2017-05-31 杭州趣链科技有限公司 A kind of block chain anonymous deal method based on ring signatures
CN107769920A (en) * 2017-10-11 2018-03-06 深圳大学 Encrypt the method and system of the traceable client public key of currency conditional

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李昕: "Bytom比原链一个多元比特资产交互协议", 《HTTPS://WENKU.BAIDU.COM/VIEW/412F2F861B37F111F18583D049649B6648D709D3.HTML?》 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11328303B2 (en) 2018-05-29 2022-05-10 Advanced New Technologies Co., Ltd. Asset transfer method and apparatus, and electronic device
CN108805712A (en) * 2018-05-29 2018-11-13 阿里巴巴集团控股有限公司 Backspacing processing method of extensive makeup and device, the electronic equipment of assets transfer
US11216820B2 (en) 2018-05-29 2022-01-04 Advanced New Technologies Co., Ltd. Asset transfer reversal method and apparatus, and electronic device
CN109727030A (en) * 2018-12-18 2019-05-07 杭州茂财网络技术有限公司 Account data storage method in a kind of block chain
CN109783478A (en) * 2019-03-12 2019-05-21 长沙理工大学 A UTXO data storage method, device, device and storage medium
CN110675147A (en) * 2019-09-11 2020-01-10 上海唯链信息科技有限公司 Block chain transaction method, electronic equipment and storage device
CN110675147B (en) * 2019-09-11 2022-11-29 上海唯链信息科技有限公司 Block chain transaction method, electronic equipment and storage device
CN111027947A (en) * 2019-12-06 2020-04-17 湖北文理学院 UTXO wallet selection method, UTXO wallet selection equipment, UTXO wallet storage medium and UTXO wallet selection device
CN111027947B (en) * 2019-12-06 2023-09-19 湖北文理学院 UTXO wallet selection method, device, storage medium and device
CN111709742A (en) * 2020-05-18 2020-09-25 杜晓楠 Method for preventing root address exposure in blockchain system, computer readable storage medium and blockchain system
CN112488725A (en) * 2020-12-25 2021-03-12 杭州复杂美科技有限公司 Private authorized transfer method, device and storage medium
WO2022134612A1 (en) * 2020-12-25 2022-06-30 杭州复杂美科技有限公司 Confidential authorized transfer method, device, and storage medium
CN112488725B (en) * 2020-12-25 2022-04-05 杭州复杂美科技有限公司 Private authorized transfer method, device and storage medium
CN113269639A (en) * 2021-05-06 2021-08-17 众连智能科技有限公司 Business processing method, device, equipment and medium based on block chain intelligent contract

Similar Documents

Publication Publication Date Title
CN108876335A (en) A kind of management of balance method and system, equipment and storage medium
AU2018347195B2 (en) System and method for information protection
US11521212B2 (en) System and server for receiving transaction requests
US10999235B2 (en) Interface, method and computer program product for controlling the transfer of electronic messages
US11080690B2 (en) Device, system, method and computer program product for processing electronic transaction requests
CN111046109B (en) A cross-chain task processing method, device, equipment and readable storage medium
US20170344964A1 (en) Interface, System, Method and Computer Program Product for Controlling the Transfer of Electronic Messages
US20170344960A1 (en) A System, Method and Computer Program Product for Receiving Electronic Messages
CN112583811B (en) Wallet finding method, equipment and storage medium
GB2603309A (en) Transfering tokens between blockchain networks
WO2017162164A1 (en) Electronic signature device transaction method
SG10201800589WA (en) Virtual reality headset device and payment method
CN108921553A (en) A kind of thresholding private key generation method, method of commerce and relevant apparatus
US20110246424A1 (en) Automated relocation of in-use multi-site protected data storage
CN107395772A (en) The management method and management system of a kind of duplicate data
CN109816525A (en) A kind of data processing method and its device, medium, terminal
CN110147995A (en) A kind of auditing method based on key level
JP2015166988A (en) Data management device and data management method
EP4660914A1 (en) Transaction method and apparatus, device and storage medium
HK40028473A (en) Resource cross-chain transfer method and apparatus, computer device and storage medium
HK40028473B (en) Resource cross-chain transfer method and apparatus, computer device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20181123