NFT privacy transaction method, computer device and storage medium

By configuring multiple zero-knowledge proof circuits on the blockchain, an NFT privacy transaction method with complete privacy of other information except for the transaction amount during the NFT transaction process is realized, and the problem of insufficient information privacy in the existing NFT transaction solutions is solved.

CN114565384BActive Publication Date: 2025-02-07SHENZHEN CULTURAL PROPERTY EXCHANGE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210203719.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-03
Publication Date
2025-02-07
Estimated Expiration
2042-03-03

AI Technical Summary

Technical Problem

Existing NFT trading solutions are difficult to achieve transactions with complete privacy in addition to the transaction amount.

Method used

By configuring the first zero-knowledge proof circuit on the blockchain to verify whether the seller is an NFT owner, verifying the legality of the uneffective check that is paid, and verifying the NFT submitted by the buyer The third zero-knowledge proof circuit for the legality of ID, the fourth zero-knowledge proof circuit for validity of checks used by the buyer, and the fifth zero-knowledge proof circuit for verifying the legality of checks submitted by the buyer, Implement anonymous sales and purchase transactions for NFTs.

Benefits of technology

During the NFT transaction process, other information in addition to the transaction amount (such as paid accounts, spending amount, change amount, etc.) is completely private, ensuring the privacy of the transaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565384B_ABST
    Figure CN114565384B_ABST
Patent Text Reader

Abstract

The present invention provides an NFT privacy transaction method, computer equipment and storage medium, the method comprising: executing an NFT anonymous sale transaction: inputting a first hash ID and a first proof information into a first verification algorithm; inputting a second hash ID, a payment amount and a second proof information into a second verification algorithm; if each verification is passed, the anonymous sale order is recorded on the chain; executing an NFT anonymous purchase transaction: inputting a third hash ID and a third proof information into a third verification algorithm; inputting a fourth hash ID, a first encrypted amount and a fourth proof information into a fourth verification algorithm; inputting a fifth hash ID, a second encrypted amount and a fifth proof information into a fifth verification algorithm; verifying whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the payment amount and the first ellipse base point; if each verification is passed, the second expendable check is invalidated, the first and third expendable checks are valid, and the NFT owner is updated to the third hash ID. The present invention realizes privacy NFT transactions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and specifically to an NFT privacy transaction method, computer device and storage medium. Background Art

[0002] The full name of NFT in English is Non-Fungible Token, that is, non-fungible token, which has the characteristics of indivisibility, irreplaceability and uniqueness.

[0003] Correspondingly, a homogeneous token is a token where each token is exactly the same, for example, one game coin and another game coin are exactly the same and there is no difference between them;

[0004] The current application of NFT is that each unique NFT can be used as an ownership mark of a unique digital asset. For example, NFT1 is used as an ownership mark of a digital avatar, NFT2 is used as an ownership mark of a virtual cat in a game, and so on.

[0005] The current NFT trading scheme makes it difficult to achieve transactions that ensure complete privacy of other information besides the public transaction amount. Summary of the invention

[0006] In view of the above-mentioned defects or deficiencies in the prior art, it is desired to provide an NFT privacy transaction method, computer equipment and storage medium that can ensure complete privacy of information other than the transaction amount during the transaction process.

[0007] In a first aspect, the present invention provides an NFT privacy transaction method applicable to a blockchain node, wherein the blockchain is deployed with an NFT privacy transaction contract, and the NFT privacy transaction contract is configured with a first zero-knowledge proof circuit for verifying whether the seller is the owner of the NFT being traded, a second zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check to be collected, a third zero-knowledge proof circuit for verifying the legitimacy of an unvalidated new hash ID of the NFT being traded submitted by the buyer, a fourth zero-knowledge proof circuit for verifying the legitimacy of an validated spendable check used by the buyer, and a fifth zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check for change submitted by the buyer, the method comprising:

[0008] Execute an anonymous NFT sale transaction:

[0009] Inputting the first hash ID and the first proof information of the first NFT to be sold into the verification algorithm of the first zero-knowledge proof circuit for verification;

[0010] Inputting the second hash ID of the unvalidated first spendable check to be collected, the amount of the collection, and the second proof information into the verification algorithm of the second zero-knowledge proof circuit for verification;

[0011] If any verification fails, the NFT anonymous sale transaction will fail;

[0012] If all verifications are passed, the anonymous sale order of the first NFT will be recorded on the blockchain for the buyer’s device to access;

[0013] To perform an anonymous NFT purchase transaction:

[0014] Inputting the unvalidated third hash ID and third proof information of the first NFT into the verification algorithm of the third zero-knowledge proof circuit for verification;

[0015] Inputting the fourth hash ID, the first encrypted amount and the fourth proof information of the validated second spendable check used for payment into the verification algorithm of the fourth zero-knowledge proof circuit for verification;

[0016] Inputting the fifth hash ID, the second encrypted amount, and the fifth proof information of the unvalidated third spendable check used for change into the verification algorithm of the fifth zero-knowledge proof circuit for verification;

[0017] Verify whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the received amount and the first ellipse base point;

[0018] If any verification fails, the NFT anonymous purchase transaction will fail;

[0019] If all verifications are passed, the second spendable check will be invalidated, the first spendable check and the third spendable check will be valid, and the owner of the first NFT will be updated to the third hash ID.

[0020] Wherein, the first encrypted amount E1 = amount1*G+r*H;

[0021] The second encrypted amount E2 = amount2*G+r*H;

[0022] amount1 is the amount of the second spendable check, amount2 is the amount of the third spendable check, r is a random number, G is the first elliptic curve base point, and H is the second elliptic curve base point.

[0023] In a second aspect, the present invention provides an NFT privacy transaction method applicable to a user end of a seller, wherein a blockchain is deployed with an NFT privacy transaction contract, and the NFT privacy transaction contract is configured with a first zero-knowledge proof circuit for verifying whether the seller is the owner of the NFT being traded, a second zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check to be collected, a third zero-knowledge proof circuit for verifying the legitimacy of an unvalidated new hash ID of the NFT being traded submitted by the buyer, a fourth zero-knowledge proof circuit for verifying the legitimacy of an validated spendable check used by the buyer, and a fifth zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check for change submitted by the buyer, the method comprising:

[0024] Generate first proof information according to a first proof algorithm of the first zero-knowledge proof circuit; wherein the public input of the first proof algorithm includes a first hash ID of the first NFT to be sold, and the private input of the first proof algorithm includes a first address and a first private key of an owner of the first NFT;

[0025] Generate second proof information according to a second proof algorithm of the second zero-knowledge proof circuit; wherein the public input of the second proof algorithm includes the second hash ID of the unvalidated first spendable check to be collected and the amount of the collection, and the private input of the second proof algorithm includes the first address;

[0026] The NFT anonymous sale transaction including the first hash ID, the first proof information, the second hash ID, the amount of payment, and the second proof information is packaged and generated and sent to the blockchain network for execution by the blockchain node:

[0027] Inputting the first hash ID and the first proof information into a verification algorithm of a first zero-knowledge proof circuit for verification;

[0028] Inputting the second hash ID, the amount of payment received, and the second proof information into the verification algorithm of the second zero-knowledge proof circuit for verification;

[0029] If any verification fails, the NFT anonymous sale transaction will fail;

[0030] If all verifications are passed, the anonymous sales order of the first NFT will be recorded on the blockchain for the buyer's device to access.

[0031] Among them, the blockchain node is also configured to perform NFT anonymous purchase transactions:

[0032] Inputting the third hash ID and the third proof information of the first NFT into the verification algorithm of the third zero-knowledge proof circuit for verification;

[0033] Inputting the fourth hash ID, the first encrypted amount and the fourth proof information of the validated second spendable check used for payment into the verification algorithm of the fourth zero-knowledge proof circuit for verification;

[0034] Inputting the fifth hash ID, the second encrypted amount, and the fifth proof information of the unvalidated third spendable check used for change into the verification algorithm of the fifth zero-knowledge proof circuit for verification;

[0035] Verify whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the received amount and the first ellipse base point;

[0036] If any verification fails, the NFT anonymous purchase transaction will fail;

[0037] If all verifications are passed, the second spendable check is invalidated, the first spendable check and the third spendable check are validated, and the owner of the first NFT is updated to the third hash ID;

[0038] The first encrypted amount E1 = amount1*G+r*H;

[0039] The second encrypted amount E2 = amount2*G+r*H;

[0040] amount1 is the amount of the second spendable check, amount2 is the amount of the third spendable check, r is a random number, G is the first elliptic curve base point, and H is the second elliptic curve base point.

[0041] In a third aspect, the present invention also provides an NFT privacy transaction method applicable to a user end of a buyer, wherein a blockchain is deployed with an NFT privacy transaction contract, and the NFT privacy transaction contract is configured with a first zero-knowledge proof circuit for verifying whether the seller is the owner of the NFT being traded, a second zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check to be collected, a third zero-knowledge proof circuit for verifying the legitimacy of an unvalidated new hash ID of the NFT being traded submitted by the buyer, a fourth zero-knowledge proof circuit for verifying the legitimacy of an validated spendable check used by the buyer, and a fifth zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check for change submitted by the buyer, the method comprising:

[0042] Generate third proof information according to a third proof algorithm of a third zero-knowledge proof circuit; wherein the public input of the third proof algorithm includes an unvalidated third hash ID of the purchased first NFT, and the private input of the third proof algorithm includes the second address of the buyer;

[0043] Generate fourth proof information according to a fourth proof algorithm of a fourth zero-knowledge proof circuit; wherein the public input of the fourth proof algorithm includes the first encrypted amount, and the private input of the fourth proof algorithm includes a fourth hash ID of a second spendable check that has been validated for payment, the second address and the second private key of the buyer, and the amount of the second spendable check;

[0044] Generate fifth proof information according to a fifth proof algorithm of a fifth zero-knowledge proof circuit; wherein the public input of the fifth proof algorithm includes the fifth hash ID of the unvalidated third spendable check used for change and the second encrypted amount, and the private input of the fifth proof algorithm includes the second address and the amount of the third spendable check;

[0045] The NFT anonymous purchase transaction including the third hash ID, the third proof information, the fourth hash ID, the first encrypted amount, the fourth proof information, the fifth hash ID, the second encrypted amount, and the fifth proof information is packaged and generated and sent to the blockchain network for execution by the blockchain node:

[0046] Inputting the third hash ID and the third proof information into a verification algorithm of a third zero-knowledge proof circuit for verification;

[0047] Inputting the fourth hash ID, the first encrypted amount, and the fourth proof information into a verification algorithm of a fourth zero-knowledge proof circuit for verification;

[0048] Inputting the fifth hash ID, the second encrypted amount, and the fifth proof information into a verification algorithm of a fifth zero-knowledge proof circuit for verification;

[0049] Verify whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the received amount and the first ellipse base point;

[0050] If any verification fails, the NFT anonymous purchase transaction will fail;

[0051] If all verifications are passed, the second spendable check will be invalidated, the first spendable check and the third spendable check will be valid, and the owner of the first NFT will be updated to the third hash ID.

[0052] Among them, the anonymous sale order of the first NFT is executed by the blockchain node. The NFT anonymous sale transaction is recorded on the blockchain when it passes the following verifications:

[0053] Inputting the first hash ID and the first proof information of the first NFT into the verification algorithm of the first zero-knowledge proof circuit for verification;

[0054] Inputting the second hash ID of the unvalidated first spendable check to be collected, the amount of the collection, and the second proof information into the verification algorithm of the second zero-knowledge proof circuit for verification;

[0055] The first encrypted amount E1 = amount1*G+r*H;

[0056] The second encrypted amount E2 = amount2*G+r*H;

[0057] amount1 is the amount of the second spendable check, amount2 is the amount of the third spendable check, r is a random number, G is the first elliptic curve base point, and H is the second elliptic curve base point.

[0058] In a fourth aspect, the present invention also provides a computer device comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors so that the one or more processors execute the NFT privacy transaction method provided according to various embodiments of the present invention.

[0059] In the fifth aspect, the present invention also provides a storage medium storing a computer program, which enables a computer to execute the NFT privacy transaction method provided according to various embodiments of the present invention.

[0060] The NFT privacy transaction method, computer device and storage medium provided by many embodiments of the present invention ensure that the seller can sell anonymously by configuring a first zero-knowledge proof circuit on the blockchain to verify whether the seller is the owner of the NFT; by configuring a third zero-knowledge proof circuit to verify the legitimacy of the new hash ID provided by the buyer, it ensures that the buyer can purchase anonymously; by configuring the second / fourth / fifth zero-knowledge proof circuit and designing a specific first encrypted amount and second encrypted amount therein, the complete privacy of information other than the transaction amount, such as the payment account, the amount spent, the change amount, etc., is ensured during the transaction, ultimately realizing an NFT privacy transaction method that ensures the complete privacy of other information other than the transaction amount during the transaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0062] Figure 1 A flowchart of an NFT privacy transaction method provided for one embodiment of the present invention.

[0063] Figure 2 A flowchart of another NFT privacy transaction method provided for an embodiment of the present invention.

[0064] Figure 3 A flowchart of another NFT privacy transaction method provided for an embodiment of the present invention.

[0065] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0066] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0067] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0068] Figure 1 A flowchart of an NFT privacy transaction method provided for one embodiment of the present invention.

[0069] like Figure 1 As shown, in this embodiment, the present invention provides an NFT privacy transaction method applicable to blockchain nodes, the blockchain is deployed with an NFT privacy transaction contract, the NFT privacy transaction contract is configured with a first zero-knowledge proof circuit for verifying whether the seller is the owner of the NFT being traded, a second zero-knowledge proof circuit for verifying the legitimacy of the unvalidated spendable check to be collected, a third zero-knowledge proof circuit for verifying the legitimacy of the unvalidated new hash ID of the NFT being traded submitted by the buyer, a fourth zero-knowledge proof circuit for verifying the legitimacy of the validated spendable check used by the buyer, and a fifth zero-knowledge proof circuit for verifying the legitimacy of the unvalidated spendable check for change submitted by the buyer, the method comprising:

[0070] S11: Execute NFT anonymous sale transaction:

[0071] S111: inputting the first hash ID and the first proof information of the first NFT to be sold into the verification algorithm of the first zero-knowledge proof circuit for verification;

[0072] S113: inputting the second hash ID of the unvalidated first spendable check to be collected, the amount of the collection, and the second proof information into the verification algorithm of the second zero-knowledge proof circuit for verification;

[0073] If any verification fails, the NFT anonymous sale transaction will fail;

[0074] If all verifications are passed, step S115 is executed: the anonymous selling order of the first NFT is recorded on the blockchain for the buyer's device to obtain;

[0075] S13: Execute NFT anonymous purchase transaction:

[0076] S131: Inputting the unvalidated third hash ID and third proof information of the first NFT into the verification algorithm of the third zero-knowledge proof circuit for verification;

[0077] S133: inputting the fourth hash ID, the first encrypted amount and the fourth proof information of the second spendable check that has been validated for payment into the verification algorithm of the fourth zero-knowledge proof circuit for verification;

[0078] S135: inputting the fifth hash ID, the second encrypted amount and the fifth proof information of the unvalidated third spendable check used for change into the verification algorithm of the fifth zero-knowledge proof circuit for verification;

[0079] S137: Verify whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the received amount and the first ellipse base point;

[0080] If any verification fails, the NFT anonymous purchase transaction will fail;

[0081] If all verifications are passed, execute step S139: invalidate the second expendable check, validate the first expendable check and the third expendable check, and update the owner of the first NFT to the third hash ID.

[0082] Wherein, the first encrypted amount E1 = amount1*G+r*H;

[0083] The second encrypted amount E2 = amount2*G+r*H;

[0084] amount1 is the amount of the second spendable check, amount2 is the amount of the third spendable check, r is a random number, G is the first elliptic curve base point, and H is the second elliptic curve base point.

[0085] In this application, the verification principles of each zero-knowledge proof circuit are:

[0086] 1. The first zero-knowledge proof circuit is verified based on the following principles:

[0087] HashID1=hash(ownerAddr+r1);

[0088] ownerAddr=Addr(Pub(ownerPrivateKey));

[0089] Among them, HashID1 is the first hash ID, ownerAddr is the first address of the owner of the first NFT, r1 is a random number, ownerPrivateKey is the first private key of the owner of the first NFT, Pub() is the algorithm for generating the public key based on the private key, Addr() is the algorithm for generating the address based on the public key, and hash() is the hash algorithm.

[0090] Among them, those skilled in the art can understand that the random number r1 can be replaced with other (undisclosed) information to achieve the same technical effect.

[0091] 2. The second zero-knowledge proof circuit is verified based on the following principles:

[0092] HashID2=hash(ownerAddr+amount+r2);

[0093] Among them, HashID2, amount is the transaction amount (i.e. the amount of the first spendable check used for receiving payment), and r2 is a random number. Those skilled in the art can understand that ownerAddr can be replaced with the corresponding public key and other information, and r2 can also be replaced with other (undisclosed) information to achieve the same technical effect.

[0094] 3. The third zero-knowledge proof circuit is verified based on the following principles:

[0095] HashID3=hash(buyerAddr+r3);

[0096] Among them, HashID3 is the third hash ID, buyerAddr is the second address of the buyer, and r3 is a random number. Those skilled in the art can understand that the random number r3 can be replaced with other (undisclosed by the owner) information to achieve the same technical effect.

[0097] 4. The fourth zero-knowledge proof circuit is verified based on the following principles:

[0098] HashID4=hash(buyerAddr+amount1+r4);

[0099] buyerAddr=Addr(Pub(buyerPrivateKey));

[0100] HashID4*merkle_path=merkle_root;

[0101] Among them, HashID4 is the fourth hash ID, amount1 is the amount of the second spendable check, r4 is a random number, buyerPrivateKey is the buyer's second private key, merkle_path is the Merkle path corresponding to the second spendable check in the spendable check Merkle tree, and merkle_root is the root of the spendable check Merkle tree.

[0102] Specifically, in this embodiment, the blockchain marks whether the expendable check is valid by recording the hash ID of the valid expendable check into the expendable Merkle tree. The expendable check whose hash ID is not in the expendable Merkle tree is not valid. There is also an invalid Merkle tree for marking that the expendable check has been used and invalidated, which will not be elaborated in detail.

[0103] Those skilled in the art will appreciate that when in other embodiments the blockchain uses other methods commonly used in the art to mark whether a spendable check is valid, the validity of the spendable check can be verified by a corresponding verification method (rather than the above-mentioned verification method of verifying with the Merkle path / tree root).

[0104] Those skilled in the art can also understand that buyerAddr can be replaced with the corresponding public key and other information, and r4 can be replaced with other (undisclosed) information to achieve the same technical effect.

[0105] 5. The fifth zero-knowledge proof circuit is verified based on the following principles:

[0106] HashID5=hash(buyerAddr+amount2+r5);

[0107] buyerAddr=Addr(Pub(buyerPrivateKey));

[0108] Among them, HashID5 is the fifth hash ID, amount2 is the amount of the third spendable check, and r5 is a random number.

[0109] Those skilled in the art can also understand that buyerAddr can be replaced with the corresponding public key and other information, and r5 can be replaced with other (undisclosed) information to achieve the same technical effect.

[0110] Those skilled in the art can understand how to generate a zero-knowledge proof circuit according to the above verification principle in a zero-knowledge proof system, as well as:

[0111] The generated first zero-knowledge proof circuit includes a first proof algorithm Provel(), a first verification algorithm Verify1(), and may also include a first generation algorithm Setup1();

[0112] The generated second zero-knowledge proof circuit includes a second proof algorithm Prove2(), a second verification algorithm Verify2(), and may also include a second generation algorithm Setup2();

[0113] The generated third zero-knowledge proof circuit includes a third proof algorithm Prove3(), a third verification algorithm Verify3(), and may also include a third generation algorithm Setup3();

[0114] The generated fourth zero-knowledge proof circuit includes a fourth proof algorithm Prove4(), a fourth verification algorithm Verify4(), and may also include a fourth generation algorithm Setup4();

[0115] The generated fifth zero-knowledge proof circuit includes a fifth proof algorithm Prove5(), a fifth verification algorithm Verify5(), and may also include a fifth generation algorithm Setup5();

[0116] The specific process will not be described here.

[0117] The following example shows that user A sells NFT3, user B buys NFT3, and the blockchain passes Figure 1 Take the method shown in the figure as an example to realize private transaction. Figure 1 An exemplary description is given.

[0118] When user A wants to sell NFT3 for 100 digital RMB, user A’s client uses the hash ID of NFT3 (HashID NFT3 ) as the public input of the first proof algorithm Prove1(), and use the first address Addr1, the first private key p1, and the random number r1 as the private input of the first proof algorithm Prove1() to generate the first proof information prove1:

[0119] Provel(HashID NFT3 , Addrl, p1, r1)→prove1;

[0120] Then, the second hash ID of the first unvalidated spendable check to be received is generated according to the first address Addr1, the amount of payment 100, and the random number r2:

[0121] HashlD Check1 = hash(Addrl+100+r2);

[0122] Then use the second hash ID (HashID Check1), the payment amount 100 is used as the public input of the second proof algorithm Prove2(), and the first address Addr1 and the random number r2 are used as the private input of the second proof algorithm Prove2() to generate the second proof information prove2:

[0123] Prove2(HashID Check1 , 100, Addr1, r2)→prove2;

[0124] The final package generation includes the first hash ID (HashID NFT3 )、first proof information prove1、second hash ID (HashID Check1 ), the NFT anonymous sale transaction tx1 with the payment amount 100 and the second proof information prove2 is sent to the blockchain network.

[0125] In step S11, the blockchain node executes the NFT anonymous sale transaction tx1:

[0126] In step S111, the first hash ID (HashID NFT3 ), the first proof information prove1 is input into the first verification algorithm Verify1() for verification:

[0127] Verify1(HashID NFT3 , prove l )→Yes / No;

[0128] When the output result of the first verification algorithm Verify1() is No, the verification fails and tx1 execution fails;

[0129] In step S113, the second hash ID (HashID Check1 ), the payment amount 100 and the second proof information prove2 are input into the second verification algorithm Verify2() for verification:

[0130] Verify2(HashID Check1 、100,prove2)→Yes / No;

[0131] When the output result of the second verification algorithm Verify2() is No, the verification fails and tx1 execution fails;

[0132] When the output results of Verify1() and Verify2() are both Yes, execute step S115 to record the anonymous sales order of NFT3 (the only public information is the selling price of 100 digital RMB) on the blockchain for the buyer's device to obtain.

[0133] When user B sees the order and decides to spend 100 digital RMB to buy NFT3, user B's client first needs to construct a new unvalidated hash ID for NFT3 based on user B's address Addr2:

[0134] HashID NFT3_new = hash(Addr2+r3);

[0135] And use the newly constructed hash ID (HashIDNFT3) as the public input of the third proof algorithm Prove3(), and use the second address Addr2 and random number r3 as the private input of the third proof algorithm Prove3() to generate the third proof information prove3:

[0136] Prove3(HashID NFT3_new ,Addr2,r3)→prove3;

[0137] In addition, the user terminal of user B also needs to find a spendable check (valid and not invalidated) owned by user B with an amount not less than 100 yuan (Note: payment is made through one spendable check as an example here, and in more embodiments, payment can also be made through multiple spendable checks with amounts less than the transaction amount and a total amount not less than the transaction amount). For example, a second spendable check with an amount of 128 yuan is found, and the change amount of 28 yuan (i.e., the amount of the third spendable check) is determined based on the amount of 128 yuan of the second spendable check and the transaction amount of 100 yuan, and a first encrypted amount E1 and a second encrypted amount E2 are generated respectively:

[0138] E1=128*G+r*H;

[0139] E2=28*G+r*H;

[0140] The root of the Merkle tree of the spendable check of the second spendable check, merkle_root, and the invalid hash of the second spendable check void , the first encrypted amount E1 is used as the public input of the fourth proof algorithm Prove4(), with the hash ID (HashID Check2 ), the Merkle path merkle_path corresponding to the second spendable check in the spendable check Merkle tree, the second address Addr2, the random number r, the second private key p2, the amount of the second spendable check 128, and the random number r4 are used as the private input of the fourth proof algorithm Prove4() to generate the fourth proof information prove4:

[0141] Prove4(merkle_root, hash void 、E1,HashID Check2、merkle_path、

[0142] Addr2, r, 128, r4)→prove4;

[0143] Generate the fifth hash ID of the unvalidated third spendable check to be changed based on the second address Addr2, the change amount 28, and the random number r5:

[0144] HashID Check3 = hash(Addr2+28+r5);

[0145] Then use the fifth hash ID (HashID Check3 ), the second encrypted amount E2 is used as the public input of the fifth proof algorithm Prove5(), and the second address Addr2, the change amount 28, the random number r, and the random number r5 are used as the private input of the fifth proof algorithm Prove5() to generate the fifth proof information prove5:

[0146] Prove5(HashID Check3 , E2, Addr2, 28, r, r5)→prove5;

[0147] The final package generation includes HashID NFT3_new , prove3, merkle_root, hash void 、E1、prove4、HashID Check3 , E2, prove5's NFT anonymous purchase transaction tx2 and send it to the blockchain network.

[0148] In step S13, the blockchain node executes the NFT anonymous purchase transaction tx2:

[0149] In step S131, HashID NFT3_new , prove3 inputs the verification algorithm of the third zero-knowledge proof circuit for verification:

[0150] Verify3(HashID NFT3_new , prove3)→Yes / No;

[0151] When the output result of the third verification algorithm Verify3() is No, the verification fails and tx2 execution fails;

[0152] In step S133, merkle_root, hash void , E1, prove4 input the verification algorithm of the fourth zero-knowledge proof circuit for verification:

[0153] Verify4(merkle_root, hashvoid 、E1,prove4)→Yes / No;

[0154] When the output result of the fourth verification algorithm Verify4() is No, the verification fails and tx2 execution fails;

[0155] In step S135, HashID Check3 , E2, prove5 input the verification algorithm of the fifth zero-knowledge proof circuit for verification:

[0156] Verify5(HashID Check3 、E2,prove5)→Yes / No;

[0157] When the output result of the fifth verification algorithm Verify5() is No, the verification fails and tx2 execution fails;

[0158] In step S137, verify whether E1-E2 is equal to 100*G: if not, the verification fails and tx2 execution fails;

[0159] When all the verifications of steps S131-S137 are passed, step S139 is executed to add the invalid hash of the second spendable check to the invalid Merkle tree to invalidate the second spendable check, add the hash IDs of the first spendable check and the third spendable check to the spendable check Merkle tree to validate the first spendable check and the third spendable check, and the owner of NFT3 is replaced by HashID NFT3 Update to HashID NFT3_new .

[0160] In the above example, only the transaction amount of 100 yuan is public during the entire transaction process.

[0161] The above embodiment ensures that the seller can sell anonymously by configuring a first zero-knowledge proof circuit on the blockchain to verify whether the seller is the owner of the NFT; it ensures that the buyer can purchase anonymously by configuring a third zero-knowledge proof circuit to verify the legitimacy of the new hash ID provided by the buyer; and it ensures that the information other than the transaction amount, such as the payment account, the amount spent, and the change amount, is completely private during the transaction by configuring the second / fourth / fifth zero-knowledge proof circuit and designing specific first and second encrypted amounts therein. This ultimately realizes an NFT privacy transaction method that ensures the complete privacy of other information other than the transaction amount during the transaction.

[0162] Figure 2 A flowchart of another NFT privacy transaction method provided for an embodiment of the present invention. Figure 2 The method shown can be used with Figure 1 The method shown is executed.

[0163] like Figure 2 As shown, in this embodiment, the present invention also provides an NFT privacy transaction method applicable to the user end of the seller, the blockchain is deployed with an NFT privacy transaction contract, and the NFT privacy transaction contract is configured with a first zero-knowledge proof circuit for verifying whether the seller is the owner of the NFT being traded, a second zero-knowledge proof circuit for verifying the legitimacy of the unvalidated spendable check to be collected, a third zero-knowledge proof circuit for verifying the legitimacy of the unvalidated new hash ID of the NFT being traded submitted by the buyer, a fourth zero-knowledge proof circuit for verifying the legitimacy of the validated spendable check used by the buyer, and a fifth zero-knowledge proof circuit for verifying the legitimacy of the unvalidated spendable check for change submitted by the buyer, the method comprising:

[0164] S21: Generate first proof information according to a first proof algorithm of the first zero-knowledge proof circuit; wherein the public input of the first proof algorithm includes the first hash ID of the first NFT to be sold, and the private input of the first proof algorithm includes the first address and the first private key of the owner of the first NFT;

[0165] S23: Generate second proof information according to a second proof algorithm of the second zero-knowledge proof circuit; wherein the public input of the second proof algorithm includes the second hash ID of the unvalidated first spendable check to be collected and the amount of the collection, and the private input of the second proof algorithm includes the first address;

[0166] S25: Pack and generate an NFT anonymous sale transaction including the first hash ID, the first proof information, the second hash ID, the amount of payment, and the second proof information and send it to the blockchain network for execution by the blockchain node:

[0167] Inputting the first hash ID and the first proof information into a verification algorithm of a first zero-knowledge proof circuit for verification;

[0168] Inputting the second hash ID, the amount of payment received, and the second proof information into the verification algorithm of the second zero-knowledge proof circuit for verification;

[0169] If any verification fails, the NFT anonymous sale transaction will fail;

[0170] If all verifications are passed, the anonymous sales order of the first NFT will be recorded on the blockchain for the buyer's device to access.

[0171] Among them, the blockchain node is also configured to perform NFT anonymous purchase transactions:

[0172] Inputting the third hash ID and the third proof information of the first NFT into the verification algorithm of the third zero-knowledge proof circuit for verification;

[0173] Inputting the fourth hash ID, the first encrypted amount and the fourth proof information of the validated second spendable check used for payment into the verification algorithm of the fourth zero-knowledge proof circuit for verification;

[0174] Inputting the fifth hash ID, the second encrypted amount, and the fifth proof information of the unvalidated third spendable check used for change into the verification algorithm of the fifth zero-knowledge proof circuit for verification;

[0175] Verify whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the received amount and the first ellipse base point;

[0176] If any verification fails, the NFT anonymous purchase transaction will fail;

[0177] If all verifications are passed, the second spendable check is invalidated, the first spendable check and the third spendable check are validated, and the owner of the first NFT is updated to the third hash ID;

[0178] The first encrypted amount E1 = amount1*G+r*H;

[0179] The second encrypted amount E2 = amount2*G+r*H;

[0180] amount1 is the amount of the second spendable check, amount2 is the amount of the third spendable check, r is a random number, G is the first elliptic curve base point, and H is the second elliptic curve base point.

[0181] Figure 2 The trading principle of the method shown can be found in Figure 1 The method shown here will not be described in detail.

[0182] Figure 3 A flowchart of another NFT privacy transaction method provided for an embodiment of the present invention. Figure 3 The method shown can be used with Figure 1 / 2 is executed.

[0183] like Figure 3As shown, in this embodiment, the present invention also provides an NFT privacy transaction method applicable to the user end of the buyer, the blockchain is deployed with an NFT privacy transaction contract, and the NFT privacy transaction contract is configured with a first zero-knowledge proof circuit for verifying whether the seller is the owner of the NFT being traded, a second zero-knowledge proof circuit for verifying the legitimacy of the unvalidated spendable check to be collected, a third zero-knowledge proof circuit for verifying the legitimacy of the unvalidated new hash ID of the NFT being traded submitted by the buyer, a fourth zero-knowledge proof circuit for verifying the legitimacy of the validated spendable check used by the buyer, and a fifth zero-knowledge proof circuit for verifying the legitimacy of the unvalidated spendable check for change submitted by the buyer, the method comprising:

[0184] S31: Generate third proof information according to a third proof algorithm of a third zero-knowledge proof circuit; wherein the public input of the third proof algorithm includes an unvalidated third hash ID of the purchased first NFT, and the private input of the third proof algorithm includes the second address of the buyer;

[0185] S33: Generate fourth proof information according to a fourth proof algorithm of a fourth zero-knowledge proof circuit; wherein the public input of the fourth proof algorithm includes the first encrypted amount, and the private input of the fourth proof algorithm includes the fourth hash ID of the second spendable check that has been validated for payment, the second address and the second private key of the buyer, and the amount of the second spendable check;

[0186] S35: Generate fifth proof information according to a fifth proof algorithm of the fifth zero-knowledge proof circuit; wherein the public input of the fifth proof algorithm includes the fifth hash ID of the unvalidated third spendable check used for change and the second encrypted amount, and the private input of the fifth proof algorithm includes the second address and the amount of the third spendable check;

[0187] S37: Pack and generate an NFT anonymous purchase transaction including a third hash ID, third proof information, fourth hash ID, first encrypted amount, fourth proof information, fifth hash ID, second encrypted amount, and fifth proof information and send it to the blockchain network for execution by the blockchain node:

[0188] Inputting the third hash ID and the third proof information into a verification algorithm of a third zero-knowledge proof circuit for verification;

[0189] Inputting the fourth hash ID, the first encrypted amount, and the fourth proof information into a verification algorithm of a fourth zero-knowledge proof circuit for verification;

[0190] Inputting the fifth hash ID, the second encrypted amount, and the fifth proof information into a verification algorithm of a fifth zero-knowledge proof circuit for verification;

[0191] Verify whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the received amount and the first ellipse base point;

[0192] If any verification fails, the NFT anonymous purchase transaction will fail;

[0193] If all verifications are passed, the second spendable check will be invalidated, the first spendable check and the third spendable check will be valid, and the owner of the first NFT will be updated to the third hash ID.

[0194] Among them, the anonymous sale order of the first NFT is executed by the blockchain node. The NFT anonymous sale transaction is recorded on the blockchain when it passes the following verifications:

[0195] Inputting the first hash ID and the first proof information of the first NFT into the verification algorithm of the first zero-knowledge proof circuit for verification;

[0196] Inputting the second hash ID of the unvalidated first spendable check to be collected, the amount of the collection, and the second proof information into the verification algorithm of the second zero-knowledge proof circuit for verification;

[0197] The first encrypted amount E1 = amount1*G+r*H;

[0198] The second encrypted amount E2 = amount2*G+r*H;

[0199] amount1 is the amount of the second spendable check, amount2 is the amount of the third spendable check, r is a random number, G is the first elliptic curve base point, and H is the second elliptic curve base point.

[0200] Figure 3 The trading principle of the method shown can also be referred to Figure 1 The method shown here will not be described in detail.

[0201] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention.

[0202] like Figure 4 As shown, as another aspect, the present application also provides a computer device, including one or more central processing units (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage part 408 to the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0203] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.

[0204] In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing any of the above methods. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from the removable medium 411.

[0205] As another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus of the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the method described in the present application.

[0206] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs a specified function or operation, or can be realized by a combination of dedicated hardware and computer instructions.

[0207] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be provided in a processor. For example, each unit may be a software program provided in a computer or a mobile smart device, or may be a separately configured hardware device. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0208] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the present application. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) to form a technical solution.

Claims

1. A NFT privacy transaction method, characterized in that: The blockchain is deployed with an NFT privacy transaction contract, and the NFT privacy transaction contract is configured with a first zero-knowledge proof circuit for verifying whether the seller is the owner of the NFT being traded, a second zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check to be collected, a third zero-knowledge proof circuit for verifying the legitimacy of an unvalidated new hash ID of the NFT being traded submitted by the buyer, a fourth zero-knowledge proof circuit for verifying the legitimacy of an validated spendable check used by the buyer, and a fifth zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check for change submitted by the buyer. The method is applicable to a blockchain node, and the method includes: Execute an anonymous NFT sale transaction: Inputting the first hash ID and the first proof information of the first NFT to be sold into the verification algorithm of the first zero-knowledge proof circuit for verification; Inputting the second hash ID of the unvalidated first spendable check to be collected, the amount of the collection, and the second proof information into the verification algorithm of the second zero-knowledge proof circuit for verification; If any verification fails, the NFT anonymous sale transaction will fail; If all verifications are passed, the anonymous sale order of the first NFT will be recorded on the blockchain for the buyer's device to obtain; To perform an anonymous NFT purchase transaction: Inputting the unvalidated third hash ID and third proof information of the first NFT into the verification algorithm of the third zero-knowledge proof circuit for verification; Inputting the fourth hash ID, the first encrypted amount and the fourth proof information of the validated second spendable check used for payment into the verification algorithm of the fourth zero-knowledge proof circuit for verification; Inputting the fifth hash ID, the second encrypted amount and the fifth proof information of the unvalidated third spendable check used for change into the verification algorithm of the fifth zero-knowledge proof circuit for verification; Verifying whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the received amount and the first ellipse base point; If any verification fails, the NFT anonymous purchase transaction will fail; If all verifications are passed, the second spendable check is invalidated, the first spendable check and the third spendable check are validated, and the owner of the first NFT is updated to the third hash ID; Wherein, the first encrypted amount E1 = amount1*G+r*H; The second encrypted amount E2 = amount2*G+r*H; amount1 is the amount of the second spendable check, amount2 is the amount of the third spendable check, r is a random number, G is the first elliptic curve base point, and H is the second elliptic curve base point.

2. A NFT privacy transaction method, characterized in that: The blockchain is deployed with an NFT privacy transaction contract, and the NFT privacy transaction contract is configured with a first zero-knowledge proof circuit for verifying whether the seller is the owner of the NFT being traded, a second zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check to be collected, a third zero-knowledge proof circuit for verifying the legitimacy of an unvalidated new hash ID of the NFT being traded submitted by the buyer, a fourth zero-knowledge proof circuit for verifying the legitimacy of an validated spendable check used by the buyer, and a fifth zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check for change submitted by the buyer. The method is applicable to a user end of the seller, and the method includes: Generate first proof information according to a first proof algorithm of the first zero-knowledge proof circuit; wherein the public input of the first proof algorithm includes a first hash ID of the first NFT to be sold, and the private input of the first proof algorithm includes a first address and a first private key of an owner of the first NFT; Generate second proof information according to a second proof algorithm of the second zero-knowledge proof circuit; wherein the public input of the second proof algorithm includes the second hash ID of the unvalidated first spendable check to be collected and the amount of the collection, and the private input of the second proof algorithm includes the first address; Pack and generate an NFT anonymous sale transaction including the first hash ID, the first proof information, the second hash ID, the amount of the payment, and the second proof information and send it to the blockchain network for execution by the blockchain node: Inputting the first hash ID and the first proof information into a verification algorithm of the first zero-knowledge proof circuit for verification; Inputting the second hash ID, the payment amount and the second proof information into the verification algorithm of the second zero-knowledge proof circuit for verification; If any verification fails, the NFT anonymous sale transaction will fail; If all verifications are passed, the anonymous sale order of the first NFT will be recorded on the blockchain for the buyer's device to obtain; Among them, the blockchain node is also configured to perform NFT anonymous purchase transactions: Inputting the third hash ID and the third proof information of the first NFT into the verification algorithm of the third zero-knowledge proof circuit for verification; Inputting the fourth hash ID, the first encrypted amount and the fourth proof information of the validated second spendable check used for payment into the verification algorithm of the fourth zero-knowledge proof circuit for verification; Inputting the fifth hash ID, the second encrypted amount and the fifth proof information of the unvalidated third spendable check used for change into the verification algorithm of the fifth zero-knowledge proof circuit for verification; Verifying whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the received amount and the first ellipse base point; If any verification fails, the NFT anonymous purchase transaction will fail; If all verifications are passed, the second spendable check is invalidated, the first spendable check and the third spendable check are validated, and the owner of the first NFT is updated to the third hash ID; The first encrypted amount E1 = amount1*G+r*H; The second encrypted amount E2 = amount2*G+r*H; amount1 is the amount of the second spendable check, amount2 is the amount of the third spendable check, r is a random number, G is the first elliptic curve base point, and H is the second elliptic curve base point.

3. A NFT privacy transaction method, characterized in that: The blockchain is deployed with an NFT privacy transaction contract, and the NFT privacy transaction contract is configured with a first zero-knowledge proof circuit for verifying whether the seller is the owner of the NFT being traded, a second zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check to be collected, a third zero-knowledge proof circuit for verifying the legitimacy of an unvalidated new hash ID of the NFT being traded submitted by the buyer, a fourth zero-knowledge proof circuit for verifying the legitimacy of an validated spendable check used by the buyer, and a fifth zero-knowledge proof circuit for verifying the legitimacy of an unvalidated spendable check for change submitted by the buyer. The method is applicable to a user end of the buyer, and the method includes: Generating third proof information according to a third proof algorithm of the third zero-knowledge proof circuit; wherein the public input of the third proof algorithm includes an unvalidated third hash ID of the purchased first NFT, and the private input of the third proof algorithm includes the second address of the buyer; Generate fourth proof information according to a fourth proof algorithm of the fourth zero-knowledge proof circuit; wherein the public input of the fourth proof algorithm includes the first encrypted amount, and the private input of the fourth proof algorithm includes the fourth hash ID of the second spendable check that has been validated for payment, the second address and the second private key of the buyer, and the amount of the second spendable check; generating fifth proof information according to a fifth proof algorithm of the fifth zero-knowledge proof circuit; wherein the public input of the fifth proof algorithm includes the fifth hash ID of the unvalidated third spendable check used for change and the second encrypted amount, and the private input of the fifth proof algorithm includes the second address and the amount of the third spendable check; Pack and generate an NFT anonymous purchase transaction including the third hash ID, the third proof information, the fourth hash ID, the first encrypted amount, the fourth proof information, the fifth hash ID, the second encrypted amount, and the fifth proof information and send it to the blockchain network for execution by the blockchain node: Inputting the third hash ID and the third proof information into a verification algorithm of the third zero-knowledge proof circuit for verification; Inputting the fourth hash ID, the first encrypted amount and the fourth proof information into a verification algorithm of the fourth zero-knowledge proof circuit for verification; Inputting the fifth hash ID, the second encrypted amount and the fifth proof information into a verification algorithm of the fifth zero-knowledge proof circuit for verification; Verifying whether the difference between the first encrypted amount and the second encrypted amount is equal to the product of the received amount and the first ellipse base point; If any verification fails, the NFT anonymous purchase transaction will fail; If all verifications are passed, the second spendable check is invalidated, the first spendable check and the third spendable check are validated, and the owner of the first NFT is updated to the third hash ID; The anonymous sale order of the first NFT is executed by the blockchain node as an NFT anonymous sale transaction, and is recorded on the blockchain when the following verifications are passed: Inputting the first hash ID and the first proof information of the first NFT into the verification algorithm of the first zero-knowledge proof circuit for verification; Inputting the second hash ID of the unvalidated first spendable check to be collected, the amount of the collection, and the second proof information into the verification algorithm of the second zero-knowledge proof circuit for verification; The first encrypted amount E1 = amount l *G+r*H; The second encrypted amount E2 = amount2*G+r*H; amount1 is the amount of the second spendable check, amount2 is the amount of the third spendable check, r is a random number, G is the first elliptic curve base point, and H is the second elliptic curve base point.

4. A computer device, characterized in that: The device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to any one of claims 1 to 3.

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

Citation Information

Patent Citations

  • Anonymous multi-signature method, computer equipment and storage medium

    CN113095827A

  • Private data transaction method and device, equipment and storage medium

    CN113822671A