A blockchain-based electric carbon trading method and device
By using blockchain-based smart contracts and zero-knowledge proof technology, the problem of balancing privacy protection and regulatory traceability in the electricity carbon trading system has been solved. This enables anonymous processing of enterprises and effective protection of sensitive assets under real-name supervision, ensuring the legality of transactions and regulatory efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID ZHEJIANG ELECTRIC POWER CO LTD
- Filing Date
- 2026-04-14
- Publication Date
- 2026-07-14
AI Technical Summary
While existing carbon trading systems meet the requirements for real-name supervision, they pose a risk of leakage of trade secrets and lack the ability to efficiently verify the transaction funds, carbon quotas and their proportional relationships in encrypted form, making it difficult to achieve a balance between privacy protection and regulatory traceability.
By employing blockchain-based smart contracts, real-name verification is performed by submitting genuine identity credentials and compliance documents. This process constructs a Pedersen commitment and generates group credentials, randomly generates transaction private and public keys, and utilizes a zero-knowledge proof module for transaction verification and database updates, ensuring the legality of transactions and the effective protection of asset attributes.
This allows for the anonymization of companies participating in electricity carbon trading while meeting real-name regulatory requirements, protecting sensitive asset attributes such as electricity carbon quota balances and cash balances, and ensuring the legality of transactions and the efficiency of regulatory traceability.
Smart Images

Figure CN122023010B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of carbon trading, and more particularly to a method and apparatus for carbon trading based on blockchain. Background Technology
[0002] Carbon allowances, as a tradable emissions asset, are not only important proof for enterprises to fulfill their emission reduction obligations, but also a crucial economic tool reflecting the cost and environmental value of carbon emissions. With the increasing proportion of clean energy and the accelerated adjustment of the energy structure, the "electricity carbon trading" model, which incorporates carbon allowance trading mechanisms into the electricity trading process, has emerged. This model directly embeds carbon emission costs into the electricity trading process, guiding market participants to optimize their energy consumption structure and production methods to achieve energy conservation and emission reduction goals. The electricity carbon trading market typically involves regulatory agencies setting allowance allocation and trading rules, while trading platforms provide matching and settlement services. Enterprises buy and sell allowances based on their own production plans and emission status. In recent years, with the diversification of market participants and the expansion of trading scale, electricity carbon trading is developing towards digitalization, automation, and intelligence to improve trading efficiency, enhance transparency, and support more refined regulatory needs.
[0003] Against this backdrop, the industry has begun exploring the introduction of various digital and information technologies into the carbon trading system to meet the requirements of security, compliance, and efficient operation. For example, in terms of transaction data recording and storage, distributed databases, log tamper-proofing technology, and redundant storage strategies are adopted to improve data reliability and verifiability; in terms of information transmission, encrypted communication protocols and secure authentication mechanisms are used to ensure the confidentiality and integrity of data during transmission; in terms of market operation and supervision, functions such as real-time monitoring, anomaly detection, and automated rule matching are deployed to identify potential risks in real time during transaction execution; and in terms of platform management, audit logs, hierarchical access control, and operation traceability mechanisms are integrated to provide technical support for subsequent dispute resolution and compliance checks. These general technical means have laid the foundation for the digital development of the carbon trading market, enabling the platform to achieve a certain degree of secure and controllable operation and basic risk prevention capabilities.
[0004] Existing carbon trading systems, designed to prevent illegal transactions, generally employ real-name registration. While this facilitates direct verification of trading entities by regulatory agencies, it also makes core business information such as companies' carbon allowance balances and cash balances easily accessible during transaction matching and settlement, posing a risk of trade secret leakage. To avoid information leakage, some solutions introduce complete anonymization, completely hiding transaction details and participant identities on the blockchain. However, this approach makes it impossible for regulators to trace the trading entities and asset sources when facing risks such as money laundering, excessive trading, or fictitious assets, weakening regulatory capabilities. Although some improved solutions incorporate technologies such as on-chain notarization, encrypted signatures, or multi-party secure computation, compliance verification still relies on manual or centralized logic, lacking the ability to efficiently verify transaction funds, carbon allowance quantities, and their proportional relationships in encrypted form, thus leaving vulnerabilities for data tampering and unilateral forgery of matching results. Meanwhile, these schemes lack encrypted binding and consistency verification mechanisms for multiple asset attributes, and have not established a complete process for revealing anonymous identities, verifying the authenticity of registered assets, and conducting suspicious transaction analysis in conjunction with historical data under legal authorization. As a result, regulators often lack timely and reliable technical means when dealing with abnormal transactions. Summary of the Invention
[0005] This invention provides a blockchain-based method and apparatus for trading carbon electricity, which can anonymize participating companies while meeting real-name regulatory requirements, and effectively protect sensitive asset attributes such as carbon electricity quota balances and cash balances.
[0006] This invention provides a blockchain-based method for trading electricity and carbon, applicable to smart contracts deployed on a blockchain. The method includes:
[0007] Submit your real identity and compliance documentation to the regulator so that the regulator can perform a fourth verification on the real identity and compliance documentation, and store the real identity in a third database after the fourth verification is passed;
[0008] Based on the balance of funds and the balance of electricity carbon allowance, Pedersen commitments are constructed respectively, corresponding to a first commitment and a second commitment, which are then submitted to the regulator so that the regulator can perform a fifth verification on the first and second commitments, and generate a group certificate after the fifth verification is passed; wherein, the group certificate contains certificate elements constructed based on the real identity identifier, the first commitment and the second commitment;
[0009] A transaction private key and a corresponding transaction public key are randomly generated. A credential tuple is constructed based on the transaction private key, the transaction public key, and the group credential, and submitted to the smart contract. The smart contract performs a sixth verification on the credential tuple, and after the sixth verification is passed, it updates the state of the first and second databases based on the credential tuple to complete the enterprise's registration on the blockchain. The first database stores the transaction public key of the registered enterprise; the second database stores the capital balance commitment and electricity carbon quota balance commitment of the registered enterprise.
[0010] The first verification is performed based on the first database, using the buyer's first transaction public key and the seller's second transaction public key.
[0011] After the first verification is passed, the system receives the first transaction commitment and the first balance commitment submitted by the buyer, as well as the second transaction commitment and the second balance commitment submitted by the seller; wherein, the first transaction commitment and the first balance commitment are constructed based on the buyer's transaction funds, post-transaction fund balance, and public cryptographic parameters; the second transaction commitment and the second balance commitment are constructed based on the seller's transaction carbon quota, post-transaction carbon quota balance, and the public cryptographic parameters;
[0012] The system receives a first and a second proof tuple submitted by the buyer, and a third proof tuple submitted by the seller; wherein the first proof tuple is used to prove that the transaction funds and the post-transaction fund balance are within a preset value range; the second proof tuple is used to prove that the transaction carbon quota multiplied by the preset unit price equals the transaction funds; and the third proof tuple is used to prove that the transaction carbon quota and the post-transaction carbon quota balance are within a preset value range.
[0013] A second verification is performed on the first proof tuple and the third proof tuple respectively, and a third verification is performed on the second proof tuple. After both the second verification and the third verification pass, the first commitment in the tuple containing the first commitment and the second commitment corresponding to the first transaction public key in the second database is updated to the first balance commitment; the second commitment in the tuple containing the first commitment and the second commitment corresponding to the second transaction public key in the second database is updated to the second balance commitment, so as to complete the enterprise's electricity carbon transaction on the blockchain.
[0014] This invention, through a first database, performs a first verification on the buyer's first transaction public key and the seller's second transaction public key, ensuring that both the buyer and seller participating in the carbon trading are registered enterprises. By receiving the buyer's first transaction commitment and first balance commitment, and the seller's second transaction commitment and second balance commitment, it provides a privacy-protected data foundation for subsequent carbon trading. By receiving the buyer's first and second proof tuples and the seller's third proof tuple and performing second and third verifications, it guarantees the legality of subsequent carbon trading, ensuring that transaction funds, carbon quotas, fund balances, and carbon quota balances are all within valid ranges and that the transaction price is consistent. By updating the value corresponding to the first transaction public key in the second database according to the first balance commitment and updating the value corresponding to the second transaction public key in the second database according to the second balance commitment, it achieves timely updates of the commitment stored in the on-chain database after the carbon trading. Compared to existing technologies that struggle to balance privacy protection and regulatory traceability, this application can anonymize participating enterprises while meeting real-name regulatory requirements and effectively protect sensitive asset attributes such as carbon quota balances and fund balances.
[0015] Further, the first verification based on the first database of the buyer's first transaction public key and the seller's second transaction public key includes:
[0016] The first and second transaction public keys are compared with the transaction public keys stored in the first database. If the first database contains a transaction public key that is the same as the first transaction public key and a transaction public key that is the same as the second transaction public key, then the first verification is successful.
[0017] The embodiments of the present invention perform a first verification on the buyer's first transaction public key and the seller's second transaction public key through a first database, which can ensure that both the buyer and the seller participating in the electricity carbon trading are registered enterprises.
[0018] Further, the step of performing state updates of the first and second databases based on the credential tuple after the sixth verification is passed includes:
[0019] The credential element and transaction public key in the credential tuple are stored as key-value pairs in the first database, and the transaction public key and the tuple containing the first commitment and the second commitment in the credential tuple are stored as key-value pairs in the second database.
[0020] In this embodiment of the invention, the credential tuple performs state updates to the first and second databases, enabling the storage of the identity and asset information of registered enterprises in the on-chain database. This facilitates identity verification and location tracking during subsequent electricity and carbon trading and regulatory traceability.
[0021] Further, the step of receiving the first transaction commitment and first balance commitment submitted by the buyer, and the second transaction commitment and second balance commitment submitted by the seller, after the first verification is passed, includes:
[0022] The buyer constructs a first transaction commitment based on a first blinding factor, transaction funds, and a generator tuple, and constructs a first balance commitment based on a second blinding factor, post-transaction fund balance, and a generator tuple; wherein the generator tuple belongs to the public cryptographic parameters published by the regulator.
[0023] The seller constructs a second transaction commitment based on the third blinding factor, the traded carbon quota, and the generator tuple, and constructs a second balance commitment based on the fourth blinding factor, the post-trade carbon quota balance, and the generator tuple.
[0024] The buyer uses the seller's second transaction public key to encrypt the first blinding factor and transaction funds to obtain a first encrypted tuple, and submits the first transaction commitment, the first balance commitment and the first encrypted tuple to the smart contract.
[0025] The seller uses the buyer's first transaction public key to encrypt the third blinding factor and the transaction carbon quota to obtain a second encrypted tuple, and submits the second transaction commitment, the second balance commitment and the second encrypted tuple to the smart contract.
[0026] The embodiments of the present invention construct transaction commitments and balance commitments through public cryptographic parameters, enabling subsequent electricity carbon trading without exposing the actual transaction amount and balance.
[0027] Further, receiving the first and second proof tuples submitted by the buyer, and the third proof tuple submitted by the seller, includes:
[0028] The buyer constructs a first commitment tuple based on the transaction funds, the post-transaction fund balance, and the generated tuple; and constructs a second commitment tuple based on the first transaction commitment, the second transaction commitment, the preset unit price, and the generated tuple; the seller constructs a third commitment tuple based on the transaction carbon quota, the post-transaction carbon quota balance, and the generated tuple.
[0029] The buyer generates a first challenge tuple and a second challenge tuple based on the first commitment tuple and the second commitment tuple using a hash function, respectively; the seller generates a third challenge tuple based on the third commitment tuple using a hash function.
[0030] The buyer constructs a first proof tuple based on the first commitment tuple and the first challenge tuple, and constructs a second proof tuple based on the second commitment tuple and the second challenge tuple; the seller constructs a third proof tuple based on the third commitment tuple and the third challenge tuple.
[0031] The embodiments of the present invention can provide a data foundation for subsequent second and third verifications by receiving a first and a second proof tuple submitted by the buyer and a third proof tuple submitted by the seller.
[0032] Further, the step of performing a second verification on the first proof tuple and the third proof tuple respectively, and performing a third verification on the second proof tuple, includes:
[0033] Based on the first proof tuple, the second proof tuple, and the third proof tuple, the fourth challenge tuple, the fifth challenge tuple, and the sixth challenge tuple are reconstructed, respectively.
[0034] Substitute the first proof tuple and the fourth challenge tuple into the preset first cryptographic formula set. If the first cryptographic formula set is true, then the second verification of the first proof tuple is passed.
[0035] Substitute the third proof tuple and the sixth challenge tuple into the preset first cryptographic formula set. If the first cryptographic formula set is true, then the second verification of the third proof tuple is passed.
[0036] Substitute the second proof tuple and the fifth challenge tuple into the preset second cryptographic formula set. If the second cryptographic formula set is valid, then the third verification of the second proof tuple is passed.
[0037] The embodiments of the present invention can ensure the legality of subsequent electricity carbon transactions by performing second verification on the first proof tuple and the third proof tuple respectively, and performing third verification on the second proof tuple. This ensures that the transaction funds, transaction electricity carbon quotas, fund balance and electricity carbon quota balance are all within the valid range, and ensures that the transaction unit price is consistent.
[0038] Furthermore, after the completion of the enterprise's electricity-carbon transaction on the blockchain, the regulatory body also conducts regulatory traceability, specifically as follows:
[0039] Based on the public key used in the first abnormal transaction, a query is performed in the first database to obtain the credential element corresponding to the public key. Based on the credential element, a query is performed in the third database to obtain the real identity identifier corresponding to the credential element.
[0040] Receive the transaction private key of the first enterprise corresponding to the real identity identifier, obtain all transaction parameters involving the transaction public key, perform the seventh verification based on the transaction private key and transaction parameters, and reconstruct the fund balance sequence and the electricity carbon quota balance sequence after the seventh verification is passed;
[0041] A transaction behavior graph is constructed based on the fund balance sequence and the carbon quota balance sequence. Anomaly identification is performed based on the transaction behavior graph to identify all second abnormal transactions in which the first enterprise participated. Regulatory tracing is then carried out on all second abnormal transactions involving all second enterprises.
[0042] This invention, through querying the public key used in the first abnormal transaction in the first database and the third database, enables the mapping from the anonymous transaction public key to the legal identity of the enterprise, forming an identity anchor for regulatory traceability. By reconstructing the fund balance sequence and the carbon quota balance sequence, it can provide a verifiable and complete asset history trajectory, achieving efficient and privacy-preserving traceability analysis. By constructing a transaction behavior graph and performing anomaly identification based on the transaction behavior graph, it can transform isolated on-chain anonymous transaction data into a visualized relational network, thereby improving the efficiency of regulatory traceability.
[0043] Another embodiment of the present invention provides a blockchain-based carbon trading device, suitable for smart contracts deployed on a blockchain, the carbon trading device comprising: an enterprise registration module, an identity verification module, a commitment construction module, a zero-knowledge proof module, and a carbon trading module;
[0044] The enterprise registration module is used to submit real identity information and compliance certificates to the regulator, so that the regulator can perform a fourth verification on the real identity information and compliance certificates, and store the real identity information in a third database after the fourth verification is passed;
[0045] Based on the balance of funds and the balance of electricity carbon allowance, Pedersen commitments are constructed respectively, corresponding to a first commitment and a second commitment, which are then submitted to the regulator so that the regulator can perform a fifth verification on the first and second commitments, and generate a group certificate after the fifth verification is passed; wherein, the group certificate contains certificate elements constructed based on the real identity identifier, the first commitment and the second commitment;
[0046] A transaction private key and a corresponding transaction public key are randomly generated. A credential tuple is constructed based on the transaction private key, the transaction public key, and the group credential, and submitted to the smart contract. The smart contract performs a sixth verification on the credential tuple, and after the sixth verification is passed, it updates the state of the first and second databases based on the credential tuple to complete the enterprise's registration on the blockchain. The first database stores the transaction public key of the registered enterprise; the second database stores the capital balance commitment and electricity carbon quota balance commitment of the registered enterprise.
[0047] The identity verification module is used to perform a first verification based on the first database, using the buyer's first transaction public key and the seller's second transaction public key.
[0048] The commitment construction module is configured to receive, after the first verification is passed, a first transaction commitment and a first balance commitment submitted by the buyer, and a second transaction commitment and a second balance commitment submitted by the seller; wherein, the first transaction commitment and the first balance commitment are constructed based on the buyer's transaction funds, post-transaction fund balance, and public cryptographic parameters; the second transaction commitment and the second balance commitment are constructed based on the seller's transaction carbon quota, post-transaction carbon quota balance, and the public cryptographic parameters;
[0049] The zero-knowledge proof module is used to receive a first proof tuple and a second proof tuple submitted by the buyer, and a third proof tuple submitted by the seller; wherein, the first proof tuple is used to prove that the transaction funds and the post-transaction fund balance are within a preset numerical range; the second proof tuple is used to prove that the transaction carbon quota multiplied by the preset unit price equals the transaction funds; and the third proof tuple is used to prove that the transaction carbon quota and the post-transaction carbon quota balance are within a preset numerical range.
[0050] The carbon trading module is used to perform a second verification on the first proof tuple and the third proof tuple respectively, and to perform a third verification on the second proof tuple. After both the second verification and the third verification are passed, the first commitment in the tuple containing the first commitment and the second commitment corresponding to the first transaction public key in the second database is updated to the first balance commitment; the second commitment in the tuple containing the first commitment and the second commitment corresponding to the second transaction public key in the second database is updated to the second balance commitment, so as to complete the carbon trading of enterprises on the blockchain. Attached Figure Description
[0051] Figure 1 A schematic flowchart illustrating one embodiment of the blockchain-based carbon trading method provided by the present invention;
[0052] Figure 2 A schematic diagram illustrating an embodiment of the registration process for enterprises to participate in blockchain-based electricity carbon trading, provided by the present invention.
[0053] Figure 3 This is a schematic diagram illustrating an embodiment of regulatory traceability by regulators after blockchain-based electricity carbon trading, as provided by the present invention.
[0054] Figure 4 A schematic flowchart illustrating another embodiment of the blockchain-based carbon trading method provided by the present invention;
[0055] Figure 5 This is a schematic diagram of one embodiment of the blockchain-based carbon trading device provided by the present invention. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0058] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0059] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0060] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0061] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0062] See Figure 1To address the challenge of balancing privacy protection and regulatory traceability in existing technologies, this invention provides a blockchain-based method for trading electricity and carbon, applicable to smart contracts deployed on a blockchain. The smart contract is an automated program whose code and state are transparent to all participants, and its execution is jointly verified and executed by nodes in a decentralized network through a consensus mechanism. The electricity and carbon trading method includes steps S101 to S104:
[0063] Step S101: Perform a first verification based on the buyer's first transaction public key and the seller's second transaction public key using the first database; wherein, the first database is used to store the transaction public keys of enterprises that have completed registration.
[0064] Preferably, before performing the first verification based on the first database using the buyer's first transaction public key and the seller's second transaction public key, the process further includes enterprise registration, as detailed below. Figure 2 As shown:
[0065] First, submit your real identity and compliance documentation to the regulator so that the regulator can perform a fourth verification on the real identity and compliance documentation. After the fourth verification is successful, the regulator will store the real identity in a third-party database. This fourth verification is a real-name and compliance verification, including verifying the real identity. Authenticity and compliance verification documents The effectiveness of the database, assessment of corporate creditworthiness, and verification of whether the company meets the minimum asset threshold required to participate in transactions; the third database is a controlled database managed by the regulator. .
[0066] Second, Pedersen commitments are constructed based on the cash balance and the carbon emission allowance balance, respectively, resulting in a first commitment and a second commitment, which are then submitted to the regulator. The regulator performs a fifth verification on the first and second commitments, and generates a group certificate upon successful fifth verification. The group certificate contains certificate elements constructed based on the real identity identifier, the first commitment, and the second commitment. It is worth noting that Pedersen commitment is an information-theoretic hiding and computationally bound commitment scheme.
[0067] Before constructing a Pedersen commitment, the regulator needs to publish public cryptographic parameters. In one specific embodiment, the initialization process of the public cryptographic parameters is as follows: First, the order is a large prime number. Elliptic curve group and Select generators and Wherein, the elliptic curve group is an elliptic curve addition cyclic group defined on a finite field, the elements of the group are points on the curve, and the group operation is elliptic curve point addition; if selected As an elliptic group generator, Any group element It can be represented as , For scalars. Define a valid bilinear mapping. Wherein, the bilinear mapping satisfies: for any , as well as ,have ;exist , , making There exist efficient algorithms capable of calculating... ;in, And in and There is no valid group isomorphic mapping between them. Subsequently, the regulator randomly selected the master private key. And calculate the corresponding public key. To support the construction of group credentials, further steps are needed. Four independent and publicly available group elements are randomly selected from the group. In addition, another set of independent generators is selected. Used for the construction of subsequent Pedersen commitments ( The discrete logarithm relative to (Computationally unknowable). Ultimately, regulators released the public cryptographic parameters. and securely store the master private key. .
[0068] In the specific embodiments described above, the enterprise determines its current cash balance locally. With carbon quota balance Then, select a random blinding factor. And construct Pedersen commitments respectively. ;in, For the first commitment, This is the second commitment. Because the Pedersen commitment has information hiding and computational binding properties, and Can be done without exposure and This is used for subsequent verification, provided that the plaintext values are consistent with the blinding factor. and The commitment is submitted to the regulator so that they can verify its validity and audit the asset's compliance—this is the fifth verification step. Once the regulator confirms the asset's compliance, they will group the company's identity and the asset commitment together. The message vector in the text. Specifically, it converts structured data (such as identity identifiers or group elements) into standard byte sequences ( At the same time, a hash function is used. Map the input to This ensures encoding consistency; the hash function is a collision-resistant, one-way, and pseudo-random cryptographic function, commonly used in cryptographic constructs such as generating random numbers, commitments, challenge values, or key derivation. By introducing prefixes to distinguish different semantics, the following is calculated: , , These messages will be used to construct subsequent group credentials, implicitly binding identity and asset information. Subsequently, regulators will use the master private key... Generate group credentials by randomly selecting two secret values. ; Calculate message aggregation items Constructing basic terms ; Calculate voucher elements Generate group credentials And transmit it to the enterprise through a secure channel.
[0069] Third, a transaction private key and a corresponding transaction public key are randomly generated. A credential tuple is constructed based on the transaction private key, transaction public key, and group credentials, and submitted to the smart contract. The smart contract then performs a sixth verification on the credential tuple. Upon successful sixth verification, the smart contract updates the state of the first and second databases based on the credential tuple to complete the enterprise's registration on the blockchain. In the above specific embodiment, the enterprise randomly generates the transaction private key. And calculate the corresponding transaction public key. Obtain the transaction key pair This transaction key pair is used solely for identity verification and signature authentication in on-chain transactions and is not associated with the company's real identity information, thus ensuring transaction anonymity. To complete on-chain registration, the company uses the transaction key pair to perform the following operations: constructing a binding message. Use the transaction private key For bound messages Generate signature Specifically, it means: randomly selecting a one-time value. Calculate commitment Computational Challenge Calculate the response Get a signature Enterprises will use voucher tuples Submitted to the smart contract; the smart contract performs a sixth verification on the credential tuple, including: verification Does it already exist in the first database? In the middle, verify the bilinear pairing equation. Whether it is valid, parsing the signature. And recalculate the challenge Verify signature equation Whether it is valid, thus ensuring that the signature is indeed held by the holder. Entity generation, where After the sixth verification is passed, the credential element and transaction public key in the credential tuple are stored as key-value pairs in the first database, and the transaction public key and the tuple containing the first and second commitments in the credential tuple are stored as key-value pairs in the second database, specifically: ;in, As the first database, This is the second database.
[0070] Preferably, the first verification based on the first database of the buyer's first transaction public key and the seller's second transaction public key includes: comparing the first transaction public key and the second transaction public key with transaction public keys stored in the first database respectively; if the first database contains a transaction public key identical to the first transaction public key and a transaction public key identical to the second transaction public key, then the first verification passes. In the above specific embodiment, the first verification specifically includes: verifying... ;in, As the first transaction public key, This is the second transaction public key.
[0071] Step S102: After the first verification is passed, receive the first transaction commitment and the first balance commitment submitted by the buyer, and the second transaction commitment and the second balance commitment submitted by the seller; wherein, the first transaction commitment and the first balance commitment are constructed based on the buyer's transaction funds, post-transaction fund balance and public cryptographic parameters; the second transaction commitment and the second balance commitment are constructed based on the seller's transaction carbon quota, post-transaction carbon quota balance and the public cryptographic parameters.
[0072] Preferably, the step of receiving the first transaction commitment and first balance commitment submitted by the buyer, and the second transaction commitment and second balance commitment submitted by the seller, after the first verification is passed, includes:
[0073] First, the buyer constructs a first transaction commitment based on a first blinding factor, transaction funds, and a generator tuple, and constructs a first balance commitment based on a second blinding factor, post-transaction fund balance, and a generator tuple; wherein the generator tuple belongs to the publicly available cryptographic parameters published by the regulator. In the above specific embodiment, let the buyer's fund balance commitment in the previous round be... ;in, To generate a tuple, This is the remaining balance of funds from the previous round. This is the blinding factor from the previous round. Let the transaction amount be... The remaining funds after the transaction are The first blinding factor is The second blinding factor is Then the first transaction commitment is The first balance commitment is and satisfy .
[0074] Second, the seller constructs a second transaction commitment based on the third blinding factor, the traded carbon allowance, and the generator tuple, and constructs a second balance commitment based on the fourth blinding factor, the post-transaction carbon allowance balance, and the generator tuple. In the above specific embodiment, let the seller's carbon allowance balance commitment in the previous round be... ;in, This represents the remaining carbon emission allowance from the previous round. This is the blinding factor from the previous round. Let the carbon allowance for this transaction be... After the transaction, the remaining carbon quota for electricity is The third blinding factor is The fourth blinding factor is The second transaction commitment is The second balance commitment is and satisfy .
[0075] Third, the buyer uses the second transaction public key to encrypt the first blinding factor and transaction funds to obtain a first encrypted tuple, and submits the first transaction commitment, the first balance commitment, and the first encrypted tuple to the smart contract. In the above specific embodiment, the buyer will Submit on-chain, using the seller's second transaction public key. encryption The first encrypted tuple is obtained and submitted to the blockchain to ensure that the seller can decrypt and verify it.
[0076] Fourth, the seller uses the first transaction public key to encrypt the third blinding factor and the transaction carbon quota to obtain a second encrypted tuple, and submits the second transaction commitment, the second balance commitment, and the second encrypted tuple to the smart contract. In the above specific embodiment, the seller will Submit on-chain, using the buyer's first transaction public key. encryption The second encrypted tuple is obtained and submitted to the blockchain to ensure that the buyer can decrypt and verify it.
[0077] Step S103: Receive the first and second proof tuples submitted by the buyer, and the third proof tuple submitted by the seller; wherein, the first proof tuple is used to prove that the transaction funds and the post-transaction fund balance are within a preset value range; the second proof tuple is used to prove that the transaction carbon quota multiplied by the preset unit price equals the transaction funds; the third proof tuple is used to prove that the transaction carbon quota and the post-transaction carbon quota balance are within a preset value range.
[0078] Preferably, to ensure the legality of the transaction, the buyer and seller need to complete a zero-knowledge proof process on-chain to ensure that the transaction funds, post-transaction fund balance, transaction carbon credits, and post-transaction carbon credit balance are all within a preset value range. Simultaneously, to ensure that the transaction carbon credits multiplied by the preset unit price equal the transaction funds, the buyer also needs to complete an additional zero-knowledge proof process on-chain for price consistency. The zero-knowledge proof can be implemented using the Bulletproofs protocol, requiring the buyer and seller to submit their respective proof tuples. The receiving of the first and second proof tuples submitted by the buyer, and the third proof tuple submitted by the seller, includes: the buyer's generation of a tuple based on the transaction funds, post-transaction fund balance, and... A first commitment tuple is constructed. A second commitment tuple is constructed based on the first transaction commitment, the second transaction commitment, the preset unit price, and the generator tuple. The seller constructs a third commitment tuple based on the traded carbon quota, the remaining carbon quota after the transaction, and the generator tuple. The buyer generates a first challenge tuple and a second challenge tuple using a hash function based on the first and second commitment tuples, respectively. The seller generates a third challenge tuple using a hash function based on the third commitment tuple. The buyer constructs a first proof tuple based on the first commitment tuple and the first challenge tuple, and constructs a second proof tuple based on the second commitment tuple and the second challenge tuple. The seller constructs a third proof tuple based on the third commitment tuple and the third challenge tuple.
[0079] In the above specific embodiments, the zero-knowledge proof of the numerical range needs to prove... , , and The values are all in Within the range, This is a preset safety bit width used to define the valid range of values and prevent overflow or outliers. (Promise is set.) ,in, This is a value to be proven (for the buyer, It can be or For sellers, It can be or ), It is a blinding factor, and the goal is to prove... Enterprises and smart contracts share common parameters. The company has secret input The company will Decomposed into dimensional bit vector , making and order Random selection ,calculate Randomly select vectors and ,calculate ;Will Record to communication log For buyers, this can be based on... Generate a set , can be based on Generate another set Two groups This can form the first commitment tuple; for the seller, it can be based on... Generate a set , can be based on Generate another set Two groups This can form a third commitment tuple. Enterprises generate challenges based on these commitment tuples. , and update Generate auxiliary values based on challenges Define a vector polynomial: , ,make Random selection ,calculate , and update .based on and Generate Challenge and update For buyers, this can be based on... Generate a set , can be based on Generate another set Two groups This can constitute the first challenge tuple; for sellers, it can be based on Generate a set , can be based on Generate another set Two groups This can form a third challenge tuple. The enterprise calculates based on the commitment tuple and the challenge tuple. , , , , The final output is the proof tuple. For buyers, this can be based on... Generate a set , can be based on Generate another set Two groups This can form the first proof tuple; for the seller, it can be based on Generate a set , can be based on Generate another set Two groups This can form a third proof tuple.
[0080] In the specific embodiments described above, the price consistency zero-knowledge proof needs to prove... ,in The unit price is preset. This proof has been verified. Only This is accomplished using components. The difference commitment is defined as... The proposition to be proved is ,exist Under the premise of independence, if and only if hour, Only Quantity. Because the buyer can decrypt and obtain... Therefore, it can generate proofs independently. The common input is... Transaction context (such as contract address and transaction ID), domain separation tag (e.g., "PRICE_CONSISTENCY_V1"). Buyer calculations. Random selection Calculate commitment That is, the second commitment tuple; computational challenge That is, the second challenge tuple; calculate the response. Output proof That is, the second proof tuple.
[0081] Step S104: Perform a second verification on the first proof tuple and the third proof tuple respectively, and perform a third verification on the second proof tuple. After both the second and third verifications pass, update the value corresponding to the first transaction public key in the second database according to the first balance commitment, and update the value corresponding to the second transaction public key in the second database according to the second balance commitment, so as to complete the enterprise's electricity carbon transaction on the blockchain; wherein, the second database is used to store the capital balance commitment and electricity carbon quota balance commitment of the registered enterprise.
[0082] Preferably, the step of performing a second verification on the first proof tuple and the third proof tuple respectively, and performing a third verification on the second proof tuple, includes:
[0083] First, based on the first, second, and third proof tuples, a reconstruction is performed to obtain the fourth, fifth, and sixth challenge tuples, respectively. In the above specific embodiment, for zero-knowledge proofs of numerical ranges, the smart contract replays the communication records. Reconstruction Challenges For buyers, this can be based on... Reconstruct a set , can be based on Reconstruct another set Two groups This can form the fourth challenge tuple; for sellers, it can be based on Reconstruct a set , can be based on Reconstruct another set Two groups This can form the sixth challenge tuple. For zero-knowledge proofs of price consistency, the smart contract recalculates. And recalculate the challenge This refers to the fifth challenge tuple.
[0084] Second, the first proof tuple and the fourth challenge tuple are substituted into a preset first cryptographic formula set. If the first cryptographic formula set holds, then the second verification of the first proof tuple passes. In the above specific embodiment, for zero-knowledge proofs within a numerical range, the smart contract calculates and adjusts the generated meta-vector based on the first proof tuple and the fourth challenge tuple. and verify ;Calculate based on the first proof tuple and the fourth challenge tuple and verify If all of them are true, that is, the first set of cryptographic formulas is true, then the second verification of the first proof tuple is successful.
[0085] Third, the third proof tuple and the sixth challenge tuple are substituted into a preset first cryptographic formula set. If the first cryptographic formula set holds, then the second verification of the third proof tuple passes. In the above specific embodiment, for zero-knowledge proofs within a numerical range, the smart contract calculates and adjusts the generated meta-vector based on the third proof tuple and the sixth challenge tuple. and verify ;Calculate based on the third proof tuple and the sixth challenge tuple and verify If all of them are true, that is, the first set of cryptographic formulas is true, then the second verification of the third proof tuple is successful.
[0086] Fourth, substitute the second proof tuple and the fifth challenge tuple into a preset second cryptographic formula set. If the second cryptographic formula set holds, then the third verification of the second proof tuple passes. In the above specific embodiment, for the price consistency zero-knowledge proof, the smart contract verifies based on the second proof tuple and the fifth challenge tuple. If true, that is, if the second cryptographic formula set is true, then the second verification of the third proof tuple is successful.
[0087] Preferably, the step of updating the value corresponding to the first transaction public key in the second database according to the first balance commitment, and updating the value corresponding to the second transaction public key in the second database according to the second balance commitment, to complete the enterprise's electricity-carbon transaction on the blockchain, includes:
[0088] First, update the first commitment in the tuple containing the first commitment and the second commitment corresponding to the first transaction public key in the second database to the first balance commitment. In the above specific embodiment, corresponding In Updated to .
[0089] Second, update the second commitment in the tuple containing the first and second commitments corresponding to the second transaction public key in the second database to the second balance commitment. In the above specific embodiment, corresponding In Updated to .
[0090] Preferably, after the enterprise completes its electricity-carbon transaction on the blockchain, the process also includes regulatory traceability by the regulator, as detailed in the following steps: Figure 3 As shown:
[0091] First, the system queries the first database based on the public key used in the first abnormal transaction to obtain the credential element corresponding to the public key. Then, it queries the third database based on the credential element to obtain the real identity identifier corresponding to the credential element. In the above specific embodiment, when the regulator discovers that the first abnormal transaction used a public key... At that time, first query the first database. Obtain the credential element corresponding to the public key of the transaction. Subsequently, regulators used a third-party database. Search Extract the company's real identity identifier from the corresponding registration information. .
[0092] Second, the system receives the transaction private key of the first enterprise corresponding to the real identity identifier, obtains all transaction parameters involving the transaction public key, performs a seventh verification based on the transaction private key and transaction parameters, and reconstructs the fund balance sequence and the electricity carbon quota balance sequence after the seventh verification passes. In the above specific embodiment, when the regulator... When the first company initiates an investigation, it can be requested to provide transaction information and transaction private keys. To reconstruct its complete asset change sequence, specifically: regulators retrieve all relevant information from the blockchain. The transactions constitute the target set. Sort by time ,in The regulators issued compliance requirements to the companies, and the companies submitted their compliance information for each transaction in accordance with the law. Transaction parameters involved: If the company is the buyer, then submit... If the company is the seller, then submit... Among them, the balance of carbon emission allowance at the time of initial registration of the enterprise Balance of funds and corresponding blinding factor The transaction has already been registered with the regulator; the regulator verifies the correctness of the transaction parameters submitted by the company for each transaction: if the company is the buyer, then verification is performed. If the company is the seller, then verification is required. Simultaneously verify the balance update relationship If any verification fails, the transaction is marked as suspicious and requires further investigation; for information not directly provided by the company but transmitted in encryption by the counterparty, the regulator uses... Decryption: If the company is the buyer, then use Decrypt the seller's encrypted content to obtain If the company is the seller, then use Decrypt the buyer's encrypted content to obtain This step is used to cross-validate the authenticity of the information submitted by the enterprise; if both the transaction parameter correctness verification and cross-validation pass, the seventh verification is passed; based on the verified transaction parameters, initialization is performed. Process each transaction in chronological order. If the company is the buyer, then it is , And update the current status; if the business is the seller, then it will be... , And update the current status; after processing each transaction, the reconstruction of the carbon quota balance sequence and the cash balance sequence is completed.
[0093] Third, a transaction behavior graph is constructed based on the aforementioned fund balance sequence and electricity carbon quota balance sequence. Anomaly identification is then performed based on this graph to identify all second-abnormal transactions involving the first enterprise, and regulatory tracing is conducted on all second-abnormal enterprises involved in these transactions. In the above specific embodiment, a directed graph is constructed. , where the node set Contains the public keys of all counterparties who have transacted with the first enterprise. And the first company's own transaction public key; edge set Each edge Represents a node Towards Transferred Unit carbon quota and Unit funds, occurring in time Based on directed graphs The following suspicious behavior indicators can be calculated: High-frequency trading index, let... The historical transaction set of the surveyed companies For the current analysis time, For a sliding time window (e.g., 24 hours), define the number of transactions within the window as... High-frequency trading index is the frequency of transactions per unit of time, i.e. ,like If a preset threshold is reached, abnormal high-frequency trading behavior is determined; closed-loop fund flow detection checks for the existence of a closed-loop fund path. ,in Use the public key for transactions to calculate the starting account. Total capital outflow and inflow If satisfied If so, it is determined that there is a suspicious closed-loop fund flow, in which The threshold for fund deviation, Minimum outflow threshold; associated risk score, set as follows: Given a known set of high-risk accounts (such as accounts with historical violations or blacklisted accounts), define the association risk score between the investigated enterprise and these high-risk accounts as follows: ,in To high-risk accounts The volume of a single or cumulative transaction. As a weighting factor, it can be set based on account risk level or trading frequency, etc. (e.g.) ),like If a transaction is found to exhibit abnormally high-frequency trading behavior, suspicious closed-loop fund flows, or high correlation risk, it is identified as a second abnormal transaction, and the directed graph is then analyzed. Accounts associated with the second abnormal transaction Initiating regulatory tracing involves repeatedly re-executing the transaction private key acquisition and the aforementioned analysis process to achieve comprehensive oversight of collusive behavior. It is worth noting that all tracing operations are recorded in a separate, immutable audit log. The audit log includes the operation time, the identity of the personnel performing the operation, the legal basis number, and the scope of data accessed. Support regular reviews by higher-level regulatory agencies to ensure that regulatory actions are transparent, supervised, and accountable, and to prevent abuse of power.
[0094] Optionally, in this embodiment of the invention, performing the first verification based on the first database on the buyer's first transaction public key and the seller's second transaction public key includes:
[0095] The first and second transaction public keys are compared with the transaction public keys stored in the first database. If the first database contains a transaction public key that is the same as the first transaction public key and a transaction public key that is the same as the second transaction public key, then the first verification is successful.
[0096] The embodiments of the present invention perform a first verification on the buyer's first transaction public key and the seller's second transaction public key through a first database, which can ensure that both the buyer and the seller participating in the electricity carbon trading are registered enterprises.
[0097] Optionally, in this embodiment of the invention, before performing the first verification on the buyer's first transaction public key and the seller's second transaction public key based on the first database, the process further includes enterprise registration, specifically:
[0098] Submit your real identity and compliance documentation to the regulator so that the regulator can perform a fourth verification on the real identity and compliance documentation, and store the real identity in a third database after the fourth verification is passed;
[0099] Based on the balance of funds and the balance of electricity carbon allowance, Pedersen commitments are constructed respectively, corresponding to a first commitment and a second commitment, which are then submitted to the regulator so that the regulator can perform a fifth verification on the first and second commitments, and generate a group certificate after the fifth verification is passed; wherein, the group certificate contains certificate elements constructed based on the real identity identifier, the first commitment and the second commitment;
[0100] A transaction private key and a corresponding transaction public key are randomly generated. A credential tuple is constructed based on the transaction private key, the transaction public key, and the group credential and submitted to the smart contract. The smart contract performs a sixth verification on the credential tuple. After the sixth verification is passed, the smart contract performs a state update of the first and second databases based on the credential tuple to complete the enterprise's registration on the blockchain.
[0101] This invention's embodiments utilize a fourth verification process performed by regulators on the real identity identifier and compliance documentation to assess the authenticity and creditworthiness of registered enterprises. Storing the real identity identifier in a third database facilitates subsequent regulatory tracing of the enterprise's true identity. Constructing Pedersen commitments for the balance of electricity carbon allowances and funds respectively enables subsequent electricity carbon trading without revealing the actual balances. A fifth verification process by regulators on the first and second commitments verifies the correctness of the trading commitments provided by the registered enterprise. The generation of group credentials by regulators implicitly binds enterprise identity and asset information. Generating credential tuples from transaction keys and group credentials ensures that each transaction key corresponds to a legally registered enterprise identity. Updating the state of the first and second databases through credential tuples stores the identity and asset information of the registered enterprise in an on-chain database, facilitating identity verification and tracing during subsequent electricity carbon trading and regulatory tracing.
[0102] Optionally, in this embodiment of the invention, the step of performing a state update of the first and second databases based on the credential tuple after the sixth verification is passed includes:
[0103] The credential element and transaction public key in the credential tuple are stored as key-value pairs in the first database, and the transaction public key and the tuple containing the first commitment and the second commitment in the credential tuple are stored as key-value pairs in the second database.
[0104] In this embodiment of the invention, the credential tuple performs state updates to the first and second databases, enabling the storage of the identity and asset information of registered enterprises in the on-chain database. This facilitates identity verification and location tracking during subsequent electricity and carbon trading and regulatory traceability.
[0105] Optionally, in this embodiment of the invention, the step of receiving the first transaction commitment and the first balance commitment submitted by the buyer, and the second transaction commitment and the second balance commitment submitted by the seller, after the first verification is passed, includes:
[0106] The buyer constructs a first transaction commitment based on a first blinding factor, transaction funds, and a generator tuple, and constructs a first balance commitment based on a second blinding factor, post-transaction fund balance, and a generator tuple; wherein the generator tuple belongs to the public cryptographic parameters published by the regulator.
[0107] The seller constructs a second transaction commitment based on the third blinding factor, the traded carbon quota, and the generator tuple, and constructs a second balance commitment based on the fourth blinding factor, the post-trade carbon quota balance, and the generator tuple.
[0108] The buyer uses the second transaction public key to encrypt the first blinding factor and transaction funds to obtain the first encrypted tuple, and submits the first transaction commitment, the first balance commitment and the first encrypted tuple to the smart contract.
[0109] The seller uses the first transaction public key to encrypt the third blinding factor and the transaction carbon quota to obtain a second encrypted tuple, and submits the second transaction commitment, the second balance commitment and the second encrypted tuple to the smart contract.
[0110] The embodiments of the present invention construct transaction commitments and balance commitments through public cryptographic parameters, enabling subsequent electricity carbon trading without exposing the actual transaction amount and balance.
[0111] Optionally, in this embodiment of the invention, receiving the first and second proof tuples submitted by the buyer, and the third proof tuple submitted by the seller, includes:
[0112] The buyer constructs a first commitment tuple based on the transaction funds, the post-transaction fund balance, and the generated tuple; and constructs a second commitment tuple based on the first transaction commitment, the second transaction commitment, the preset unit price, and the generated tuple; the seller constructs a third commitment tuple based on the transaction carbon quota, the post-transaction carbon quota balance, and the generated tuple.
[0113] The buyer generates a first challenge tuple and a second challenge tuple based on the first commitment tuple and the second commitment tuple using a hash function, respectively; the seller generates a third challenge tuple based on the third commitment tuple using a hash function.
[0114] The buyer constructs a first proof tuple based on the first commitment tuple and the first challenge tuple, and constructs a second proof tuple based on the second commitment tuple and the second challenge tuple; the seller constructs a third proof tuple based on the third commitment tuple and the third challenge tuple.
[0115] The embodiments of the present invention can provide a data foundation for subsequent second and third verifications by receiving a first and a second proof tuple submitted by the buyer and a third proof tuple submitted by the seller.
[0116] Optionally, in this embodiment of the invention, performing a second verification on the first proof tuple and the third proof tuple respectively, and performing a third verification on the second proof tuple, includes:
[0117] Based on the first proof tuple, the second proof tuple, and the third proof tuple, the fourth challenge tuple, the fifth challenge tuple, and the sixth challenge tuple are reconstructed, respectively.
[0118] Substitute the first proof tuple and the fourth challenge tuple into the preset first cryptographic formula set. If the first cryptographic formula set is true, then the second verification of the first proof tuple is passed.
[0119] Substitute the third proof tuple and the sixth challenge tuple into the preset first cryptographic formula set. If the first cryptographic formula set is true, then the second verification of the third proof tuple is passed.
[0120] Substitute the second proof tuple and the fifth challenge tuple into the preset second cryptographic formula set. If the second cryptographic formula set is valid, then the third verification of the second proof tuple is passed.
[0121] The embodiments of the present invention can ensure the legality of subsequent electricity carbon transactions by performing second verification on the first proof tuple and the third proof tuple respectively, and performing third verification on the second proof tuple. This ensures that the transaction funds, transaction electricity carbon quotas, fund balance and electricity carbon quota balance are all within the valid range, and ensures that the transaction unit price is consistent.
[0122] Optionally, in this embodiment of the invention, the step of updating the value corresponding to the first transaction public key in the second database according to the first balance commitment, and updating the value corresponding to the second transaction public key in the second database according to the second balance commitment, to complete the enterprise's electricity-carbon transaction on the blockchain, includes:
[0123] Update the first commitment in the tuple containing the first commitment and the second commitment corresponding to the first transaction public key in the second database to the first balance commitment;
[0124] Update the second commitment in the tuple containing the first commitment and the second commitment corresponding to the second transaction public key in the second database to the second balance commitment.
[0125] This invention enables timely updates of on-chain database storage commitments after a carbon transaction by updating the value corresponding to the first transaction public key in the second database according to the first balance commitment and updating the value corresponding to the second transaction public key in the second database according to the second balance commitment.
[0126] Optionally, in this embodiment of the invention, after the completion of the enterprise's electricity-carbon transaction on the blockchain, the process further includes regulatory traceability by the regulator, specifically:
[0127] Based on the public key used in the first abnormal transaction, a query is performed in the first database to obtain the credential element corresponding to the public key. Based on the credential element, a query is performed in the third database to obtain the real identity identifier corresponding to the credential element.
[0128] Receive the transaction private key of the first enterprise corresponding to the real identity identifier, obtain all transaction parameters involving the transaction public key, perform the seventh verification based on the transaction private key and transaction parameters, and reconstruct the fund balance sequence and the electricity carbon quota balance sequence after the seventh verification is passed;
[0129] A transaction behavior graph is constructed based on the fund balance sequence and the carbon quota balance sequence. Anomaly identification is performed based on the transaction behavior graph to identify all second abnormal transactions in which the first enterprise participated. Regulatory tracing is then carried out on all second abnormal transactions involving all second enterprises.
[0130] This invention, through querying the public key used in the first abnormal transaction in the first database and the third database, enables the mapping from the anonymous transaction public key to the legal identity of the enterprise, forming an identity anchor for regulatory traceability. By reconstructing the fund balance sequence and the carbon quota balance sequence, it can provide a verifiable and complete asset history trajectory, achieving efficient and privacy-preserving traceability analysis. By constructing a transaction behavior graph and performing anomaly identification based on the transaction behavior graph, it can transform isolated on-chain anonymous transaction data into a visualized relational network, thereby improving the efficiency of regulatory traceability.
[0131] This invention, through a first database, performs a first verification on the buyer's first transaction public key and the seller's second transaction public key, ensuring that both the buyer and seller participating in the carbon trading are registered enterprises. By receiving the buyer's first transaction commitment and first balance commitment, and the seller's second transaction commitment and second balance commitment, a privacy-protected data foundation is provided for subsequent carbon trading. By receiving the buyer's first and second proof tuples and the seller's third proof tuple and performing second and third verifications, the legality of subsequent carbon trading is guaranteed, ensuring that the transaction funds, carbon trading quotas, fund balance, and carbon quota balance are all within valid ranges, and ensuring consistent transaction prices. By updating the value corresponding to the first transaction public key in the second database according to the first balance commitment, and updating the value corresponding to the second transaction public key in the second database according to the second balance commitment, timely updates of the commitment stored in the on-chain database after the carbon trading are achieved.
[0132] like Figure 4 As shown, based on the above-described method embodiments, another embodiment of a blockchain-based carbon trading method is provided, including:
[0133] Step 1: The buyer and seller submit their respective transaction public keys to the blockchain so that the blockchain can verify whether the buyer's and seller's respective transaction public keys are in the permissioned database; it is worth noting that performing Step 1 is equivalent to performing Step S101.
[0134] Step two: The buyer submits a funding commitment and encrypted transaction funds to the blockchain, and the seller submits an electricity carbon quota commitment and encrypted transaction electricity carbon quota to the blockchain; it is worth noting that performing step two is equivalent to performing step S102.
[0135] Step 3: The buyer and seller each submit their own zero-knowledge proofs to enable the blockchain to verify the scope and proportion of the commitment; it is worth noting that performing step 3 is equivalent to performing step S103.
[0136] Step four involves the blockchain verifying the zero-knowledge proof and updating the balance commitments of both parties; it is worth noting that performing step four is equivalent to performing step S104.
[0137] This invention, through the submission of transaction public keys by both buyers and sellers to the blockchain for access checks, ensures that all buyers and sellers participating in carbon trading are registered enterprises. By having buyers submit financial commitments and encrypted transaction funds to the blockchain, and sellers submit carbon quota commitments and encrypted carbon quotas, a privacy-protected data foundation is provided for subsequent carbon trading. The submission of zero-knowledge proofs by both buyers and sellers guarantees the legality of subsequent carbon trading, ensuring that transaction funds, carbon quotas, fund balances, and carbon quota balances are all within valid ranges and that the transaction price is consistent. Updating the balance commitments of both parties through the blockchain enables timely updates of the commitments stored in the on-chain database after the carbon trading transaction.
[0138] like Figure 5 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided;
[0139] An embodiment of the present invention provides a blockchain-based carbon trading device, which is suitable for smart contracts deployed on a blockchain. The carbon trading device includes: an identity verification module 501, a commitment construction module 502, a zero-knowledge proof module 503, and a carbon trading module 504.
[0140] The identity verification module 501 is used to perform a first verification based on the buyer's first transaction public key and the seller's second transaction public key in a first database; wherein, the first database is used to store the transaction public keys of enterprises that have completed registration;
[0141] The commitment construction module 502 is used to receive, after the first verification is passed, a first transaction commitment and a first balance commitment submitted by the buyer, and a second transaction commitment and a second balance commitment submitted by the seller; wherein, the first transaction commitment and the first balance commitment are constructed based on the buyer's transaction funds, post-transaction fund balance, and public cryptographic parameters; the second transaction commitment and the second balance commitment are constructed based on the seller's transaction carbon quota, post-transaction carbon quota balance, and the public cryptographic parameters;
[0142] The zero-knowledge proof module 503 is used to receive a first proof tuple and a second proof tuple submitted by the buyer, and a third proof tuple submitted by the seller; wherein, the first proof tuple is used to prove that the transaction funds and the post-transaction fund balance are within a preset numerical range; the second proof tuple is used to prove that the transaction carbon quota multiplied by the preset unit price equals the transaction funds; and the third proof tuple is used to prove that the transaction carbon quota and the post-transaction carbon quota balance are within a preset numerical range.
[0143] The carbon trading module 504 is used to perform a second verification on the first proof tuple and the third proof tuple respectively, and to perform a third verification on the second proof tuple. After both the second and third verifications are passed, the module updates the value corresponding to the first transaction public key in the second database according to the first balance commitment, and updates the value corresponding to the second transaction public key in the second database according to the second balance commitment, so as to complete the carbon trading of enterprises on the blockchain. The second database is used to store the capital balance commitment and carbon quota balance commitment of enterprises that have completed registration.
[0144] Optionally, in this embodiment of the invention, the authentication module 501 includes: an authentication submodule;
[0145] The identity verification submodule is used to compare the first transaction public key and the second transaction public key with the transaction public keys stored in the first database. If there is a transaction public key in the first database that is the same as the first transaction public key and also has a transaction public key that is the same as the second transaction public key, then the first verification is successful.
[0146] The embodiments of the present invention perform a first verification on the buyer's first transaction public key and the seller's second transaction public key through a first database, which can ensure that both the buyer and the seller participating in the electricity carbon trading are registered enterprises.
[0147] Optionally, in this embodiment of the invention, the following submodules are included before the identity verification module 501: a compliance verification submodule, an initial commitment submodule, and an enterprise registration submodule;
[0148] The compliance verification submodule is used to submit the real identity identifier and compliance proof documents to the regulator, so that the regulator can perform a fourth verification on the real identity identifier and compliance proof documents, and store the real identity identifier in a third database after the fourth verification is passed;
[0149] The initial commitment submodule is used to construct Pedersen commitments based on the cash balance and the carbon emission allowance balance, respectively, to obtain a first commitment and a second commitment, which are then submitted to the regulator. This allows the regulator to perform a fifth verification on the first and second commitments, and generate a group certificate after the fifth verification is passed. The group certificate contains certificate elements constructed based on the real identity identifier, the first commitment, and the second commitment.
[0150] The enterprise registration submodule is used to randomly generate a transaction private key and a transaction public key corresponding to the transaction private key, construct a credential tuple based on the transaction private key, the transaction public key and the group credential, and submit it to the smart contract, so that the smart contract performs a sixth verification on the credential tuple, and after the sixth verification is passed, performs a state update of the first database and the second database based on the credential tuple to complete the enterprise registration on the blockchain.
[0151] This invention's embodiments utilize a fourth verification process performed by regulators on the real identity identifier and compliance documentation to assess the authenticity and creditworthiness of registered enterprises. Storing the real identity identifier in a third database facilitates subsequent regulatory tracing of the enterprise's true identity. Constructing Pedersen commitments for the balance of electricity carbon allowances and funds respectively enables subsequent electricity carbon trading without revealing the actual balances. A fifth verification process by regulators on the first and second commitments verifies the correctness of the trading commitments provided by the registered enterprise. The generation of group credentials by regulators implicitly binds enterprise identity and asset information. Generating credential tuples from transaction keys and group credentials ensures that each transaction key corresponds to a legally registered enterprise identity. Updating the state of the first and second databases through credential tuples stores the identity and asset information of the registered enterprise in an on-chain database, facilitating identity verification and tracing during subsequent electricity carbon trading and regulatory tracing.
[0152] Optionally, in this embodiment of the invention, the enterprise registration submodule includes: an enterprise registration unit;
[0153] The enterprise registration unit is used to store the credential element and transaction public key in the credential tuple as key-value pairs in the first database, and to store the transaction public key and the tuple containing the first commitment and the second commitment in the credential tuple as key-value pairs in the second database.
[0154] In this embodiment of the invention, the credential tuple performs state updates to the first and second databases, enabling the storage of the identity and asset information of registered enterprises in the on-chain database. This facilitates identity verification and location tracking during subsequent electricity and carbon trading and regulatory traceability.
[0155] Optionally, in this embodiment of the invention, the commitment construction module 502 includes: a first commitment construction submodule, a second commitment construction submodule, a first encryption submodule, and a second encryption submodule;
[0156] The first commitment construction submodule is used by the buyer to construct a first transaction commitment based on a first blinding factor, transaction funds, and generator tuples, and to construct a first balance commitment based on a second blinding factor, post-transaction fund balance, and generator tuples; wherein the generator tuples belong to the public cryptographic parameters published by the regulator;
[0157] The second commitment construction submodule is used by the seller to construct a second transaction commitment based on the third blinding factor, the transaction carbon quota and the generator tuple, and to construct a second balance commitment based on the fourth blinding factor, the post-transaction carbon quota balance and the generator tuple.
[0158] The first encryption submodule is used by the buyer to encrypt the first blinding factor and transaction funds using the second transaction public key to obtain a first encrypted tuple, and submit the first transaction commitment, the first balance commitment and the first encrypted tuple to the smart contract;
[0159] The second encryption submodule is used by the seller to encrypt the third blinding factor and the transaction carbon quota using the first transaction public key to obtain a second encrypted tuple, and submit the second transaction commitment, the second balance commitment and the second encrypted tuple to the smart contract.
[0160] The embodiments of the present invention construct transaction commitments and balance commitments through public cryptographic parameters, enabling subsequent electricity carbon trading without exposing the actual transaction amount and balance.
[0161] Optionally, in this embodiment of the invention, the zero-knowledge proof module 503 includes: a commitment tuple submodule, a challenge tuple submodule, and a proof tuple submodule;
[0162] The commitment tuple submodule is used for the buyer to construct a first commitment tuple based on the transaction funds, the post-transaction fund balance, and the generated tuple, and to construct a second commitment tuple based on the first transaction commitment, the second transaction commitment, the preset unit price, and the generated tuple; and for the seller to construct a third commitment tuple based on the transaction carbon quota, the post-transaction carbon quota balance, and the generated tuple.
[0163] The challenge tuple submodule is used for the buyer to generate a first challenge tuple and a second challenge tuple based on the first commitment tuple and the second commitment tuple using a hash function, and for the seller to generate a third challenge tuple based on the third commitment tuple using a hash function.
[0164] The proof tuple submodule is used for the buyer to construct a first proof tuple based on the first commitment tuple and the first challenge tuple, and to construct a second proof tuple based on the second commitment tuple and the second challenge tuple; and for the seller to construct a third proof tuple based on the third commitment tuple and the third challenge tuple.
[0165] The embodiments of the present invention can provide a data foundation for subsequent second and third verifications by receiving a first and a second proof tuple submitted by the buyer and a third proof tuple submitted by the seller.
[0166] Optionally, in this embodiment of the invention, the carbon trading module 504 includes: a reconfiguration challenge submodule, a first verification submodule, a second verification submodule, and a third verification submodule;
[0167] The reconstruction challenge submodule is used to reconstruct based on the first proof tuple, the second proof tuple, and the third proof tuple, to obtain the fourth challenge tuple, the fifth challenge tuple, and the sixth challenge tuple, respectively.
[0168] The first verification submodule is used to substitute the first proof tuple and the fourth challenge tuple into a preset first cryptographic formula set. If the first cryptographic formula set is valid, then the second verification of the first proof tuple is passed.
[0169] The second verification submodule is used to substitute the third proof tuple and the sixth challenge tuple into a preset first cryptographic formula set. If the first cryptographic formula set is valid, then the second verification of the third proof tuple is passed.
[0170] The third verification submodule is used to substitute the second proof tuple and the fifth challenge tuple into a preset second cryptographic formula set. If the second cryptographic formula set is valid, then the third verification of the second proof tuple is passed.
[0171] The embodiments of the present invention can ensure the legality of subsequent electricity carbon transactions by performing second verification on the first proof tuple and the third proof tuple respectively, and performing third verification on the second proof tuple. This ensures that the transaction funds, transaction electricity carbon quotas, fund balance and electricity carbon quota balance are all within the valid range, and ensures that the transaction unit price is consistent.
[0172] Optionally, in this embodiment of the invention, the carbon trading module 504 further includes: a first commitment update submodule and a second commitment update submodule;
[0173] The first commitment update submodule is used to update the first commitment in the tuple containing the first commitment and the second commitment corresponding to the first transaction public key in the second database to the first balance commitment;
[0174] The second commitment update submodule is used to update the second commitment in the tuple containing the first commitment and the second commitment corresponding to the second transaction public key in the second database to the second balance commitment.
[0175] This invention enables timely updates of on-chain database storage commitments after a carbon transaction by updating the value corresponding to the first transaction public key in the second database according to the first balance commitment and updating the value corresponding to the second transaction public key in the second database according to the second balance commitment.
[0176] Optionally, in this embodiment of the invention, after the carbon trading module 504, the module further includes: an identity positioning submodule, a sequence reconstruction submodule, and a transaction graph submodule;
[0177] The identity positioning submodule is used to query the first database based on the transaction public key used in the first abnormal transaction to obtain the credential element corresponding to the transaction public key, and to query the third database based on the credential element to obtain the real identity identifier corresponding to the credential element.
[0178] The sequence reconstruction submodule is used to receive the transaction private key of the first enterprise corresponding to the real identity identifier, obtain all transaction parameters involving the transaction public key, perform the seventh verification based on the transaction private key and transaction parameters, and reconstruct the fund balance sequence and the electricity carbon quota balance sequence after the seventh verification is passed.
[0179] The transaction graph submodule is used to construct a transaction behavior graph based on the fund balance sequence and the electricity carbon quota balance sequence, and to perform anomaly identification based on the transaction behavior graph, identify all second abnormal transactions in which the first enterprise participates, and to conduct regulatory tracing of all second abnormal transactions involving all second enterprises.
[0180] This invention, through querying the public key used in the first abnormal transaction in the first database and the third database, enables the mapping from the anonymous transaction public key to the legal identity of the enterprise, forming an identity anchor for regulatory traceability. By reconstructing the fund balance sequence and the carbon quota balance sequence, it can provide a verifiable and complete asset history trajectory, achieving efficient and privacy-preserving traceability analysis. By constructing a transaction behavior graph and performing anomaly identification based on the transaction behavior graph, it can transform isolated on-chain anonymous transaction data into a visualized relational network, thereby improving the efficiency of regulatory traceability.
[0181] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement a blockchain-based carbon trading method provided by any of the above-described method embodiments of the present invention.
[0182] In this embodiment of the invention, the identity verification module 501 performs a first verification on the buyer's first transaction public key and the seller's second transaction public key, ensuring that both the buyer and seller participating in the carbon trading are registered enterprises. The commitment construction module 502 receives the first transaction commitment and first balance commitment submitted by the buyer, and the second transaction commitment and second balance commitment submitted by the seller, providing a privacy-protected data foundation for subsequent carbon trading. The zero-knowledge proof module 503 receives the first and second proof tuples submitted by the buyer, and the third proof tuple submitted by the seller, and performs second and third verifications, ensuring the legality of subsequent carbon trading, guaranteeing that the transaction funds, carbon quotas, fund balance, and carbon quota balance are all within valid ranges, and ensuring consistent transaction prices. The carbon trading module 504 updates the value corresponding to the first transaction public key in the second database according to the first balance commitment, and updates the value corresponding to the second transaction public key in the second database according to the second balance commitment, enabling timely updates of the commitment stored in the on-chain database after the carbon trading transaction.
[0183] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0184] Based on the above embodiment of a blockchain-based carbon trading method, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a blockchain-based carbon trading method according to any embodiment of the present invention.
[0185] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0186] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0187] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0188] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute a blockchain-based carbon trading method as described in any of the above-described method embodiments of the present invention.
[0189] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0190] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A blockchain-based method for trading electricity and carbon, characterized in that, The electricity carbon trading method, applicable to smart contracts deployed on a blockchain, includes: Submit your real identity and compliance documentation to the regulator so that the regulator can perform a fourth verification on the real identity and compliance documentation, and store the real identity in a third database after the fourth verification is passed; Based on the balance of funds and the balance of electricity carbon allowance, Pedersen commitments are constructed respectively, corresponding to a first commitment and a second commitment, which are then submitted to the regulator so that the regulator can perform a fifth verification on the first and second commitments, and generate a group certificate after the fifth verification is passed; wherein, the group certificate contains certificate elements constructed based on the real identity identifier, the first commitment and the second commitment; A transaction private key and a corresponding transaction public key are randomly generated. A credential tuple is constructed based on the transaction private key, the transaction public key, and the group credential, and submitted to the smart contract. The smart contract performs a sixth verification on the credential tuple, and after the sixth verification is passed, it updates the state of the first and second databases based on the credential tuple to complete the enterprise's registration on the blockchain. The first database stores the transaction public key of the registered enterprise; the second database stores the capital balance commitment and electricity carbon quota balance commitment of the registered enterprise. The first verification is performed based on the first database, using the buyer's first transaction public key and the seller's second transaction public key. After the first verification is passed, the system receives the first transaction commitment and the first balance commitment submitted by the buyer, as well as the second transaction commitment and the second balance commitment submitted by the seller; wherein, the first transaction commitment and the first balance commitment are constructed based on the buyer's transaction funds, post-transaction fund balance, and public cryptographic parameters; the second transaction commitment and the second balance commitment are constructed based on the seller's transaction carbon quota, post-transaction carbon quota balance, and the public cryptographic parameters; The system receives a first and a second proof tuple submitted by the buyer, and a third proof tuple submitted by the seller; wherein the first proof tuple is used to prove that the transaction funds and the post-transaction fund balance are within a preset value range; the second proof tuple is used to prove that the transaction carbon quota multiplied by the preset unit price equals the transaction funds; and the third proof tuple is used to prove that the transaction carbon quota and the post-transaction carbon quota balance are within a preset value range. A second verification is performed on the first proof tuple and the third proof tuple respectively, and a third verification is performed on the second proof tuple. After both the second verification and the third verification pass, the first commitment in the tuple containing the first commitment and the second commitment corresponding to the first transaction public key in the second database is updated to the first balance commitment; the second commitment in the tuple containing the first commitment and the second commitment corresponding to the second transaction public key in the second database is updated to the second balance commitment, so as to complete the enterprise's electricity carbon transaction on the blockchain.
2. The blockchain-based method for trading electricity and carbon as described in claim 1, characterized in that, The first verification based on the first database of the buyer's first transaction public key and the seller's second transaction public key includes: The first and second transaction public keys are compared with the transaction public keys stored in the first database. If the first database contains a transaction public key that is the same as the first transaction public key and a transaction public key that is the same as the second transaction public key, then the first verification is successful.
3. The blockchain-based method for trading electricity and carbon as described in claim 1, characterized in that, The step of performing state updates on the first and second databases based on the credential tuple after the sixth verification is passed includes: The credential element and transaction public key in the credential tuple are stored as key-value pairs in the first database, and the transaction public key and the tuple containing the first commitment and the second commitment in the credential tuple are stored as key-value pairs in the second database.
4. The blockchain-based method for trading electricity and carbon as described in claim 1, characterized in that, The step of receiving the first transaction commitment and first balance commitment submitted by the buyer, and the second transaction commitment and second balance commitment submitted by the seller, after the first verification is passed, includes: The buyer constructs a first transaction commitment based on a first blinding factor, transaction funds, and a generator tuple, and constructs a first balance commitment based on a second blinding factor, post-transaction fund balance, and a generator tuple; wherein the generator tuple belongs to the public cryptographic parameters published by the regulator. The seller constructs a second transaction commitment based on the third blinding factor, the traded carbon quota, and the generator tuple, and constructs a second balance commitment based on the fourth blinding factor, the post-trade carbon quota balance, and the generator tuple. The buyer uses the seller's second transaction public key to encrypt the first blinding factor and transaction funds to obtain a first encrypted tuple, and submits the first transaction commitment, the first balance commitment and the first encrypted tuple to the smart contract. The seller uses the buyer's first transaction public key to encrypt the third blinding factor and the transaction carbon quota to obtain a second encrypted tuple, and submits the second transaction commitment, the second balance commitment and the second encrypted tuple to the smart contract.
5. The blockchain-based method for trading electricity and carbon as described in claim 4, characterized in that, The receiving of the first and second proof tuples submitted by the buyer, and the third proof tuple submitted by the seller, includes: The buyer constructs a first commitment tuple based on the transaction funds, the post-transaction fund balance, and the generated tuple; and constructs a second commitment tuple based on the first transaction commitment, the second transaction commitment, the preset unit price, and the generated tuple; the seller constructs a third commitment tuple based on the transaction carbon quota, the post-transaction carbon quota balance, and the generated tuple. The buyer generates a first challenge tuple and a second challenge tuple based on the first commitment tuple and the second commitment tuple using a hash function, respectively; the seller generates a third challenge tuple based on the third commitment tuple using a hash function. The buyer constructs a first proof tuple based on the first commitment tuple and the first challenge tuple, and constructs a second proof tuple based on the second commitment tuple and the second challenge tuple; the seller constructs a third proof tuple based on the third commitment tuple and the third challenge tuple.
6. The blockchain-based method for trading electricity and carbon as described in claim 5, characterized in that, The step of performing a second verification on the first proof tuple and the third proof tuple respectively, and performing a third verification on the second proof tuple, includes: Based on the first proof tuple, the second proof tuple, and the third proof tuple, the fourth challenge tuple, the fifth challenge tuple, and the sixth challenge tuple are reconstructed, respectively. Substitute the first proof tuple and the fourth challenge tuple into the preset first cryptographic formula set. If the first cryptographic formula set is true, then the second verification of the first proof tuple is passed. Substitute the third proof tuple and the sixth challenge tuple into the preset first cryptographic formula set. If the first cryptographic formula set is true, then the second verification of the third proof tuple is passed. Substitute the second proof tuple and the fifth challenge tuple into the preset second cryptographic formula set. If the second cryptographic formula set is valid, then the third verification of the second proof tuple is passed.
7. A blockchain-based method for trading electricity and carbon as described in claim 3, characterized in that, After the completion of the enterprise's electricity-carbon transaction on the blockchain, the regulatory body also conducts regulatory traceability, specifically: Based on the public key used in the first abnormal transaction, a query is performed in the first database to obtain the credential element corresponding to the public key. Based on the credential element, a query is performed in the third database to obtain the real identity identifier corresponding to the credential element. Receive the transaction private key of the first enterprise corresponding to the real identity identifier, obtain all transaction parameters involving the transaction public key, perform the seventh verification based on the transaction private key and transaction parameters, and reconstruct the fund balance sequence and the electricity carbon quota balance sequence after the seventh verification is passed; A transaction behavior graph is constructed based on the fund balance sequence and the carbon quota balance sequence. Anomaly identification is performed based on the transaction behavior graph to identify all second abnormal transactions in which the first enterprise participated. Regulatory tracing is then carried out on all second abnormal transactions involving all second enterprises.
8. A blockchain-based carbon trading device, characterized in that, Suitable for smart contracts deployed on a blockchain, the carbon trading device includes: an enterprise registration module, an identity verification module, a commitment construction module, a zero-knowledge proof module, and a carbon trading module; The enterprise registration module is used to submit real identity information and compliance certificates to the regulator, so that the regulator can perform a fourth verification on the real identity information and compliance certificates, and store the real identity information in a third database after the fourth verification is passed; Based on the balance of funds and the balance of electricity carbon allowance, Pedersen commitments are constructed respectively, corresponding to a first commitment and a second commitment, which are then submitted to the regulator so that the regulator can perform a fifth verification on the first and second commitments, and generate a group certificate after the fifth verification is passed; wherein, the group certificate contains certificate elements constructed based on the real identity identifier, the first commitment and the second commitment; A transaction private key and a corresponding transaction public key are randomly generated. A credential tuple is constructed based on the transaction private key, the transaction public key, and the group credential, and submitted to the smart contract. The smart contract performs a sixth verification on the credential tuple, and after the sixth verification is passed, it updates the state of the first and second databases based on the credential tuple to complete the enterprise's registration on the blockchain. The first database stores the transaction public key of the registered enterprise; the second database stores the capital balance commitment and electricity carbon quota balance commitment of the registered enterprise. The identity verification module is used to perform a first verification based on the first database, using the buyer's first transaction public key and the seller's second transaction public key. The commitment construction module is configured to receive, after the first verification is passed, a first transaction commitment and a first balance commitment submitted by the buyer, and a second transaction commitment and a second balance commitment submitted by the seller; wherein, the first transaction commitment and the first balance commitment are constructed based on the buyer's transaction funds, post-transaction fund balance, and public cryptographic parameters; the second transaction commitment and the second balance commitment are constructed based on the seller's transaction carbon quota, post-transaction carbon quota balance, and the public cryptographic parameters; The zero-knowledge proof module is used to receive a first proof tuple and a second proof tuple submitted by the buyer, and a third proof tuple submitted by the seller; wherein, the first proof tuple is used to prove that the transaction funds and the post-transaction fund balance are within a preset numerical range; the second proof tuple is used to prove that the transaction carbon quota multiplied by the preset unit price equals the transaction funds; and the third proof tuple is used to prove that the transaction carbon quota and the post-transaction carbon quota balance are within a preset numerical range. The carbon trading module is used to perform a second verification on the first proof tuple and the third proof tuple respectively, and to perform a third verification on the second proof tuple. After both the second verification and the third verification are passed, the first commitment in the tuple containing the first commitment and the second commitment corresponding to the first transaction public key in the second database is updated to the first balance commitment; the second commitment in the tuple containing the first commitment and the second commitment corresponding to the second transaction public key in the second database is updated to the second balance commitment, so as to complete the carbon trading of enterprises on the blockchain.