A method, device, equipment and medium for supervising blockchain transaction data
By deploying smart contracts on the blockchain platform, encrypting transaction data using random private keys and interacting with the regulatory system, automated, highly adaptable, efficient and low-cost transaction data supervision is achieved, and supervision in the existing technology is solved High cost and poor adaptability.
Patent Information
- Application Number
- CN202211340599.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2042-10-28
AI Technical Summary
It is difficult for the existing technology to achieve automated, highly adaptable, efficient and low-cost blockchain transaction data supervision, especially while ensuring the security and compliance of transaction data.
By deploying smart contracts, using random private keys to encrypt transaction data, and interacting with the regulatory system through smart contract interfaces, automatic supervision of transaction data is achieved. Specific steps include obtaining the cipher text of the transaction data, writing it to the account book, obtaining the data to be verified, encrypting, comparing the results, transmitting the cipher text to the regulatory system, decrypting and conducting compliance inspections, adjusting the review status, etc.
It realizes automated, highly adaptable, efficient and low-cost transaction data supervision, ensures the security and compliance of transaction data, and avoids modifications to the blockchain system and adapts to any blockchain system. No additional development costs.
Smart Images

Figure CN115664659B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a method, apparatus, device and computer-readable storage medium for supervising blockchain transaction data. Background Art
[0002] The blockchain system has a distributed architecture that is different from the traditional information system. Its distributed nodes jointly maintain a data ledger, and each of them keeps a copy of the same data ledger. It has the characteristics of decentralization, distribution, open and transparent data, non-tamperability, and traceability. Unlike the traditional system that relies on the trust endorsement of a centralized authority. In the blockchain, transaction data relies on cryptographic algorithms and consensus mechanisms to achieve trust endorsement, so the transaction data has a high degree of credibility. At the same time, due to the special storage method of block data, the transaction data on the blockchain is theoretically stored permanently. Based on the above characteristics, blockchain has been increasingly widely used.
[0003] However, just as everything has two sides, the permanent storage and non-tamperability of blockchain transaction data can also be easily exploited by malicious attackers to become a medium for publishing and spreading harmful information. Just like road traffic, in order to ensure smooth road traffic, in addition to traffic rules, good supervision is also required. Similarly, orderly supervision of blockchain transaction data is conducive to the healthy development of blockchain business.
[0004] At present, the regulatory technologies for blockchain transaction data include controlled rollback technology for harmful information, blockchain editable technology, and hierarchical and collaborative regulatory technology. Controlled rollback technology means that when a hacker attack causes serious consequences to the blockchain system or data, the blockchain system administrator can roll back the ledger data to before the harmful transaction event. However, this treatment also brings some disadvantages, which will cause some normal transaction data to be cleared together, which is easy to cause transaction disagreements.
[0005] Blockchain editable technology has a variety of methods to modify transaction data, such as the data modification method based on chameleon hash function in single-chain mode, the data modification method in parallel chain mode, etc. These methods have some special requirements or restrictions on how the blockchain system constructs the data structure of the ledger, so their versatility and adaptability are poor.
[0006] In the blockchain system, hierarchical and collaborative supervision technology can be divided into application end, blockchain node and supervision center according to the function and deployment location of the entity; the shielding function of harmful data can be added to each functional entity as needed, and data detection and harmful data shielding can be performed at the corresponding location. This supervision method will introduce a supervision function module into the blockchain system, which requires some customization and modification of the blockchain system. At the same time, the supervision module must be able to adapt to the blockchain data protocol, etc., which brings some additional development work.
[0007] It can be seen that how to achieve automated, highly adaptable, efficient and low-cost transaction data supervision is a problem that technical personnel in this field need to solve. Summary of the invention
[0008] The purpose of the embodiments of the present application is to provide a blockchain transaction data supervision method, device, equipment and computer-readable storage medium, which can realize automated, highly adaptable, efficient and low-cost transaction data supervision.
[0009] In order to solve the above technical problems, the present application embodiment provides a method for supervising blockchain transaction data, which is applicable to a blockchain platform for deploying smart contracts, and the method includes:
[0010] Obtaining a ciphertext of transaction data based on the first smart contract interface; wherein the ciphertext of transaction data is obtained by encrypting the transaction data using a random private key; writing the identifier of the transaction data, the ciphertext of transaction data, the review status of the transaction data, and the random private key into the account book;
[0011] Acquire the data to be verified based on the second smart contract interface; encrypt the data to be verified using the random private key to obtain a ciphertext of the data to be verified; compare the ciphertext of the data to be verified with the ciphertext of the transaction data, and return the comparison result to the blockchain application or the user terminal;
[0012] The transaction data ciphertext is transmitted to the regulatory system through the third smart contract interface, so that the regulatory system can decrypt the transaction data ciphertext using a random public key, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface;
[0013] The audit status corresponding to the transaction data and the information to be published are adjusted according to the detection results.
[0014] Optionally, adjusting the review status corresponding to the transaction data and the information to be published according to the detection result includes:
[0015] If the detection result shows that the transaction data is compliant, adjusting the audit status corresponding to the transaction data to an audit passed status, and writing the decrypted random public key into the account book through the fourth smart contract interface;
[0016] When the detection result shows that the transaction data is non-compliant, the audit status corresponding to the transaction data is adjusted to an audit failure status, and the non-compliance description is written into the account book through the fourth smart contract interface.
[0017] Optionally, after writing the identifier of the transaction data, the ciphertext of the transaction data, the review status of the transaction data, and the random private key into the account book, the method further includes:
[0018] The identifier of the transaction data is fed back to the blockchain application that transmits the transaction data through the first smart contract interface.
[0019] Optionally, after adjusting the review status corresponding to the transaction data and the information to be published according to the detection result, the method further includes:
[0020] Upon receiving the target identifier transmitted by the blockchain application through the fifth smart contract interface, determining whether the review status corresponding to the target identifier is a review passed status;
[0021] When the audit status corresponding to the target identifier is the audit passed status, obtaining the target transaction data ciphertext and the decrypted target random public key matching the target identifier from the account book; decrypting the target transaction data ciphertext using the target random public key to obtain the target transaction data plaintext; feeding back the target transaction data plaintext to the blockchain application through the fifth smart contract interface;
[0022] When the audit status corresponding to the target identifier is an audit failure status or an unaudited status, a prompt message indicating that data acquisition failed is fed back to the blockchain application through the fifth smart contract interface.
[0023] Optionally, after adjusting the review status corresponding to the transaction data and the information to be published according to the detection result, the method further includes:
[0024] Upon receiving the target identifier transmitted by the blockchain application through the fifth smart contract interface, determining whether the blockchain application has access rights and the corresponding scope of rights;
[0025] In the case where the blockchain application has access rights, executing the step of determining whether the audit status corresponding to the target identifier is an audit-passed status;
[0026] Accordingly, the step of feeding back the target transaction data in plain text to the blockchain application through the fifth smart contract interface includes:
[0027] Transaction data plaintext that matches the authority scope is extracted from the target transaction data plaintext, and the transaction data plaintext that matches the authority scope is fed back to the blockchain application through the fifth smart contract interface.
[0028] Optionally, for the process of obtaining the random private key, the method includes:
[0029] Obtain a randomly generated key pair from the storage system of the block node; the randomly generated key pair includes a random private key and a random public key;
[0030] Correspondingly, after the transaction data is encrypted using the random private key to obtain the transaction data ciphertext, the following further comprises:
[0031] The random public key is encrypted using the supervision private key fed back by the supervision system, and the encrypted random public key is written into the account book.
[0032] Optionally, for the process of obtaining the random private key, the method includes:
[0033] Receive a pair of randomly generated key pairs written by the supervision system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by the supervised private key; write the encrypted random public key into the account book.
[0034] Optionally, for the process of obtaining the random private key, the method includes:
[0035] Receive the random private key written by the supervision system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the supervision system.
[0036] Optionally, for the process of obtaining the random private key, the method includes:
[0037] Obtaining a pair of randomly generated key pairs written by an external program through the seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key;
[0038] Correspondingly, after the transaction data is encrypted using the random private key to obtain the transaction data ciphertext, the following further comprises:
[0039] The random public key is encrypted using the supervision private key fed back by the supervision system, and the encrypted random public key is written into the account book.
[0040] Optionally, the step of encrypting the transaction data using a random private key to obtain a ciphertext of the transaction data includes:
[0041] The random private key is used to encrypt the content of the pre-protected field in the transaction data to obtain the transaction data ciphertext.
[0042] Optionally, there are multiple random private keys; and encrypting the transaction data using the random private keys to obtain the ciphertext of the transaction data includes:
[0043] The transaction data is encrypted according to the random private key corresponding to each field to obtain the transaction data ciphertext.
[0044] Optionally, the step of encrypting the transaction data using a random private key to obtain a ciphertext of the transaction data includes:
[0045] The random private key is used to encrypt the contents of all fields in the transaction data to obtain the transaction data ciphertext.
[0046] Optionally, obtaining the ciphertext of transaction data based on the first smart contract interface includes:
[0047] Receive the transaction data ciphertext transmitted by the blockchain application through the first smart contract interface; wherein the transaction data ciphertext is obtained by the blockchain application obtaining a random private key through the initial smart contract interface; and the transaction data is encrypted using the random private key.
[0048] The embodiment of the present application also provides a supervision device for blockchain transaction data, which is applicable to a blockchain platform for deploying smart contracts, and the device includes a first acquisition unit, a writing unit, a second acquisition unit, an encryption unit, a transmission unit, and an adjustment unit;
[0049] The first acquisition unit is used to acquire the transaction data ciphertext based on the first smart contract interface; wherein the transaction data ciphertext is obtained by encrypting the transaction data using a random private key;
[0050] The writing unit is used to write the identifier of the transaction data, the ciphertext of the transaction data, the review status of the transaction data, and the random private key into the account book;
[0051] The second acquisition unit is used to acquire the data to be verified based on the second smart contract interface;
[0052] The encryption unit is used to encrypt the data to be verified using the random private key to obtain a ciphertext of the data to be verified; compare the ciphertext of the data to be verified with the ciphertext of the transaction data, and return the comparison result to the blockchain application or the user terminal;
[0053] The transmission unit is used to transmit the transaction data ciphertext to the supervision system through the third smart contract interface, so that the supervision system can decrypt the transaction data ciphertext using the random public key, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface;
[0054] The adjustment unit is used to adjust the review status corresponding to the transaction data and the information to be published according to the detection result.
[0055] Optionally, the adjustment unit is used to adjust the review status corresponding to the transaction data to a review passed status when the detection result shows that the transaction data is compliant, and write the decrypted random public key into the account book through the fourth smart contract interface;
[0056] When the detection result shows that the transaction data is non-compliant, the audit status corresponding to the transaction data is adjusted to an audit failure status, and the non-compliance description is written into the account book through the fourth smart contract interface.
[0057] Optionally, it also includes an identification feedback unit;
[0058] The identification feedback unit is used to feedback the identification of the transaction data to the blockchain application that transmits the transaction data through the first smart contract interface.
[0059] Optionally, after adjusting the audit status corresponding to the transaction data and the information to be published according to the detection result, it also includes a first judgment unit, a third acquisition unit, a decryption unit, a data feedback unit and a prompt feedback unit;
[0060] The first judgment unit is used to judge whether the review status corresponding to the target identifier is a review passed status when receiving the target identifier transmitted by the blockchain application through the fifth smart contract interface;
[0061] The third acquisition unit is configured to acquire, from the account book, a target transaction data ciphertext and a decrypted target random public key that match the target identifier when the audit status corresponding to the target identifier is an audit passed status;
[0062] The decryption unit is used to decrypt the target transaction data ciphertext using the target random public key to obtain the target transaction data plaintext;
[0063] The data feedback unit is used to feed back the target transaction data in plain text to the blockchain application through the fifth smart contract interface;
[0064] The prompt feedback unit is used to feedback prompt information of data acquisition failure to the blockchain application through the fifth smart contract interface when the audit status corresponding to the target identifier is an audit failure status or an unaudited status.
[0065] Optionally, it further includes a second judgment unit;
[0066] The second judgment unit is used to judge whether the blockchain application has access rights and the corresponding scope of rights when receiving the target identifier transmitted by the blockchain application through the fifth smart contract interface; if the blockchain application has access rights, trigger the first judgment unit to execute the step of judging whether the review status corresponding to the target identifier is the review passed status;
[0067] Correspondingly, the data feedback unit is used to extract the transaction data plaintext that matches the authority scope from the target transaction data plaintext, and feed back the transaction data plaintext that matches the authority scope to the blockchain application through the fifth smart contract interface.
[0068] Optionally, for the process of acquiring the random private key, the device further includes a first key acquisition unit;
[0069] The key acquisition unit is used to acquire a randomly generated key pair from the storage system of the block node; the randomly generated key pair includes a random private key and a random public key;
[0070] Correspondingly, the writing unit is also used to encrypt the random public key using the supervision private key fed back by the supervision system, and write the encrypted random public key into the account book.
[0071] Optionally, with respect to the process of acquiring the random private key, the device further includes a first receiving unit;
[0072] The first receiving unit is used to receive a pair of randomly generated key pairs written by the supervision system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by the supervised private key;
[0073] Correspondingly, the writing unit is also used to write the encrypted random public key into the account book.
[0074] Optionally, with respect to the process of acquiring the random private key, the device further includes a second receiving unit;
[0075] The second receiving unit is used to receive the random private key written by the supervision system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the supervision system.
[0076] Optionally, for the process of acquiring the random private key, the device further includes a second key acquisition unit;
[0077] The second key acquisition unit is used to acquire a pair of randomly generated key pairs written by an external program through the seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key;
[0078] Correspondingly, the writing unit is also used to encrypt the random public key using the supervision private key fed back by the supervision system, and write the encrypted random public key into the account book.
[0079] Optionally, the first acquisition unit is used to use the random private key to encrypt the content of the pre-protected field in the transaction data to obtain a ciphertext of the transaction data.
[0080] Optionally, the first acquisition unit is used to encrypt the transaction data according to a random private key corresponding to each field to obtain a transaction data ciphertext.
[0081] Optionally, the first acquisition unit is used to use the random private key to encrypt the contents of all fields in the transaction data to obtain transaction data ciphertext.
[0082] Optionally, the first acquisition unit is used to receive transaction data ciphertext transmitted by the blockchain application through the first smart contract interface; wherein the transaction data ciphertext is obtained by the blockchain application obtaining a random private key through the initial smart contract interface; and the transaction data is encrypted using the random private key.
[0083] The embodiment of the present application also provides a supervision system for blockchain transaction data, including a blockchain application, a blockchain platform for deploying smart contracts, and a supervision system;
[0084] The blockchain application is used to call the first smart contract interface to transfer the transaction data to the ledger of the blockchain;
[0085] The blockchain platform is used to obtain the transaction data; encrypt the transaction data with a random private key to obtain a ciphertext of the transaction data; write the identifier of the transaction data, the ciphertext of the transaction data, the audit status of the transaction data, the random private key, and the random public key encrypted with the supervision private key into the account book; obtain the data to be verified based on the second smart contract interface; encrypt the data to be verified with the random private key to obtain a ciphertext of the data to be verified, compare the ciphertext of the data to be verified with the ciphertext of the transaction data, and return the comparison result to the blockchain application or the user terminal; transmit the ciphertext of the transaction data to the supervision system through the third smart contract interface;
[0086] The regulatory system is used to decrypt the encrypted random public key using the regulatory public key, decrypt the transaction data ciphertext using the random public key, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface;
[0087] The blockchain platform is also used to adjust the review status corresponding to the transaction data and the information to be published based on the detection results.
[0088] The embodiment of the present application also provides a supervision system for blockchain transaction data, including a blockchain application, a blockchain platform for deploying smart contracts, and a supervision system;
[0089] The blockchain application is used to obtain a random private key through an initial smart contract interface; and use the random private key to encrypt transaction data to obtain transaction data ciphertext; call the first smart contract interface to transmit the transaction data ciphertext to the blockchain account book;
[0090] The blockchain platform is used to obtain the transaction data ciphertext; write the transaction data identifier, the transaction data ciphertext, the transaction data review status, the random private key, and the random public key encrypted with the supervision private key into the account book; obtain the data to be verified based on the second smart contract interface; encrypt the data to be verified using the random private key to obtain the data ciphertext to be verified; compare the data ciphertext to be verified with the transaction data ciphertext, and return the comparison result to the blockchain application or user terminal; transmit the transaction data ciphertext to the supervision system through the third smart contract interface;
[0091] The regulatory system is used to decrypt the encrypted random public key using the regulatory public key, decrypt the transaction data ciphertext using the random public key, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface;
[0092] The blockchain platform is also used to adjust the review status corresponding to the transaction data and the information to be published based on the detection results.
[0093] The embodiment of the present application also provides a supervision system for blockchain transaction data, including a blockchain application, a blockchain platform for deploying smart contracts, and a supervision system;
[0094] The blockchain application is used to call the first smart contract interface to transfer the transaction data to the ledger of the blockchain;
[0095] The blockchain platform is used to obtain a random private key through an initial smart contract interface; use the random private key to encrypt transaction data to obtain transaction data ciphertext; write the transaction data identifier, the transaction data ciphertext, the review status of the transaction data and the random private key into the account book, and mark the review status of the transaction data ciphertext as unreviewed; obtain the data to be verified based on the second smart contract interface; use the random private key to encrypt the data to be verified to obtain the data ciphertext to be verified; compare the data ciphertext to be verified with the transaction data ciphertext, and return the comparison result to the blockchain application or user terminal; transmit the transaction data ciphertext to the supervision system through the third smart contract interface;
[0096] The regulatory system is used to generate a random private key and a random public key; upload the random private key to the blockchain and save the random public key locally; use the random public key to decrypt the transaction data ciphertext, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface;
[0097] The blockchain platform is also used to adjust the review status corresponding to the transaction data and the information to be published based on the detection results.
[0098] The embodiment of the present application also provides a supervision system for blockchain transaction data, including a blockchain application, a blockchain platform for deploying smart contracts, and a supervision system;
[0099] The blockchain application is used to obtain a random private key through an initial smart contract interface; and use the random private key to encrypt transaction data to obtain transaction data ciphertext; call the first smart contract interface to transmit the transaction data ciphertext to the blockchain account book;
[0100] The blockchain platform is used to obtain the transaction data ciphertext; write the transaction data identifier, the transaction data ciphertext, the audit status of the transaction data and the random private key into the account book, and mark the audit status of the transaction data ciphertext as unaudited; obtain the data to be verified based on the second smart contract interface; encrypt the data to be verified using the random private key to obtain the ciphertext of the data to be verified; compare the ciphertext of the data to be verified with the transaction data ciphertext, and return the comparison result to the blockchain application or the user terminal; transmit the transaction data ciphertext to the supervision system through the third smart contract interface;
[0101] The regulatory system is used to generate a random private key and a random public key; upload the random private key to the blockchain and save the random public key locally; use the random public key to decrypt the transaction data ciphertext, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface;
[0102] The blockchain platform is also used to adjust the review status corresponding to the transaction data and the information to be published based on the detection results.
[0103] The present application also provides an electronic device, including:
[0104] Memory for storing computer programs;
[0105] A processor is used to execute the computer program to implement the steps of the above-mentioned blockchain transaction data supervision method.
[0106] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned blockchain transaction data supervision method are implemented.
[0107] It can be seen from the above technical scheme that the blockchain platform that deploys smart contracts obtains the transaction data ciphertext based on the first smart contract interface; wherein the transaction data ciphertext is obtained by encrypting the transaction data using a random private key; the transaction data identifier, transaction data ciphertext, transaction data audit status and random private key are written into the account book; the data to be verified is obtained based on the second smart contract interface; the data to be verified is encrypted using a random private key to obtain the data ciphertext to be verified; the data ciphertext to be verified is compared with the transaction data ciphertext, and the comparison result is returned to the blockchain application or user terminal. The transaction data ciphertext is transmitted to the regulatory system through the third smart contract interface, so that the regulatory system can decrypt the transaction data ciphertext using a random public key, and perform compliance detection on the decrypted transaction data, and upload the detection results to the blockchain through the fourth smart contract interface; the audit status corresponding to the transaction data and the information to be published are adjusted according to the detection results. In this technical scheme, by deploying smart contracts, the automated supervision of transaction data can be achieved through the interface corresponding to the smart contract, and this supervision method is open, transparent and efficient. No modification is required to the blockchain implementation. Only the smart contract needs to be deployed on the blockchain. Therefore, it can be adapted to any blockchain system without additional development costs. At the same time, the transaction data on the chain is only saved once in the account book, which reduces the storage overhead of the on-chain data due to supervision. Automated, highly adaptable, efficient and low-cost transaction data supervision is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0109] Figure 1 A flowchart of a method for supervising blockchain transaction data provided in an embodiment of the present application;
[0110] Figure 2 A schematic diagram of the structure of a blockchain transaction data supervision device provided in an embodiment of the present application;
[0111] Figure 3 A blockchain transaction data supervision system provided in an embodiment of the present application;
[0112] Figure 4 Another blockchain transaction data supervision system provided in an embodiment of the present application;
[0113] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0114] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0115] The terms "including" and "having" in the specification and claims of this application and the above drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0116] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0117] Next, a method for supervising blockchain transaction data provided by an embodiment of the present application is introduced in detail. Figure 1 A flowchart of a method for supervising blockchain transaction data provided in an embodiment of the present application is applicable to a blockchain platform for deploying smart contracts, and the method includes:
[0118] S101: Obtain transaction data ciphertext based on the first smart contract interface.
[0119] In the embodiment of the present application, the transaction data is encrypted by asymmetric encryption. In order to improve the security of the asymmetric encryption method, a random public key and a random private key can be obtained by random generation. Among them, the transaction data ciphertext is obtained by encrypting the transaction data using the random private key.
[0120] The process of using smart contracts on the blockchain is as follows: multiple users jointly participate in the formulation of a contract and use the contract programming language to write a smart contract code; the smart contract code is compiled and reviewed, and the participating parties use private keys to sign the reviewed contract code to ensure the validity of the contract. The signed smart contract will be transmitted to the blockchain network, and the smart contract will be spread through the peer-to-peer network and stored on the distributed nodes of the blockchain. After the smart contract is published on the blockchain, it will not be automatically executed. It is often necessary for the blockchain application to call the smart contract, execute the contract terms through it, and interact with the ledger data.
[0121] The blockchain application can be varied according to the functions to be implemented. In the embodiment of the present application, different smart contract interfaces can be set to implement different blockchain applications.
[0122] In the embodiment of the present application, the blockchain application can call the first smart contract interface to transmit transaction data to the blockchain platform. The blockchain platform can encrypt the transaction data based on the obtained random private key to obtain the transaction data ciphertext.
[0123] In addition, the blockchain application can also obtain a random private key from the ledger of the blockchain platform through the initial smart contract interface, use the random private key to encrypt the transaction data, and call the first smart contract interface to transmit the ciphertext of the transaction data to the blockchain platform.
[0124] In the embodiments of the present application, there are multiple ways to obtain the random private key.
[0125] The first method is to obtain a randomly generated key pair from the storage system of the block node; the randomly generated key pair includes a random private key and a random public key. In order to ensure the security of the random public key, the random public key can be encrypted using the regulatory private key fed back by the regulatory system, and the encrypted random public key can be written into the account book.
[0126] The second method is to receive a pair of randomly generated key pairs written by the regulatory system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by the regulated private key; and the encrypted random public key is written into the account book.
[0127] The third method is to receive the random private key written by the regulatory system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the regulatory system.
[0128] The fourth method is to obtain a pair of randomly generated key pairs written by an external program through the seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key. In order to ensure the security of the random public key, the random public key can be encrypted using the regulatory private key fed back by the regulatory system, and the encrypted random public key can be written into the account book.
[0129] After obtaining the random private key, the transaction data can be encrypted using the random private key. There are many ways to encrypt transaction data. The first way is to use the random private key to encrypt the content of the pre-protected field in the transaction data to obtain the transaction data ciphertext. The pre-protected field can be a field in the transaction data where sensitive information or information that needs to be kept confidential is located. The second way is to set multiple random private keys; encrypt the transaction data according to the random private key corresponding to each field to obtain the transaction data ciphertext. The third way is to encrypt the complete transaction data, that is, to use the random private key to encrypt the content of all fields in the transaction data to obtain the transaction data ciphertext.
[0130] S102: Write the transaction data identifier, transaction data ciphertext, transaction data review status, and random private key into the account book.
[0131] In order to distinguish different transaction data, a unique identifier can be set for each transaction data. After obtaining the ciphertext of the transaction data, the blockchain platform can write the identifier of the transaction data, the ciphertext of the transaction data, the audit status of the transaction data, and the random private key into the account book. In the initial state, the audit status of the transaction data is unaudited.
[0132] S103: Obtain the data to be verified based on the second smart contract interface; encrypt the data to be verified using a random private key to obtain a ciphertext of the data to be verified.
[0133] The blockchain application can call the second smart contract interface to submit the data to be verified and its corresponding identifier to the blockchain for verification. The processing program of the second smart contract interface first obtains the transaction data ciphertext and its random private key uploaded to the blockchain through the first smart contract interface from the account book, then encrypts the submitted data to be verified using the random private key, and then compares the ciphertext of the data to be verified with the ciphertext of the transaction data, and returns the comparison result to the blockchain application or user terminal.
[0134] S104: Transmitting the ciphertext of transaction data to the regulatory system through the third smart contract interface, so that the regulatory system can decrypt the ciphertext of transaction data using a random public key, and perform compliance testing on the decrypted transaction data, and upload the test results to the blockchain through the fourth smart contract interface.
[0135] In actual applications, the blockchain platform can transmit transaction data ciphertext to the regulatory system through the third smart contract interface, or the regulatory system can call the third smart contract interface to obtain unaudited data from the blockchain. The data may include the transaction data identifier, transaction data ciphertext, random private key, encrypted random public key and audit status.
[0136] In order to distinguish it from other key pairs, in the embodiment of the present application, the key pair of the supervision system itself is named as the supervision public key and the supervision private key.
[0137] Taking the example of using the regulatory private key to encrypt the random public key, after the regulatory system obtains the data to be reviewed, first, the encrypted random public key is decrypted using the regulatory public key of the regulatory system itself to obtain the decrypted random public key; where the regulatory public key and the regulatory private key are a pair of asymmetric encryption key pairs. Secondly, the decrypted random public key is used to decrypt the transaction data ciphertext to obtain the transaction data plaintext; thirdly, the data detection algorithm is used to detect the compliance of the transaction data; finally, the detection results are submitted to the blockchain through the fourth smart contract interface.
[0138] Considering that in practical applications, random key pairs can also be generated by the regulatory system, the regulatory system can upload the random private key to the chain so that the blockchain platform can use the random private key to encrypt the transaction data. The regulatory system can save the random public key locally. After the regulatory system obtains the data to be reviewed, it can directly use the locally saved random public key to decrypt the transaction data ciphertext and obtain the transaction data plaintext; then, use the data detection algorithm to detect the compliance of the transaction data; finally, submit the detection results to the blockchain through the fourth smart contract interface.
[0139] The types of transaction data to be reviewed are different, and the corresponding data detection algorithms will also be different. The data detection algorithm can be a matching algorithm or an artificial intelligence algorithm, etc. Using data detection algorithms to detect the compliance of transaction data is a relatively common technology available, and will not be elaborated here.
[0140] In S103, it is introduced that the blockchain platform can compare the ciphertext of the data to be verified with the ciphertext of the transaction data for consistency. In addition, the blockchain application can also call the third smart contract interface to obtain certain unaudited data from the blockchain, and the blockchain application itself verifies the consistency of the data, that is, encrypts the data to be verified with a random private key, and then compares it with the ciphertext of the transaction data to check whether the results are consistent.
[0141] S105: Adjust the audit status corresponding to the transaction data and the information to be published according to the detection results.
[0142] The detection results may include two situations: transaction data compliance and transaction data non-compliance.
[0143] If the test result shows that the transaction data is compliant, the audit status corresponding to the transaction data can be adjusted to the audit passed status. The compliance of the transaction data means that it can be used by the blockchain application. Since the transaction data ciphertext is written in the account book, the blockchain platform can write the decrypted random public key into the account book through the fourth smart contract interface when the transaction data is compliant. When a blockchain application needs to call transaction data, the blockchain platform can decrypt the transaction data ciphertext through the random public key to obtain the plaintext transaction data, and then feed the plaintext transaction data back to the blockchain application.
[0144] When the detection result shows that the transaction data is non-compliant, the audit status corresponding to the transaction data is adjusted to the audit failed status, and the non-compliance description is written into the account book through the fourth smart contract interface.
[0145] The non-compliance description can specify which data is non-compliant or the reasons for the non-compliance, so that blockchain users can more clearly understand the non-compliance of transaction data.
[0146] It can be seen from the above technical scheme that the blockchain platform that deploys smart contracts obtains the transaction data ciphertext based on the first smart contract interface; wherein the transaction data ciphertext is obtained by encrypting the transaction data using a random private key; the transaction data identifier, transaction data ciphertext, transaction data audit status and random private key are written into the account book; the data to be verified is obtained based on the second smart contract interface; the data to be verified is encrypted using a random private key to obtain the data ciphertext to be verified; the data ciphertext to be verified is compared with the transaction data ciphertext, and the comparison result is returned to the blockchain application or user terminal. The transaction data ciphertext is transmitted to the regulatory system through the third smart contract interface, so that the regulatory system can decrypt the transaction data ciphertext using a random public key, and perform compliance detection on the decrypted transaction data, and upload the detection results to the blockchain through the fourth smart contract interface; the audit status corresponding to the transaction data and the information to be published are adjusted according to the detection results. In this technical scheme, by deploying smart contracts, the automated supervision of transaction data can be achieved through the interface corresponding to the smart contract, and this supervision method is open, transparent and efficient. No modification is required to the blockchain implementation. Only the smart contract needs to be deployed on the blockchain. Therefore, it can be adapted to any blockchain system without additional development costs. At the same time, the transaction data on the chain is only saved once in the account book, which reduces the storage overhead of the on-chain data due to supervision. Automated, highly adaptable, efficient and low-cost transaction data supervision is achieved.
[0147] The blockchain platform can set corresponding identifiers for different transaction data. After writing the transaction data identifier, transaction data ciphertext, transaction data review status and random private key into the account book, the blockchain platform can feedback the transaction data identifier to the blockchain application that transmits the transaction data through the first smart contract interface, so that the blockchain application can obtain the corresponding transaction data based on the identifier.
[0148] The above content is an introduction to the review process of transaction data. After completing the review of transaction data, blockchain applications can obtain transaction data from the blockchain platform.
[0149] In a specific implementation, the blockchain application may transmit the target identifier to the blockchain platform through the fifth smart contract interface. When the blockchain platform receives the target identifier transmitted by the blockchain application through the fifth smart contract interface, it may determine whether the audit status corresponding to the target identifier is the audit passed status.
[0150] Each transaction data has its corresponding identifier and random public key. For the sake of distinction, in the embodiment of the present application, the transaction data ciphertext corresponding to the target identifier is referred to as the target transaction data ciphertext, and its corresponding random public key is referred to as the target random public key.
[0151] When the audit status corresponding to the target identifier is the audit passed status, the target transaction data ciphertext matching the target identifier and the decrypted target random public key are obtained from the account book; the target transaction data ciphertext is decrypted using the target random public key to obtain the target transaction data plaintext; the target transaction data plaintext is fed back to the blockchain application through the fifth smart contract interface.
[0152] When the audit status corresponding to the target identifier is a failed audit status or an unaudited status, the target transaction data plain text cannot be obtained at this time. The blockchain platform can feedback a prompt message of data acquisition failure to the blockchain application through the fifth smart contract interface.
[0153] Considering that different blockchain applications have different permissions in actual applications, the blockchain platform can determine whether the blockchain application has access rights and the corresponding permission scope when receiving the target identifier transmitted by the blockchain application through the fifth smart contract interface.
[0154] In the case where the blockchain application has access rights, a step of determining whether the audit status corresponding to the target identifier is an audit-passed status is performed. In the case where the audit status corresponding to the target identifier is an audit-passed status, the blockchain platform can extract the transaction data plaintext that matches the authority scope from the target transaction data plaintext, and feed the transaction data plaintext that matches the authority scope back to the blockchain application through the fifth smart contract interface.
[0155] By setting permissions, you can improve the security of transaction data and avoid the risk of transaction data being leaked.
[0156] It should be noted that the first smart contract interface, the second smart contract interface, the third smart contract interface, the fourth smart contract interface, the fifth smart contract interface, the sixth smart contract interface and the seventh smart contract interface mentioned above can be independent contract interfaces, each of which is used to perform different functions. The smart contract interfaces mentioned above can also be a unified interface, and different functions are distinguished by setting different identifiers. Among them, "first, second, third, fourth, fifth, sixth and seventh" are only for distinguishing different functions, and do not limit the arrangement order of smart contract interfaces.
[0157] Figure 2 A schematic diagram of the structure of a blockchain transaction data supervision device provided in an embodiment of the present application, which is applicable to a blockchain platform for deploying smart contracts, and the device includes a first acquisition unit 21, a writing unit 22, a second acquisition unit 23, an encryption unit 24, a transmission unit 25 and an adjustment unit 26;
[0158] The first acquisition unit 21 is used to acquire the transaction data ciphertext based on the first smart contract interface; wherein the transaction data ciphertext is obtained by encrypting the transaction data using a random private key;
[0159] A writing unit 22, used to write the transaction data identifier, transaction data ciphertext, transaction data review status and random private key into the account book;
[0160] A second acquisition unit 23, used to acquire the data to be verified based on the second smart contract interface;
[0161] The encryption unit 24 is used to encrypt the data to be verified using a random private key to obtain a ciphertext of the data to be verified; compare the ciphertext of the data to be verified with the ciphertext of the transaction data, and return the comparison result to the blockchain application or the user terminal;
[0162] The transmission unit 25 is used to transmit the transaction data ciphertext to the supervision system through the third smart contract interface, so that the supervision system can decrypt the transaction data ciphertext using the random public key, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface;
[0163] The adjustment unit 26 is used to adjust the audit status corresponding to the transaction data and the information to be published according to the detection result.
[0164] Optionally, the adjustment unit is used to adjust the review status corresponding to the transaction data to a review passed status when the detection result shows that the transaction data is compliant, and write the decrypted random public key into the account book through the fourth smart contract interface;
[0165] When the detection result shows that the transaction data is non-compliant, the audit status corresponding to the transaction data is adjusted to the audit failed status, and the non-compliance description is written into the account book through the fourth smart contract interface.
[0166] Optionally, it also includes an identification feedback unit;
[0167] The identification feedback unit is used to feedback the identification of the transaction data to the blockchain application that transmits the transaction data through the first smart contract interface.
[0168] Optionally, after adjusting the audit status corresponding to the transaction data and the information to be published according to the detection result, it also includes a first judgment unit, a third acquisition unit, a decryption unit, a data feedback unit and a prompt feedback unit;
[0169] A first judgment unit is used to judge whether the review status corresponding to the target identifier is a review passed status when receiving the target identifier transmitted by the blockchain application through the fifth smart contract interface;
[0170] The third acquisition unit is used to acquire the target transaction data ciphertext and the decrypted target random public key matching the target identifier from the account book when the audit status corresponding to the target identifier is the audit passed status;
[0171] A decryption unit, used to decrypt the target transaction data ciphertext using the target random public key to obtain the target transaction data plaintext;
[0172] A data feedback unit, used to feed back the target transaction data in plain text to the blockchain application through the fifth smart contract interface;
[0173] The prompt feedback unit is used to feedback prompt information of data acquisition failure to the blockchain application through the fifth smart contract interface when the audit status corresponding to the target identifier is an audit failure status or an unaudited status.
[0174] Optionally, it further includes a second judgment unit;
[0175] The second judgment unit is used to judge whether the blockchain application has access rights and the corresponding scope of rights when receiving the target identifier transmitted by the blockchain application through the fifth smart contract interface; if the blockchain application has access rights, trigger the first judgment unit to execute the step of judging whether the audit status corresponding to the target identifier is the audit passed status;
[0176] Correspondingly, the data feedback unit is used to extract the transaction data plaintext that matches the authority scope from the target transaction data plaintext, and feed back the transaction data plaintext that matches the authority scope to the blockchain application through the fifth smart contract interface.
[0177] Optionally, for the process of obtaining the random private key, the device further includes a first key obtaining unit;
[0178] A key acquisition unit, used to acquire a pair of randomly generated key pairs from a storage system of a block node; the randomly generated key pair includes a random private key and a random public key;
[0179] Correspondingly, the writing unit is also used to encrypt the random public key using the regulatory private key fed back by the regulatory system, and write the encrypted random public key into the account book.
[0180] Optionally, for the process of obtaining the random private key, the device further includes a first receiving unit;
[0181] A first receiving unit is used to receive a pair of randomly generated key pairs written by the supervision system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by the supervised private key;
[0182] Correspondingly, the writing unit is also used to write the encrypted random public key into the ledger.
[0183] Optionally, for the process of obtaining the random private key, the device further includes a second receiving unit;
[0184] The second receiving unit is used to receive the random private key written by the supervision system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the supervision system.
[0185] Optionally, for the process of obtaining the random private key, the device further includes a second key obtaining unit;
[0186] A second key acquisition unit, used to acquire a pair of randomly generated key pairs written by an external program through a seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key;
[0187] Correspondingly, the writing unit is also used to encrypt the random public key using the regulatory private key fed back by the regulatory system, and write the encrypted random public key into the account book.
[0188] Optionally, the first acquisition unit is used to encrypt the content of the pre-protected field in the transaction data using a random private key to obtain a ciphertext of the transaction data.
[0189] Optionally, the first acquisition unit is used to encrypt the transaction data according to the random private key corresponding to each field to obtain the transaction data ciphertext.
[0190] Optionally, the first acquisition unit is used to encrypt the contents of all fields in the transaction data using a random private key to obtain a ciphertext of the transaction data.
[0191] Optionally, the first acquisition unit is used to receive transaction data ciphertext transmitted by the blockchain application through the first smart contract interface; wherein the transaction data ciphertext is obtained by the blockchain application obtaining a random private key through the initial smart contract interface; and the transaction data is encrypted using the random private key.
[0192] Figure 2 The description of the features in the corresponding embodiments can be found in Figure 1 The relevant descriptions of the corresponding embodiments will not be repeated here one by one.
[0193] It can be seen from the above technical scheme that the blockchain platform that deploys smart contracts obtains the transaction data ciphertext based on the first smart contract interface; wherein the transaction data ciphertext is obtained by encrypting the transaction data using a random private key; the transaction data identifier, transaction data ciphertext, transaction data audit status and random private key are written into the account book; the data to be verified is obtained based on the second smart contract interface; the data to be verified is encrypted using a random private key to obtain the data ciphertext to be verified; the data ciphertext to be verified is compared with the transaction data ciphertext, and the comparison result is returned to the blockchain application or user terminal. The transaction data ciphertext is transmitted to the regulatory system through the third smart contract interface, so that the regulatory system can decrypt the transaction data ciphertext using a random public key, and perform compliance detection on the decrypted transaction data, and upload the detection results to the blockchain through the fourth smart contract interface; the audit status corresponding to the transaction data and the information to be published are adjusted according to the detection results. In this technical scheme, by deploying smart contracts, the automated supervision of transaction data can be achieved through the interface corresponding to the smart contract, and this supervision method is open, transparent and efficient. No modification is required to the blockchain implementation. Only the smart contract needs to be deployed on the blockchain. Therefore, it can be adapted to any blockchain system without additional development costs. At the same time, the transaction data on the chain is only saved once in the account book, which reduces the storage overhead of the on-chain data due to supervision. Automated, highly adaptable, efficient and low-cost transaction data supervision is achieved.
[0194] Figure 3 A blockchain transaction data supervision system provided in an embodiment of the present application includes a blockchain application, a blockchain platform for deploying smart contracts, and a supervision system; Figure 3 In the figure, the first smart contract interface to the fifth smart contract interface are represented by contract interface 1 to contract interface 5 respectively.
[0195] The blockchain application is used to call the first smart contract interface (contract interface 1) to execute transaction data on the chain, that is, to transfer the transaction data to the ledger of the blockchain.
[0196] The blockchain platform is used to obtain transaction data; encrypt the transaction data with a random private key to obtain the transaction data ciphertext; write the transaction data identifier, transaction data ciphertext, transaction data audit status, random private key, and random public key encrypted with the regulatory private key into the account book. The blockchain application can transmit the data to be verified for verifying the transaction data to the blockchain platform through the second smart contract interface (contract interface 2). At this time, the transaction data recorded in the account book of the blockchain platform is in a ciphertext state. After the blockchain platform obtains the data to be verified based on the contract interface 2, it can use the random private key to encrypt the data to be verified to obtain the ciphertext of the data to be verified. The blockchain platform compares the ciphertext of the data to be verified with the ciphertext of the transaction data, and returns the comparison result to the blockchain application or the user terminal. The blockchain platform can transmit the ciphertext of the transaction data to the regulatory system through the third smart contract interface (contract interface 3). If the blockchain application needs to obtain the ciphertext of the transaction data, the blockchain platform can also transmit the ciphertext of the transaction data to the blockchain application through the contract interface 3.
[0197] The supervision system is used to use the supervision public key to decrypt the encrypted random public key, use the random public key to decrypt the transaction data ciphertext, and perform compliance testing on the decrypted transaction data, and upload the test results to the blockchain through the fourth smart contract interface (contract interface 4).
[0198] In the specific implementation, the blockchain platform can use the supervision private key of the supervision system to encrypt the random public key and write the encrypted random public key into the account book. Therefore, after the supervision system obtains the transaction data ciphertext, it can use the supervision public key to decrypt the encrypted random public key, and then use the random public key to decrypt the transaction data ciphertext to obtain the transaction data plaintext. The supervision system can call the data detection algorithm to perform compliance detection on the transaction data plaintext.
[0199] The blockchain platform is also used to adjust the audit status of transaction data and the information that needs to be published based on the test results.
[0200] The detection result may include whether the transaction data is compliant or not. For compliant transaction data, the random public key may be made public, and for non-compliant transaction data, the non-compliance may be noted and the random public key may not be made public.
[0201] When the blockchain application needs to obtain the plain text of transaction data, the corresponding target identifier can be transmitted to the blockchain application through the fifth smart contract interface (contract interface 5), and the blockchain platform can determine the corresponding random public key and transaction data ciphertext based on the target identifier. The transaction data ciphertext is decrypted using the random public key to obtain the transaction data plaintext, and the transaction data plaintext is fed back to the blockchain application through the contract interface 5.
[0202] Figure 3The encryption processing of transaction data can also be performed by the blockchain application. The blockchain application can obtain a random private key through the initial smart contract interface; and use the random private key to encrypt the transaction data to obtain the transaction data ciphertext; call the first smart contract interface to transmit the transaction data ciphertext to the blockchain account book.
[0203] Figure 3 In the example above, the random private key, random public key, supervisory private key and supervisory public key are used to encrypt and decrypt data. In actual applications, the supervisory private key and supervisory public key may not be set, and the supervisory system may directly generate a random key pair (including a random private key and a random public key). For this implementation, please refer to Figure 4 .
[0204] Figure 4 Another blockchain transaction data supervision system provided in an embodiment of the present application includes a blockchain application, a blockchain platform for deploying smart contracts, and a supervision system; Figure 4 In the figure, the first to fifth smart contract interfaces are represented by contract interface 1 to contract interface 5 respectively. The initial smart contract interface is represented by contract interface 0.
[0205] The blockchain platform can obtain the random private key through the initial smart contract interface (contract interface 0). Or the regulatory system can actively write the random private key to the blockchain platform through contract interface 0.
[0206] The blockchain application is used to call the first smart contract interface (contract interface 1) to execute transaction data on the chain, that is, to transfer the transaction data to the ledger of the blockchain.
[0207] The blockchain platform uses a random private key to encrypt the transaction data to obtain the transaction data ciphertext; the transaction data identifier, transaction data ciphertext, transaction data review status and random private key are written into the account book through contract interface 1, and the review status of the transaction data ciphertext is marked as unreviewed.
[0208] The blockchain application can call the second smart contract interface (contract interface 2) to transmit the data to be verified to the blockchain platform for verifying the transaction data.
[0209] After the blockchain platform obtains the data to be verified through the contract interface 2, it can use the random private key to encrypt the data to be verified to obtain the ciphertext of the data to be verified; compare the ciphertext of the data to be verified with the ciphertext of the transaction data, and return the comparison result to the blockchain application or user terminal. The ciphertext of the transaction data is transmitted to the supervision system through the third smart contract interface (contract interface 3).
[0210] The supervision system is used to generate a random private key and a random public key; upload the random private key to the chain and save the random public key locally; use the random public key to decrypt the transaction data ciphertext, and perform compliance detection on the decrypted transaction data, and upload the detection results to the blockchain through the fourth smart contract interface (contract interface 4).
[0211] The blockchain platform is also used to adjust the audit status of transaction data and the information that needs to be published based on the test results.
[0212] The detection result may include whether the transaction data is compliant or not. For compliant transaction data, the random public key may be made public, and for non-compliant transaction data, the non-compliance may be noted and the random public key may not be made public.
[0213] When the blockchain application needs to obtain the plain text of transaction data, the corresponding target identifier can be transmitted to the blockchain application through the fifth smart contract interface (contract interface 5), and the blockchain platform can determine the corresponding random public key and transaction data ciphertext based on the target identifier. The transaction data ciphertext is decrypted using the random public key to obtain the transaction data plaintext, and the transaction data plaintext is fed back to the blockchain application through the contract interface 5.
[0214] Figure 4 The encryption processing of transaction data can also be performed by the blockchain application. The blockchain application can obtain a random private key through the initial smart contract interface; and use the random private key to encrypt the transaction data to obtain the transaction data ciphertext; call the first smart contract interface to transmit the transaction data ciphertext to the blockchain account book.
[0215] It can be seen from the above technical scheme that the blockchain platform that deploys smart contracts obtains the transaction data ciphertext based on the first smart contract interface; wherein the transaction data ciphertext is obtained by encrypting the transaction data using a random private key; the transaction data identifier, transaction data ciphertext, transaction data audit status and random private key are written into the account book; the data to be verified is obtained based on the second smart contract interface; the data to be verified is encrypted using a random private key to obtain the data ciphertext to be verified; the data ciphertext to be verified is compared with the transaction data ciphertext, and the comparison result is returned to the blockchain application or user terminal. The transaction data ciphertext is transmitted to the regulatory system through the third smart contract interface, so that the regulatory system can decrypt the transaction data ciphertext using a random public key, and perform compliance detection on the decrypted transaction data, and upload the detection results to the blockchain through the fourth smart contract interface; the audit status corresponding to the transaction data and the information to be published are adjusted according to the detection results. In this technical scheme, by deploying smart contracts, the automated supervision of transaction data can be achieved through the interface corresponding to the smart contract, and this supervision method is open, transparent and efficient. No modification is required to the blockchain implementation. Only the smart contract needs to be deployed on the blockchain. Therefore, it can be adapted to any blockchain system without additional development costs. At the same time, the transaction data on the chain is only saved once in the account book, which reduces the storage overhead of the on-chain data due to supervision. Automated, highly adaptable, efficient and low-cost transaction data supervision is achieved.
[0216] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application, such as Figure 5 As shown, the electronic device includes: a memory 20 for storing a computer program; and a processor 21 for implementing the steps of the method for supervising blockchain transaction data in the above-mentioned embodiment when executing the computer program.
[0217] The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state.
[0218] In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning. The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, the relevant steps of the method for supervising blockchain transaction data disclosed in any of the aforementioned embodiments can be implemented.
[0219] In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary storage or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, an identification of transaction data, a ciphertext of transaction data, an audit status of transaction data, and a random private key. In some embodiments, the electronic device may also include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0220] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure.
[0221] It is understandable that if the supervision method of blockchain transaction data in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, disk or optical disk and other media that can store program code.
[0222] Based on this, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned blockchain transaction data supervision method are implemented.
[0223] The above is a detailed introduction to a method, device, equipment and computer-readable storage medium for supervising blockchain transaction data provided by the embodiments of the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0224] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0225] The above is a detailed introduction to the supervision method, device, equipment and computer-readable storage medium for blockchain transaction data provided by this application. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
Claims
1. A method for supervising blockchain transaction data, characterized in that: A blockchain platform suitable for deploying smart contracts, the method comprising: Obtaining a ciphertext of transaction data based on the first smart contract interface; wherein the ciphertext of transaction data is obtained by encrypting the transaction data using a random private key; writing the identifier of the transaction data, the ciphertext of transaction data, the review status of the transaction data, and the random private key into the account book; Acquire the data to be verified based on the second smart contract interface; encrypt the data to be verified using the random private key to obtain a ciphertext of the data to be verified; compare the ciphertext of the data to be verified with the ciphertext of the transaction data, and return the comparison result to the blockchain application or the user terminal; The transaction data ciphertext is transmitted to the regulatory system through the third smart contract interface, so that the regulatory system can decrypt the transaction data ciphertext using a random public key, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface; Adjusting the review status corresponding to the transaction data and the information to be published according to the detection results; Wherein, for the process of obtaining the random private key, the method includes: A pair of randomly generated key pairs is obtained from the storage system of the block node; the randomly generated key pair includes a random private key and a random public key; accordingly, after the transaction data is encrypted using the random private key to obtain the transaction data ciphertext, the method further includes: encrypting the random public key using the supervision private key fed back by the supervision system, and writing the encrypted random public key into the account book; Or, receiving a pair of randomly generated key pairs written by the supervision system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by the supervised private key; and writing the encrypted random public key into the account book; Or, receiving a random private key written by the supervision system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the supervision system; Or, a pair of randomly generated key pairs written by an external program is obtained through the seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key; accordingly, after the transaction data is encrypted using the random private key to obtain the transaction data ciphertext, it also includes: using the supervision private key fed back by the supervision system to encrypt the random public key, and writing the encrypted random public key into the account book.
2. The method for supervising blockchain transaction data according to claim 1, characterized in that: The adjustment of the audit status corresponding to the transaction data and the information to be published according to the detection result includes: If the detection result shows that the transaction data is compliant, adjusting the audit status corresponding to the transaction data to an audit passed status, and writing the decrypted random public key into the account book through the fourth smart contract interface; When the detection result shows that the transaction data is non-compliant, the audit status corresponding to the transaction data is adjusted to an audit failure status, and the non-compliance description is written into the account book through the fourth smart contract interface.
3. The method for supervising blockchain transaction data according to claim 1, characterized in that: After writing the identifier of the transaction data, the ciphertext of the transaction data, the review status of the transaction data, and the random private key into the account book, the method further includes: The identifier of the transaction data is fed back to the blockchain application that transmits the transaction data through the first smart contract interface.
4. The method for supervising blockchain transaction data according to claim 3 is characterized in that: After adjusting the audit status corresponding to the transaction data and the information to be published according to the detection result, the method further includes: Upon receiving the target identifier transmitted by the blockchain application through the fifth smart contract interface, determining whether the review status corresponding to the target identifier is a review passed status; When the audit status corresponding to the target identifier is the audit passed status, obtaining the target transaction data ciphertext and the decrypted target random public key matching the target identifier from the account book; decrypting the target transaction data ciphertext using the target random public key to obtain the target transaction data plaintext; and feeding back the target transaction data plaintext to the blockchain application through the fifth smart contract interface; When the audit status corresponding to the target identifier is an audit failure status or an unaudited status, a prompt message indicating that data acquisition failed is fed back to the blockchain application through the fifth smart contract interface.
5. The method for supervising blockchain transaction data according to claim 4 is characterized in that: After adjusting the audit status corresponding to the transaction data and the information to be published according to the detection result, the method further includes: Upon receiving the target identifier transmitted by the blockchain application through the fifth smart contract interface, determining whether the blockchain application has access rights and the corresponding scope of rights; In the case where the blockchain application has access rights, executing the step of determining whether the audit status corresponding to the target identifier is an audit-passed status; Accordingly, the step of feeding back the target transaction data in plain text to the blockchain application through the fifth smart contract interface includes: Transaction data plaintext that matches the authority scope is extracted from the target transaction data plaintext, and the transaction data plaintext that matches the authority scope is fed back to the blockchain application through the fifth smart contract interface.
6. The method for supervising blockchain transaction data according to claim 1, characterized in that: The encrypting of the transaction data using the random private key to obtain the ciphertext of the transaction data includes: The random private key is used to encrypt the content of the pre-protected field in the transaction data to obtain the transaction data ciphertext.
7. The method for supervising blockchain transaction data according to claim 1, characterized in that: The number of the random private keys is multiple; the encrypting the transaction data using the random private keys to obtain the transaction data ciphertext includes: The transaction data is encrypted according to the random private key corresponding to each field to obtain the transaction data ciphertext.
8. The method for supervising blockchain transaction data according to claim 1, characterized in that: The encrypting of the transaction data using the random private key to obtain the ciphertext of the transaction data includes: The random private key is used to encrypt the contents of all fields in the transaction data to obtain the transaction data ciphertext.
9. The method for supervising blockchain transaction data according to claim 1, characterized in that: The obtaining of the ciphertext of transaction data based on the first smart contract interface includes: Receive the transaction data ciphertext transmitted by the blockchain application through the first smart contract interface; wherein the transaction data ciphertext is obtained by the blockchain application obtaining a random private key through the initial smart contract interface; and the transaction data is encrypted using the random private key.
10. A blockchain transaction data supervision device, characterized in that: A blockchain platform suitable for deploying smart contracts, the device comprising a first acquisition unit, a writing unit, a second acquisition unit, an encryption unit, a transmission unit and an adjustment unit; The first acquisition unit is used to acquire the transaction data ciphertext based on the first smart contract interface; wherein the transaction data ciphertext is obtained by encrypting the transaction data using a random private key; The writing unit is used to write the identifier of the transaction data, the ciphertext of the transaction data, the review status of the transaction data, and the random private key into the account book; The second acquisition unit is used to acquire the data to be verified based on the second smart contract interface; The encryption unit is used to encrypt the data to be verified using the random private key to obtain a ciphertext of the data to be verified; compare the ciphertext of the data to be verified with the ciphertext of the transaction data, and return the comparison result to the blockchain application or the user terminal; The transmission unit transmits the transaction data ciphertext to the supervision system through the third smart contract interface, so that the supervision system decrypts the transaction data ciphertext using the random public key, performs compliance detection on the decrypted transaction data, and uploads the detection result to the blockchain through the fourth smart contract interface; The adjustment unit is used to adjust the audit status corresponding to the transaction data and the information to be published according to the detection result; Wherein, for the process of obtaining the random private key, the device further includes: A key acquisition unit is used to acquire a pair of randomly generated key pairs from the storage system of the block node; the randomly generated key pair includes a random private key and a random public key; accordingly, the writing unit is also used to encrypt the random public key using the supervision private key fed back by the supervision system, and write the encrypted random public key into the account book; Or, a first receiving unit is used to receive a pair of randomly generated key pairs written by the supervision system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by the supervised private key; the writing unit is also used to write the encrypted random public key into the account book; Or, a second receiving unit, used to receive a random private key written by the supervision system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the supervision system; Or, a second key acquisition unit is used to obtain a pair of randomly generated key pairs written by an external program through the seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key; accordingly, the writing unit is also used to encrypt the random public key using the regulatory private key fed back by the regulatory system, and write the encrypted random public key into the account book.
11. A blockchain transaction data supervision system, characterized in that: Including blockchain applications, blockchain platforms for deploying smart contracts, and regulatory systems; The blockchain application is used to call the first smart contract interface to transfer the transaction data to the ledger of the blockchain; The blockchain platform is used to obtain the transaction data; encrypt the transaction data using a random private key to obtain a ciphertext of the transaction data; and write the identifier of the transaction data, the ciphertext of the transaction data, the review status of the transaction data, the random private key, and the random public key encrypted with the supervisory private key into the account book; Acquire the data to be verified based on the second smart contract interface; encrypt the data to be verified using the random private key to obtain a ciphertext of the data to be verified; compare the ciphertext of the data to be verified with the ciphertext of the transaction data, and return the comparison result to the blockchain application or the user terminal; The transaction data ciphertext is transmitted to the supervision system through the third smart contract interface; wherein, for the acquisition process of the random private key, a pair of randomly generated key pairs are specifically obtained from the storage system of the block node; the randomly generated key pair includes a random private key and a random public key; accordingly, after the transaction data is encrypted using the random private key to obtain the transaction data ciphertext, it also includes: encrypting the random public key using the supervision private key fed back by the supervision system, and writing the encrypted random public key into the account book; or, receiving a pair of randomly generated key pairs written by the supervision system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by a regulated private key; writing the encrypted random public key into the account book; or, receiving a random private key written by the regulatory system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the regulatory system; or, obtaining a pair of randomly generated key pairs written by an external program through the seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key; accordingly, after encrypting the transaction data using the random private key to obtain the transaction data ciphertext, the method further includes: encrypting the random public key using the regulatory private key fed back by the regulatory system, and writing the encrypted random public key into the account book; The regulatory system is used to decrypt the encrypted random public key using the regulatory public key, decrypt the transaction data ciphertext using the random public key, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface; The blockchain platform is also used to adjust the review status corresponding to the transaction data and the information to be published based on the detection results.
12. A blockchain transaction data supervision system, characterized in that: Including blockchain applications, blockchain platforms for deploying smart contracts, and regulatory systems; The blockchain application is used to obtain a random private key through an initial smart contract interface; and use the random private key to encrypt transaction data to obtain transaction data ciphertext; call the first smart contract interface to transmit the transaction data ciphertext to the blockchain account book; The blockchain platform is used to obtain the transaction data ciphertext; write the transaction data identifier, the transaction data ciphertext, the review status of the transaction data, the random private key, and the random public key encrypted with the supervisory private key into the account book; Acquire the data to be verified based on the second smart contract interface; encrypt the data to be verified using the random private key to obtain a ciphertext of the data to be verified; compare the ciphertext of the data to be verified with the ciphertext of the transaction data, and return the comparison result to the blockchain application or the user terminal; The transaction data ciphertext is transmitted to the supervision system through the third smart contract interface; wherein, for the acquisition process of the random private key, a pair of randomly generated key pairs are specifically obtained from the storage system of the block node; the randomly generated key pair includes a random private key and a random public key; accordingly, after the transaction data is encrypted using the random private key to obtain the transaction data ciphertext, it also includes: encrypting the random public key using the supervision private key fed back by the supervision system, and writing the encrypted random public key into the account book; or, receiving a pair of randomly generated key pairs written by the supervision system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by a regulated private key; writing the encrypted random public key into the account book; or, receiving a random private key written by the regulatory system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the regulatory system; or, obtaining a pair of randomly generated key pairs written by an external program through the seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key; accordingly, after encrypting the transaction data using the random private key to obtain the transaction data ciphertext, the method further includes: encrypting the random public key using the regulatory private key fed back by the regulatory system, and writing the encrypted random public key into the account book; The regulatory system is used to decrypt the encrypted random public key using the regulatory public key, decrypt the transaction data ciphertext using the random public key, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface; The blockchain platform is also used to adjust the review status corresponding to the transaction data and the information to be published based on the detection results.
13. A blockchain transaction data supervision system, characterized in that: Including blockchain applications, blockchain platforms for deploying smart contracts, and regulatory systems; The blockchain application is used to call the first smart contract interface to transfer the transaction data to the ledger of the blockchain; The blockchain platform is used to obtain a random private key through an initial smart contract interface; encrypt the transaction data using the random private key to obtain a ciphertext of the transaction data; write the identifier of the transaction data, the ciphertext of the transaction data, the review status of the transaction data, and the random private key into the account book, and mark the review status of the ciphertext of the transaction data as unreviewed; Acquire the data to be verified based on the second smart contract interface; The data to be verified is encrypted using the random private key to obtain a ciphertext of the data to be verified; the ciphertext of the data to be verified is compared with the ciphertext of the transaction data, and the comparison result is returned to the blockchain application or the user terminal; The transaction data ciphertext is transmitted to the supervision system through the third smart contract interface; wherein, for the acquisition process of the random private key, a pair of randomly generated key pairs are specifically obtained from the storage system of the block node; the randomly generated key pair includes a random private key and a random public key; accordingly, after the transaction data is encrypted using the random private key to obtain the transaction data ciphertext, it also includes: encrypting the random public key using the supervision private key fed back by the supervision system, and writing the encrypted random public key into the account book; or, receiving a pair of randomly generated key pairs written by the supervision system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by a regulated private key; writing the encrypted random public key into the account book; or, receiving a random private key written by the regulatory system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the regulatory system; or, obtaining a pair of randomly generated key pairs written by an external program through the seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key; accordingly, after encrypting the transaction data using the random private key to obtain the transaction data ciphertext, the method further includes: encrypting the random public key using the regulatory private key fed back by the regulatory system, and writing the encrypted random public key into the account book; The regulatory system is used to generate a random private key and a random public key; upload the random private key to the blockchain and save the random public key locally; use the random public key to decrypt the transaction data ciphertext, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface; The blockchain platform is also used to adjust the review status corresponding to the transaction data and the information to be published based on the detection results.
14. A blockchain transaction data supervision system, characterized in that: Including blockchain applications, blockchain platforms for deploying smart contracts, and regulatory systems; The blockchain application is used to obtain a random private key through an initial smart contract interface; and use the random private key to encrypt transaction data to obtain transaction data ciphertext; call the first smart contract interface to transmit the transaction data ciphertext to the blockchain account book; The blockchain platform is used to obtain the transaction data ciphertext; write the transaction data identifier, the transaction data ciphertext, the review status of the transaction data and the random private key into the account book, and mark the review status of the transaction data ciphertext as unreviewed; Acquire the data to be verified based on the second smart contract interface; The data to be verified is encrypted using the random private key to obtain a ciphertext of the data to be verified; the ciphertext of the data to be verified is compared with the ciphertext of the transaction data, and the comparison result is returned to the blockchain application or the user terminal; The transaction data ciphertext is transmitted to the supervision system through the third smart contract interface; wherein, for the acquisition process of the random private key, a pair of randomly generated key pairs are specifically obtained from the storage system of the block node; the randomly generated key pair includes a random private key and a random public key; accordingly, after the transaction data is encrypted using the random private key to obtain the transaction data ciphertext, it also includes: encrypting the random public key using the supervision private key fed back by the supervision system, and writing the encrypted random public key into the account book; or, receiving a pair of randomly generated key pairs written by the supervision system through the sixth smart contract interface; the randomly generated key pair includes a random private key and a random public key encrypted by a regulated private key; writing the encrypted random public key into the account book; or, receiving a random private key written by the regulatory system through the sixth smart contract interface; wherein the random public key corresponding to the random private key is stored on the regulatory system; or, obtaining a pair of randomly generated key pairs written by an external program through the seventh smart contract interface; the randomly generated key pair includes a random private key and a random public key; accordingly, after encrypting the transaction data using the random private key to obtain the transaction data ciphertext, the method further includes: encrypting the random public key using the regulatory private key fed back by the regulatory system, and writing the encrypted random public key into the account book; The regulatory system is used to generate a random private key and a random public key; upload the random private key to the blockchain and save the random public key locally; use the random public key to decrypt the transaction data ciphertext, perform compliance detection on the decrypted transaction data, and upload the detection result to the blockchain through the fourth smart contract interface; The blockchain platform is also used to adjust the review status corresponding to the transaction data and the information to be published based on the detection results.
15. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the method for supervising blockchain transaction data as described in any one of claims 1 to 9.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for supervising blockchain transaction data as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Cross-chain transaction supervision method and device, equipment and storage medium
CN113206744A
Block chain data supervision method
CN114358763A