Dual offline continuous transaction verification method, system and device for digital currency

By using smart contracts and ECC curves to generate transaction vouchers in the dual offline trading mode of digital currency, combined with the continuous trading model, the problem of ‘double spend’ and the source of vouchers is solved, and continuous transaction verification is realized in offline state, improving transaction flexibility and security.

CN119539788BActive Publication Date: 2025-04-11SHUKE LINK TECHNOLOGY (HANGZHOU) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510104774.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-04-11
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

The existing dual offline transaction mode of digital currency cannot be verified immediately whether the transaction is repeatedly executed in offline state, resulting in the problem of "double spending", limiting the application scope of large-scale transactions, and affecting the liquidity and convenience of digital currency.

Method used

By generating smart contracts for transaction vouchers, the target transaction vouchers of the payee are generated using any two random points on the ECC curve, and the transaction amount can be continuously verified in combination with the preset continuous transaction model, solving the source of the vouchers and preventing the ‘double spend’ problem.

Benefits of technology

It realizes continuous digital currency transactions in offline state, improves transaction flexibility and convenience, ensures the stability and security of the transaction system, and expands the application scope of digital currency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119539788B_ABST
    Figure CN119539788B_ABST
Patent Text Reader

Abstract

The present invention discloses a dual offline continuous transaction verification method, system and device for digital currency, the method includes obtaining relevant information of both parties in the transaction relationship; calling a smart contract for generating a transaction voucher, based on a random number and a target transaction amount, generating a target transaction amount transaction voucher of the payee through any two random points on an ECC curve; based on the transaction voucher, obtaining an input voucher and a payee change voucher, based on the input voucher and the payee change voucher and in combination with a preset continuous transaction model, performing a continuous transaction verification on the transaction amount; if the transaction amounts involved by both parties are the same, performing a hash calculation on the random number and the transaction data, and then obtaining a payee signature and a payee signature; obtaining a transaction signature based on the payee signature and the payee signature, obtaining a zero-sum result based on the transaction signature, and if the zero-sum result meets the preset conditions, the transaction relationship is valid. The present invention significantly improves transaction efficiency and greatly shortens the time required for transactions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a dual offline continuous transaction verification method, system and device for digital currency. Background Art

[0002] Digital currency, as a decentralized form of currency, has attracted widespread attention and has been widely used in recent years. With the vigorous development of digital currency, exchanges have emerged to provide users with convenient digital currency trading platforms. Although these trading platforms provide convenience for digital currency transactions, they are also accompanied by a series of security challenges, such as network attacks, transaction tampering, and personal information leakage. In order to solve the security risks of digital currency transactions, some offline transaction modes have been proposed. Although the offline transaction mode provides a certain degree of security, the current offline transactions are usually one-time, that is, once the offline transaction is completed, the user needs to reconnect to the network to conduct the next transaction. Therefore, the demand for a dual offline continuous transaction mode is proposed, which enables users to conduct continuous digital currency transactions in an offline state, thereby improving the flexibility and convenience of transactions.

[0003] At present, dual offline transaction technology is mainly used in areas where network signals are unstable or not covered by the network, such as basements, parking lots, areas affected by geographical disasters, places with high density of people, and areas with poor signals under special environments. In addition, this technology has been applied in the field of digital RMB. The core algorithm of dual offline transactions mainly relies on cryptography technology. During the payment process, the payment device uses the private key to sign the payment information, and the verification device uses the public key to verify the signature. The private key and the public key constitute a pair of key systems, which are generated by the user and stored in the offline device. The algorithm ensures the security and authenticity of the transaction. Even if one of the devices is attacked or lost, the security of the payment information will not be threatened.

[0004] However, the dual offline transaction mode of digital currency also has some shortcomings. In an offline state, it is impossible to verify whether the transaction is executed repeatedly in real time, which is commonly known as the "double spending" or double spending problem. This problem limits the scope of application of dual offline payment to a certain extent, especially when it comes to large transactions, the risk is more significant. Therefore, at this stage, dual offline payment is more suitable for small transaction scenarios to reduce potential losses caused by double spending problems. Digital currency received in an offline state must be confirmed and recorded after connecting to the Internet before subsequent transactions can be carried out. Before connecting to the Internet, these digital currencies will be marked as "pending repeated payment verification". Only after passing the repeated payment verification and successfully entering the account after connecting to the Internet can they re-enter the circulation link. This process affects the liquidity and convenience of digital currency to a certain extent. Although the digital currency dual offline transaction algorithm plays a key role in ensuring the security and authenticity of transactions, it also faces defects such as double spending problems and secondary circulation restrictions. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides a dual offline continuous transaction verification method, system and device for digital currency.

[0006] In order to solve the above technical problems, the present invention is solved by the following technical solutions:

[0007] A dual offline continuous transaction verification method for digital currency, comprising the following steps:

[0008] Obtaining relevant information of both parties in the transaction relationship, wherein the relevant information includes the target transaction amount and the random number involved, and the two parties in the transaction include the payer and the payee;

[0009] Call the smart contract for generating transaction vouchers, and generate a transaction voucher of the target transaction amount of the payee based on the random number and the target transaction amount through any two random points on the ECC curve, wherein the transaction voucher includes the transaction amount involved by both parties to the transaction;

[0010] Based on the transaction voucher, an input voucher and a payer's change voucher are obtained, and a continuous transaction verification is performed on the transaction amount based on the input voucher and the payer's change voucher in combination with a preset continuous transaction model;

[0011] If the transaction amount involved by both parties is the same, the random number and transaction data are hashed to obtain the hash value, and then the payee's signature and the payee's signature are obtained;

[0012] The transaction signature is obtained based on the payer's signature and the payee's signature, and the zero-sum result is obtained based on the transaction signature. If the zero-sum result meets the preset conditions, the transaction relationship is valid.

[0013] As an implementable embodiment, the transaction voucher is represented as:

[0014] Enter the credentials, expressed as:

[0015] The payer's change voucher is expressed as:

[0016] in, They represent input voucher, payer change voucher and transaction voucher respectively. They represent the change amount, the received amount, and the input amount respectively. Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, The random numbers representing the change voucher, receipt voucher and input voucher respectively.

[0017] As an implementable method, the continuous transaction verification of the transaction amount based on the input voucher and the payer's change voucher in combination with a preset continuous transaction model includes the following steps:

[0018] Based on the input voucher and the payer's change voucher, a first verification relationship is constructed, which is expressed as follows:

[0019]

[0020] Expand the first verification relationship to obtain the expanded verification relationship, which is expressed as follows:

[0021]

[0022] in, For scalar calculation, if If is a non-influence item, then: ;

[0023] When the input amount and output amount are the same, the input document is converted to: , the verification is successful;

[0024] in, They represent input voucher, payer change voucher and transaction voucher respectively. The corner mark is used to distinguish each transaction. Respectively represent the transaction data of the payer and the payee, Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Indicates the number of times.

[0025] As an implementable method, performing hash calculation on the random number and transaction data to obtain a hash value, and then obtaining the payer's signature and the payee's signature, includes the following steps:

[0026] The payer random number is expressed as: , the recipient's random number is expressed as: ;

[0027] The payer's random number and the payee's random number are hashed to obtain the hash value of the transaction information, which is expressed as follows:

[0028]

[0029] Based on the hash value, the payer's signature and the payee's signature are calculated, and the transaction signature is obtained based on the payer's signature and the payee's signature;

[0030] Sender's signature:

[0031] Recipient's signature:

[0032] Transaction signature:

[0033] in, Indicates the difference between the random number of the change voucher and the input voucher for consecutive transactions. Indicates The difference between the random number of the change voucher and the input voucher for consecutive transactions, They represent input voucher and payer's change voucher respectively. Respectively represent the first to the The input voucher and the payer's change voucher, They represent specific points on the ECC curve and serve as public keys in the encryption process. They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Indicates the payer's random number. Indicates the random number of the recipient. Represents the random number generated when the payer signs the transaction. It represents the random number generated when the payee signs the transaction, and E represents the hash value of the transaction information. They represent the random numbers of input voucher, change voucher and receipt voucher respectively. SHA represents the SHA encryption algorithm. UUID is the password construction standard.

[0034] As an implementable method, the transaction signature is updated, and a zero-sum result is obtained based on the updated transaction signature. If the zero-sum result meets the preset conditions, the transaction relationship is valid, including the following steps:

[0035] Update the transaction signature, as follows:

[0036]

[0037] The preset condition is a preset proof condition, and the preset proof condition is expressed as follows:

[0038] ,

[0039] When the preset proof conditions are met, the transaction relationship is valid;

[0040] in, Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Respectively represent the signature of the payee and the signature of the payee. Indicates the updated payee signature. Respectively represent updating transaction signature and updating random number, Represents the random number generated when the payer signs the transaction. Indicates the random number generated when the recipient signs the transaction.

[0041] As an implementable method, the zero-sum result is obtained based on the transaction signature. If the zero-sum result meets the preset conditions, the transaction relationship is valid, including the following steps:

[0042] The zero-sum result is represented as follows:

[0043]

[0044] The preset condition is a preset proof condition, and the preset proof condition is expressed as follows:

[0045] ,

[0046] When the preset proof conditions are met, the transaction relationship is valid;

[0047] in, They represent input voucher, payer change voucher and transaction voucher respectively. Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Respectively represent the signature of the payee and the signature of the payee. Indicates The difference between the random number of the change voucher and the input voucher for consecutive transactions, Represent transaction signature and random number respectively, Indicates the updated payee signature.

[0048] As an implementable method, the following steps are also included:

[0049] Execute the transaction. If the current transaction is completed, send the payee an instruction to delete the input voucher and use the change voucher as the new input voucher.

[0050] A dual offline continuous transaction verification system for digital currency, including a data acquisition module, a call generation module, a preliminary verification module, a signature calculation module and a transaction verification module;

[0051] The data acquisition module is used to acquire relevant information of both parties in the transaction relationship, wherein the relevant information includes the target transaction amount and the random number involved, and the two parties include the payer and the payee;

[0052] The calling generation module is used to call the smart contract for generating a transaction voucher, and based on the random number and the target transaction amount, generate a transaction voucher of the target transaction amount of the payee through any two random points on the ECC curve, wherein the transaction voucher includes the transaction amount involved by both parties to the transaction;

[0053] The preliminary verification module obtains an input voucher and a payer's change voucher based on the transaction voucher, and performs a continuous transaction verification on the transaction amount based on the input voucher and the payer's change voucher in combination with a preset continuous transaction model;

[0054] The signature calculation module, if the transaction amount involved by both parties is the same, performs hash calculation on the random number and transaction data to obtain a hash value, and then obtains the payer's signature and the payee's signature;

[0055] The transaction verification module obtains a transaction signature based on the payer's signature and the payee's signature, and obtains a zero-sum result based on the transaction signature. If the zero-sum result meets a preset condition, the transaction relationship is valid.

[0056] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method is implemented:

[0057] Obtaining relevant information of both parties in the transaction relationship, wherein the relevant information includes the target transaction amount and the random number involved, and the two parties in the transaction include the payer and the payee;

[0058] Call the smart contract for generating transaction vouchers, and generate a transaction voucher of the target transaction amount of the payee based on the random number and the target transaction amount through any two random points on the ECC curve, wherein the transaction voucher includes the transaction amount involved by both parties to the transaction;

[0059] Based on the transaction voucher, an input voucher and a payer's change voucher are obtained, and a continuous transaction verification is performed on the transaction amount based on the input voucher and the payer's change voucher in combination with a preset continuous transaction model;

[0060] If the transaction amount involved by both parties is the same, the random number and transaction data are hashed to obtain the hash value, and then the payee's signature and the payee's signature are obtained;

[0061] The transaction signature is obtained based on the payer's signature and the payee's signature, and the zero-sum result is obtained based on the transaction signature. If the zero-sum result meets the preset conditions, the transaction relationship is valid.

[0062] A dual offline continuous transaction verification device for digital currency, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the following method when executing the computer program:

[0063] Obtaining relevant information of both parties in the transaction relationship, wherein the relevant information includes the target transaction amount and the random number involved, and the two parties in the transaction include the payer and the payee;

[0064] Call the smart contract for generating transaction vouchers, and generate a transaction voucher of the target transaction amount of the payee based on the random number and the target transaction amount through any two random points on the ECC curve, wherein the transaction voucher includes the transaction amount involved by both parties to the transaction;

[0065] Based on the transaction voucher, an input voucher and a payer's change voucher are obtained, and a continuous transaction verification is performed on the transaction amount based on the input voucher and the payer's change voucher in combination with a preset continuous transaction model;

[0066] If the transaction amount involved by both parties is the same, the random number and transaction data are hashed to obtain the hash value, and then the payee's signature and the payee's signature are obtained;

[0067] The transaction signature is obtained based on the payer's signature and the payee's signature, and the zero-sum result is obtained based on the transaction signature. If the zero-sum result meets the preset conditions, the transaction relationship is valid.

[0068] The present invention has significant technical effects due to the adoption of the above technical solution:

[0069] In view of the defects of the prior art, the present invention creatively designs and implements a sustainable dual offline transaction mode. This mode not only includes the design of transaction logic, but also combines an efficient implementation of a zero-knowledge proof algorithm based on elliptic curve cryptography (ECC). During the research and development process, the wide applicability of this mode was fully considered. The designed algorithm performs well in terms of memory and computing power consumption, and can easily adapt to different hardware platforms, whether it is a computer, mobile phone, encrypted wallet or smart card system, it can run smoothly.

[0070] Driven by the need to cope with continuous dual offline transactions, the solution of the present invention is based on the transaction mode of traditional paper money or physical currency, and performs digital abstract processing on physical currency, creating an "encrypted digital string" equivalent to physical currency, which is referred to as "voucher" in the present invention. After obtaining the "voucher", the present invention deeply explores the characteristics of ECC encryption technology to solve the problem of how to generate new transactions from old vouchers, ensuring that the voucher can continue to circulate in subsequent transactions. After solving the logic and algorithm problems of continuous offline transactions, it is also necessary to solve the source of the voucher and prevent the "double-spending" problem. The present invention realizes the generation and verification of vouchers by using smart contract technology on the blockchain, and the source of funds for the generation of vouchers can rely on other virtual currencies or custom currency systems. This technology effectively combines offline transactions with on-chain generation and verification functions, successfully solves the source of vouchers and the "double-spending" problem, and ensures the stability and security of the entire transaction system.

[0071] The present invention aims to solve the two core problems faced by the offline transaction field. By deeply analyzing the characteristics of elliptic curve cryptography (ECC) technology, the present invention ensures the continuous circulation of "credentials" in transactions, thereby solving the logic and algorithm problems of continuous offline transactions. With the support of blockchain technology, through the implementation of smart contracts, the generation and verification process of "credentials" is realized, and offline transactions are seamlessly connected with on-chain operations, effectively solving the problem of credential sources and preventing "double spending". By combining ECC encryption technology with smart contracts, the present invention realizes continuous dual offline transactions, ensures the stability and security of the transaction system, and has a far-reaching impact on the development of digital currency offline transactions.

[0072] The dual offline payment technology of the present invention allows the payer and the payee to complete the transaction when both parties are offline, without waiting for the network to recover or connect to the central bank's digital currency registration system. This greatly shortens the transaction time and improves transaction efficiency. In particular, dual offline payment provides a practical solution in special environments where the network signal is poor or there is no connection to the Internet.

[0073] The dual offline payment technology of the present invention greatly expands the application scope of digital currency. In special environments such as basements, parking lots, mountainous areas and even geographical disasters, dual offline payment can meet people's payment needs and effectively solve the limitations of traditional payment methods in these scenarios.

[0074] The dual offline payment of the present invention adopts advanced encryption technology, such as chip hardware encryption and software encryption in NFC technology, to ensure the security of point-to-point encrypted communication. This payment method not only improves the security of the payment process, but also reduces the payment risk caused by network problems.

[0075] The realization of dual offline payment in the present invention further promotes the popularization of digital currency. As the public's cognition and acceptance of digital currency continue to increase, dual offline payment, as a convenient and efficient payment method, will gradually become an important choice in people's daily life. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0077] Figure 1 It is a schematic flow diagram of the method of the present invention;

[0078] Figure 2 It is a schematic diagram of the overall structure of the system of the present invention;

[0079] Figure 3 It is a schematic diagram of a specific embodiment of the present invention. DETAILED DESCRIPTION

[0080] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.

[0081] Embodiment 1:

[0082] A dual offline continuous transaction verification method for digital currency, such as Figure 1 As shown, the following steps are included:

[0083] S100, obtaining relevant information of both parties in the transaction relationship, wherein the relevant information includes the target transaction amount and the random number involved, and the two parties include the payer and the payee;

[0084] S200, calling a smart contract for generating a transaction voucher, and generating a transaction voucher of the target transaction amount of the payee through any two random points on the ECC curve based on a random number and a target transaction amount, wherein the transaction voucher includes the transaction amount involved by both parties to the transaction;

[0085] S300, based on the transaction voucher, obtaining an input voucher and a payer's change voucher, and performing a continuous transaction verification on the transaction amount based on the input voucher and the payer's change voucher and in combination with a preset continuous transaction model;

[0086] S400. If the transaction amounts involved by both parties are the same, a hash calculation is performed on the random number and the transaction data to obtain a hash value, and then the payee's signature and the payee's signature are obtained;

[0087] S500: Obtain a transaction signature based on the payer's signature and the payee's signature, and obtain a zero-sum result based on the transaction signature. If the zero-sum result meets a preset condition, the transaction relationship is valid.

[0088] The credential in this application can be understood as an encrypted digital string, and the transaction credential is expressed as:

[0089] Enter the credentials, expressed as:

[0090] The payer's change voucher is expressed as:

[0091] in, They represent input voucher, payer change voucher and transaction voucher respectively. They represent the change amount, the received amount, and the input amount respectively. Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, The random numbers representing the change voucher, receipt voucher and input voucher respectively.

[0092] In one embodiment, performing hash calculation on the random number and transaction data to obtain a hash value, and then obtaining the payer's signature and the payee's signature, includes the following steps:

[0093] The payer random number is expressed as: , the recipient's random number is expressed as: ;

[0094] The payer's random number and the payee's random number are hashed to obtain the hash value of the transaction information, which is expressed as follows:

[0095]

[0096] Based on the hash value, the payer's signature and the payee's signature are calculated, and the transaction signature is obtained based on the payer's signature and the payee's signature;

[0097] Sender's signature:

[0098] Recipient's signature:

[0099] Transaction signature:

[0100] in, Indicates the difference between the random number of the change voucher and the input voucher for consecutive transactions. Indicates The difference between the random number of the change voucher and the input voucher for consecutive transactions, They represent input voucher and payer's change voucher respectively. Respectively represent the first to the The input voucher and the payer's change voucher, They represent specific points on the ECC curve and serve as public keys in the encryption process. They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Indicates the payer's random number. Indicates the random number of the recipient. Represents the random number generated when the payer signs the transaction. It represents the random number generated when the payee signs the transaction, and E represents the hash value of the transaction information. They represent the random numbers of input voucher, change voucher and receipt voucher respectively. SHA represents the SHA encryption algorithm. UUID is the password construction standard.

[0101] In addition, after the transaction is completed, the payee will be issued an instruction to delete the input voucher, which means that the payee is required to delete the input voucher and then use the change voucher as the new input voucher.

[0102] In a specific embodiment, based on the input voucher and the payer's change voucher and in combination with a preset continuous transaction model, a continuous transaction verification is performed on the transaction amount, including the following steps:

[0103] Based on the input voucher and the payer's change voucher, a first verification relationship is constructed, which is expressed as follows:

[0104]

[0105] Expand the first verification relationship to obtain the expanded verification relationship, which is expressed as follows:

[0106]

[0107] in, For scalar calculation, if If is a non-influence item, then: ;

[0108] When the input amount and output amount are the same, the input document is converted to: , the verification is successful;

[0109] in, They represent input voucher, payer change voucher and transaction voucher respectively. The corner mark is used to distinguish each transaction. Respectively represent the transaction data of the payer and the payee, Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Indicates the number of times.

[0110] In the actual practice, there will also be an update of the transaction signature, based on which a zero-sum result is obtained. If the zero-sum result meets the preset conditions, the transaction relationship is valid, including the following steps:

[0111] Update the transaction signature, as follows:

[0112]

[0113] The preset condition is a preset proof condition, and the preset proof condition is expressed as follows:

[0114] ,

[0115] When the preset proof conditions are met, the transaction relationship is valid;

[0116] in, Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Respectively represent the signature of the payee and the signature of the payee. Indicates the updated payee signature. Respectively represent updating transaction signature and updating random number, Represents the random number generated when the payer signs the transaction. Indicates the random number generated when the recipient signs the transaction.

[0117] This embodiment is another variation of verification through transaction signature. The zero-sum result is obtained based on the transaction signature. If the zero-sum result meets the preset conditions, the transaction relationship is valid, including the following steps:

[0118] The zero-sum result is represented as follows:

[0119]

[0120] The preset condition is a preset proof condition, and the preset proof condition is expressed as follows:

[0121] ,

[0122] When the preset proof conditions are met, the transaction relationship is valid;

[0123] in, They represent input voucher, payer change voucher and transaction voucher respectively. Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Respectively represent the signature of the payee and the signature of the payee. Indicates The difference between the random number of the change voucher and the input voucher for consecutive transactions, Represent transaction signature and random number respectively, Indicates the updated payee signature.

[0124] In actual use, this solution is implemented in combination with a credential holding device (mobile phone, computer, hardware wallet, smart card, etc.). This credential holding device can be regarded as a hardware system that can run a dual offline transaction algorithm.

[0125] The whole process includes the following steps:

[0126] Generate relevant vouchers and provide them to the voucher holding device to realize the production of original vouchers;

[0127] The credential holders use the designed dual offline transaction zero-knowledge proof algorithm to Figure 3 The process shown implements a dual offline transaction process, and this transaction process can be repeated; the credential received or remaining by the credential holding device completes the credential verification process.

[0128] Figure 3For the dual offline transaction process between voucher holding devices, for the convenience of explanation and implementation, it can be divided into a transaction voucher area and a receiving voucher area, wherein the change voucher in the transaction voucher area comes from the voucher of the contract on the chain or the voucher sent, and the receiving voucher area comes from the voucher obtained by the dual offline transaction. The first voucher holding device obtains the input voucher, and then decomposes the input voucher to obtain the change voucher. The change voucher, the input voucher and the payment signature are sent together to the second voucher holding device, which is received by the receiving voucher area of ​​the second voucher holding device and verified by the transaction voucher area. In the first voucher holding device, after the transaction is completed, the change voucher will be used as the "input voucher" for the next transaction, that is, through the transaction algorithm designed by this scheme, the voucher can be reused. The core of the implementation is the decomposition of the input voucher, that is, the money in the input voucher will be decomposed into the change voucher in each transaction. The input voucher is used to submit to the security hardware for verification, and the change voucher is saved and used as the input voucher in the next transaction to re-transact.

[0129] In order to achieve continuous transactions, the input credentials are encrypted and accumulated, and the algorithm can be verified when neither party knows the true value. The algorithm is based on the zero-knowledge proof algorithm of elliptic curve encryption technology, realizes a dual offline transaction algorithm, and can realize transaction proof on installation hardware such as security hardware.

[0130] The symbol " " respectively codes the addition, multiplication and subtraction of points on the ECC curve, where subtraction is the operation of taking the inverse of a point and then adding it, and the other symbols used are the usual digital title addition and subtraction operations. The order of calculation of addition, multiplication and subtraction of points is the same as the usual digital calculation order. In particular, this document does not explain the calculation method of addition, multiplication and subtraction on the ECC curve (calculation on discrete groups).

[0131] Q and H used in the present invention hereinafter are specific points on a known ECC encryption curve, which can be generated by random numbers, and the transaction parties know the parameter values.

[0132] The general form of the credentials described in this invention is as follows:

[0133]

[0134] Where V is the quantity (amount) information to be stored in the voucher; R is the Nonce generated according to specific rules, which is the random number mentioned above. Nonce is the abbreviation of Number once. In cryptography, Nonce is an arbitrary or non-repeated random value used only once. Its function is to confuse the quantity, which is called the confusion factor below. The generation relationship of R is as follows:

[0135]

[0136] In the formula It is a random number generated by a true random number generator during a transaction, which is used as a confusion factor for the sender (transaction payer) to input the voucher, i.e., a random number. This random number is only held by the sender, and therefore can only be correctly decomposed by the sender. The confusion factor of the sender's change voucher is a random number. The difference between the random number of the change voucher and the input voucher for consecutive transactions.

[0137] The other part of the voucher is the transaction quantity V. Its decomposition logic is similar to that of R. The data V has the following relationship:

[0138]

[0139] In the formula is the amount of the voucher, is the sender’s change amount, The amount to be spent. This number does not need to be encrypted to the recipient, because this value is the number expected by the recipient. The transaction can only be made when the number is the same as the number expected by the recipient.

[0140] Based on the above process, a set of credentials (sender) used in the transaction can be obtained as follows:

[0141] Enter the voucher for this transaction:

[0142] Change voucher:

[0143] The input voucher is the original voucher, Only the sender can know.

[0144] Based on the credentials, it is easy to deduce that the recipient's credentials are:

[0145]

[0146] In the formula, The new random number introduced is also called a blinding factor in this field and can be used as a private key. It is the number expected by the receiver, which should be the same as the number promised by the sender.

[0147] From the transaction voucher, we can see that the sender has reasonably hidden the deception factor, transaction amount and other information by decomposing it, making it impossible for the receiver to restore and speculate the content of the voucher. The following formula is obtained:

[0148]

[0149] Calculate the above formula to get:

[0150]

[0151] in The operation has no effect on the calculation result, that is, the calculation result of the voucher can be converted to .

[0152] As you can see from the above demonstration, because the total input amount and output amount are the same, and because all items related to "V" are calculated to zero (O) after calculation, this item can be ignored.

[0153] Based on the above formula, further in-depth analysis is required. Since we only need to ensure that the sum of the number of sent and received messages is "0", we can generalize the single verification method above and get the following formula:

[0154]

[0155] Expanding and calculating it gives the following formula:

[0156]

[0157] In the formula For scalar calculation of large numbers, since it can be understood as a large number and O represents the number 0, it can be simplified to .

[0158] From the above calculation process, we can see that if the sender and the receiver want to obtain the same amount, the final result calculated through the voucher will not contain items related to the amount. Otherwise, it will not be possible to obtain items related only to the deception factor.

[0159] By calculation, we should finally get only As a result, in order to confirm that it is only related to the deception factors of both parties, the sender also needs to embed the content and its information in the information provided to the receiver for verification in a reasonable way.

[0160] Both parties need to generate their own Nonce for signature, which are and The HASH value of the transaction information is as follows:

[0161]

[0162] Among other things, the sender signs:

[0163] Recipient's signature:

[0164] Transaction signature:

[0165] Update the transaction signature to:

[0166] The zero-sum result obtained above is expressed as:

[0167]

[0168] The proof formula is as follows:

[0169]

[0170]

[0171] When the above formula is established, it can be proved that the transaction is valid.

[0172] Embodiment 2:

[0173] A dual offline continuous transaction verification system for digital currency, such as Figure 2 As shown, it includes a data acquisition module 100, a call generation module 200, a preliminary verification module 300, a signature calculation module 400 and a transaction verification module 500;

[0174] The data acquisition module 100 is used to acquire relevant information of both parties in the transaction relationship, wherein the relevant information includes the target transaction amount and the random number involved, and the two parties in the transaction include the payer and the payee;

[0175] The calling generation module 200 is used to call the smart contract for generating a transaction voucher, and based on the random number and the target transaction amount, generate a transaction voucher of the target transaction amount of the payee through any two random points on the ECC curve, wherein the transaction voucher includes the transaction amount involved by both parties to the transaction;

[0176] The preliminary verification module 300 obtains the input voucher and the payer's change voucher based on the transaction voucher, and performs continuous transaction verification on the transaction amount based on the input voucher and the payer's change voucher in combination with a preset continuous transaction model;

[0177] The signature calculation module 400 performs hash calculation on the random number and transaction data to obtain a hash value, and then obtains the payee's signature and the payee's signature if the transaction amount involved by the two parties is the same;

[0178] The transaction verification module 500 obtains a transaction signature based on the payer's signature and the payee's signature, and obtains a zero-sum result based on the transaction signature. If the zero-sum result meets a preset condition, the transaction relationship is valid.

[0179] In addition, it should be noted that the shapes and names of the parts and components of the specific embodiments described in this specification may be different. Any equivalent or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. The technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A dual offline continuous transaction verification method for digital currency, characterized in that: The following steps are involved: Obtaining relevant information of both parties in the transaction relationship, wherein the relevant information includes the target transaction amount and the random number involved, and the two parties in the transaction include the payer and the payee; Call the smart contract for generating transaction vouchers, and generate a transaction voucher of the target transaction amount of the payee based on the random number and the target transaction amount through any two random points on the ECC curve, wherein the transaction voucher includes the transaction amount involved by both parties to the transaction; Based on the transaction voucher, an input voucher and a payer's change voucher are obtained, and a continuous transaction verification is performed on the transaction amount based on the input voucher and the payer's change voucher in combination with a preset continuous transaction model; If the transaction amount involved by both parties is the same, the random number and transaction data are hashed to obtain the hash value, and then the payee's signature and the payee's signature are obtained; The transaction signature is obtained based on the payer's signature and the payee's signature, and the zero-sum result is obtained based on the transaction signature. If the zero-sum result meets the preset conditions, the transaction relationship is valid.

2. The dual offline continuous transaction verification method for digital currency according to claim 1 is characterized in that: The transaction voucher is represented by: Enter the credentials, expressed as: The payer's change voucher is expressed as: in, They represent input voucher, payer change voucher and transaction voucher respectively. They represent the change amount, the received amount, and the input amount respectively. Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, The random numbers representing the change voucher, receipt voucher and input voucher respectively.

3. The dual offline continuous transaction verification method for digital currency according to claim 1 is characterized in that: The continuous transaction verification of the transaction amount based on the input voucher and the payer's change voucher in combination with a preset continuous transaction model includes the following steps: Based on the input voucher and the payer's change voucher, a first verification relationship is constructed, which is expressed as follows: Expand the first verification relationship to obtain the expanded verification relationship, which is expressed as follows: in, For scalar calculation, if If is a non-influence item, then: ; When the input amount and output amount are the same, the input document is converted to: , the verification is successful; in, They represent input voucher, payer change voucher and transaction voucher respectively. The corner mark is used to distinguish each transaction. Respectively represent the transaction data of the payer and the payee, Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Indicates the number of times.

4. The dual offline continuous transaction verification method for digital currency according to claim 1 is characterized in that: The process of performing hash calculation on the random number and the transaction data to obtain a hash value, and then obtaining the payee's signature and the payee's signature, includes the following steps: The payer random number is expressed as: , the recipient's random number is expressed as: ; The payer's random number and the payee's random number are hashed to obtain the hash value of the transaction information, which is expressed as follows: Based on the hash value, the payer's signature and the payee's signature are calculated, and the transaction signature is obtained based on the payer's signature and the payee's signature; Sender's signature: Recipient's signature: Transaction signature: in, Indicates the difference between the random number of the change voucher and the input voucher for consecutive transactions. Indicates The difference between the random number of the change voucher and the input voucher for consecutive transactions, They represent input voucher and payer's change voucher respectively. Respectively represent the first to the The input voucher and the payer's change voucher, They represent specific points on the ECC curve and serve as public keys in the encryption process. They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Indicates the payer's random number. Indicates the random number of the recipient. Represents the random number generated when the payer signs the transaction. It represents the random number generated when the payee signs the transaction, and E represents the hash value of the transaction information. They represent the random numbers of input voucher, change voucher and receipt voucher respectively. SHA represents the SHA encryption algorithm. UUID is the password construction standard.

5. The dual offline continuous transaction verification method for digital currency according to claim 1 is characterized in that: Update the transaction signature and obtain a zero-sum result based on the updated transaction signature. If the zero-sum result meets the preset conditions, the transaction relationship is valid, including the following steps: Update the transaction signature, as follows: The preset condition is a preset proof condition, and the preset proof condition is expressed as follows: , When the preset proof conditions are met, the transaction relationship is valid; in, Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Respectively represent the signature of the payee and the signature of the payee. Indicates the updated payee signature. Respectively represent updating transaction signature and updating random number, Represents the random number generated when the payer signs the transaction. Indicates the random number generated when the recipient signs the transaction.

6. The dual offline continuous transaction verification method for digital currency according to claim 1 is characterized in that: The zero-sum result is obtained based on the transaction signature. If the zero-sum result meets the preset conditions, the transaction relationship is valid, including the following steps: The zero-sum result is represented as follows: The preset condition is a preset proof condition, and the preset proof condition is expressed as follows: , When the preset proof conditions are met, the transaction relationship is valid; in, They represent input voucher, payer change voucher and transaction voucher respectively. Respectively represent specific points on the ECC curve, They represent the multiplication and addition of specific points on the ECC curve, They represent the random numbers generated by the true random number generator for the payer and the payee during the transaction. Respectively represent the signature of the payee and the signature of the payee. Indicates The difference between the random number of the change voucher and the input voucher for consecutive transactions, Represents transaction signature and random number respectively, Indicates the updated payee signature.

7. The dual offline continuous transaction verification method for digital currency according to claim 1 is characterized in that: The following steps are also included: Execute the transaction. If the current transaction is completed, send the payee an instruction to delete the input voucher and use the change voucher as the new input voucher.

8. A dual offline continuous transaction verification system for digital currency, characterized in that: It includes data acquisition module, call generation module, preliminary verification module, signature calculation module and transaction verification module; The data acquisition module is used to acquire relevant information of both parties in the transaction relationship, wherein the relevant information includes the target transaction amount and the random number involved, and the two parties include the payer and the payee; The calling generation module is used to call the smart contract for generating a transaction voucher, and based on the random number and the target transaction amount, generate a transaction voucher of the target transaction amount of the payee through any two random points on the ECC curve, wherein the transaction voucher includes the transaction amount involved by both parties to the transaction; The preliminary verification module obtains an input voucher and a payer's change voucher based on the transaction voucher, and performs a continuous transaction verification on the transaction amount based on the input voucher and the payer's change voucher in combination with a preset continuous transaction model; The signature calculation module, if the transaction amount involved by both parties is the same, performs hash calculation on the random number and transaction data to obtain a hash value, and then obtains the payer's signature and the payee's signature; The transaction verification module obtains a transaction signature based on the payer's signature and the payee's signature, and obtains a zero-sum result based on the transaction signature. If the zero-sum result meets a preset condition, the transaction relationship is valid.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. A dual offline continuous transaction verification device for digital currency, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Block chain intelligent contract-oriented undetachable digital signature general construction method

    CN110233733A

  • Privacy protection method and device based on blockchain smart contract

    CN111277415A