Hash tree-based blockchain timestamp authentication method, apparatus, device, and medium

By using a hash tree structure to compress the hash values ​​of multiple files into a single root node and store it on the blockchain, the problem of high storage pressure on the blockchain is solved, and efficient timestamp authentication and file verification are achieved.

WO2026241969A1PCT designated stage Publication Date: 2026-11-26TRUSTCOM TECHPTE LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/096333
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

Existing blockchain timestamp authentication schemes result in large blockchain storage space consumption and high storage pressure, making it difficult to meet the timeliness requirements in high-concurrency scenarios.

Method used

A blockchain timestamp authentication method based on hash trees is adopted. By calculating the hash value of digital files and constructing a hash tree, the hash values ​​of multiple files are aggregated into the root node of the hash tree and stored in the blockchain. The hierarchical characteristics of the hash tree are used for verification.

Benefits of technology

Significantly reduces the storage footprint of the blockchain, lowers network transmission overhead, improves verification speed, ensures the integrity and credibility of file timestamps, and lays the foundation for subsequent scalable applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025096333_26112026_PF_FP_ABST
    Figure CN2025096333_26112026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present invention relate to the technical field of trusted authentication, and disclosed are a hash tree-based blockchain timestamp authentication method, an apparatus, a device, and a medium. The method comprises: acquiring digital files to be timestamped, and calculating a hash value of each of the digital files; separately determining a leaf node on the basis of the hash value of each of the digital files; and constructing a hash tree on the basis of all leaf nodes, and storing a root node of the hash tree in a blockchain. The present solution compresses the hash values of multiple files into a single root node by means of a hash tree structure, and then writes the root node into a blockchain, thereby greatly reducing the storage footprint of the blockchain, and reducing network transmission overhead. In addition, the root node, as a globally unique identifier, is combined with the immutability of the blockchain, such that the integrity and trustworthiness of all file timestamps are ensured, thereby laying a foundation for subsequent scalable applications.
Need to check novelty before this filing date? Find Prior Art

Description

Hash Tree-Based Blockchain Timestamp Authentication Method, Apparatus, Equipment, and Medium Technical Field

[0001] This invention relates to the field of trusted authentication technology, and in particular to a blockchain timestamp authentication method, apparatus, device, and medium based on hash trees. Background Technology

[0002] Blockchain technology, due to its immutability and decentralization, is widely used in the field of timestamp authentication of digital files. Traditional solutions typically write the hash value of the file to be authenticated directly into the blockchain, using the blockchain's global timestamp mechanism to prove the file's existence at a specific point in time. However, this approach requires storing a hash value separately for each file, leading to low blockchain storage efficiency. Specifically, users need to generate a unique hash value for each file and store it in the blockchain, permanently recording it in blocks through a consensus mechanism. While this method ensures the timeliness and authenticity of files, it has gradually revealed significant technical bottlenecks in practical applications.

[0003] Existing solutions require each file to have its hash value generated and recorded separately, resulting in a linear increase in blockchain space usage. Numerous repetitive operations not only consume network bandwidth resources but also exacerbate the storage pressure on the blockchain system. As file size increases, the accumulation of redundant data quickly saturates block capacity, limiting the overall system throughput and making it difficult to meet the timeliness requirements of high-concurrency scenarios. Summary of the Invention

[0004] This invention provides a blockchain timestamp authentication method, apparatus, device, and medium based on hash trees, aiming to solve the problem of large storage pressure on blockchain systems caused by the large space occupation of existing timestamp authentication.

[0005] In a first aspect, embodiments of the present invention provide a blockchain timestamp authentication method based on a hash tree, comprising:

[0006] Obtain the digital files to be tagged with timestamps, and calculate the hash value of each digital file;

[0007] A leaf node is determined based on the hash value of each of the digital files;

[0008] A hash tree is constructed based on all the leaf nodes, and the root node of the hash tree is stored in the blockchain.

[0009] A further technical solution is that determining a leaf node based on the hash value of each digital file includes:

[0010] Assign a random number to the hash value of the digital file;

[0011] The hash value of the digital file is combined with the corresponding random number to obtain the number of combinations;

[0012] The hash value of the combination number is calculated as a leaf node.

[0013] A further technical solution is that, after constructing the hash tree based on all leaf nodes, the method further includes:

[0014] Insert randomly generated leaf nodes and / or branches into the hash tree.

[0015] A further technical solution is that the construction of a hash tree based on all leaf nodes includes:

[0016] Divide all leaf nodes into multiple categories;

[0017] Construct a sub-hash tree based on the leaf nodes of each of the aforementioned categories;

[0018] The hash tree is constructed by using the root node of each of the sub-hash trees as a leaf node.

[0019] A further technical solution is that, before obtaining the digital file to be tagged with timestamps, the method further includes:

[0020] Add the public key and digital signature of the target object to the digital file.

[0021] A further technical solution is that the method further includes:

[0022] Upon receiving a verification request, the verification request includes the hash value of the target digital file and the corresponding random number;

[0023] Obtain the root node of the hash tree from the blockchain, and verify the trustworthiness of the target digital file based on the root node, the hash value of the target digital file, and the corresponding random number.

[0024] A further technical solution is that verifying the trustworthiness of the target digital file based on the root node, the hash value of the target digital file, and the corresponding random number includes:

[0025] Determine the branch in the hash tree corresponding to the target digital file;

[0026] Verification nodes are obtained based on the hash value, random number, and branch calculation of the target digital file. The verification nodes include intermediate verification nodes and root verification nodes.

[0027] If the verification root node is the same as the root node of the hash tree, the target digital file is determined to be trustworthy.

[0028] If the verification root node is not the same as the root node of the hash tree, and / or the verification intermediate node is not the same as the corresponding intermediate node of the hash tree, the target digital file is determined to be untrustworthy.

[0029] Secondly, embodiments of the present invention also provide a blockchain timestamp authentication device based on a hash tree, which includes a unit for performing the above-described method.

[0030] Thirdly, embodiments of the present invention also provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0031] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.

[0032] This invention provides a method, apparatus, device, and medium for blockchain timestamp authentication based on a hash tree. The method includes: acquiring digital files to be timestamped; calculating the hash value of each digital file; determining a leaf node based on the hash value of each digital file; constructing a hash tree based on all leaf nodes; and storing the root node of the hash tree in the blockchain. This solution compresses the hash values ​​of multiple files into a single root node for writing to the blockchain using a hash tree structure, significantly reducing the blockchain's storage footprint and network transmission overhead. Furthermore, the root node, acting as a globally unique identifier, combined with the immutability of the blockchain, ensures the integrity and reliability of all file timestamps, laying the foundation for subsequent scalable applications. Attached Figure Description

[0033] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 is a flowchart illustrating the blockchain timestamp authentication method based on a hash tree provided in an embodiment of the present invention;

[0035] Figure 2 is a schematic diagram of the root node of the hash tree being stored in the blockchain in the blockchain-based blockchain timestamp authentication method provided by the embodiment of the present invention;

[0036] Figure 3 is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0038] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0039] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0040] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0041] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0042] Please refer to Figure 1. This embodiment of the invention provides a blockchain timestamp authentication method based on a hash tree, which includes the following steps:

[0043] S1, Obtain the digital files to be marked with timestamps, and calculate the hash value of each digital file.

[0044] In practice, the digital files can be of various types, such as documents, audio, and video, and this invention does not specifically limit them. Specifically, a hash algorithm is used to calculate the hash value of each digital file.

[0045] S2, determine a leaf node based on the hash value of each of the digital files.

[0046] In practice, in order to construct a hash tree, a leaf node is determined based on the hash value of each of the digital files.

[0047] The leaf node can be the hash value of the digital file itself. However, if the hash value of the digital file itself is used as the leaf node, there is a problem of insufficient privacy protection.

[0048] Therefore, in some preferred embodiments, the above step of "determining a leaf node based on the hash value of each digital file" specifically includes the following steps: assigning a random number to the hash value of the digital file; combining the hash value of the digital file with the corresponding random number to obtain a combination number; and calculating the hash value of the combination number as a leaf node.

[0049] In practice, the random number can be 256 bits. The random number is then concatenated with the hash value of the digital file to obtain the number of combinations.

[0050] By using the hash value of the combination number as a leaf node, privacy protection is effectively enhanced. Traditional solutions directly use the original file's hash value as a leaf node, potentially allowing attackers to deduce file content or link multiple files using the known hash value. This solution, however, uses a combination of random numbers and hash values ​​to prevent the leaf node's hash value from directly mapping to the original file content. Even if an attacker intercepts some node information, it is difficult to infer the true file content or identify the relationships between files. This design ensures verification reliability while also considering the privacy requirements of sensitive data, making it suitable for scenarios with high confidentiality requirements.

[0051] S3, construct a hash tree based on all leaf nodes, and store the root node of the hash tree in the blockchain.

[0052] For example, referring to Figure 2, there are a total of 8 digital files. The hash values ​​of these 8 digital files are f1, f2, f3, f4, f5, f6, f7, and f8, and the corresponding random numbers are r1, r2, r3, r4, r5, r6, r7, and r8, respectively. Eight leaf nodes h1, h2, h3, h4, h5, h6, h7, and h8 are calculated respectively. A hash tree is constructed based on these 8 leaf nodes, and its root node is hroot.

[0053] In a blockchain system, each block corresponds to a time interval v. Assuming a block corresponds to time T, its previous block corresponds to time Tv, and its next block corresponds to time T+v. In this invention, the root node hroot is stored in block T.

[0054] This invention significantly optimizes the efficiency and resource consumption of timestamp authentication by aggregating the hash values ​​of multiple digital files into a hash tree and storing only the root node in the blockchain. Traditional solutions require recording the hash value for each file individually, causing the blockchain's space usage to increase linearly with file size. This solution, however, compresses the hash values ​​of multiple files into a single root node and writes it to the blockchain, greatly reducing storage space and network transmission overhead. Furthermore, the hierarchical nature of the hash tree allows subsequent verification to confirm file existence simply by tracing the path back from the root node, thus improving verification speed. In addition, the root node, as a globally unique identifier, combined with the blockchain's immutability, ensures the integrity and reliability of all file timestamps, laying the foundation for future scalable applications.

[0055] In some preferred embodiments, after constructing the hash tree based on all the leaf nodes, the method further includes inserting randomly generated leaf nodes and / or branches into the hash tree.

[0056] In practice, in a standard hash tree (e.g., a Merkle hash tree), the tree structure is fixed, and each leaf node corresponds to a real data hash value. If an attacker knows the tree structure and can observe the verification path of some hash values, they may be able to infer the existence and location of other data, thereby leaking privacy.

[0057] The purpose of inserting random branches / leaves is to obfuscate the tree structure by inserting randomly generated hash values, making it harder for attackers to distinguish which nodes are real and which are random. Thus, even if attackers observe some verification paths, they cannot accurately infer the distribution of all the data.

[0058] For example, in one specific embodiment, the sensitive documents include: D1, D2, D3, D4

[0059] Objective: To generate timestamps for the hash values ​​H(D1), H(D2), H(D3), and H(D4) of these documents and protect their privacy.

[0060] Implementation steps:

[0061] Generate random hash values:

[0062] Generate 4 random hash values: R1, R2, R3, R4.

[0063] Constructing a Merkel hash tree:

[0064] Instead of directly using H(D1), H(D2), H(D3), and H(D4) as leaf nodes, they are mixed with random hash values.

[0065] For example, the leaf nodes can be: H(D1), R1, H(D2), R2, H(D3), R3, H(D4), R4 (the order can be randomized).

[0066] Then, as usual, construct the Merkle hash tree, calculate the hash value of the intermediate nodes, and so on until the root hash value is obtained.

[0067] Recorded on the blockchain:

[0068] Record the root hash value in the blockchain.

[0069] Verification process:

[0070] When users want to verify the timestamp of D3, they need to provide the hash path that verifies the existence of H(D3) in the tree.

[0071] However, the verification path may also contain some random hash values ​​(such as R3).

[0072] Importantly, service providers need to know which hashes are random and which are real in order to correctly verify the path. This can be achieved by tagging random hashes when building the tree.

[0073] Privacy Enhancement Explanation:

[0074] If attackers only observe the path that verifies D3, they can only know that H(D3) and R3 exist in the tree, but cannot determine what other real document hashes are in the hash tree.

[0075] Because of the presence of random hash values, the structure of the hash tree becomes more complex, making it more difficult for attackers to deduce the distribution of the real data.

[0076] More complex strategies:

[0077] In addition to simply inserting random leaf nodes, more complex strategies can be employed, such as:

[0078] Random branch insertion: Insert some randomly generated branches in the middle level of the tree to increase the complexity of the tree.

[0079] Dynamic insertion: Each time the tree is built, random nodes of different numbers and positions are randomly inserted, so that the structure of the tree changes dynamically.

[0080] By using the methods described above, randomness can be added to the Merkle hash tree, thereby improving the privacy protection capabilities of the timestamp system.

[0081] In some preferred embodiments, the above step "constructing a hash tree based on all leaf nodes" specifically includes: dividing all leaf nodes into multiple categories; constructing a sub-hash tree based on the leaf nodes of each category; and constructing the hash tree with the root node of each sub-hash tree as a leaf node.

[0082] For example, a timestamp service needs to process a large amount of log data from different departments. To improve efficiency and privacy, the preferred embodiment described above can be used, as follows:

[0083] Data organization:

[0084] 1) The log data is divided into logs for multiple departments: Log_A1, Log_A2, Log_B1, Log_B2, Log_C1, Log_C2, Log_C3.

[0085] 2) Construct a sub-Merkel hash tree for each department's logs: Tree_A, Tree_B, Tree_C.

[0086] The leaf nodes of Tree_A are: Hash(Log_A1), Hash(Log_A2);

[0087] The leaf nodes of Tree_B are: Hash(Log_B1), Hash(Log_B2);

[0088] The leaf nodes of Tree_C are: Hash(Log_C1), Hash(Log_C2), and Hash(Log_C3).

[0089] 3) Construct a root Merkle hash tree Root_Tree, whose leaf nodes are the root hash values ​​of Tree_A, Tree_B, and Tree_C.

[0090] Timestamp generation:

[0091] 1) Construct a sub-Merkel hash tree for the log data of each department and calculate the root hash value of each subtree.

[0092] 2) Use the root hash values ​​of these sub-Merkel hash trees to construct the root Merkel hash tree and calculate the final root hash value.

[0093] 3) Record the final root hash value on the blockchain.

[0094] Timestamp verification:

[0095] If you only want to verify the existence of Log_B2, you only need to provide the hash path for verifying the existence of Log_B2 in Tree_B, and the hash path for verifying the existence of the root hash of Tree_B in Root_Tree.

[0096] There is no need to expose log information from other departments such as Log_A1, Log_A2, and Log_C1. Beneficial effects:

[0097] Privacy: Each department can manage its own log data independently, and there is no need to disclose other departments' data during verification.

[0098] Efficiency: It can process sub-Merkel hash trees of different departments in parallel, improving processing speed.

[0099] Flexibility: Log data for a department can be easily added or deleted without affecting other departments.

[0100] As can be seen, modular grouping distributes files across multiple sub-hash trees according to categories (such as department or type), supporting parallel construction and verification and reducing the complexity of a single tree. The independence of sub-hash trees means that when local data is updated or a new category is added, only the corresponding subtree and the global root node need to be adjusted, without reconstructing the overall structure, significantly reducing maintenance costs. Furthermore, category management facilitates access control; for example, different departments only need to verify the integrity of their subtrees, avoiding interference from irrelevant data and balancing efficiency and privacy.

[0101] In some preferred embodiments, the method further includes: receiving a verification request, the verification request including the hash value of the target digital file and the corresponding random number; obtaining the root node of the hash tree from the blockchain; and verifying whether the target digital file is trustworthy based on the root node, the hash value of the target digital file, and the corresponding random number.

[0102] In practice, as shown in Figure 2, the root node of the hash tree is stored in block (T), and the user wants to prove that they already had the target digital file before time T.

[0103] The system receives user verification requests, which include the hash value of the target digital file and its corresponding random number. It retrieves the root node of the hash tree from the blockchain and verifies the trustworthiness of the target digital file based on the root node, the hash value of the target digital file, and the corresponding random number. Specifically, the system includes the following steps: determining the branch corresponding to the target digital file in the hash tree; calculating a verification node based on the hash value, random number, and branch of the target digital file, where the verification node includes a verification intermediate node and a verification root node; if the verification root node is the same as the root node of the hash tree, the target digital file is deemed trustworthy; if the verification root node is different from the root node of the hash tree, and / or the verification intermediate node is different from the corresponding intermediate node of the hash tree, the target digital file is deemed untrustworthy.

[0104] For example, referring to Figure 2, assuming the target digital file f3' to be proved by the user is f3, and its corresponding provided random number is r3', then the branches of the hash tree are: h3, h34, h1234, and hroot. Anyone can calculate the verification intermediate nodes and the verification root node in the following way: h3' = HASH(f3', r3'), h34' = HASH(h3', h4), h1234' = HASH(h12, h34'), hroot' = HASH(h1234', h5678).

[0105] If hroot' is the same as hroot, the target digital file is deemed trustworthy; if any one of the following conditions is met: h3' is different from h3, h34' is different from h34, h1234' is different from h1234, or hroot' is different from hroot, the target digital file is deemed untrustworthy.

[0106] In some preferred embodiments, before obtaining the digital file to be tagged with timestamps, the method further includes adding a preset public key and digital signature of a target object to the digital file.

[0107] In its specific implementation, this invention provides an enhanced timestamp service that not only proves the existence time of a document but also proves that a specific target object (identified by its public key) "knew" the content of the document at a set time. The core objective is to establish a "proof of knowledge," that is, to prove that the owner of a public key was aware of the content of a specific document at a specific time. The method is to have this person digitally sign the document using their private key. However, instead of directly signing the original document, the person's public key is first added to the document before signing. Thus, during verification, by verifying the signature, two things can be proven simultaneously:

[0108] 1) The document's existence time (via timestamp service); 2) The person who possesses the corresponding private key (i.e., the owner of the public key) knows the document's content when signing.

[0109] Real-world example: Contract signing time and proof of right to know

[0110] Scene:

[0111] Company A and Company B signed an important contract online.

[0112] Both parties not only want to prove when the contract was signed, but also want to ensure that both parties agree on the content of the contract.

[0113] Implementation steps:

[0114] 1) Prepare contract documents:

[0115] Company A prepares the electronic document of the contract; adds the public key:

[0116] Company A adds its own public key (A's public key) to the end of the contract document, creating a "modified contract document".

[0117] 2) Company A's signature:

[0118] Company A uses its own private key to digitally sign the "modified contract document".

[0119] 3) Company B adds the public key:

[0120] Company B then adds its own public key (B's public key) to the end of the contract document, which already contains Company A's public key and signature, to form the "final modified contract document".

[0121] 3) Company B's signature:

[0122] Company B used its own private key to digitally sign the "finally modified contract document".

[0123] Timestamp service:

[0124] The "finally modified contract document" containing the public keys and signatures of both parties is used as a digital file to be timestamped. Its hash value is calculated based on step S1 and submitted to the timestamping service for timestamping.

[0125] Verification process:

[0126] In case of future disputes, it is necessary to verify the date of contract signing and whether both parties were aware of the contract. The following verification methods can be used:

[0127] Timestamp verification:

[0128] Verify the evidence provided by the timestamp service to prove that the "finally modified contract document" existed at a certain point in time.

[0129] Signature verification:

[0130] Using Company A's public key, verify whether Company A's signature is valid. If it is valid, it proves that Company A knew the contract content containing its own public key when signing.

[0131] Using Company B's public key, verify whether Company B's signature is valid. If it is valid, it proves that Company B knew the full contents of the contract, including both parties' public keys, when signing.

[0132] Beneficial effects:

[0133] 1) Non-repudiation: Digital signatures provide non-repudiation, meaning that the signer cannot deny that they have signed the document.

[0134] 2) Proof of right to know: This clearly proves that both parties were aware of the contents of the contract when they signed it, reducing the possibility of future disputes.

[0135] Proof of time: Timestamp services provide reliable evidence of time.

[0136] This case demonstrates that combining digital signatures and timestamps can provide stronger evidence, proving not only when a document existed but also that a specific person had the right to know the document's contents.

[0137] As can be seen, by embedding the target object's public key and digital signature into digital files, timestamp authentication and ownership verification are deeply integrated, enhancing the authenticity and legal validity of the documents. Traditional timestamps can only prove the time of a document's existence and cannot link the responsible party. This solution, however, identifies the document's owner through a public key and ensures the integrity of the document's content through a digital signature. This allows verification to confirm the document's existence at a specific point in time and trace the signatory's identity. This design is particularly suitable for scenarios such as contract signing and intellectual property protection. For example, in disputes, users can use signature verification to prove that they were aware of and approved of the document's content at the time of the timestamp, forming an undeniable chain of evidence, thereby enhancing the legal value and application breadth of timestamp services.

[0138] In some preferred embodiments, the technical solution of the present invention can also be applied to smart contract scenarios, as detailed below:

[0139] By combining timestamp services with smart contracts, the automatic execution of a smart contract can be triggered when a specific document is "opened" (i.e., its existence is verified).

[0140] Scenario: The execution of a smart contract depends on proof that a specific piece of information exists at a specific point in time. This information needs to meet certain preset conditions (e.g., a solution to a mathematical equation). Someone can use the timestamp service proposed in this invention to "secretly open" a document, thereby providing the necessary proof to the smart contract and triggering its execution. Here, "secretly opening" refers to proving the existence of the document through the verification path of a Merkle hash tree without disclosing the full content of the document.

[0141] Application Case: Rewards Triggered by Delayed Publication of Patent Information

[0142] Scene:

[0143] A decentralized research collaboration platform that encourages researchers to submit innovative solutions.

[0144] The platform's smart contract stipulates that anyone who submits a solution to a specific scientific problem before a specified time will receive a reward.

[0145] Researchers can choose to encrypt their solution documents and submit them to a timestamp service to prove they had the solution before a specified time, but will not disclose the specific content of the solution for the time being.

[0146] Implementation steps:

[0147] 1. Define a smart contract:

[0148] Deploy a smart contract on the blockchain that contains the following logic:

[0149] Define the specific requirements of the problem (e.g., the specific form of the equation).

[0150] Set a deadline for submitting your solution.

[0151] The amount of the reward is specified.

[0152] Provides a verification function to verify whether the existence proof of the solution meets the preset conditions.

[0153] Once verification is successful, the reward will be automatically issued to the submitter.

[0154] 2. Researchers submit their proposals:

[0155] The researchers completed the solution documentation.

[0156] The researchers encrypted the solution document and calculated its hash value.

[0157] Researchers used a timestamp service to generate timestamps for the hash values ​​of encrypted documents. It should be noted that the timestamp service in this scenario represents a hash tree-based blockchain timestamp authentication method provided in any embodiment of this invention.

[0158] Researchers submitted the encrypted documents and timestamp proofs to the research collaboration platform.

[0159] 3. Smart contract triggering:

[0160] When the deadline set in the smart contract is reached, no one can submit a new solution.

[0161] Researchers "open" the document and trigger the contract:

[0162] Researchers who possess the solution provide the following information to the smart contract:

[0163] The hash value of the encrypted document.

[0164] The verification path of the hash tree proves that the hash value existed in the timestamp service before the deadline.

[0165] Decrypted solution documentation.

[0166] After receiving the information, the smart contract performs the following operations:

[0167] Verify the validation path of the Merkle tree to confirm that the solution was submitted before the deadline.

[0168] Verify that the decrypted solution document meets the requirements of the problem (e.g., verify that the solution is correct).

[0169] If both verifications pass, the smart contract automatically distributes the reward to the researcher who submitted the solution.

[0170] Technical effects:

[0171] 1) Protecting intellectual property: Researchers can protect their intellectual property by proving that they have the solution before the deadline without disclosing the details of the solution.

[0172] 2) Incentivizing Innovation: The automatic execution of rewards by smart contracts ensures a fair and transparent incentive mechanism, encouraging more people to participate in research.

[0173] Trusted time proof: The timestamp service provides trusted time proof, ensuring the accuracy of the submission time.

[0174] 3) Automated execution: The automatic execution of smart contracts reduces human intervention and improves efficiency and security.

[0175] This case demonstrates that combining timestamp services with smart contracts can enable more complex and automated application scenarios, especially in scenarios that require proof of information existence and triggering subsequent operations.

[0176] In some preferred embodiments, the technical solution of the present invention can also be applied to anonymous service scenarios, as detailed below:

[0177] The anonymity features of cryptocurrencies:

[0178] Although transactions on the blockchain are public and transparent, the identities of the parties involved in the transaction are not directly linked to their real-world identities.

[0179] Users possess cryptocurrency wallet addresses, which are strings of characters that can theoretically be generated anonymously.

[0180] Therefore, by controlling the flow of information, service providers can accept cryptocurrency payments without directly collecting users' personally identifiable information, thus providing users with a certain degree of anonymity.

[0181] How to implement anonymity services:

[0182] No collection of personal information: Service providers do not require users to provide personal identification information such as name, ID number, email address, or phone number during transactions; Only use cryptocurrency addresses: Service providers only use users' cryptocurrency wallet addresses to identify transactions and provide corresponding services.

[0183] Hybrid techniques (optional): To further enhance anonymity, users can use hybrid techniques to obfuscate the transaction chain, making it more difficult to trace the source of the transaction.

[0184] Application Case: Anonymous Timestamp Service

[0185] Scene:

[0186] Some users may need to timestamp sensitive documents, but for privacy reasons, they do not want to reveal their identity to the timestamp service provider; for example, a lawyer may need to timestamp a client's draft contract, but does not want the service provider to know the specific content of the contract or the client's identity.

[0187] Implementation steps:

[0188] Service provider settings:

[0189] The timestamp service provider configures its system to accept cryptocurrency as a payment method.

[0190] The service provider's website or application only requires users to provide a cryptocurrency wallet address for receiving payments.

[0191] The service provider does not collect any other personal information from users.

[0192] User actions:

[0193] Users prepare the documents that need to be timestamped and calculate their hash values.

[0194] Users pay fees to a designated cryptocurrency address of the timestamp service provider.

[0195] Users submit the document's hash value and payment transaction ID to the timestamp service provider.

[0196] After verifying the payment, the timestamp service provider generates a timestamp for the document hash value and returns the result to the user.

[0197] verify:

[0198] When document timestamp verification is required in the future, users can use the results returned by the timestamp service provider for verification without revealing their identity. It should be noted that the timestamp service in this scenario is a hash tree-based blockchain timestamp authentication method provided in any embodiment of this invention.

[0199] Technical effects:

[0200] Privacy protection: Users are not required to provide personally identifiable information, thus protecting their privacy.

[0201] Risk reduction: Reduces the risk of user identity information being leaked due to service provider data breaches.

[0202] Wide range of applications: It can be applied to various scenarios that require anonymity, such as intellectual property protection, contract signing, and sensitive data processing.

[0203] Corresponding to the above-described hash tree-based blockchain timestamp authentication method, this invention also provides a hash tree-based blockchain timestamp authentication device. This hash tree-based blockchain timestamp authentication device includes a unit for executing the aforementioned hash tree-based blockchain timestamp authentication method, and can be configured in terminals such as desktop computers, tablet computers, and laptops. Specifically, the hash tree-based blockchain timestamp authentication device includes:

[0204] The acquisition unit is used to acquire digital files to be tagged with timestamps and calculate the hash value of each digital file.

[0205] A determining unit is configured to determine a leaf node based on the hash value of each of the digital files;

[0206] A storage unit is used to construct a hash tree based on all the leaf nodes and store the root node of the hash tree in the blockchain.

[0207] In some preferred embodiments, determining a leaf node based on the hash value of each digital file includes:

[0208] Assign a random number to the hash value of the digital file;

[0209] The hash value of the digital file is combined with the corresponding random number to obtain the number of combinations;

[0210] The hash value of the combination number is calculated as a leaf node.

[0211] In some preferred embodiments, the hash tree-based blockchain timestamp authentication device further includes:

[0212] An insertion unit is used to insert randomly generated leaf nodes and / or branches into the hash tree.

[0213] In some preferred embodiments, constructing the hash tree based on all leaf nodes includes:

[0214] Divide all leaf nodes into multiple categories;

[0215] Construct a sub-hash tree based on the leaf nodes of each of the aforementioned categories;

[0216] The hash tree is constructed by using the root node of each of the sub-hash trees as a leaf node.

[0217] In some preferred embodiments, before obtaining the digital file to be tagged with timestamps, the method further includes:

[0218] Add the public key and digital signature of the target object to the digital file.

[0219] In some preferred embodiments, the hash tree-based blockchain timestamp authentication device further includes:

[0220] A receiving unit is configured to receive a verification request, the verification request including the hash value of the target digital file and the corresponding random number;

[0221] The verification unit is used to obtain the root node of the hash tree from the blockchain, and verify whether the target digital file is trustworthy based on the root node, the hash value of the target digital file, and the corresponding random number.

[0222] In some preferred embodiments, the step of verifying the trustworthiness of the target digital file based on the root node, the hash value of the target digital file, and the corresponding random number includes:

[0223] Determine the branch in the hash tree corresponding to the target digital file;

[0224] Verification nodes are obtained based on the hash value, random number, and branch calculation of the target digital file. The verification nodes include intermediate verification nodes and root verification nodes.

[0225] If the verification root node is the same as the root node of the hash tree, the target digital file is determined to be trustworthy.

[0226] If the verification root node is not the same as the root node of the hash tree, and / or the verification intermediate node is not the same as the corresponding intermediate node of the hash tree, the target digital file is determined to be untrustworthy.

[0227] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned hash tree-based blockchain timestamp authentication device and its various units can be found in the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity, these details will not be repeated here.

[0228] The aforementioned hash tree-based blockchain timestamp authentication device can be implemented as a computer program that can run on the computer device shown in Figure 3.

[0229] Please refer to Figure 3, which is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet, laptop, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.

[0230] The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0231] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it enables the processor 502 to execute a blockchain timestamp authentication method based on a hash tree.

[0232] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0233] The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a blockchain timestamp authentication method based on a hash tree.

[0234] The network interface 505 is used for network communication with other devices. Those skilled in the art will understand that the above structure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. A specific computer device 500 may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.

[0235] The processor 502 is used to run a computer program 5032 stored in a memory to implement the steps of a hash tree-based blockchain timestamp authentication method provided in any embodiment of the present invention.

[0236] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0237] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0238] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform the steps of a hash tree-based blockchain timestamp authentication method provided in any embodiment of the present invention.

[0239] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), magnetic disk, or optical disk, or any other physical storage medium capable of storing program code. The computer-readable storage medium can be non-volatile or volatile.

[0240] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0241] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0242] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0243] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0244] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0245] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.

[0246] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A blockchain timestamp authentication method based on a hash tree, characterized in that, include: Obtain the digital files to be tagged with timestamps, and calculate the hash value of each digital file; A leaf node is determined based on the hash value of each of the digital files; A hash tree is constructed based on all the leaf nodes, and the root node of the hash tree is stored in the blockchain.

2. The blockchain timestamp authentication method based on a hash tree according to claim 1, characterized in that, The step of determining a leaf node based on the hash value of each digital file includes: Assign a random number to the hash value of the digital file; The hash value of the digital file is combined with the corresponding random number to obtain the number of combinations; The hash value of the combination number is calculated as a leaf node.

3. The blockchain timestamp authentication method based on hash trees according to claim 1, characterized in that, After constructing the hash tree based on all leaf nodes, the method further includes: Insert randomly generated leaf nodes and / or branches into the hash tree.

4. The blockchain timestamp authentication method based on a hash tree according to claim 1, characterized in that, The construction of the hash tree based on all leaf nodes includes: Divide all leaf nodes into multiple categories; Construct a sub-hash tree based on the leaf nodes of each of the aforementioned categories; The hash tree is constructed by using the root node of each of the sub-hash trees as a leaf node.

5. The blockchain timestamp authentication method based on a hash tree according to claim 1, characterized in that, Before obtaining the digital file to be tagged with timestamps, the method further includes: Add the public key and digital signature of the target object to the digital file.

6. The blockchain timestamp authentication method based on a hash tree according to claim 2, characterized in that, The method further includes: Upon receiving a verification request, the verification request includes the hash value of the target digital file and the corresponding random number; Obtain the root node of the hash tree from the blockchain, and verify the trustworthiness of the target digital file based on the root node, the hash value of the target digital file, and the corresponding random number.

7. The blockchain timestamp authentication method based on a hash tree according to claim 6, characterized in that, The verification of the trustworthiness of the target digital file based on the root node, the hash value of the target digital file, and the corresponding random number includes: Determine the branch in the hash tree corresponding to the target digital file; Verification nodes are obtained based on the hash value, random number, and branch calculation of the target digital file. The verification nodes include intermediate verification nodes and root verification nodes. If the verification root node is the same as the root node of the hash tree, the target digital file is determined to be trustworthy. If the verification root node is not the same as the root node of the hash tree, and / or the verification intermediate node is not the same as the corresponding intermediate node of the hash tree, the target digital file is determined to be untrustworthy.

8. A blockchain timestamp authentication device based on a hash tree, characterized in that, Includes a unit for performing the method as described in any one of claims 1-7.

9. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-7.