A method and device for editing blockchain ledger data
By sending a ledger data editing request to the node in the blockchain system and performing identity verification, calculating and sending hash conflict values of the replacement data to change the original data, the problem of inability to modify the ledger data in blockchain technology is solved, and the functions of fair editing and data revocation are realized.
Patent Information
- Application Number
- CN202110682603.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-18
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-06-18
AI Technical Summary
Existing blockchain technology cannot modify ledger data, resulting in data errors or loss that cannot be revoked, and there are functional problems and standardized management problems.
By sending a ledger data edit request to the blockchain node, including the original data and the replacement data, and performing authentication, computing the hash conflict value of the replacement data, sending this value to change the original data to the replacement data.
It realizes fair editing of blockchain ledger data, solves the problem of inability to modify data, reduces the losses caused by the inability to revoke ledger data, and improves the functionality and management standardization of the system.
Smart Images

Figure CN113393241B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to blockchain technology and the financial field, and in particular to a method and device for editing blockchain ledger data. Background Art
[0002] In recent years, blockchain, as a distributed accounting technology, has been widely used by all walks of life, especially in the financial and computer fields, due to its decentralized, tamper-proof and traceable characteristics. Since blockchain uses a distributed computing and storage structure, there is no centralized hardware or management agency, and the rights and obligations of any node are equal. The data blocks in the system are jointly maintained by the nodes with maintenance functions in the entire system. At the same time, the data on the chain is open to everyone, and anyone can query blockchain data and develop related applications through public interfaces, so the entire system information is highly transparent. At the same time, the blocks are verified by the hash value of the transaction, ensuring that the content of the blockchain cannot be tampered with arbitrarily.
[0003] However, the shortcomings of the existing blockchain are mainly reflected in the inability to modify the data on the blockchain, which will lead to many practical problems. For example, if the cash transfer address is filled in incorrectly, it will directly cause permanent losses that cannot be revoked; if the key is lost, it will also cause permanent losses that cannot be recovered; nodes can publish negative information anonymously on the blockchain without being held accountable, and the content they publish cannot be modified, etc. This feature may lead to many violations of relevant systems and regulations, and it also does not meet the basic needs of adding, deleting, modifying and checking database content. Summary of the invention
[0004] In order to solve the problems existing in the prior art, the present application provides a method for editing blockchain ledger data, which relates to blockchain technology and the financial field. The method for editing blockchain ledger data includes:
[0005] Sending a ledger data editing request to a blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data;
[0006] Generate identity authentication information according to the identity authentication request fed back by the blockchain node, and send the identity authentication information to the blockchain node for identity authentication;
[0007] When the information fed back by the blockchain node is that the identity authentication is passed, the hash collision value corresponding to the replacement data is calculated according to the original data, the hash collision value corresponding to the original data, and the replacement data;
[0008] The hash collision value corresponding to the replacement data is sent to the blockchain node, so that the blockchain node changes the original data to the replacement data.
[0009] In one embodiment, before sending the ledger data editing request to the blockchain node, the method further includes:
[0010] Draw a random number to generate at least one trapdoor shard;
[0011] Perform secure multi-party computation according to the trapdoor shards to obtain a trapdoor public key;
[0012] Generating identity information corresponding to the trapdoor shard according to the trapdoor shard;
[0013] The trapdoor public key and the identity information are sent to the blockchain node.
[0014] The above embodiments are described from the perspective of privileged blockchain nodes. This application also provides another method for editing blockchain ledger data, which is described from the perspective of other blockchain nodes other than privileged blockchain nodes. The method includes:
[0015] Generate an identity authentication request based on a ledger data editing request sent by a pre-elected privileged blockchain node; wherein the ledger data editing request includes original data and corresponding replacement data;
[0016] Receiving identity authentication information generated by the privileged blockchain node according to the identity authentication request;
[0017] Receiving a hash collision value corresponding to the replacement data sent by the privileged blockchain node after identity authentication is passed, so as to verify the legitimacy of the replacement data; the hash collision value corresponding to the replacement data is calculated by the privileged blockchain node according to the original data, the hash collision value corresponding to the original data, and the replacement data;
[0018] When the replacement data passes the legality verification, the original data is changed to the replacement data.
[0019] In one embodiment, the method for editing blockchain ledger data further includes:
[0020] Receiving a trapdoor public key sent by the privileged blockchain node and identity information corresponding to the privileged blockchain node;
[0021] The trapdoor public key and the identity information are stored in a non-editable storage module.
[0022] In one embodiment, the method for editing blockchain ledger data further includes:
[0023] The account book data is stored in an editable storage module.
[0024] In one embodiment, the method for editing blockchain ledger data further includes:
[0025] The replacement data and the hash conflict value corresponding to the replacement data are announced so that other blockchain nodes can synchronously update their respective account book data.
[0026] This application also provides a method for editing blockchain ledger data, including:
[0027] The privileged blockchain node sends a ledger data editing request to the blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data;
[0028] The blockchain node generates an identity authentication request according to the ledger data editing request;
[0029] The privileged blockchain node generates identity authentication information according to the identity authentication request;
[0030] The blockchain node receives the identity authentication information and performs identity authentication; when the identity authentication is passed, the blockchain node calculates the hash collision value corresponding to the replacement data according to the original data, the hash collision value corresponding to the original data, and the replacement data, and sends the hash collision value corresponding to the replacement data to the blockchain node;
[0031] The blockchain node verifies the legitimacy of the replacement data according to the hash collision value corresponding to the replacement data, and when the legitimacy verification passes, changes the original data to the replacement data.
[0032] The present application also provides a device for editing blockchain ledger data, the device comprising:
[0033] An editing request sending module, used to send a ledger data editing request to a blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data;
[0034] An identity authentication information generation module, used to generate identity authentication information according to the identity authentication request fed back by the blockchain node, and send the identity authentication information to the blockchain node for identity authentication;
[0035] A hash collision value calculation module, configured to calculate a hash collision value corresponding to the replacement data according to the original data, the hash collision value corresponding to the original data, and the replacement data when the information fed back by the blockchain node is that the identity authentication is passed;
[0036] A hash collision value sending module is used to send the hash collision value corresponding to the replacement data to the blockchain node, so that the blockchain node changes the original data into the replacement data.
[0037] In one embodiment, the blockchain ledger data editing device further includes:
[0038] A trapdoor shard generation module, used to extract a random number to generate at least one trapdoor shard;
[0039] A trapdoor public key calculation module, used for performing secure multi-party calculation according to the trapdoor shards to obtain the trapdoor public key;
[0040] An identity information generation module, used to generate identity information corresponding to the trapdoor slice according to the trapdoor slice;
[0041] A verification information sending module is used to send the trapdoor public key and the identity information to the blockchain node.
[0042] The present application also provides another device for editing blockchain ledger data, including:
[0043] An identity authentication request sending module, configured to generate an identity authentication request according to a ledger data editing request sent by a pre-elected privileged blockchain node; wherein the ledger data editing request includes original data and corresponding replacement data;
[0044] An identity authentication information receiving module, used to receive the identity authentication information generated by the privileged blockchain node according to the identity authentication request;
[0045] A hash collision value receiving module, used to receive the hash collision value corresponding to the replacement data sent by the privileged blockchain node after the identity authentication is passed, so as to verify the legitimacy of the replacement data; the hash collision value corresponding to the replacement data is calculated by the privileged blockchain node according to the original data, the hash collision value corresponding to the original data and the replacement data;
[0046] The ledger data replacement module is used to change the original data into the replacement data after the replacement data passes the legitimacy verification.
[0047] In one embodiment, the blockchain ledger data editing device further includes:
[0048] A verification information receiving module, used to receive the trapdoor public key sent by the privileged blockchain node and the identity information corresponding to the privileged blockchain node;
[0049] The non-editable storage module is used to store the trapdoor public key and the identity information.
[0050] In one embodiment, the blockchain ledger data editing device further includes:
[0051] Editable storage module, used to store the ledger data corresponding to the blockchain node.
[0052] In one embodiment, the blockchain ledger data editing device further includes:
[0053] The data update announcement module is used to announce the replacement data and the hash conflict value corresponding to the replacement data so that other blockchain nodes can synchronously update their respective account book data.
[0054] The present application also provides a blockchain ledger data editing system, comprising: a blockchain node and a pre-elected privileged blockchain node;
[0055] The privileged blockchain node sends a ledger data editing request to the blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data;
[0056] The blockchain node generates an identity authentication request according to the ledger data editing request;
[0057] The privileged blockchain node generates identity authentication information according to the identity authentication request;
[0058] The blockchain node receives the identity authentication information and performs identity authentication; when the identity authentication is passed, the blockchain node calculates the hash collision value corresponding to the replacement data according to the original data, the hash collision value corresponding to the original data, and the replacement data, and sends the hash collision value corresponding to the replacement data to the blockchain node;
[0059] The blockchain node verifies the legitimacy of the replacement data according to the hash collision value corresponding to the replacement data, and when the legitimacy verification passes, changes the original data to the replacement data.
[0060] The blockchain ledger data editing method and device of the present application can realize fair editing of blockchain ledger data, so as to overcome the deficiency that the existing blockchain technology cannot modify the ledger data at all. The fair, efficient and decentralized blockchain editing method provided by the present invention can solve the functional problems and standardized management problems caused by the inability to modify the ledger data of blockchain nodes, and reduce various losses caused by the inability to revoke the ledger data of blockchain nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0062] Figure 1This is a schematic diagram of the blockchain system of this application.
[0063] Figure 2 Schematic diagram of the method for editing blockchain ledger data.
[0064] Figure 3 Another schematic diagram of a method for editing blockchain ledger data.
[0065] Figure 4 Another schematic diagram of a method for editing blockchain ledger data.
[0066] Figure 5 Another schematic diagram of a method for editing blockchain ledger data.
[0067] Figure 6 A schematic diagram of a device for editing blockchain ledger data.
[0068] Figure 7 Another schematic diagram of a device for editing blockchain ledger data.
[0069] Figure 8 Another schematic diagram of a device for editing blockchain ledger data.
[0070] Fig. 9 Another schematic diagram of a device for editing blockchain ledger data.
[0071] Fig.10 Another schematic diagram of a device for editing blockchain ledger data.
[0072] Fig.11 A schematic diagram of an electronic device. DETAILED DESCRIPTION
[0073] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] The present application provides a method for editing blockchain ledger data, which can be used to edit the ledger data of a blockchain node. The method can be applied to a blockchain system including ordinary blockchain nodes and privileged blockchain nodes. In order to facilitate the description of the method for editing blockchain ledger data of the present application, the blockchain system is first described here.
[0075] like Figure 1 As shown, the blockchain system of the present application includes two types of nodes, one is an ordinary blockchain node 1, and the other is a privileged blockchain node 2.
[0076] The generation process of privileged blockchain nodes is as follows: all nodes of the blockchain system vote for each node in the blockchain system, and the N nodes with the most votes are selected as privileged blockchain nodes, where N is an integer greater than or equal to 1, that is, the number of privileged blockchain nodes can be one or more. The privileged blockchain node can edit the ledger data of ordinary blockchain nodes. This specification is described by taking multiple privileged blockchain nodes as an example, but it is not intended to limit the present invention.
[0077] When there are multiple privileged blockchain nodes, each privileged blockchain node constitutes a consensus group that can edit the ledger data of the blockchain node. Each privileged blockchain node reaches a POA (Proof of Rights) consensus. When there is a need to edit the ledger data of a blockchain node, when more than half of the privileged blockchain nodes agree to edit, the consensus group can generate a ledger data editing request and send the ledger data editing request to the corresponding blockchain node.
[0078] The only difference between a privileged blockchain node and an ordinary blockchain node is that a privileged blockchain node can initiate edit requests, and the rest of the functions are the same as those of an ordinary blockchain node. That is, before a privileged blockchain node is elected as a privileged blockchain node, it is also an ordinary node in the blockchain and participates in the voting process.
[0079] Both ordinary blockchain nodes and privileged blockchain nodes include two storage modules, namely, an editable storage module and a non-editable storage module. Among them, the editable storage module is used to store various types of transaction data, and the non-editable storage module is used to store verification information that needs to be tamper-proof, such as identity information, keys and other unchangeable information. The ledger data of this application is stored in the editable storage module.
[0080] Based on the above blockchain system, this application first provides a method for editing blockchain ledger data. The execution subject of the method in this embodiment is a privileged blockchain node in the blockchain system. Figure 2 As shown, the method comprises the following steps:
[0081] Step S201, sending a ledger data editing request to a blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data.
[0082] Specifically, when a data editing requirement is generated, such as when a blockchain node publishes an incorrect cash transfer address or information that is not suitable for dissemination, the privileged blockchain node can send a ledger data editing request based on the data to be edited to correct the information to be edited. For example, when the original data is an incorrect cash transfer address, the replacement data is the correct cash transfer address, that is, the correction operation is performed; it can be understood that although the replacement data is included in the ledger data editing request of the privileged blockchain node, it is obtained after the privileged blockchain node confirms with the ordinary blockchain node.
[0083] Step S202: Generate identity authentication information according to the identity authentication request fed back by the blockchain node, and send the identity authentication information to the blockchain node for identity authentication.
[0084] Since only privileged blockchain nodes can initiate ledger data editing requests, ordinary blockchain nodes will verify the identity of privileged blockchain nodes after receiving ledger data editing requests.
[0085] The privileged blockchain node generates authentication information according to the authentication request of the ordinary blockchain node, and the authentication information includes encrypted information that can uniquely represent the identity of the privileged blockchain node, such as a pre-generated trapdoor shard.
[0086] Step S203, when the information fed back by the blockchain node is that the identity authentication is passed, the hash collision value corresponding to the replacement data is calculated according to the original data, the hash collision value corresponding to the original data and the replacement data.
[0087] Specifically, assuming that the original data is represented by m, the replacement data is represented by m', the hash collision value corresponding to the original data is represented by r, and the hash collision value corresponding to the replacement data is represented by r', then according to the following formula group:
[0088] H=g m ·h r
[0089] H′=g m′ ·h r′ mod q
[0090] H=H′
[0091] You can get the hash collision value corresponding to the replacement data:
[0092] r′=F(m,m′,r)=(mm′+xr)x -1 mod q
[0093] Where g and q are constants.
[0094] Step S204: Send the hash conflict value corresponding to the replacement data to the blockchain node, so that the blockchain node changes the original data to the replacement data.
[0095] In step S202, the privileged blockchain node may encrypt the pre-generated trapdoor fragment and send it as identity verification information to the ordinary blockchain node for identity verification. Figure 3 As shown, step S201, before sending the ledger data editing request to the blockchain node, also includes the following steps:
[0096] Step S301, extracting a random number to generate at least one trapdoor fragment.
[0097] Specifically, assume that there are multiple (n, n is a positive integer greater than 1) privileged blockchain nodes P1, P2, ..., P n , and each privileged blockchain node has only one trapdoor shard, then the trapdoor shards of each privileged blockchain node are represented as x1, x2, …, x n .
[0098] Step S302: Perform secure multi-party computing according to the trapdoor shards to obtain a trapdoor public key.
[0099] Among them, the synthesis formula of the trapdoor public key h is specifically:
[0100]
[0101] Therefore, we first need to get the value of the trapdoor x. Specifically, this step uses the chameleon trapdoor. i (1<<i<<n) trapdoor fragment x i (1<<i<<n) The way to synthesize the trapdoor x is
[0102] Since each privileged blockchain node P i (1<<i<<n) trapdoor fragment x i (1<<i<<n) is not known to other nodes. In order to ensure that the trapdoor shard is not leaked, each privileged blockchain node needs to perform a secure multi-party computation (MPC) to obtain the value of the trapdoor x.
[0103] Specifically, a homomorphic encryption and decryption tool (sk, pk, M, C, E, D) is set, where sk represents the private key of the encryption and decryption tool, pk represents the public key of the encryption and decryption tool, M and C represent the plaintext space and ciphertext space of the encryption and decryption tool respectively, and E and D represent the encryption algorithm and decryption algorithm of the encryption and decryption tool respectively. Among them, the encryption algorithm E is homomorphic.
[0104] Each privileged blockchain node P i (1<<i<<n) split their own trapdoor into x i (1<<i<<n) is encrypted with the public key pk to obtain the corresponding ciphertext E(x i )(1<<i<<n), and the ciphertext E(x i ) is made public. Each privileged blockchain node obtains the ciphertext of the trapdoor shards made public by all other privileged blockchain nodes. Then, the function value ciphertext E(x) = E(x1·x2…x n )=E(x1)E(x2)…E(x n ).
[0105] Then all privileged blockchain nodes use their own private keys to jointly decrypt E(x) to obtain the value of the trapdoor x.
[0106] Finally, substitute the value of x into the synthesis formula of the trapdoor public key h to get the value of h of the trapdoor public key.
[0107] Step S303: Generate identity information corresponding to the trapdoor slice according to the trapdoor slice.
[0108] This step is that each privileged blockchain node uses the homomorphic encryption and decryption tools (sk, pk, M, C, E, D) to encrypt the trapdoor shard and obtain the identity information.
[0109] Step S304: sending the trapdoor public key and the identity information to the blockchain node.
[0110] The identity information and trapdoor public key are encrypted using the communication public key of the common blockchain node. The communication public key of the common blockchain node is public, and the information encrypted using the communication public key can only be decrypted using the communication private key of the common blockchain node, and the communication private key is only controlled by the common blockchain node to ensure the security of the trapdoor public key and identity information.
[0111] This step sends the trapdoor public key and the identity information of each privileged blockchain node to the ordinary blockchain node, so that the ordinary blockchain node stores the trapdoor public key and the identity information of each privileged blockchain node in a non-editable storage module, which is convenient for subsequent verification of the identity of each privileged blockchain node.
[0112] The above embodiments are described from the perspective of privileged blockchain nodes. In another embodiment, the present application also provides another method for editing blockchain ledger data, which is described from the perspective of ordinary blockchain nodes. The steps performed on the privileged blockchain node side can refer to steps S201 to S204 and steps S301 to S304 of the above embodiments, which will not be repeated here. Figure 4 As shown, the method comprises the following steps:
[0113] Step S401, generating an identity authentication request based on a ledger data editing request sent by a pre-elected privileged blockchain node.
[0114] The ledger data editing request includes original data and corresponding replacement data, and the original data is stored in an editable storage module of a common blockchain node.
[0115] Step S402: receiving the identity authentication information generated by the privileged blockchain node according to the identity authentication request, and verifying the identity of the privileged blockchain node according to the identity authentication request.
[0116] Specifically, the identity information of each privileged blockchain node is pre-stored in the ordinary blockchain node. When the privileged blockchain node sends the identity authentication information again, the homomorphic-chameleon function f(x)=g x mod q for authentication.
[0117] The verification step is specifically as follows: the identity information of the privileged blockchain node pre-stored in the non-editable storage module is substituted as x into the above homomorphic-chameleon function to obtain the first f(x) value; the authentication information of the privileged blockchain node received in step S402 is substituted as x into the above homomorphic-chameleon function to obtain the second f(x) value. If the two f(x) values are the same, the authentication of the privileged blockchain node passes; otherwise, it fails.
[0118] Step S403, receiving the hash collision value corresponding to the replacement data sent by the privileged blockchain node after identity authentication is passed; the hash collision value corresponding to the replacement data is calculated by the privileged blockchain node based on the original data, the hash collision value corresponding to the original data and the replacement data.
[0119] Step S404: when the replacement data passes the legality verification, the original data is changed to the replacement data.
[0120] The legitimacy verification process can also be verified using the formula in step S203, that is, the original data and the hash collision value corresponding to the original data are substituted into the formula H=g m ·h r Substitute the replacement data and the hash collision value corresponding to the replacement data into the formula H′=g m′ ·h r′ In mod q, when the results of the two formulas are consistent, the legality verification passes; otherwise, it fails.
[0121] In one embodiment, if Figure 5As shown, before step S401, the method for editing blockchain ledger data further includes:
[0122] Step S501, receiving the trapdoor public key sent by the privileged blockchain node and the identity information corresponding to the privileged blockchain node.
[0123] Step S502: storing the trapdoor public key and the identity information in a non-editable storage module.
[0124] In one embodiment, the method for editing blockchain ledger data further includes:
[0125] The replacement data and the hash conflict value corresponding to the replacement data are announced so that other blockchain nodes can synchronously update their respective account book data.
[0126] This step can also be performed by privileged blockchain nodes. The privileged nodes synchronize all ordinary blockchain nodes in the consensus blockchain system and publish block versions. After receiving the update announcement, each ordinary blockchain node performs version verification. When the block version published by the privileged node is consistent with the current block version, the ordinary blockchain nodes synchronously update their own ledger data.
[0127] In another embodiment, based on the above blockchain system, the present application also provides a method for editing blockchain ledger data. Figure 6 As shown, the specific steps include:
[0128] Step S601: The privileged blockchain node sends a ledger data editing request to a common blockchain node, where the ledger data editing request includes original data and corresponding replacement data.
[0129] The ordinary blockchain node is a node that publishes the original data, and is hereinafter collectively referred to as a blockchain node to distinguish it from a privileged blockchain node. In step S101, the privileged blockchain node sends the original data to be modified and the replacement data used to replace the original data to the ordinary blockchain node.
[0130] Step S602: The blockchain node generates an identity authentication request according to the ledger data editing request.
[0131] Since only privileged blockchain nodes have the authority to edit ledger data, after receiving a request to edit ledger data, ordinary blockchain nodes need to verify whether the node that sent the request is a privileged blockchain node. The verification method is to send an identity authentication request to the privileged blockchain node.
[0132] Step S603: The privileged blockchain node generates identity authentication information according to the identity authentication request.
[0133] After receiving the identity authentication request, the privileged blockchain node will encrypt the data that can prove its identity, obtain the identity authentication information, and send it to the ordinary blockchain node.
[0134] Step S604: the blockchain node receives the identity authentication information and performs identity authentication.
[0135] Step S605, when the identity authentication is passed, the privileged blockchain node calculates the hash collision value corresponding to the replacement data based on the original data, the hash collision value corresponding to the original data and the replacement data, and sends the hash collision value corresponding to the replacement data to the blockchain node.
[0136] Step S606, the blockchain node verifies the legitimacy of the replacement data according to the hash conflict value corresponding to the replacement data, and when the legitimacy verification passes, changes the original data to the replacement data.
[0137] The specific execution process of each step in this embodiment can be found in the description of the previous embodiments, and will not be repeated here.
[0138] The blockchain ledger data editing method of the present application can realize fair editing of blockchain ledger data, so as to overcome the deficiency that the existing blockchain technology cannot modify the ledger data at all. The fair, efficient and decentralized blockchain editing method provided by the present invention can solve the functional problems and standardized management problems caused by the inability to modify the ledger data of blockchain nodes, and reduce various losses caused by the inability to revoke the ledger data of blockchain nodes.
[0139] Based on the same inventive concept, the embodiments of the present application also provide an editing device for blockchain ledger data, which can be used to implement the method described in the above embodiments, as described in the following embodiments. Since the principle of solving the problem by the editing device for blockchain ledger data is similar to the editing method for blockchain ledger data, the implementation of the editing device for blockchain ledger data can refer to the implementation of the editing method for blockchain ledger data, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0140] In one embodiment, the present application also provides a device for editing blockchain ledger data, such as Figure 7 As shown, the device comprises:
[0141] An editing request sending module 701 is used to send a ledger data editing request to a blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data;
[0142] The identity authentication information generation module 702 is used to generate identity authentication information according to the identity authentication request fed back by the blockchain node, and send the identity authentication information to the blockchain node for identity authentication;
[0143] A hash collision value calculation module 703 is used to calculate a hash collision value corresponding to the replacement data according to the original data, the hash collision value corresponding to the original data, and the replacement data when the information fed back by the blockchain node is that the identity authentication is passed;
[0144] The hash collision value sending module 704 is used to send the hash collision value corresponding to the replacement data to the blockchain node, so that the blockchain node changes the original data to the replacement data.
[0145] In one embodiment, if Figure 8 As shown, the blockchain ledger data editing device also includes:
[0146] A trapdoor shard generation module 705, configured to extract a random number to generate at least one trapdoor shard;
[0147] A trapdoor public key calculation module 706, configured to perform secure multi-party computation according to the trapdoor shards to obtain a trapdoor public key;
[0148] An identity information generating module 707, configured to generate identity information corresponding to the trapdoor slice according to the trapdoor slice;
[0149] The verification information sending module 708 is used to send the trapdoor public key and the identity information to the blockchain node.
[0150] In another embodiment, the present application also provides another device for editing blockchain ledger data, such as Fig. 9 As shown, including:
[0151] The identity authentication request sending module 901 is used to generate an identity authentication request according to the ledger data editing request sent by the pre-elected privileged blockchain node; wherein the ledger data editing request includes original data and corresponding replacement data;
[0152] The identity authentication information receiving module 902 is used to receive the identity authentication information generated by the privileged blockchain node according to the identity authentication request;
[0153] A hash collision value receiving module 903 is used to receive a hash collision value corresponding to the replacement data sent by the privileged blockchain node after identity authentication is passed; the hash collision value corresponding to the replacement data is calculated by the privileged blockchain node according to the original data, the hash collision value corresponding to the original data, and the replacement data;
[0154] The ledger data replacement module 904 is used to change the original data into the replacement data after the replacement data passes the legality verification.
[0155] In one embodiment, if Fig.10 As shown, the blockchain ledger data editing device also includes:
[0156] A verification information receiving module 905 is used to receive the trapdoor public key sent by the privileged blockchain node and the identity information corresponding to the privileged blockchain node;
[0157] The non-editable storage module 906 is used to store the trapdoor public key and the identity information.
[0158] In one embodiment, if Fig.10 As shown, the blockchain ledger data editing device also includes:
[0159] The editable storage module 907 is used to store the ledger data corresponding to the blockchain node.
[0160] In one embodiment, if Fig.10 As shown, the blockchain ledger data editing device also includes:
[0161] The data update announcement module 908 is used to announce the replacement data and the hash conflict value corresponding to the replacement data so that other blockchain nodes can synchronously update their respective account book data.
[0162] In another embodiment, the present application also provides a blockchain ledger data editing system, which can be found at Figure 1 , including: ordinary blockchain node 1 and pre-elected privileged blockchain node 2;
[0163] The privileged blockchain node sends a ledger data editing request to the blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data;
[0164] The blockchain node generates an identity authentication request according to the ledger data editing request;
[0165] The privileged blockchain node generates identity authentication information according to the identity authentication request;
[0166] The blockchain node receives the identity authentication information and performs identity authentication; when the identity authentication is passed, the blockchain node calculates the hash collision value corresponding to the replacement data according to the original data, the hash collision value corresponding to the original data, and the replacement data, and sends the hash collision value corresponding to the replacement data to the blockchain node;
[0167] The blockchain node verifies the legitimacy of the replacement data according to the hash collision value corresponding to the replacement data, and when the legitimacy verification passes, changes the original data to the replacement data.
[0168] The blockchain ledger data editing system and device of the present application can realize fair editing of blockchain ledger data, so as to overcome the deficiency that the existing blockchain technology cannot modify the ledger data at all. The fair, efficient and decentralized blockchain editing method provided by the present invention can solve the functional problems and standardized management problems caused by the inability to modify the ledger data of blockchain nodes, and reduce various losses caused by the inability to revoke the ledger data of blockchain nodes.
[0169] The present invention also provides an electronic device, see Fig.11 , the electronic device 100 specifically includes:
[0170] A central processing unit (processor) 110 , a memory (memory) 120 , a communication module (Communications) 130 , an input unit 140 , an output unit 150 and a power supply 160 .
[0171] The memory 120, the communication module 130, the input unit 140, the output unit 150 and the power supply 160 are respectively connected to the central processing unit 110. The memory 120 stores a computer program, and the central processing unit 110 can call the computer program. When the central processing unit 110 executes the computer program, all the steps in the method for editing blockchain account book data in the above embodiment are implemented.
[0172] The embodiment of the present application further provides a computer storage medium for storing a computer program, wherein the computer program can be executed by a processor. When the computer program is executed by the processor, any method for editing blockchain ledger data provided by the present invention is implemented.
[0173] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment. In the description of this specification, the description of the reference term "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification.
[0174] In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradicting each other. The above is only an embodiment of the embodiment of this specification and is not intended to limit the embodiment of this specification. For those skilled in the art, the embodiment of this specification may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiment of this specification shall be included within the scope of the claims of the embodiment of this specification.
Claims
1. A method for editing blockchain ledger data, characterized in that: The blockchain includes a plurality of blockchain nodes and at least one privileged blockchain node pre-selected from the plurality of blockchain nodes; the blockchain node and the privileged blockchain node respectively include an editable storage module and a non-editable storage module, the editable storage module is used to store transaction data, and the non-editable storage module is used to store verification information that needs to be tamper-proof, and the verification information that needs to be tamper-proof includes identity information; The method is applied to the privileged blockchain node, and the method comprises: Sending a ledger data editing request to a blockchain node, the ledger data editing request including original data and corresponding replacement data; the original data is stored in an editable storage module of the blockchain node; Generate identity authentication information according to the identity authentication request fed back by the blockchain node, send the identity authentication information to the blockchain node for identity authentication, and receive information fed back by the blockchain node; wherein the blockchain node authenticates the privileged blockchain node according to the identity authentication information and the identity information pre-stored in the non-editable storage module of the blockchain node; When the information fed back by the blockchain node is that the identity authentication is passed, the hash collision value corresponding to the replacement data is calculated according to the original data, the hash collision value corresponding to the original data, and the replacement data; The hash collision value corresponding to the replacement data is sent to the blockchain node, so that the blockchain node changes the original data in the editable storage module to the replacement data.
2. The method for editing blockchain account data according to claim 1, characterized in that: Before sending the ledger data editing request to the blockchain node, the method further includes: Draw a random number to generate at least one trapdoor shard; Perform secure multi-party computation according to the trapdoor shards to obtain a trapdoor public key; Generating identity information corresponding to the trapdoor shard according to the trapdoor shard; The trapdoor public key and the identity information are sent to the blockchain node.
3. A method for editing blockchain ledger data, characterized in that: The blockchain includes a plurality of blockchain nodes and at least one privileged blockchain node pre-selected from the plurality of blockchain nodes; the blockchain node and the privileged blockchain node respectively include an editable storage module and a non-editable storage module, the editable storage module is used to store transaction data, and the non-editable storage module is used to store verification information that needs to be tamper-proof, and the verification information that needs to be tamper-proof includes identity information; The method is applied to the blockchain node, and the method comprises: Generate an identity authentication request according to the ledger data editing request sent by the privileged blockchain node; wherein the ledger data editing request includes original data and corresponding replacement data; and the original data is stored in an editable storage module of the blockchain node; Receiving identity authentication information generated by the privileged blockchain node according to the identity authentication request, and authenticating the privileged blockchain node according to the identity authentication information and identity information pre-stored in the non-editable storage module of the blockchain node; Receiving a hash collision value corresponding to the replacement data sent by the privileged blockchain node after identity authentication is passed, so as to verify the legitimacy of the replacement data; the hash collision value corresponding to the replacement data is calculated by the privileged blockchain node according to the original data, the hash collision value corresponding to the original data, and the replacement data; When the replacement data passes the legality verification, the original data in the editable storage module is changed to the replacement data.
4. The method for editing blockchain account data according to claim 3, characterized in that: Also includes: Receiving a trapdoor public key sent by the privileged blockchain node and identity information corresponding to the privileged blockchain node; The trapdoor public key and the identity information are stored in a non-editable storage module.
5. The method for editing blockchain account data according to claim 4, characterized in that: The account book data is stored in an editable storage module.
6. The method for editing blockchain account data according to claim 5, characterized in that: Also includes: The replacement data and the hash conflict value corresponding to the replacement data are announced so that other blockchain nodes can synchronously update their respective account book data.
7. A method for editing blockchain ledger data, characterized in that: The blockchain includes a plurality of blockchain nodes and at least one privileged blockchain node pre-selected from the plurality of blockchain nodes; the blockchain node and the privileged blockchain node respectively include an editable storage module and a non-editable storage module, the editable storage module is used to store transaction data, and the non-editable storage module is used to store verification information that needs to be tamper-proof, and the verification information that needs to be tamper-proof includes identity information; The method comprises: The privileged blockchain node sends a ledger data editing request to the blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data; the original data is stored in an editable storage module of the blockchain node; The blockchain node generates an identity authentication request according to the ledger data editing request; The privileged blockchain node generates identity authentication information according to the identity authentication request; The blockchain node receives the identity verification information, and authenticates the privileged blockchain node based on the identity verification information and identity information pre-stored in the non-editable storage module of the blockchain node; When the identity authentication is passed, the privileged blockchain node calculates the hash collision value corresponding to the replacement data according to the original data, the hash collision value corresponding to the original data, and the replacement data, and sends the hash collision value corresponding to the replacement data to the blockchain node; The blockchain node verifies the legitimacy of the replacement data according to the hash collision value corresponding to the replacement data, and when the legitimacy verification passes, changes the original data in the editable storage module to the replacement data.
8. A device for editing blockchain ledger data, characterized in that: The blockchain includes a plurality of blockchain nodes and at least one privileged blockchain node pre-selected from the plurality of blockchain nodes; the blockchain node and the privileged blockchain node respectively include an editable storage module and a non-editable storage module, the editable storage module is used to store transaction data, and the non-editable storage module is used to store verification information that needs to be tamper-proof, and the verification information that needs to be tamper-proof includes identity information; The device is applied to the privileged blockchain node, and the device includes: An editing request sending module, used to send a ledger data editing request to a blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data; the original data is stored in an editable storage module of the blockchain node; An identity authentication information generation module, used to generate identity authentication information according to the identity authentication request fed back by the blockchain node, and send the identity authentication information to the blockchain node for identity authentication, and receive information fed back by the blockchain node; wherein the blockchain node authenticates the privileged blockchain node according to the identity authentication information and the identity information pre-stored in the non-editable storage module of the blockchain node; A hash collision value calculation module, configured to calculate a hash collision value corresponding to the replacement data according to the original data, the hash collision value corresponding to the original data, and the replacement data when the information fed back by the blockchain node is that the identity authentication is passed; A hash collision value sending module is used to send the hash collision value corresponding to the replacement data to the blockchain node, so that the blockchain node changes the original data in the editable storage module to the replacement data.
9. The device for editing blockchain ledger data according to claim 8, characterized in that: Also includes: A trapdoor shard generation module, used to extract a random number to generate at least one trapdoor shard; A trapdoor public key calculation module, used for performing secure multi-party calculation according to the trapdoor shards to obtain the trapdoor public key; An identity information generation module, used to generate identity information corresponding to the trapdoor slice according to the trapdoor slice; A verification information sending module is used to send the trapdoor public key and the identity information to the blockchain node.
10. A device for editing blockchain ledger data, characterized in that: The blockchain includes a plurality of blockchain nodes and at least one privileged blockchain node pre-selected from the plurality of blockchain nodes; the blockchain node and the privileged blockchain node respectively include an editable storage module and a non-editable storage module, the editable storage module is used to store transaction data, and the non-editable storage module is used to store verification information that needs to be tamper-proof, and the verification information that needs to be tamper-proof includes identity information; The device is applied to the blockchain node, and the device includes: An identity authentication request sending module, configured to generate an identity authentication request according to a ledger data editing request sent by the privileged blockchain node; wherein the ledger data editing request includes original data and corresponding replacement data; and the original data is stored in an editable storage module of the blockchain node; an identity authentication information receiving module, configured to receive the identity authentication information generated by the privileged blockchain node according to the identity authentication request, and authenticate the privileged blockchain node according to the identity authentication information and the identity information pre-stored in the non-editable storage module of the blockchain node; A hash collision value receiving module, used to receive the hash collision value corresponding to the replacement data sent by the privileged blockchain node after the identity authentication is passed, so as to verify the legitimacy of the replacement data; the hash collision value corresponding to the replacement data is calculated by the privileged blockchain node according to the original data, the hash collision value corresponding to the original data and the replacement data; The ledger data replacement module is used to change the original data in the editable storage module to the replacement data after the replacement data passes the legality verification.
11. The device for editing blockchain ledger data according to claim 10, characterized in that: Also includes: A verification information receiving module, used to receive the trapdoor public key sent by the privileged blockchain node and the identity information corresponding to the privileged blockchain node; The non-editable storage module is used to store the trapdoor public key and the identity information.
12. The device for editing blockchain ledger data according to claim 11, characterized in that: Also includes: Editable storage module, used to store the ledger data corresponding to the blockchain node.
13. The device for editing blockchain ledger data according to claim 12, characterized in that: Also includes: The data update announcement module is used to announce the replacement data and the hash conflict value corresponding to the replacement data so that other blockchain nodes can synchronously update their respective account book data.
14. A blockchain ledger data editing system, characterized in that: The blockchain system includes a plurality of blockchain nodes and at least one privileged blockchain node pre-selected from the plurality of blockchain nodes; the blockchain node and the privileged blockchain node respectively include an editable storage module and a non-editable storage module, the editable storage module is used to store transaction data, and the non-editable storage module is used to store verification information that needs to be tamper-proof, and the verification information that needs to be tamper-proof includes identity information; The privileged blockchain node sends a ledger data editing request to the blockchain node, wherein the ledger data editing request includes original data and corresponding replacement data; the original data is stored in an editable storage module of the blockchain node; The blockchain node generates an identity authentication request according to the ledger data editing request; The privileged blockchain node generates identity authentication information according to the identity authentication request; The blockchain node receives the identity authentication information, and authenticates the privileged blockchain node according to the identity authentication information and the identity information pre-stored in the non-editable storage module of the blockchain node; when the identity authentication is passed, the blockchain node calculates the hash collision value corresponding to the replacement data according to the original data, the hash collision value corresponding to the original data, and the replacement data, and sends the hash collision value corresponding to the replacement data to the blockchain node; The blockchain node verifies the legitimacy of the replacement data according to the hash collision value corresponding to the replacement data, and when the legitimacy verification passes, changes the original data in the editable storage module to the replacement data.
15. An electronic device, characterized in that: include: A central processing unit, a memory, and a communication module, wherein the memory stores a computer program, the central processing unit can call the computer program, and when the central processing unit executes the computer program, the method for editing blockchain ledger data as described in any one of claims 1 to 7 is implemented.
16. A computer storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, the method for editing blockchain ledger data according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Editable block chain system
CN111460497A