Credit credibility verification method based on Merkel tree
By using Merkel tree to build a hash tree for credit records in credit management, the problems of opaque information, easy to tamper with and verification difficulties in traditional credit management are solved, and higher data integrity and security are achieved, and traceable historical record management is supported.
Patent Information
- Application Number
- CN202510646365.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-06-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional credit management method has problems such as information opacity, tampering, and difficulty in verification, which affects the authenticity and reliability of credits.
Using the Merkel tree-based credit trusted verification method, by building the Merkel tree, calculating the hash value and root hash value of each node, any modification will cause changes in the root hash value, which will be easily discovered, and the modified credit record is located through recursive inspection.
Improves data integrity and security, greatly reduces the risk of tampering with credit records, and ensures traceability of all history records through the maintenance of history.
Smart Images

Figure CN120162836A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of credit management, and in particular relates to a credit trust verification method based on a Merkle tree. Background Art
[0002] With the rapid development of information technology, the digitization of educational data has become a trend. Among them, credits, as an important indicator to measure students' academic achievements, play a vital role in academic exchanges, degree certification and job hunting.
[0003] Traditional credit management methods, such as the method for managing college students' innovation and entrepreneurship credits based on blockchain technology published in the invention patent application with application publication number CN113807706A, include the following steps: students log in to the system, and based on their own actual situation, fill in the innovation and entrepreneurship file truthfully in the corresponding innovation and entrepreneurship credit category, and submit the application file; after submitting the application file, the credit information will be fed back to the college port, and the system will automatically summarize the application files of all corresponding grades in each college, and generate an electronic form for unified review by the college. After the student downloads and prints the transcript, if there is no problem, please sign it with the instructor and submit it to the college to complete the credit verification; if there is an error in the file information during the review stage, the relevant person in charge of the college will count the erroneous file information and hand it over to the administrator for return or deletion; after the review period ends, the student will be able to obtain the final innovation and entrepreneurship credit transcript, and this round of student innovation and entrepreneurship credit statistics and analysis work is completed.
[0004] Traditional credit management methods have many shortcomings, such as information opacity, easy tampering, and difficult verification. These problems not only affect the authenticity and reliability of credits, but also bring great inconvenience to educational institutions and students. Summary of the invention
[0005] The purpose of the present invention is to provide a credit credible verification method based on Merkle tree to solve the problems of information opacity, easy tampering, and verification difficulty existing in traditional credit management methods.
[0006] In order to achieve the above object, the technical solution of the present invention is as follows: The present invention relates to a credit trust verification method based on a Merkle tree, comprising the following steps: S1. Obtain the student's credit record, construct a Merkle tree with the credit record as a leaf node, calculate the hash value of each node of the Merkle tree and the root hash value of the Merkle tree and record them; S2. Request verification of a certain credit record, that is, request to provide the Merkle path corresponding to the credit record; S3. Determine whether the root hash value of the current Merkle tree matches the known correct root hash value. If it matches, confirm that the credit record is true and valid and maintain the credit record; if it does not match, proceed to S4; S4. Locate the modified credit record by recursively checking the hash values of the affected nodes; S5. Recalculate the hash values of each node on the Merkle path where the modified credit record is located in the manner of S1, and update the root hash value of the Merkle tree; S6. Compare the recalculated root hash value with the known root hash value stored on the blockchain. If they are the same, update the credit record; if they are different, handle the abnormal credit record.
[0007] Preferably, the specific steps of S1 for calculating the hash value of each node of the Merkle tree and the root hash value of the Merkle tree are as follows: S1.1. Convert each credit record into the corresponding hash value and use it as a leaf node. The formula for the leaf hash value is: Hash leaf = Hash (Course name + Credits), where, Hash leaf represents the hash value of the leaf node, Hash (·) represents the hash value calculation function, which is used to encrypt the data including the course name, credit record and weight; S1.2. For each group of adjacent nodes, merge the hash values to form a parent node. The formula for merging the hash values is: H ij t+1 = Hash ( H i t + H j t ), where, i and j respectively represent the numbers of two adjacent nodes, H i and H j respectively represent the hash values of two adjacent nodes i and j , Hash (·) represents the hash value calculation function, t represents the node layer number, H ij represents the combination of two adjacent nodes i and jHash value of the combined parent node S1.3. Determine whether there is only one parent node. If not, return to S1.2. If so, use the unique parent node as the root node, and use the hash value corresponding to the root node as the root hash value of the Merkle tree.
[0008] Preferably, the Merkle path in S2 includes the hash values of all intermediate nodes from the leaf node to the root node.
[0009] Preferably, when the S2 requests to verify a certain credit record, it also requests the signature information of the credit provider. The signature information of the transferor refers to the digital signature signed by the credit owner using the private key; after the S6 updates the root hash value of the Merkle tree, verify the digital signature signed by the credit provider using the private key. If they are consistent, the credit record will be maintained; if they are inconsistent, re-recognize and modify the credit, and re-sign and verify at the same time.
[0010] Preferably, the specific steps for the S4 to locate the modified credit record by recursively checking the hash values of the affected nodes are as follows: start from the root node and check layer by layer downward whether the hash value of each node has changed. When it is found that the hash value of a certain level has changed, enter the affected branch in that level and continue to check until the modified leaf node is found.
[0011] Preferably, after the S6 updates the credit record, use the original credit record and the root hash value corresponding to the original credit record as historical records, and then form a detailed change record of the credit record.
[0012] Adopting the technical solution provided by the present invention, compared with the prior art, it has the following beneficial effects: 1. The credit trusted verification method based on the Merkle tree involved in the present invention constructs a Merkle tree with credit records as leaf nodes, calculates the hash value of each node of the Merkle tree and the root hash value of the Merkle tree and records them. Any modification will cause a change in the root hash value, so it can be easily discovered. Compared with the traditional centralized database, the credit record is more difficult to tamper with; when verifying a certain credit record, provide the corresponding Merkle path, and use the method of recursively checking the hash values of the affected nodes to locate the modified credit record, which can quickly detect and locate any possible data tampering behavior, greatly improving data integrity and security.
[0013] 2. The credit trusted verification method based on the Merkle tree involved in the present invention, after updating the credit record, uses the original credit record and the root hash value corresponding to the original credit record as historical records, and then forms a detailed change record of the credit record to ensure that all historical records are traceable, which helps to build a more open and trustworthy education ecosystem. Description of the Drawings
[0014] Figure 1 It is a schematic flow chart of the credit trustworthy verification method based on the Merkle tree of the present invention; Figure 2 It is a schematic diagram of the construction and adjustment of the Merkle tree of the present invention. Specific embodiments
[0015] To further understand the content of the present invention, the present invention will be described in detail in combination with embodiments. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.
[0016] Refer to the appendix Figure 1 As shown, the present invention relates to a credit trustworthy verification method based on a Merkle tree, including the following steps: S1. Obtain credit records from educational institutions or students. The credit records include detailed information such as students' personal information, course names, credits, etc.; construct a Merkle tree with the credit records as leaf nodes, calculate the hash value of each node of the Merkle tree and the root hash value of the Merkle tree and record them. As Figure 2 shown, specifically including: S1.1. Convert each credit record into a corresponding hash value and use it as a leaf node of the Merkle tree. The formula for the leaf hash value is: Hash leaf = Hash (Course name + credit), where Hash leaf represents the hash value of the leaf node, Hash (·) represents a hash value calculation function for encrypting data containing course names and credit records, and + represents a string concatenation operation.
[0017] In this embodiment, taking four credit records as an example, the four credit records are credit record A, credit record B, credit record C, and credit record D respectively, and the calculated hash values are represented by hash value A, hash value B, hash value C, and hash value D respectively; S1.2. For each group of adjacent nodes, merge the hash values to form a parent node. The formula for merging the hash values is: H ij t+1 = Hash ( H i t + H j t ), where i and j represent the numbers of two adjacent nodes respectively, Hi and H j respectively represent the hash values of two adjacent nodes i and j ; Hash (·) represents the hash value calculation function, t represents the node layer number, H ij represents the hash value of the parent node formed by combining two adjacent nodes i and j ; In this embodiment, hash value A and hash value B are combined to form hash value AB, and hash value C and hash value D are combined to form hash value CD; S1.3. Determine whether there is only one parent node. If not, return to S1.2. If so, use the only parent node as the root node, and use the hash value corresponding to the root node as the root hash value of the Merkle tree; Through the above steps, an initial Merkle tree is formed. This hierarchical data organization method can not only effectively manage and protect a large number of students' credit records, but also significantly improve the detection efficiency of data tampering behavior. Once a credit record is modified, the change in its hash value will spread along the path from the leaf node to the root node, resulting in a change in the root hash value, so that the tampering behavior can be quickly discovered and located.
[0018] In addition, the concept of Merkle path is introduced, that is, providing information on the hash values of a specific credit record and its sibling nodes makes it possible to reconstruct the hash value from the leaf node to the root node.
[0019] S2. Determine whether it is necessary to verify the credit record. If not, maintain the current state and listen for the next event. If so, request to verify a certain credit record, that is, request to provide the Merkle path corresponding to the credit record and the signature information of the transferor; among them, the Merkle path includes the hash values of all intermediate nodes from the leaf node to the root node; the signature information of the transferor refers to the digital signature signed by the credit owner using the private key.
[0020] S3. Determine whether the root hash value of the current Merkle tree matches the known correct root hash value. If it matches, confirm that the credit record is true and valid and maintain the credit record. If it does not match, enter S4; S4. Locate the modified credit record by recursively checking the hash values of the affected nodes. The specific steps are as follows: Starting from the root node, check whether the hash value of each node changes layer by layer from top to bottom. When it is found that the hash value of a certain level changes, enter the affected branch at this level and continue to check until the modified leaf node is found. This method first determines the range of affected nodes, and then gradually recursively checks the hash values of these nodes until the exact position of the leaf node is found. In addition, the differential hash comparison technology is introduced. The old hash values of each intermediate node are cached, and the parts that actually change are compared. If the hash values are different, continue to check the child nodes downward until the specific difference point is found. Only the nodes on the affected path need to be calculated, without recalculating the entire Merkle tree, thereby further improving the location efficiency.
[0021] S5. Recalculate the hash values of each node on the Merkle path where the modified credit record is located in the manner of S1, and update the root hash value of the Merkle tree. Specifically: Starting from the leaf node, gradually calculate upward using the provided hash values; calculate the hash values of two adjacent nodes each time, and generate a new parent node hash value; finally, obtain the new root hash value.
[0022] After updating the root hash value of the Merkle tree, compare the recalculated root hash value with the known root hash value stored on the blockchain. At the same time, verify the digital signature signed by the credit owner using the private key. If both are consistent, confirm that the credit record is true and valid, maintain the updated credit record, and use the original credit record and the corresponding root hash value of the original credit record as historical records to form a detailed change record of the credit record; if the comparison result of the root hash values is inconsistent or the digital signature is inconsistent, it is determined that the updated credit record is an abnormal credit, and the abnormal credit is processed, that is, locate the error node from the Merkle tree path according to the steps of S4, modify it again according to the course name and credits certified by the institution or school, and perform re-signature verification.
[0023] Considering the need to modify course credits or add nodes, the present invention designs a set of mechanisms to support the adjustment mechanism of the Merkle tree. When the credits of some courses change, the hash values of the relevant nodes need to be recalculated and updated to the Merkle tree to ensure the latestness of the root hash value. Such as Figure 2As shown, in this embodiment, the credit record B needs to be changed. First, calculate the hash value corresponding to the credit record B to form a new leaf node. The new hash value corresponding to the credit record B is represented by the new hash value B. Then, update the hash value of the parent node, which is represented by the new hash value AB, and update the hash value of the root node, which is represented by the new root hash value. Finally, update to obtain the latest Merkle tree. At the same time, if there is a need to add a new node with a credit record of E, resulting in an odd number of data blocks, it can be copied to perform combined calculations to form a hash value EE, and then merged with other hash values. Finally, update some of the nodes that need to be updated according to the Merkle tree path to obtain the latest Merkle tree.
[0024] This feature not only enhances the flexibility and adaptability of the method, meeting the needs of different schools and institutions for credit management, but also supports complex historical data analysis and auditing work. After each adjustment, only the hash value link of the affected part needs to be updated, rather than reconstructing the entire Merkle tree, which greatly saves computing resources and time costs. Therefore, even in the face of frequently changing credits, it can maintain efficient operation and accurate data.
[0025] The present invention has been described in detail above in conjunction with the embodiments, but the content described is only the preferred embodiment of the present invention and cannot be considered as limiting the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the application of the present invention shall still fall within the scope covered by the patent of the present invention.
Claims
1. A credit trust verification method based on Merkle tree, characterized in that: The following steps are involved: S1. Obtain the student's credit record, construct a Merkle tree with the credit record as a leaf node, calculate the hash value of each node of the Merkle tree and the root hash value of the Merkle tree and record them; S2. Request verification of a certain credit record, that is, request to provide the Merkle path corresponding to the credit record; S3. Determine whether the root hash value of the current Merkle tree matches the known correct root hash value. If so, confirm that the credit record is authentic and valid and maintain the credit record; if not, proceed to S4; S4. Locate the modified credit record by recursively checking the hash value of the affected node; S5. Recalculate the hash value of each node on the Merkle path where the modified credit record is located according to S1, and update the root hash value of the Merkle tree; S6. Compare the recalculated root hash value with the known root hash value stored on the blockchain. If they are consistent, update the credit record; If there is any inconsistency, handle the abnormal credit records.
2. The credit trust verification method based on Merkle tree according to claim 1 is characterized in that: The specific steps of S1 calculating the hash value of each node of the Merkle tree and the root hash value of the Merkle tree are: S1.
1. Convert each credit record into a corresponding hash value and use it as a leaf node. The formula for the leaf hash value is: Hash leaf = Hash (Course Name + Credits), in, Hash leaf Represented as the hash value of the leaf node, Hash (·) represents a hash value calculation function, which is used to encrypt data including course names, credit records and weights; S1.
2. For each group of adjacent nodes, merge the hash values to form the parent node. The formula for merging the hash values is: H ij t +1 = Hash ( H i t + H j t ), in, i and j Represent the numbers of two adjacent nodes respectively. H i and H j Represents two adjacent nodes i and j The hash value of Hash (·) indicates the hash value calculation function, + indicates the string concatenation operation, t Indicates the number of node layers, H ij Represents two adjacent nodes i and j The hash value of the parent node formed by the combination; S1.
3. Determine whether there is only one parent node. If not, return to S1.
2. If so, take the only parent node as the root node and the hash value corresponding to the root node as the root hash value of the Merkle tree.
3. The credit trust verification method based on Merkle tree according to claim 2 is characterized in that: The Merkle path in S2 includes hash values of all intermediate nodes from the leaf node to the root node.
4. The credit trust verification method based on Merkle tree according to claim 2 is characterized in that: When S2 requests verification of a certain credit record, it also requests the signature information of the credit provider, which refers to the digital signature signed by the school or institution using a private key; after S6 updates the root hash value of the Merkle tree, it verifies the digital signature signed by the credit provider using the private key, and if they are consistent, the credit record will be maintained; If there is any inconsistency, the credits will be re-recognized and modified, and re-signed for verification.
5. The credit trust verification method based on Merkle tree according to claim 1 is characterized in that: The specific steps of S4 locating the modified credit record by recursively checking the hash values of the affected nodes are: starting from the root node, check whether the hash value of each node has changed layer by layer. When it is found that the hash value of a certain level has changed, enter the affected branch in the level and continue checking until the modified leaf node is found.
6. The credit trust verification method based on Merkle tree according to claim 1 is characterized in that: After the credit record is updated in S6, the original credit record and the root hash value corresponding to the original credit record are recorded as historical records, thereby forming a detailed change record of the credit record.
Citation Information
Patent Citations
College student innovation and entrepreneurship credit management system and method based on block chain technology
CN113807706A
School educational administration data processing system based on cloud computing
CN117408846A
Infant motion detection data management system and method based on block chain technology
CN117421756A
Multi-brand marketing sharing system and method thereof
CN119671640A
Decentralized talent background survey data storage and verification method and system
CN119892491A
Cited By
Block chain-based multi-path semantic retrieval credible collaborative verification method for RAG system
CN121327118A