Consensus verification method, system, and terminal based on data age and integrity verification
By introducing data age and integrity verification methods into the blockchain consensus protocol, the probability difference between nodes when competing for accounting rights is optimized, and data integrity is verified through computing resource efficiency without bilinear pairing, solving the problem of resource waste and The problem of low verification efficiency is solved and the efficient operation and security of the blockchain system are achieved.
Patent Information
- Application Number
- CN202110758953.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-05
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-07-05
AI Technical Summary
Existing blockchain consensus protocols have resource waste problems and low data integrity verification efficiency, especially the lack of effective solutions under the conditions of public verifiability and the absence of a third-party trusted agency.
A consensus verification method based on data age and integrity verification is adopted. By generating a system parameter set, a public-private key pair and a label set, the integrity proof is verified, and the age concept is used to optimize the probability difference between nodes when competing for accounting rights, and Verify data integrity with computational resource efficiency without bilinear alignment.
It effectively solves the problems of resource waste and low verification efficiency, improves the resource utilization rate and accounting right election efficiency of the blockchain system, reduces the probability of nodes doing evil, and meets the requirements of security and efficiency.
Smart Images

Figure CN113626874B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of blockchain consensus protocols, and in particular to a consensus verification method, system, and terminal based on data age and integrity verification. Background Art
[0002] Currently: Blockchain technology is a new type of distributed ledger technology with the characteristics of decentralization, immutability, anonymity, etc. It is hailed as a new technology that will trigger social change. In the blockchain system, the key to ensuring that each node has the same ledger is how to reach a consensus on the ledger status of each node in a distributed environment. The emergence of consensus protocols solves this problem.
[0003] The consensus protocol is the core of blockchain technology. It maintains the normal operation of the blockchain system and ensures the consistency and validity of the distributed ledger data. Consistency means that the prefix part of the blockchain saved by all honest nodes is exactly the same; while validity means that the information published by an honest node will eventually be recorded by all other honest nodes in their local blockchains. The consensus protocol is the key to the design of blockchain technology, which realizes the effective extension and state consistency of the blockchain. Therefore, how to design a safe and efficient consensus protocol is an important research topic of blockchain.
[0004] Proof of Work (PoW) is the most widely used consensus protocol in the current blockchain system. It reaches consensus by proving the workload, where the workload refers to the successful solution of a hash puzzle, and the proof means that other nodes can easily verify the corresponding work that has been completed. When solving the problem, the transaction content, the hash of the previous block, the current block height and timestamp and the Nonce value are used as the input of the hash function to calculate the hash value. If the calculated hash value is lower than the current difficulty, the block is judged as a valid block, otherwise the Nonce value is continuously adjusted until the calculated hash value is lower than the pre-set difficulty. Although the hash operation is very simple, PoW requires a lot of hash operation proof workload, resulting in serious resource waste.
[0005] In order to alleviate the problem of waste of computing resources, a hybrid consensus of Proof of Work and Proof of Stake (PoS) is used. The rules for determining the right to record the next moment in the PoS consensus are basically the same as those of PoW, that is, when the hash value that meets certain conditions is successfully calculated first, the right to record the account is granted. The difference is that in the PoW protocol, the probability of success in finding a hash value is proportional to its computing power, while in PoS, the success rate of finding a hash value is proportional to its equity. PoS determines the difficulty of finding the hash original image based on the size of its equity. Although the number of hash operations is reduced to a certain extent, the computing resources used are still wasted, and it cannot run independently and needs to be used in conjunction with the PoW consensus. In the early stages of the system operation, each node obtains assets through PoW, and then can reach a consensus through PoS.
[0006] The above consensus is a member election consensus for electing block generators. The difference from the former is the state consensus that ensures data consistency. The Byzantine Fault Tolerance (BFT) state consensus protocol is based on multiple rounds of message transmission between nodes to ensure that non-Byzantine nodes in the system reach a consensus. The total number of nodes in the system should be greater than or equal to nodes, representing the number of Byzantine nodes in the system. The entire consensus process requires almost no computing resources, so there is no waste of computing resources, and it does not need to rely on other consensus protocols and can run independently, but the BFT consensus has the problem of partial centralization. Therefore, under the premise of complete decentralization, it is of great practical value to study how to design a new consensus protocol to improve the operating efficiency of the blockchain system.
[0007] Data integrity verification in outsourced storage and consensus protocols in blockchain systems are two hot research technologies in today's Internet technology. Scholars at home and abroad have conducted a lot of related research.
[0008] (1) Data integrity verification technology
[0009] In the outsourced storage scenario, after the user stores the data in the outsourced server, it is not possible to confirm whether the outsourced server stores the data completely, so how to verify the integrity of the data is a hot topic among scholars. Prior art 1 first proposed the Provable Data Possession (PDP) scheme in 2007. The PDP scheme verifies the integrity of the data through homomorphic verification tags, but cannot recover damaged data. Prior art 2 first combined the PDP scheme with redundant coding technology and proposed the Proof of Retrievability (PoR) scheme. The PDP scheme and the PoR scheme are the two most basic schemes for studying data integrity verification.
[0010] In order to solve the problem of dynamic operation of data, prior art 3 proposed a dynamic verification scheme based on Merkle hash tree, which stores the encrypted file in blocks on the leaf nodes of Merkle hash tree, and realizes the full dynamic operation of the verification scheme at the data block level through the insertion, deletion and modification of leaf nodes. Prior art 4 first proposed a rank-based authentication skip table to support the provable data ownership scheme of dynamic data verification, and for the first time used the idea of combining dynamic authentication data structure with verification algorithm. However, since the skip table is a data structure that exchanges space for time, once large files are stored, the storage overhead of this scheme is too high. In the same year, prior art 5 constructed a dynamic hash table to support dynamic operation of data. Although the dynamic hash table constructed by this scheme is based on a two-dimensional data structure, it is actually an ordered single linked list, and the efficiency of query and update operations is low. Prior art 6 proposed a verification structure based on a bidirectional linked list to support dynamic operation of data, which improves the update efficiency.
[0011] However, the above schemes are all designed based on bilinear pairings, and the verification efficiency is low. In 2018, prior art 8 proposed a bilinear pairing-free integrity verification scheme based on Schnorr signatures, which improved the verification efficiency, but the scheme still requires a third-party trusted agency. In 2020, prior art 9 designed a more efficient bilinear pairing-free scheme based on blockchain and did not require a third-party trusted agency, but the scheme is only suitable for private audits and cannot publicly verify integrity. In the existing data integrity verification without bilinear pairings, there is no solution that meets both public verifiability and does not require a third-party trusted agency, so it is of great significance to study a publicly verifiable data integrity verification scheme based on bilinear pairings.
[0012] (2) Consensus Protocol in Blockchain
[0013] Distributed consensus is a key technology for achieving blockchain decentralization, which stipulates the message passing and local decision-making of each node, ensuring that all participants unify the distributed transaction ledger without the help of a central authority. Various design choices in consensus protocols can greatly affect the performance of blockchain systems, including their transaction capacity, scalability, and fault tolerance. From incremental modifications to the PoW consensus protocol to innovative consensus protocols, many consensus protocols have been proposed to improve the performance of the blockchain network itself or to adapt to other specific application requirements.
[0014] The first consensus protocol used in blockchain was Proof of Work (PoW), the main idea of which is that all nodes in the distributed network compete to solve the problem of calculating hash values to obtain the correct Nonce value, add new blocks to the blockchain and get rewards. In subsequent research, different PoW variants have been proposed. King proposed a new type of PoW that proves the workload by searching for prime numbers in a peer-to-peer network instead of finding solutions to hash puzzles. Proof of Work can indeed reach consensus well, but it has a major disadvantage in terms of resource utilization - wasting computing resources.
[0015] In order to solve the inefficiency of PoW, Proof of Stake (PoS) came into being. In PoS, the coin age owned by the node can be staked as a stake in order to have the opportunity to become a block generator. Because the size of the stake in PoS is inversely proportional to the difficulty of the hash puzzle, PoS alleviates the problem of resource waste to a certain extent. However, PoS cannot operate independently from PoW, and there are problems such as the accumulation of coin age or stake, and there is no mechanism to keep nodes online to keep the network in operation, resulting in the fact that PoS is not widely used.
[0016] In order to solve the problem of resource waste in blockchain consensus and achieve security in outsourced storage, more and more scholars are combining blockchain technology with data integrity verification in outsourced storage.
[0017] Prior art 10 proposed Permacoin, which reuses its computing resources to achieve distributed storage of file data. Permacoin requires not only the client to invest computing resources, but also storage resources, and its participants must store different parts of large data sets locally to ensure a high probability of complete data recovery. However, Permacoin still needs to perform a large number of hash operations before integrity verification, which does not fundamentally solve the problem of wasted computing resources. In 2019, prior art 11 proposed Audita, which verifies the generator of the election block through data integrity. However, the integrity verification method used in the protocol is based on bilinear pairings, so the verification efficiency is relatively low.
[0018] Permacoin and Audita combine storage, data integrity verification and consensus protocols to try to solve the problem of resource waste in consensus protocols. However, these two protocols only partially solve the waste problem and their efficiency is low. Therefore, it is of great practical value to design a consensus protocol combined with integrity verification to achieve resource efficiency optimization.
[0019] Through the above analysis, the problems and defects of the prior art are as follows:
[0020] (1) Most existing blockchain consensus protocols have a large amount of resource waste;
[0021] (2) Most existing data integrity verification schemes use bilinear pairings, resulting in poor verification efficiency.
[0022] The difficulty of solving the above problems and defects is: the consensus protocol combined with data integrity verification not only needs to realize the election of accounting rights in the blockchain system under the premise of ensuring verification efficiency; at the same time, it is necessary to consider increasing the probability difference of nodes when competing for accounting rights; in addition, it is also necessary to ensure the security and efficiency of the protocol.
[0023] The significance of solving the above problems and defects is: realizing a consensus protocol based on data age and integrity verification will help optimize the resource efficiency of the blockchain system, and realize the integrity verification of outsourced data while realizing the election of accounting rights in the system, which is of great significance to the application and development of the blockchain system. Summary of the invention
[0024] In view of the problems existing in the prior art, the present invention provides a consensus verification method, system and terminal based on data age and integrity verification.
[0025] The present invention is implemented as follows: a consensus verification method based on data age and integrity verification, the consensus verification method based on data age and integrity verification comprises:
[0026] The integrity proof is verified by generating a system parameter set, a public-private key pair, a label set, and an integrity proof.
[0027] Furthermore, the consensus verification method based on data age and integrity verification includes the following steps:
[0028] Step 1: Generate a system parameter set based on security parameters; the user node generates a private key for generating tags and a public key for verification. The positive effect of this step is to generate a public-private key pair for the user node, the private key is used to generate tags, and the public key is used for subsequent verification.
[0029] Step 2: The user node generates a set of labels for integrity verification; the storage node generates a challenge set and corresponding integrity proof based on the storage age. The positive effect of this step is that the user generates labels for subsequent integrity verification, and the storage node generates integrity proofs for integrity verification.
[0030] Step 3: The consensus node verifies whether the integrity proof provided by the storage node is valid. The positive role of this step is to verify the integrity of the data.
[0031] Further, generating a system parameter set according to the security parameter includes:
[0032] (1) Obtain the system security parameter λ, select two large prime numbers p and q, where q is a prime factor of p-1; construct a multiplication cyclic group of order q The generator of is g;
[0033] (2) Select a pseudo-random function F(·): {0, 1} * →[1,n] and a secure hash function
[0034] (3) System common parameters are:
[0035] Further, the user node generates a private key for generating a label and a public key for verification, including:
[0036] (1) Based on the system public parameter param, the user node generates its own public and private key pair (skU, pk U ), sk U For label generation, pk U Used for integrity proof verification;
[0037] (2) The node randomly selects a private key And calculate as your public key.
[0038] Further, the user node generates a label set for integrity verification including:
[0039] (1) User nodes randomly select α=(α 1 , α 2 , ..., α s ), β=(β 1 , β 2 , ..., β n ),in, for calculate
[0040] (2) Random selection And calculate:
[0041]
[0042] (3) Get the label set Φ = {σ i} 1≤i≤n .
[0043] Further, the storage node generates a challenge set according to the storage age, including:
[0044] (1) According to the storage age of the storage node, the number of challenge blocks c is obtained;
[0045] (2) Calculate chal j = F(t||j), j∈[1,c] and And calculate
[0046] (3) Get the challenge set Q = {(i, v i )} i∈I .
[0047] Further, the storage node generates the integrity proof including:
[0048] (1) Calculate R and S based on the label of the file block,
[0049]
[0050] (2) Calculate μ based on file blocks l and τ 0 ,
[0051]
[0052] (3) Get the data integrity proof proof = (R, S, τ 0 ).
[0053] Further, the consensus node verifies whether the integrity proof provided by the storage node is valid, including:
[0054] (1) Consensus nodes calculate τ = τ 0 +Σ i∈I v i β i mod q;
[0055] (2) Verify the validity of the integrity proof by verifying whether the following equation holds:
[0056]
[0057] Another object of the present invention is to provide a consensus protocol system for implementing the consensus verification method based on data age and integrity verification, the consensus protocol system comprising: a user node, a storage node, a consensus node and an accounting node;
[0058] Ordinary user nodes, i.e. user nodes that provide files to be stored by other nodes;
[0059] Storage nodes, which provide extra space to help other user nodes store files;
[0060] Consensus nodes, which are nodes that perform integrity verification;
[0061] Accounting nodes, i.e., storage nodes that send integrity proofs and first pass integrity verification.
[0062] Another object of the present invention is to provide a consensus method based on the consensus protocol system, the consensus method comprising:
[0063] The user node performs file preprocessing and uses the user node's private key to generate a data file tag, and stores the file block and tag set in the storage node. The storage node generates a challenge and a corresponding proof based on the timestamp in the latest block in the blockchain, and broadcasts it in the network; the consensus node verifies whether the proof is valid, and the first storage node that passes the verification becomes the accounting node; the accounting node completes the packaging of the transaction and generates a block in the blockchain.
[0064] Another object of the present invention is to provide a blockchain consensus protocol terminal, which is used to execute the consensus verification method based on data age and integrity verification.
[0065] Combining all the above technical solutions, the advantages and positive effects of the present invention are as follows: the present invention utilizes the storage resources of the node for data storage and the computing resources for integrity verification without bilinear pairings, which solves the problem of resource waste in the existing consensus protocol and improves the verification efficiency; the present invention introduces the concept of storage age, which is proposed for the first time in the present invention, increases the probability difference of nodes when competing for accounting rights, reduces the probability of nodes doing evil, and meets the requirements of security and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a flow chart of a consensus verification method based on data age and integrity verification provided by the implementation of the present invention.
[0067] Figure 2 It is a schematic diagram of the consensus protocol system model provided by the implementation of the present invention.
[0068] Figure 3 It is a consensus protocol implementation framework diagram provided by the present invention.
[0069] Figure 4 It is a schematic diagram comparing the time overhead of label generation provided by an example of the present invention.
[0070] Figure 5 It is a schematic diagram comparing the time overhead of proof generation and proof verification provided by an example of the present invention.
[0071] Figure 6 It is a schematic diagram comparing the time overhead of generating proofs provided by an example of the present invention.
[0072] Figure 7 It is a schematic diagram comparing the time overhead of proof verification provided by an example of the present invention. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0074] In view of the problems existing in the prior art, the present invention provides a consensus verification method, system and terminal based on data age and integrity verification. The present invention is described in detail below in conjunction with the accompanying drawings.
[0075] like Figure 1 As shown, the consensus verification method based on data age and integrity verification provided by the embodiment of the present invention includes the following steps:
[0076] S101, generating a system parameter set according to security parameters; the user node generates a private key for generating a label and a public key for verification;
[0077] S102, the user node generates a tag set for integrity verification; the storage node generates a challenge set and a corresponding integrity proof according to the storage age;
[0078] S103, the consensus node verifies whether the integrity proof provided by the storage node is valid.
[0079] The method of generating a system parameter set according to security parameters provided in an embodiment of the present invention includes:
[0080] (1) Obtain the system security parameter λ, select two large prime numbers p and q, where q is a prime factor of p-1; construct a multiplication cyclic group of order q The generator of is g;
[0081] Choose a pseudo-random function F(·): {0, 1} * →[1,n] and a secure hash function
[0082] (2) System common parameters are:
[0083] The method provided by the embodiment of the present invention for generating a private key for generating a label and a public key for verification by a user node includes:
[0084] (1) Based on the system public parameter param, the user node generates its own public and private key pair (sk U , pk U ), skU For label generation, pk U Used for integrity proof verification;
[0085] (2) The node randomly selects a private key And calculate as your public key.
[0086] The user node provided in the embodiment of the present invention generates a label set for integrity verification, including:
[0087] (1) User nodes randomly select α=(α 1 , α 2 , ..., α s ), β=(β 1 , β 2 , ..., β n ),in, for calculate
[0088] (2) Random selection And calculate:
[0089]
[0090] (3) Get the label set Φ = {σ i} 1≤i≤n .
[0091] The storage node provided in the embodiment of the present invention generates a challenge set according to the storage age, including:
[0092] (1) According to the storage age of the storage node, the number of challenge blocks c is obtained;
[0093] (2) Calculate chal j = F(t||j), j∈[1,c] and And calculate
[0094] (3) Get the challenge set Q = {(i, v i )} i∈I .
[0095] The storage node generation integrity proof provided by the embodiment of the present invention includes:
[0096] (1) Calculate R and S based on the label of the file block,
[0097]
[0098] (2) Calculate μ based on file blocks l and τ 0 ,
[0099]
[0100] (3) Get the data integrity proof proof = (R, S, τ 0 ).
[0101] The consensus node provided in the embodiment of the present invention verifies whether the integrity proof provided by the storage node is valid, including:
[0102] (1) Consensus nodes calculate τ = τ 0 +∑ i∈I v i β i mod q;
[0103] (2) Verify the validity of the integrity proof by verifying whether the following equation holds:
[0104]
[0105] The consensus protocol provided by the embodiment of the present invention includes: ordinary user nodes, storage nodes, consensus nodes and accounting nodes;
[0106] Ordinary user nodes, i.e. user nodes that provide files to be stored by other nodes;
[0107] Storage nodes, which provide extra space to help other user nodes store files;
[0108] Consensus nodes, which are nodes that perform integrity verification;
[0109] Accounting nodes, i.e., storage nodes that send integrity proofs and first pass integrity verification.
[0110] The consensus method provided by the embodiment of the present invention includes:
[0111] The user node performs file preprocessing and uses the user node's private key to generate a data file tag, and stores the file block and tag set in the storage node. The storage node generates a challenge and a corresponding proof based on the timestamp in the latest block in the blockchain, and broadcasts it in the network; the consensus node verifies whether the proof is valid, and the first storage node that passes the verification becomes the accounting node; the accounting node completes the packaging of the transaction and generates a block in the blockchain.
[0112] The technical solution of the present invention is further described below in conjunction with specific embodiments.
[0113] Embodiment 1:
[0114] Blockchain is a diversified fusion of cryptography, distributed data storage, peer-to-peer transmission, consensus protocols and other technologies. It has the characteristics of decentralization, immutability, anonymity, autonomy, openness and transparency. It is regarded as another disruptive technology after cloud computing, the Internet of Things and big data, and has received great attention from governments, financial institutions and scholars.
[0115] Consensus protocols are the core of blockchain technology and can ensure the consistency and validity of block data. The most commonly used consensus protocols in blockchain systems are Proof of Work (PoW), Proof of Stake (PoS), and Byzantine Fault Tolerance (BFT). PoW consensus protocols prove the workload by solving difficult problems and compete for the right to record accounts. However, this type of consensus requires a large number of hash operations when solving difficult problems, which wastes computing resources. PoS consensus protocols determine the probability of competing for the right to record accounts by the size of their own equity, thus solving the problem of resource waste to a certain extent. However, it cannot run independently and needs to be used in conjunction with PoW consensus protocols. BFT consensus protocols can better solve the problem of resource waste and can run independently, but there is a problem of partial centralization. Therefore, under the premise of complete decentralization, it is of great practical value to study how to design new consensus protocols to improve the operating efficiency of blockchain systems.
[0116] Aiming at the application demand of effective utilization of resources in blockchain system, the present invention proposes a new consensus protocol based on data storage age and integrity verification (Proof of Storage Age and Integrity Verification, referred to as PoSI), which realizes the election of blockchain system accounting rights while effectively utilizing resources. The present invention uses the storage resources of nodes for data storage and computing resources for integrity verification without bilinear pairings, which optimizes resource efficiency and improves verification efficiency; at the same time, the concept of storage age is introduced, which increases the probability difference of nodes in competing for accounting rights, reduces the probability of nodes doing evil, and meets security and efficiency.
[0117] The present invention is applicable to blockchain scenarios that include storage functions. It can use the storage resources of nodes to store valid data information to meet the storage needs of users; at the same time, it can also meet the data integrity verification needs of users. In addition, compared with the consensus protocol in the existing blockchain, the present invention solves the problem of selecting consensus nodes by using nodes for integrity verification.
[0118] 1. Preliminary knowledge
[0119] 1.1 Bilinear Map
[0120] set up is the multiplicative cyclic group of three prime orders p. The element g 1 , g 2 Respectively represent cyclic groups There exists a generator from arrive A computable homomorphic mapping ψ such that ψ(g 1 ) = g 2 . There is also a computable bilinear map Satisfy the following three characteristics:
[0121] (1) Bilinear: For any Both have e(u a , v b ) = e(u,v) ab Established;
[0122] (2) Non-degenerate: in Represents a multiplicative cyclic group The unit element of
[0123] (3) Computability: For any element There exist polynomial-time algorithms that can efficiently compute e(v,u) and ψ(u).
[0124] The following definition is given in Two difficult problems on the group.
[0125] Definition 1 (Discrete Logarithm Problem): The Discrete Logarithm Problem (DLP) is described as follows: Assume is a multiplicative cyclic group of prime order p, and g is the generator of this cyclic group. Given a pair (g, g x ),in Output x. Define the group The DLP assumption in holds if for any probabilistic polynomial-time adversary
[0126]
[0127] For any security parameter λ, negl(·) is a negligible function.
[0128] Definition 2 (Computational Diffie-Hellman Promblem): The Computational Diffie-Hellman Promblem (CDHP) is described as follows: Assume is a multiplicative cyclic group of prime order p, and g is the generator of this cyclic group. Given a triple (g, g x , g y ),in Output g xy . Defined in group The CDHP assumption on holds if for any probabilistic polynomial-time adversary For any security parameter λ,
[0129]
[0130] holds, where negl(·) is a negligible function.
[0131] 1.2 Boneh-Lynn-Shacham Signature
[0132] Boneh-Lynn-Shacham (BLS) signature is a short signature scheme proposed by Boneh et al. in 2004. The security of BLS signature depends on the difficulty assumption of CDHP. A BLS signature scheme includes the following three algorithms: make and are two multiplicative cyclic groups of order prime p, is a bilinear map, is a full mapping hash function. The specific details of each algorithm are as follows:
[0133] (1) A probabilistic polynomial time algorithm, input system public parameter param, randomly select calculate The output public key is spk=v and the private key is ssk=x.
[0134] (2) A probabilistic polynomial time algorithm, taking as input the message m and the signer's private key ssk, calculates and σ←h x . Output the signature σ of m.
[0135] (3) A deterministic algorithm, input signature σ, message m and public key spk, verifies whether the following equation holds.
[0136]
[0137] If the equation holds, output 1, otherwise output 0.
[0138] 1.3 Proof of Recoverability Protocol
[0139] In 2008, Shacham and Waters proposed a proof of recoverability (PoR) based on bilinear pairings in the protocol. The general process of the protocol is as follows: first, the user generates a public-private key pair, then the user preprocesses the file to be stored, generates a set of file block labels, and sends it to the storage service provider. When the user needs to verify the integrity of the stored file, a random challenge is generated and sent to the storage service provider. The storage service provider generates the corresponding integrity proof based on the challenge and sends the proof to the user. The user verifies whether the proof meets the verification equation (when there is a third-party trusted institution, the generation of challenges and verification are completed by the third party).
[0140] The specific solution generally consists of 6 algorithms. Given a file M = {m ij} 1≤i≤n,1≤j≤s ,protocol The specific details are as follows:
[0141] (1) A probabilistic polynomial-time algorithm for a given security parameter Output system common parameters
[0142] (2) A probabilistic polynomial time algorithm, input system public parameter param, select a random And calculate Output private key sk=α, public key is pk=v.
[0143] (3) A probabilistic polynomial time algorithm, input private key sk and file M, select s elements calculate Output processed file M * =({σ i} 1≤i≤n ,{m ij} 1≤i≤n,1≤j≤s ).
[0144] (4) A probabilistic polynomial-time algorithm takes as input param, randomly selects a subset I of c elements from the set [1, n], and Select a random element Output challenge set Q = {(i, v i )} i∈I .
[0145] (5) A probabilistic polynomial time algorithm, with input file M * and challenge set Q, calculate
[0146]
[0147] Output response μ 1 , ..., μ s and σ.
[0148] (6) A deterministic algorithm, with input response μ 1 , ..., μ s and σ, verify whether the following equation holds,
[0149]
[0150] If the equation holds, output 1, otherwise output 0.
[0151] 2. System Model
[0152] like Figure 2 As shown, a new consensus protocol based on data age and integrity verification provided by the present invention is composed of four entities: ordinary user node (UserNode, referred to as UN), storage node (StorageNode, referred to as SN), consensus node (ConsensusNode, referred to as CN) and accounting node (MintingNode, referred to as MN).
[0153] · Ordinary user node (UN): is a user node that wants files to be stored by other nodes;
[0154] Storage Node (SN): A node with extra space to help other user nodes store files;
[0155] Consensus Node (CN): It is a node that verifies integrity (i.e. verifies whether the proof issued by the storage node is correct). It can be a normal user node or other node, but it must be old enough.
[0156] Accounting Node (MN): It is the storage node that sends the integrity proof and passes the integrity verification first.
[0157] First, UN preprocesses the file and generates a data file tag using its private key. Then, the file blocks and tag collection are stored in SN. At the beginning of each cycle, SN generates a challenge and corresponding proof based on the timestamp in the latest block in the blockchain and broadcasts it to the network. CN verifies whether the proof is valid, and the first SN that passes the verification becomes MN. MN completes the packaging of the transaction and generates a block in the blockchain. After each cycle of this consensus protocol, the storage age is updated. The larger the storage age, the fewer blocks need to be verified in the generated challenge, the faster the proof is generated, and the easier it is to be selected as MN. For an honest SN, the storage age is the key to whether it can become a MN.
[0158] The concept of storage age is introduced in the system for the first time, and the storage age can be defined as follows.
[0159] Definition 3 (Storage Age): The storage age is the quantitative measurement of the time a file or part of a file is stored in a fixed location, expressed in GBday. The size of the storage age depends on the size of the stored file and the storage time.
[0160] For example, if a node stores a 3GB file for 100 days, the storage age of the node is 300GBdays. In the system of the present invention, the storage age of a node can be obtained in three ways.
[0161] (1) Storage nodes can obtain a large amount of storage age by storing files for user nodes and sending proofs in a timely manner.
[0162] (2) Accounting nodes can obtain a small amount of age by packaging transactions and creating new blocks.
[0163] (3) Any node can obtain a certain age by joining the consensus group to participate in integrity verification and verify blocks and fix blocks.
[0164] In the PoSI protocol, the age of a node affects the number of challenge blocks generated during the challenge phase. The relationship between the age of a node and the number of challenge blocks is defined as follows: the older the node is, the fewer challenge blocks it receives, and the easier it is to become a bookkeeping node.
[0165] In a PoSI-based blockchain system, age determines whether a node can enter the consensus group. At the end of each cycle, the top p% with the highest age become members of the consensus group, and the size of p is defined according to the different needs of the system. Since the age of each node changes at the end of each cycle, the members of the consensus group are dynamic and unpredictable, making it impossible for malicious nodes to destroy the system by controlling some fixed nodes. In the consensus group, each vote of each member is calculated based on the weight of its age among all members, so in the consensus group, the older the age, the more decision-making power it has.
[0166] 3. Method Overview
[0167] like Figure 3 As shown, under normal circumstances, the present invention can be used in the accounting node election stage of any blockchain system.
[0168] An overview of this method is as follows: SN uses storage resources to store files and file tags uploaded by UN, and uses computing resources to generate challenges and integrity proofs. CN verifies whether the proof is valid. When f+1 CNs verify that the proof is valid, the SN passes the verification, where f is the maximum number of malicious nodes that the protocol can tolerate. The first SN that passes the verification becomes the new MN, thereby completing the purpose of electing MN. If all SNs generate proofs for the same number of challenge blocks, the calculation time is almost the same, so the storage age is introduced in the protocol. Each SN calculates the number of challenge blocks based on its own storage age. The larger the storage age, the fewer blocks need to be verified in the generated challenge, the faster the proof is generated, and the easier it is to be selected as an MN. For an honest SN, storage age is the key to whether it can become an MN.
[0169] 4. Algorithm Overview
[0170] A new consensus protocol PoSI based on data age and integrity verification consists of 6 algorithms, among which the algorithms Setup and KeyGen constitute step S101, which are used to generate the public and private key pairs of user nodes; the algorithms TagGen, Chal, and Proof constitute step S102, which are used to generate integrity proofs; and the algorithm Verify constitutes step S103, which is used to verify the integrity of data. The description is as follows:
[0171] (1)Setup(1 λ )→(param): This algorithm is a probabilistic algorithm. It takes the security parameter λ as input and outputs param.
[0172] (2)KeyGen(param)→(sk U , pk U ): This algorithm is a probabilistic algorithm. Input param, UN generates a public-private key pair (sk U , pk U ).
[0173] (3)TagGen(M,sk U )→(Φ): This algorithm is a probabilistic algorithm, with input file M and private key sk U , UN generates a label set Φ.
[0174] (4) Chal(param)→Q: This algorithm is a probabilistic algorithm. It inputs the security parameter set param and SN generates the challenge set Q.
[0175] (5) Proof(Q, M, Φ) → proof: This algorithm is a probabilistic algorithm. It inputs the challenge set Q, the file M and the tag set Φ, and SN generates proof of data integrity.
[0176] (6)Verify(proof, Q, pk U )→{0 / 1}: This algorithm is a deterministic algorithm, with input proof, challenge set Q and public key pk U , CN generates verification results.
[0177] 5. Specific structure
[0178] A new consensus protocol based on data age and integrity verification, PoSI, combines integrity verification with consensus to realize the election of bookkeeping rights in the blockchain system. The present invention consists of 6 algorithms. ij} 1≤i≤n,1≤j≤s The specific construction method is described as follows:
[0179] (1)Setup(1 λ )→(param): Input a system security parameter λ and output a system public parameter param.
[0180] 1) Choose two large prime numbers p and q, where q is a prime factor of p-1. is a multiplicative cyclic group of order q, and g is The generator of .
[0181] 2) Choose a pseudo-random function F(·): {0, 1} * →[1,n] and a secure hash function
[0182] 3) Set the system common parameters to And returns this public parameter param.
[0183] (2)KeyGen(param)→(sk U , pk U ): Input the system public parameter param, and the node generates its own public and private key pair (sk U , pk U ), sk U For label generation, pk U Used for integrity proof verification.
[0184] 1) The node randomly selects a private key And calculate as your public key.
[0185] 2) Output the public and private key pair of the node (sk U , pk U ).
[0186] (3)TagGen(M,sk U)→(Φ): Input file M and private key sk U ,The user node generates a label set for subsequent integrity verification.
[0187] 1) User nodes randomly select α=(α 1 , α 2 , ..., α s ), β=(β 1 , β 2 , ..., β n ),in, Then for calculate
[0188] 2) Random Selection Then calculate
[0189]
[0190] 3) Output label set Φ = {σ i} 1≤i≤n .
[0191] (4) Chal(param)→Q: Input system parameter param, and the storage node generates a challenge set based on its own storage age.
[0192] 1) According to the storage age of the storage node, the number of challenge blocks c is obtained.
[0193] 2) Calculate chal j = F(t||j), j∈[1,c] and Then calculate
[0194] 3) Output challenge set Q = {(i, v i )} i∈I .
[0195] (5) Proof(Q, M, Φ) → proof: Input the challenge set Q, file M and label set Φ, and the storage node generates a proof.
[0196] 1) Calculate R and S based on the label of the file block,
[0197]
[0198] 2) Then calculate μ based on the file block l and τ 0 ,
[0199]
[0200] 3) Output data integrity proof proof = (R, S, τ 0 ).
[0201] (6)Verify(proof, Q, pk U )→{0 / 1}: Input proof proof, challenge set Q and public key pk U , the consensus node generates the verification result.
[0202] 1) Consensus node calculates τ = τ 0 +Σ i∈I v i β i mod q.
[0203] 2) Verify whether the following equation holds true.
[0204]
[0205] The technical effects of the present invention are described in detail below in conjunction with experiments.
[0206] In order to test the present invention, the system of the present invention is implemented by programming simulation. At the same time, the scheme of the present invention is also compared with the PoR protocol [Compact Proofs of Retrievability] of Shacham et al.
[0207] Compare the communication and computational overhead.
[0208] Table 1 compares the communication and computational overheads of the protocol of the present invention and the PoR protocol of Shacham et al. Among them, n represents the number of unseen data blocks; s represents the number of data block fragments; c represents the number of challenge blocks; p represents the number of groups in the PoR protocol. The prime order of q represents the group The prime order of ; M represents multiplication operation; E represents modular exponentiation operation; P represents bilinear pairing operation.
[0209] Table 1. Comparison of communication and computational overhead
[0210]
[0211] In terms of communication overhead, during the tag upload process, the communication overhead of the PoSI protocol and the PoR protocol is linearly related to the number of file blocks. During the proof response process, the communication overhead of the PoSI protocol is a constant, which is significantly smaller than the communication overhead of the PoR protocol, because the communication overhead of the PoR protocol is linearly related to the number of shards of the data block. In general, the communication overhead of the protocol of the present invention is smaller than that of the PoR protocol.
[0212] In terms of computational overhead, during the label generation phase, the PoR protocol requires sn modular exponentiation operations, while the PoSI protocol only requires n modular exponentiation operations. Obviously, the computational overhead of the PoSI protocol is lower than that of the PoR protocol at this stage. In the proof generation phase, the computational overhead of both the PoSI protocol and the PoR protocol is linearly related to the number of challenge blocks, but it is not difficult to see that the computational overhead of the PoSI protocol is smaller. In the proof verification phase, the PoR protocol requires two bilinear pairing operations and c+s modular exponentiation operations, while the PoSI protocol only requires 2 modular exponentiation operations and no bilinear pairing operations, so the computational overhead of the PoSI protocol is much smaller than that of the PoR protocol. From the experimental graph Figure 4 to Figure 7 The same conclusion can be obtained in .
[0213] The simulation experiment was carried out under Linux operating system using Intel(R) Xeon CPU E5-2682 v4@2.50GHz processor and 2GB RAM. The network used was a common Gigabit network with an upload and download speed of 1Mbps. The simulation experiment code was written in Python language, which used the GMP library and PBC library based on GNU multiple precision arithmetic. According to the relevant assumptions, the base domain size was set and the multiplication loop group used was It is a 1024-bit group that satisfies the 160-bit prime order subgroup. Each set of experiments was conducted 20 times, and the experimental graph was drawn by calculating the average value.
[0214] The most notable feature of the new consensus protocol PoSI based on data age and integrity verification proposed in this invention is its lightweight. Figure 4 , Figure 6 and Figure 7 It can be seen that the computational overhead of the proposed PoSI protocol is less than that of the PoR protocol. The label generation time of the two protocols varies with the number of data blocks n as shown in Figure 4 As shown in the figure, it can be found that the label generation time is linearly related to the size of n, and it is not difficult to see that the label generation time in the PoSI protocol is significantly less than that in the PoR protocol, because the PoSI protocol calculates (s-1)n fewer modular exponentiation operations than the PoR protocol.
[0215] The proof generation time and proof verification time of the two protocols vary with the number of challenge data blocks c as follows: Figure 6 and Figure 7 As shown. Figure 6 As shown in the figure, it can be seen that as the number of challenge blocks c increases, the time to generate the proof will also increase. In the PoSI protocol, this trend of change can enable SN to calculate the proof in different times, so that MN can be elected more efficiently. Figure 7It can be seen that compared with the PoR protocol, the PoSI protocol takes significantly less time to verify the proof on the CN, because the PoSI protocol does not require the calculation of bilinear pairings during verification. Figure 5 As shown in the figure, the computational overhead of proof verification of the PoSI protocol is much smaller than that of proof generation. Experimental data shows that the PoSI protocol only needs 2ms to 6ms to verify the proof, which is very suitable for the high efficiency required by the blockchain system.
[0216] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0217] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A consensus verification method based on data age and integrity verification, characterized in that: The consensus verification method based on data age and integrity verification includes the following steps: Step 1: Generate a system parameter set based on security parameters; the user node generates a private key for generating tags and a public key for verification; Step 2: The user node generates a tag set for integrity verification; the storage node generates a challenge set and corresponding integrity proof based on the storage age; Step 3: The consensus node verifies whether the integrity proof provided by the storage node is valid; The generating of the system parameter set according to the security parameter comprises: (1) Obtain the system security parameter λ, select two large prime numbers p and q, where q is a prime factor of p-1; construct a multiplication cyclic group of order q The generator of is g; (2) Select a pseudo-random function F(·): {0, 1} * →[1,n] and a secure hash function (3) System common parameters are: The storage node generates a challenge set according to the storage age, including: (1) According to the storage age of the storage node, the number of challenge blocks c is obtained; (2) Calculate chal j = F(t||j), j∈[1,c] and And calculate (3) Get the challenge set Q = {(i, v i ))i∈I; The storage node generates the integrity proof including: (1) Calculate R and S based on the label of the file block, (2) Calculate μ based on file blocks l and τ0, (3) Obtain data integrity proof proof = (R, S, τ0); The storage age is the quantification of the time that a file or part of a file is stored in a fixed location, measured in GBday; the size of the storage age depends on the size of the stored file and the storage time.
2. The consensus verification method based on data age and integrity verification as claimed in claim 1, characterized in that: The user node generates a private key for generating a label and a public key for verification, including: (1) Based on the system public parameter param, the user node generates its own public and private key pair (sk U , pk U ), sk U For label generation, pk U Used for integrity proof verification; (2) The node randomly selects a private key And calculate as your public key.
3. The consensus verification method based on data age and integrity verification as claimed in claim 1, characterized in that: The user node generates a label set for integrity verification including: (1) The user node randomly selects α=(α1, α2, ..., α s ), β=(β1, β2,...,β n ),in, for calculate (2) Random selection And calculate: (3) Get the label set Φ = {σ i } 1≤i≤n .
4. The consensus verification method based on data age and integrity verification as claimed in claim 1, characterized in that: The consensus node verifies whether the integrity proof provided by the storage node is valid, including: (1) Consensus node calculation τ=τ0+∑ i∈I v i β i mod q; (2) Verify the validity of the integrity proof by verifying whether the following equation holds:
5. A consensus protocol system implementing the consensus verification method based on data age and integrity verification as described in any one of claims 1 to 4, characterized in that: The consensus protocol system includes: Ordinary user nodes, i.e. user nodes that provide files to be stored by other nodes; Storage nodes, which provide extra space to help other user nodes store files; Consensus nodes, which are nodes that perform integrity verification; The accounting node is the storage node that sends the integrity proof and passes the integrity verification first.
6. A consensus method based on the consensus protocol system as claimed in claim 5, characterized in that: The consensus method includes: the user node performs file preprocessing and generates a data file tag using the private key of the user node, stores the file block and the tag set in the storage node, the storage node generates a challenge and a corresponding proof according to the timestamp in the latest block in the blockchain, and broadcasts them in the network; the consensus node verifies whether the proof is valid, and the first storage node that passes the verification becomes the accounting node; the accounting node completes the packaging of the transaction and generates a block in the blockchain.
7. A blockchain consensus protocol terminal, characterized in that: The blockchain consensus protocol terminal is used to execute the consensus verification method based on data age and integrity verification as described in any one of claims 1-4.
