Method, system and equipment for editing editable block chain with dynamic editing right

By introducing dynamic editing rights and reputation mechanisms into blockchain technology, and using master-slave trap doors to realize editing functions, the problems of data update and privacy protection in the blockchain system are solved, and dynamic adjustment of editing rights and system security are realized. sex.

CN119496611AActive Publication Date: 2025-02-21NANJING UNIV OF SCI & TECH

Patent Information

Application Number
CN202411691620.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-02-21
Estimated Expiration
2044-11-25

Smart Images

  • Figure CN119496611A_ABST
    Figure CN119496611A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of block chains, and discloses an editable block chain editing method, system and device with a dynamic editing right. The method of the invention comprises; constructing a leader public key and a main trap door; when a user needs to edit data on the block chain, the user inquires own reputation points and determines that the user has right to initiate an editing request, and then generates the editing request and sends the editing request to a leader; the leader broadcasts the editing request to other users in the system after verifying the authority; the user and the leader respectively carry out self-inspection and verification on the voting authority, and if the voting is passed, the leader generates a slave trap door and distributes a sub-key of the slave trap door to each user; selecting an editor of the editing request for editing; and the supervisor verifies the editing operation and updates the reputation points of the related users. According to the method, the editable function of the block chain system can be realized, the editing permission can be dynamically adjusted, and the problems of responsibility investigation and limitation of the editing permission when data problems occur after editing can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of blockchain technology, and in particular relates to an editable blockchain editing method, system and device with dynamic editing rights. Background Art

[0002] The core feature of traditional blockchain technology is the immutability of data, which is achieved through cryptographic hash functions and consensus mechanisms to ensure the credibility and security of data. However, this also leads to a lack of flexibility. Once data is written to the blockchain, it cannot be modified. In addition, unlicensed blockchain networks may lead to malicious users abusing their permissions to store sensitive or illegal data. The immutability also limits the application of blockchain in many fields, such as finance and copyright. Therefore, blockchain solutions with editability and traceability can better respond to needs such as data updates and privacy protection, and promote the application of blockchain in a wider range of fields.

[0003] Currently, many solutions have been proposed for this type of problem, but their functions are not perfect.

[0004] The concept of a modifiable blockchain was explored in the paper “G. Ateniese, B. Magri, D. Venturi, and E. Andrade, RedactableBlockchain – or – Rewriting History in Bitcoin and Friends, in 2017 IEEEEuropean Symposium on Security and Privacy (EuroS&P), IEEE, 2017.” Their permissioned blockchain scheme based on chameleon hashing uses a chameleon hash function with a trapdoor to edit blocks and maintain hash consistency. However, this scheme does not address the issues of accountability and editing authority restrictions when problems occur with edited data.

[0005] The paper "K. Ashritha, M. Sindhu, and KV Lakshmy, Redactable Blockchain using Enhanced Chameleon Hash Function, in International Conference on Advanced Computing and Communication Systems, 2019." proposes an editable blockchain scheme using enhanced chameleon hashing, in which a nonlinear secret sharing scheme is used to prevent malicious sharing of false shares. However, this scheme also does not solve the problem of accountability and adjustment of editing permissions when problems occur in the edited data.

[0006] The paper "Y. Jia, SF Sun, Y. Zhang, Z. Liu, and D. Gu, RedactableBlockchain Supporting Supervision and Self-Management, in ASIA CCS '21: ACMAsia Conference on Computer and Communications Security, ACM, 2021." proposed a stateful chameleon hash with revocable subkeys (sCHRS) and designed a new editable blockchain construction. They introduced a semi-trusted regulator to supervise editing behavior, but did not consider how to hold illegal behavior accountable, nor did they solve the problem of adjusting editing permissions. Summary of the invention

[0007] The purpose of the present invention is to address the deficiencies in the prior art and to provide an editable blockchain editing method, system and device with dynamic editing rights, which are used to realize the editable function of the blockchain system and dynamically adjust the editing rights, so as to solve the problems of accountability and restriction of editing rights when problems occur in the data after editing.

[0008] Specifically, the present invention is implemented by adopting the following technical solutions.

[0009] In one aspect, the present invention provides a method for editing an editable blockchain with dynamic editing rights, comprising:

[0010] Main trapdoor generation phase: The leader selects a multiplication cycle group based on the security parameters of the editable block system and , and The order is , the generator is , set up the bilinear map , choose a hash function and , Indicates the order Unit groups, and secure pseudo-random number generators , output common parameters ; Generate three random numbers ,in , and calculate ; Generate a signature key pair using public parameters , and then construct the leader's public key and main trapdoor ;

[0011] Edit request stage: When a user needs to edit data on the blockchain, he first queries the leader for his credit points, and determines the user authority corresponding to the credit points according to the preset credit point authority classification rules to determine whether he has the right to initiate an edit request. The user who has the right to initiate an edit request will identify his identity. 、Original message 、New message you want to modify The edit request is packaged and sent to the leader; the leader queries the user's credit score to verify whether the user has the authority to initiate the edit request. If so, the edit request is broadcast to other users in the system and enters the voting phase;

[0012] Voting stage: After receiving the edit request, other users in the system will check their voting rights. If they have voting rights, a random number will be selected for the user. , using a hash function for edit requests Calculate a hash value , and then use the leader's public key Hash value , random numbers The encrypted voting information is sent to the leader as encrypted voting information. After receiving the encrypted voting information, the leader checks whether the user has voting rights based on the user's credit score. The votes cast by users without voting rights will be discarded, and the votes cast by users with voting rights are valid votes. The voting results of all valid votes are decrypted by the leader using the leader's private key. If a set proportion of users agree to the edit request, the voting result is considered to be passed; otherwise, the process ends. Calculate the sum of the random numbers in all valid votes ;

[0013] From the trapdoor generation phase: If the vote is passed, the leader 、Original message and a random string The triples composed of new messages and main trapdoor , generate a new random string , from the trapdoor and witness , and then generate a new random string ,witness Broadcast; after receiving, the user uses the leader's public key , by the hash value of the block 、Original message and a random string The triplet composed of the new random string received and witness , verify the hash value of the block Validity, inspection and witness Is it valid? After the verification result is counted and passed by the leader, the generation of the slave trapdoor is completed.

[0014] Secret sharing phase: The leader distributes the subkey of the trapdoor to each user; after receiving the subkey of the trapdoor, the user verifies the distribution process of the subkey of the trapdoor and obtains the subkey of the trapdoor through decryption. , and construct the corresponding proof ;

[0015] Edit phase: The user receives the sum of the random numbers broadcast by the leader , combined with the user's own public key , calculate its own candidate editor hash value, and broadcast it and the user's public key to the chain; the user receives the candidate editor hash values ​​of other users broadcasted by other users, and integrates them into an array after sorting; each user then finds the candidate editor with editing rights and the smallest candidate editor hash value from all candidate editors, sends it to the leader for confirmation, and then becomes the editor of this editing request, and then the user sends the decrypted subkey Sent to the editor of this edit request; the editor of this edit request subsequently recovers the trapdoor key And send it to the leader, after the leader verifies it, get it from the trapdoor ; Then according to the trapdoor Calculate new message The corresponding final random string , perform data editing;

[0016] Verification and maintenance reputation stage: Supervisors verify the editing operations. During this process, the reputation points of relevant users are updated according to the preset reputation point update rules based on the verification results to reward compliant operations and punish violations.

[0017] Furthermore, the credit points authority classification rules are as follows:

[0018] Nodes with a reputation score of [0, A) are classified as malicious nodes, and have no voting rights, no edit request rights, and no edit rights;

[0019] The node with reputation points at [A, B) is classified as a common node. This node has voting rights, but no edit request rights and no edit rights.

[0020] The node with reputation score in [B, C) is classified as a good node. This node has voting rights, edit request rights, but no editing rights;

[0021] Nodes with a reputation score of [C, 100] are classified as excellent nodes, and have voting rights, edit request rights, and edit rights;

[0022] Among them, A, B, and C are all positive integers.

[0023] Furthermore, the credit score update rule includes: classifying user behaviors into different user behavior categories and setting corresponding feedback values, which are positive or negative;

[0024] Among them, user behavior categories are mainly divided into two categories: the first category is malicious behavior, and its corresponding credit score adjustment value is negative; the second category is good behavior, and its corresponding credit score adjustment value is positive;

[0025] The absolute value of the credit score adjustment value corresponding to a malicious behavior is set to be greater than the absolute value of the credit score adjustment value corresponding to a good behavior.

[0026] Furthermore, the editing request stage also includes the leader sending the verification result according to the editing request authority to the supervisor, and the supervisor updates the user's reputation points according to the reputation point update rule.

[0027] Furthermore, the leader determines the block based on the hash value of the block. 、Original message and a random string The triples composed of new messages and main trapdoor , generate a new random string , from the trapdoor and witness ,include:

[0028] Generate a new hash tree for the block The root hash value of , where the leaf nodes from left to right are generated by the random number generator Two random numbers generated , , hash value and the identity of the leader ; Calculate the signature according to equations (3) and (4) and , output a new random string , from the trapdoor and witness , then to broadcast;

[0029] (3);

[0030] (4);

[0031] in, It is the block generator’s identity. is the root hash value of the block hash tree M, is the second part of the random string r, and A random number generated when constructing the leader's public key and the master trapdoor; witness , from the trapdoor , new random string ,in is the first part of the random string r, , are two random numbers generated when the block is generated, Represents the concatenation of two bit strings.

[0032] Furthermore, the leader distributes the subkey of the slave trapdoor to each user; after receiving the subkey of the slave trapdoor, the user verifies the distribution process of the subkey of the slave trapdoor and obtains the subkey of the slave trapdoor by decryption. , and construct the corresponding proof ,include:

[0033] 5-1) The leader will distribute the subkeys from the trapdoor to each user:

[0034] Leader selection integer ,in The mapping of is an integer group of order q, let the trapdoor key ; The number of selections is The polynomial ,in , , t is the minimum number of users required to recover from the trapdoor, t≤n; calculation coefficient commitment value , , is a multiplicative cyclic group Zhongyu Mutually independent generators; encrypt the subkey, the encrypted subkey of the i-th user , , n is the total number of users to whom the trapdoor subkeys are to be distributed, is the public key of the ith user, The number of times is polynomial of ;

[0035] For each , the number of random leader selections , and calculate the following formula:

[0036] (5);

[0037] use , , , Calculate the common value c 1 :

[0038] (6);

[0039] in, Represents the concatenation of two bit strings; is from arrive A hash map of

[0040] Calculate the response for each user , i=1,2,...,n, and generate a proof of distribution process ;

[0041] Output encryption subkey , coefficient commitment value , and proof , and broadcast it to the chain;

[0042] 5-2) User verification of the subkey distribution process from the trapdoor:

[0043] Calculate the intermediate parameters:

[0044] (7);

[0045] Verify the public value: Verify whether the following formula is true. If so, the distribution from the trapdoor subkey is successful; otherwise, the distribution fails and redistribution is performed:

[0046] (8);

[0047] 5-3) User performs decryption from the trapdoor subkey:

[0048] The encrypted subkey of the i-th user received by the user , the user's public key and the user's private key As input, calculate the following:

[0049] (9);

[0050] Among them, S i is the decrypted subkey of the i-th user, and the user's public and private key pair satisfies ;

[0051] Randomly select a value , calculate the following formula:

[0052] (10);

[0053] (11);

[0054] Generate the proof for the i-th user .

[0055] Furthermore, the editing request stage also includes: the leader obtains the user identity according to the editing request, obtains the user behavior category according to the verification result of the editing request authority, and hands the user behavior category and user identity to the supervisor for processing, and the supervisor updates the credit points according to the credit points update rules.

[0056] On the other hand, the present invention provides an editable blockchain system with dynamic editing rights, which implements the above-mentioned editable blockchain editing method with dynamic editing rights, including a leader, a user and a supervisor;

[0057] The leader, as the leader of the editing operation, is responsible for generating the master trapdoor and slave trapdoor of the Chameleon hash function, secretly sharing the slave trapdoor, saving the credit score list of all users, responding to the credit score query request of the user, counting the voting results and calculating the sum of random numbers;

[0058] The user is a user node in the blockchain network. According to their roles and behaviors in the blockchain editable system, they are divided into different node categories. Users of different node categories have different permissions and responsibilities in the system. All users have reputation points. According to the preset reputation point permission classification rules, the user's permissions are divided. Users vote for editing operations, initiate editing requests, and perform editing operations according to their corresponding permissions.

[0059] The supervisor maintains the user's reputation points and updates the corresponding user's reputation points according to the user's behavior category and preset reputation point update rules.

[0060] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that: when the computer program is executed by a processor, the steps of the above-mentioned method for editing an editable blockchain with dynamic editing rights are implemented.

[0061] In yet another aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for editing an editable blockchain with dynamic editing rights.

[0062] The beneficial effects of the editable blockchain editing method, system and device with dynamic editing rights of the present invention are as follows:

[0063] The editable blockchain editing method, system and device with dynamic editing rights of the present invention use a master-slave trapdoor method. The master trapdoor will not be shared with any other user. During the editing process, a slave trapdoor is generated according to a new message of the editing request, and then the secret of the slave trapdoor is shared. The editor performs editing operations according to the restored slave trapdoor. This method prevents the master trapdoor from being leaked, and users cannot modify data that has not undergone a legal editing process according to the slave trapdoor, which is beneficial to the security of on-chain data in the editable blockchain system.

[0064] The editable blockchain editing method, system and device with dynamic editing rights of the present invention introduces a reputation mechanism to dynamically maintain the user's reputation points, reward compliance operations and punish violations, ensure the security of the system and the standardization of user behavior, and ensure the stability of the entire system. Through the reputation point authority classification rules, users are given dynamic editing rights, editing request rights, and voting rights, which is beneficial to the data security of the editable blockchain system. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 Schematic diagram of an editable system framework according to an embodiment of the present invention.

[0066] Figure 2 Schematic diagram of the reputation mechanism of an embodiment of the present invention.

[0067] Figure 3 It is a schematic diagram of the editing process of an embodiment of the present invention. DETAILED DESCRIPTION

[0068] The present invention is further described in detail below in conjunction with embodiments and with reference to the accompanying drawings.

[0069] One embodiment of the present invention is an editable blockchain system with dynamic editing rights, such as Figure 1 As shown, it includes leaders, users and supervisors.

[0070] In the blockchain editable system of the present invention, the leader, as the leader of the editing operation, is responsible for broadcasting the parameters required for the editing operation and distributing them to users, and is responsible for maintaining the security of the trapdoor. Specifically, the leader is responsible for generating the main trapdoor of the chameleon hash function ( ), from the trap door ( ), secret sharing from the trapdoor ( ), save the credit score list of all users, respond to the user's credit score query request, count the voting results and calculate the sum of random numbers.

[0071] User nodes (hereinafter referred to as users) in the blockchain network can be divided into different node categories according to their roles and behaviors in the blockchain editable system. Users of different node categories have different permissions and responsibilities in the system. Preferably, in the blockchain editable system of this embodiment, all users have reputation points. According to the reputation point permission classification rules, the user's permissions are divided. Users can vote for editing operations, initiate editing requests, and perform editing operations according to the corresponding permissions.

[0072] The supervisor's main task is to supervise and manage the user's behavior. Specifically, the supervisor is responsible for maintaining the credit score list and updating the credit score of the corresponding user in the credit score list according to the user's behavior category and credit score update rules, such as Figure 2 shown.

[0073] The method for editing an editable blockchain with dynamic editing rights of the present invention is as follows: Figure 3 As shown, it includes generating the main trapdoor, editing request, voting, generating the slave trapdoor, secret sharing, editing, and verification maintenance.

[0074] 1. Generate the main trapdoor.

[0075] The leader generates a set of public parameters , and use the public parameters to calculate the signature key pair , and then construct the leader's public key and main trapdoor .

[0076] Specifically, the leader selects the multiplication cycle group based on the security parameters of the editable block system. and , and The order is , the generator is , set up the bilinear map , choose a hash function and ( represents the unit group of order q), and a secure pseudo-random number generator , output common parameters ; Generate three random numbers ,in , and calculate ; Generate a signature key pair using public parameters , and then construct the leader's public key and main trapdoor .

[0077] Leader public key It can be used to verify the validity of the hash value. When a block is first generated, it is based on the leader's public key. ,information and block producer identity , generate the hash value of the block and a random string When the user node needs to verify the validity of the hash value, it receives the leader's public key and the hash of the containing block ,information and a random string The triplet of is taken as input and the hash value of the block is verified by the hash value generation method. and a random string Is it effective?

[0078] Specifically, enter the public key ,information and block producer identity , randomly generate two random numbers ; Then calculate . is the root hash value of the block hash tree M, where the leaf nodes from left to right are generated by the random number generator Two random numbers generated , , hash value and block producer identity ; Initial order , Represents a placeholder, i.e. Is a null value. The hash value of the block is calculated according to the following formula and a random string :

[0079] (1);

[0080] (2);

[0081] in, Represents the concatenation of two bit strings.

[0082] When the validity of the hash value needs to be verified, the leader's public key is received and the hash of the containing block ,information and a random string The triplet of is taken as input and the hash value of the block is verified by checking whether equation (1) holds. and a random string Is it valid? If equation (1) holds, the verification is successful and output is 1; otherwise, the verification is unsuccessful and output is 0.

[0083] 2. Editing request stage.

[0084] When a user needs to edit data on the blockchain, he or she first queries the leader for his or her reputation score to determine whether he or she has the right to initiate an edit request. The reputation score determines the user's authority. The user's authority corresponding to the reputation score is determined according to the preset reputation score authority classification rules to determine whether he or she has the right to initiate an edit request. Users who have the right to initiate an edit request can identify themselves as 、Original message 、New message you want to modify Packaging and editing requests , and sends it to the leader. The leader queries the user's reputation points to verify whether the user has the edit request permission. If so, the edit request is broadcast to other users in the system and enters the voting phase. Subsequently, the leader sends the verification result based on the edit request permission to the supervisor, and the supervisor updates the reputation point list according to the reputation point update rules.

[0085] The specific steps are as follows:

[0086] 2-1) Users identify themselves As a parameter, the leader initiates a reputation query request to the leader. The leader queries the reputation list , returns the user's credit score After a user obtains credit points, the user is determined to have the authority to initiate an edit request based on the preset credit point authority classification rules. A user who has the authority to initiate an edit request generates an edit request. , and sends it to the leader, the edit request includes the user's identity 、Original message 、New message you want to modify .

[0087] 2-2) The leader receives the edit request initiated by the user After that, query the credit score list , get the user identity Corresponding user credit points , according to the preset credit score permission classification rules, verify whether the user who submitted the edit request has the permission to edit the request. , indicating that the user does not have permission to initiate an edit request; if , it means that the user has the permission to initiate an edit request. If the user has the permission to initiate an edit request, the leader broadcasts the edit request to other users in the system and enters the voting phase.

[0088] Preferably, in another embodiment, the editing request stage further includes the leader Get user identity , based on the verification result of the edit request permission Get user behavior category , classify user behavior and user identity The supervisor will handle it, and the supervisor will update the user's credit score in the credit score list according to the credit score update rules. The values ​​and explanations of user behavior categories are shown in Table 3.

[0089] For example, if you edit the validation result of the requested permission , then the user behavior category ; If the verification result of the edit request permission , then the user behavior category .

[0090] 3. Voting stage.

[0091] After receiving the edit request, other users in the system will check their voting rights. If they have voting rights, they will select a random number for this vote. , calculates a hash value for the edit request , and then use the leader's public key Hash value , random numbers The encrypted voting information is sent to the leader as encrypted voting information. After receiving the encrypted voting information, the leader will check the validity of the vote based on the user's credit score, that is, check whether the user has the right to vote. Invalid votes, that is, votes cast by users without voting rights, will be discarded, and votes cast by users with voting rights are valid votes. The voting results of all valid votes are decrypted by the leader using his own private key. If a set proportion (for example, more than half) of the users agree to the edit request, the voting result is considered to be passed; otherwise, the editing process ends. Finally, the sum of the random numbers in all valid votes is calculated .

[0092] The specific steps are as follows:

[0093] 3-1) When other users in the system receive the edit request broadcast by the leader, they first query the leader for their own credit points based on their user ID to determine whether they have voting authority: other users in the system send their ID to the leader. As a parameter to initiate a reputation query request, the leader queries the reputation list Returns the user's credit score After the user obtains credit points, whether he has voting rights is determined according to the credit point authority classification rules.

[0094] 3-2) If the user has voting rights and agrees to the edit request, a random number is selected for the user's vote. , and using a hash function per edit request Calculating the hash value The user uses the leader's public key Hash value and random numbers Encrypt and generate encrypted voting information , sent to the leader.

[0095] The leader receives the encrypted voting information of the voting users Then, the leader checks the reputation score list to see if the user has voting rights. , get the user's identity Corresponding user credit points , according to the credit points authority classification rules, verify whether the user has voting authority. If the voting authority verification result , that is, the user has voting authority, then the vote is valid; if the voting authority verification result , which means that the user does not have voting authority and the vote is invalid.

[0096] 3-3) For valid encrypted voting information , the leader uses his own private key Decrypt and get the voting results (Agree or Disagree), Hash value of the plain text and random numbers .

[0097] 3-4) The leader votes on all decrypted results Statistics: The leader calculates the random number in the encrypted voting information submitted by all voting users sum If a set proportion (e.g. more than half) of the voting users agree with the edit request, the voting result is considered For passing.

[0098] 4. From the trapdoor generation stage.

[0099] If the vote is passed, the leader will 、Original message and a random string The triples composed of new messages and main trapdoor , generate a new random string , from the trapdoor and witness , then The leader will broadcast the newly generated parameters (new random string and witness ), broadcast to all users, ensuring that all participants can receive and pass the witness Verify the validity of these trapdoor parameters to ensure the integrity and consistency of the blockchain.

[0100] After receiving this information, the user uses the leader's public key , by the hash value of the block 、Original message and a random string The triple composed of the new random string received from the leader broadcast and witness , to verify the legitimacy, that is, to verify the hash value of the block Validity, inspection and witness Is it valid? After the verification results are counted and passed by the leader, the generation of the slave trapdoor is completed.

[0101] The specific steps are as follows:

[0102] 4-1) Generate a new hash tree for the block The root hash value of , where the leaf nodes from left to right are generated by the random number generator Two random numbers generated , , hash value and the identity of the leader . Calculate the signature according to equations (3) and (4) and , output a new random string , from the trapdoor and witness , then Broadcasting.

[0103] (3);

[0104] (4);

[0105] in, It is the block generator’s identity. is the second part of the random string r, i.e. the second parameter in formula (2). and A random number generated when constructing the leader's public key and the master trapdoor; witness , from the trapdoor , new random string ,in is the first part of the random string r, , are two random numbers generated when the block is generated, Represents the concatenation of two bit strings.

[0106] 4-2) The user receives the new random string broadcast by the leader and witness After that, verify the validity of the block’s hash value and check whether the witness wtx is valid:

[0107] Based on the leader's public key , the hash value of the block 、Original message and the new random string received , verify the hash value of the block The validity of Replace , if the equation holds, then the hash value of the block Valid. Check if the witness wtx is valid (using the leader public key examine Signature in Is it valid? Check the hash value of the block With Witness The hash value of the block in Is it equal? ​​Check the witness The root hash value in Is it a hash tree? The root hash value and the new random string The root hash value in Equality; check new random string With hash trees The identity of the leader in Are they equal? ​​If they are both satisfied, output 1; otherwise, output 0).

[0108] 4-4) The verification results of all users are counted by the leader and the number of users who have passed the verification reaches the specified threshold. The verification is passed and the trapdoor generation phase is completed.

[0109] 5. Secret sharing stage.

[0110] The leader distributes the subkey from the trapdoor to each user. After the user receives the subkey from the trapdoor, he needs to verify the distribution process of the subkey from the trapdoor and obtain the subkey from the trapdoor through decryption. , and construct the corresponding proof .

[0111] Preferably, the reputation mechanism module tracks the user's operational behaviors during this process, including whether the verification and decryption steps are compliant, and adjusts the user's reputation points based on these operations.

[0112] The specific steps are as follows:

[0113] 5-1) The leader will distribute the subkeys from the trapdoor to each user:

[0114] Leader selection integer ,in The mapping of is an integer group of order q, let the trapdoor key The number of selections is The polynomial ,in , , t is the minimum number of users required to recover from the trapdoor, t≤n; calculation coefficient commitment value , , is a multiplicative cyclic group Zhongyu Mutually independent generators; encrypt the subkey, the encrypted subkey of the i-th user , , n is the total number of users to whom the trapdoor subkeys are to be distributed, is the public key of the ith user, The number of times is The polynomial of .

[0115] For each , the number of random leader selections , and calculate

[0116] (5);

[0117] use , , , Calculate the common value c 1 :

[0118] (6);

[0119] in, Represents the concatenation of two bit strings. Unless otherwise specified in the following text, is from arrive A hash map of .

[0120] Calculate the response for each user , i=1,2,...,n, and generate a proof of distribution process . It is an integrity proof in secret sharing and encryption protocols, used to verify whether the participants follow the rules when executing the protocol. It ensures that the data has not been tampered with and all steps are executed correctly. It is a zero-knowledge proof used to ensure the security and reliability of the entire process.

[0121] Output encryption subkey , coefficient commitment value , and proof , and broadcast it to the chain.

[0122] 5-2) User verification of the subkey distribution process from the trapdoor:

[0123] Calculate the intermediate parameters:

[0124] (7);

[0125] Verify the public value: Verify whether the following formula is true. If so, the distribution from the trapdoor subkey is successful and outputs 1; otherwise, the distribution fails and outputs 0, and redistribution is required.

[0126] (8);

[0127] 5-3) User performs decryption from the trapdoor subkey:

[0128] The encrypted subkey of the i-th user received by the user , the user's public key and the user's private key As input, calculate the following:

[0129] (9);

[0130] Among them, S i is the decrypted subkey of the i-th user, and the user's public and private key pair satisfies .

[0131] Randomly select a value , calculate the following formula:

[0132] (10);

[0133] (11);

[0134] Generate the proof for the i-th user .

[0135] in, It is an integrity proof used to verify whether the user's operations in the protocol are correct and legal. It ensures that the user has performed the correct calculation steps and has not forged or tampered with the data. It is a form of zero-knowledge proof that ensures the security and credibility of the protocol.

[0136] Output the decrypted subkey of the i-th user And the corresponding proof .

[0137] 6. Editing stage.

[0138] The sum of random numbers broadcast by the leader received by the user , combined with the user's own public key , using a hash function Calculate your own candidate editor hash , and broadcast it and the user's public key to the chain. The user receives the candidate editor hash values ​​broadcast by other users, and integrates them into an array after sorting. Each user then finds the candidate editor with editing rights and the smallest candidate editor hash value from all candidate editors, sends it to the leader for confirmation, and then becomes the editor of this editing request. Then the user will decrypt the subkey Sent to the editor of this edit request.

[0139] The editor of this edit request then recovers the slave trapdoor key S and sends it to the leader. After verification by the leader, the editor obtains the slave trapdoor tk. Calculate new message The corresponding final random string , edit the data and ensure that the data updates in the blockchain are consistent with the hash value.

[0140] The specific steps are as follows:

[0141] 6-1) The user finds out the editor of this edit request.

[0142] The sum of random numbers broadcast by the leader received by the user and the user's public key As input, use the hash function Calculate candidate editor hashes , and broadcast it and the user's public key to the chain.

[0143] The user receives the candidate editor hash values ​​broadcast by other users, sorts them and integrates them into an array .

[0144] Select the candidate with editing rights and the smallest hash value from all candidate editors as the editor of this editing request. The specific steps are: Find the smallest candidate editor hash value among , and obtain the corresponding user public key . Query the reputation score list, if the smallest candidate editor hash value If the corresponding user does not have the right to edit, the request will be deferred to the first user with the right to edit, who will be the editor of this edit request. Sent to the editor of this edit request.

[0145] 6-2) The editor of this editing request performs the recovery operation from the trapdoor key. The specific steps are:

[0146] At least Users The decrypted subkey is the input, where B is the serial number set of the collected decrypted subkeys, is the set of subkey serial numbers distributed by the leader, is the decrypted subkey of the i-th user. The Lagrange interpolation function is used to calculate the trapdoor key , ,

[0147] in, , are the coefficients in the Lagrange interpolation polynomial.

[0148] 6-3) Calculation of new messages by editors The corresponding final random string :

[0149] The editor will recover the trapdoor key Submit to the leader. The leader verifies the equation Is it true? If true, the editor will send a trapdoor . The editor then uses the trapdoor , triple , News ,in , check whether the triple is valid, calculate , , ensuring hash consistency.

[0150] 7. Verification and maintenance phase.

[0151] Supervisors will verify the editing operations, including checking whether the data is consistent, whether the operation is compliant, etc. In this process, the reputation points of relevant users are updated according to the preset reputation point update rules based on the verification results to reward compliant operations and punish illegal behaviors, ensuring the security of the system and the standardization of user behavior.

[0152] Supervisors convert users' behaviors and contributions into reputation points according to the preset reputation points mechanism, and determine the user's authority in the editing process based on the points. Reputation points are calculated based on the user's edit request authority, edit authority, correctness of edits, and participation in voting. The dynamic adjustment of reputation points is achieved through reputation point update rules to ensure that users' behavior in the system complies with regulations and to punish or restrict violations.

[0153] The reputation mechanism of the present invention includes reputation score initialization, reputation score authority classification rules and reputation score update rules.

[0154] When the system is first built, the leader initializes the reputation points. Users can get the reputation value of any node by sending a request to the leader. When the user is editing, he or she queries the reputation points list and determines whether he or she has the permission for the current operation according to the user permission classification rules. Finally, the supervisor updates the reputation points of the user node according to the reputation points update rules.

[0155] The credit score initialization includes: the leader uses a preset random function to set the credit score of each node, sets the credit score of the node to a certain value within the set range, and generates a specific number for each node (for example, 1, 2, 3, ..., N, where N is the number of nodes in the cluster). When a user needs to query the credit score of a node, he can query the credit score of any node by sending a request to the leader.

[0156] The credit score permission classification rule is to divide the user's operation permissions according to the node's credit score. For example:

[0157] Nodes with a reputation score of [0, A) are classified as malicious nodes. They have no voting rights, no edit request rights, and no edit rights. Malicious nodes cannot participate in any part of the editing operation.

[0158] The node with reputation score at [A, B) is classified as a common node, which has voting rights, no edit request rights, and no edit rights. Common nodes can normally perform edit voting and provide sub-keys of sub-slave trapdoors during edit operations.

[0159] Nodes with reputation points in [B, C) are classified as good nodes. They have voting rights, edit request rights, and no edit rights. When there is an edit requirement in the system, a good node can initiate an edit request.

[0160] Nodes with a reputation score of [C, 100] are classified as excellent nodes. They have voting rights, edit request rights, and editing rights. When there is an editing demand in the system, the editor is selected from the excellent nodes.

[0161] Among them, A, B, and C are all positive integers.

[0162] For example, see Table 1, set the initial reputation score of the node in the range of (60, 100), and generate a specific serial number (1, 2, 3, ..., N) for each node. Nodes with a reputation score in the interval [85, 100] are classified as excellent nodes, nodes with a reputation score in the interval [70, 85) are classified as good nodes, nodes with a reputation score in the interval [60, 70) are classified as ordinary nodes, and nodes with a reputation score below 60 are classified as malicious nodes.

[0163] Table 1 User node classification table

[0164]

[0165] The node category permission classification table, see Table 2, grants different permissions in editing operations to nodes of different categories.

[0166] Table 2 Node category permission classification table

[0167]

[0168] Preferably, the credit score update rule includes: classifying user behaviors into different user behavior categories and setting corresponding feedback values ​​reward, which can be positive (credit score encouragement value) or negative (credit score penalty value).

[0169] As shown in Table 3, the user behavior category is a three-digit integer code, and the credit score adjustment value (reward or penalty value) corresponding to the category is reward. Reward can be positive or negative, and can be an integer or a decimal. Note is the explanation of the corresponding user behavior category.

[0170] Among them, user behavior categories are mainly divided into two categories: the first category is malicious behavior, and its corresponding credit point adjustment value reward is negative; the second category is good behavior, and its corresponding credit point adjustment value reward is positive.

[0171] Preferably, the reputation mechanism determines whether the user behavior category belongs to the first category or the second category by distinguishing the highest bit of the user behavior category. When the user behavior category belongs to malicious behavior, the absolute value of the credit score adjustment value reward is generally set to be relatively large, and the reputation mechanism module has a strong punishment for malicious behavior; when the user behavior category belongs to good behavior, the absolute value of the credit score adjustment value reward is generally small, and the user needs to accumulate more good behavior to maintain a relatively healthy credit score. For example, in Table 3, when the highest bit of the user behavior category category is 3, it means malicious behavior, the absolute value of the credit score adjustment value reward is generally set to be relatively large, and the reputation mechanism module has a strong punishment for malicious behavior; when the user behavior category belongs to good behavior, the highest bit of the user behavior category category is 2, the absolute value of the credit score adjustment value reward is generally small, and the user needs to accumulate more good behavior to maintain a relatively healthy credit score.

[0172] When a node has illegal operations in the editing operation, the node's reputation score adjustment value is deducted. The evaluation behavior of a malicious node is that it has multiple illegal operations in the editing operation so that the reputation score is reduced to the corresponding reputation score range of the malicious node.

[0173] Table 3 Credit score update rules

[0174]

[0175] Supervisors verify editing operations and maintain user node reputation points, including the following steps:

[0176] 7-1) Supervisors verify the legitimacy of the editor’s hash value.

[0177] In this operation, the candidate editor hash table is first Remove the hash values ​​of users who do not have editing permissions, and then sort the remaining hash values ​​to get a hash value array Next, check the hash of the selected editor Is it If yes, the editing operation is legal, and the corresponding user behavior category (e.g. 202) is output. Otherwise, the corresponding user behavior category (e.g. 302) of the editing operation is output. Output the user identity of the editor , User behavior categories Will be used for subsequent credit point maintenance.

[0178] 7-2) Supervisor verifies hash consistency and subkey correctness.

[0179] The supervisor uses the public key , two triplets and ,witness and evidence , verify hash consistency and subkey correctness, and output hash consistency verification results And subkey correctness verification results .include:

[0180] To verify hash consistency, check the following four items:

[0181] Checking triples Is it valid? That is, use its parameters to replace the corresponding original parameters in formula (1). For example, use In replace , replace , verify whether formula (1) holds;

[0182] Check two triplets and With Witness In Whether the values ​​are equal;

[0183] Inspection Witness and , In whether they are equal;

[0184] examine and In Are they equal?

[0185] If all four of the above items are passed, the hash consistency verification result for , that is, the hash consistency verification is passed, otherwise , hash consistency verification failed.

[0186] Verify the correctness of the subkey value by checking whether the following equation holds. If true, the subkey correctness verification result is for , that is, the subkey value is correct, otherwise , that is, the subkey value is incorrect.

[0187]

[0188] Among them, c 2 , Z i Proof for the i-th user The parameters in is the public key of the ith user, S iis the decrypted subkey of the i-th user, Y i is the encryption subkey of the i-th user.

[0189] 7-3) Supervisors verify the legality of edits.

[0190] If the subkey correctness verification result for , then the subkey is incorrect, and the corresponding user behavior category (such as 304) and the editor's user ID are output. Proof for the i-th user The user ID of the provider.

[0191] If the subkey correctness verification result for The hash consistency verification result for , then the subkey is correct, but the hash consistency fails, so the editor is punished and the corresponding user behavior category (such as 303) and the editor's user ID are output. The user ID of the editor.

[0192] If the subkey correctness verification result And hash consistency verification results Both , it means that the subkey is correct and the hash consistency passes, the editor and the subkey provider are rewarded, and the corresponding user behavior category (for example, 204) and the editor's user ID are output.

[0193] 7-4) The supervisor updates the reputation score and sends it to the leader.

[0194] Supervisors classify users according to their behavior , the editor's user ID and reputation points list , maintain the credit score list according to the credit score update rules and generate a new credit score list and send it to the leader.

[0195] The editable blockchain editing method, system and device with dynamic editing rights of the present invention use a master-slave trapdoor method. The master trapdoor will not be shared with any other user. During the editing process, a slave trapdoor is generated according to a new message of the editing request, and then the secret of the slave trapdoor is shared. The editor performs editing operations according to the restored slave trapdoor. This method prevents the master trapdoor from being leaked, and users cannot modify data that has not undergone a legal editing process according to the slave trapdoor, which is beneficial to the security of on-chain data in the editable blockchain system.

[0196] The editable blockchain editing method, system and device with dynamic editing rights of the present invention dynamically maintain the user's reputation points by introducing a reputation mechanism module, rewarding compliant operations and punishing illegal behaviors, ensuring the security of the system and the standardization of user behavior, and ensuring the stability of the entire system. Through the reputation points authority classification rules, users are given dynamic editing rights, editing request rights, and voting rights, which is beneficial to the data security of the editable blockchain system.

[0197] In some embodiments, certain aspects of the above-mentioned techniques may be implemented by one or more processors of a processing system executing software. The software includes one or more executable instruction sets stored or otherwise tangibly implemented on a non-transitory computer-readable storage medium. The software may include instructions and certain data that manipulate one or more processors to perform one or more aspects of the above-mentioned techniques when executed by one or more processors. Non-transitory computer-readable storage media may include, for example, magnetic or optical disk storage devices, solid-state storage devices such as flash memory, cache, random access memory (RAM), or other non-volatile memory devices. The executable instructions stored on the non-transitory computer-readable storage medium may be source code, assembly language code, object code, or other instruction formats interpreted or otherwise executed by one or more processors.

[0198] Computer-readable storage media may include any storage medium or combination of storage media that can be accessed by a computer system during use to provide instructions and / or data to the computer system. Such storage media may include, but are not limited to, optical media (e.g., compact disks (CDs), digital versatile disks (DVDs), Blu-ray disks), magnetic media (e.g., floppy disks, tapes, or magnetic hard drives), volatile memory (e.g., random access memory (RAM) or cache), non-volatile memory (e.g., read-only memory (ROM) or flash memory), or micro-electromechanical system (MEMS)-based storage media. Computer-readable storage media may be embedded in a computing system (e.g., system RAM or ROM), fixedly attached to a computing system (e.g., a magnetic hard drive), removably attached to a computing system (e.g., an optical disk or a universal serial bus (USB)-based flash memory), or coupled to a computer system via a wired or wireless network (e.g., network accessible storage (NAS)).

[0199] Please note that not all activities or elements in the general description above are required, that a portion of a particular activity or device may not be required, and that one or more further activities or included elements may be performed in addition to those described. Further, the order in which the activities are listed is not necessarily the order in which they are performed. Moreover, these concepts have been described with reference to specific embodiments. However, those of ordinary skill in the art recognize that various modifications and changes may be made without departing from the scope of the present disclosure as set forth in the following claims. Therefore, the specification and drawings are to be regarded as illustrative rather than restrictive, and all such modifications are included within the scope of the present disclosure.

[0200] Benefits, other advantages, and solutions to problems have been described above with respect to specific embodiments. However, benefits, advantages, solutions to problems, and any features that may cause any benefit, advantage, or solution to occur or become more apparent should not be construed as key, essential, or essential features of any or all claims in any or other respects. In addition, the specific embodiments disclosed above are merely illustrative, as the disclosed subject matter may be modified and implemented in different but equivalent ways that are apparent to those skilled in the art having the benefit of the teachings herein. There is no intention to limit the details of construction or design shown herein, except as described in the claims. It is therefore apparent that the specific embodiments disclosed above may be altered or modified, and all such variations are considered to be within the scope of the disclosed subject matter.

Claims

1. A method for editing an editable blockchain with dynamic editing rights, characterized in that: include: Main trapdoor generation phase: The leader selects a multiplication cycle group based on the security parameters of the editable block system and , and The order is , the generator is , set up the bilinear map , choose a hash function and , Indicates the order Unit groups, and secure pseudo-random number generators , output common parameters ; Generate three random numbers ,in , and calculate ; Generate a signature key pair using public parameters , and then construct the leader's public key and main trapdoor ; Edit request stage: When a user needs to edit data on the blockchain, he first queries the leader for his credit points, and determines the user authority corresponding to the credit points according to the preset credit point authority classification rules to determine whether he has the right to initiate an edit request. The user who has the right to initiate an edit request will identify his identity. 、Original message 、New message you want to modify The edit request is packaged and sent to the leader; the leader queries the user's credit score to verify whether the user has the authority to initiate the edit request. If so, the edit request is broadcast to other users in the system and enters the voting phase; Voting stage: After receiving the edit request, other users in the system will check their voting rights. If they have voting rights, a random number will be selected for the user. , using a hash function for edit requests Calculate a hash value , and then use the leader's public key Hash value , random numbers The encrypted vote is sent to the leader as encrypted voting information. After receiving the encrypted voting information, the leader checks whether the user has voting rights based on the user's credit score. The votes cast by users without voting rights will be discarded, and the votes cast by users with voting rights are valid votes. The voting results of all valid votes are decrypted by the leader using the leader's private key. If a set proportion of users agree to the edit request, the voting result is considered passed; otherwise, the process ends. Calculate the sum of random numbers in all valid votes ; From the trapdoor generation phase: If the vote is passed, the leader 、Original message and a random string The triples composed of new messages and main trapdoor , generate a new random string , from the trapdoor and witness , and then generate a new random string ,witness Broadcast; after receiving, the user uses the leader's public key , by the hash value of the block 、Original message and a random string The triplet composed of the new random string received and witness , verify the hash value of the block Validity, inspection and witness Is it valid? After the verification result is counted and passed by the leader, the generation of the slave trapdoor is completed. Secret sharing phase: The leader distributes the subkey of the trapdoor to each user; after receiving the subkey of the trapdoor, the user verifies the distribution process of the subkey of the trapdoor and obtains the subkey of the trapdoor through decryption. , and construct the corresponding proof ; Edit phase: The user receives the sum of the random numbers broadcast by the leader , combined with the user's own public key , calculate its own candidate editor hash value, and broadcast it and the user's public key to the chain; the user receives the candidate editor hash values ​​of other users broadcasted by other users, and integrates them into an array after sorting; Each user then finds the candidate editor with the editing rights and the smallest hash value from all candidate editors, sends it to the leader for confirmation, and then becomes the editor of this editing request. The user then uses the decrypted subkey Sent to the editor of this edit request; the editor of this edit request subsequently recovers the trapdoor key And send it to the leader, after the leader verifies it, get it from the trapdoor ; Then according to the trapdoor Calculate new message The corresponding final random string , perform data editing; Verification and maintenance reputation stage: Supervisors verify the editing operations. During this process, the reputation points of relevant users are updated according to the preset reputation point update rules based on the verification results to reward compliant operations and punish violations.

2. The method for editing an editable blockchain with dynamic editing rights according to claim 1, characterized in that: The credit points authority classification rules are as follows: Nodes with a reputation score of [0, A) are classified as malicious nodes, and have no voting rights, no edit request rights, and no edit rights; The node with reputation points at [A, B) is classified as a common node. This node has voting rights, but no edit request rights and no edit rights. The node with reputation score in [B, C) is classified as a good node, which has voting rights, edit request rights, but no editing rights; Nodes with a reputation score of [C, 100] are classified as excellent nodes, and have voting rights, edit request rights, and edit rights; Among them, A, B, and C are all positive integers.

3. The method for editing an editable blockchain with dynamic editing rights according to claim 1, characterized in that: The credit score update rule includes: classifying user behaviors into different user behavior categories and setting corresponding feedback values, which are positive or negative; Among them, user behavior categories are mainly divided into two categories: the first category is malicious behavior, and its corresponding credit score adjustment value is negative; the second category is good behavior, and its corresponding credit score adjustment value is positive; The absolute value of the credit score adjustment value corresponding to a malicious behavior is set to be greater than the absolute value of the credit score adjustment value corresponding to a good behavior.

4. The method for editing an editable blockchain with dynamic editing rights according to claim 3, characterized in that: The editing request stage also includes the leader sending the verification result according to the editing request authority to the supervisor, and the supervisor updating the user's reputation points according to the reputation point update rule.

5. The method for editing an editable blockchain with dynamic editing rights according to claim 1, characterized in that: The leader is determined by the hash value of the block 、Original message and a random string The triples composed of new messages and main trapdoor , generate a new random string , from the trapdoor and witness ,include: Generate a new hash tree for the block The root hash value of , where the leaf nodes from left to right are generated by the random number generator Two random numbers generated , , hash value and the identity of the leader ; Calculate the signature according to equations (3) and (4) and , output a new random string , from the trapdoor and witness , then to broadcast; (3); (4); in, It is the identity of the block producer. is the root hash value of the block hash tree M, is the second part of the random string r, and A random number generated when constructing the leader's public key and the master trapdoor; witness , from the trapdoor , new random string ,in is the first part of the random string r, , are two random numbers generated when the block is generated, Represents the concatenation of two bit strings.

6. The method for editing an editable blockchain with dynamic editing rights according to claim 5, characterized in that: The leader distributes the subkey from the trapdoor to each user; after receiving the subkey from the trapdoor, the user verifies the distribution process of the subkey from the trapdoor and obtains the subkey from the trapdoor by decryption. , and construct the corresponding proof ,include: 5-1) The leader will distribute the subkeys from the trapdoor to each user: Leader selection integer ,in The mapping of is an integer group of order q, let the trapdoor key ; The number of selections is The polynomial ,in , , t is the minimum number of users required to recover from the trapdoor, t≤n; calculation coefficient commitment value , , is a multiplicative cyclic group Zhongyu Mutually independent generators; encrypt the subkey, the encrypted subkey of the i-th user , , n is the total number of users to whom the trapdoor subkeys are to be distributed, is the public key of the ith user, The number of times is polynomial of ; For each , the number of random leader selections , and calculate the following formula: (5); use , , , Calculate the common value c1: (6); in, Represents the concatenation of two bit strings; is from arrive A hash map of Calculate the response for each user , i=1,2,...,n, and generate a proof of distribution process ; Output encryption subkey , coefficient commitment value , and proof , and broadcast it to the chain; 5-2) User verification of the subkey distribution process from the trapdoor: Calculate the intermediate parameters: (7); Verify the public value: Verify whether the following formula is true. If so, the distribution from the trapdoor subkey is successful; otherwise, the distribution fails and redistribution is performed: (8); 5-3) User performs decryption from the trapdoor subkey: The encrypted subkey of the i-th user received by the user , the user's public key and the user's private key As input, calculate the following: (9); Among them, S i is the decrypted subkey of the i-th user, and the user's public and private key pair satisfies ; Randomly select a value , calculate the following formula: (10); (11); Generate the proof for the i-th user .

7. The method for editing an editable blockchain with dynamic editing rights according to claim 1, characterized in that: The editing request stage also includes: the leader obtains the user identity according to the editing request, obtains the user behavior category according to the verification result of the editing request authority, and hands the user behavior category and user identity to the supervisor for processing. The supervisor updates the credit points according to the credit points update rules.

8. An editable blockchain system with dynamic editing rights, implementing an editable blockchain editing method with dynamic editing rights according to any one of claims 1-7, characterized in that: Includes leaders, users, and supervisors; The leader, as the leader of the editing operation, is responsible for generating the master trapdoor and slave trapdoor of the Chameleon hash function, secretly sharing the slave trapdoor, saving the credit score list of all users, responding to the credit score query request of the user, counting the voting results and calculating the sum of random numbers; The user is a user node in the blockchain network, and is divided into different node categories according to its role and behavior in the blockchain editable system. Users of different node categories have different permissions and responsibilities in the system; All users have credit points. According to the preset credit point authority classification rules, the user's authority is divided. Users vote on editing operations, initiate editing requests, and perform editing operations according to their corresponding authority. The supervisor maintains the user's reputation points and updates the corresponding user's reputation points according to the user's behavior category and preset reputation point update rules.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps of the editable blockchain editing method with dynamic editing rights according to any one of claims 1 to 7 are implemented.

10. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by the processor, the steps of the editable blockchain editing method with dynamic editing rights according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Multiple-link cryptologic blockchain

    CN109417478A

  • Multiple-Phase Rewritable Blockchain

    CN109428892A

  • Lattice-based changeable block chain method

    CN110572254A

  • Distributed on-chain information editing consensus method and system of editable block chain

    CN118074945A

  • Turn-control rewritable blockchain

    EP3451578A1

Cited By

  • Block chain data editing method and device, storage medium and program product

    CN122457391A

  • Blockchain data editing method and device, storage medium and program product

    CN122457391B