CN115664659A - Method, device, equipment and medium for supervising blockchain transaction data - Google Patents

Method, device, equipment and medium for supervising blockchain transaction data Download PDF

Info

Publication number
CN115664659A
CN115664659A CN202211340599.4A CN202211340599A CN115664659A CN 115664659 A CN115664659 A CN 115664659A CN 202211340599 A CN202211340599 A CN 202211340599A CN 115664659 A CN115664659 A CN 115664659A
Authority
CN
China
Prior art keywords
transaction data
random
intelligent contract
private key
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211340599.4A
Other languages
Chinese (zh)
Inventor
林群阳
张闯
谢志勇
李雪雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Inspur Smart Computing Technology Co Ltd
Original Assignee
Guangdong Inspur Smart Computing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Inspur Smart Computing Technology Co Ltd filed Critical Guangdong Inspur Smart Computing Technology Co Ltd
Priority to CN202211340599.4A priority Critical patent/CN115664659A/en
Publication of CN115664659A publication Critical patent/CN115664659A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application relates to the technical field of block chains, and discloses a block chain transaction data supervision method, device, equipment and medium, wherein a block chain platform for deploying an intelligent contract acquires a transaction data ciphertext based on a first intelligent contract interface; writing the identification of the transaction data, the transaction data cipher text, the auditing state of the transaction data and the random private key into an account book; acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be verified by using a random private key; returning the comparison result of the check data cipher text and the transaction data cipher text to the user or the block chain application; transmitting a transaction data ciphertext to a supervision system through a third intelligent contract interface, carrying out compliance detection on the decrypted transaction data by the supervision system, and chaining a detection result through a fourth intelligent contract interface; and adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result. The transaction data supervision with automation, high adaptability, high efficiency and low cost is realized by deploying intelligent contracts.

Description

Method, device, equipment and medium for supervising blockchain transaction data
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for monitoring blockchain transaction data.
Background
The block chain system has a distributed architecture different from a traditional information system, distributed nodes of the block chain system jointly maintain a data ledger, and each node stores a copy of the same data ledger, and the block chain system has the characteristics of decentralization, distribution, transparent data disclosure, no tampering, traceability and the like. Unlike conventional systems that rely on centralized authority to trust endorsements. In the blockchain, the transaction data realizes trust endorsement by means of a cryptographic algorithm and a consensus mechanism, so that the transaction data has high credibility. Meanwhile, due to the special storage mode of the block data, the transaction data on the block chain is also stored permanently in theory. Based on these features, the block chain is increasingly widely used.
However, just as things are two-sided, persistent storage and non-tamper-able characteristics of blockchain transaction data, they are also easily utilized by malicious attackers, becoming a medium for distributing and propagating harmful information. Just like road traffic, in order to have smooth road traffic, good supervision is required in addition to traffic regulations. Similarly, the orderly supervision of the blockchain transaction data is beneficial to the healthy development of blockchain business.
The current block chain transaction data supervision technology comprises a harmful information controlled rollback technology, a block chain editable technology and a hierarchical and cooperative linkage supervision technology. The controlled rollback technology is that when a hacker attacks and causes serious consequences to a blockchain system or data, a blockchain system manager can roll back the ledger data to the front of a harmful transaction event. However, this process also brings some disadvantages, which may result in some normal transaction data being cleared together, and easily cause transaction divergence.
The blockchain editable technology has various methods for modifying transaction data, such as a chameleon hash function-based data modification method in a single chain mode, a parallel chain mode data modification method, and the like, and these methods have some special requirements or limitations on how a blockchain system constructs a data structure of an account book, so that the universality and the adaptability are poor.
The hierarchical and cooperative linkage supervision technology can be divided into an application program end, a block chain link point and a supervision center in a block chain system according to the functions and the deployment positions of entities; the shielding function of the harmful data can be added to each functional entity according to the requirement, and the processing such as data detection, harmful data shielding and the like can be carried out at the corresponding position. In the supervision mode, a supervision function module is introduced into the blockchain system, some customization and modification need to be performed on the blockchain system, and meanwhile, the supervision module can be adapted to a blockchain data protocol and the like, so that some extra development work is brought.
Therefore, how to realize the automatic, high-adaptability, high-efficiency and low-cost transaction data supervision is a problem to be solved by the technical personnel in the field.
Disclosure of Invention
The embodiment of the application aims to provide a block chain transaction data supervision method, a block chain transaction data supervision device, block chain transaction data supervision equipment and a computer readable storage medium, and the block chain transaction data supervision device, the block chain transaction data supervision device and the block chain transaction data supervision equipment can achieve automatic, high-adaptability, high-efficiency and low-cost transaction data supervision.
In order to solve the above technical problem, an embodiment of the present application provides a method for supervising blockchain transaction data, which is suitable for a blockchain platform for deploying an intelligent contract, and the method includes:
acquiring a transaction data ciphertext based on a first intelligent contract interface; the transaction data ciphertext is obtained by encrypting transaction data by using a random private key; writing the identification of the transaction data, the transaction data cipher text, the auditing state of the transaction data and the random private key into an account book;
acquiring data to be checked based on a second intelligent contract interface; encrypting the data to be checked by using the random private key to obtain a data cipher text to be checked; comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal;
transmitting the transaction data ciphertext to a supervisory system through a third intelligent contract interface so that the supervisory system can decrypt the transaction data ciphertext by using a random public key, perform compliance detection on the decrypted transaction data, and upload a detection result to a block chain through a fourth intelligent contract interface;
and adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
Optionally, the adjusting the audit state corresponding to the transaction data and the information to be published according to the detection result includes:
when the detection result is that the transaction data is in compliance, adjusting an audit state corresponding to the transaction data to be an audit passing state, and writing the decrypted random public key into the account book through the fourth intelligent contract interface;
and under the condition that the detection result is that the transaction data is not in compliance, adjusting an auditing state corresponding to the transaction data to be an auditing failed state, and writing a non-compliance specification into the ledger through the fourth intelligent contract interface.
Optionally, after the writing the identification of the transaction data, the transaction data ciphertext, the audit state of the transaction data, and the random private key into an account book, the method further includes:
feeding back, by the first intelligent contract interface, an identification of the transaction data to a blockchain application that transmitted the transaction data.
Optionally, after the adjusting the audit state corresponding to the transaction data and the information to be published according to the detection result, the method further includes:
under the condition that a target identifier transmitted by the block chain application through a fifth intelligent contract interface is received, judging whether an auditing state corresponding to the target identifier is an auditing passing state or not;
under the condition that the auditing state corresponding to the target identifier is an auditing passing state, acquiring a target transaction data ciphertext matched with the target identifier and a decrypted target random public key from the account book; decrypting the target transaction data ciphertext by using the target random public key to obtain a target transaction data plaintext; feeding back the target transaction data plaintext to the blockchain application through the fifth intelligent contract interface;
and under the condition that the auditing state corresponding to the target identifier is an auditing failing state or an auditing failing state, applying feedback data to the block chain through the fifth intelligent contract interface to obtain failed prompt information.
Optionally, after the adjusting the audit state corresponding to the transaction data and the information to be published according to the detection result, the method further includes:
under the condition that a target identifier transmitted by the block chain application through a fifth intelligent contract interface is received, judging whether the block chain application has an access authority and a corresponding authority range;
under the condition that the block chain application has the access right, the step of judging whether the auditing state corresponding to the target identification is an auditing passing state is executed;
correspondingly, the plaintext feedback of the target transaction data to the blockchain application through the fifth intelligent contract interface comprises:
and extracting the transaction data plaintext matched with the authority range from the target transaction data plaintext, and feeding back the transaction data plaintext matched with the authority range to the block chain application through the fifth intelligent contract interface.
Optionally, for the obtaining process of the random private key, the method includes:
acquiring a pair of randomly generated keys from a storage system of the block node; the randomly generated key pair comprises a random private key and a random public key;
correspondingly, after the transaction data is encrypted by using the random private key to obtain a transaction data ciphertext, the method further comprises the following steps:
and encrypting the random public key by using a supervision private key fed back by a supervision system, and writing the encrypted random public key into the account book.
Optionally, for the obtaining process of the random private key, the method includes:
receiving a pair of randomly generated keys written by the monitoring system through a sixth intelligent contract interface; the randomly generated key pair comprises a random private key and a random public key encrypted by a supervision private key; and writing the encrypted random public key into the account book.
Optionally, for the obtaining process of the random private key, the method includes:
receiving a random private key written by the monitoring system through a sixth intelligent contract interface; and a random public key corresponding to the random private key is stored on the supervision system.
Optionally, for the obtaining process of the random private key, the method includes:
acquiring a pair of randomly generated keys written by an external program through a seventh intelligent contract interface; the randomly generated key pair comprises a random private key and a random public key;
correspondingly, after the transaction data is encrypted by using the random private key to obtain a transaction data ciphertext, the method further comprises the following steps:
and encrypting the random public key by using a supervision private key fed back by a supervision system, and writing the encrypted random public key into the account book.
Optionally, the encrypting the transaction data by using the random private key to obtain the transaction data ciphertext includes:
and encrypting the content of the pre-protection field in the transaction data by using the random private key to obtain a transaction data ciphertext.
Optionally, the number of the random private keys is multiple; the encrypting the transaction data by using the random private key to obtain the transaction data ciphertext comprises:
and encrypting the transaction data according to the random private keys corresponding to the fields to obtain a transaction data ciphertext.
Optionally, the encrypting the transaction data by using the random private key to obtain the transaction data ciphertext includes:
and encrypting the contents of all fields in the transaction data by using the random private key to obtain a transaction data ciphertext.
Optionally, the obtaining of the transaction data ciphertext based on the first intelligent contract interface includes:
receiving a transaction data ciphertext transmitted by the blockchain application through the first intelligent contract interface; the transaction data ciphertext is obtained by the blockchain application through an initial intelligent contract interface; and encrypting the transaction data by using the random private key.
The embodiment of the application also provides a block chain transaction data supervision device, which is suitable for a block chain platform for deploying intelligent contracts, and comprises 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 for acquiring a transaction data ciphertext based on a first intelligent contract interface; the transaction data ciphertext is obtained by encrypting transaction data by using a random private key;
the writing unit is used for writing the identification of the transaction data, the transaction data ciphertext, the auditing state of the transaction data and the random private key into an account book;
the second obtaining unit is used for obtaining the data to be verified based on a second intelligent contract interface;
the encryption unit is used for encrypting the data to be verified by using the random private key to obtain a data ciphertext to be verified; comparing the data cipher text to be checked with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal;
the transmission unit is used for transmitting the transaction data ciphertext to a supervisory system through a third intelligent contract interface so that the supervisory system can decrypt the transaction data ciphertext by using a random public key, perform compliance detection on the decrypted transaction data, and upload a detection result to a block chain through a fourth intelligent contract interface;
and the adjusting unit is used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
Optionally, the adjusting unit is configured to, when the detection result is that the transaction data is compliant, adjust an audit state corresponding to the transaction data to be an audit-passed state, and write the decrypted random public key into the account book through the fourth intelligent contract interface;
and under the condition that the detection result is that the transaction data is not in compliance, adjusting an auditing state corresponding to the transaction data to be an auditing failed state, and writing a non-compliance specification into the ledger through the fourth intelligent contract interface.
Optionally, an identification feedback unit is further included;
the identification feedback unit is used for feeding back the identification of the transaction data to the blockchain application transmitting the transaction data through the first intelligent contract interface.
Optionally, after the audit state corresponding to the transaction data and the information to be published are adjusted according to the detection result, a first judging unit, a third obtaining unit, a decrypting unit, a data feedback unit and a prompt feedback unit are further included;
the first judging unit is configured to judge whether an audit state corresponding to the target identifier is an audit-passed state under the condition that the target identifier transmitted by the block chain application through a fifth intelligent contract interface is received;
the third obtaining unit is configured to obtain, from the account book, a target transaction data ciphertext matched with the target identifier and a decrypted target random public key when the audit state corresponding to the target identifier is an audit pass state;
the decryption unit is used for decrypting the target transaction data ciphertext by using the target random public key to obtain a target transaction data plaintext;
the data feedback unit is used for feeding back the target transaction data plaintext to the blockchain application through the fifth intelligent contract interface;
and the prompt feedback unit is configured to apply feedback data to the block chain through the fifth intelligent contract interface to obtain failed prompt information when the audit state corresponding to the target identifier is an audit failed state or an audit not passed state.
Optionally, a second judging unit is further included;
the second judging unit is configured to judge whether the blockchain application has an access right and a corresponding right range when receiving a target identifier transmitted by the blockchain application through a fifth intelligent contract interface; under the condition that the block chain application has the access right, triggering the first judging unit to execute the step of judging whether the auditing state corresponding to the target identification is the auditing passing state;
correspondingly, the data feedback unit is used for extracting the transaction data plaintext matched with the authority range from the target transaction data plaintext, and feeding back the transaction data plaintext matched with the authority range to the block chain application through the fifth intelligent contract interface.
Optionally, for the acquiring process of the random private key, the apparatus further includes a first key acquiring unit;
the key acquisition unit is used for acquiring a pair of randomly generated key pairs from a storage system of the block node; the randomly generated key pair comprises a random private key and a random public key;
correspondingly, the writing unit is further configured to encrypt the random public key by using a supervision private key fed back by the supervision system, and write the encrypted random public key into the account book.
Optionally, for the acquiring process of the random private key, the apparatus further includes a first receiving unit;
the first receiving unit is used for receiving a pair of randomly generated key pairs written by the monitoring system through a sixth intelligent contract interface; the randomly generated key pair comprises a random private key and a random public key encrypted by a supervision private key;
correspondingly, the writing unit is further configured to write the encrypted random public key into the ledger.
Optionally, for the acquiring process of the random private key, the apparatus further includes a second receiving unit;
the second receiving unit is used for receiving a random private key written by the monitoring system through a sixth intelligent contract interface; and a random public key corresponding to the random private key is stored on the supervision system.
Optionally, for the acquiring process of the random private key, the apparatus further includes a second key acquiring unit;
the second key acquisition unit is used for acquiring a pair of randomly generated keys written by an external program through a seventh intelligent contract interface; the randomly generated key pair comprises a random private key and a random public key;
correspondingly, the writing unit is further configured to encrypt the random public key by using a supervision private key fed back by the supervision system, and write the encrypted random public key into the account book.
Optionally, the first obtaining unit is configured to encrypt, by using the random private key, content of a pre-protection field in the transaction data to obtain a transaction data ciphertext.
Optionally, the first obtaining unit is configured to encrypt the transaction data according to a random private key corresponding to each field to obtain a transaction data ciphertext.
Optionally, the first obtaining unit is configured to encrypt contents of all fields in the transaction data by using the random private key to obtain a transaction data ciphertext.
Optionally, the first obtaining unit is configured to receive a transaction data ciphertext transmitted by a blockchain application through the first intelligent contract interface; the transaction data ciphertext is obtained by the blockchain application through an initial intelligent contract interface; and encrypting the transaction data by using the random private key.
The embodiment of the application also provides a block chain transaction data monitoring system, which comprises a block chain application, a block chain platform for deploying intelligent contracts and a monitoring system;
the block chain application is used for calling a first intelligent contract interface to transmit transaction data to an account book of a block chain;
the block chain platform is used for acquiring the transaction data; encrypting the transaction data by using a random private key to obtain a transaction data ciphertext; writing the identification of the transaction data, the transaction data cipher text, the auditing state of the transaction data, the random private key and a random public key encrypted by a supervision private key into an account book; acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be checked by using the random private key to obtain a data cipher text to be checked, comparing the data cipher text to be checked with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal; transmitting the transaction data ciphertext to a monitoring system through a third intelligent contract interface;
the supervision system is used for decrypting the encrypted random public key by using the supervision public key, decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to the block chain through a fourth intelligent contract interface;
and the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
The embodiment of the application also provides a block chain transaction data monitoring system, which comprises a block chain application, a block chain platform for deploying intelligent contracts and a monitoring system;
the block chain application is used for acquiring a random private key through an initial intelligent contract interface; encrypting the transaction data by using the random private key to obtain a transaction data ciphertext; calling a first intelligent contract interface to transmit the transaction data ciphertext to an account book of the block chain;
the block chain platform is used for acquiring the transaction data ciphertext; writing the identification of the transaction data, the transaction data cipher text, the audit state of the transaction data, the random private key and a random public key encrypted by a supervision private key into an account book; acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be verified by using the random private key to obtain a data ciphertext to be verified; comparing the data cipher text to be checked with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal; transmitting the transaction data ciphertext to a monitoring system through a third intelligent contract interface;
the supervision system is used for decrypting the encrypted random public key by using a supervision public key, decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to a block chain through a fourth intelligent contract interface;
and the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
The embodiment of the application also provides a block chain transaction data supervision system, which comprises a block chain application, a block chain platform for deploying intelligent contracts and a supervision system;
the blockchain application is used for calling a first intelligent contract interface to transmit transaction data to an account book of the blockchain;
the block chain platform is used for acquiring a random private key through an initial intelligent contract interface; encrypting the transaction data by using the random private key to obtain a transaction data ciphertext; writing the identification of the transaction data, the transaction data ciphertext, the audit state of the transaction data and the random private key into an account book, and marking the audit state of the transaction data ciphertext as not audited; acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be verified by using the random private key to obtain a data ciphertext to be verified; comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal; transmitting the transaction data ciphertext to a supervisory system through a third intelligent contract interface;
the supervision system is used for generating a random private key and a random public key; chaining the random private key and locally storing the random public key; decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to a block chain through a fourth intelligent contract interface;
and the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
The embodiment of the application also provides a block chain transaction data supervision system, which comprises a block chain application, a block chain platform for deploying intelligent contracts and a supervision system;
the block chain application is used for acquiring a random private key through an initial intelligent contract interface; encrypting the transaction data by using the random private key to obtain a transaction data ciphertext; calling a first intelligent contract interface to transmit the transaction data ciphertext to an account book of the block chain;
the block chain platform is used for acquiring the transaction data ciphertext; writing the identification of the transaction data, the transaction data ciphertext, the audit state of the transaction data and the random private key into an account book, and marking the audit state of the transaction data ciphertext as not audited; acquiring data to be checked based on a second intelligent contract interface; encrypting the data to be verified by using the random private key to obtain a data ciphertext to be verified; comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal; transmitting the transaction data ciphertext to a supervisory system through a third intelligent contract interface;
the supervision system is used for generating a random private key and a random public key; chaining the random private key and locally storing the random public key; decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to a block chain through a fourth intelligent contract interface;
and the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
An embodiment of the present application further provides an electronic device, including:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the method for supervising blockchain transaction data as described above.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the above method for supervising blockchain transaction data.
According to the technical scheme, the block chain platform for deploying the intelligent contract obtains the transaction data ciphertext based on the first intelligent contract interface; the transaction data ciphertext is obtained by encrypting the transaction data by using a random private key; writing the identification of the transaction data, the transaction data ciphertext, the auditing state of the transaction data and the random private key into an account book; acquiring data to be checked based on a second intelligent contract interface; encrypting the data to be verified by using a random private key to obtain a data ciphertext to be verified; and comparing the data cipher text to be checked with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal. Transmitting the transaction data ciphertext to the supervisory system through a third intelligent contract interface so that the supervisory system can decrypt the transaction data ciphertext by using a random public key, perform compliance detection on the decrypted transaction data, and upload a detection result to the block chain through a fourth intelligent contract interface; and adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result. In the technical scheme, the automatic supervision of the transaction data can be realized through deploying the intelligent contract and the interface corresponding to the intelligent contract, and the supervision mode is transparent and efficient. The intelligent contract is only deployed on the blockchain without any modification to the blockchain implementation, so that the method can be adapted to any blockchain system and has no additional development cost. Meanwhile, uplink transaction data are only stored once in the account book, and the storage overhead of uplink data caused by supervision is reduced. The transaction data supervision with automation, high adaptability, high efficiency and low cost is realized.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for supervising blockchain transaction data according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a device for supervising blockchain transaction data according to an embodiment of the present disclosure;
fig. 3 is a block chain transaction data monitoring system according to an embodiment of the present disclosure;
fig. 4 is another block chain transaction data monitoring system provided in an embodiment of the present application;
fig. 5 is a structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The terms "including" and "having," and any variations thereof in the description and claims of this application and the above-described drawings, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may include other steps or elements not expressly listed.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
Next, a method for supervising blockchain transaction data provided by the embodiment of the present application is described in detail. Fig. 1 is a flowchart of a method for supervising blockchain transaction data according to an embodiment of the present application, where the method is applied to a blockchain platform for deploying an intelligent contract, and the method includes:
s101: and acquiring a transaction data ciphertext based on the first intelligent contract interface.
In the embodiment of the application, the transaction data is encrypted by adopting an asymmetric encryption mode. In order to improve the security of the asymmetric encryption mode, a random public key and a random private key can be obtained by adopting a random generation mode. The transaction data ciphertext is obtained by encrypting the transaction data by using a random private key.
The intelligent contract is used on the blockchain in the following process: multiple users participate in making a contract together, and the contract programming language is used for writing an intelligent contract code; the intelligent contract code is compiled and examined, and the participator signs the examined contract code by using a private key so as to ensure the validity of the contract. And the signed intelligent contract is transmitted into a block chain network, and the intelligent contract is diffused through a point-to-point network and stored into distributed nodes of the block chain. After the intelligent contract is issued on the blockchain, the intelligent contract is not automatically executed, and a blockchain application program is often required to call the intelligent contract, execute contract terms through the intelligent contract and interact with the ledger data.
The blockchain application can be varied in terms of the functions that need to be implemented. In the embodiment of the present application, different intelligent contract interfaces may be set for implementing different blockchain applications.
In an embodiment of the present application, the blockchain application may invoke the first intelligent contract interface to transmit the transaction data to the blockchain platform. The blockchain platform can encrypt the transaction data according to the obtained random private key to obtain a transaction data ciphertext.
In addition, the blockchain application can also obtain a random private key from an account book of the blockchain platform through the initial intelligent contract interface, encrypt transaction data by using the random private key, and call the first intelligent contract interface to transmit a transaction data ciphertext to the blockchain platform.
In the embodiment of the present application, there may be multiple ways to obtain the random private key.
The first way may be to obtain a pair of randomly generated keys 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 supervision private key fed back by the supervision system can be used for encrypting the random public key, and the encrypted random public key is written into the account book.
The second mode can receive a pair of randomly generated keys written by the monitoring system through the sixth intelligent contract interface; the randomly generated key pair comprises a random private key and a random public key encrypted by the supervision private key; and writing the encrypted random public key into the account book.
The third mode can receive a random private key written by the monitoring system through a sixth intelligent contract interface; and the random public key corresponding to the random private key is stored on the monitoring system.
The fourth mode can acquire a pair of randomly generated keys written by an external program through a seventh intelligent 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 supervision private key fed back by the supervision system can be used for encrypting the random public key, and the encrypted random public key is written into the account book.
After the random private key is obtained, the transaction data can be encrypted by using the random private key. The encryption mode of the transaction data can be various, and the first mode can utilize a random private key to encrypt the content of the pre-protection field in the transaction data to obtain a transaction data ciphertext. The pre-protected field may be a field in which sensitive information or information that needs to be kept secret in the transaction data is located. In a second way, a plurality of random private keys can be set; and encrypting the transaction data according to the random private keys corresponding to the fields to obtain a transaction data ciphertext. The third mode can encrypt the complete transaction data, namely, the random private key is used for encrypting the contents of all fields in the transaction data to obtain a transaction data ciphertext.
S102: and writing the identification of the transaction data, the transaction data ciphertext, the auditing state of the transaction data and the random private key into the account book.
In order to distinguish between different transaction data, a unique identifier may be set for each transaction data. After the block chain platform acquires the transaction data ciphertext, the identification of the transaction data, the transaction data ciphertext, the auditing state of the transaction data and the random private key can be written into the account book. In the initial state, the transaction data is not checked in the checking state.
S103: acquiring data to be verified based on a second intelligent contract interface; and encrypting the data to be verified by using the random private key to obtain a data ciphertext to be verified.
The blockchain application can call the second intelligent contract interface to submit the data to be verified and the corresponding identification thereof to the blockchain for verification. And the processing program of the second intelligent contract interface firstly acquires the transaction data ciphertext linked through the first intelligent contract interface and the random private key thereof from the account book, secondly encrypts the submitted data to be verified by using the random private key, secondly compares the data ciphertext to be verified with the transaction data ciphertext, and returns the comparison result to the block chain application or the user terminal.
S104: and transmitting the transaction data ciphertext to the monitoring system through the third intelligent contract interface so that the monitoring system can decrypt the transaction data ciphertext by using the random public key, perform compliance detection on the decrypted transaction data, and upload the detection result to the block chain through the fourth intelligent contract interface.
In practical application, the blockchain platform may transmit the transaction data ciphertext to the supervisory system through the third intelligent contract interface, or the supervisory system may call the third intelligent contract interface to obtain data in an unverified state from the blockchain, where the data may include an identifier of the transaction data, the transaction data ciphertext, the random private key, the encrypted random public key, and the verified state.
In order to distinguish the other key pairs, in the embodiment of the present application, the key pair of the supervisory system itself is named as a supervisory public key and a supervisory private key.
Taking the example of encrypting the random public key by using the supervision private key, after the supervision system acquires the data to be audited, firstly, decrypting the encrypted random public key by using the supervision public key of the supervision system to acquire a decrypted random public key; the supervision public key and the supervision private key are a pair of asymmetric encryption keys. Secondly, decrypting the transaction data ciphertext by using the decrypted random public key to obtain a transaction data plaintext; thirdly, detecting the compliance of the transaction data by using a data detection algorithm; and finally, submitting the detection result to a block chain through a fourth intelligent contract interface.
In consideration of the practical application, the random key pair can also be generated by the supervisory system, and correspondingly, the supervisory system can uplink the random private key so that the blockchain platform can encrypt the transaction data by using the random private key. The supervisory system may locally maintain the random public key. After the monitoring system acquires the data to be audited, the transaction data ciphertext can be decrypted by directly using the locally stored random public key to obtain the transaction data plaintext; then, detecting the compliance of the transaction data by using a data detection algorithm; and finally, submitting the detection result to a block chain through a fourth intelligent contract interface.
Different transaction data types need to be audited, and different data detection algorithms can be used correspondingly. The data detection algorithm may be a matching algorithm or an artificial intelligence algorithm, etc. The detection of compliance with transaction data using a data detection algorithm is a conventional technique and is not described herein.
In S103, a block chain platform is introduced to compare consistency of a to-be-checked data cipher text with a transaction data cipher text, and in addition, a block chain application may also call a third intelligent contract interface to obtain some unchecked data from the block chain, and the block chain application verifies the consistency of the data by itself, that is, encrypt the to-be-checked data through a random private key, then compare the encrypted data with the transaction data cipher text, and check whether a result is consistent.
S105: and adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
The detection result may include both a case of transaction data compliance and a case of transaction data non-compliance.
And under the condition that the detection result is that the transaction data is in compliance, adjusting the auditing state corresponding to the transaction data to be an auditing passing state. And the block chain platform can write the decrypted random public key into the account book through the fourth intelligent contract interface under the condition of the compliance of the transaction data. When some blockchain application needs to call the transaction data, the blockchain platform can decrypt the transaction data ciphertext through the random public key so as to obtain the transaction data of the plaintext, and then the transaction data of the plaintext is fed back to the blockchain application.
And under the condition that the detection result is that the transaction data is not in compliance, adjusting the auditing state corresponding to the transaction data to be an auditing failure state, and writing the non-compliance description into the account book through a fourth intelligent contract interface.
The non-compliance description can write out which data are not compliant, or cause the non-compliance, so that users of the blockchain can more clearly know the transaction data are not compliant.
According to the technical scheme, the block chain platform for deploying the intelligent contract acquires the transaction data ciphertext based on the first intelligent contract interface; the transaction data ciphertext is obtained by encrypting the transaction data by using a random private key; writing the identification of the transaction data, the transaction data cipher text, the auditing state of the transaction data and the random private key into an account book; acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be verified by using a random private key to obtain a data ciphertext to be verified; and comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal. Transmitting the transaction data ciphertext to the monitoring system through the third intelligent contract interface so that the monitoring system can decrypt the transaction data ciphertext by using the random public key, perform compliance detection on the decrypted transaction data, and upload a detection result to the block chain through the fourth intelligent contract interface; and adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result. In the technical scheme, the automatic supervision of the transaction data can be realized through the corresponding interface of the intelligent contract by deploying the intelligent contract, and the supervision mode is transparent and efficient. The intelligent contract is only deployed on the blockchain without any modification to the blockchain implementation, so that the method can be adapted to any blockchain system and has no additional development cost. Meanwhile, the uplink transaction data is only stored once in the account book, so that the storage overhead of uplink data caused by supervision is reduced. The transaction data supervision with automation, high adaptability, high efficiency and low cost is realized.
The blockchain platform can set respective corresponding identifications for different transaction data, and after the identifications of the transaction data, the transaction data ciphertext, the auditing state of the transaction data and the random private key are written into the account book, the blockchain platform can feed back the identifications of the transaction data to blockchain application transmitting the transaction data through the first intelligent contract interface, so that the blockchain application can obtain the corresponding transaction data based on the identifications.
The above description is developed around an auditing process of transaction data, and after auditing of transaction data is completed, a blockchain application can acquire transaction data from a blockchain platform.
In a specific implementation, the blockchain application may transmit the target identifier to the blockchain platform through a fifth intelligent contract interface. And the block chain platform can judge whether the auditing state corresponding to the target identifier is the auditing passing state or not under the condition of receiving the target identifier transmitted by the block chain application through the fifth intelligent contract interface.
Each transaction data has an identifier and a random public key corresponding to the transaction data, and in the embodiment of the present application, the transaction data ciphertext corresponding to the target identifier is referred to as a target transaction data ciphertext, and the random public key corresponding to the target transaction data ciphertext is referred to as a target random public key, for convenience of distinguishing.
Under the condition that the audit state corresponding to the target identification is an audit passing state, acquiring a target transaction data ciphertext matched with the target identification and a decrypted target random public key from the account book; decrypting the target transaction data ciphertext by using the target random public key to obtain a target transaction data plaintext; and feeding back the target transaction data plaintext to the blockchain application through a fifth intelligent contract interface.
When the auditing state corresponding to the target identifier is an auditing failure state or an auditing failure state, the plaintext of the target transaction data cannot be acquired, and the blockchain platform can apply feedback data to the blockchain through the fifth intelligent contract interface to acquire failure prompt information.
In consideration of practical application, the different block chain applications have different rights. And under the condition that the block chain platform receives the target identifier transmitted by the block chain application through the fifth intelligent contract interface, judging whether the block chain application has the access authority and the corresponding authority range.
And under the condition that the block chain application has the access right, executing a step of judging whether the auditing state corresponding to the target identification is an auditing passing state. Under the condition that the audit state corresponding to the target identifier is the audit passing state, the block chain platform can extract the transaction data plaintext matched with the authority range from the target transaction data plaintext and feed the transaction data plaintext matched with the authority range back to the block chain application through the fifth intelligent contract interface.
By setting the authority, the safety of the transaction data can be improved, and the risk of the transaction data being leaked is avoided.
It should be noted that the first intelligent contract interface, the second intelligent contract interface, the third intelligent contract interface, the fourth intelligent contract interface, the fifth intelligent contract interface, the sixth intelligent contract interface, and the seventh intelligent contract interface mentioned above may be mutually independent contract interfaces, and each contract interface is used to execute a different function. The above-mentioned intelligent contract interfaces may also be a unified interface, and different functions may be distinguished by setting different identifiers. The first, second, third, fourth, fifth, sixth and seventh terms are only used for distinguishing different functions, and do not limit the arrangement order of the intelligent contract interfaces.
Fig. 2 is a schematic structural diagram of a device for supervising blockchain transaction data according to an embodiment of the present application, which is suitable for a blockchain platform for deploying an intelligent contract, and includes a first obtaining unit 21, a writing unit 22, a second obtaining unit 23, an encryption unit 24, a transmission unit 25, and an adjustment unit 26;
a first obtaining unit 21, configured to obtain a transaction data ciphertext based on a first intelligent contract interface; the transaction data ciphertext is obtained by encrypting the transaction data by using a random private key;
the writing unit 22 is configured to write the identifier of the transaction data, the transaction data ciphertext, the audit state of the transaction data, and the random private key into the account book;
a second obtaining unit 23, configured to obtain data to be verified based on a second intelligent contract interface;
the encryption unit 24 is configured to encrypt the data to be verified by using a random private key to obtain a ciphertext of the data to be verified; comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal;
the transmission unit 25 is configured to transmit the transaction data ciphertext to the monitoring system through the third intelligent contract interface, so that the monitoring system decrypts the transaction data ciphertext by using the random public key, performs compliance detection on the decrypted transaction data, and uploads a detection result to the block chain through the fourth intelligent contract interface;
and the adjusting unit 26 is configured to adjust the audit state corresponding to the transaction data and the information to be published according to the detection result.
Optionally, the adjusting unit is configured to, when the detection result is that the transaction data is compliant, adjust an audit state corresponding to the transaction data to an audit-passed state, and write the decrypted random public key into the account book through the fourth intelligent contract interface;
and under the condition that the detection result is that the transaction data is not in compliance, adjusting the auditing state corresponding to the transaction data to be an auditing failure state, and writing the non-compliance description into the account book through a fourth intelligent contract interface.
Optionally, an identification feedback unit is further included;
and the identification feedback unit is used for feeding back the identification of the transaction data to the blockchain application transmitting the transaction data through the first intelligent contract interface.
Optionally, after the audit state corresponding to the transaction data and the information to be published are adjusted according to the detection result, the system further comprises a first judging unit, a third obtaining unit, a decryption unit, a data feedback unit and a prompt feedback unit;
the first judging unit is used for judging whether the auditing state corresponding to the target identifier is an auditing passing state or not under the condition that the target identifier transmitted by the block chain application through the fifth intelligent contract interface is received;
the third obtaining unit is used for obtaining a target transaction data ciphertext matched with the target identifier and a decrypted target random public key from the account book under the condition that the audit state corresponding to the target identifier is an audit passing state;
the decryption unit is used for decrypting the target transaction data ciphertext by using the target random public key to obtain a target transaction data plaintext;
the data feedback unit is used for feeding back a target transaction data plaintext to the block chain application through a fifth intelligent contract interface;
and the prompt feedback unit is used for applying feedback data to the block chain through a fifth intelligent contract interface to obtain failed prompt information under the condition that the auditing state corresponding to the target identifier is an auditing failure state or an auditing failure state.
Optionally, a second judging unit is further included;
the second judgment unit is used for judging whether the block chain application has the access authority and the corresponding authority range under the condition that the target identifier transmitted by the block chain application through the fifth intelligent contract interface is received; under the condition that the block chain application has the access right, triggering a first judging unit to execute a step of judging whether the auditing state corresponding to the target identification is an auditing passing state;
correspondingly, the data feedback unit is used for extracting the transaction data plaintext matched with the authority range from the target transaction data plaintext, and feeding back the transaction data plaintext matched with the authority range to the block chain application through the fifth intelligent contract interface.
Optionally, for the acquiring process of the random private key, the apparatus further includes a first key acquiring unit;
a key acquisition unit configured to acquire a pair of randomly generated keys from a storage system of the block node; the randomly generated key pair comprises a random private key and a random public key;
correspondingly, the writing unit is also used for encrypting the random public key by using the supervision private key fed back by the supervision system and writing the encrypted random public key into the account book.
Optionally, for the obtaining process of the random private key, the apparatus further includes a first receiving unit;
a first receiving unit, configured to receive a pair of randomly generated key pairs written by the monitoring system through the sixth smart contract interface; the randomly generated key pair comprises a random private key and a random public key encrypted by the supervision private key;
correspondingly, the writing unit is further configured to write the encrypted random public key into the ledger.
Optionally, for the acquiring process of the random private key, the apparatus further includes a second receiving unit;
the second receiving unit is used for receiving a random private key written by the monitoring system through a sixth intelligent contract interface; and the random public key corresponding to the random private key is stored on the monitoring system.
Optionally, for the acquiring process of the random private key, the apparatus further includes a second key acquiring unit;
a second key acquisition unit configured to acquire, through a seventh smart contract interface, a pair of randomly generated key pairs written by an external program; the randomly generated key pair comprises a random private key and a random public key;
correspondingly, the writing unit is also used for encrypting the random public key by using the supervision private key fed back by the supervision system and writing the encrypted random public key into the account book.
Optionally, the first obtaining unit is configured to encrypt the content of the pre-protection field in the transaction data by using a random private key to obtain a transaction data ciphertext.
Optionally, the first obtaining unit is configured to encrypt the transaction data according to a random private key corresponding to each field to obtain a transaction data ciphertext.
Optionally, the first obtaining unit is configured to encrypt contents of all fields in the transaction data by using a random private key to obtain a transaction data ciphertext.
Optionally, the first obtaining unit is configured to receive a transaction data ciphertext transmitted by the blockchain application through the first intelligent contract interface; the transaction data ciphertext is obtained from the random private key through an initial intelligent contract interface by the block chain application; and encrypting the transaction data by using a random private key.
The description of the features in the embodiment corresponding to fig. 2 may refer to the related description of the embodiment corresponding to fig. 1, and is not repeated here.
According to the technical scheme, the block chain platform for deploying the intelligent contract acquires the transaction data ciphertext based on the first intelligent contract interface; the transaction data ciphertext is obtained by encrypting the transaction data by using a random private key; writing the identification of the transaction data, the transaction data cipher text, the auditing state of the transaction data and the random private key into an account book; acquiring data to be checked based on a second intelligent contract interface; encrypting the data to be verified by using a random private key to obtain a data ciphertext to be verified; and comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal. Transmitting the transaction data ciphertext to the monitoring system through the third intelligent contract interface so that the monitoring system can decrypt the transaction data ciphertext by using the random public key, perform compliance detection on the decrypted transaction data, and upload a detection result to the block chain through the fourth intelligent contract interface; and adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result. In the technical scheme, the automatic supervision of the transaction data can be realized through deploying the intelligent contract and the interface corresponding to the intelligent contract, and the supervision mode is transparent and efficient. The intelligent contract only needs to be deployed on the blockchain without any modification on the blockchain implementation, so that the method can be adapted to any blockchain system and has no additional development cost. Meanwhile, uplink transaction data are only stored once in the account book, and the storage overhead of uplink data caused by supervision is reduced. The transaction data supervision with automation, high adaptability, high efficiency and low cost is realized.
Fig. 3 is a monitoring system for blockchain transaction data according to an embodiment of the present application, including a blockchain application, a blockchain platform for deploying an intelligent contract, and a monitoring system; the first to fifth intelligent contract interfaces are represented in fig. 3 by contract interfaces 1 to 5, respectively.
And the blockchain application is used for calling a first intelligent contract interface (contract interface 1) to execute transaction data uplink, namely transmitting the transaction data to the ledger of the blockchain.
The block chain platform is used for acquiring transaction data; encrypting the transaction data by using a random private key to obtain a transaction data ciphertext; and writing the identification of the transaction data, the transaction data ciphertext, the auditing state of the transaction data, the random private key and the random public key encrypted by the supervision private key into the account book. The blockchain application may transmit data to be verified for verifying the transaction data to the blockchain platform through a second intelligent 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, and after the blockchain platform acquires the data to be checked based on the contract interface 2, the blockchain platform can encrypt the data to be checked by using a random private key to obtain a ciphertext of the data to be checked. And the block chain platform compares the data cipher text to be verified with the transaction data cipher text and returns a comparison result to the block chain application or the user terminal. The blockchain platform can transmit the transaction data ciphertext to the supervision system through a third intelligent contract interface (contract interface 3). If the blockchain application needs to acquire the transaction data ciphertext, the blockchain platform can also transmit the transaction data ciphertext to the blockchain application through the contract interface 3.
And the supervision system is used for decrypting the encrypted random public key by using the supervision public key, decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to the block chain through a fourth intelligent contract interface (contract interface 4).
In a specific implementation, the blockchain platform may encrypt the random public key by using a supervision private key of the supervision system, and write the encrypted random public key into the account book. Therefore, after the supervision system acquires the transaction data ciphertext, the encrypted random public key can be decrypted by using the supervision public key, so that the transaction data ciphertext is decrypted by using the random public key to obtain the transaction data plaintext. The supervisory system can invoke a data detection algorithm to perform compliance detection on the transaction data plaintext.
And the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
The detection result may include a transaction data compliance or a transaction data non-compliance. The random public key may be disclosed for compliant transaction data, non-compliance may be noted for non-compliant transaction data, and the random public key is not disclosed.
When the blockchain application needs to acquire a transaction data plaintext, a corresponding target identifier may be transmitted to the blockchain application through a fifth intelligent contract interface (contract interface 5), and the blockchain platform may determine a corresponding random public key and a transaction data ciphertext based on the target identifier. And decrypting the transaction data ciphertext by using the random public key to obtain a transaction data plaintext, and feeding back the transaction data plaintext to the block chain application through the contract interface 5.
The encryption processing of the transaction data in fig. 3 may also be performed by a blockchain application, which may obtain the random private key through an initial intelligent contract interface; encrypting the transaction data by using a random private key to obtain a transaction data ciphertext; and calling the first intelligent contract interface to transmit the transaction data ciphertext to the ledger of the block chain.
In fig. 3, the random private key, the random public key, the supervision private key, and the supervision public key are used as an example to encrypt and decrypt data, in practical application, the supervision private key and the supervision public key may not be set, and the supervision system directly generates a random key pair (including the random private key and the random public key), and this implementation manner may be as shown in fig. 4.
Fig. 4 is another block chain transaction data monitoring system provided in an embodiment of the present application, including a block chain application, a block chain platform for deploying an intelligent contract, and a monitoring system; the first to fifth intelligent contract interfaces are represented in fig. 4 by contract interfaces 1 to 5, respectively. The initial intelligent contract interface is represented by contract interface 0.
And the block chain platform is used for acquiring the random private key through an initial intelligent contract interface (contract interface 0). Or the supervision system actively writes a random private key into the blockchain platform through a contract interface 0.
And the blockchain application is used for calling a first intelligent contract interface (contract interface 1) to execute transaction data uplink, namely transmitting the transaction data to the ledger of the blockchain.
The block chain platform encrypts the transaction data by using a random private key to obtain a transaction data ciphertext; and writing the identification of the transaction data, the transaction data ciphertext, the audit state of the transaction data and the random private key into an account book through a contract interface 1, and marking the audit state of the transaction data ciphertext as not audited.
The blockchain application may invoke a second intelligent contract interface (contract interface 2) to transmit to the blockchain platform data to be verified for verifying the transaction data.
After the block chain platform acquires the data to be checked through the contract interface 2, the random private key can be used for encrypting the data to be checked to obtain a data ciphertext to be checked; and comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal. And transmitting the transaction data ciphertext to the supervision system through a third intelligent contract interface (contract interface 3).
The supervision system is used for generating a random private key and a random public key; chaining the random private key and locally storing the random public key; and decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to the block chain through a fourth intelligent contract interface (contract interface 4).
And the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
The detection result may include a transaction data compliance or a transaction data non-compliance. The random public key may be disclosed for compliant transaction data, non-compliance may be noted for non-compliant transaction data, and the random public key is not disclosed.
When the blockchain application needs to acquire a transaction data plaintext, a corresponding target identifier may be transmitted to the blockchain application through a fifth intelligent contract interface (contract interface 5), and the blockchain platform may determine a corresponding random public key and a transaction data ciphertext based on the target identifier. And decrypting the transaction data ciphertext by using the random public key to obtain a transaction data plaintext, and feeding back the transaction data plaintext to the block chain application through the contract interface 5.
The encryption process of the transaction data in fig. 4 may also be performed by a blockchain application, which may obtain the random private key through an initial intelligent contract interface; encrypting the transaction data by using a random private key to obtain a transaction data ciphertext; and calling the first intelligent contract interface to transmit the transaction data ciphertext to the ledger of the block chain.
According to the technical scheme, the block chain platform for deploying the intelligent contract obtains the transaction data ciphertext based on the first intelligent contract interface; the transaction data ciphertext is obtained by encrypting the transaction data by using a random private key; writing the identification of the transaction data, the transaction data cipher text, the auditing state of the transaction data and the random private key into an account book; acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be verified by using a random private key to obtain a data ciphertext to be verified; and comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal. Transmitting the transaction data ciphertext to the monitoring system through the third intelligent contract interface so that the monitoring system can decrypt the transaction data ciphertext by using the random public key, perform compliance detection on the decrypted transaction data, and upload a detection result to the block chain through the fourth intelligent contract interface; and adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result. In the technical scheme, the automatic supervision of the transaction data can be realized through the corresponding interface of the intelligent contract by deploying the intelligent contract, and the supervision mode is transparent and efficient. The intelligent contract only needs to be deployed on the blockchain without any modification on the blockchain implementation, so that the method can be adapted to any blockchain system and has no additional development cost. Meanwhile, the uplink transaction data is only stored once in the account book, so that the storage overhead of uplink data caused by supervision is reduced. The transaction data supervision with automation, high adaptability, high efficiency and low cost is realized.
Fig. 5 is a structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 5, the electronic device includes: a memory 20 for storing a computer program; the processor 21 is configured to implement the steps of the block chain transaction data supervision method according to the above embodiment when executing the computer program.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state.
In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor for processing a calculation operation related to machine learning. The memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing the following computer program 201, wherein after being loaded and executed by the processor 21, the computer program can implement the relevant steps of the block chain transaction data supervision method disclosed in any of the foregoing embodiments.
In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 202 may include, among others, windows, unix, linux, and the like. Data 203 may include, but is not limited to, an identification of the transaction data, a cryptogram of the transaction data, an audit status of the transaction data, a random private key, and the like. In some embodiments, the electronic device may further include a display 22, an input/output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
Those skilled in the art will appreciate that the configuration shown in fig. 5 is not intended to be limiting of electronic devices and may include more or fewer components than those shown.
It is understood that, if the block chain transaction data monitoring method in the above embodiment is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be substantially or partially implemented in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods of the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), an electrically erasable programmable ROM, a register, a hard disk, a removable magnetic disk, a CD-ROM, a magnetic or optical disk, and other various media capable of storing program codes.
Based on this, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for supervising blockchain transaction data as described above.
A method, an apparatus, a device, and a computer-readable storage medium for supervising blockchain transaction data provided by embodiments of the present application are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
A method, an apparatus, a device and a computer-readable storage medium for managing blockchain transaction data provided by the present application are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, without departing from the principle of the present invention, it can make several improvements and modifications to the present application, and those improvements and modifications also fall into the protection scope of the claims of the present application.

Claims (20)

1. A method of supervising blockchain transaction data, adapted for use with a blockchain platform for deploying intelligent contracts, the method comprising:
acquiring a transaction data ciphertext based on a first intelligent contract interface; the transaction data ciphertext is obtained by encrypting the transaction data by using a random private key; writing the identification of the transaction data, the transaction data ciphertext, the audit state of the transaction data and the random private key into an account book;
acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be checked by using the random private key to obtain a data cipher text to be checked; comparing the data cipher text to be checked with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal;
transmitting the transaction data ciphertext to a supervision system through a third intelligent contract interface so that the supervision system can decrypt the transaction data ciphertext by using a random public key, perform compliance detection on the decrypted transaction data, and upload a detection result to a block chain through a fourth intelligent contract interface;
and adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
2. The method of claim 1, wherein the adjusting the audit status and the published information corresponding to the transaction data according to the detection result comprises:
when the detection result is that the transaction data is in compliance, adjusting an audit state corresponding to the transaction data to be an audit passing state, and writing the decrypted random public key into the account book through the fourth intelligent contract interface;
and under the condition that the detection result is that the transaction data is not in compliance, adjusting the auditing state corresponding to the transaction data to be an auditing failure state, and writing the non-compliance specification into the book through the fourth intelligent contract interface.
3. The method for supervising blockchain transaction data according to claim 1, further comprising, after the writing the identification of the transaction data, the transaction data cipher text, the audit state of the transaction data, and the random private key into an account book:
feeding back, by the first intelligent contract interface, an identification of the transaction data to a blockchain application that transmitted the transaction data.
4. The method of claim 3, wherein the adjusting the audit status and the published information according to the detection result further comprises:
under the condition that a target identifier transmitted by the block chain application through a fifth intelligent contract interface is received, judging whether an auditing state corresponding to the target identifier is an auditing passing state or not;
under the condition that the auditing state corresponding to the target identifier is an auditing passing state, acquiring a target transaction data ciphertext matched with the target identifier and a decrypted target random public key from the account book; decrypting the target transaction data ciphertext by using the target random public key to obtain a target transaction data plaintext; feeding back the target transaction data plaintext to the blockchain application through the fifth intelligent contract interface;
and under the condition that the auditing state corresponding to the target identifier is an auditing failing state or an auditing failing state, applying feedback data to the block chain through the fifth intelligent contract interface to obtain failed prompt information.
5. The method of claim 4, wherein after the adjusting the audit status and the information to be published corresponding to the transaction data according to the detection result, the method further comprises:
under the condition that a target identifier transmitted by the block chain application through a fifth intelligent contract interface is received, judging whether the block chain application has an access right and a corresponding right range;
under the condition that the block chain application has the access right, the step of judging whether the auditing state corresponding to the target identification is an auditing passing state is executed;
correspondingly, the feeding back the target transaction data plaintext to the blockchain application through the fifth intelligent contract interface includes:
and extracting the transaction data plaintext matched with the authority range from the target transaction data plaintext, and feeding back the transaction data plaintext matched with the authority range to the block chain application through the fifth intelligent contract interface.
6. The method for supervising blockchain transaction data according to claim 1, wherein the method includes, for the acquisition process of the random private key:
acquiring a pair of randomly generated keys from a storage system of the block node; the randomly generated key pair comprises a random private key and a random public key;
correspondingly, after the transaction data is encrypted by using the random private key to obtain a transaction data ciphertext, the method further comprises the following steps:
and encrypting the random public key by using a supervision private key fed back by a supervision system, and writing the encrypted random public key into the account book.
7. The method for managing blockchain transaction data according to claim 1, wherein for the process of obtaining the random private key, the method includes:
receiving a pair of randomly generated keys written by the monitoring system through a sixth intelligent contract interface; the randomly generated key pair comprises a random private key and a random public key encrypted by a supervision private key; and writing the encrypted random public key into the account book.
8. The method for supervising blockchain transaction data according to claim 1, wherein the method includes, for the acquisition process of the random private key:
receiving a random private key written by the monitoring system through a sixth intelligent contract interface; and a random public key corresponding to the random private key is stored on the supervision system.
9. The method for supervising blockchain transaction data according to claim 1, wherein the method includes, for the acquisition process of the random private key:
acquiring a pair of randomly generated keys written by an external program through a seventh intelligent contract interface; the randomly generated key pair comprises a random private key and a random public key;
correspondingly, after the transaction data is encrypted by using the random private key to obtain a transaction data ciphertext, the method further comprises the following steps:
and encrypting the random public key by using a supervision private key fed back by a supervision system, and writing the encrypted random public key into the account book.
10. The method for supervising blockchain transaction data according to claim 1, wherein the encrypting the transaction data by using the random private key to obtain the transaction data ciphertext comprises:
and encrypting the content of the pre-protection field in the transaction data by using the random private key to obtain a transaction data ciphertext.
11. The method for supervising blockchain transaction data according to claim 1, wherein the number of the random private keys is plural; the encrypting the transaction data by using the random private key to obtain the transaction data ciphertext comprises the following steps:
and encrypting the transaction data according to the random private keys corresponding to the fields to obtain a transaction data ciphertext.
12. The method for supervising blockchain transaction data according to claim 1, wherein the encrypting the transaction data by using the random private key to obtain the transaction data ciphertext comprises:
and encrypting the contents of all fields in the transaction data by using the random private key to obtain a transaction data ciphertext.
13. The method for supervising blockchain transaction data according to claim 1, wherein the obtaining of the transaction data ciphertext based on the first intelligent contract interface comprises:
receiving a transaction data ciphertext transmitted by the blockchain application through the first intelligent contract interface; the transaction data ciphertext is obtained by the blockchain application through an initial intelligent contract interface; and encrypting the transaction data by using the random private key.
14. A supervision device for block chain transaction data is characterized by being suitable for a block chain platform for deploying intelligent contracts, and 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 for acquiring a transaction data ciphertext based on a first intelligent contract interface; the transaction data ciphertext is obtained by encrypting transaction data by using a random private key;
the writing unit is used for writing the identification of the transaction data, the transaction data ciphertext, the auditing state of the transaction data and the random private key into an account book;
the second obtaining unit is used for obtaining the data to be verified based on a second intelligent contract interface;
the encryption unit is used for encrypting the data to be verified by using the random private key to obtain a data ciphertext to be verified; comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal;
the transmission unit transmits the transaction data ciphertext to a supervision system through a third intelligent contract interface, so that the supervision system can decrypt the transaction data ciphertext by using a random public key, perform compliance detection on the decrypted transaction data, and upload a detection result to a block chain through a fourth intelligent contract interface;
and the adjusting unit is used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
15. A supervision system for blockchain transaction data is characterized by comprising a blockchain application, a blockchain platform for deploying intelligent contracts and a supervision system;
the blockchain application is used for calling a first intelligent contract interface to transmit transaction data to an account book of the blockchain;
the block chain platform is used for acquiring the transaction data; encrypting the transaction data by using a random private key to obtain a transaction data ciphertext; writing the identification of the transaction data, the transaction data cipher text, the auditing state of the transaction data, the random private key and a random public key encrypted by a supervision private key into an account book; acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be checked by using the random private key to obtain a data cipher text to be checked; comparing the data cipher text to be checked with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal; transmitting the transaction data ciphertext to a monitoring system through a third intelligent contract interface;
the supervision system is used for decrypting the encrypted random public key by using the supervision public key, decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to the block chain through a fourth intelligent contract interface;
and the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
16. A supervision system for blockchain transaction data is characterized by comprising a blockchain application, a blockchain platform for deploying intelligent contracts and a supervision system;
the block chain application is used for acquiring a random private key through an initial intelligent contract interface; encrypting the transaction data by using the random private key to obtain a transaction data ciphertext; calling a first intelligent contract interface to transmit the transaction data ciphertext to an account book of the block chain;
the block chain platform is used for acquiring the transaction data ciphertext; writing the identification of the transaction data, the transaction data cipher text, the auditing state of the transaction data, the random private key and a random public key encrypted by a supervision private key into an account book; acquiring data to be checked based on a second intelligent contract interface; encrypting the data to be verified by using the random private key to obtain a data ciphertext to be verified; comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal; transmitting the transaction data ciphertext to a supervisory system through a third intelligent contract interface;
the supervision system is used for decrypting the encrypted random public key by using the supervision public key, decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to the block chain through a fourth intelligent contract interface;
and the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
17. A supervision system for blockchain transaction data is characterized by comprising a blockchain application, a blockchain platform for deploying intelligent contracts and a supervision system;
the blockchain application is used for calling a first intelligent contract interface to transmit transaction data to an account book of the blockchain;
the block chain platform is used for acquiring a random private key through an initial intelligent contract interface; encrypting the transaction data by using the random private key to obtain a transaction data ciphertext; writing the identification of the transaction data, the transaction data ciphertext, the audit state of the transaction data and the random private key into an account book, and marking the audit state of the transaction data ciphertext as not audited; acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be verified by using the random private key to obtain a data ciphertext to be verified; comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal; transmitting the transaction data ciphertext to a monitoring system through a third intelligent contract interface;
the supervision system is used for generating a random private key and a random public key; chaining the random private key and locally storing the random public key; decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to a block chain through a fourth intelligent contract interface;
and the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
18. A supervision system for blockchain transaction data is characterized by comprising a blockchain application, a blockchain platform for deploying intelligent contracts and a supervision system;
the block chain application is used for acquiring a random private key through an initial intelligent contract interface; encrypting the transaction data by using the random private key to obtain a transaction data ciphertext; calling a first intelligent contract interface to transmit the transaction data ciphertext to an account book of the block chain;
the block chain platform is used for acquiring the transaction data ciphertext; writing the identification of the transaction data, the transaction data ciphertext, the audit state of the transaction data and the random private key into an account book, and marking the audit state of the transaction data ciphertext as not audited; acquiring data to be verified based on a second intelligent contract interface; encrypting the data to be checked by using the random private key to obtain a data cipher text to be checked; comparing the data cipher text to be verified with the transaction data cipher text, and returning a comparison result to the block chain application or the user terminal; transmitting the transaction data ciphertext to a monitoring system through a third intelligent contract interface;
the supervision system is used for generating a random private key and a random public key; chaining the random private key and locally storing the random public key; decrypting the transaction data ciphertext by using the random public key, performing compliance detection on the decrypted transaction data, and uploading a detection result to a block chain through a fourth intelligent contract interface;
and the block chain platform is also used for adjusting the auditing state corresponding to the transaction data and the information required to be published according to the detection result.
19. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to carry out the steps of the method of administering blockchain transaction data according to any one of claims 1 to 13.
20. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of a method of administering blockchain transaction data according to any one of claims 1 to 13.
CN202211340599.4A 2022-10-28 2022-10-28 Method, device, equipment and medium for supervising blockchain transaction data Pending CN115664659A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211340599.4A CN115664659A (en) 2022-10-28 2022-10-28 Method, device, equipment and medium for supervising blockchain transaction data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211340599.4A CN115664659A (en) 2022-10-28 2022-10-28 Method, device, equipment and medium for supervising blockchain transaction data

Publications (1)

Publication Number Publication Date
CN115664659A true CN115664659A (en) 2023-01-31

Family

ID=84992827

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211340599.4A Pending CN115664659A (en) 2022-10-28 2022-10-28 Method, device, equipment and medium for supervising blockchain transaction data

Country Status (1)

Country Link
CN (1) CN115664659A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840683A (en) * 2023-02-24 2023-03-24 浪潮电子信息产业股份有限公司 Monitoring method, system, device, equipment and storage medium of heterogeneous alliance chain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840683A (en) * 2023-02-24 2023-03-24 浪潮电子信息产业股份有限公司 Monitoring method, system, device, equipment and storage medium of heterogeneous alliance chain
CN115840683B (en) * 2023-02-24 2023-05-16 浪潮电子信息产业股份有限公司 Heterogeneous alliance chain monitoring method, system, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US10496811B2 (en) Counterfeit prevention
CN107770159B (en) Vehicle accident data recording method and related device and readable storage medium
US20030233573A1 (en) System and method for securing network communications
CN105072125B (en) A kind of http communication system and method
CN112507363A (en) Data supervision method, device and equipment based on block chain and storage medium
CN110290102A (en) Service security system and method based on application
CN102916963A (en) Safe data exchange method, device, nodes and safe data exchange system
CN107172056A (en) A kind of channel safety determines method, device, system, client and server
CN105099705B (en) A kind of safety communicating method and its system based on usb protocol
AU2021271512A1 (en) Constructing a distributed ledger transaction on a cold hardware wallet
CN107871081A (en) A kind of computer information safe system
CN113346997B (en) Method and device for communication of Internet of things equipment, Internet of things equipment and server
CN111131416A (en) Business service providing method and device, storage medium and electronic device
CN112532656B (en) Block chain-based data encryption and decryption method and device and related equipment
CN105577639A (en) Trusted device control messages
CN112653556B (en) TOKEN-based micro-service security authentication method, device and storage medium
CN114786160B (en) NFC label key management system
CN112907375A (en) Data processing method, data processing device, computer equipment and storage medium
CN115001715A (en) Encrypted intelligent contract detection method based on block chain and terminal
CN115664659A (en) Method, device, equipment and medium for supervising blockchain transaction data
CN116506134B (en) Digital certificate management method, device, equipment, system and readable storage medium
CN116881936A (en) Trusted computing method and related equipment
CN105049209B (en) Dynamic password formation method and device
CN115118751A (en) Block chain-based supervision system, method, equipment and medium
WO2024087470A1 (en) Blockchain transaction data supervision method and apparatus, and device and nonvolatile readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination