Signature method and signature verification method for quantum blockchain, and electronic device
By using a hash chain generated by quantum random numbers as the key in the quantum blockchain, the security and efficiency issues of the quantum blockchain in a quantum computing environment are solved, achieving a more efficient signature verification process and stronger resistance to attacks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CAS QUANTUM NETWORK CO LTD
- Filing Date
- 2026-01-15
- Publication Date
- 2026-04-28
AI Technical Summary
Traditional asymmetric encryption mechanisms are easily cracked in a quantum computing environment, which affects the security and operational efficiency of quantum blockchains. Post-quantum cryptographic algorithms are computationally complex and also pose a risk of being cracked.
The hash value in the hash chain generated by quantum random numbers is used as the key for signature verification. By using quantum random number generation algorithm and hash chain generation algorithm, the ability to resist quantum computing attacks is improved and the running efficiency of the signature verification process is increased.
It enhances the security and operational efficiency of the quantum blockchain, reduces the risk of information leakage, and improves the computational efficiency and security of the signature verification process.
Smart Images

Figure CN121547189B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum technology, and in particular to a signature method and verification method for quantum blockchain, and an electronic device. Background Technology
[0002] Blockchain is a distributed database technology with advantages such as decentralization, data immutability, and high transparency. However, with the development of quantum computing technology, traditional asymmetric encryption mechanisms face the risk of being cracked, posing a challenge to the security of blockchain technology. Therefore, quantum blockchain technology has emerged. In the blockchain signature verification process, it employs post-quantum cryptography (PQC) algorithms, enabling the blockchain to resist quantum computing attacks and thus ensuring its security.
[0003] However, post-quantum cryptography algorithms are inefficient and pose a certain risk of being cracked, which affects the efficiency and security of quantum blockchains. Summary of the Invention
[0004] This application provides a signature method and verification method for quantum blockchain, as well as an electronic device, which can improve the operating efficiency and security of quantum blockchain.
[0005] A first aspect of this application provides a signature method for a quantum blockchain, comprising: obtaining a first seed and a data block sequence, wherein the first seed is a quantum random number, each data block in the data block sequence is a quantum random number, or the data block sequence is a hash chain generated using a quantum random number as the seed; performing an HMAC operation based on the first seed and the data block sequence to generate a first hash chain; using unused hash values in the first hash chain as keys to generate a digital signature of a first message; and sending a digest and digital signature of the first message for a recipient to verify the digest of the first message based on the digital signature of the first message.
[0006] A second aspect of this application provides a signature method for a quantum blockchain, comprising: obtaining a second seed, wherein the second seed is a quantum random number; generating a second hash chain based on the second seed; generating a digital signature of a second message using unused hash values in the second hash chain; and sending a digest and digital signature of the second message for a recipient to verify the digest of the second message based on the digital signature of the second message.
[0007] A third aspect of this application provides a signature verification method for quantum blockchain, comprising: receiving a message digest and a digital signature; generating a corresponding digital signature using a locally currently stored hash value and the digest of the received message; comparing the generated digital signature with the received digital signature to verify the digest of the received message; wherein the locally currently stored hash value is an unused hash value in a hash chain received in a secure manner, the hash chain being a first hash chain generated in the signature method for quantum blockchain as described above, or the hash chain being a second hash chain generated in the signature method for quantum blockchain as described above.
[0008] A fourth aspect of this application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in any of the preceding claims.
[0009] The technical solution provided in this application has at least the following advantages:
[0010] By using hash values from a hash chain generated based on quantum random numbers as the key for signature verification, the blockchain signature verification process will have better resistance to quantum computing attacks due to the randomness and security of quantum random numbers, further enhancing blockchain security. Furthermore, compared to post-quantum key algorithms, quantum random number generation algorithms and hash chain generation algorithms are more efficient; therefore, the efficiency of the signature verification process supported by a hash chain generated based on quantum random numbers will be improved. Attached Figure Description
[0011] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0012] Figure 1 This is a flowchart of a signature method for quantum blockchain provided in one embodiment of this application;
[0013] Figure 2 This is a flowchart of another signature method for quantum blockchain provided in another embodiment of this application;
[0014] Figure 3 This is a flowchart of a signature verification method for quantum blockchain provided in another embodiment of this application;
[0015] Figure 4 This is an interactive schematic diagram of the consensus process provided in another embodiment of this application;
[0016] Figure 5 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of this application to enable readers to better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments.
[0018] The division of the following embodiments is for ease of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.
[0019] In quantum blockchains, to provide resistance to quantum computing attacks in the signature verification process, post-quantum cryptography algorithms are typically used. However, the security of post-quantum cryptography relies on mathematical problems considered computationally difficult even in a quantum environment. This means that the computation of post-quantum cryptography algorithms will be very complex and inefficient, making the signature verification process based on them inefficient. Furthermore, while post-quantum cryptography is considered computationally difficult, it is not necessarily unsolvable; therefore, a certain degree of vulnerability to attack still exists.
[0020] Based on this, this application provides a signature method and verification method, as well as an electronic device, for quantum blockchains. It replaces the post-quantum cryptographic algorithm with quantum random number generation from quantum cryptography, providing better resistance to quantum computing attacks and improving the security of the quantum blockchain. Furthermore, instead of directly using quantum random numbers as the signature verification key, it employs the hash value from a hash chain generated based on quantum random numbers as the signature verification key, significantly reducing the computation required for signature verification and further improving the computational efficiency of the signature verification process. Ultimately, this achieves both high operational efficiency and security for the quantum blockchain.
[0021] In some embodiments, the signature method for quantum blockchain follows the procedure described above. Figure 1 As shown, it includes:
[0022] Step 101: Obtain the first seed and the data block sequence, wherein the first seed is a quantum random number, and each data block in the data block sequence is a quantum random number, or the data block sequence is a hash chain generated with a quantum random number as the seed.
[0023] Step 102: Perform a hash-based message authentication code (HMAC) operation based on the first seed and the data block sequence to generate the first hash chain.
[0024] Step 103: Use the unused hash value in the first hash chain as a key to generate a digital signature for the first message.
[0025] Step 104: Send the digest and digital signature of the first message so that the recipient can verify the digest of the first message based on the digital signature of the first message.
[0026] exist Figure 1 In the illustrated embodiment, the hash value in the hash chain generated based on quantum random numbers is used as the key for signature verification. Therefore, based on the randomness and security of quantum random numbers, the blockchain signature verification process will have better resistance to quantum computing attacks, further enhancing the security of the blockchain. Furthermore, compared to post-quantum key algorithms, the quantum random number generation algorithm and the hash chain generation algorithm are more efficient. Therefore, the efficiency of the signature verification process supported by the hash chain generated based on quantum random numbers will be improved. In particular, both the seed and database of the first hash chain involve the use of quantum random numbers; therefore, the first hash chain has stronger resistance to quantum computing attacks, further enhancing the security of the quantum blockchain.
[0027] For ease of understanding, the following will be... Figure 1 The steps shown are explained below.
[0028] In step 101, each quantum random number can be generated based on a quantum random number generator (QRNG). This QRNG can integrate one or more methods for generating random numbers using quantum mechanics principles, such as a quantum random number generation algorithm based on single-photon detection, a quantum random number generation method based on quantum entanglement, or a quantum random number generation algorithm based on quantum coherence. By calling the corresponding algorithm, the quantum random number output by the quantum random number generator is obtained as the first seed, and each data block or seed in the data block sequence is used.
[0029] In this context, when the data block sequence is a hash chain generated using quantum random numbers as seeds, this hash chain can be obtained based on any hash chain generation algorithm. In some examples, the seed quantum random number can be hashed 0 times, 1 time, 2 times, 3 times, ..., n-1 times to obtain n hash values, which then constitute the data block sequence. Data blocks in ( The result can be calculated using the following expression:
[0030] ;
[0031] in, , For quantum random numbers, Indicates to Perform a hash operation.
[0032] It should be noted that, in the embodiments of this application, the markers in the parameters... This parameter indicates that it is used by the sender. With the receiving side The parameters used in the signature verification process between the sender and sender The recipient will sign based on this parameter. Signature verification will be based on this parameter. In other words, different senders and receivers use different first hash chains, further enhancing the security of the quantum blockchain. Further details will not be elaborated upon here.
[0033] Of course, the above are just examples. In some cases, other hash chain generation algorithms can be used, which will not be listed here.
[0034] In step 102, when both a seed and a data block are available, the hash value in the hash chain is obtained through HMAC operation.
[0035] In other words, the first hash chain hash value in ( It can be calculated using the following expression:
[0036] ;
[0037] in, , As the first seed, Indicates to Perform hash operations. Indicated by As the key and with Perform HMAC operations on the message.
[0038] In step 103, the hash values in the first hash chain are combined with a one-time pad key usage mechanism, so that each time a message needs to be signed, only the key that has not been used before is used to sign the message, thereby further improving security. In some embodiments, as the hash values in the first hash chain are continuously consumed, the hash chain regeneration mechanism of the first hash chain will be triggered, and a new first hash chain will be generated according to steps 101 and 102 above.
[0039] It should be noted that, in the embodiments of this application, the unused hash value in the first hash chain refers to the hash value that was not used as a key to encrypt messages after the first hash chain was generated.
[0040] It should also be noted that there are no restrictions on the digital signature of the first message in this embodiment of the application, and any digital signature algorithm can be used.
[0041] In some embodiments, the digital signature of the first message may include a first identity signature and a first message signature. In this case, generating the digital signature of the first message using unused hash values in the first hash chain can be achieved as follows: Obtain the first message, a first hash value, a second hash value, and a first data block, wherein the first hash value is the currently unused hash value closest to the tail of the first hash chain, the second hash value is the previous hash value in the first hash chain, and the first data block is a data block in the data block sequence used when generating the first data block based on the second hash value; encrypt the second hash value and the first data block using the first hash value as the key to obtain the first identity signature; and generate the first message signature, a digest of the first message, using the first hash value as the key.
[0042] Thus, by constructing a first identity signature using the first hash value, the second hash value, and the first data block on the first hash chain, the first hash value can be verified during signature verification, as well as the process of generating the first hash value using the second hash value and the first data block. This allows for multi-dimensional determination of whether the sender's identity has been tampered with, further enhancing the security of the quantum blockchain.
[0043] Simultaneously, since the second hash value is transmitted to the recipient during the signature verification process, the recipient can obtain the last hash value on the first hash chain (excluding the one mentioned above) through the continuous signature verification process with the sender. The sender uses all hash values other than the first hash chain (i.e., the second hash value obtained in each signature verification) as the locally stored hash value to decrypt the received data in the next signature verification process. In other words, the sender only needs to use the last hash value on the chain when the first hash chain was generated (i.e., the aforementioned hash value). The hash value is transmitted to the recipient in a secure manner (such as offline transmission via secure storage medium or online transmission via secure communication channel), instead of transmitting all hash values on the first hash chain to the recipient at once, which reduces the risk of information leakage and further enhances security.
[0044] It should be noted that although the second hash value is transmitted to the recipient, it is not used as a key for encryption. Therefore, the second hash value is still an unused hash value in the first hash chain and can be used in the next signing process.
[0045] In some embodiments, the digital signature of the first message includes a first identity signature, a first message signature, and a second message signature. In this case, generating the digital signature of the first message using unused hash values in the first hash chain can be achieved as follows: Obtain the first message, the first hash value, the second hash value, and the first data block, wherein the first hash value is the currently unused hash value closest to the tail of the first hash chain, the second hash value is the previous hash value in the first hash chain, and the first data block is a data block in the data block sequence used when generating the first data block based on the second hash value; encrypt the second hash value and the first data block using the first hash value as the key to obtain the first identity signature; generate an HMAC value using the first data block as the key and the digest of the first message as the message, to serve as the second message signature; generate an HMAC value using the first hash value as the key and the digest generated based on the first identity signature and the second message signature as the message, to serve as the first message signature.
[0046] Thus, the receiver can verify whether the sender's identity has been tampered with through the first identity signature, and can also verify whether the first message has been tampered with through the second message signature. Furthermore, the receiver can verify both the first identity signature and the second message signature simultaneously through the first message signature, further reducing the risk of data tampering and improving the security of the quantum blockchain.
[0047] For ease of understanding, the following will use the k-th hash value in the first hash chain. Taking the first hash value as an example, the generation of the digital signature for the first message will be explained. The digital signature for the first message can then be obtained using the following expression:
[0048] ;
[0049] ;
[0050] ;
[0051] in, Sign for the first identity. Indicates the first hash value The second hash value of the key pair and the first data block Encryption, Sign the second message. Indicated by As the key and with Perform HMAC operations on the message. Indicates the first message Perform summary calculation. Sign the first message. Indicated by As the key and with Perform HMAC operations on the message. Indicates according to and The result of running the digest algorithm (e.g., it can be a computation) and (such as a summary of the data obtained after splicing). Indicates signature of the first identity Perform summary calculation.
[0052] Of course, the above are just examples. In some embodiments, the first message signature can be an HMAC value generated by using the first hash value as the key and the digest of the first message as the message, or the first message signature can be an HMAC value generated by using the first hash value as the key and the digest of the first message and the first identity signature as the message, etc., which will not be listed here.
[0053] In step 104, a summary of the first message is sent instead of the original content of the first message to further enhance the security of the first message.
[0054] In some embodiments, the signature method used for quantum blockchains is as follows: Figure 2 As shown, it includes:
[0055] Step 201: Obtain the second seed, which is a quantum random number.
[0056] Step 202: Generate a second hash chain based on the second seed.
[0057] Step 203: Use the unused hash values in the second hash chain to generate a digital signature for the second message.
[0058] Step 204: Send the digest and digital signature of the second message so that the recipient can verify the digest of the second message based on the digital signature.
[0059] exist Figure 2In the illustrated embodiment, the hash value in the hash chain generated based on quantum random numbers is used as the key for signature verification. Therefore, based on the randomness and security of quantum random numbers, the blockchain signature verification process will have better resistance to quantum computing attacks, further improving the security of the blockchain. Furthermore, compared to post-quantum key algorithms, the quantum random number generation algorithm and the hash chain generation algorithm are more efficient. Therefore, the efficiency of the signature verification process supported by the hash chain generated based on quantum random numbers will be improved. Moreover, the hash chain computation is simple, and the sender does not need to maintain the data block sequence, reducing the sender's computational and storage burden.
[0060] For ease of understanding, the following will be... Figure 2 The steps shown are explained below.
[0061] In step 201, the quantum random number can be generated based on a quantum random number generator (QRNG). This QRNG can integrate one or more methods for generating random numbers using quantum mechanics principles, such as single-photon detection-based quantum random number generation algorithms, quantum entanglement-based quantum random number generation methods, and quantum coherence-based quantum random number generation algorithms. By calling the corresponding algorithm, the quantum random number output by the quantum random number generator is obtained as the second seed.
[0062] In step 202, when no data block is available, the hash value in the hash chain is obtained through hash operation.
[0063] In other words, the second hash chain hash value in ( It can be calculated using the following expression:
[0064] ;
[0065] in, Indicates to Perform hash operations. , It is the second seed.
[0066] In step 203, the hash values in the second hash chain are combined with a one-time pad key usage mechanism, so that each time a message needs to be signed, only the key that has not been used before is used to sign the message, thereby further improving security. In some embodiments, as the hash values in the second hash chain are continuously consumed, the hash chain regeneration mechanism of the second hash chain will be triggered, and a new first hash chain will be generated according to steps 201 and 202 above.
[0067] It should be noted that, in the embodiments of this application, the unused hash value in the second hash chain refers to the hash value that was not used as a key to encrypt messages after the second hash chain was generated.
[0068] It should also be noted that there are no restrictions on the digital signature of the second message in this application embodiment, and any digital signature algorithm can be used.
[0069] In some embodiments, the digital signature of the second message includes a second identity signature and a third message signature. In this case, generating the digital signature of the second message using unused hash values in the second hash chain can be achieved as follows: Obtain the second message, the third hash value, and the fourth hash value, where the third hash value is the currently unused hash value closest to the end of the second hash chain, and the fourth hash value is the previous hash value in the second hash chain; encrypt the fourth hash value using the third hash value as the key to obtain the second identity signature; and generate the third message signature, which is a digest of the second message.
[0070] Therefore, by constructing a second identity signature using the third and fourth hash values on the second hash chain, the process of verifying the third hash value and generating the third hash value using the third and fourth hash values can be achieved during signature verification. This allows for multi-dimensional determination of whether the sender's identity has been tampered with, further enhancing the security of the quantum blockchain.
[0071] Simultaneously, since the fourth hash value is transmitted to the recipient during the signature verification process, the recipient can obtain the last hash value on the second hash chain (excluding the one mentioned above) through the continuous signature verification process with the sender. The sender uses all hash values other than the first hash value obtained during the second hash chain generation (i.e., the previously mentioned hash value) to decrypt the received data, and uses the fourth hash value obtained during each signature verification as the locally stored hash value for the next signature verification process. In other words, the sender only needs to use the last hash value on the chain when the second hash chain was generated (i.e., the previously mentioned hash value). The hash value is transmitted to the recipient in a secure manner (such as offline transmission via secure storage medium or online transmission via secure communication channel), instead of transmitting all hash values on the second hash chain to the recipient at once, which reduces the risk of information leakage and further enhances security.
[0072] It should be noted that although the fourth hash value is transmitted to the recipient, it is not used as a key for encryption. Therefore, the fourth hash value is still an unused hash value in the second hash chain and can be used in the next signing process.
[0073] In some embodiments, the digital signature of the second message includes a second identity signature, a third message signature, and a fourth message signature. In this case, generating the digital signature of the second message using unused hash values in the second hash chain can be achieved as follows: Obtain the second message, the third hash value, and the fourth hash value, where the third hash value is the currently unused hash value closest to the tail of the second hash chain, and the fourth hash value is the previous hash value of the third hash value in the second hash chain; encrypt the fourth hash value using the third hash value as the key to obtain the second identity signature; obtain the second data block, where the data block contains information shared with the recipient; generate an HMAC value using the second data block as the key and the digest of the second message as the message, to serve as the fourth message signature; generate an HMAC value using the XOR operation result of the third hash value and the second data block as the key and the digest generated based on the digest of the second message and the fourth message signature as the message, to serve as the third message signature.
[0074] Thus, the receiver can verify whether the sender's identity has been tampered with through the second identity signature, and whether the second message has been tampered with through the fourth message signature. Furthermore, the receiver can verify both the second identity signature and the fourth message signature through the third message signature, further reducing the risk of data tampering and improving the security of the quantum blockchain.
[0075] For ease of understanding, the following will use the k-th hash value in the first hash chain. Taking the third hash value as an example, the generation of the digital signature for the second message will be explained. The digital signature for the second message can then be obtained using the following expression:
[0076] ;
[0077] ;
[0078] ;
[0079] in, Sign for a second identity, Indicated by the third hash value The fourth hash value of the key pair Encryption, Sign the fourth message. Indicates the second data block As the key and with Perform HMAC operations on the message. Indicates to the second message Perform summary calculation. Indicates a third message signature. Indicated by As the key and with Perform HMAC operations on the message. Indicates according to and The result of running the digest algorithm (e.g., it can be a computation) and (such as a summary of the data obtained after splicing). Indicates signature of a second identity Perform summary calculation. Indicates to and Perform an XOR operation. The parameters are those used in the aforementioned embodiments and will not be repeated here.
[0080] Of course, the above are just examples. In some embodiments, the third message signature can be an HMAC value generated by using the third hash value as the key and the digest of the second message as the message, or the third message signature can be an HMAC value generated by using the third hash value as the key and the digest of the second message and the second identity signature as the message, etc., which will not be listed here.
[0081] In step 204, a summary of the second message is sent instead of the original content of the second message to further enhance the security of the second message.
[0082] Corresponding to the signature method for quantum blockchain described above, this application also provides a signature verification method for quantum blockchain. In some embodiments, the process of the signature verification method for quantum blockchain is as follows: Figure 3 As shown, it includes:
[0083] Step 301: Receive the message digest and digital signature.
[0084] Step 302: Generate a corresponding digital signature using the hash value currently stored locally and the digest of the received message; the hash value currently stored locally is an unused hash value in the first hash chain or the second hash chain that was received securely.
[0085] Step 303: Compare the generated digital signature with the received digital signature to verify the digest of the received message.
[0086] The first hash chain and the second hash chain have been described previously, so they will not be repeated here.
[0087] exist Figure 3In the illustrated embodiment, the hash value in the hash chain generated based on quantum random numbers is used as the key for signature verification. Therefore, based on the randomness and security of quantum random numbers, the blockchain signature verification process will have better resistance to quantum computing attacks, further enhancing the security of the blockchain. Furthermore, compared to post-quantum key algorithms, quantum random number generation algorithms and hash chain generation algorithms are more efficient. Therefore, the efficiency of the signature verification process supported by the hash chain generated based on quantum random numbers will be improved.
[0088] For ease of understanding, the following will be... Figure 3 The steps shown are explained below.
[0089] In step 301, the digest and digital signature of the received message are... Figure 1 The digest and digital signature of the first message sent in the illustrated embodiment, or, for example, the following: Figure 2 The digest and digital signature of the second message sent in the illustrated embodiment have been described previously and will not be repeated here.
[0090] In step 302, the generation of the digital signature corresponds to the generation of the digital signature of the sender. The following example illustrates this: the received digital signature includes an identity signature and a message signature, where the identity signature is either a first identity signature or a second identity signature, and the message signature includes either a first message signature or a third message signature.
[0091] At this point, generating a corresponding digital signature using the currently stored hash value and the digest of the received message can be achieved through the following steps: decrypting the identity signature using the currently stored hash value as the key; generating a hash value based on the decryption result of the identity signature; and generating a digital signature corresponding to the digest of the received message. Correspondingly, comparing the generated digital signature with the received digital signature can be achieved through the following steps: comparing the generated hash value with the identity signature; and if the identity signature passes the comparison, comparing the digital signature corresponding to the digest of the received message with the message signature.
[0092] It is not hard to see that Figure 3 The illustrated embodiment is similar to... Figure 1 , Figure 2 The method embodiments corresponding to the shown embodiments, Figure 3 The illustrated embodiment can be compared with Figure 1 , Figure 2 The embodiments shown are implemented in combination. Figure 1 , Figure 2 The relevant technical details mentioned in the illustrated embodiments are as follows: Figure 3 The illustrated embodiments remain valid, and to avoid repetition, they will not be described again here. Accordingly, Figure 3 The relevant technical details mentioned in the illustrated embodiments can also be applied to Figure 1 , Figure 2 In the illustrated embodiment.
[0093] It should be noted that the signature method and signature verification method for quantum blockchain described in the above embodiments can be applied to any signature verification process in the quantum blockchain. Figure 4 Taking the Byzantine fault-tolerant consensus process shown as an example, the blockchain includes node 1, node 2, node 3, and node 4. The entire consensus process includes five phases: request phase, preparation phase, transmission phase, commit phase, and reply node. Figure 1 or Figure 2 The signature method shown can be executed by the client during the request phase, as described above. Figure 3 The signature verification method shown can be executed by node 2 in the request phase; or, as described above Figure 1 or Figure 2 The signature method shown can be executed by node 2 in the pre-preparation phase, as described above. Figure 3 The verification method shown can be executed by nodes 1, 3, and 4 in the pre-preparation phase, respectively; or, as described above... Figure 1 or Figure 2 The signature method shown can be executed by nodes 1, 2, 3, and 4 in the response phase, respectively. Figure 3 The verification method shown can be executed by the client during the response phase, etc.
[0094] To facilitate understanding of the signature method and verification method for quantum blockchain described above, and their application in blockchain, the following sections will use the above as a basis. Figure 4 The request and response phases shown are illustrated with examples.
[0095] like Figure 4 As shown, during the request phase, the client, as the initiator, signs the message to be published to the blockchain (at this point, as the first message), and node 2, as the receiver, verifies the signature. Assuming based on... Figure 1 The signature method shown is used for signing. In this case, the first hash chain generated on the client (identified as U1) is required for signature verification with node 2 (identified as N2). The data block sequence used when generating the first hash chain is as follows: The first seed is Before the request phase begins, the client has already securely sent the hash value. Pass it to node 2.
[0096] Therefore, if this is the first signature verification process initiated by the client to node 2, the client will calculate the first message to be published on the blockchain using the following expression. Digital signature:
[0097] ;
[0098] ;
[0099] .
[0100] If this is the second signature verification process initiated by the client to node 2, then, Already in use, will be used This serves as the first hash value. At this point, the client will calculate the first message to be published to the blockchain using the following expression. Digital signature:
[0101] ;
[0102] ;
[0103] .
[0104] Of course, by analogy, we will not list the use of each hash value on the first hash chain one by one here. The following explanation will mainly take the first signature verification process initiated by the sender to the receiver as an example.
[0105] The operational instructions in the above expressions have already been explained, so they will not be repeated here.
[0106] And the client will use the above calculations to obtain... , , and Send to node 2 to initiate a request to the blockchain.
[0107] Node 2 received , , and Then, firstly, the following expression is used to... Decryption:
[0108] ;
[0109] in, This indicates that the data is stored locally on node 2. For the key pair received Decryption is required. This is the result obtained from decryption.
[0110] Then, node 2 is calculated using the following expression. And compare the calculated results and local storage If they match, proceed to the next step; otherwise, the verification failed, and the current process ends.
[0111] ;
[0112] in, Indicated by As the key and with Perform HMAC operations on the message.
[0113] Next, node 2 calculates according to the following expression And compare the calculated results With received If they match, proceed to the next step; otherwise, the verification failed, and the current process ends.
[0114] ;
[0115] in, Indicates received For message and decryption get Perform HMAC operations on the key.
[0116] Finally, node 2 is calculated according to the following expression. And compare the calculated results With received If they match, proceed to the pre-preparation stage; otherwise, the verification failed, and the current process ends.
[0117] ;
[0118] in, Indicates local storage As the key and with Perform HMAC operations on the message. This indicates the result obtained from the previous calculation. and received Abstract Generate a summary.
[0119] It should be noted that, after the above signature verification process, node 2 will obtain the first hash chain. In Thus, by storing locally Updated to This is used as the key for the next signature verification and decryption operation. Therefore, the client does not need to securely store the first hash chain. All are sent to node 2, and only needs to be sent in a secure manner. Send to node 2.
[0120] During the response phase (taking the interaction between node 3 and the client as an example), node 3, as the sender, signs the consensus result returned to the client (which serves as the second message), and the client, as the receiver, verifies the signature. Assuming based on... Figure 2 The signature method shown is used for signing. In this case, the second hash chain generated on node 3 (identified as N3) is required for signature verification with the client (identified as U1). The second seed used in generating the second hash chain is... Before the response phase begins, node 3 has already securely sent the hash value. Passed to the client.
[0121] Therefore, if this is the first signature verification process initiated by node 3 to the client, then node 3 will calculate the consensus result using the following expression. Digital signature:
[0122] ;
[0123] ;
[0124] .
[0125] The operational instructions in the above expressions have already been explained, so they will not be repeated here.
[0126] It should be noted that, The process of obtaining the data has been explained previously and will not be repeated here. This method can more closely link the request phase and the response phase, which is conducive to maintaining the consistency of the entire consensus process and thus further improving the security of the quantum blockchain.
[0127] And the client receives , , and Then, firstly, the following expression is used to... Decryption:
[0128] ;
[0129] in, Indicates storage on the client's local machine For the key pair received Decryption is required. This is the result obtained from decryption.
[0130] Then, the client calculates using the following expression. And compare the calculated results and local storage If they match, proceed to the next step; otherwise, the verification failed, and the current process ends.
[0131] ;
[0132] in, Indicates to Perform a hash operation.
[0133] Next, the client calculates based on the following expression. And compare the calculated results With received If they match, proceed to the next step; otherwise, the verification failed, and the current process ends.
[0134] ;
[0135] in, Indicates received The message is passed from the client to the blockchain in the request phase. Perform HMAC operations on the key.
[0136] It should be noted that, The process of obtaining the data has been explained previously and will not be repeated here. This method can more closely link the request phase and the response phase, which is conducive to maintaining the consistency of the entire consensus process and thus further improving the security of the quantum blockchain.
[0137] Finally, the client calculates based on the following expression. And compare the calculated results With received To get the first message, we need to check if they match. The on-chain result:
[0138] ;
[0139] in, Indicates local storage As the key and with Perform HMAC operations on the message. This indicates the result obtained from the previous calculation. and received Abstract Generate a summary.
[0140] It should be noted that after the above signature verification process, the client will obtain the second hash chain. In Thus, by storing locally Updated to This is used as the key for the next signature verification and decryption operation. Therefore, node 3 does not need to securely store the second hash chain. All are sent to the client, but only in a secure manner. Send to the client.
[0141] It should be noted that the subscript of the last hash value in the above hash chain... It refers to any integer greater than 1, and is the subscript of the last hash value in a different hash chain. The value of can be different.
[0142] As can be seen from the above examples, the signature method and signature verification method for quantum blockchain provided in this application can get rid of the dependence on post-quantum cryptographic algorithms and provide a secure, decentralized, tamper-proof, and non-repudiation authentication mechanism for quantum blockchain based on quantum random numbers. Moreover, compared with signature verification based on post-quantum cryptographic algorithms, the computation is less complex and the operating efficiency is higher.
[0143] Of course, the above are just examples. In some embodiments, the signature verification method used in the request phase can also be used in the response phase, or the signature verification method used in the request phase can also be used in the response phase, or it can be combined with the signature verification process of other consensus schemes. These will not be listed one by one here.
[0144] Furthermore, blockchain also involves signing and verifying the data uploaded to the chain. In this case, any one or more message signatures provided in the above embodiments can be sent together with the location on the chain for the recipient to verify the message. For example, in some embodiments, using... Figure 1 Taking the signature method for quantum blockchain as an example, the signature method for quantum blockchain can also include the following steps: sending a second message signature, and the location information of the first message on the blockchain, so that the receiver can obtain data from the corresponding location on the blockchain according to the location information; using the locally stored data block as the key and the obtained data as the message, generating an HMAC value; and comparing the generated HMAC value with the received second message signature. This achieves information consistency verification on the blockchain.
[0145] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this application.
[0146] This application also provides an electronic device, such as... Figure 5 As shown, it includes: at least one processor 501; and a memory 502 communicatively connected to at least one processor 501; wherein the memory 502 stores instructions executable by at least one processor 501, the instructions being executed by at least one processor 501 to enable at least one processor 501 to perform the method described in any of the above method embodiments.
[0147] The memory 502 and processor 501 are connected via a bus, which can include any number of interconnecting buses and bridges. The bus connects various circuits of one or more processors 501 and memory 502 together. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by processor 501 is transmitted over a wireless medium via an antenna, which further receives data and transmits it to processor 501.
[0148] Processor 501 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory 502 can be used to store data used by processor 501 during operation.
[0149] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.
Claims
1. A signature method for quantum blockchain, characterized in that, include: Obtain a first seed and a data block sequence, wherein the first seed is a quantum random number, and each data block in the data block sequence is a quantum random number, or the data block sequence is a hash chain generated with a quantum random number as the seed; Perform HMAC operation based on the first seed and the data block sequence to generate a first hash chain; Using the unused hash value in the first hash chain as a key, a digital signature for the first message is generated; Send a digest and digital signature of the first message so that the recipient can verify the digest of the first message based on the digital signature of the first message; The digital signature of the first message includes a first identity signature and a first message signature; The step of generating a digital signature for the first message using unused hash values from the first hash chain includes: Obtain the first message, the first hash value, the second hash value, and the first data block, wherein the first hash value is the currently unused hash value closest to the tail of the first hash chain, the second hash value is the previous hash value of the first hash value in the first hash chain, and the first data block is a data block in the data block sequence used when generating the first hash value based on the second hash value; Using the first hash value as the key, the second hash value and the first data block are encrypted to obtain the first identity signature; Using the first hash value as the key, generate a first message signature that is a digest of the first message.
2. The method according to claim 1, characterized in that, The digital signature of the first message also includes a second message signature; The step of generating a digital signature for the first message using unused hash values from the first hash chain further includes: Using the first data block as the key and the digest of the first message as the message, an HMAC value is generated to serve as the signature for the second message; The first message signature, which uses the first hash value as the key to generate a digest of the first message, includes: Using the first hash value as the key and the message as the digest generated based on the digest of the first identity signature and the second message signature, an HMAC value is generated to serve as the first message signature.
3. The method according to claim 2, characterized in that, The method further includes: Send the second message signature and the location information of the first message on the blockchain, so that the receiver can obtain the first message from the corresponding location on the blockchain according to the location information, use the locally stored data block as the key and the digest of the obtained first message as the message, generate an HMAC value, and compare the generated HMAC value with the received second message signature.
4. A signature method for quantum blockchain, characterized in that, include: Obtain a second seed, wherein the second seed is a quantum random number; Based on the second seed, generate a second hash chain; Using the unused hash values in the second hash chain, a digital signature for the second message is generated; Send a digest and digital signature of the second message so that the recipient can verify the digest of the second message based on the digital signature of the second message; The digital signature of the second message includes a second identity signature and a third message signature; The step of generating a digital signature for the second message using unused hash values from the second hash chain includes: Obtain the second message, the third hash value, and the fourth hash value, wherein the third hash value is the currently unused hash value closest to the tail of the second hash chain, and the fourth hash value is the previous hash value of the third hash value in the second hash chain; Using the third hash value as the key, the fourth hash value is encrypted to obtain the second identity signature; The third message signature is generated as a summary of the second message.
5. The method according to claim 4, characterized in that, The digital signature of the second message also includes a fourth message signature; The step of generating a digital signature for the second message using unused hash values from the second hash chain further includes: Obtain a second data block, wherein the data block contains information shared with the receiver; Using the second data block as the key and the digest of the second message as the message, an HMAC value is generated to serve as the signature for the fourth message; The third message signature used to generate the digest of the second message includes: The result of the XOR operation between the third hash value and the second data block is used as the key, and the digest generated according to the digest of the second identity signature and the fourth message signature is used as the message to generate an HMAC value, which is used as the third message signature.
6. A signature verification method for quantum blockchain, characterized in that, include: Receive message digest and digital signature; Generate a corresponding digital signature using the hash value currently stored locally and the digest of the received message; The generated digital signature is compared with the received digital signature to verify the digest of the received message; Wherein, the hash value currently stored locally is an unused hash value in a hash chain received securely, the hash chain being a first hash chain generated in the signature method for quantum blockchain as described in any one of claims 1 to 3, or the hash chain being a second hash chain generated in the signature method for quantum blockchain as described in claim 4 or 5; The received digital signature is obtained by the signature method for quantum blockchain as described in any one of claims 1 to 3, or by the signature method for quantum blockchain as described in claim 4 or 5.
7. The method according to claim 6, characterized in that, The received digital signature includes: an identity signature and a message signature, wherein the identity signature is a first identity signature or a second identity signature, and the message signature includes a first message signature or a third message signature; The step of generating a corresponding digital signature using the currently stored hash value and the digest of the received message includes: The identity signature is decrypted using the currently stored hash value as the key; Generate a hash value based on the decryption result of the identity signature; Generate a digital signature corresponding to the digest of the received message based on the digest of the received message; The step of comparing the generated digital signature with the received digital signature includes: The generated hash value is compared with the hash value currently stored locally; If the identity signature passes the comparison, the digital signature corresponding to the generated digest of the received message is compared with the message signature.
8. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a signature method for a quantum blockchain as described in any one of claims 1 to 3, or to perform a signature verification method for a quantum blockchain as described in claim 4 or 5, or to perform a signature verification method for a quantum blockchain as described in claim 6 or 7.
Citation Information
Patent Citations
Message index aware multi-hash acelerator for post quantum cryptography secure hash-based signing and verification
CN112152787A
Method and device for generating post-quantum one-time digital signature by using national cryptographic algorithm SM3
CN118054899A