Blockchain-based quantum-resistant transaction processing method, device, medium, and equipment

By using a nested signature method in the blockchain system to block transaction information, and using traditional and quantum-resistant signature algorithms to generate signature message blocks, it is ensured that old nodes can verify transactions through traditional signature algorithms, solving the verification problem of non-upgraded nodes and achieving forward compatibility of the blockchain system.

CN120128317BActive Publication Date: 2025-09-26ZHONGJINKE INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510153587.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-09-26
Estimated Expiration
2045-02-12

AI Technical Summary

Technical Problem

When the existing blockchain system is upgraded to a quantum-resistant signature algorithm, non-upgraded nodes cannot participate in transaction verification, resulting in verification failure.

Method used

A nested signature method is used to divide transaction information into blocks and sign them separately using traditional signature algorithms and quantum-resistant signature algorithms to generate signed message blocks. The broadcast and signature verification process ensures that old nodes can be verified by the traditional signature algorithm.

Benefits of technology

This enables old nodes to verify transaction information through traditional signature algorithms, solving the problem of non-upgraded nodes being unable to participate in transaction verification and achieving forward compatibility of the blockchain system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128317B_ABST
    Figure CN120128317B_ABST
Patent Text Reader

Abstract

The present application discloses a quantum-resistant transaction processing method, apparatus, medium, and device based on blockchain. The method includes: dividing the transaction information of the target transaction into blocks based on the algorithm type of each target signature algorithm configured by the first terminal to obtain a plurality of message blocks; each target signature algorithm includes at least a traditional signature algorithm and a quantum-resistant signature algorithm; based on each target signature algorithm and the target private key of each target signature algorithm, each message block is signed using a nested signature method to obtain a signed message block corresponding to each message block; each signed message block is sent to a first server, and each signed message block is broadcasted by the first server so that each second server in the blockchain can verify the signature of each signed message block based on the target public key corresponding to the target private key. The present application solves the problem that old system nodes that have not been upgraded cannot participate in transaction verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based quantum-resistant transaction processing method, device, medium, and equipment. Background Art

[0002] With the continuous development of science and technology, blockchain-based transaction processing methods have emerged. The mathematical difficulties of traditional cryptographic algorithms integrated into traditional blockchain systems are not resistant to attacks by quantum computers. Therefore, it is imperative to upgrade the historical signature algorithms of various systems in existing blockchains to quantum-resistant signature algorithms.

[0003] However, currently, when upgrading historical signature algorithms to quantum-resistant signature algorithms, direct replacement or hybrid modes are mainly used, which will cause non-upgraded nodes in the blockchain to be unable to participate in transaction verification. Summary of the Invention

[0004] In view of this, the present invention provides a blockchain-based quantum-resistant transaction processing method, device, medium and equipment, the main purpose of which is to solve the problem that currently non-upgraded nodes cannot participate in transaction verification.

[0005] To address the above issues, the present application provides a blockchain-based quantum-resistant transaction processing method, which is applied to a first terminal corresponding to a first server in the blockchain and includes:

[0006] Blocking the transaction information of the target transaction based on the algorithm type of each target signature algorithm configured by the first terminal to obtain a plurality of message blocks; each of the target signature algorithms includes at least a traditional signature algorithm and a quantum-resistant signature algorithm;

[0007] Based on each of the target signature algorithms and the target private keys of each of the target signature algorithms, each of the message blocks is signed using a nested signature method to obtain a signed message block corresponding to each of the message blocks;

[0008] Each of the signed message blocks is sent to the first server, and each of the signed message blocks is broadcasted by the first server, so that each second server in the blockchain can verify the signature of each of the signed message blocks based on the target public key corresponding to the target private key.

[0009] To address the above issues, this application provides a blockchain-based quantum-resistant transaction processing method, which is applied to a first server in the blockchain and includes:

[0010] Receiving each signature information block for the target transaction sent by the first terminal; each signature information block is obtained by the first terminal performing block processing on the transaction information of the target transaction based on the algorithm type of each configured target signature algorithm, and signing the message block obtained by the block processing based on the target private key of each target signature algorithm;

[0011] Broadcasting each of the signed message blocks in the blockchain;

[0012] receiving a signature verification result for each signed message block sent by each second server; each of the signature verification results is obtained by the second server performing signature verification processing on each of the signed message blocks based on the target public key corresponding to each of the target private keys;

[0013] When it is determined that the signature verification is passed based on each of the signature verification results, the target transaction is carried out.

[0014] To solve the above problems, this application provides a blockchain-based quantum-resistant transaction processing device, comprising:

[0015] a block division module, configured to divide the transaction information of the target transaction into blocks based on the algorithm type of each target signature algorithm configured by the first terminal, to obtain a plurality of message blocks; each of the target signature algorithms includes at least a traditional signature algorithm and a quantum-resistant signature algorithm;

[0016] A signature module, configured to sign each message block using a nested signature method based on each target signature algorithm and a target private key of each target signature algorithm, to obtain a signed message block corresponding to each message block;

[0017] A sending module is used to send each of the signed message blocks to a first server, and broadcast each of the signed message blocks through the first server, so that each second server in the blockchain can verify each of the signed message blocks based on a target public key corresponding to a target private key.

[0018] To solve the above problems, this application provides a blockchain-based quantum-resistant transaction processing device, comprising:

[0019] a signature information block receiving module, configured to receive signature information blocks for a target transaction sent by the first terminal; each signature information block is obtained by the first terminal performing block processing on transaction information of the target transaction based on the algorithm type of each configured target signature algorithm, and signing the message blocks obtained by the block processing based on the target private key of each target signature algorithm;

[0020] A broadcast module, configured to broadcast each of the signed message blocks in the blockchain;

[0021] a result receiving module for receiving the signature verification results for each signed message block sent by each second server; each of the signature verification results is obtained by the second server performing signature verification processing on each of the signed message blocks based on the target public key corresponding to each target private key;

[0022] The transaction module is configured to conduct a target transaction when it is determined that the signature verification is passed based on the signature verification results.

[0023] To solve the above problems, the present application provides a storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned blockchain-based quantum-resistant transaction processing methods.

[0024] To solve the above problems, the present application provides an electronic device, comprising at least a memory and a processor, wherein a computer program is stored on the memory, and when the processor executes the computer program on the memory, it implements the steps of any of the above-mentioned blockchain-based quantum-resistant transaction processing methods.

[0025] The blockchain-based quantum-resistant transaction processing method disclosed in this application divides transaction information into blocks based on traditional signature algorithms and the types of various quantum-resistant signature algorithms, and uses a nested signature method to perform signature processing, so that any currently signed message block contains the previously signed message block and the corresponding signed message block. Therefore, when an old node / server in the blockchain does not support the quantum-resistant signature algorithm, although the old node / server cannot verify the signature of the signed message block corresponding to the quantum-resistant signature algorithm, it can still use the traditional signature algorithm to obtain the plaintext message block whose signature sequence precedes the signed message block from the signed message block corresponding to the traditional signature algorithm, thereby performing subsequent transaction verification. This solves the problem of old nodes that have not been upgraded and are unable to participate in transaction verification.

[0026] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0028] Figure 1 This is a flowchart of a blockchain-based quantum-resistant transaction processing method according to an embodiment of the present application;

[0029] Figure 2 This is a flowchart of a blockchain-based quantum-resistant transaction processing method according to another embodiment of the present application.

[0030] Figure 3 This is a schematic diagram of the structure of a forward-compatible quantum-resistant certificate in another embodiment of the present application;

[0031] Figure 4 This is a structural block diagram of a blockchain-based quantum-resistant transaction processing device according to another embodiment of the present application;

[0032] Figure 5 This is a structural block diagram of a blockchain-based quantum-resistant transaction processing device according to another embodiment of the present application;

[0033] Figure 6 This is a structural block diagram of an electronic device according to another embodiment of the present application. DETAILED DESCRIPTION

[0034] Various aspects and features of the present application are described herein with reference to the accompanying drawings.

[0035] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but merely as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.

[0036] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0037] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.

[0038] It should also be understood that although the present application has been described with reference to certain specific examples, those skilled in the art will readily be able to implement many other equivalent forms of the present application.

[0039] The above and other aspects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.

[0040] Specific embodiments of the present application will be described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments described are merely examples of the present application and may be implemented in a variety of ways. Familiar and / or repetitive functions and structures are not described in detail to avoid obscuring the present application with unnecessary or redundant details. Therefore, the specific structural and functional details described herein are not intended to be limiting, but rather serve merely as a basis and representative basis for the claims to teach those skilled in the art to variously utilize the present application with substantially any suitable detailed structure.

[0041] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may all refer to one or more of the same or different embodiments according to the present application.

[0042] The embodiment of the present application provides a method for processing quantum-resistant transactions based on blockchain, which is applied to a first terminal corresponding to a first server in the blockchain, such as Figure 1 As shown, the method in this embodiment includes the following steps:

[0043] Step S101: Blocking the transaction information of a target transaction based on the algorithm type of each target signature algorithm configured by the first terminal to obtain a plurality of message blocks; each of the target signature algorithms includes at least a traditional signature algorithm and a quantum-resistant signature algorithm;

[0044] In this step, let's assume the first terminal is configured with three target signature algorithms: quantum-resistant signature algorithm Alg1, quantum-resistant signature algorithm Alg2, and traditional signature algorithm Alg3. The first terminal can process transaction information M in blocks based on these three algorithm types, thereby obtaining three message blocks: M1, M2, and M3. The transaction information includes information such as the transaction amount and the transaction party identifier.

[0045] Step S102: Based on each target signature algorithm and the target private key of each target signature algorithm, each message block is signed using a nested signature method to obtain a signed message block corresponding to each message block;

[0046] In this step, after obtaining each message block, namely, message blocks M1, M2, and M3, each quantum-resistant signature algorithm is matched to each message block. Each message block is then signed using each quantum-resistant signature algorithm, thereby obtaining a signed message block corresponding to each message block. The specific process of signing in this step is as follows: determining the signature order of each message block and matching the corresponding target signature algorithm to each message block; then, using the target private key of the target signature algorithm corresponding to the current message block, signing the current message block, the previously signed message block that precedes the current message block, and the previously signed signed message block, thereby obtaining a current signed message block corresponding to the current message block.

[0047] That is, we can first determine the signature order of each message block as M1, M2, and M3. Then, based on the target private key sk1 corresponding to the quantum-resistant signature algorithm Alg1, the current message block M1 is signed to obtain the signed message block E1, that is, E1 = Alg1(sk1, M1); then, using the target private key sk2 corresponding to the quantum-resistant signature algorithm Alg2, the current message block M2, the signed message block M1, and the signed message block E1 are signed to obtain the signed message block E2, that is, E2 = Alg2(sk2, M1, E1, M2); similarly, based on the target private key sk3 corresponding to the traditional signature algorithm Alg3, the current message block M3, the signed message block M1, the signed message block M2, the signed message block E1, and the signed message block E2 are signed to obtain the signed message block E3, that is, E3 = Alg3(sk3, M1, E1, M2, E2, M3). In other words, for the current message block M to be signed, i , and its corresponding signature method is: E i =Alg i (sk i ,M1,E1,M2,E2...M i-1 ,E i-1 ,M i ).

[0048] Step S103: Send each of the signed message blocks to the first server, and broadcast each of the signed message blocks through the first server, so that each second server in the blockchain can verify each of the signed message blocks based on the target public key corresponding to the target private key.

[0049] During the specific implementation of this step, the first terminal may pre-send the algorithm identifier of each target signature algorithm and the target public key of each target signature algorithm to the first server, and the first server may store the corresponding relationship between each target signature algorithm identifier and the public key of each target signature algorithm in the blockchain. In other words, the first terminal may pre-send the algorithm identifier of each target signature algorithm and the target public key of each target signature algorithm in the blockchain via the first server, so that each second server can obtain the target public key corresponding to the target signature algorithm from the blockchain.

[0050] In this embodiment, for the same signature algorithm, different clients / terminals are configured with different public-private key pairs. That is, the public-private key pair corresponding to the same signature algorithm A when it is assigned to client / terminal 1 is different from the public-private key pair corresponding to the same signature algorithm A when it is assigned to client / terminal 2. Therefore, when each second server receives the signed message block broadcast by the first server, it can first determine the target signature algorithm and the corresponding target terminal corresponding to each signed message block. When the second server is configured with the same target signature algorithm, it can obtain the target public key corresponding to the target signature algorithm when it is assigned to the target terminal from the blockchain, and then use the target public key to verify the signature message block. For example, there are second servers 1, 2, and 3 in the blockchain, where each second server is configured with the traditional signature algorithm Alg3. On this basis, second server 1 is also configured with the quantum-resistant signature algorithm Alg1, and second server 2 is also configured with the quantum-resistant signature algorithm Alg2. Therefore, when second server 1, second server 2, and second server 3 verify each signed message block, the specific process is as follows:

[0051] Since the second server 1 is configured with quantum-resistant signature algorithm Alg1 and traditional signature algorithm Alg3, it can obtain the target public key pk1 corresponding to quantum-resistant signature algorithm Alg1 from the blockchain, and the target public key pk3 corresponding to traditional signature algorithm Alg3 from the blockchain. pk1 corresponds to the target private key sk1, and pk3 corresponds to the target private key sk3. The second server 1 can then verify the signature of the signed message block E1 broadcast by the first server using the target public key pk1, thereby obtaining message block M1. Simultaneously, the second server 1 can verify the signature of the signed message block E3 broadcast by the first server using the target public key pk3, thereby obtaining message blocks M1, M2, and M3. The second server 1 can then verify the authenticity of the transaction information based on the two verified message blocks M1. Furthermore, it can also verify the legitimacy of the transaction information based on the obtained M1, M2, and M3, thereby obtaining the final verification result. The second server 1 can then send the final verification result to the first server for subsequent transactions.

[0052] Similarly, second server 2 is configured with quantum-resistant signature algorithm Alg2 and traditional signature algorithm Alg3. Therefore, second server 2 can obtain the target public key pk2 corresponding to quantum-resistant signature algorithm Alg2 from the blockchain, and the target public key pk3 corresponding to traditional signature algorithm Alg3 from the blockchain. pk2 corresponds to the target private key sk2, and pk3 corresponds to the target private key sk3. Second server 2 can then verify the signature of signed message block E2 broadcast by the first server using the target public key pk2, thereby obtaining message blocks M1 and M2. Simultaneously, second server 2 can verify the signature of signed message block E3 broadcast by the first server using the target public key pk3, thereby obtaining message blocks M1, M2, and M3. Then, the second server 2 can perform verification based on the message blocks M1 and M2 obtained from the two signature verifications to determine whether the two message blocks M1 and M2 are the same. At the same time, it can also perform verification based on M1, M2 and M3 to verify whether the transaction information is legal to obtain the final signature verification result. Subsequently, the second server 2 can send the final signature verification result to the first server for subsequent transactions.

[0053] Similarly, second server 3 is configured only with the traditional signature algorithm Alg3. Therefore, second server 3 can obtain the target public key pk3 corresponding to traditional signature algorithm Alg3 from the blockchain. pk3 corresponds to the target private key sk3. Second server 3 can then verify the signature of the signed message block E3 broadcast by the first server based on the target public key pk3, thereby obtaining message blocks M1, M2, and M3. Second server 3 can then verify the legitimacy of the transaction information based on M1, M2, and M3, obtaining the final verification result. Second server 3 can then send the verification result to the first server for subsequent transactions.

[0054] During implementation, when matching the target signature algorithm for each message block, a traditional signature algorithm can be configured for the message block that is signed last. Therefore, during subsequent signature verification, if any second server does not support the quantum-resistant signature algorithm, each message block can be retrieved from the signature message block corresponding to the last signed message block based on the configured traditional signature algorithm and the target public key obtained from the blockchain, thereby completing the signature verification.

[0055] The method in this embodiment, the blockchain-based quantum-resistant transaction processing method of this application, divides transaction information into blocks based on traditional signature algorithms and the types of various quantum-resistant signature algorithms, and uses a nested signature method to process the blocks, so that any currently signed message block contains the previously signed message block and the corresponding signed message block. Therefore, when an old node / server in the blockchain does not support the quantum-resistant signature algorithm, although the old node / server cannot verify the signature of the signed message block corresponding to the quantum-resistant signature algorithm, it can still use the traditional signature algorithm to obtain the plaintext message block whose signature sequence precedes the signed message block from the signed message block corresponding to the traditional signature algorithm, thereby performing subsequent transaction verification. This solves the problem of old nodes that have not been upgraded and cannot participate in transaction verification.

[0056] Another embodiment of the present application provides a blockchain-based quantum-resistant transaction processing method. In this embodiment, before the first terminal sends each signed message block to the first server, the method further includes: encrypting each signed message block based on a target quantum-resistant negotiation key pre-negotiated with the first server to obtain an encrypted signed message block, and then sending each encrypted signed message block to the first server. In the specific implementation process of this embodiment, the target quantum-resistant negotiation key can be pre-negotiated with the first server. That is, before the first terminal executes step S101, the method further includes: pre-negotiating with the first server to obtain the target quantum-resistant negotiation key, specifically including the following steps:

[0057] Step 1: The first terminal generates a temporary key pair corresponding to the quantum-resistant key encapsulation algorithm;

[0058] Step 2: The first terminal adds at least the quantum-resistant key encapsulation algorithm (i.e., the quantum-resistant KEM algorithm) to the cryptographic component;

[0059] Step 3: The first terminal generates a first handshake message based at least on the cryptographic component and the temporary public key in the temporary key pair, and sends the first handshake message to the first server;

[0060] In this step, when generating the first handshake information, the extended information can be generated based on the signature algorithm list, the elliptic curve type, the public key corresponding to the elliptic curve, and the temporary public key; and then the first handshake information is generated based on the first terminal random number, the protocol version number, the cryptographic component, and the extended message.

[0061] Step 4: The first terminal receives a second handshake message sent by the first server and generated based on the first handshake message; the second handshake message at least includes an encapsulated ciphertext generated by the first server by encapsulating the temporary public key and the first negotiated key corresponding to the quantum key encapsulation algorithm;

[0062] Step 5: The first terminal receives the forward-compatible quantum-resistant certificate sent by the first server, and calculates the target quantum-resistant negotiation key based on the encapsulated ciphertext in the second handshake information.

[0063] In this step, calculating the target quantum-resistant negotiation key specifically includes: decapsulating the encapsulated ciphertext c using the temporary private key poc_sk in the temporary key pair to obtain a first negotiation key k, i.e., k = Decaps(poc_sk, c); and generating the target quantum-resistant negotiation key K, i.e., K = k||k', based on the first negotiation key k and the historical negotiation key k'. The historical negotiation key k' is the negotiation key calculated by Diffie-Hellman in the original TLS.

[0064] In this embodiment, by adopting the above-mentioned quantum-resistant key exchange / negotiation process between the first terminal and the server, the quantum-resistant algorithm is integrated into the corresponding components that conform to the existing message structure and protocol format. This facilitates the subsequent communication between the first terminal and the server, and enables the communication content (signature information block) to be encrypted based on the target quantum-resistant negotiation key obtained through negotiation, thereby ensuring data security.

[0065] Another embodiment of the present application provides a quantum-resistant transaction processing method based on blockchain. In this application, each transaction party can jointly build a consortium chain / blockchain in advance, and each transaction party corresponds to a network node / server in the blockchain. The method is applied to the first server / first network node in the blockchain, such as Figure 2 As shown, the method in this embodiment includes the following steps:

[0066] Step S201: receiving signature information blocks for a target transaction sent by a first terminal; each signature information block is obtained by the first terminal performing block processing on transaction information of the target transaction based on the algorithm type of each configured target signature algorithm, and signing the message blocks obtained by block processing based on the target private key of each target signature algorithm;

[0067] Step S202: broadcasting each of the signed message blocks in the blockchain;

[0068] Step S203: receiving a signature verification result for each signed message block sent by each second server; each signature verification result is obtained by the second server performing signature verification processing on each signed message block based on the target public key corresponding to each target private key;

[0069] Step S204: When the signature verification is determined to be successful based on the signature verification results, the target transaction is performed.

[0070] During the specific implementation of this embodiment, before receiving each signed message block, the first server may also receive the algorithm identifier of each target signature algorithm and the target public key of each target signature algorithm sent by the first terminal, and store each algorithm identifier and the corresponding relationship between each algorithm identifier and the target public key in the blockchain, so that the second server can obtain the target public key of the corresponding target signature algorithm from the blockchain when verifying each signed message block.

[0071] The method in this embodiment receives signed message blocks from a first terminal, obtained by segmenting transaction information based on traditional signature algorithms and various quantum-resistant signature algorithms, and performing nested signature processing. The method then broadcasts each signed message block, enabling a second server in the blockchain to receive each signed message block. Because any current signed message block contains both a previously signed message block and the corresponding signed message block, if an older node / second server in the blockchain does not support a quantum-resistant signature algorithm, while the older node / second server cannot verify the signed message block corresponding to the quantum-resistant signature algorithm, it can still use the traditional signature algorithm to obtain the plaintext message block that precedes the current signed message block from the current signed message block corresponding to the traditional signature algorithm, thereby performing subsequent transaction verification. This resolves the issue of older, non-upgraded nodes being unable to participate in transaction verification.

[0072] Based on the above embodiment, another embodiment of the present application provides a blockchain-based quantum-resistant transaction processing method. In this embodiment, before the first server receives each signature information block for transaction information sent by the first terminal, that is, before executing step S201, the method further includes: pre-negotiating with the first terminal to obtain a target quantum-resistant negotiation key for encrypting each signature message block, specifically including the following steps:

[0073] Step 1: The first server receives a first handshake request sent by the first terminal, where the first handshake request is generated by the first terminal based on at least a cryptographic component and a temporary public key in a temporary key pair of a quantum-resistant key encapsulation algorithm;

[0074] Step 2: When the first handshake request includes a temporary public key of a quantum-resistant key encapsulation algorithm and the cryptographic component includes a quantum-resistant key encapsulation algorithm, encapsulate the first negotiated key corresponding to the quantum-resistant key encapsulation algorithm based on the temporary public key to generate an encapsulated ciphertext;

[0075] Step 3: The first server generates a second handshake message based on at least the encapsulated ciphertext, and sends the second handshake message to the first terminal;

[0076] Step 4: The first server generates the target quantum-resistant negotiation key based on the first negotiation key and the historical negotiation key;

[0077] In this step, the server calculates the target quantum-resistant negotiated key by performing the following steps: Based on the first negotiated key k corresponding to the quantum-resistant key encapsulation algorithm (i.e., the quantum-resistant KEM algorithm) and the historical negotiated key k', the target quantum-resistant negotiated key K is generated, i.e., K = k||k'. The historical negotiated key k' is the negotiated key calculated by Diffie-Hellman in the original TLS.

[0078] Step 5: The first server generates a forward-compatible quantum-proof certificate and sends the forward-compatible quantum-proof certificate to the first terminal.

[0079] When generating a forward-compatible quantum-resistant certificate, the specific process of this step is as follows: based on the version number, serial number, signature algorithm, signature algorithm hash, quantum-resistant signature algorithm, quantum-resistant signature algorithm hash, issuer, start time, end time, subject name, signature public key, quantum-resistant signature algorithm public key, signature and quantum-resistant signature, the forward-compatible quantum-resistant certificate is generated. That is, the forward-compatible quantum-resistant certificate can be as follows: Figure 3 shown.

[0080] In this embodiment, after the first server completes key negotiation with the first terminal, the first terminal can encrypt each signature message block based on the negotiated target quantum-resistant negotiation key and then send it to the first server. After receiving each encrypted signature information block, the first server can decrypt each encrypted signature information block based on the target quantum-resistant negotiation key to obtain a decrypted signature information block. Subsequently, each decrypted signature information block can be further broadcast.

[0081] The method in this embodiment integrates the quantum-resistant algorithm into the corresponding components that conform to the existing message structure and protocol format by performing key negotiation with the first terminal in the manner described above. This facilitates the decryption of the communication content (encrypted signature information block) encrypted by the first terminal based on the target quantum-resistant negotiation key obtained through negotiation during subsequent communication between the server and the first terminal, thereby ensuring data security.

[0082] Based on the above embodiment, another embodiment of the present application provides a blockchain-based quantum-resistant transaction processing method, which specifically includes the following steps:

[0083] Step 1: The first terminal generates a temporary key pair (poc_pk, poc_sk) corresponding to the quantum-resistant key encapsulation algorithm;

[0084] Step 2: The first terminal adds at least the quantum-resistant key encapsulation algorithm (i.e., the quantum-resistant KEM algorithm) to the cryptographic component;

[0085] In this step, the first terminal obtains the current cryptographic component by adding the quantum-resistant key encapsulation algorithm to the original cryptographic component. In specific implementations, the first terminal may also add Hash Algorithm 2 (the hash algorithm corresponding to the traditional signature algorithm) to the original cryptographic component. In other words, the original cryptographic component includes: TLS_Key Exchange Algorithm_Signature Algorithm_with_Symmetric Encryption Algorithm_Hash Algorithm. The current cryptographic component includes: TLS_Key Exchange Algorithm_Signature Algorithm_with_Symmetric Encryption Algorithm_Hash Algorithm 1_and_Quantum-resistant KEM Algorithm_Quantum-resistant Signature Algorithm_with_Hash Algorithm 2.

[0086] Step 3: The first terminal generates a first handshake message based at least on the cryptographic component and the temporary public key in the temporary key pair, and sends the first handshake message to the first server;

[0087] In this step, when generating the first handshake information, the extended information can be generated based on the signature algorithm list, the elliptic curve type, the public key corresponding to the elliptic curve, and the temporary public key; and then the first handshake information is generated based on the first terminal random number, the protocol version number, the cryptographic component, and the extended message.

[0088] That is, the first handshake information ClientHello = {client random number / first terminal random number, protocol version number, cryptographic component, first extended message [signature algorithm list, elliptic curve type, public key corresponding to the elliptic curve, quantum-resistant KEM algorithm public key / temporary public key]}.

[0089] Step 4: The first server receives the first handshake request sent by the first terminal;

[0090] Step 5: When the first handshake request includes a temporary public key of a quantum-resistant key encapsulation algorithm and the cryptographic component includes a quantum-resistant key encapsulation algorithm, encapsulate the first negotiated key corresponding to the quantum-resistant key encapsulation algorithm based on the temporary public key to generate an encapsulated ciphertext;

[0091] In this step, after receiving the first handshake request, the first server can first determine whether the first handshake request contains the temporary public key poc_pk of the quantum-resistant key encapsulation algorithm and whether the cryptographic component contains the quantum-resistant key encapsulation algorithm / quantum-resistant KEM algorithm; if the cryptographic component contains the quantum-resistant key encapsulation algorithm / quantum-resistant KEM algorithm and poc_pk is not empty, then calculate the encapsulated ciphertext c, that is, c=Encaps(poc_pk, k).

[0092] Step 6: The first server generates a second handshake message based at least on the encapsulated ciphertext c, and sends the second handshake message to the first terminal;

[0093] In this step, when generating the second handshake message ServerHello, the second extended information can be generated based on the encapsulated ciphertext c, the negotiated elliptic curve and the server public key, and then the second handshake message ServerHello is generated based on the server random number, the protocol version number, the cryptographic component and the second extended message.

[0094] That is, the second handshake message ServerHello={server random number, protocol version number, cryptographic component, second extended message [negotiated elliptic curve, server public key, encapsulated ciphertext c]}.

[0095] Step 7: The first server generates the target quantum-resistant negotiation key based on the first negotiation key and the historical negotiation key;

[0096] In this step, the server calculates the target quantum-resistant negotiated key by performing the following steps: Based on the first negotiated key k corresponding to the quantum-resistant key encapsulation algorithm (i.e., the quantum-resistant KEM algorithm) and the historical negotiated key k', the target quantum-resistant negotiated key K is generated, i.e., K = k||k'. The historical negotiated key k' is the negotiated key calculated by Diffie-Hellman in the original TLS.

[0097] Step 8: The first terminal receives the second handshake information;

[0098] Step 9: The first server generates a forward-compatible quantum-proof certificate and sends the forward-compatible quantum-proof certificate to the first terminal;

[0099] Step 10: The first terminal receives the forward-compatible quantum-resistant certificate sent by the first server, and calculates and obtains the target quantum-resistant negotiated key based on the encapsulated ciphertext in the second handshake information.

[0100] In this step, when the first terminal is negotiating the target quantum-resistant key K, the steps specifically include: decapsulating the encapsulated ciphertext c based on the temporary private key poc_sk in the temporary key pair to obtain the first negotiated key k of the quantum-resistant key encapsulation algorithm (i.e., the quantum-resistant KEM algorithm), i.e., k=Decaps(poc_sk,c); and generating the target quantum-resistant negotiated key K based on the first negotiated key k and the historical negotiated key k', i.e., K=k||k'. The historical negotiated key k' is the negotiated key calculated by Diffie-Hellman in the original TLS.

[0101] In this step, after calculating and obtaining the target quantum-resistant negotiation key, the first terminal may also reply to the second handshake message ServerHello based on the Finished message encrypted by the target quantum-resistant negotiation key, thereby completing the key negotiation.

[0102] Step 11: The first terminal stores the configured algorithm identifier of the target signature algorithm and the target public key pk of each target signature algorithm in the blockchain in advance through the first server, so that each second server can obtain the target public key corresponding to the target signature algorithm from the blockchain;

[0103] During the specific implementation of this step, the first terminal can pre-establish a correspondence between the algorithm identifier of each target signature algorithm and the target public key of the target signature algorithm, and then send the correspondence to the first server. As a result, the first server can receive each algorithm identifier and the target public key corresponding to each algorithm identifier sent by the first terminal, and store each algorithm identifier and the target public key corresponding to each algorithm identifier in the blockchain.

[0104] Step 12: The first terminal divides the transaction information of the target transaction into blocks based on the algorithm type of each configured target signature algorithm to obtain a plurality of message blocks; the transaction information includes the transaction amount and the transaction object identifier; each of the target signature algorithms includes at least a traditional signature algorithm and a quantum-resistant signature algorithm;

[0105] For example, the target signature algorithm Alg includes i types, so the transaction information M can be divided into i message blocks M1, M2...M i .

[0106] Step 13: The first terminal determines the signature order of each message block and matches the corresponding target signature algorithm for each message block;

[0107] In this step, the signature order of each message block can be determined to be M1, M2, and M3. Then, M1 is matched with the quantum-resistant signature algorithm Alg1 in the target signature algorithm, M2 is matched with the quantum-resistant signature algorithm Alg2 in the target signature algorithm, and M3 is matched with the traditional signature algorithm Alg3 in the target signature algorithm.

[0108] Step 14: The first terminal uses the target private key of the target signature algorithm corresponding to the current message block to sign the current message block, the message block that has been signed and whose signature order is before the current message block, and the signed message block obtained by completing the signing to obtain a current signed message block corresponding to the current message block.

[0109] In this step, the current message block M1 can be signed using the target private key sk1 corresponding to the quantum-resistant signature algorithm Alg1 to obtain a signed message block E1, i.e., E1 = Alg1(sk1, M1). Then, the current message block M2, the signed message block M1, and the signed message block E1 can be signed using the target private key sk2 corresponding to the quantum-resistant signature algorithm Alg2 to obtain a signed message block E2, i.e., E2 = Alg2(sk2, M1, E1, M2). Similarly, the current message block M3, the signed message block M1, the signed message block E1, the signed message block M2, and the signed message block E2 can be signed using the target private key sk3 corresponding to the quantum-resistant signature algorithm Alg3 to obtain a signed message block E3. In other words, E3 = Alg3(sk3, M1, E1, M2, E2, M3).

[0110] Step 15: The first terminal encrypts each signature message block based on the target quantum-resistant negotiated key, and sends the encrypted signature message blocks to the first server;

[0111] Step 16: The first server receives the encrypted signature information blocks sent by the first terminal, and decrypts the encrypted signature information blocks based on the target quantum-resistant negotiated key to obtain signature message blocks.

[0112] Step 17: The first server broadcasts each of the signed message blocks in the blockchain;

[0113] Step 18: Each second server in the blockchain obtains a target public key of a target signature algorithm that is the same as the local signature algorithm from the blockchain based on the local signature algorithm;

[0114] In this step, when each second server receives the signed message block broadcast by the first server, it can first determine the target signature algorithm corresponding to each signed message block. When the second server is configured with the same target signature algorithm, it can obtain the target public key of the target signature algorithm from the blockchain, so as to facilitate the subsequent use of the target public key to verify the signed message block.

[0115] For example, a blockchain contains two servers, Server 1 and Server 2. Each server is configured with the traditional signature algorithm Alg3. Furthermore, Server 1 is also configured with the quantum-resistant signature algorithm Alg1, while Server 2 is only configured with the traditional signature algorithm Alg3. Consequently, Server 1 can obtain the target public keys pk1 and pk3 from the blockchain, and Server 2 can also obtain the target public key pk3 from the blockchain.

[0116] Step 19: The second server performs signature verification on the corresponding message block based on the obtained target public key, obtains a signature verification result, and sends the signature verification result to the first server;

[0117] In this step, after the second server 1 obtains the target public key pk1 corresponding to the quantum-resistant signature algorithm Alg1 and the target public key pk3 corresponding to the traditional signature algorithm Alg3 from the blockchain, it can perform the following signature verification operation: First, the second server 1 can verify the signature of the signed message block E1 broadcast by the first server based on the target public key pk1, thereby obtaining message block M1. At the same time, the second server 1 can verify the signature of the signed message block E3 broadcast by the first server based on the target public key pk3, thereby obtaining message blocks M1, M2, and M3. Then, the second server 1 can verify the message block M1 obtained from the two verifications to determine whether the two message blocks M1 are the same. At the same time, it can also verify the legitimacy of the transaction information based on the obtained M1, M2, and M3, thereby obtaining the final verification result. The second server 1 can then send the final verification result to the first server.

[0118] Similarly, after obtaining the target public key pk3 corresponding to the traditional signature algorithm Alg3 from the blockchain, second server 2 can verify the signature of the signed message block E3 broadcast by the first server based on the target public key pk3, thereby obtaining message blocks M1, M2, and M3. Second server 2 can then verify the legitimacy of the transaction information based on M1, M2, and M3, obtaining the final verification result, which second server 3 can then send to the first server.

[0119] Step 20: The first server receives the signature verification results for each signed message block sent by each second server;

[0120] Step 21: When the first server determines that the signature verification is successful based on the signature verification results, the first server performs the target transaction.

[0121] The method in this embodiment integrates quantum-resistant algorithms into corresponding components that conform to existing message structures and protocol formats. This enables the first terminal to configure any quantum-resistant signature algorithm, ensuring that the first terminal supports both traditional signature algorithms and quantum-resistant signature algorithms, thereby constructing a forward-compatible quantum-resistant blockchain cryptographic service. This solves the existing problem of quantum-resistant signature algorithm migration causing historical system data to become unavailable and preventing normal communication between the new and old systems.

[0122] By segmenting transaction information into blocks based on traditional signature algorithms and the types of quantum-resistant signature algorithms, and using a nested signature approach, any currently signed message block contains both the previously signed message block and the corresponding signed message block. Therefore, if an older node / server in the blockchain doesn't support a quantum-resistant signature algorithm, while the older node / server won't be able to verify the signature of the message block corresponding to the quantum-resistant signature algorithm, it can still use the traditional signature algorithm to retrieve the plaintext message block that precedes the signature block in the signature sequence, allowing subsequent transaction verification. This resolves the issue of older, unupgraded nodes being unable to participate in transaction verification.

[0123] Another embodiment of the present application provides a quantum-resistant transaction processing device based on blockchain, such as Figure 4 As shown, including:

[0124] A block division module 11 is configured to divide the transaction information of the target transaction into blocks based on the algorithm type of each target signature algorithm configured by the first terminal to obtain a plurality of message blocks; each of the target signature algorithms includes at least a traditional signature algorithm and a quantum-resistant signature algorithm;

[0125] The signing module 12 is configured to sign each message block using a nested signing method based on each target signature algorithm and a target private key of each target signature algorithm to obtain a signed message block corresponding to each message block;

[0126] The first sending module 13 is used to send each of the signed message blocks to the first server, and broadcast each of the signed message blocks through the first server, so that each second server in the blockchain can verify each of the signed message blocks based on the target public key corresponding to the target private key.

[0127] During the specific implementation of this embodiment, the first sending module is further used to: pre-store the algorithm identifier of each target signature algorithm and the target public key of each target signature algorithm in the blockchain through the first server, so that each second server can obtain the target public key corresponding to the target signature algorithm from the blockchain.

[0128] In the specific implementation process of this embodiment, the signature module specifically includes a determination unit and a signature unit:

[0129] The determining unit is configured to determine a signature order for each message block and match a corresponding target signature algorithm for each message block;

[0130] The signing unit is used to sign the current message block to be signed, using the target private key of the target signature algorithm corresponding to the current message block, the current message block, the message block that has been signed and whose signature order is before the current message block, and the signed message block obtained by completing the signing, to obtain a current signed message block corresponding to the current message block.

[0131] During the specific implementation of this embodiment, the blockchain-based quantum-resistant transaction processing device further includes a first negotiation module, which is configured to: encrypt each of the signature message blocks based on a target quantum-resistant negotiation key obtained through pre-negotiation with the first server to obtain an encrypted signature message block, and send each of the encrypted signature message blocks to the first server.

[0132] In the specific implementation of this embodiment, the first negotiation module specifically includes:

[0133] A key pair generation unit, configured to generate a temporary key pair corresponding to a quantum-resistant key encapsulation algorithm;

[0134] An adding unit, configured to add at least the quantum-resistant key encapsulation algorithm to a cryptographic component;

[0135] a first information generating unit, configured to generate first handshake information based at least on the cryptographic component and a temporary public key in the temporary key pair, and send the first handshake information to the first server;

[0136] A first receiving unit is configured to receive second handshake information sent by the first server and generated in response to the first handshake information, where the second handshake information at least includes an encapsulated ciphertext generated by the first server by encapsulating the temporary public key and a first negotiated key corresponding to a quantum key encapsulation algorithm;

[0137] The first receiving unit is further configured to receive a forward-compatible quantum-resistant certificate sent by the first server, and obtain the target quantum-resistant negotiation key by calculation based on the encapsulated ciphertext in the second handshake information based on the first key calculation unit.

[0138] During the specific implementation of this embodiment, the first information generation unit is specifically used to: generate extended information based on the signature algorithm list, the elliptic curve type, the public key corresponding to the elliptic curve, and the temporary public key; generate the first handshake information based on the first terminal random number, the protocol version number, the cryptographic component, and the extended message.

[0139] During the specific implementation of this embodiment, the first key calculation unit is specifically configured to: deseal the encapsulated ciphertext based on the temporary private key in the temporary key pair to obtain a first negotiated key; and generate the target quantum-resistant negotiated key based on the first negotiated key and the historical negotiated key.

[0140] The device in this embodiment divides transaction information into blocks based on traditional signature algorithms and the types of quantum-resistant signature algorithms, and uses a nested signature method to perform signature processing. This ensures that any currently signed message block contains both the previously signed message block and the corresponding signed message block. Therefore, if an older node / server in the blockchain does not support a quantum-resistant signature algorithm, while the older node / server cannot verify the signature block corresponding to the quantum-resistant signature algorithm, it can still use the traditional signature algorithm to obtain the plaintext message block that precedes the signature block from the signature block corresponding to the traditional signature algorithm, thereby performing subsequent transaction verification. This solves the problem of older nodes not being able to participate in transaction verification due to their inability to participate.

[0141] Another embodiment of the present application provides a quantum-resistant transaction processing device based on blockchain, such as Figure 5 Shown, including:

[0142] The signature information block receiving module 21 is configured to receive signature information blocks for a target transaction sent by the first terminal; each signature information block is obtained by the first terminal performing block processing on the transaction information of the target transaction based on the algorithm type of each configured target signature algorithm, and signing the message blocks obtained by the block processing based on the target private key of each target signature algorithm;

[0143] A broadcast module 22, configured to broadcast each of the signed message blocks in the blockchain;

[0144] A result receiving module 23 receives the signature verification results for each signed message block sent by each second server; each of the signature verification results is obtained by the second server performing signature verification processing on each of the signed message blocks based on the target public key corresponding to each target private key;

[0145] The transaction module 24 is configured to perform a target transaction when it is determined based on the signature verification results that the signature verification is passed.

[0146] In the specific implementation of this embodiment, the blockchain-based quantum-resistant transaction processing device further includes a second negotiation module, which is configured to pre-negotiate with the first terminal to obtain a target quantum-resistant negotiation key for encrypting each signed message block. The second communication module specifically includes:

[0147] A second receiving unit is configured to receive a first handshake request sent by a first terminal, where the first handshake request is generated by the first terminal based on at least a cryptographic component and a temporary public key in a temporary key pair of a quantum-resistant key encapsulation algorithm;

[0148] a ciphertext generation unit, configured to, when the first handshake request includes a temporary public key of a quantum-resistant key encapsulation algorithm and the cryptographic component includes a quantum-resistant key encapsulation algorithm, encapsulate a first negotiated key corresponding to the quantum-resistant key encapsulation algorithm based on the temporary public key to generate an encapsulated ciphertext;

[0149] A second information generating unit, configured to generate second handshake information based at least on the encapsulated ciphertext, and send the second handshake information to the first terminal;

[0150] A second key calculation unit is configured to generate the target quantum-resistant negotiation key based on the first negotiation key and the historical negotiation key;

[0151] The certificate generation unit is configured to generate a forward-compatible quantum-resistant certificate and send the forward-compatible quantum-resistant certificate to the first terminal.

[0152] During the specific implementation of this embodiment, the certificate generation unit is specifically configured to generate the forward-compatible quantum-resistant certificate based on the version number, serial number, signature algorithm, signature algorithm hash, quantum-resistant signature algorithm, quantum-resistant signature algorithm hash, issuer, start time, end time, subject name, signature public key, quantum-resistant signature algorithm public key, signature, and quantum-resistant signature.

[0153] The device in this embodiment receives signed message blocks from a first terminal, obtained by segmenting transaction information based on traditional signature algorithms and various quantum-resistant signature algorithms, and performing nested signature processing. The device then broadcasts each signed message block, enabling a second server in the blockchain to receive each signed message block. Because any current signed message block contains both the previously signed message block and the corresponding signed message block, if an older node or second server in the blockchain does not support a quantum-resistant signature algorithm, while the older node or second server cannot verify the signed message block corresponding to the quantum-resistant signature algorithm, it can still use the traditional signature algorithm to obtain a plaintext message block that precedes the current signed message block in the signature sequence from the current signed message block corresponding to the traditional signature algorithm, thereby performing subsequent transaction verification. This resolves the issue of older, non-upgraded nodes being unable to participate in transaction verification.

[0154] Another embodiment of the present application provides a storage medium storing a computer program. When the computer program is executed by a processor, the following method steps are implemented:

[0155] Step 1: Blocking the transaction information of the target transaction based on the algorithm type of each target signature algorithm configured by the first terminal to obtain a plurality of message blocks; the transaction information includes the transaction amount and the transaction object identifier; each of the target signature algorithms includes at least a traditional signature algorithm and a quantum-resistant signature algorithm;

[0156] Step 2: Based on each of the target signature algorithms and the target private keys of each of the target signature algorithms, each of the message blocks is signed using a nested signature method to obtain a signed message block corresponding to each of the message blocks;

[0157] Step 3: Send each of the signed message blocks to the first server, and broadcast each of the signed message blocks through the first server so that each second server in the blockchain can verify the signature of each of the signed message blocks based on the target public key corresponding to the target private key.

[0158] Or implement the following steps:

[0159] Step 1: Receive signature information blocks for a target transaction sent by the first terminal; each signature information block is obtained by the first terminal performing block processing on the transaction information of the target transaction based on the algorithm type of each configured target signature algorithm, and signing the message blocks obtained by the block processing based on the target private key of each target signature algorithm;

[0160] Step 2: broadcasting each of the signed message blocks in the blockchain;

[0161] Step 3: Receive the signature verification results for each signed message block sent by each second server; each verification result is obtained by the second server performing signature verification processing on each signed message block based on the target public key corresponding to each target private key;

[0162] Step 4: When the signature verification is determined to be successful based on the signature verification results, the target transaction is carried out.

[0163] The specific implementation process of the above method steps can be found in any of the above-mentioned blockchain-based quantum-resistant transaction processing methods and method embodiments, and this embodiment will not be repeated here.

[0164] The storage medium in this application divides transaction information into blocks based on traditional signature algorithms and the types of quantum-resistant signature algorithms, and uses a nested signature method to process the blocks. This allows any currently signed message block to contain previously signed message blocks and corresponding signed message blocks. Therefore, when an older node / server in the blockchain does not support a quantum-resistant signature algorithm, while the older node / server cannot verify the signature of the signature block corresponding to the quantum-resistant signature algorithm, it can still use the traditional signature algorithm to obtain the plaintext message block that precedes the signature block in the signature sequence from the signature block corresponding to the traditional signature algorithm, thereby performing subsequent transaction verification. This solves the problem of older, unupgraded nodes being unable to participate in transaction verification.

[0165] Another embodiment of the present application provides an electronic device, such as Figure 6 As shown, it at least includes a memory 1 and a processor 2. The memory 1 stores a computer program. When the processor 2 executes the computer program on the memory 1, it implements the following method steps:

[0166] Step 1: Blocking the transaction information of the target transaction based on the algorithm type of each target signature algorithm configured by the first terminal to obtain a plurality of message blocks; the transaction information includes the transaction amount and the transaction object identifier; each of the target signature algorithms includes at least a traditional signature algorithm and a quantum-resistant signature algorithm;

[0167] Step 2: Based on each of the target signature algorithms and the target private keys of each of the target signature algorithms, each of the message blocks is signed using a nested signature method to obtain a signed message block corresponding to each of the message blocks;

[0168] Step 3: Send each of the signed message blocks to the first server, and broadcast each of the signed message blocks through the first server so that each second server in the blockchain can verify the signature of each of the signed message blocks based on the target public key corresponding to the target private key.

[0169] Or implement the following steps:

[0170] Step 1: Receive signature information blocks for a target transaction sent by the first terminal; each signature information block is obtained by the first terminal performing block processing on the transaction information of the target transaction based on the algorithm type of each configured target signature algorithm, and signing the message blocks obtained by the block processing based on the target private key of each target signature algorithm;

[0171] Step 2: broadcasting each of the signed message blocks in the blockchain;

[0172] Step 3: Receive the signature verification results for each signed message block sent by each second server; each verification result is obtained by the second server performing signature verification processing on each signed message block based on the target public key corresponding to each target private key;

[0173] Step 4: When the signature verification is determined to be successful based on the signature verification results, the target transaction is carried out.

[0174] The specific implementation process of the above method steps can be found in any of the above-mentioned blockchain-based quantum-resistant transaction processing methods and method embodiments, and this embodiment will not be repeated here.

[0175] The electronic device in this application divides transaction information into blocks based on traditional signature algorithms and the types of quantum-resistant signature algorithms, and uses a nested signature method to perform signature processing, so that any current signed message block contains the previously signed message block and the corresponding signed message block. Therefore, when an old node / server in the blockchain does not support the quantum-resistant signature algorithm, although the old node / server cannot verify the signature of the signed message block corresponding to the quantum-resistant signature algorithm, it can still use the traditional signature algorithm to obtain the plaintext message block whose signature sequence is located before the signed message block corresponding to the traditional signature algorithm, thereby performing subsequent transaction verification, thus solving the problem that the old node / server that has not been upgraded cannot participate in transaction verification.

[0176] The above embodiments are merely exemplary embodiments of the present application and are not intended to limit the scope of the present application. The scope of protection of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and scope of protection of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the scope of protection of the present application.

Claims

1. A method for processing quantum-resistant transactions based on blockchain, the method being applied to a first terminal corresponding to a first server in the blockchain, characterized in that: The method comprises: Blocking the transaction information of the target transaction based on the algorithm type of each target signature algorithm configured by the first terminal to obtain a plurality of message blocks; each of the target signature algorithms includes at least a traditional signature algorithm and a quantum-resistant signature algorithm; Based on each of the target signature algorithms and the target private keys of each of the target signature algorithms, each of the message blocks is signed using a nested signature method to obtain a signed message block corresponding to each of the message blocks; Each of the signed message blocks is sent to the first server, and each of the signed message blocks is broadcasted by the first server, so that each second server in the blockchain can verify the signature of each of the signed message blocks based on the target public key corresponding to the target private key.

2. The method according to claim 1, wherein Before dividing the transaction information of the target transaction into blocks based on the algorithm type of each target signature algorithm configured by the first terminal, the method further includes: The algorithm identifier of each target signature algorithm and the target public key of each target signature algorithm are stored in the blockchain in advance through the first server, so that each second server can obtain the target public key corresponding to the target signature algorithm from the blockchain.

3. The method according to claim 1, wherein The step of signing each message block using a nested signature method based on each target signature algorithm and the target private key of each target signature algorithm to obtain a signed message block corresponding to each message block specifically includes: Determine the signature order of each message block and match the corresponding target signature algorithm for each message block; For the current message block to be signed, the target private key of the target signature algorithm corresponding to the current message block is used to sign the current message block, the message block that has been signed and whose signature order is before the current message block, and the signed message block obtained by completing the signing, to obtain a current signed message block corresponding to the current message block.

4. The method according to claim 1, wherein Before sending each of the signed message blocks to the first server, the method further includes: Based on the target quantum-resistant negotiation key obtained through pre-negotiation with the first server, each of the signature message blocks is encrypted to obtain an encrypted signature message block, and each of the encrypted signature message blocks is sent to the first server.

5. The method according to claim 4, wherein The method further includes: pre-negotiating with the first server to obtain the target quantum-resistant negotiation key, specifically including: For a quantum-resistant key encapsulation algorithm, generating a temporary key pair corresponding to the quantum-resistant key encapsulation algorithm; Adding at least the quantum-resistant key encapsulation algorithm to a cryptographic component; generating a first handshake message based at least on the cryptographic component and a temporary public key in the temporary key pair, and sending the first handshake message to the first server; Receiving second handshake information sent by the first server and generated based on the first handshake information, where the second handshake information at least includes an encapsulated ciphertext generated by the first server by encapsulating the temporary public key and a first negotiated key corresponding to a quantum key encapsulation algorithm; Receive a forward-compatible quantum-resistant certificate sent by the first server, and calculate and obtain the target quantum-resistant negotiation key based on the encapsulated ciphertext in the second handshake information.

6. The method according to claim 5, wherein Generating first handshake information based at least on the cryptographic component and the temporary public key in the temporary key pair specifically includes: Generate extended information based on the signature algorithm list, the elliptic curve type, the public key corresponding to the elliptic curve, and the temporary public key; The first handshake information is generated based on the first terminal random number, the protocol version number, the cryptographic component, and the extended message.

7. The method according to claim 5, wherein The obtaining the target quantum-resistant negotiation key by calculating based on the encapsulated ciphertext in the second handshake information specifically includes: Decrypting the encapsulated ciphertext based on the temporary private key in the temporary key pair to obtain a first negotiated key; The target quantum-resistant negotiation key is generated based on the first negotiation key and the historical negotiation key.

8. A method for processing quantum-resistant transactions based on blockchain, the method being applied to a first server in the blockchain, characterized in that: The method comprises: receiving each signed message block for a target transaction sent by the first terminal; each signed message block is obtained by the first terminal performing block processing on transaction information of the target transaction based on the algorithm type of each configured target signature algorithm, and signing the message blocks obtained by block processing based on the target private key of each target signature algorithm; each target signature algorithm includes at least a traditional signature algorithm and a quantum-resistant signature algorithm; Broadcasting each of the signed message blocks in the blockchain; receiving a signature verification result for each signed message block sent by each second server; each of the signature verification results is obtained by the second server performing signature verification processing on each of the signed message blocks based on the target public key corresponding to each of the target private keys; When it is determined that the signature verification is passed based on each of the signature verification results, the target transaction is carried out.

9. The method according to claim 8, wherein Before receiving each signed message block for transaction information sent by the first terminal, the method further includes: pre-negotiating with the first terminal to obtain a target quantum-resistant negotiation key for encrypting each signed message block, specifically including: Receiving a first handshake request sent by a first terminal, where the first handshake request is generated by the first terminal based on at least a cryptographic component and a temporary public key in a temporary key pair of a quantum-resistant key encapsulation algorithm; When the first handshake request includes a temporary public key of a quantum-resistant key encapsulation algorithm and the cryptographic component includes a quantum-resistant key encapsulation algorithm, encapsulating a first negotiated key corresponding to the quantum-resistant key encapsulation algorithm based on the temporary public key to generate an encapsulated ciphertext; generating second handshake information based at least on the encapsulated ciphertext, and sending the second handshake information to the first terminal; Generate the target quantum-resistant negotiation key based on the first negotiation key and the historical negotiation key; Generate a forward-compatible quantum-resistant certificate, and send the forward-compatible quantum-resistant certificate to the first terminal.

10. The method according to claim 9, wherein Generating a forward-compatible quantum-resistant certificate specifically includes: The forward-compatible quantum-resistant certificate is generated based on the version number, serial number, quantum-resistant signature algorithm, quantum-resistant signature algorithm hash, issuer, start time, end time, subject name, quantum-resistant signature algorithm public key, and quantum-resistant signature.

11. A quantum-resistant transaction processing device based on blockchain, characterized in that: include: a block division module, configured to divide the transaction information of the target transaction into blocks based on the algorithm type of each target signature algorithm configured by the first terminal, to obtain a plurality of message blocks; Each of the target signature algorithms includes at least a traditional signature algorithm and a quantum-resistant signature algorithm; A signature module, configured to sign each message block using a nested signature method based on each target signature algorithm and a target private key of each target signature algorithm, to obtain a signed message block corresponding to each message block; The first sending module is used to send each of the signed message blocks to a first server, and broadcast each of the signed message blocks through the first server, so that each second server in the blockchain can verify each of the signed message blocks based on a target public key corresponding to a target private key.

12. A quantum-resistant transaction processing device based on blockchain, characterized in that: include: a signature message block receiving module, configured to receive signature message blocks for a target transaction sent by the first terminal; each signature message block is obtained by the first terminal performing block processing on the transaction information of the target transaction based on the algorithm type of each configured target signature algorithm, and signing the message blocks obtained by block processing based on the target private key of each target signature algorithm; each target signature algorithm includes at least a traditional signature algorithm and a quantum-resistant signature algorithm; A broadcast module, configured to broadcast each of the signed message blocks in the blockchain; a result receiving module for receiving the signature verification results for each signed message block sent by each second server; each of the signature verification results is obtained by the second server performing signature verification processing on each of the signed message blocks based on the target public key corresponding to each target private key; The transaction module is configured to conduct a target transaction when it is determined that the signature verification is passed based on the signature verification results.

13. A computer storage medium, characterized in that The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of the blockchain-based quantum-resistant transaction processing method described in any one of claims 1 to 7 or claims 8 to 10.

14. An electronic device, characterized in that: The system comprises at least a memory and a processor, wherein a computer program is stored on the memory, and when the processor executes the computer program on the memory, the processor implements the steps of the blockchain-based quantum-resistant transaction processing method as described in any one of claims 1 to 7 or claims 8 to 10.

Citation Information

Patent Citations

  • Digital signature method and device, storage medium and electronic equipment

    CN117201034A

  • Transaction processing method and device based on block chain, storage medium and electronic equipment

    CN119417604A