Blockchain-based transaction processing method, device, storage medium and electronic device

By introducing a dual signature verification mechanism into the blockchain system, combining the classic encryption signature algorithm and anti-quantum encryption signature algorithm, the compatibility and security problems faced by the blockchain system in the process of upgrading the encryption algorithm are solved, and transaction security and compatibility are achieved.

CN119417604BActive Publication Date: 2025-04-08BUBI (BEIJING) NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510033772.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-04-08
Estimated Expiration
2045-01-09

AI Technical Summary

Technical Problem

The classic encryption algorithms of blockchain systems face the risk of being cracked by quantum computing. The existing anti-quantum encryption algorithms have not been fully standardized, and there are challenges in performance and implementation, resulting in blockchain systems facing compatibility and security issues during the encryption algorithm upgrade process.

Method used

The dual signature verification mechanism is adopted to hash the transaction content in the transaction request to be initiated, and the first hash value is signed using the pre-stored anti-quantum encryption signature algorithm private key to obtain the first anti-quantum signature, and combined with the classic encryption signature algorithm to fuse the signature data to ensure the security and compatibility of the transaction.

Benefits of technology

The compatibility of the blockchain system with classic encryption signature algorithms and quantum encryption signature algorithms during the upgrade process is realized, ensuring the security of transactions, reducing the risk of being cracked, and simplifying the switching process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417604B_ABST
    Figure CN119417604B_ABST
Patent Text Reader

Abstract

The present invention relates to a transaction processing method, device, storage medium and electronic device based on blockchain, and the method includes: performing a hash operation on the transaction content in the transaction request to be initiated to obtain a first hash value; if it is determined that the type of the stored signature algorithm private key is the first stage of classical encryption and anti-quantum encryption signature algorithm private key, using the anti-quantum encryption signature algorithm private key to sign the first hash value to obtain an anti-quantum first signature; splicing the first hash value and the anti-quantum first signature to obtain the first splicing data and performing a hash operation to obtain a second hash value; using the classical encryption signature algorithm private key to sign the second hash value to obtain the classical first signature data; fusing the anti-quantum first signature and the classical first signature data to obtain signature data; carrying the signature data in the transaction request and sending it to the access node on the blockchain for processing. The transaction security can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data security technology, and in particular to a transaction processing method, device, storage medium and electronic device based on blockchain. Background Art

[0002] Blockchain is a decentralized distributed ledger technology that uses a peer-to-peer blockchain network and classical encryption algorithms based on large number factorization and discrete logarithms to achieve functions such as information addressing, verification, storage and transaction. With its decentralization, transparency, traceability and tamper-proof characteristics, it is widely used in smart contract transactions including crypto asset transactions.

[0003] With the rapid development of quantum computing technology, the use of principles such as qubits and quantum entanglement can efficiently solve problems such as factorization of large numbers and discrete logarithm problems, making the classical encryption algorithms of blockchain systems at risk of being cracked, posing a potential threat to the security of existing blockchain systems.

[0004] In order to cope with the threat of quantum computing, researchers have begun to explore quantum-resistant encryption algorithms, which currently include lattice encryption algorithms, coding theory encryption algorithms, etc. However, these algorithms have not yet been fully standardized, and there are some challenges in performance and implementation. Summary of the invention

[0005] In view of this, the present invention provides a transaction processing method, device, storage medium and electronic device based on blockchain.

[0006] Specifically, the present invention is achieved through the following technical solutions:

[0007] According to a first aspect of the present invention, a transaction processing method based on blockchain is provided, and the transaction processing method based on blockchain includes:

[0008] Performing a hash operation on the transaction content in the transaction request to be initiated to obtain a first hash value;

[0009] Querying a pre-stored signature algorithm private key repository, if it is determined that the type of the stored signature algorithm private key is the first-stage classical encryption and quantum-resistant encryption signature algorithm private key, use the stored quantum-resistant encryption signature algorithm private key to sign the first hash value to obtain a quantum-resistant first signature;

[0010] splicing the first Hash value and the first quantum-resistant signature to obtain first spliced ​​data, and running the first spliced ​​data using a Hash algorithm to obtain a second Hash value;

[0011] Sign the second hash value using the stored private key of the classic encryption signature algorithm to obtain classic first signature data;

[0012] Fusion of the quantum-resistant first signature and the classical first signature data to obtain signature data;

[0013] The signature data, the classic encryption signature algorithm public key corresponding to the classic encryption signature algorithm private key, the quantum-resistant encryption signature algorithm public key corresponding to the quantum-resistant encryption signature algorithm private key, and the transaction content are carried in the transaction request and sent to the access node on the blockchain to process the transaction request.

[0014] The transaction processing method based on blockchain in this technical solution uses the stored quantum-resistant encryption signature algorithm private key to sign the first hash value of the transaction content to obtain the quantum-resistant first signature; splices the first hash value and the quantum-resistant first signature to obtain the first spliced ​​data, and then uses the hash algorithm to run the first spliced ​​data to obtain the second hash value; then, uses the classic encryption signature algorithm private key to sign the second hash value to obtain the classic first signature data; and fuses the quantum-resistant first signature and the classic first signature data to obtain the signature data. In this way, a dual-signature verification mechanism is set to achieve a smooth transition from the classic encryption signature algorithm to the quantum-resistant encryption signature algorithm, and ensure the security of the transaction, allowing the blockchain system to support both the classic encryption signature algorithm and the quantum-resistant encryption signature algorithm during the upgrade process, ensuring the compatibility and security of the blockchain system.

[0015] According to a second aspect of the present invention, a transaction processing device based on blockchain is provided, and the transaction processing device based on blockchain includes:

[0016] A first hash operation module, configured to perform a hash operation on the transaction content in the transaction request to be initiated to obtain a first hash value;

[0017] A quantum signature module is used to query a pre-stored signature algorithm private key repository, and if it is determined that the type of the stored signature algorithm private key is the first-stage classical encryption and quantum-resistant encryption signature algorithm private key, use the stored quantum-resistant encryption signature algorithm private key to sign the first hash value to obtain a quantum-resistant first signature;

[0018] A second hash operation module is used to concatenate the first hash value and the quantum-resistant first signature to obtain first concatenated data, and to run the first concatenated data using a hash algorithm to obtain a second hash value;

[0019] A classic signature module, used to sign the second hash value using a stored private key of a classic encryption signature algorithm to obtain classic first signature data;

[0020] A signature fusion module, used to fuse the quantum-resistant first signature and the classical first signature data to obtain signature data;

[0021] A request sending module is used to carry the signature data, the classic encryption signature algorithm public key corresponding to the classic encryption signature algorithm private key, the quantum-resistant encryption signature algorithm public key corresponding to the quantum-resistant encryption signature algorithm private key, and the transaction content in the transaction request, and send it to an access node on the blockchain to process the transaction request.

[0022] According to a third aspect of the present invention, there is provided a storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the blockchain-based transaction processing method in any possible implementation of the first aspect.

[0023] According to a fourth aspect of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the transaction processing method based on blockchain in any possible implementation of the first aspect are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0026] Figure 1 A flowchart of a transaction processing method based on blockchain provided by an embodiment of the present invention;

[0027] Figure 2 A schematic diagram of upgrading the encryption signature algorithm of the access node and the client provided in an embodiment of the present invention;

[0028] Figure 3 A schematic diagram of a transaction processing device based on blockchain provided in an embodiment of the present invention;

[0029] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] The security of blockchain systems depends on the encryption algorithms used, and upgrades usually need to consider backward compatibility to ensure a smooth transition of blockchain systems. Therefore, in the process of transitioning from classical encryption algorithms to quantum-resistant encryption algorithms, blockchain systems need to solve the compatibility issues between the old and new algorithms, that is, transaction processing, while ensuring the continuous operation and security of blockchain systems. Among them, transaction processing includes but is not limited to: account password switching and smart contract code switching. Among them, account password switching requires initiating a switching transaction on the source chain, generating a hash commitment as the receiving address on the target chain, verifying the hash commitment and destroying the account assets on the source chain, and finally receiving and unlocking the assets on the target chain. For smart contract code switching, by identifying the cryptographic components that need to be updated, writing and deploying new smart contract code, switching the original smart contract data, and calling the update code through transactions, the correctness of the update result is finally verified.

[0032] The above-mentioned transaction processing method based on blockchain needs to involve multiple steps such as hash commitment protocol, proof of destruction, dynamic switching of smart contract code, etc., which makes user operation complicated, resulting in a complicated switching process, low switching efficiency, and high system maintenance and execution costs. Furthermore, in the face of future protocol updates or system changes, the switching process may be difficult to adapt and lack flexibility. Moreover, since the proof of destruction mechanism is irreversible, it cannot be rolled back when there is a switching failure or error processing, resulting in a switching failure. The upgrade of the encryption algorithm of the blockchain system needs to consider backward compatibility. In the process of upgrading from the classical encryption algorithm to the quantum-resistant encryption algorithm, transaction processing needs to be solved. However, the transaction processing method based on blockchain in the related technology needs to involve multiple steps such as hash commitment protocol, proof of destruction, dynamic switching of smart contract code, etc., which makes user operation complicated, resulting in a complicated switching process and low switching efficiency.

[0033] In this embodiment, in the process of upgrading the encryption algorithm of the blockchain system to be compatible with the quantum-resistant encryption signature algorithm and ensuring the security of transactions, in order to smoothly transition to the quantum-resistant encryption signature algorithm, taking into account the non-standardization and potential risks of the existing quantum-resistant algorithm, a dual-signature mechanism is introduced to ensure the security of the blockchain system, while being compatible with the classical encryption algorithm and the quantum-resistant encryption signature algorithm.

[0034] See also Figure 1 The embodiment of the present invention provides a transaction processing method based on blockchain, which may include the following steps:

[0035] S101, performing a hash operation on the transaction content in the transaction request to be initiated to obtain a first hash value;

[0036] In this embodiment, a hash value of the transaction content (blob) is calculated using a preset hash algorithm to obtain a first hash value (blob'). As an optional embodiment, the transaction content includes but is not limited to: source account address, destination account address, transaction type, transaction data, etc.

[0037] In this embodiment, when the source client needs to initiate a transaction request to the target client, for example, a transfer transaction request carrying a transfer amount is initiated to the source client.

[0038] S102, querying a pre-stored signature algorithm private key repository, if it is determined that the type of the stored signature algorithm private key is the first-stage classical encryption and quantum-resistant encryption signature algorithm private key, using the stored quantum-resistant encryption signature algorithm private key to sign the first hash value to obtain a quantum-resistant first signature;

[0039] In this embodiment, as an optional embodiment, the types of signature algorithm private keys include but are not limited to: classic encryption signature algorithm private keys, quantum-resistant encryption signature algorithm private keys, first-stage classic encryption and quantum-resistant encryption signature algorithm private keys, and second-stage classic encryption and quantum-resistant encryption signature algorithm private keys. Among them, the first-stage classic encryption and quantum-resistant encryption signature algorithm private keys refer to signature algorithms that support classic encryption signature algorithms, as well as dual-signature mechanisms that support classic encryption signature algorithms and quantum-resistant encryption signature algorithms, and the second-stage classic encryption and quantum-resistant encryption signature algorithm private keys refer to signature algorithms that support quantum-resistant encryption signature algorithms, as well as dual-signature mechanisms that support classic encryption signature algorithms and quantum-resistant encryption signature algorithms.

[0040] In this embodiment, as an optional embodiment, the classic encryption signature algorithm includes but is not limited to: a symmetric encryption algorithm, an asymmetric encryption algorithm, and an advanced encryption algorithm, which are not specifically limited here.

[0041] In this embodiment, as an optional embodiment, the client sets a classic encryption signature algorithm private key repository in the signature algorithm private key repository to store the classic encryption signature algorithm private key, and sets a quantum-resistant encryption signature algorithm private key repository to store the quantum-resistant encryption signature algorithm private key. If after the node is upgraded, the client does not interact with the blockchain system, fails to obtain the quantum-resistant encryption signature algorithm private key, and does not perform a corresponding upgrade, the quantum-resistant encryption signature algorithm private key repository is empty, indicating that the type of the stored signature algorithm private key is the classic encryption signature algorithm private key. If after the node is upgraded, the client interacts with the blockchain system to obtain the quantum-resistant encryption signature algorithm private key, but has not performed a corresponding upgrade, the quantum-resistant encryption signature algorithm private key repository stores the quantum-resistant encryption signature algorithm private key, and at the same time, the classical encryption signature algorithm private key is stored in the classical encryption signature algorithm private key repository, indicating that the types of the stored signature algorithm private keys are classical encryption and quantum-resistant encryption signature algorithm private keys. If after the node is upgraded, the client interacts with the blockchain system to obtain the quantum-resistant encryption signature algorithm private key and also performs a corresponding upgrade, the quantum-resistant encryption signature algorithm private key stored in the quantum-resistant encryption signature algorithm private key repository is retained, and at the same time, the classic encryption signature algorithm private key stored in the classic encryption signature algorithm private key repository is cleared, indicating that the type of the stored signature algorithm private key is the quantum-resistant encryption signature algorithm private key.

[0042] In this embodiment, in order to improve the data security of the client, the transaction processing method of this embodiment is adopted for the situation where the client interacts with the blockchain system to obtain the private key of the quantum-resistant encryption signature algorithm, but has not yet performed the corresponding upgrade.

[0043] S103, concatenating the first Hash value and the first quantum-resistant signature to obtain first concatenated data, and running the first concatenated data using a Hash algorithm to obtain a second Hash value;

[0044] In this embodiment, the first Hash value and the quantum-resistant first signature are concatenated to obtain first concatenated data, and a Hash operation is performed on the first concatenated data to obtain a second Hash value.

[0045] S104. Sign the second hash value using the stored private key of the classic encryption signature algorithm to obtain classic first signature data;

[0046] In this embodiment, as an optional embodiment, the second hash value and the quantum-resistant first signature can also be spliced ​​to obtain second spliced ​​data, the second spliced ​​data can be run using a hash algorithm to obtain a second spliced ​​hash value, the second hash value can be replaced with the second spliced ​​hash value, and the updated second hash value can be signed using the stored private key of the classical encryption signature algorithm to obtain the classical first signature data.

[0047] In this embodiment, as an optional embodiment, after the quantum-resistant first signature (qsign) is attached to the second hash value (blob'), the hash value of the second hash value to which the quantum-resistant first signature is attached is calculated again. As an optional embodiment, the result (second hash value) is reassigned to the first hash value for subsequent operations.

[0048] In this embodiment, if the quantum-resistant encryption signature algorithm private key repository and the classical encryption signature algorithm private key repository are not empty, the quantum-resistant encryption signature algorithm private key (qsk) is read, and the first hash value (blob') is signed using the quantum-resistant encryption signature algorithm private key (qsk) to generate a quantum-resistant first signature (qsign). Next, the first hash value (blob') and the quantum-resistant first signature (qsign) are spliced ​​to obtain first spliced ​​data, and the first spliced ​​data is run using a hash algorithm to obtain a second hash value. As an optional embodiment, the first hash value is updated using the second hash value. Then, the second hash value (updated first hash value) is signed using the classical encryption signature algorithm private key to generate the classical first signature data. In this embodiment, the updated first hash value (blob') is signed using the classical encryption signature algorithm private key (csk) to generate the classical first signature data (csign).

[0049] S105, fusing the quantum-resistant first signature and the classical first signature data to obtain signature data;

[0050] In this embodiment, as an optional embodiment, fusing the quantum-resistant first signature and the classical first signature data includes but is not limited to: splicing the quantum-resistant first signature and the classical first signature data.

[0051] S106. Carry the signature data, the public key of the classical encryption signature algorithm corresponding to the private key of the classical encryption signature algorithm, the public key of the quantum-resistant encryption signature algorithm corresponding to the private key of the quantum-resistant encryption signature algorithm, and the transaction content in the transaction request, and send them to the access node on the blockchain to process the transaction request.

[0052] In this embodiment, a pre-stored signature algorithm private key repository is queried, and based on the type of the stored signature algorithm private key, the transaction request to be initiated is signed to generate signature data, and the signature data, the public key corresponding to the stored signature algorithm private key, and the transaction content are carried in the transaction request.

[0053] In this embodiment, as an optional embodiment, the method further includes:

[0054] If it is determined that the type of the stored signature algorithm private key is a classic encryption signature algorithm private key, use the classic encryption signature algorithm private key to sign the first hash value to obtain the signature data;

[0055] The transaction request carries the signature data, the public key of the classic encryption signature algorithm corresponding to the private key of the classic encryption signature algorithm, and the transaction content.

[0056] In this embodiment, the access node determines whether the stored signature algorithm private key includes the quantum-resistant encryption signature algorithm private key and the classical encryption signature algorithm private key, that is, queries the classical encryption signature algorithm private key repository and the quantum-resistant encryption signature algorithm private key repository:

[0057] If the quantum-resistant encryption signature algorithm private key (qsk) stored in the quantum-resistant encryption signature algorithm private key repository is empty, the first hash value is signed using the classical encryption signature algorithm private key to generate signature data, where the first hash value (blob') is the hash value of the transaction content.

[0058] If both the private key of the classic encryption signature algorithm stored in the classic encryption signature algorithm private key repository and the private key of the quantum-resistant encryption signature algorithm stored in the quantum-resistant encryption signature algorithm private key repository are not empty, then the first hash value obtained based on the transaction content is signed according to the quantum-resistant encryption signature algorithm private key to generate a quantum-resistant first signature; the first hash value and the quantum-resistant first signature are concatenated to obtain first concatenated data, the first concatenated data is run using a hash algorithm to obtain a second hash value, and the first hash value is updated using the second hash value; the updated first hash value is signed using the classic encryption signature algorithm private key to generate classic first signature data.

[0059] In this embodiment, for the pre-set first-stage classical encryption and quantum-resistant encryption signature algorithm private keys, when the classical encryption signature algorithm private key is used to sign the first hash value, the first hash value is an updated first hash value (blob'), that is, a hash value that combines the first hash value of the original transaction content and the quantum-resistant first signature, which can ensure that the transaction request is more secure and effectively reduce the probability of being cracked.

[0060] In this embodiment, when the quantum-resistant encryption signature algorithm private key repository and the classical encryption signature algorithm private key repository are both not empty, the quantum-resistant first signature and the classical first signature data are concatenated to obtain signature data.

[0061] In this embodiment, the quantum-resistant first signature and the classical first signature data are concatenated to obtain signature data (sign), which is then attached to the transaction structure.

[0062] In this embodiment, if the quantum-resistant encryption signature algorithm private key (qsk) stored in the quantum-resistant encryption signature algorithm private key repository is empty, the signature data (sign) only includes the classic second signature data (csign) signed based on the first hash value of the transaction content, and the classic second signature data is the signature data.

[0063] In this embodiment, as another optional embodiment, the method further includes:

[0064] If it is determined that the type of the stored signature algorithm private key is a quantum-resistant encryption signature algorithm private key, the first hash value is signed using the stored quantum-resistant encryption signature algorithm private key to obtain the signature data;

[0065] The transaction request carries the signature data, the public key of the quantum-resistant encryption signature algorithm corresponding to the private key of the quantum-resistant encryption signature algorithm, and the transaction content.

[0066] In this embodiment, as another optional embodiment, the method further includes:

[0067] If it is determined that the type of the stored signature algorithm private key is the second-stage classical encryption and quantum-resistant encryption signature algorithm private key, the first hash value is signed using the stored quantum-resistant encryption signature algorithm private key to obtain a quantum-resistant first signature;

[0068] splicing the first Hash value and the first quantum-resistant signature to obtain first spliced ​​data, and running the first spliced ​​data using a Hash algorithm to obtain a second Hash value;

[0069] Sign the second hash value using the stored private key of the classic encryption signature algorithm to obtain classic first signature data;

[0070] The quantum-resistant first signature and the classical first signature data are merged to obtain the signature data.

[0071] In this embodiment, the first hash value (blob') of the transaction content is signed using the quantum-resistant encryption signature algorithm private key (qsk) to generate a quantum-resistant first signature (qsign). The first hash value and the quantum-resistant first signature are concatenated, for example, the quantum-resistant first signature (qsign) is attached to the first hash value (blob') to obtain first concatenated data, the first concatenated data is run using a hash algorithm to obtain a second hash value, and the first hash value is updated using the second hash value.

[0072] In this embodiment, the updated first hash value (blob') is signed using the classic encryption signature algorithm private key (csk) to generate classic first signature data (csign).

[0073] The quantum-resistant first signature and the classical first signature data are concatenated to generate the final signature data (sign) and return the data.

[0074] In this embodiment, as another optional embodiment, the method further includes:

[0075] If it is determined that the type of the stored signature algorithm private key is the second-stage classical encryption and quantum-resistant encryption signature algorithm private key, the first hash value is signed using the stored classical encryption signature algorithm private key to obtain classical second signature data;

[0076] splicing the first hash value and the quantum-resistant second signature to obtain second spliced ​​data, and running the second spliced ​​data using a hash algorithm to obtain a third hash value;

[0077] Signing the third hash value using the stored quantum-resistant encryption signature algorithm private key to obtain a quantum-resistant second signature;

[0078] The quantum-resistant second signature and the classical second signature data are merged to obtain the signature data.

[0079] In this embodiment, after the access node (client) is upgraded to the third-stage version, the blockchain system switches the account from the classic encryption signature algorithm to the quantum-resistant encryption signature algorithm through the intelligent switching contract. In this way, the security of user assets and data can be ensured, and the compatibility of the classic encryption signature algorithm and the quantum-resistant encryption signature algorithm can be provided. Therefore, as another optional embodiment, the method also includes:

[0080] B11, deploying smart switching contracts on the access nodes of the blockchain system;

[0081] In this embodiment, a smart switching contract is deployed. As an optional embodiment, a blockchain node or an account with predetermined special permissions creates and deploys a smart switching contract to handle the switching process (ledger migration) from a classic encryption signature algorithm account to a quantum-resistant encryption signature algorithm account.

[0082] In this embodiment, the smart switching contract provides identity authentication to ensure the security of the account switching (migration) process. At the same time, the smart switching contract has an asset locking mechanism to prevent the risk of double use or repeated payment of the assets of the source account during the switching period, thereby improving the asset security of the source account.

[0083] B12, generating an account switching request based on the user's trigger, wherein the account switching request carries a source account address signed using a classical encryption signature algorithm, a target account address signed using a quantum-resistant encryption signature algorithm, and asset data to be switched;

[0084] In this embodiment, after upgrading the quantum-resistant encryption signature algorithm, in order to improve the security of data communication, the user can migrate his account based on the classical encryption signature algorithm to an account based on the quantum-resistant encryption signature algorithm, and thus send an account switching request (transaction) to the smart switching contract to register the account switching. As an optional embodiment, the content of the account switching request includes: the source account address (signed using the classical encryption signature algorithm), the target account address (signed using the quantum-resistant encryption signature algorithm), and the asset data to be switched. The source account address and the target account address are both addresses for the user, and the asset data includes but is not limited to: asset volume data and data resources.

[0085] B13, based on the private key of the second-stage classical encryption and quantum-resistant encryption signature algorithm, sign the request content in the account switching request to obtain the signature request data, carry it in the account switching request, and send it to the smart switching contract;

[0086] In this embodiment, during the account switching process, to ensure security, the account switching request is signed through a double signature mechanism.

[0087] B14, the smart switching contract verifies the signature of the received account switching request, and after the signature verification is passed, switches the asset data to be switched in the source account address to the target account address.

[0088] In this embodiment, the smart switching contract performs multiple verifications on the legitimacy of the account switching request, including but not limited to: verifying the association and legitimacy between the source account address and the target account address; confirming the user's control over the source account through a double signature mechanism to ensure that the user has authorization for the switching operation; checking the status of the target account to ensure that it can normally receive the assets and data resources transferred from the source account.

[0089] In this embodiment, after passing the verification, the smart switching contract performs the actual account switching operation. As an optional embodiment, the asset data to be switched in the source account address is switched to the target account address, including:

[0090] Setting a mutex lock for the source account corresponding to the source account address;

[0091] Switch the asset data to be switched of the source account to the target account corresponding to the target account address;

[0092] The mutex lock of the source account is cleared, and the source account is frozen.

[0093] In this embodiment, during the account switching process, the smart switching contract temporarily freezes or locks the assets and transactions of the source account to prevent double payment and ensure asset security; then, the assets and data are transferred: the smart switching contract securely transfers the assets and related data resources in the source account to the target quantum-resistant encryption algorithm account (target account).

[0094] In this embodiment, after the source account is switched to the target account, in order to achieve source tracing and information query of the source account, as an optional embodiment, the method further includes:

[0095] A mapping relationship between the database corresponding to the source account and the target account is constructed.

[0096] In this embodiment, in order to ensure the compatibility of the system after switching, an account mapping mechanism is set after the transaction is successfully processed, and the smart switching contract establishes a mapping relationship between the source account (classical encryption signature algorithm) and the target account (quantum-resistant encryption signature algorithm).

[0097] In this embodiment, by constructing a mapping mechanism, in subsequent applications, the transaction request of the classic encryption signature algorithm account can be automatically redirected to the quantum-resistant encryption signature algorithm account corresponding to the classic encryption signature algorithm account by using the mapping mechanism, thereby ensuring that the user can still receive transactions seamlessly after switching.

[0098] In this embodiment, as another optional embodiment, after the account switch is successful, the classic account address (source account address) corresponding to the classic encryption signature algorithm account continues to be retained for historical transaction query and audit, but is no longer supported for new transaction input.

[0099] In this embodiment, after the account switch is completed, the smart switch contract also performs security verification to ensure that the target account can successfully receive all assets and data. After the verification is passed, the smart switch contract releases the frozen state of the source account, and the asset holding function of the source account will be permanently locked to ensure that the source account cannot perform new transaction operations. The historical transaction records of the source account are still available for query to maintain system transparency and traceability. In this way, for the account address associated with the public-private key pair, the source account address based on the classical encryption signature algorithm is switched to the target account address of the quantum-resistant encryption signature algorithm through the account address switching mechanism.

[0100] Figure 2 Schematic diagram of upgrading the encryption signature algorithm of the access node and the client provided by the embodiment of the present invention. Figure 2As shown, in this embodiment, the encryption signature algorithm of the blockchain system mainly includes the following four stages: the first stage (V1) that only supports the classical encryption signature algorithm (referred to as the classical signature algorithm), the second stage (V2) is the classical encryption and quantum-resistant encryption signature algorithm that supports the classical encryption signature algorithm, the classical encryption signature algorithm and the quantum-resistant encryption signature algorithm (referred to as the classical + quantum-resistant signature algorithm) dual signature mechanism, the third stage (V3) is the classical encryption and quantum-resistant encryption signature algorithm that supports the quantum-resistant encryption signature algorithm (referred to as the quantum-resistant signature algorithm), the classical encryption signature algorithm and the quantum-resistant encryption signature algorithm dual signature mechanism, and the fourth stage (V4) is the support for the quantum-resistant encryption signature algorithm.

[0101] In this embodiment, in the first stage (V1), neither the client nor the access node (node) has upgraded the encryption algorithm, and the classic encryption signature algorithm is used for communication. In the second stage (V2), after the access node is upgraded to the quantum-resistant encryption signature algorithm, the client may not be fully upgraded synchronously, for example, only the quantum-resistant encryption signature algorithm can be implemented. At this time, the access node can be compatible with the client's classical encryption signature algorithm, as well as the dual signature of the classical encryption and quantum-resistant encryption signature algorithms. That is, in this stage, the access node supports two signature mechanisms: transaction signature and verification of only the classical encryption signature algorithm (classical encryption algorithm), and transaction signature and verification of the dual signature mechanism of the classical encryption signature algorithm and the quantum-resistant encryption signature algorithm.

[0102] In the third phase (V3), after the access node is upgraded to the quantum-resistant encryption signature algorithm, the client can implement the quantum-resistant encryption signature algorithm, but account migration is not implemented, and it is compatible with the second and third phases of the client. This phase supports the quantum-resistant encryption signature algorithm, as well as the transaction signature and verification of the dual-signature mechanism of the classic encryption signature algorithm and the quantum-resistant encryption signature algorithm.

[0103] In the fourth phase (V4), when the access node is upgraded to the quantum-resistant encryption signature algorithm, the client does not need to be upgraded.

[0104] In this embodiment, after the access node is upgraded to the second stage V2, the client may not be fully upgraded synchronously, and the access node is compatible with the first stage V1 and the second stage V2 of the client. In this stage, the access node supports two signature mechanisms: transaction signature and verification of the classical encryption signature algorithm only, and transaction signature and verification of the dual signature mechanism of the classical encryption signature algorithm and the quantum-resistant encryption signature algorithm.

[0105] In this embodiment, as an optional embodiment, the pseudo code of the signature algorithm of the double signature mechanism of the access node in the second phase V2 is as follows:

[0106]

[0107] In this embodiment, as an optional embodiment, the structure of the signature data includes the following fields:

[0108] {

[0109] Blob: Blockchain-based transaction processing,

[0110] csk: Transaction processing based on blockchain

[0111] }

[0112] blob is the transaction content, csk is the private key of the classic encryption signature algorithm. The upgraded transaction structure adds a field:

[0113] {

[0114] qsk: Blockchain-based transaction processing

[0115] }

[0116] qsk is the private key of the quantum-resistant encryption signature algorithm. For clients that have not been upgraded, the qsk field is empty.

[0117] In this embodiment, after the access node is upgraded to the third stage V3, the access node is compatible with the second stage V2 and the third stage V3 of the client. In this stage, the access node supports transaction signing and verification of only quantum-resistant encryption signature algorithms, as well as transaction signing and verification of dual-signature mechanisms of classical and quantum-resistant encryption signature algorithms. When the access node is upgraded to the fourth stage V4, the client does not need to be upgraded.

[0118] In this embodiment, as an optional embodiment, the pseudo code of the signature algorithm of the access node in the third phase V3 double signature mechanism is as follows:

[0119]

[0120] The signature data structure includes blob, csk and qsk. When the client is upgraded to the fourth phase V4, the csk field is empty.

[0121] In this embodiment, after the transaction request is made, the access node needs to verify the signature of the transaction request. Therefore, as an optional embodiment, the type of the signature algorithm private key is the first-stage classical encryption and quantum-resistant encryption signature algorithm private key to process the transaction request, including:

[0122] C11, the access node parses the received transaction request to obtain the signature data, the public key of the classical encryption signature algorithm, the public key of the quantum-resistant encryption signature algorithm and the transaction content;

[0123] C12, performing a hash operation on the transaction content to obtain a fourth hash value;

[0124] C13, extracting the quantum-resistant first signature and the classical first signature data from the signature data;

[0125] C14, concatenating the first quantum-resistant signature and the fourth hash value to obtain third concatenated data, and running the third concatenated data using a hash algorithm to obtain a fifth hash value;

[0126] C15, verifying the first quantum-resistant signature using the public key of the quantum-resistant encryption signature algorithm and the fourth hash value;

[0127] C16, using the public key of the classic encryption signature algorithm and the fifth hash value, verifying the classic first signature data;

[0128] C17, determining that both the verification of the quantum-resistant first signature and the verification of the classical first signature data are passed, and processing is performed according to the transaction content.

[0129] In this embodiment, the hash value of the transaction content (blob) is calculated to obtain the fourth hash value (blob'). If the transaction request does not contain the quantum-resistant encryption signature algorithm public key (qpk) field, the signature verification is performed using the classical encryption signature algorithm public key (cpk), the fourth hash value (blob') and the signature data (sign).

[0130] If the transaction request contains the quantum-resistant encryption signature algorithm public key (qpk) field, the signature data (sign) is split into the classical first signature data and the quantum-resistant first signature. In this embodiment, the quantum-resistant first signature (qsign) and the classical first signature data (csign) can be extracted from the signature data based on the fact that the length of the classical signature data is fixed. Then, the quantum-resistant first signature is verified using the quantum-resistant encryption signature algorithm public key and the fourth hash value; that is, the signature is verified using the quantum-resistant encryption signature algorithm public key (qpk), the quantum-resistant first signature (qsign) and the fourth hash value (blob'). If the verification is successful, the subsequent process continues; otherwise, the transaction signature verification fails and the process is exited. Then, after the quantum-resistant first signature (qsign) is attached to the fourth hash value (blob'), the hash value is calculated again, and the result is updated to the fourth hash value (blob') to obtain the fifth hash value. The signature is then verified using the classical encryption signature algorithm public key, the fifth hash value, and the classical first signature data.

[0131] In this embodiment, if the transaction request does not contain the quantum-resistant encryption signature algorithm public key (qpk) field, that is, if the quantum-resistant encryption signature algorithm public key (qpk) is empty, the hash value (blob') is the hash value of the original transaction content, and the signature data (sign) is its signature data; if the quantum-resistant encryption signature algorithm public key (qpk) is not empty, the last updated hash value (blob') combines the hash value of the original transaction content and the result after the quantum-resistant signature, and the signature data (sign) is its signature data. If the verification of both is successful, the transaction verification is successful; otherwise, the transaction verification fails.

[0132] In this embodiment, as an optional embodiment, the pseudo code of the access node's V2 double signature mechanism verification algorithm in the second phase is as follows:

[0133]

[0134] In the blockchain system, transactions are the basic unit of operation. A typical transaction structure includes the following data:

[0135] {

[0136] blob: blockchain-based transaction processing,

[0137] signature: Transaction processing based on blockchain

[0138] cpk : Blockchain-based transaction processing

[0139] }

[0140] blob is the transaction content, signature is the transaction signature, and cpk is the public key of the classic encryption signature algorithm. The upgraded transaction structure includes an additional field:

[0141] {

[0142] qpk: Blockchain-based transaction processing

[0143] }

[0144] qpk is the public key of the quantum-resistant encryption signature algorithm. For clients that have not been upgraded, qpk is empty.

[0145] In this embodiment, similar to the access node in the second phase V2, the pseudo code of the double signature mechanism verification algorithm of the access node in the third phase V3 is as follows:

[0146]

[0147] The transaction structure includes blob, signature, cpk and qpk. For clients upgraded to the fourth phase V4, cpk is empty.

[0148] In this embodiment, for the signature algorithm private key type of the second-stage classical encryption and quantum-resistant encryption signature algorithm private key, the transaction request is processed similarly to the signature algorithm private key type of the first-stage classical encryption and quantum-resistant encryption signature algorithm private key. For example, by calculating the hash value of the transaction content (blob), the sixth hash value (blob') is obtained. If the transaction request does not contain the public key (cpk) field of the classical encryption signature algorithm, the quantum-resistant encryption signature algorithm public key (qpk), signature data (sign) and the sixth hash value (blob') are used for signature verification. Among them, the sixth hash value (blob') is the hash value of the original transaction content, and the signature data (sign) is its quantum-resistant signature data. If the verification passes, the transaction verification is successful; otherwise, the transaction verification fails.

[0149] If the transaction request contains the public key (cpk) field of the classical encryption signature algorithm, split the signature data (sign) corresponding to the transaction request into a classical signature and an anti-quantum signature, where the length of the classical signature is fixed. Extract the anti-quantum first signature (qsign) and the classical first signature data (csign). Use the anti-quantum encryption signature algorithm public key and the sixth hash value to verify the anti-quantum first signature. After appending the anti-quantum first signature (qsign) to the sixth hash value (blob'), calculate the hash value again to obtain the seventh hash value (blob''). Use the classical encryption signature algorithm public key (cpk), the seventh hash value (blob'') and the classical first signature data (csign) for signature verification. If the verification passes, the transaction verification is successful; otherwise, the transaction signature verification fails and the process exits.

[0150] In this embodiment, the switching process is greatly simplified through the dual signature mechanism and smooth node upgrade. The dual signature mechanism allows the blockchain system to support both the classical encryption algorithm and the quantum-resistant encryption algorithm, thereby reducing interference during the switching process, gradually realizing quantum-resistant switching, reducing complexity and risk, and improving the security of communication. In this way, through the dual signature mechanism and the progressive update method, the smooth transition and compatibility of the classical encryption algorithm and the quantum-resistant encryption algorithm are ensured, and the interoperability of the delayed updated client and node during the switching process is guaranteed. The user operation is simple, the system is flexible, and it is easy to upgrade and maintain. Further, a dual signature verification mechanism is set: in order to smoothly transition to the quantum-resistant encryption signature algorithm and ensure the security of the transaction, a dual signature mechanism is introduced. This mechanism allows the blockchain system to support both the classical encryption signature algorithm and the quantum-resistant encryption signature algorithm during the upgrade process, ensuring the compatibility and security of the blockchain system. Moreover, the version compatibility of nodes and clients can be achieved: through upgrades at different stages, the compatibility between nodes and clients is ensured. Even if the client is not fully upgraded synchronously, the node can handle transaction signatures and verifications of different versions. At the same time, based on the integration of quantum-resistant encryption signature algorithms: with the upgrade of node versions, the blockchain system gradually integrates and eventually transitions to quantum-resistant encryption signature algorithms to cope with the security threats brought about by the development of quantum computing technology. Moreover, using the account switching mechanism: the account is switched from classical encryption algorithms to quantum-resistant encryption algorithms through smart switching contracts, ensuring the security of user assets and data, and providing compatibility between classical encryption algorithms and quantum-resistant encryption algorithms. In addition, by deploying smart switching contracts: using smart switching contracts to handle the account switching process, including asset locking, identity authentication, asset and data transfer, etc., the security and automation level of the process are improved.

[0151] Based on the same inventive concept, Figure 3 As shown, the embodiment of the present invention also provides a transaction processing device based on blockchain, the device comprising:

[0152] A first hash operation module 301, configured to perform a hash operation on the transaction content in the transaction request to be initiated to obtain a first hash value;

[0153] The quantum signature module 302 is used to query the pre-stored signature algorithm private key repository, and if it is determined that the type of the stored signature algorithm private key is the first-stage classical encryption and quantum-resistant encryption signature algorithm private key, use the stored quantum-resistant encryption signature algorithm private key to sign the first hash value to obtain a quantum-resistant first signature;

[0154] A second hash operation module 303 is used to concatenate the first hash value and the quantum-resistant first signature to obtain first concatenated data, and to run the first concatenated data using a hash algorithm to obtain a second hash value;

[0155] A classic signature module 304 is used to sign the second hash value using a stored private key of a classic encryption signature algorithm to obtain classic first signature data;

[0156] A signature fusion module 305 is used to fuse the quantum-resistant first signature and the classical first signature data to obtain signature data;

[0157] The request sending module 306 is used to carry the signature data, the classic encryption signature algorithm public key corresponding to the classic encryption signature algorithm private key, the quantum-resistant encryption signature algorithm public key corresponding to the quantum-resistant encryption signature algorithm private key, and the transaction content in the transaction request, and send it to the access node on the blockchain to process the transaction request.

[0158] In this embodiment, as an optional embodiment, the quantum signature module 302 is further used to, if it is determined that the type of the stored signature algorithm private key is a classical encryption signature algorithm private key, use the classical encryption signature algorithm private key to sign the first hash value, obtain the signature data, and send it to the request sending module 306, so that the transaction request carries the signature data, the classical encryption signature algorithm public key corresponding to the classical encryption signature algorithm private key, and the transaction content.

[0159] In this embodiment, as another optional embodiment, the quantum signature module 302 is further used to, if it is determined that the type of the stored signature algorithm private key is a quantum-resistant encryption signature algorithm private key, use the stored quantum-resistant encryption signature algorithm private key to sign the first hash value, obtain the signature data, and send it to the request sending module 306, so that the transaction request carries the signature data, the quantum-resistant encryption signature algorithm public key corresponding to the quantum-resistant encryption signature algorithm private key, and the transaction content.

[0160] In this embodiment, as another optional embodiment, the quantum signature module 302 is further used to, if it is determined that the type of the stored signature algorithm private key is the second-stage classical encryption and quantum-resistant encryption signature algorithm private key, use the stored classical encryption signature algorithm private key to sign the first hash value to obtain the classical second signature data, and send it to the second hash operation module 303;

[0161] The second hash operation module 303 is further used to concatenate the first hash value and the quantum-resistant second signature to obtain second concatenated data, and to run the second concatenated data using a hash algorithm to obtain a third hash value;

[0162] The classical signature module 304 is further used to sign the third hash value using the stored quantum-resistant encryption signature algorithm private key to obtain a quantum-resistant second signature;

[0163] The signature fusion module 305 is also used to fuse the quantum-resistant second signature and the classical second signature data to obtain the signature data;

[0164] The request sending module 306 is also used to carry the signature data, the quantum-resistant encryption signature algorithm public key corresponding to the quantum-resistant encryption signature algorithm private key, and the transaction content in the transaction request.

[0165] In this embodiment, as another optional embodiment, it also includes:

[0166] A node parsing module (not shown in the figure) is used to trigger the access node to parse the received transaction request and obtain the signature data, the public key of the classical encryption signature algorithm, the public key of the quantum-resistant encryption signature algorithm and the transaction content;

[0167] Performing a hash operation on the transaction content to obtain a fourth hash value;

[0168] Extracting the quantum-resistant first signature and the classical first signature data from the signature data;

[0169] splicing the quantum-resistant first signature and the fourth Hash value to obtain third spliced ​​data, and running the third spliced ​​data using a Hash algorithm to obtain a fifth Hash value;

[0170] Verifying the quantum-resistant first signature by using the quantum-resistant encryption signature algorithm public key and the fourth hash value;

[0171] Using the classic encryption signature algorithm public key and the fifth hash value, verifying the classic first signature data;

[0172] Determine that both the verification of the quantum-resistant first signature and the verification of the classical first signature data pass, and process according to the transaction content.

[0173] In this embodiment, as an optional embodiment, the device further includes:

[0174] An account switching module (not shown in the figure) is used to deploy a smart switching contract on the access node of the blockchain system;

[0175] Generate an account switching request based on the user's trigger, which carries the source account address signed by the classical encryption signature algorithm, the target account address signed by the quantum-resistant encryption signature algorithm, and the asset data to be switched;

[0176] Based on the private key of the second-stage classical encryption and quantum-resistant encryption signature algorithm, the request content in the account switching request is signed to obtain the signature request data, which is carried in the account switching request and sent to the smart switching contract;

[0177] The smart switching contract verifies the signature of the received account switching request, and after the signature verification is passed, switches the asset data to be switched in the source account address to the target account address.

[0178] In this embodiment, as another optional embodiment, the device further includes:

[0179] A mapping relationship building module is used to build a mapping relationship between the database corresponding to the source account and the target account.

[0180] Based on the same inventive concept, an embodiment of the present invention further provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the blockchain-based transaction processing method in any possible implementation manner described above are implemented.

[0181] Alternatively, the storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0182] Based on the same inventive concept, see Figure 4 , the embodiment of the present invention also provides an electronic device, including a memory 101 (such as a non-volatile memory), a processor 102, and a computer program stored in the memory 101 and executable on the processor 102. When the processor 102 executes the program, the steps of the transaction processing method based on blockchain in any possible implementation method described above can be equivalent to the transaction processing device based on blockchain as described above. Of course, the processor can also be used to process other data or operations. The electronic device can be a PC, a server, a terminal, and other devices.

[0183] like Figure 4 As shown, the electronic device may also generally include: a memory 103, a network interface 104, and an internal bus 105. In addition to these components, other hardware may also be included, which will not be described in detail.

[0184] It should be pointed out that the above-mentioned blockchain-based transaction processing device can be implemented through software. As a device in a logical sense, it is formed by the processor 102 of the electronic device in which it is located reading the computer program instructions stored in the non-volatile memory into the memory 103 for execution.

[0185] The embodiments of the subject matter and functional operations described in this specification may be implemented in the following: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. The embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules in computer program instructions encoded on a tangible non-temporary program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by a data processing device. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.

[0186] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuits, such as FPGAs (field programmable gate arrays) or ASICs (application-specific integrated circuits), and the apparatus can also be implemented as special purpose logic circuits.

[0187] Computers suitable for executing computer programs include, for example, general and / or special microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more large-capacity storage devices for storing data, such as a disk, a magneto-optical disk, or an optical disk, or the computer will be operably coupled to this large-capacity storage device to receive data from it or to transmit data to it, or both. However, a computer does not necessarily have such a device. In addition, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.

[0188] Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, for example, semiconductor memory devices (e.g., EPROM, EEPROM and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. The processor and memory may be supplemented by, or incorporated in, special purpose logic circuitry.

[0189] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of the specific embodiments of specific inventions. Certain features described in multiple embodiments in this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although the features may work as above in certain combinations and even initially claim protection, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of a sub-combination.

[0190] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or requiring that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.

[0191] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.

[0192] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0193] The above is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features applied herein.

Claims

1. A transaction processing method based on blockchain, characterized in that: include: Performing a hash operation on the transaction content in the transaction request to be initiated to obtain a first hash value; Querying a pre-stored signature algorithm private key repository, if it is determined that the type of the stored signature algorithm private key is the first-stage classical encryption and quantum-resistant encryption signature algorithm private key, use the stored quantum-resistant encryption signature algorithm private key to sign the first hash value to obtain a quantum-resistant first signature; splicing the first Hash value and the first quantum-resistant signature to obtain first spliced ​​data, and running the first spliced ​​data using a Hash algorithm to obtain a second Hash value; Sign the second hash value using the stored private key of the classic encryption signature algorithm to obtain classic first signature data; Fusion of the quantum-resistant first signature and the classical first signature data to obtain signature data; The signature data, the classic encryption signature algorithm public key corresponding to the classic encryption signature algorithm private key, the quantum-resistant encryption signature algorithm public key corresponding to the quantum-resistant encryption signature algorithm private key, and the transaction content are carried in the transaction request and sent to the access node on the blockchain to process the transaction request.

2. The transaction processing method based on blockchain according to claim 1, characterized in that: The method further comprises: If it is determined that the type of the stored signature algorithm private key is a classic encryption signature algorithm private key, use the classic encryption signature algorithm private key to sign the first hash value to obtain the signature data; The transaction request carries the signature data, the public key of the classic encryption signature algorithm corresponding to the private key of the classic encryption signature algorithm, and the transaction content.

3. The transaction processing method based on blockchain according to claim 1, characterized in that: The method further comprises: If it is determined that the type of the stored signature algorithm private key is a quantum-resistant encryption signature algorithm private key, the first hash value is signed using the stored quantum-resistant encryption signature algorithm private key to obtain the signature data; The transaction request carries the signature data, the public key of the quantum-resistant encryption signature algorithm corresponding to the private key of the quantum-resistant encryption signature algorithm, and the transaction content.

4. The transaction processing method based on blockchain according to claim 1, characterized in that: If it is determined that the type of the stored signature algorithm private key is the second-stage classical encryption and quantum-resistant encryption signature algorithm private key, the first hash value is signed using the stored classical encryption signature algorithm private key to obtain classical second signature data; splicing the first hash value and the quantum-resistant second signature to obtain second spliced ​​data, and running the second spliced ​​data using a hash algorithm to obtain a third hash value; Signing the third hash value using the stored quantum-resistant encryption signature algorithm private key to obtain a quantum-resistant second signature; The quantum-resistant second signature and the classical second signature data are merged to obtain the signature data.

5. The transaction processing method based on blockchain according to claim 4 is characterized in that: The method further comprises: Deploy smart switching contracts on the access nodes of the blockchain system; Generate an account switching request based on the user's trigger, which carries the source account address signed by the classical encryption signature algorithm, the target account address signed by the quantum-resistant encryption signature algorithm, and the asset data to be switched; Based on the private key of the second-stage classical encryption and quantum-resistant encryption signature algorithm, the request content in the account switching request is signed to obtain the signature request data, which is carried in the account switching request and sent to the smart switching contract; The smart switching contract verifies the signature of the received account switching request, and after the signature verification is passed, switches the asset data to be switched in the source account address to the target account address.

6. The transaction processing method based on blockchain according to claim 5, characterized in that: The method further comprises: A mapping relationship between the database corresponding to the source account and the target account is constructed.

7. The transaction processing method based on blockchain according to claim 1, characterized in that: The processing of the transaction request includes: The access node parses the received transaction request to obtain the signature data, the public key of the classical encryption signature algorithm, the public key of the quantum-resistant encryption signature algorithm, and the transaction content; Performing a hash operation on the transaction content to obtain a fourth hash value; Extracting the quantum-resistant first signature and the classical first signature data from the signature data; splicing the first quantum-resistant signature and the fourth Hash value to obtain third spliced ​​data, and running the third spliced ​​data using a Hash algorithm to obtain a fifth Hash value; Using the quantum-resistant encryption signature algorithm public key and the fourth hash value, verifying the quantum-resistant first signature; Using the classic encryption signature algorithm public key and the fifth hash value, verifying the classic first signature data; Determine that both the verification of the quantum-resistant first signature and the verification of the classical first signature data pass, and process according to the transaction content.

8. A transaction processing device based on blockchain, characterized in that: The transaction processing device based on blockchain includes: A first hash operation module, used for performing a hash operation on the transaction content in the transaction request to be initiated to obtain a first hash value; A quantum signature module is used to query a pre-stored signature algorithm private key repository, and if it is determined that the type of the stored signature algorithm private key is the first-stage classical encryption and quantum-resistant encryption signature algorithm private key, use the stored quantum-resistant encryption signature algorithm private key to sign the first hash value to obtain a quantum-resistant first signature; A second hash operation module is used to concatenate the first hash value and the quantum-resistant first signature to obtain first concatenated data, and to run the first concatenated data using a hash algorithm to obtain a second hash value; A classic signature module, used to sign the second hash value using a stored private key of a classic encryption signature algorithm to obtain classic first signature data; A signature fusion module, used to fuse the quantum-resistant first signature and the classical first signature data to obtain signature data; A request sending module is used to carry the signature data, the classic encryption signature algorithm public key corresponding to the classic encryption signature algorithm private key, the quantum-resistant encryption signature algorithm public key corresponding to the quantum-resistant encryption signature algorithm private key, and the transaction content in the transaction request, and send it to an access node on the blockchain to process the transaction request.

9. A storage medium, characterized in that: The storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of the blockchain-based transaction processing method as described in any one of claims 1 to 7 are implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the blockchain-based transaction processing method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Identity-based anti-quantum computing block chain method and system

    CN110557247A

  • Block chain digital signature encryption method and system for resisting quantum computing attack

    CN112003707A