Blockchain public key storage optimization method based on post-quantum signature
By introducing the UTXO_PUBKEY structure and public key management process into the blockchain transaction structure, the redundancy problem of public key storage in lattice-based post-quantum signature algorithms is solved, achieving efficient optimization of public key storage and improving the application efficiency of the blockchain system.
Patent Information
- Application Number
- CN202510837987.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-06-23
AI Technical Summary
Lattice-based post-quantum digital signature algorithms in blockchain systems require excessive public key and signature storage space and lack key derivation capabilities, leading to redundant public key storage during frequent transactions and impacting efficiency.
The UTXO_PUBKEY structure is introduced into the blockchain transaction structure. The public key is located by the transaction hash value and index. The public key is stored for the first transaction, and subsequent transactions only store the hash value for verification. The public key storage is optimized, and the public key registration, referencing and destruction process is designed to reduce redundant storage.
It significantly optimizes the storage space efficiency of public keys in post-quantum signature blockchains, improves application efficiency, and is particularly suitable for lattice-based post-quantum signature algorithms, reducing the duplicate storage of the same public key.
Smart Images

Figure CN120358026B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of post-quantum cryptography and information security technology, and particularly relates to a blockchain public key storage optimization method based on a post-quantum signature. BACKGROUND
[0002] With the continuous development of quantum computing technology, post-quantum cryptographic schemes that can resist quantum attacks have emerged. For a blockchain system based on a digital signature algorithm, it is necessary to upgrade to a post-quantum digital signature algorithm. It has been proved that a lattice-based post-quantum digital signature algorithm can resist quantum attacks, and the use of the lattice-based post-quantum digital signature algorithm in the blockchain system is also being researched. However, compared with the elliptic curve digital signature algorithm, the public key and the signature storage space of this algorithm are significantly increased. Therefore, it is necessary to optimize the space in actual use.
[0003] In the optimization process, it can be found that for a blockchain system using an elliptic curve digital signature algorithm, a pair of public and private keys can derive multiple child public and private key pairs. However, the lattice-based digital signature algorithm currently does not have a key derivation function, so the public and private key pairs will be called multiple times each time a transaction is performed on the chain.
[0004] The application selects a blockchain system based on the UTXO (Unspent Transaction Output) accounting model for design optimization. This type of blockchain uses UTXO to represent the unused output in a transaction during a transaction. Each UTXO contains certain information. Each transaction consumes the old UTXO of the transaction initiator and generates a new UTXO for the transaction recipient.
[0005] In a transaction, the correctness and security of the UTXO are achieved through the storage and verification of information in some specific format scripts. The most common ones are P2PK, P2PKH and P2SH scripts, among which the P2PK (Pay to Public Key) script is the most classic. In this script, the transaction initiator's signature is stored in the input script, and the transaction recipient's public key is stored in the output script. The signature of the transaction initiator is verified with the public key of the UTXO it owns, and the verification success indicates that the original UTXO will be consumed, and the public key in the output script also indicates the ownership of the newly generated UTXO.
[0006] According to the above process and characteristics, it can also be seen that in the output script, the signature is different each time due to the difference in information, but the public key stored in the output script is repeatedly used by users who frequently use the same account. Therefore, a method can be designed to avoid repeated storage of the public key in the script. SUMMARY
[0007] In view of this, the application provides a blockchain public key storage optimization method based on post-quantum signature. According to the frequent application characteristics of the blockchain public key of the post-quantum signature, a transaction structure for storing the public key is designed in the block, and a transaction is generated for storing the specific content of the public key when the public key appears for the first time. When the public key is applied again in the blockchain, only the transaction hash needs to be stored for calling the public key stored in the transaction to verify the information. The method significantly optimizes the public key space efficiency of the blockchain using post-quantum signature. The specific scheme is as follows:
[0008] In the first aspect, the application discloses a data structure design method of a blockchain transaction, which specifically comprises:
[0009] In the transaction structure, firstly, a UTXO_PUBKEY structure is added, which includes a transaction hash (Tx_hash) and an index (index). The transaction hash is used to point to the transaction for storing the public key, and compared with the transaction hash pointed to in the input script, the UTXO in the UTXO_PUBKEY structure will not be consumed. However, after the original input script is referenced, the UTXO will be consumed and a new UTXO will be generated. The same point is that the UTXO can be determined in the entire blockchain network through the transaction hash and the index. Secondly, in the output script of the transaction, a Type type is added, which is a Transcation type for a regular transaction and a Pubkey type for a transaction for storing a public key. If the transaction is of the Pubeky type, the data of the output script is the specific value of the public key.
[0010] In the second aspect, the application discloses a public key storage method, which specifically comprises:
[0011] The first step is public key registration. When a pair of public and private keys is used for the first time, whether it is to receive a transfer or to receive a block reward, it will be used as a receiver. Therefore, a UTXO of Pubkey type is automatically generated in the output script, the data value stored in the UTXO is written into the public key value, and the UTXO is set to have the lowest priority (to prevent the UTXO from being randomly consumed).
[0012] The second step is public key reference. When the pair of public and private keys is used after registration, the UTXO recording the public key is stored in the UTXO PUBKEY structure of the transaction. During script verification, the stack operation is performed. The signature of the input script is first stacked, and then the output script content calls the transaction hash stored in the UTXO data, and then calls the public key value stored in the transaction hash to stack the public key, and then verifies the correctness of the signature of the input script by using the operator. In this process, the UTXO storing the public key is not consumed. After the verification is completed, the UTXO will continue to remain in the unspent state for subsequent use.
[0013] The third step is public key destruction. When the balance of the address corresponding to the pair of public and private keys is 0, it can be regarded as an inactive state. In the last transaction, the UTXO storing the public key information with the lowest priority is automatically destroyed. However, the public key registration process can be performed again subsequently. BRIEF DESCRIPTION OF DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the present application, the drawings needed in the description of the present application will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0015] Figure 1 A transaction structure schematic diagram provided for an embodiment of the present application;
[0016] Figure 2 A public key reference structure and flowchart schematic diagram provided for an embodiment of the present application;
[0017] Figure 3 A public key registration flowchart provided for an embodiment of the present application;
[0018] Figure 4 A public key destruction flowchart provided for an embodiment of the present application. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0020] As described in the background, this method optimizes public key storage for blockchains using post-quantum signature algorithms. This approach addresses the unique requirements of such blockchains, which often have long public keys and lack key derivation capabilities. Furthermore, the blockchain structure of this method is specifically designed for blockchains based on the UTXO architecture, eliminating redundant storage through specialized structural design.
[0021] Figure 1 As shown in the figure, it is a schematic diagram of a transaction structure. Figure 1 As shown, the block transaction structure consists of five main parts: the transaction hash is the hashed value of all data, which serves as the transaction index and can be used to verify the correctness of the data. The transaction version is used to control system iteration and is not closely related to this method. The public key script is a new data structure that stores the hash and index of the referenced transaction. By referencing the transaction hash, the UTXO data table in the blockchain can be queried to find the transaction. The index can then be used to locate the specific location of the UTXO, and this information can be used to find the required transaction content. The input script mainly stores the post-quantum signature content. The output script mainly consists of three parts: type, script, and data. If the type is Pubeky, the script stores the opcode for signature verification, and the specific value of the public key is stored in the data. If the type is Transaction, the script stores the opcode for signature verification and no content is stored in the data.
[0022] Figure 2 As shown in the figure, it is a schematic diagram of the public key reference structure and process, as shown in Figure 2 As shown, the main process is similar to the traditional verification method described in the background. The process mainly takes place in the data verification stack. First, the digital signature of the input script is pushed into the stack. Next, based on the transaction hash and index data of the public key script, the transaction storing the required public key is searched in the data table. The public key value of the data in the transaction is then written to the stack. Finally, the verification operation is performed based on the verification code of the output script. If the signature verification is successful, the process is successful.
[0023] Figure 3 As shown in the figure, it is a public key registration flow chart, as Figure 3 As shown, the main process needs to determine whether the balance of the public and private key pair is 0 when acting as the transaction recipient. If the balance is 0, it indicates that the public key needs to be registered. At this time, a UTXO of type Pubkey will be automatically generated, in which the public key value is stored. If the balance is not 0, no generation is required, and other UTXOs with higher priority will be consumed.
[0024] Figure 4 As shown in the figure, it is a public key destruction flow chart, such as Figure 4As shown, the main flow needs to judge whether the public and private key pair has a balance of 0 when acting as a transaction initiator, if the balance is 0, it indicates that the public key needs to be destroyed, at this time the UTXO of the Pubkey type will be consumed. If the balance is not 0, other UTXO with higher priority will be consumed.
[0025] In summary, the application makes the public key stored single time according to the use state through the UTXO script architecture characteristics, effectively reduces the redundant storage of the same public key in different block data, the more frequent the use of the public key, the better the optimization effect. The application is suitable for the scene of applying post-quantum signature in blockchain, especially suitable for the application of lattice-based post-quantum signature algorithm, significantly increases the application efficiency and improves the application range.
[0026] Those skilled in the art will appreciate that embodiments of the specification can be provided as methods, systems or computer program products. Therefore, the specification can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the specification can take the form of a computer program product implemented on one or more computer-usable / readable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0027] For another example, the application can be implemented in a blockchain system. The blockchain system can include a memory, a processor and a computer program stored on the memory. The processor can execute the computer program to implement each step of the method described in the Figures 2 to 4 above.
[0028] The above specific embodiments further illustrate the purpose, technical scheme and beneficial effects of the application. It should be understood that the above description is only for specific embodiments of the application and is not used to limit the protection scope of the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application shall be included in the protection scope of the application.
Claims
1. A blockchain public key storage optimization method based on post-quantum signature, the method comprising: (1) defining a block structure: adding an unspent transaction output (UTXO)_public key (PUBKEY) structure in a transaction data structure, the UTXO_PUBKEY structure being used to point to a transaction hash recording a stored public key, wherein the UTXO_PUBKEY structure comprises a transaction hash value (Tx_hash) and an index (index), the transaction hash value being used to point to a transaction recording a stored public key, after the UTXO_PUBKEY structure is referenced, the corresponding UTXO will not be consumed, and the unique position of the UTXO in the entire blockchain network is determined by the index (index) and the transaction hash value (Tx_hash) of the UTXO; wherein a type (Type) field is added in the output script, so that the output script contains three parts of type (Type), script, and data, wherein if the type in the output script is a public key (Pubkey), the script in the output script stores an operation code for verifying a signature, and the specific value of the public key is stored in the data in the output script; if the type in the output script is a transaction (Transaction), the script in the output script stores an operation code for verifying a signature, and no content is stored in the data in the output script; (2) public key registration: when a pair of public and private keys is used for the first time, an UTXO with a type of Pubkey is automatically generated in the output script, the information stored in the UTXO is a public key value, and the priority of the UTXO is set to the lowest; (3) public key reference: when the public and private keys are repeatedly used, the UTXO recording the public key is pointed to in the UTXO_PUBKEY structure; during script verification, the content of the output script calls the data content of the UTXO during construction, and the signature content of the input script is verified according to the operator, and in this process, the UTXO will not be consumed; (4) public key destruction: when the balance of a certain pair of public and private key addresses is 0, the UTXO of the public key is consumed in the last transaction that becomes 0, and subsequent public key registration can be performed again. 2.A blockchain system, comprising a memory, a processor, and a computer program stored on the memory, wherein, The processor executes the computer program to implement the blockchain public key storage optimization method based on post-quantum signature of claim 1.
3. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the blockchain public key storage optimization method based on post-quantum signature of claim 1.
4. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the blockchain public key storage optimization method based on post-quantum signature of claim 1.
Citation Information
Patent Citations
Zero-knowledge proof payments using blockchain
US20200193425A1
Non-native blockchain signatures
WO2023208809A1