Carbon data processing method and apparatus
By constructing an input carbon account set on the blockchain and using random numbers and zero-knowledge proof to update the carbon account, the problem of poor privacy of carbon accounts is solved and the security and privacy of carbon accounts are improved.
Patent Information
- Application Number
- CN202410706626.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-05-31
AI Technical Summary
The privacy of carbon accounts on existing blockchain platforms is poor, and the carbon emission reduction values and transaction relationships are traceable and linkable, resulting in a high risk of user carbon account information leakage.
By determining the input carbon account set on the blockchain, including the target carbon account and the random carbon account, the carbon account is updated using random numbers, and zero-knowledge proof information is generated to verify the correctness of the update, thereby improving privacy.
It achieves privacy protection of carbon accounts, prevents information leakage, and improves the security and privacy of carbon accounts.
Smart Images

Figure CN118568748B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a carbon data processing method and device. BACKGROUND
[0002] In the prior art, a blockchain platform can record the remaining carbon emission reduction amount in a user's personal carbon account, and the remaining carbon emission reduction amount is used to represent the cumulative carbon emission reduction amount obtained by the user's energy-saving and emission-reducing behavior. The platform provides a carbon trading function to enable the user to sell the remaining carbon emission reduction amount in the user's carbon account. Specifically, the platform can bundle the carbon emission reduction amount selling requests of the users and sell the bundled remaining carbon emission reduction amount.
[0003] However, the above scheme has the problem of poor privacy. Specifically, the remaining carbon emission reduction amount of the carbon account on the blockchain, the newly accumulated carbon emission reduction amount, and the carbon emission reduction amount deducted due to the transaction are all in plaintext; at the same time, which accumulation behavior increases the balance of which carbon account, and which transaction behavior reduces the balance of which carbon account, the relationship between these transactions is also traceable and associable on the chain. SUMMARY
[0004] The present application provides a carbon data processing method and device, which can improve the privacy of the carbon account as much as possible.
[0005] In a first aspect, the present application provides a carbon data processing method, which comprises:
[0006] determining a set of input carbon accounts on a blockchain, at least two input carbon accounts in the set of input carbon accounts comprising: at least one target carbon account and at least one random carbon account, the target carbon account comprising a carbon account whose carbon emission reduction amount is to be updated, the random carbon account comprising a carbon account whose carbon emission reduction amount is not to be updated, the carbon emission reduction amount to be updated comprising: remaining carbon emission reduction amount to be updated and / or frozen carbon emission reduction amount to be updated; and updating each input carbon account in the set of input carbon accounts.
[0007] Optionally, each carbon account comprises: a public key, a first commitment corresponding to the remaining carbon emission reduction amount, and a second commitment corresponding to the frozen carbon emission reduction amount, the public key being used to uniquely represent the carbon account.
[0008] Optionally, the updating each input carbon account in the set of input carbon accounts comprises:
[0009] updating each input carbon account in the set of input carbon accounts by using at least one random number, and different input carbon accounts using the same at least one random number.
[0010] Optionally, the updating each input carbon account in the set of input carbon accounts by using at least one random number comprises:
[0011] For each input carbon account in the set of input carbon accounts, determine, according to at least one random number and the input carbon account, an output carbon account corresponding to the input carbon account, to obtain a set of output carbon accounts; control the blockchain to update the set of input carbon accounts to the set of output carbon accounts.
[0012] Optionally, before the control of the blockchain to update the set of input carbon accounts to the set of output carbon accounts, the method further comprises:
[0013] Each input carbon account in the set of input carbon accounts and each output carbon account in the set of output carbon accounts are sorted according to the same rule.
[0014] Optionally, the determination of the output carbon account corresponding to the input carbon account according to at least one random number and the input carbon account comprises:
[0015] Determining, according to a first random number and a public key of the input carbon account, a public key of the output carbon account corresponding to the input carbon account; determining, according to a second random number, the public key of the output carbon account and a first commitment of the input carbon account, a first commitment of the output carbon account corresponding to the input carbon account; and determining, according to a third random number, the public key of the output carbon account and a second commitment of the input carbon account, a second commitment of the output carbon account corresponding to the input carbon account.
[0016] Optionally, the control of the blockchain to update the set of input carbon accounts to the set of output carbon accounts comprises:
[0017] Generating first zero-knowledge proof information according to the set of input carbon accounts and the set of output carbon accounts, the first zero-knowledge proof information being used to verify that the update of the set of input carbon accounts by the set of output carbon accounts is correct; and controlling the blockchain to update the set of input carbon accounts to the set of output carbon accounts when the zero-knowledge verification according to the first zero-knowledge proof information is successful.
[0018] Optionally, when the update type of the target carbon account is to update the carbon emission reduction amount of the target carbon account based on the carbon emission reduction behavior of a user, the update amount of the remaining carbon emission reduction amount of the target carbon account is determined by a trusted execution environment according to the carbon emission reduction behavior, and the update amount of the frozen carbon emission reduction amount of the target carbon account is 0.
[0019] Optionally, when the update type of the target carbon account is to initiate the target carbon account update based on a preset update amount, the update amount of the remaining carbon emission reduction amount of the target carbon account is the preset update amount, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the opposite of the preset update amount; when the update type of the target carbon account is to update the target carbon account based on the preset update amount successfully, the update amount of the remaining carbon emission reduction amount of the target carbon account is 0, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the preset update amount; when the update type of the target carbon account is to update the target carbon account based on the preset update amount unsuccessfully, the update amount of the remaining carbon emission reduction amount of the target carbon account is the opposite of the preset update amount, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the preset update amount.
[0020] Optionally, the generating the first zero-knowledge proof information according to the input carbon account set and the output carbon account set comprises:
[0021] Optionally, the generating the first zero-knowledge proof information according to the input carbon account set and the output carbon account set comprises:
[0022] Optionally, the generating the first zero-knowledge proof information according to the input carbon account set and the output carbon account set comprises:
[0023] obtaining an update identifier of the target carbon account based on a preset update amount; obtaining an update amount of a remaining carbon emission reduction amount of each target carbon account and an update amount of a frozen carbon emission reduction amount of each target carbon account; generating first zero-knowledge proof information according to the input carbon account set and the output carbon account set, the update identifier, a private key of each target carbon account, the update amount of the remaining carbon emission reduction amount of each target carbon account, a signature of each target carbon account, the first random number to the third random number, the first zero-knowledge proof information being used to verify that the random carbon account has been updated, the remaining carbon emission reduction amount and the frozen carbon emission reduction amount of the random carbon account have not been updated, the update amount of the frozen carbon emission reduction amount of the target carbon account and the update amount of the remaining carbon emission reduction amount of the target carbon account are consistent with the update type, the update amount of the remaining carbon emission reduction amount of the target carbon account, the updated remaining carbon emission reduction amount of the target carbon account, the updated frozen carbon emission reduction amount of the target carbon account and the update amount of the frozen carbon emission reduction amount of the target carbon account are all within a preset range.
[0024] Optionally, the control blockchain updates the input carbon account set to the output carbon account set when the zero-knowledge verification according to the first zero-knowledge proof information is successful, and the method further comprises:
[0025] Optionally, the control blockchain updates the input carbon account set to the output carbon account set when the zero-knowledge verification according to the first zero-knowledge proof information is successful, and the method further comprises:
[0026] Optionally, the control blockchain updates the input carbon account set to the output carbon account set when the zero-knowledge verification according to the first zero-knowledge proof information is successful, and the method further comprises:
[0027] adjusting an update execution state according to the update type of the target carbon account; wherein, when the target carbon account is initiated to be updated based on a preset update amount, the update execution state is adjusted to be in execution; when the target carbon account is successfully updated based on the preset update amount, the update execution state is adjusted to be in execution success; when the target carbon account fails to be updated based on the preset update amount, the update execution state is adjusted to be in execution failure.
[0028] Optionally, the creation process of any one carbon account on the blockchain comprises:
[0029] generating a public key of the carbon account; generating a default commitment according to the public key and a preset default carbon emission reduction amount; controlling the blockchain to create the carbon account according to the public key and the default commitment, the first commitment and the second commitment of the carbon account being the default commitment at the beginning.
[0030] Optionally, the generating the public key of the carbon account comprises:
[0031] generating the public key of the carbon account and a private key corresponding to the public key.
[0032] The creating the carbon account on the blockchain according to the public key and the default commitment comprises:
[0033] generating second zero-knowledge proof information according to the public key, the default commitment, the default carbon emission reduction amount and the private key, and controlling the blockchain to create the carbon account according to the public key and the default commitment when zero-knowledge verification based on the second zero-knowledge proof information is successful, the second zero-knowledge proof information being used to verify that the remaining carbon emission reduction amount and the frozen carbon emission reduction amount of the carbon account are both the default carbon emission reduction amount when the carbon account is created, and the creator has the private key of the carbon account.
[0034] Optionally, the generating the public key of the carbon account and the private key corresponding to the public key comprises:
[0035] generating the private key of the carbon account;
[0036] generating the public key of the carbon account through a fourth random number and the private key of the carbon account.
[0037] Optionally, the generating the default commitment according to the public key and a preset default carbon emission reduction amount comprises:
[0038] generating the default commitment through a fifth random number, the public key and the preset default carbon emission reduction amount.
[0039] In a second aspect, the present application provides a carbon data processing device, comprising:
[0040] an account set determination module configured to determine an input carbon account set on a blockchain, at least two input carbon accounts in the input carbon account set comprising at least one target carbon account and at least one random carbon account, the target carbon account comprising a carbon account whose carbon emission reduction amount is to be updated, the random carbon account comprising a carbon account whose carbon emission reduction amount is not to be updated, the carbon emission reduction amount to be updated comprising a remaining carbon emission reduction amount to be updated and / or a frozen carbon emission reduction amount to be updated.
[0041] an account set updating module configured to update each input carbon account in the input carbon account set.
[0042] Optionally, each carbon account comprises a public key, a first commitment corresponding to the remaining carbon emission reduction amount and a second commitment corresponding to the frozen carbon emission reduction amount, the public key being used to uniquely represent the carbon account.
[0043] Optionally, the account set updating module is further configured to:
[0044] updating each input carbon account in the input carbon account set by at least one random number, different input carbon accounts using the same at least one random number.
[0045] Optionally, the account set updating module is further configured to:
[0046] For each input carbon account in the input carbon account set, determining the output carbon account corresponding to the input carbon account according to at least one random number and the input carbon account, obtaining an output carbon account set; and controlling the blockchain to update the input carbon account set to the output carbon account set.
[0047] Optionally, the account set updating module is further configured to:
[0048] According to the same rule, each input carbon account in the input carbon account set and each output carbon account in the output carbon account set are sorted respectively.
[0049] Optionally, the account set updating module is further configured to:
[0050] According to a first random number and a public key of the input carbon account, a public key of the output carbon account corresponding to the input carbon account is determined; according to a second random number, the public key of the output carbon account and a first commitment of the input carbon account, a first commitment of the output carbon account corresponding to the input carbon account is determined; according to a third random number, the public key of the output carbon account and a second commitment of the input carbon account, a second commitment of the output carbon account corresponding to the input carbon account is determined.
[0051] Optionally, the account set updating module is further configured to:
[0052] According to the input carbon account set and the output carbon account set, first zero-knowledge proof information is generated, the first zero-knowledge proof information is used to verify that the input carbon account set is updated correctly by the output carbon account set; and the blockchain is controlled to update the input carbon account set to the output carbon account set when the zero-knowledge verification according to the first zero-knowledge proof information is successful.
[0053] Optionally, when the update type of the target carbon account is to update the carbon emission reduction amount of the target carbon account based on the carbon emission reduction behavior of the user, the update amount of the remaining carbon emission reduction amount of the target carbon account is determined by the trusted execution environment according to the carbon emission reduction behavior, and the update amount of the frozen carbon emission reduction amount of the target carbon account is 0.
[0054] Optionally, when the update type of the target carbon account is to initiate the target carbon account update based on a preset update amount, the update amount of the remaining carbon emission reduction amount of the target carbon account is the preset update amount, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the opposite of the preset update amount; when the update type of the target carbon account is to update the target carbon account based on the preset update amount successfully, the update amount of the remaining carbon emission reduction amount of the target carbon account is 0, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the preset update amount; when the update type of the target carbon account is to update the target carbon account based on the preset update amount unsuccessfully, the update amount of the remaining carbon emission reduction amount of the target carbon account is the opposite of the preset update amount, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the preset update amount.
[0055] Optionally, the account set updating module is further configured to:
[0056] obtain an update amount of a remaining carbon emission reduction amount of each of the input carbon accounts; generate first zero-knowledge proof information according to the input carbon account set, the output carbon account set, the update amount of the remaining carbon emission reduction amount of each of the input carbon accounts, the first random number to the third random number, the first zero-knowledge proof information being used to verify that the random carbon account has been updated, the remaining carbon emission reduction amount and the frozen carbon emission reduction amount of the random carbon account have not been updated, the remaining carbon emission reduction amount of the target carbon account has been updated according to the update amount of the remaining carbon emission reduction amount of the target carbon account, and the update amount of the remaining carbon emission reduction amount of the target carbon account and the updated remaining carbon emission reduction amount of the target carbon account are both within a preset range.
[0057] Optionally, the account set updating module is further configured to:
[0058] obtaining an update identifier of the target carbon account based on a preset update amount; obtaining an update amount of a remaining carbon emission reduction amount of each target carbon account and an update amount of a frozen carbon emission reduction amount of each target carbon account; generating first zero-knowledge proof information according to the input carbon account set and the output carbon account set, the update identifier, a private key of each target carbon account, the update amount of the remaining carbon emission reduction amount of each target carbon account, a signature of each target carbon account, the first random number to the third random number, the first zero-knowledge proof information being used to verify that the random carbon account has been updated, the remaining carbon emission reduction amount and the frozen carbon emission reduction amount of the random carbon account have not been updated, the update amount of the frozen carbon emission reduction amount of the target carbon account and the update amount of the remaining carbon emission reduction amount of the target carbon account are consistent with the update type, the update amount of the remaining carbon emission reduction amount of the target carbon account, the updated remaining carbon emission reduction amount of the target carbon account, the updated frozen carbon emission reduction amount of the target carbon account and the update amount of the frozen carbon emission reduction amount of the target carbon account are all within a preset range.
[0059] Optionally, the account set updating module is further configured to:
[0060] invoke an account updating interface of a smart account contract on the blockchain, the account updating interface being configured to perform zero-knowledge verification according to the first zero-knowledge proof information, and update the input carbon account set to the output carbon account set when the verification is successful.
[0061] Optionally, the account set updating module is further configured to:
[0062] adjust an update execution state according to the update type of the target carbon account; wherein, when the target carbon account is updated based on a preset update amount, the update execution state is adjusted to be in execution; when the target carbon account is successfully updated based on the preset update amount, the update execution state is adjusted to be in successful execution; and when the target carbon account fails to be updated based on the preset update amount, the update execution state is adjusted to be in failed execution.
[0063] Optionally, the creation process of any carbon account on the blockchain comprises:
[0064] a public key generation module configured to generate a public key of the carbon account.
[0065] a commitment generation module configured to generate a default commitment according to the public key and a preset default carbon emission reduction amount.
[0066] a creation module configured to control the blockchain to create the carbon account according to the public key and the default commitment, the first commitment and the second commitment of the carbon account being both the default commitment at the beginning.
[0067] Optionally, the public key generation module is further configured to:
[0068] generate a public key of the carbon account and a private key corresponding to the public key.
[0069] The creating module is further configured to:
[0070] generate second zero-knowledge proof information according to the public key, the default commitment, the default carbon reduction amount and the private key, and control the blockchain to create the carbon account according to the public key and the default commitment when the zero-knowledge verification based on the second zero-knowledge proof information is successful, the second zero-knowledge proof information being used to verify that the remaining carbon reduction amount and the frozen carbon reduction amount of the carbon account are both the default carbon reduction amount when the carbon account is created, and the creator has the private key of the carbon account.
[0071] Optionally, the private key generating module is further configured to:
[0072] generate the private key of the carbon account;
[0073] generate the public key of the carbon account by a fourth random number and the private key of the carbon account.
[0074] Optionally, the commitment generating module is further configured to:
[0075] generate a default commitment by a fifth random number, the public key and a preset default carbon reduction amount.
[0076] In a third aspect, the present application provides an electronic device, comprising a memory and at least one processor;
[0077] The memory stores computer execution instructions.
[0078] The at least one processor executes the computer execution instructions stored in the memory, so that the electronic device implements the method of the first aspect.
[0079] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the method of the first aspect.
[0080] In a fifth aspect, the present application provides a computer program product, the computer program product comprises a computer program, and the computer program is executed by a processor to implement the method of the first aspect.
[0081] The carbon data processing method and device provided in the application determine an input carbon account set on a block chain, at least two input carbon accounts in the input carbon account set include at least one target carbon account and at least one random carbon account, the target carbon account includes a carbon emission reduction amount to be updated, and the random carbon account includes a carbon emission reduction amount not to be updated, the carbon emission reduction amount to be updated includes a remaining carbon emission reduction amount to be updated and / or a frozen carbon emission reduction amount to be updated, and each input carbon account in the input carbon account set is updated. The application can form an input carbon account set by combining random carbon accounts and target carbon accounts to be updated when the target carbon accounts are actually updated, so that the target carbon accounts to be actually updated can be protected by the random carbon accounts, and the privacy of the carbon accounts can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0082] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0083] Figure 1 is a software architecture schematic diagram provided by an embodiment of the application;
[0084] Figure 2 is a step flowchart of a carbon data processing method provided by an embodiment of the application;
[0085] Figure 3 is a flowchart of a carbon account updating process provided by an embodiment of the application;
[0086] Figure 4 is a structural block diagram of a carbon data processing device provided by an embodiment of the application;
[0087] Figure 5 is a structural block diagram of an electronic device provided by an embodiment of the application.
[0088] The above-described drawings have shown the specific embodiments of the application, and the following will have a more detailed description. These drawings and the written description are not intended to limit the scope of the concept of the application by any means, but to illustrate the concept of the application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0089] The exemplary embodiments will be described in detail herein with reference to the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the application. Instead, they are merely examples of apparatuses and methods consistent with some aspects of the application as detailed in the appended claims.
[0090] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards, and provide corresponding operation portal for user to choose authorization or rejection.
[0091] In order to promote energy saving and emission reduction, many software platforms can convert the user's energy saving and emission reduction behavior into carbon emission reduction amount, so as to express the user's contribution to energy saving and emission reduction through carbon emission reduction amount. When the carbon emission reduction amount is larger, it means that the user's contribution to energy saving and emission reduction is higher; when the carbon emission reduction amount is smaller, it means that the user's contribution to energy saving and emission reduction is lower. For example, the energy saving and emission reduction behavior can be riding, walking, etc., and the longer the duration of the energy saving and emission reduction behavior, the larger the carbon emission reduction amount.
[0092] The above platform specifies the target carbon account to be updated when updating the carbon emission reduction amount in the carbon account each time. In this way, the target carbon account may be leaked, and the security is poor.
[0093] In order to solve the above technical problems, the embodiments of the present application set two kinds of carbon emission reduction amounts, residual carbon emission reduction amount and frozen carbon emission reduction amount, for each carbon account, and when it is necessary to update the carbon emission reduction amount of the target carbon account, an input carbon account set is formed by combining a random carbon account and the target carbon account, and the updating is performed based on the input carbon account set. In this way, the carbon account that appears to be updated is not only the target carbon account, but also the random carbon account, which realizes the protection of the actual updated target carbon account and can improve the security of the update.
[0094] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail in specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0095] Figure 1 It is a software architecture schematic diagram provided by an embodiment of the present application. Referring to FIG. 1, the software architecture of the embodiment of the present application involves: a blockchain, a trusted execution environment, an intermediate software platform and a user terminal. Figure 1
[0096] Among them, the blockchain is a tool for storing carbon accounts, and the blockchain supports the updating of carbon accounts.
[0097] The user end is software or a device used by a user. The user end is configured to collect carbon reduction behaviors, and update a carbon account on a blockchain based on carbon reduction amounts corresponding to the carbon reduction behaviors. The user end can also update the carbon account on the blockchain based on user authorization through an intermediate software platform.
[0098] A trusted execution environment (TEE) is configured to calculate carbon reduction amounts based on carbon reduction behaviors.
[0099] The intermediate software platform is any software platform that needs to access the carbon account. The intermediate software platform can update the carbon account on the blockchain based on user authorization on the user end.
[0100] Based on the above software architecture, two data processing procedures are given below.
[0101] In the first data processing procedure, first, the user end collects carbon reduction behaviors of a user, and the user end sends the carbon reduction behaviors to the trusted execution environment. Then, the trusted execution environment calculates carbon reduction amounts based on the received carbon reduction behaviors, and sends the carbon reduction amounts to the user end. Finally, the user end updates a carbon account on a blockchain based on the received carbon reduction amounts.
[0102] In the second data processing procedure, first, a user authorizes carbon reduction amounts to be updated on the user end, and the user end generates an update request based on the carbon reduction amounts and a carbon account identifier corresponding to the user end on the blockchain, and sends the update request to the intermediate software platform. Then, the intermediate software platform updates the carbon account on the blockchain after a series of processing of the update request.
[0103] Traditional update algorithms usually only update carbon accounts specified by a user and carbon accounts corresponding to user ends where carbon reduction behaviors occur. Thus, these actual updated carbon accounts are leaked, and the security is poor. Unlike the traditional update algorithms, the carbon accounts updated by the embodiments of the present application not only include carbon accounts specified by a user and carbon accounts corresponding to user ends where carbon reduction behaviors occur, but also include some random carbon accounts. Thus, the actual updated carbon accounts can be protected, and the security of the carbon accounts is improved.
[0104] The carbon data processing method of the embodiments of the present application can be applied to Figure 1 the intermediate software platform shown in Figure 1 the user end shown in.
[0105] Figure 2 is a step flowchart of a carbon data processing method provided by the embodiments of the present application. Referring to Figure 2 the carbon data processing method of the present application can include
[0106] S101: Determine a set of input carbon accounts on the blockchain, at least two input carbon accounts in the set of input carbon accounts including at least one target carbon account and at least one random carbon account, the target carbon account including a carbon account whose carbon reduction amount is to be updated, the random carbon account including a carbon account whose carbon reduction amount is not to be updated, the carbon reduction amount to be updated including a remaining carbon reduction amount to be updated and / or a frozen carbon reduction amount to be updated.
[0107] The target carbon account is a carbon account that actually needs to update the carbon reduction amount, including a carbon account that needs to update the carbon reduction amount according to a carbon reduction behavior of a user and a carbon account that needs to update the carbon reduction amount according to an authorization of the user. The authorization of the user herein can be understood as the user authorizing the transaction of the carbon reduction amount.
[0108] The random carbon account is a carbon account that does not need to update the carbon reduction amount, and the random account is one or more carbon accounts randomly selected from the blockchain when the target carbon account needs to be updated.
[0109] After a batch of users perform carbon reduction behaviors, the carbon accounts of the batch of users on the blockchain are target carbon accounts, and one or more carbon accounts are randomly selected from the blockchain as random carbon accounts, and these target carbon accounts and random carbon accounts constitute the set of input carbon accounts; when a batch of users authorize the update of the carbon reduction amount, the carbon accounts of the batch of users on the blockchain are target carbon accounts, and these target carbon accounts and random carbon accounts constitute the set of input carbon accounts.
[0110] Each target carbon account or each random carbon account in the set of input carbon accounts described above can be referred to as an input carbon account, so that the set of input carbon accounts can be regarded as a collection of multiple input carbon accounts.
[0111] In embodiments of the present application, each carbon account on the blockchain corresponds to a carbon account identifier and a carbon reduction amount. The carbon reduction amount is further divided into a remaining carbon reduction amount and a frozen carbon reduction amount. The remaining carbon reduction amount is the carbon reduction amount currently available to the carbon account, and the frozen carbon reduction amount is the carbon reduction amount currently unavailable to the carbon account. For example, when initiating a transaction, the carbon reduction amount to be transacted is usually required to be a frozen carbon reduction amount, so as to lock these carbon reduction amounts to be transacted and ensure the success of the transaction.
[0112] In some schemes, each carbon account on the blockchain stores the following information: a carbon account identifier, a remaining carbon reduction amount, and a frozen carbon reduction amount. The carbon account identifier is used to uniquely represent a carbon account. However, this way can cause the problem of information leakage of the carbon account, and the privacy is poor.
[0113] In order to improve the privacy of the carbon account as much as possible, each carbon account on the blockchain includes: a public key, a first commitment corresponding to the remaining carbon emission reduction amount, and a second commitment corresponding to the frozen carbon emission reduction amount. As can be seen, the information in the carbon account on the blockchain is all encrypted information, which can improve security. The public key is used to uniquely represent a carbon account and can be regarded as a unique identifier of the carbon account, which is more secure than the traditional carbon account identifier. The public key can be generated according to a random number when the carbon account is created. The public key of the embodiment of the application is a renewable public key, which can be updated by a random number, but the private key corresponding to the public key does not need to be updated. The generation algorithm of the renewable public key can be as follows: first, generate a private key SK and a random number r Then, generate a renewable public key PK according to the private key SK, the random number r, and the generation element g of the renewable public key. The renewable public key PK=(g i ,h i )=(g r ,g r·SK ). When updating the renewable public key, a random number r is selected again to update the renewable public key according to the random number The owner of the private key does not need to know the random number to verify the correspondence between the renewable public key and the private key (VerifyKP(PK, SK)→0 / 1: analyze PK=(g SK ′, h′) output (g i ′)=h′). After updating the renewable public key, the correspondence between the updated renewable public key and the renewable public key before the update can be verified according to the random number (VerifyUpdate(PK', PK, r)→0 / 1: analyze Update(PK; r)=PK').
[0114] The first commitment is a commitment value calculated by the renewable public key on the remaining carbon emission reduction amount, which can be input into the commitment algorithm to calculate.
[0115] Similarly, the second commitment is a commitment value calculated by the renewable public key on the frozen carbon emission reduction amount, which can be input into the commitment algorithm to calculate. The commitment algorithms used by the first commitment and the second commitment are the same. The commitment algorithm is used to calculate the commitment value according to the renewable public key (g i ,h i ), the to-be-committed value v, and the random number r. The commitment value The to-be-committed value v is the aforementioned remaining carbon emission reduction amount or frozen carbon emission reduction amount. The commitment algorithm satisfies the homomorphism property, that is, Commit pk (v1; r1)⊙Commit pk (v2; r2)=Commit pk(v1+v2;r1+r2), we call the homomorphism operation as homomorphism addition operation. The commitment updating interface is used to update the previous commitment according to the public key, the random number r used for commitment updating, and the committed value Δv to be updated, and calculate the updated commitment. Specifically, the commitment updating interface inputs the public key, the random number used for commitment updating, and the committed value to be updated into the commitment algorithm to obtain a temporary commitment (Commit pk (Δv;r)). pk (v i ;r2).
[0116] In the embodiments of the present application, the above-mentioned carbon account is an updatable carbon account, which includes an updatable public key, a first commitment and a second commitment. A carbon account updating interface can be provided to update the carbon account. Specifically, the carbon account updating interface can call the updating interface of the updatable public key to update the public key, and call the commitment updating interface to update the first commitment and the second commitment.
[0117] It should be noted that each carbon account on the blockchain needs to generate its public key when created, and calculate the first commitment and the second commitment by default. After the carbon account is created, the carbon account can be updated according to actual needs.
[0118] In some embodiments, the creation process of any one of the above-mentioned carbon accounts on the blockchain includes: first, generating the public key of the carbon account; then, generating a default commitment according to the public key and a preset default carbon emission reduction amount; and finally, controlling the blockchain to create the carbon account according to the public key and the default commitment, and the first commitment and the second commitment of the carbon account are both the default commitment at the beginning.
[0119] The public key of the carbon account is an updatable public key, and the generation process is described above and will not be repeated here. After the public key of the to-be-created carbon account is generated, a default commitment can be generated according to the public key and a preset default carbon emission reduction amount. The default carbon emission reduction amount is preset, for example, the default carbon emission reduction amount can be set to 0, that is, when the carbon account is created by default, the remaining carbon emission reduction amount and the frozen carbon emission reduction amount are both 0. Of course, the default carbon emission reduction amount can be flexibly set, and the embodiments of the present application do not limit it.
[0120] The process of generating the default commitment can also use the above-mentioned commitment algorithm, that is, the default carbon emission reduction amount is calculated as the committed value.
[0121] Optionally, the default commitment is generated by a fifth random number, the public key and the preset default carbon reduction amount when the default commitment is generated according to the public key and the preset default carbon reduction amount. The fifth random number is a random number used to generate the default commitment. Specifically, the fifth random number, the public key and the default carbon reduction amount can be input into a commitment algorithm to obtain the default commitment.
[0122] After the public key and the default commitment are generated, a carbon account creation interface provided by a carbon account smart contract on the blockchain can be called to enable the carbon account creation interface to create a carbon account on the blockchain based on the public key and the default commitment. Specifically, the carbon account creation interface can use the public key as the public key of the newly created carbon account and use the default commitment as the first commitment and the second commitment of the newly created carbon account.
[0123] Embodiments of the present application can set a default carbon reduction amount when creating a carbon account to ensure the integrity of the initially created carbon account.
[0124] In some embodiments, the public key and the private key are generated together to ensure the correspondence between the public key and the private key. Specifically, the public key of the carbon account and the private key corresponding to the public key are generated. The public key and the private key are respectively corresponding to the same carbon account. To ensure the correspondence between the public key and the private key, the private key of the carbon account is generated first, and then the public key of the carbon account is generated by using a fourth random number and the private key of the carbon account.
[0125] After the above public key and the corresponding private key are generated, zero-knowledge verification can be performed based on the private key. Specifically, when creating a carbon account according to the public key and the default commitment, first, second zero-knowledge proof information is generated according to the public key, the default commitment, the default carbon reduction amount and the private key; and then the blockchain is controlled to create a carbon account according to the public key and the default commitment when the zero-knowledge verification based on the second zero-knowledge proof information is successful.
[0126] The above second zero-knowledge proof information is used to verify the relationship R(x, w) = 1: when creating a carbon account, the remaining carbon reduction amount and the frozen carbon reduction amount of the carbon account are both the default carbon reduction amount, and the creator has the private key of the carbon account. The second zero-knowledge proof information is a zero-knowledge proof about the relationship R(x, w) = 1, where x = (public key PK, default commitment COM) is the public input and w = (private key sk) is the secret input. When and only when the above R(x, w) = 1, it means that the second zero-knowledge proof verification is successful.
[0127] S102: Update each input carbon account in the input carbon account set.
[0128] In embodiments of the present application, the carbon account on the blockchain is an updatable carbon account, including: the public key of the carbon account is updatable, the first commitment of the carbon account is updatable, and the second commitment of the carbon account is updatable.
[0129] For the target carbon account in the input carbon account set, when its public key, first commitment, second commitment are updated, the remaining carbon reduction corresponding to the first commitment and / or the frozen carbon reduction corresponding to the second commitment can also be updated.
[0130] For the random carbon account in the input carbon account set, when its public key, first commitment, second commitment are updated, the remaining carbon reduction corresponding to the first commitment and / or the frozen carbon reduction corresponding to the second commitment are not updated. Therefore, from the surface, both the target carbon account and the random carbon account are updated, but in fact the remaining carbon reduction and the frozen carbon reduction corresponding to the random carbon account are not updated, so that the privacy of the target carbon account whose remaining carbon reduction and / or frozen carbon reduction are actually updated is protected under the premise of correctness.
[0131] In some embodiments, when each input carbon account in the input carbon account set is updated, each input carbon account in the input carbon account set can be updated by at least one random number, and different input carbon accounts use the same at least one random number. The random number is used to randomly update any content of the carbon account, which can ensure the randomness of the update of the input carbon account and further ensure the privacy of the carbon account. The random number can be used to process any at least one content of the carbon account to obtain an updated result.
[0132] Optionally, for each input carbon account in the input carbon account set, the output carbon account corresponding to the input carbon account is determined according to the at least one random number and the input carbon account, and the output carbon account set is obtained, so as to control the blockchain to update the input carbon account set to the output carbon account set.
[0133] Among them, the output carbon account is obtained by processing all the contents in the input carbon account by at least one random number. The output carbon account corresponding to each input carbon account in the input carbon account set constitutes the output carbon account set.
[0134] For all input carbon accounts in the input carbon account set, the at least one random number used is the same. The at least one random number can randomly map the input carbon account to the output carbon account, so that the relationship between the input carbon account and the output carbon account is random. Therefore, when the input carbon account is replaced by the output carbon account, it can be ensured that the replacement is private, which helps to ensure the security of the carbon account.
[0135] In some embodiments, we can delete each carbon account in the input carbon account set from the blockchain, and then store each output carbon account corresponding to each input carbon account in the input carbon account set on the blockchain, so as to realize the replacement of the input carbon account by the output carbon account.
[0136] To further improve the privacy, before the control blockchain updates the input carbon account set to the output carbon account set, further comprising: sorting each input carbon account in the input carbon account set and each output carbon account in the output carbon account set according to the same rule.
[0137] The rule is a rule for sorting carbon accounts. For example, the rule can sort the input carbon accounts in ascending order of the public keys of the input carbon accounts, and sort the output carbon accounts in ascending order of the public keys of the output carbon accounts, or sort the input carbon accounts in ascending order of the first commitment or the second commitment of the input carbon accounts, and sort the output carbon accounts in ascending order of the first commitment or the second commitment of the output carbon accounts. For convenience, a known algorithm such as the Hill sorting algorithm can also be directly called to sort in ascending order of the public keys.
[0138] The embodiments of the present application can sort the input carbon account set and the output carbon account set respectively to disrupt the mapping relationship between the input carbon accounts and the output carbon accounts. In this way, the disclosure of the mapping relationship can be avoided, and the privacy of the carbon accounts can be further improved.
[0139] Optionally, when determining the output carbon account corresponding to the input carbon account according to the at least one random number and the input carbon account, the following algorithm can be used: first, according to the first random number and the public key of the input carbon account, the public key of the output carbon account corresponding to the input carbon account is determined by calling the public key updating algorithm; then, according to the second random number, the public key of the output carbon account, the to-be-updated commitment value (for a random carbon account, the update value is 0) and the first commitment of the input carbon account, the first commitment of the output carbon account corresponding to the input carbon account is determined; then, according to the third random number, the public key of the output carbon account, the to-be-updated commitment value (for a random carbon account, the update value is 0) and the second commitment of the input carbon account, the second commitment of the output carbon account corresponding to the input carbon account is determined.
[0140] The first random number is used to randomly generate the public key of the output carbon account, and is specifically used to obtain the public key of the output carbon account after randomly updating the public key of the input carbon account. The same first random number can be used for all input carbon accounts in the input carbon account set to obtain the public key of the corresponding output carbon account. The updating of the public key by the random number can call an update interface of the updatable public key, which can square each item in the public key of the input carbon account by the first random number to obtain the public key of the output carbon account. Specifically, if the public key of the input carbon account is PK=(g, h), then the public key of the output carbon account is PK'=(g r1 ,h r1 ), where r1 is the first random number.
[0141] After obtaining the public key of the output carbon account corresponding to the input carbon account, the first commitment of the output carbon account can be calculated according to the second random number, the public key of the output carbon account and the first commitment of the input carbon account. The second random number is used to randomly generate the first commitment of the output carbon account. Specifically, the first commitment of the output carbon account can be obtained by calling the commitment update interface. At this time, the public key of the output carbon account is used as the public key, the second random number is used as the random number used to update the first commitment, and the first commitment of the input carbon account is used as the commitment before updating, which are input into the commitment update interface. The commitment after updating is the first commitment of the output carbon account.
[0142] Similarly, the second commitment of the output carbon account can be calculated according to the third random number, the public key of the output carbon account and the second commitment of the input carbon account. The third random number is used to randomly generate the second commitment of the output carbon account. Specifically, the second commitment of the output carbon account can also be obtained by calling the commitment update interface. At this time, the public key of the output carbon account is used as the public key, the third random number is used as the random number used to update the second commitment, and the second commitment of the input carbon account is used as the commitment before updating, which are input into the commitment update interface. The commitment after updating is the second commitment of the output carbon account.
[0143] As can be seen from the above description, the embodiments of the present application can update the public key, the first commitment and the second commitment of the input carbon account by three random numbers respectively to obtain the output carbon account. Since the three random numbers are different, the randomness of the update results of the public key, the first commitment and the second commitment can be ensured to be different when updating the carbon account, so that the randomness of the update is better, which helps to further ensure the security of the carbon account.
[0144] The output carbon account is the carbon account after updating the input carbon account. After obtaining the output carbon account, the input carbon account on the blockchain can be replaced by the corresponding output carbon account. In an implementation, in order to ensure the accuracy of the update, zero-knowledge proof needs to be performed before updating the input carbon account set to the output carbon account set. Therefore, when controlling the blockchain to update the input carbon account set to the output carbon account set, first, the first zero-knowledge proof information is generated according to the input carbon account set and the output carbon account set. The first zero-knowledge proof information is used to verify that the update of the input carbon account set by the output carbon account set is correct. Then, the blockchain updates the input carbon account set to the output carbon account set when the zero-knowledge verification according to the first zero-knowledge proof information is successful. It can be understood that the blockchain will not update the input carbon account set to the output carbon account set when the zero-knowledge verification according to the first zero-knowledge proof information fails. In this way, the accuracy of the update of the carbon account can be ensured.
[0145] The embodiments of the present application need to update the target carbon account in two scenarios.
[0146] The first scenario is that a batch of users have carbon reduction behaviors, at this time, the carbon accounts corresponding to the batch of users are taken as target carbon accounts, and the steps S101 and S102 are executed to add the carbon reduction amounts corresponding to the carbon reduction behaviors of the batch of users to the remaining carbon reduction amounts of the carbon accounts of the batch of users on the blockchain.
[0147] In the first scenario, the update type of the target carbon account is to update the carbon reduction amount of the target carbon account based on the carbon reduction behavior of the user. At this time, the update amount of the remaining carbon reduction amount of the target carbon account is determined by the trusted execution environment according to the carbon reduction behavior. Since the carbon reduction behaviors of the users of different target carbon accounts may be different, the update amounts of the remaining carbon reduction amounts of different target carbon accounts may be different. In addition, in this scenario, only the remaining carbon reduction amount needs to be directly increased, so the update amount of the frozen carbon reduction amount of the target carbon account is 0, and the frozen carbon reduction amount of the target carbon account does not need to be updated.
[0148] It can be understood that in the first scenario, the update of the remaining carbon reduction amount of the target carbon account is to increase the remaining carbon reduction amount.
[0149] The second scenario is that a batch of users respectively authorize the transaction of their own carbon reduction amounts, at this time, the carbon accounts corresponding to the batch of users are taken as target carbon accounts, and the steps S101 and S102 are executed twice, that is, the update of S101 to S102 needs to be executed twice to realize this transaction of the batch of users.
[0150] When the update of S101 to S102 is executed for the first time in the second scenario, the update type of the target carbon account is to initiate the update of the target carbon account based on the preset update amount. At this time, the update amount of the remaining carbon reduction amount of the target carbon account is the preset update amount, and the update amount of the frozen carbon reduction amount of the target carbon account is the opposite of the preset update amount. For example, when the preset update amount is -50, the remaining carbon reduction amount can be reduced by 50, and the frozen carbon reduction amount can be increased by 50.
[0151] When the update of S101 to S102 is executed for the second time in the second scenario, the update type of the target carbon account is to update the target carbon account based on the preset update amount successfully, or the update type of the target carbon account is to update the target carbon account based on the preset update amount unsuccessfully.
[0152] When the update type of the target carbon account is to update the target carbon account based on the preset update amount successfully, the update amount of the remaining carbon reduction amount of the target carbon account is 0, and the update amount of the frozen carbon reduction amount of the target carbon account is the preset update amount. For example, when the preset update amount is -50, the frozen carbon reduction amount can be reduced by 50.
[0153] When the update type of the target carbon account is: updating the target carbon account based on the preset update amount fails, the update amount of the remaining carbon emission reduction amount of the target carbon account is the opposite number of the preset update amount, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the preset update amount. For example, when the preset update amount is -50, the remaining carbon emission reduction amount can be increased by 50, and the frozen carbon emission reduction amount can be reduced by 50.
[0154] It can be seen that for a target carbon account with a preset update amount of -50, first, when initiating the update of the target carbon account, the remaining carbon emission reduction amount of the target carbon account is reduced by 50, and the frozen carbon emission reduction amount of the target carbon account is increased by 50, which is equivalent to deducting the carbon emission reduction amount to be traded from the remaining carbon emission reduction amount first and temporarily freezing it; then, when the target user successfully pays for the above update of the target carbon account, the frozen carbon emission reduction amount of the target carbon account is reduced by 50 to cancel the freezing, and when the target user fails to pay for the above update of the target carbon account or times out, the remaining carbon emission reduction amount of the target carbon account is increased by 50, and the frozen carbon emission reduction amount of the target carbon account is reduced by 50.
[0155] It should be noted that the preset update amount of the target carbon account is specified by the user of the target carbon account, so that the corresponding preset update amount of different target carbon accounts may not be the same. In this way, through the above process, two-stage trading of the target carbon account can be realized to ensure the atomicity of the transaction.
[0156] When the update type of the target carbon account is different, the first zero-knowledge proof information corresponding to the above is also different, so that the generation process of the first zero-knowledge proof information is associated with the update type of the target carbon account. When a group of target carbon accounts are updated in batches, an input carbon account set can be generated based on the group of target carbon accounts, and the update types of the group of target carbon accounts are the same.
[0157] In the case that the update type of the target carbon account is to update the carbon reduction amount of the target carbon account based on the carbon reduction behavior of the user, the process of generating the first zero-knowledge proof information according to the at least two input carbon accounts and the at least two output carbon accounts can include: first, obtaining the update amount of the remaining carbon reduction amount of each input carbon account; and then, generating the first zero-knowledge proof information according to the set of input carbon accounts, the set of output carbon accounts, the update amount of the remaining carbon reduction amount of each input carbon account, the first random number to the third random number, the first zero-knowledge proof information being used to verify that the random carbon account has been updated, the remaining carbon reduction amount and the frozen carbon reduction amount of the random carbon account that has not been updated, the remaining carbon reduction amount of the target carbon account has been updated according to the update amount of the remaining carbon reduction amount of the target carbon account, and the update amount of the remaining carbon reduction amount of the target carbon account and the updated remaining carbon reduction amount of the target carbon account are both within a preset range. In this way, the accuracy of the update can be ensured when the carbon reduction amount of the target carbon account is updated based on the carbon reduction behavior of the user.
[0158] It can be understood that when the input carbon account is a random carbon account, the update amount of the remaining carbon reduction amount of the input carbon account is 0.
[0159] In the case that the update amount of the target carbon account is to update the target carbon account based on the carbon reduction behavior, the set of input carbon accounts is denoted as inputs, the set of output carbon accounts is denoted as outputs, the set of public keys of each input carbon account is denoted as PK, the set of remaining carbon reduction amounts of all input carbon accounts is denoted as BL, the first random number, the second random number and the third random number are denoted as r1, r2 and r3. The mapping relationship between each input carbon account in the set of input carbon accounts and each output carbon account in the set of output carbon accounts is denoted as F. At this time, the first zero-knowledge proof information is used to verify whether the relationship R(x, w) = 1 is established, where x = (inputs, outputs), w = (PK, BL, V, r1, r2, r3, F, S), V is the set of update amounts of the remaining carbon reduction amounts of all target carbon accounts, and S is the set of serial numbers of all target carbon accounts in the set of input carbon accounts.
[0160] Specifically, one of the relationships verified by the first zero-knowledge proof information is that the random carbon account has been updated, and the remaining carbon reduction amount and the frozen carbon reduction amount of the random carbon account that has not been updated can be represented by the following formula (1).
[0161]
[0162] where acct i and acct' F(i)respectively, the i-th input carbon account in the random carbon account in the input carbon account set, and the output carbon account corresponding to the i-th input carbon account. Thus, the above formula (1) is used to represent that the random carbon account in the n input carbon accounts has been updated, and the remaining carbon emission reduction and the frozen carbon emission reduction are not updated.
[0163] The second relationship for the first zero-knowledge proof information to verify is that the remaining carbon emission reduction of the target carbon account has been updated according to the update amount of the remaining carbon emission reduction of the target carbon account, which can be represented by the following formula (2).
[0164]
[0165] wherein Vi is the update amount of the remaining carbon emission reduction of the i-th input carbon account, and when i=S, Vi is the update amount of the remaining carbon emission reduction of a target carbon account. The above formula (2) is used to represent that the target carbon account in the n input carbon accounts has been updated, and the remaining carbon emission reduction has been updated according to the corresponding update amount.
[0166] The third relationship for the first zero-knowledge proof information to verify is that the update amount of the remaining carbon emission reduction of the target carbon account is within a preset range, which can be represented by formula (3).
[0167]
[0168] wherein V1R is the preset range of the update amount of the remaining carbon emission reduction.
[0169] The fourth relationship for the first zero-knowledge proof information to verify is that the updated remaining carbon emission reduction of the target carbon account is within a preset range, which can be represented by formula (4).
[0170]
[0171] wherein BLi is the remaining carbon emission reduction of the i-th input carbon account before updating, thus, BLi+Vi is the remaining carbon emission reduction of the i-th input carbon account after updating. V2R is the preset range of the updated remaining carbon emission reduction of the target carbon account.
[0172] In the case that the update type of the target carbon account is: initiating the target carbon account update based on the preset update amount, or successfully updating the target carbon account based on the preset update amount, or unsuccessfully updating the target carbon account based on the preset update amount, the process of generating the first zero-knowledge proof information according to the at least two input carbon accounts and the at least two output carbon accounts can include: first, obtaining the update identifier of the target carbon account based on the preset update amount; obtaining the update amount of the remaining carbon emission reduction amount of each target carbon account and the update amount of the frozen carbon emission reduction amount of each target carbon account; then, generating the first zero-knowledge proof information according to the input carbon account set and the output carbon account set, the update identifier, the private key of each target carbon account, the update amount of the remaining carbon emission reduction amount of each target carbon account, the signature of each target carbon account, the first random number to the third random number, the first zero-knowledge proof information being used to verify that: the random carbon account has been updated, the remaining carbon emission reduction amount and the frozen carbon emission reduction amount of the random carbon account have not been updated, the update amount of the frozen carbon emission reduction amount of the target carbon account and the update amount of the remaining carbon emission reduction amount of the target carbon account are consistent with the update type, the update amount of the remaining carbon emission reduction amount of the target carbon account, the remaining carbon emission reduction amount of the target carbon account after the update, the frozen carbon emission reduction amount of the target carbon account after the update, and the update amount of the frozen carbon emission reduction amount of the target carbon account are all within a preset range. In this way, the accuracy of the update of the carbon emission reduction amount of the target carbon account based on the preset update amount can be ensured.
[0173] It can be understood that when the input carbon account is a random carbon account, the update amount of the remaining carbon emission reduction amount and the update amount of the frozen carbon emission reduction amount of the input carbon account are both 0.
[0174] In the case that the update type of the target carbon account is: initiating the target carbon account update based on the preset update amount, or successfully updating the target carbon account based on the preset update amount, or unsuccessfully updating the target carbon account based on the preset update amount, the first zero-knowledge proof is not only used to verify the verification contents represented by the foregoing formulas (1), (3), and (4), but also needs to verify the verification contents represented by formulas (5), (6), and (7).
[0175]
[0176] wherein, is the signature public key of the i-th input carbon account, which is calculated by inputting the private key of the i-th input carbon account and the public key in the i-th input carbon account into a signature algorithm to sign the public key in the i-th input carbon account by the private key of the i-th input carbon account. The signature algorithm can be a signature algorithm based on the DDH assumption, such as the Schnorr signature algorithm or the Elgamal Signature algorithm. σi is the signature of the i-th input carbon account, when i belongs to S, That is, the signature public key of a target carbon account, σi is the signature of the target carbon account. TID is the update identifier when updating the target carbon accounts in the input carbon account set. TID||Vi is used to splice the update identifier and the preset update amount of the i-th input carbon account.
[0177] It can be seen that formula (5) is used to indicate that the signature of the target carbon account is correct.
[0178]
[0179] Wherein, SKi is the private key of the i-th input carbon account, is the signature public key of the i-th input carbon account, when i belongs to S, SKi is the private key of a target carbon account, That is, the signature public key of a target carbon account.
[0180] It can be seen that formula (6) is used to indicate that the correspondence between the signature public key of the target carbon account and the private key of the target carbon account is correct.
[0181]
[0182] Wherein, BLi is the remaining carbon emission reduction amount of the i-th input carbon account, DJi is the frozen carbon emission reduction amount of the i-th input carbon account.
[0183] It can be seen that formula (7) is used to indicate that the correspondence between the updated target carbon account and the private key is correct. Formulas (5)-(7) are combined to indicate that the owner of the target carbon account indeed authorizes the transaction amount.
[0184] When the update type of the target carbon account is: initiating the target carbon account update based on the preset update amount, formula (8) can be used to indicate: increasing the remaining carbon emission reduction amount of each target carbon account by the preset update amount, and decreasing the frozen carbon emission reduction amount by the preset update amount. Thus, the update amount of the frozen carbon emission reduction amount of the target carbon account and the update amount of the remaining carbon emission reduction amount of the target carbon account are consistent with the update type.
[0185]
[0186] Wherein, Vi is the preset update amount of the i-th input carbon account, Vi is less than zero.
[0187] When the update type of the target carbon account is: updating the target carbon account based on the preset update amount successfully, formula (9) can be used to indicate: increasing the frozen carbon emission reduction amount of each target carbon account by the preset update amount. Thus, the update amount of the frozen carbon emission reduction amount of the target carbon account and the update amount of the remaining carbon emission reduction amount of the target carbon account are consistent with the update type.
[0188]
[0189] In a case where the update type of the target carbon account is: the target carbon account is updated based on the preset update amount fails, the formula (10) is used to represent: the remaining carbon emission reduction amount of each target carbon account is increased by the preset update amount, and the frozen carbon emission reduction amount is reduced by the preset update amount. Thus, the update amount of the frozen carbon emission reduction amount of the target carbon account and the update amount of the remaining carbon emission reduction amount of the target carbon account are consistent with the update type.
[0190]
[0191] In some embodiments, the process of updating the input carbon account set to the output carbon account set when the zero-knowledge verification based on the first zero-knowledge proof information succeeds can specifically include: first, calling an account update interface of a smart account contract on the blockchain, the account update interface being used to perform zero-knowledge verification based on the first zero-knowledge proof information, and updating the input carbon account set to the output carbon account set when the verification succeeds.
[0192] The smart account contract is a functional module for managing carbon accounts on the blockchain, which provides a plurality of interfaces, including: an account creation interface, an account update interface, and the like.
[0193] The account creation interface is used to create a carbon account on the blockchain based on a pre-generated public key, a default commitment, and second zero-knowledge proof information. Specifically, the account creation interface is used to receive the pre-generated public key, the default commitment, and the second zero-knowledge proof information, and when the zero-knowledge verification of the second zero-knowledge proof information passes, the received public key is used as the public key of the created carbon account, and the received default commitment is used as the first commitment and the second commitment in the created carbon account, and the current carbon account creation succeeds; when the zero-knowledge verification of the second zero-knowledge proof information fails, the carbon account is not created, and the current carbon account creation fails.
[0194] The account update interface is used to update the carbon account on the blockchain based on the pre-generated input carbon account set, the output carbon account set, and the first zero-knowledge proof. Specifically, the account update interface is used to receive the input carbon account set, the output carbon account set, and the first zero-knowledge proof information, and when the zero-knowledge verification of the first zero-knowledge proof information passes, each input carbon account in the input carbon account set is deleted from the blockchain, and then each output carbon account in the output carbon account set is added to the blockchain, and the current carbon account update succeeds; when the zero-knowledge verification of the first zero-knowledge proof information fails, the carbon account is not updated, and the current carbon account update fails.
[0195] It can be seen that the first zero-knowledge proof information, the input carbon account set and the output carbon account set can be sent to the account updating interface of the blockchain to realize carbon account updating, and the specific updating logic inside the account updating interface does not need to be concerned about, so that the software code outside the blockchain can be simplified
[0196] As can be seen from the foregoing description, the embodiment of the present application is a batch updating operation on the input carbon account set. In order to better manage the batch updating operation on the input carbon account set, an updating execution state representing the execution progress of the batch updating operation on the input carbon account set can also be set. The updating execution state can be divided into at least the following four states: not executed, executing, execution success and execution failure.
[0197] Before each execution of the batch updating operation on the input carbon account set, the updating execution state of the input carbon account set is not executed.
[0198] The updating process of the above updating execution state is associated with the updating type of the target carbon account, so the updating execution state can be adjusted according to the updating type of the target carbon account. The updating type of each target carbon account in the same input carbon account set is the same.
[0199] When the updating type of the target carbon account is to initiate the target carbon account updating based on the preset updating amount, the updating execution state is adjusted to executing.
[0200] When the updating type of the target carbon account is to update the target carbon account based on the preset updating amount successfully, the updating execution state is adjusted to execution success.
[0201] When the updating type of the target carbon account is to update the target carbon account based on the preset updating amount unsuccessfully, the updating execution state is adjusted to execution failure.
[0202] In actual application, for one transaction of multiple target carbon accounts, two batch updating operations need to be performed in turn, including: first performing the first batch updating operation, and then performing the second batch updating operation or the third batch updating operation.
[0203] In the process of performing the first batch updating operation, the updating type of the target carbon account is to initiate the target carbon account updating based on the preset updating amount. Therefore, when performing the first batch updating operation, the updating execution state is first adjusted to executing, then the input carbon account set is composed to update the input carbon account set, and a payment request for each target carbon account in the input carbon account set is initiated. When the payment is successful and not timed out, the second batch updating operation is performed; when the payment fails or is timed out, the third batch updating operation is performed.
[0204] In the process of performing the second batch update operation, the update type of the target carbon account is to update the target carbon account based on the preset update amount successfully. Therefore, when performing the second batch update operation, the update execution state is first adjusted to execution success, and then the input carbon account set is composed to update the input carbon account set.
[0205] In the process of performing the third batch update operation, the update type of the target carbon account is to update the target carbon account based on the preset update amount unsuccessfully. Therefore, when performing the second batch update operation, the update execution state is first adjusted to execution failure, and then the input carbon account set is composed to update the input carbon account set.
[0206] Figure 3 is a flowchart of a carbon account updating process provided by an embodiment of the present application. Referring to Figure 3 , two updating processes are shown, the first updating process is used to update the carbon account on the blockchain based on carbon emission reduction behavior, and the second updating process is used to update the carbon account on the blockchain based on user authorized transaction.
[0207] In the above first updating process, the following steps are included:
[0208] S201: The user end collects the carbon emission reduction behavior of the user.
[0209] S202: The user end obtains the carbon emission reduction amount corresponding to the carbon emission reduction behavior from the trusted execution environment.
[0210] Specifically, the user end can send the carbon emission reduction behavior to the trusted execution environment to make the trusted execution environment generate the carbon emission reduction amount corresponding to the carbon emission reduction behavior. Of course, in order to ensure the security of the carbon emission reduction amount of the carbon emission reduction behavior, the trusted execution environment can also encrypt it, and the user end needs to decrypt it when receiving the carbon emission reduction amount corresponding to the carbon emission reduction behavior.
[0211] S203: The user end controls the carbon account smart contract on the blockchain to perform the updating process based on the carbon emission reduction behavior.
[0212] Specifically, the user end can update the target carbon account on the blockchain through the carbon data processing method of the present application. In this process, the user end needs to determine a random carbon account to constitute an input carbon account set with the target carbon account, and implement updating based on the input carbon account set, which specifically means adding the carbon emission reduction amount corresponding to the carbon emission reduction behavior of the user to the remaining carbon emission reduction amount in the carbon account of the user.
[0213] In the above second updating process, the following steps are included:
[0214] S204: The user authorizes the transaction on the user end and formulates a preset update amount.
[0215] S205: The user terminal requests a transaction from the intermediate software platform.
[0216] S206: The intermediate software platform calls a transaction initiation interface of the carbon transaction smart contract to initiate a target carbon account updating process based on a preset updating amount.
[0217] S207: The intermediate software platform initiates a payment process to the payment platform.
[0218] S208: After the input carbon account set and the output carbon account set, and the first zero-knowledge proof information are prepared, the transaction initiation interface of the carbon transaction smart contract calls an account updating interface of the carbon account smart contract to perform an account updating process of initiating a transaction.
[0219] S209: When the payment platform returns a payment success, the intermediate software platform calls a transaction success interface of the carbon transaction smart contract to perform an updating success process based on a preset updating amount.
[0220] S210: After the input carbon account set and the output carbon account set, and the first zero-knowledge proof information are prepared, the transaction success interface of the carbon transaction smart contract calls an account updating interface of the carbon account smart contract to perform an account updating process of a transaction success.
[0221] S211: When the payment platform returns a payment failure, the intermediate software platform calls a transaction failure interface of the carbon transaction smart contract to perform an updating failure process based on a preset updating amount.
[0222] S212: After the input carbon account set and the output carbon account set, and the first zero-knowledge proof information are prepared, the transaction failure interface of the carbon transaction smart contract calls an account updating interface of the carbon account smart contract to perform an account updating process of a transaction failure.
[0223] It should be noted that the preset updating amount can be greater than 0 or less than 0.
[0224] In the account updating process of initiating a transaction, the remaining carbon emission reduction amount of the target carbon account is increased by the preset updating amount, and the frozen carbon emission reduction amount of the target carbon account is reduced by the preset updating amount. In the account updating process of a transaction success, the frozen carbon emission reduction amount of the target carbon account is reduced by the preset updating amount. In the account updating process of a transaction failure, the remaining carbon emission reduction amount of the target carbon account is reduced by the preset updating amount, and the frozen carbon emission reduction amount of the target carbon account is increased by the preset updating amount.
[0225] In the above three account updating processes, the public keys of the random carbon account and the target carbon account need to be updated, and the frozen carbon emission reduction amount and the remaining carbon emission reduction amount of the random carbon account are not updated.
[0226] Figure 4is a structural block diagram of a carbon data processing device provided by an embodiment of the present application, referring to Figure 4 The carbon data processing device 400 includes
[0227] An account set determination module 401 is configured to determine an input carbon account set on a blockchain, at least two input carbon accounts in the input carbon account set including at least one target carbon account and at least one random carbon account, the target carbon account including a carbon emission reduction amount to be updated carbon account, and the random carbon account including a carbon emission reduction amount not to be updated carbon account, the carbon emission reduction amount to be updated including a remaining carbon emission reduction amount to be updated and / or a frozen carbon emission reduction amount to be updated.
[0228] An account set updating module 402 is configured to update each input carbon account in the input carbon account set.
[0229] Optionally, each carbon account includes a public key, a first commitment corresponding to the remaining carbon emission reduction amount, and a second commitment corresponding to the frozen carbon emission reduction amount, and the public key is used to uniquely represent the carbon account.
[0230] Optionally, the account set updating module 402 is further configured to:
[0231] Each input carbon account in the input carbon account set is updated by at least one random number, and the same at least one random number is used for different input carbon accounts.
[0232] Optionally, the account set updating module 402 is further configured to:
[0233] For each input carbon account in the input carbon account set, an output carbon account corresponding to the input carbon account is determined according to at least one random number and the input carbon account, and an output carbon account set is obtained; and the blockchain is controlled to update the input carbon account set to the output carbon account set.
[0234] Optionally, the account set updating module 402 is further configured to:
[0235] Each input carbon account in the input carbon account set and each output carbon account in the output carbon account set are sorted according to the same rule, respectively.
[0236] Optionally, the account set updating module 402 is further configured to:
[0237] determining, according to the first random number and a public key of the input carbon account, a public key of an output carbon account corresponding to the input carbon account; determining, according to a second random number, the public key of the output carbon account and a first commitment of the input carbon account, a first commitment of the output carbon account corresponding to the input carbon account; determining, according to a third random number, the public key of the output carbon account and a second commitment of the input carbon account, a second commitment of the output carbon account corresponding to the input carbon account.
[0238] Optionally, the account set updating module 402 is further configured to:
[0239] generating first zero-knowledge proof information according to the input carbon account set and the output carbon account set, the first zero-knowledge proof information being used to verify that updating the input carbon account set by the output carbon account set is correct; and controlling the blockchain to update the input carbon account set to the output carbon account set when zero-knowledge verification according to the first zero-knowledge proof information is successful.
[0240] Optionally, when the update type of the target carbon account is to update the carbon emission reduction amount of the target carbon account based on a carbon emission reduction behavior of a user, the update amount of the remaining carbon emission reduction amount of the target carbon account is determined by a trusted execution environment according to the carbon emission reduction behavior, and the update amount of the frozen carbon emission reduction amount of the target carbon account is 0.
[0241] Optionally, when the update type of the target carbon account is to initiate the target carbon account update based on a preset update amount, the update amount of the remaining carbon emission reduction amount of the target carbon account is the preset update amount, and the update amount of the frozen carbon emission reduction amount of the target carbon account is an opposite number of the preset update amount; when the update type of the target carbon account is to update the target carbon account based on the preset update amount successfully, the update amount of the remaining carbon emission reduction amount of the target carbon account is 0, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the preset update amount; when the update type of the target carbon account is to update the target carbon account based on the preset update amount unsuccessfully, the update amount of the remaining carbon emission reduction amount of the target carbon account is an opposite number of the preset update amount, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the preset update amount.
[0242] Optionally, the account set updating module 402 is further configured to:
[0243] obtaining an updated amount of the remaining carbon emission reduction of each of the input carbon accounts; generating first zero-knowledge proof information according to the set of input carbon accounts, the set of output carbon accounts, the updated amount of the remaining carbon emission reduction of each of the input carbon accounts, the first random number to the third random number, the first zero-knowledge proof information being used to verify that the random carbon account has been updated, the remaining carbon emission reduction and the frozen carbon emission reduction of the random carbon account have not been updated, the remaining carbon emission reduction of the target carbon account has been updated according to the updated amount of the remaining carbon emission reduction of the target carbon account, and the updated amount of the remaining carbon emission reduction of the target carbon account and the updated remaining carbon emission reduction of the target carbon account are both within a preset range.
[0244] Optionally, the account set updating module 402 is further configured to:
[0245] obtaining an updated identification of the target carbon account based on a preset updating amount; obtaining an updated amount of the remaining carbon emission reduction of each of the target carbon accounts and an updated amount of the frozen carbon emission reduction of each of the target carbon accounts; generating the first zero-knowledge proof information according to the set of input carbon accounts and the set of output carbon accounts, the updated identification, a private key of each of the target carbon accounts, the updated amount of the remaining carbon emission reduction of each of the target carbon accounts, a signature of each of the target carbon accounts, the first random number to the third random number, the first zero-knowledge proof information being used to verify that the random carbon account has been updated, the remaining carbon emission reduction and the frozen carbon emission reduction of the random carbon account have not been updated, the updated amount of the frozen carbon emission reduction of the target carbon account is consistent with the updating type of the updated amount of the remaining carbon emission reduction of the target carbon account, and the updated amount of the remaining carbon emission reduction of the target carbon account, the updated remaining carbon emission reduction of the target carbon account, the updated frozen carbon emission reduction of the target carbon account, and the updated amount of the frozen carbon emission reduction of the target carbon account are all within a preset range.
[0246] Optionally, the account set updating module 402 is further configured to:
[0247] calling an account updating interface of a smart account contract on the blockchain, the account updating interface being used to perform zero-knowledge verification according to the first zero-knowledge proof information, and updating the set of input carbon accounts to the set of output carbon accounts when the verification is successful.
[0248] Optionally, the account set updating module 402 is further configured to:
[0249] Adjust an update execution state according to an update type of the target carbon account; wherein the update execution state is adjusted to be in execution when the target carbon account is initiated to be updated based on a preset update amount; the update execution state is adjusted to be successful when the target carbon account is successfully updated based on the preset update amount; and the update execution state is adjusted to be failed when the target carbon account fails to be updated based on the preset update amount.
[0250] Optionally, the creation process of any one carbon account on the blockchain comprises:
[0251] A public key generation module is configured to generate a public key of the carbon account.
[0252] A commitment generation module is configured to generate a default commitment according to the public key and a preset default carbon reduction amount.
[0253] A creation module is configured to control the blockchain to create the carbon account according to the public key and the default commitment, and the first commitment and the second commitment of the carbon account are both the default commitment at the initial time.
[0254] Optionally, the public key generation module is further configured to:
[0255] generate the public key of the carbon account and a private key corresponding to the public key.
[0256] The creation module is further configured to:
[0257] generate second zero-knowledge proof information according to the public key, the default commitment, the default carbon reduction amount and the private key, and control the blockchain to create the carbon account according to the public key and the default commitment when zero-knowledge verification based on the second zero-knowledge proof information is successful, the second zero-knowledge proof information being used to verify that the remaining carbon reduction amount and the frozen carbon reduction amount of the carbon account are both the default carbon reduction amount when the carbon account is created, and the creator has the private key of the carbon account.
[0258] Optionally, the private key generation module is further configured to:
[0259] generate the private key of the carbon account;
[0260] generate the public key of the carbon account through a fourth random number and the private key of the carbon account.
[0261] Optionally, the commitment generation module is further configured to:
[0262] generate the default commitment through a fifth random number, the public key and a preset default carbon reduction amount.
[0263] The device embodiment corresponds to the foregoing method embodiment, and specific descriptions can be referred to the foregoing method embodiment. The present embodiment will not be repeated here.
[0264] Figure 5 is a structural block diagram of an electronic device provided by the present embodiment. The electronic device 600 includes a memory 602 and at least one processor 601.
[0265] The memory 602 stores computer execution instructions.
[0266] The at least one processor 601 executes the computer execution instructions stored in the memory 602, so that the electronic device 600 implements the foregoing carbon data processing method.
[0267] In addition, the electronic device 600 can further include a receiver 603 and a transmitter 604. The receiver 603 is used to receive information from other devices or equipment and forward it to the processor 601. The transmitter 604 is used to send information to other devices or equipment.
[0268] The electronic device 600 here can be a user terminal as shown, or an intermediate software platform. Figure 1
[0269] In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, which stores computer execution instructions. When the computer execution instructions are executed by a processor, the computer execution instructions are used to implement the foregoing method.
[0270] In an exemplary embodiment, a computer program product is also provided, which is used to implement the foregoing method.
[0271] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims. Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.
[0272] It should be understood that the application is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application should only be limited by the appended claims.
Claims
1. A carbon data processing method, characterized in that: The method comprises: Determining an input carbon account set on a blockchain, wherein at least two input carbon accounts in the input carbon account set include: at least one target carbon account and at least one random carbon account, the target carbon account includes a carbon account whose carbon emission reduction amount is to be updated, the random carbon account includes a carbon account whose carbon emission reduction amount is not to be updated, and the carbon emission reduction amount to be updated includes: remaining carbon emission reduction amount to be updated and / or frozen carbon emission reduction amount to be updated; Each input carbon account in the input carbon account set is updated.
2. The method according to claim 1, characterized in that Each of the carbon accounts includes: a public key, a first commitment corresponding to the remaining carbon emission reduction, and a second commitment corresponding to the frozen carbon emission reduction, and the public key is used to uniquely represent the carbon account.
3. The method according to claim 2, characterized in that The updating of each input carbon account in the input carbon account set includes: Each input carbon account in the input carbon account set is updated by using at least one random number, and different input carbon accounts use the same at least one random number.
4. The method according to claim 3, characterized in that The updating of each input carbon account in the input carbon account set by using at least one random number includes: For each input carbon account in the input carbon account set, determining an output carbon account corresponding to the input carbon account according to at least one random number and the input carbon account, to obtain an output carbon account set; Control the blockchain to update the input carbon account set to the output carbon account set.
5. The method according to claim 4, characterized in that Before controlling the blockchain to update the input carbon account set to the output carbon account set, the method further includes: Each input carbon account in the input carbon account set and each output carbon account in the output carbon account set are sorted according to the same rule.
6. The method according to claim 4, characterized in that The determining, based on at least one random number and the input carbon account, an output carbon account corresponding to the input carbon account includes: Determining the public key of the output carbon account corresponding to the input carbon account according to the first random number and the public key of the input carbon account; determining, according to a second random number, the public key of the output carbon account, and the first commitment of the input carbon account, a first commitment of an output carbon account corresponding to the input carbon account; The second commitment of the output carbon account corresponding to the input carbon account is determined according to a third random number, the public key of the output carbon account, and the second commitment of the input carbon account.
7. The method according to claim 6, characterized in that When the update type of the target carbon account is: when the carbon emission reduction amount of the target carbon account is updated based on the user's carbon emission reduction behavior, the update amount of the remaining carbon emission reduction amount of the target carbon account is determined by the trusted execution environment according to the carbon emission reduction behavior, and the update amount of the frozen carbon emission reduction amount of the target carbon account is 0.
8. The method according to claim 6, characterized in that When the update type of the target carbon account is: when the target carbon account update is initiated based on a preset update amount, the update amount of the remaining carbon emission reduction amount of the target carbon account is the preset update amount, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the inverse of the preset update amount; When the update type of the target carbon account is: when the target carbon account is successfully updated based on the preset update amount, the update amount of the remaining carbon emission reduction amount of the target carbon account is 0, and the update amount of the frozen carbon emission reduction amount of the target carbon account is the preset update amount; When the update type of the target carbon account fails to update the target carbon account based on the preset update amount, the update amount of the remaining carbon emission reduction of the target carbon account is the opposite of the preset update amount, and the update amount of the frozen carbon emission reduction of the target carbon account is the preset update amount.
9. The method according to claim 7, characterized in that The controlling the blockchain to update the input carbon account set to the output carbon account set includes: Obtaining an updated amount of remaining carbon emission reductions for each of the input carbon accounts; Generate first zero-knowledge proof information based on the input carbon account set, the output carbon account set, the updated amount of the remaining carbon emission reduction of each input carbon account, and the first random number to the third random number, where the first zero-knowledge proof information is used to verify that: the random carbon account has been updated, the remaining carbon emission reduction and the frozen carbon emission reduction of the random carbon account have not been updated, the remaining carbon emission reduction of the target carbon account has been updated according to the updated amount of the remaining carbon emission reduction of the target carbon account, and that the updated amount of the remaining carbon emission reduction of the target carbon account and the remaining carbon emission reduction of the target carbon account after the update are both within a preset range; Control the blockchain to update the input carbon account set to the output carbon account set when zero-knowledge verification is successful according to the first zero-knowledge proof information.
10. The method according to claim 8, characterized in that The controlling the blockchain to update the input carbon account set to the output carbon account set includes: Obtaining an update identifier of the target carbon account based on a preset update amount; Obtaining an updated amount of the remaining carbon emission reduction amount of each target carbon account and an updated amount of the frozen carbon emission reduction amount of each target carbon account; Generate first zero-knowledge proof information based on the input carbon account set and the output carbon account set, the update identifier, the private key of each target carbon account, the updated amount of the remaining carbon emission reduction of each target carbon account, the signature of each target carbon account, and the first random number to the third random number, where the first zero-knowledge proof information is used to verify that: the random carbon account has been updated, the remaining carbon emission reduction and the frozen carbon emission reduction of the random carbon account have not been updated, the updated amount of the frozen carbon emission reduction of the target carbon account and the updated amount of the remaining carbon emission reduction of the target carbon account are consistent with the update type, and the updated amount of the remaining carbon emission reduction of the target carbon account, the remaining carbon emission reduction after the update of the target carbon account, the frozen carbon emission reduction after the update of the target carbon account, and the updated amount of the frozen carbon emission reduction of the target carbon account are all within a preset range; Control the blockchain to update the input carbon account set to the output carbon account set when zero-knowledge verification is successful according to the first zero-knowledge proof information.
11. The method according to claim 9 or 10, characterized in that The controlling the blockchain to update the input carbon account set to the output carbon account set when the zero-knowledge verification is successfully performed according to the first zero-knowledge proof information includes: An account update interface of the smart account contract on the blockchain is called, where the account update interface is used to perform zero-knowledge verification based on the first zero-knowledge proof information, and when the verification is successful, update the input carbon account set to the output carbon account set.
12. The method according to claim 9 or 10, characterized in that The controlling the blockchain to update the input carbon account set to the output carbon account set when the zero-knowledge verification is successful according to the first zero-knowledge proof information further includes: Adjusting the update execution status according to the update type of the target carbon account; Wherein, when the target carbon account update is initiated based on the preset update amount, the update execution state is adjusted to being executed; When the target carbon account is updated successfully based on the preset update amount, the update execution status is adjusted to execution success; When updating the target carbon account based on the preset update amount fails, the update execution status is adjusted to execution failure.
13. The method according to any one of claims 2 to 10, characterized in that The process of creating any carbon account on the blockchain includes: generating a public key for the carbon account; generating a default commitment based on the public key and a preset default carbon emission reduction amount; The blockchain is controlled to create the carbon account according to the public key and the default commitment, and the first commitment and the second commitment of the carbon account are both the default commitment initially.
14. The method according to claim 13, characterized in that The generating of the public key of the carbon account includes: Generate a public key of the carbon account and a private key corresponding to the public key; The step of controlling the blockchain to create the carbon account according to the public key and the default commitment includes: generating second zero-knowledge proof information according to the public key, the default commitment, the default carbon emission reduction, and the private key; Control the blockchain to create the carbon account according to the public key and the default commitment when the zero-knowledge verification based on the second zero-knowledge proof information is successful, and the second zero-knowledge proof information is used to verify that: when the carbon account is created, the remaining carbon emission reduction and the frozen carbon emission reduction of the carbon account are both the default carbon emission reduction, and the creator has the private key of the carbon account.
15. The method according to claim 14, characterized in that The generating of the public key of the carbon account and the private key corresponding to the public key includes: Generate a private key for the carbon account; The public key of the carbon account is generated by using a fourth random number and the private key of the carbon account.
16. The method according to claim 13, characterized in that Generating a default commitment based on the public key and a preset default carbon emission reduction amount includes: A default commitment is generated using the fifth random number, the public key, and a preset default carbon emission reduction amount.
17. A carbon data processing device, characterized in that: include: An account set determination module is configured to determine an input carbon account set on a blockchain, wherein the at least two input carbon accounts in the input carbon account set include: at least one target carbon account and at least one random carbon account; the target carbon account includes a carbon account whose carbon emission reduction amount is to be updated; the random carbon account includes a carbon account whose carbon emission reduction amount is not to be updated; and the carbon emission reduction amount to be updated includes: remaining carbon emission reduction amount to be updated and / or frozen carbon emission reduction amount to be updated; The account set updating module is used to update each input carbon account in the input carbon account set.
18. An electronic device comprising a memory and at least one processor; in, The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the electronic device implements the method according to any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 16 when executed by a processor.
20. A computer program product, characterized in that The computer program product comprises a computer program for implementing the method according to any one of claims 1 to 16 when the computer program is executed by a processor.
Citation Information
Patent Citations
Carbon account data determination method, carbon management platform and storage medium
CN113469581A
Carbon account data processing method and device, electronic equipment and readable storage medium
CN116933329A