CN113672680A - Lightweight probability verification method and device in block chain, block chain node and medium - Google Patents

Lightweight probability verification method and device in block chain, block chain node and medium Download PDF

Info

Publication number
CN113672680A
CN113672680A CN202110815837.1A CN202110815837A CN113672680A CN 113672680 A CN113672680 A CN 113672680A CN 202110815837 A CN202110815837 A CN 202110815837A CN 113672680 A CN113672680 A CN 113672680A
Authority
CN
China
Prior art keywords
verification
current
current block
block
degree
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110815837.1A
Other languages
Chinese (zh)
Inventor
秦阳
陈家立
李若南
褚晓文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Graduate School Harbin Institute of Technology
Original Assignee
Shenzhen Graduate School Harbin Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Graduate School Harbin Institute of Technology filed Critical Shenzhen Graduate School Harbin Institute of Technology
Priority to CN202110815837.1A priority Critical patent/CN113672680A/en
Publication of CN113672680A publication Critical patent/CN113672680A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a lightweight probability verification method and device in a block chain, a block chain link point and a medium. The method comprises the following steps: acquiring a current block of broadcast transmission; generating a random probability and acquiring a current verification degree corresponding to the current block; if the random probability is smaller than the current verification degree, verifying the current block, and storing the current block in a node local chain; and if the random probability is not less than the current verification degree, directly storing the current block in a node local chain. The method can ensure the data security in the block chain network, and can slow down the propagation delay of the current block in the block chain network, thereby reducing the block chain branching phenomenon.

Description

Lightweight probability verification method and device in block chain, block chain node and medium
Technical Field
The invention relates to the technical field of block chains, in particular to a lightweight probability verification method and device in a block chain, a block chain link point and a medium.
Background
Propagation delay of a block is a major factor causing block chain branching. In the current block chain design process, nodes are required to be set to continuously verify blocks so as to ensure the safety of block chain data, and when different nodes synchronize blocks with the same height, the same verification process is executed. Each node needs to verify every tile and every transaction, which may cause an over-verification problem for one chain of tiles. Moreover, the verification of the node to the block occupies a large amount of time resources, which brings more possibility to the bifurcation of the main chain. To a certain extent, if the block propagation delay in the block chain can be reduced, the occurrence of the branch of the main chain can be reduced. The existing block propagation delay includes, in addition to the transmission time, a verification time for verifying the block by the node, and the verification time is a main source of the block propagation delay. If the verification time of the block in the network can be reduced, the efficiency of the node synchronization block will be greatly improved, thereby reducing the block chain bifurcation, and therefore how to reduce the verification time of the block is an urgent problem to be solved in the block chain design.
Disclosure of Invention
The invention provides a lightweight probability verification method and device in a block chain, a block chain node and a medium, and aims to solve the problem of reducing block propagation delay.
The invention provides a lightweight probability verification method in a block chain, which comprises the following steps:
acquiring a current block of broadcast transmission;
generating a random probability and acquiring a current verification degree corresponding to the current block;
if the random probability is smaller than the current verification degree, verifying the current block, and storing the current block in a node local chain;
and if the random probability is not less than the current verification degree, directly storing the current block in a node local chain.
Preferably, after the verifying the current block and storing the current block in a node local chain if the random probability is smaller than the current verification degree, the lightweight probability verification method in the block chain further includes:
setting a verification flag bit corresponding to the current block to be 1;
if the random probability is not less than the current verification degree, after the current block is directly stored in a node local chain, the method for verifying the lightweight probability in the block chain further includes:
and setting the verification flag bit corresponding to the current block to be 0.
Preferably, the obtaining the current verification degree corresponding to the current block includes:
acquiring a target verification degree corresponding to the current block by adopting a verification degree adjusting algorithm;
if the target verification degree is greater than a verification degree threshold value, determining the target verification degree as the current verification degree corresponding to the current block;
and if the target verification degree is not greater than the verification degree threshold, determining the verification degree threshold as the current verification degree corresponding to the current block.
Preferably, the verification degree adjusting algorithm is
Figure BDA0003170023630000021
Wherein, v isnewThe target verification degree is obtained; v. ofoldThe historical verification degree; t is tiGenerating a time interval for the block; t is trVerifying the actual time used for the previous cycle; n is the number of blocks generated in one cycle.
Preferably, after the acquiring the current block of the broadcast transmission, the method for verifying the lightweight probability in the block chain further includes:
acquiring the current non-verification times corresponding to the current block;
if the current non-verification frequency is larger than the maximum non-verification threshold value, verifying the current block, storing the current block in a node local chain, and updating the current non-verification frequency to be 0;
and if the current non-verification times are not more than the maximum non-verification threshold value, executing the maximum non-verification threshold value.
Preferably, after the verifying the current block and storing the current block in a node local chain if the random probability is smaller than the current verification degree, the lightweight probability verification method in the block chain further includes:
setting the current non-verification times corresponding to the current block to be 0;
if the random probability is not less than the current verification degree, after the current block is directly stored in a node local chain, the method for verifying the lightweight probability in the block chain further includes:
and adding 1 to the current unverified times corresponding to the current block so as to update the current unverified times corresponding to the current block.
The invention provides a lightweight probability verification device in a block chain, which comprises:
a current block acquisition module, configured to acquire a current block for broadcast transmission;
the probability verification degree acquisition module is used for generating random probability and acquiring the current verification degree corresponding to the current block;
the verification processing module is used for verifying the current block and storing the current block in a node local chain if the random probability is smaller than the current verification degree;
and the non-verification processing module is used for directly storing the current block in a node local chain if the random probability is not less than the current verification degree.
The invention provides a block chain link point, which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor executes the computer program to realize the lightweight probability verification method in the block chain.
The invention provides a computer-readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, implements the lightweight probability verification method in the above block chain.
According to the lightweight probability verification method and device in the block chain, the block chain nodes and the medium, the partial nodes with the random probability smaller than the current verification degree verify the current block so as to ensure the data security in the block chain network. The partial nodes with the random probability not less than the current verification degree do not need to verify the current block, so that the verification time for verifying the current block is saved, the propagation delay of the current block in a block chain network is favorably reduced, and the block chain branching phenomenon is further reduced. The random probability generated by each node is compared with the current verification degree to determine whether the current block needs to be verified or not, so that any current block can be guaranteed, the verification process can be performed by different nodes, the randomness of the verification process is guaranteed, and the data security of the block chain network is guaranteed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a flow chart of a method for lightweight probability verification in a blockchain according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a method for lightweight probability verification in a blockchain according to an embodiment of the present invention;
FIG. 3 is another flow chart of a method for lightweight probability verification in a blockchain according to an embodiment of the present invention;
FIG. 4 is another flow chart of a method for lightweight probability verification in a blockchain according to an embodiment of the present invention;
FIG. 5 is a schematic illustration of simulation test results in one embodiment of the present invention;
FIG. 6 is another illustration of simulation test results in one embodiment of the present invention;
FIG. 7 is another illustration of simulation results in an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a lightweight probability verification method in a block chain, which is applied to each node in the block chain, so that when each node acquires a broadcast block, whether the block needs to be selected and verified is determined based on random probability and current verification degree, part of nodes receive the block after verifying the block, and part of nodes directly receive the block without verifying the block, thereby saving the verification time of the block in the block chain network.
In an embodiment, as shown in fig. 1, a lightweight probability verification method in a blockchain is provided, which is described by taking an example that the method is applied to any node in the blockchain, and includes the following steps:
s101: acquiring a current block of broadcast transmission;
s102: generating a random probability and acquiring a current verification degree corresponding to a current block;
s103: if the random probability is smaller than the current verification degree, verifying the current block, and storing the current block in a node local chain;
s104: and if the random probability is not less than the current verification degree, directly storing the current block in the node local chain.
The current block refers to a block broadcasted and transmitted to all nodes in the block chain at the current time, and is set as B1.. Bi... Bs, such as B100, B101, and B102 shown in fig. 2. For convenience of description, the node performing the lightweight probability verification method in the blockchain is defined as the current node, which may be N1... Bj... Nr, such as N1, N2, N3, N4, N5, and N6 shown in fig. 2.
As an example, in step S101, any node in the block chain may obtain the current block of the broadcast transmission, that is, each current node in the block chain may receive the current block of the broadcast transmission. As shown in fig. 2, all current nodes N1, N2, N3, N4, N5, and N6 in the block chain can obtain the current block B102 broadcast transmitted at the current time.
As an example, in step S102, after acquiring the current block of the broadcast transmission, the current node may use a random number generation tool to generate a random probability, where the random probability is a value between 0 and 1. The random number generation tool may be a tool developed in any programming language for generating random numbers between 0-1. The random probability is a random number between 0-1 generated using a random number generation tool.
The current verification degree refers to the verification degree calculated at the current moment. The verification degree refers to the average verification times of the nodes in the block chain to the block. For example, with a degree of verification of 0.5, the entire blockchain network verifies a block on average every two nodes. For another example, when the verification degree is 1, each node needs to verify each block, which is the standard protocol currently implemented.
As an example, in step S102, after acquiring the current block of the broadcast transmission, the current node needs to calculate the current verification degree corresponding to the current block in real time. In this example, the current verification degree corresponding to the current block may be determined by using a preset verification degree update rule, where the verification degree update rule may be determined by current computing resources in the block chain network, and the larger the current computing resource is, the higher the current verification degree is; conversely, the smaller the current computing resource, the lower its current degree of validation.
As an example, in step S103, the current node verifies the current block only when the random probability is smaller than the current verification degree, and stores the current block in the node local chain. That is, only when the random probability of all current nodes in the block chain is smaller than the current verification degree, the current block is verified, and after the verification is passed, the current block is stored in the node local chain, so that the data security in the block chain is guaranteed. As shown in fig. 2, in the current nodes N1 and N6 in the blockchain, the random probability is smaller than the current verification degree (e 1< v, e 6< v), the current block needs to be verified, and after the verification is passed, the current block is stored in the node local chain, so as to ensure the data security in the blockchain network.
As an example, in step S104, when the random probability of the current node is not less than the current verification degree, the current block does not need to be verified, and the current block is directly stored in the node local chain, so as to save the verification time for verifying the current block, help to slow down the propagation delay of the current block in the block chain network, and further reduce the block chain branching phenomenon. As shown in FIG. 2, in the current nodes N2-N5 in the block chain, the random probability is not less than the current verification degree (ε 2 ≧ v, ε 3 ≧ v, and ε 4 ≧ v), and the current block can be directly stored in the node local chain without verifying the current block, so as to save the verification time for verifying the current block.
In the lightweight probability verification method in a block chain provided in this embodiment, a partial node with a random probability smaller than the current verification degree verifies a current block to ensure data security in a block chain network. The partial nodes with the random probability not less than the current verification degree do not need to verify the current block, so that the verification time for verifying the current block is saved, the propagation delay of the current block in a block chain network is favorably reduced, and the block chain branching phenomenon is further reduced. The random probability generated by each node is compared with the current verification degree to determine whether the current block needs to be verified or not, so that any current block can be guaranteed, the verification process can be performed by different nodes, the randomness of the verification process is guaranteed, and the data security of the block chain network is guaranteed.
In an embodiment, after step S103, that is, after verifying the current block and storing the current block in the node local chain if the random probability is smaller than the current verification degree, the method for verifying the lightweight probability in the block chain further includes:
setting a verification flag bit corresponding to the current block to be 1;
after step S104, that is, after the current block is directly stored in the node local chain if the random probability is not less than the current verification degree, the method for verifying the lightweight probability in the block chain further includes:
and setting the verification flag bit corresponding to the current block to be 0.
The verification flag bit corresponding to the current block is a flag bit used for reflecting whether the current block is verified, and may be represented by α.
As an example, after the random probability of the current node is smaller than the current verification degree, the current block is verified, and the current block is stored in the local chain of nodes, the verification flag bit corresponding to the current node may also be set to 1 to identify that the current block is the block stored in the local chain of nodes after the current node is verified, so that in a subsequent propagation process of the current block, a subsequent node determines whether the current node needs to be verified according to the verification flag bit. For example, when the current node a sets its verification flag to 1, when the current node a broadcasts the current node to the next node b, such that its next node b determines that the current node a has verified the current block when it recognizes that the verification flag of the current block is 1.
As an example, after the random probability of the current node is not less than the current verification degree and the current block is directly stored in the local chain of nodes, the verification flag bit corresponding to the current block may also be set to 0 to identify that the current block is a block in the local chain of nodes where the current node does not verify the current block, so that in the subsequent propagation process of the current block, the subsequent node determines whether the current node needs to be verified according to the verification flag bit. For example, when the current node a sets the verification flag bit to 0, when the current node a broadcasts the current node to the next node b, and the next node b identifies that the verification flag bit of the current block is 0, it is determined that the current node a does not verify the current block, so as to update the current number of times of non-verification corresponding to the current block, and determine whether verification is required according to the updated current number of times of non-verification, thereby ensuring the security of the current block.
In an embodiment, as shown in fig. 3, the step S103 of obtaining the current verification degree corresponding to the current block includes:
s301: acquiring a target verification degree corresponding to the current block by adopting a verification degree adjusting algorithm;
s302: if the target verification degree is greater than the verification degree threshold, determining the target verification degree as the current verification degree corresponding to the current block;
s303: and if the target verification degree is not greater than the verification degree threshold, determining the verification degree threshold as the current verification degree corresponding to the current block.
The target verification degree refers to the verification degree calculated in real time by adopting a verification degree adjusting algorithm. The threshold of the degree of verification is a preset degree of verification, and the threshold of the degree of verification may be a minimum value of the degree of verification set according to the safety requirement of the blockchain network design, for example, the threshold of the degree of verification may be set to 0.5, that is, on average, every 2 nodes in the blockchain network need to verify a block.
As an example, in step S301, each current node in the blockchain network may employ a pre-configured verification degree adjustment algorithm to calculate the target verification degree corresponding to the current block in real time. The validation degree adjustment algorithm may be an algorithm related to the current computing resource in the blockchain network, and may reflect an association relationship between the target validation degree and the current computing resource in the blockchain network. In general, the target degree of validation increases with increasing current computing resources in the blockchain network and decreases with decreasing current computing resources in the blockchain network.
As an example, in step S302, after obtaining a target verification degree corresponding to a current block, each current node in the blockchain network needs to compare the target verification degree with a pre-configured verification degree threshold; if the target verification degree is greater than the verification degree threshold, it is stated that the current computing resources in the block chain network are more and the computing resources capable of verifying the current block are more, at this time, the target verification degree can be determined as the current verification degree corresponding to the current block, so that whether the verification process needs to be carried out on the current block is determined according to the comparison result of the random probability and the current verification degree, and it can be ensured that when the current computing resources of the block chain network are more, the current block is verified by more current nodes, which is helpful for ensuring the data security of the block chain network.
As an example, in step S303, after obtaining a target verification degree corresponding to a current block, each current node in the blockchain network needs to compare the target verification degree with a pre-configured verification degree threshold; if the target verification degree is not greater than the verification degree threshold, it is described that a situation that the current computing resources are suddenly or continuously decreased may occur in the block chain network, so that the current computing resources are less and have less computing resources capable of verifying the current block, and if the target verification degree is directly determined as the current verification degree, the current nodes with less number may verify the current block or even no current nodes verify the current block, which affects the data security of the block chain network. Therefore, when the target verification degree of the current node is not greater than the verification degree threshold, the preset verification degree threshold can be directly determined as the current verification degree, so that the current verification degree is the verification degree threshold set according to the block chain network design safety requirement, and therefore when the current computing resources of the block chain network are less, the current node corresponding to the verification degree threshold in number can be guaranteed to verify the current block, and the data safety of the block chain network is further guaranteed.
In one embodiment, the verification degree adjustment algorithm is
Figure BDA0003170023630000101
Wherein v isnewThe target verification degree is obtained; v. ofoldThe historical verification degree; t is tiGenerating a time interval for the block; t is trVerifying the actual time used for the previous cycle; n is the number of blocks generated in one cycle.
Wherein the target verification degree vnewIs the calculated and determined degree of verification at the current time. Degree of historical verification voldRefers to the degree of verification calculated prior to the current time. As an example, the historical verification degree voldThe determined degree of verification may be calculated for the initial degree of verification or for the previous cycle. The initial verification degree refers to the block chain networkThe degree of authentication determined during the initialization of the network, for example, the initial degree of authentication may be set to 0.75. Block generation interval tiWhich can be understood as the time difference between the generation times of two adjacent blocks. The period herein refers to a time when a certain number of blocks are generated. For example, the time for generating 10 blocks may be set as one period, and the next period is entered after 10 blocks are generated. The actual time t used for the verification of the previous periodrIt is understood that the synchronization time of the previous cycle refers to the actual time for verifying the blocks in the previous cycle. For example, 10 blocks is a cycle, then in a blockchain network, the block height on the main chain is from 1 to 10 blocks at the time the current block is verified.
In an embodiment, as shown in fig. 4, after step S101, that is, after acquiring the current block of the broadcast transmission, the method for verifying the lightweight probability in the block chain further includes:
s401: acquiring the current non-verification times corresponding to the current block;
s402: if the current non-verification times are larger than the maximum non-verification threshold value, verifying the current block, storing the current block in a node local chain, and updating the current non-verification times to be 0;
s403: and if the current non-verification times are not more than the maximum non-verification threshold value, executing the maximum non-verification threshold value.
The current unverified times are times that the current block is not verified by the node in the process of propagating through the block chain. The number of times of non-verification currently can be understood as the number of nodes that pass when the current block is propagated through the block chain and directly store the current block in the node local chain without verification. The maximum unverified threshold value refers to a threshold value of nodes which are allowed to pass through in the design of the block chain network and do not need to be verified. For example, a maximum unverified threshold value of 3 indicates that at most 3 consecutive current nodes are allowed to remain unverified for a current block as any current block propagates through the chain of blocks.
As an example, in step S401, when any current node in the block chain acquires the current block, block information carried by the current block may be read, and the current non-verification times are read from the block information. It is understood that each block is broadcast for transmission to any current node, and after the current block is stored in the node local chain, the current number of times of non-authentication of the current node is updated so that the next node can read the current number of times of non-authentication of the current block when the current block is transmitted to the next node.
As an example, in step S402, after any current node in the block chain obtains the current number of times of non-verification of the current block, the current number of times of non-verification needs to be compared with a preset maximum non-verification threshold; if the current non-verification frequency is greater than the maximum non-verification threshold value, it is indicated that the current block is not verified continuously through more nodes before the current time, and if the current block is not verified by the current node, the safety of the current block cannot be guaranteed. Therefore, when the current non-verification frequency of the current node is greater than the maximum non-verification threshold value, the current block is verified, and only after the verification is passed, the current block is stored in the node local chain, and at this time, the current non-verification frequency is updated to be 0, so that the current block is verified at the current node.
As an example, in step S403, after any current node in the block chain obtains the current number of times of non-verification of the current block, the current number of times of non-verification needs to be compared with a preset maximum non-verification threshold; if the number of times of current non-verification is not greater than the maximum non-verification threshold value, it indicates that the current block is not verified by passing fewer nodes continuously before the current time, and at this time, steps S102-S104 may be executed, so that the current node may determine whether to verify the current block according to the random probability and the current verification degree, and the purposes of data security and verification time reduction may be achieved.
For example, the maximum unverified threshold θ is set, that is, a current block may be unverified by θ current nodes at most, and when the θ +1 th current node acquires the current block, the current block must be verified. The distance between two adjacent nodes is set as 1, and when probability verification is adopted, two adjacent nodes areMean distance χ of nodes is
Figure BDA0003170023630000121
v is the current degree of authentication; χ is the average distance between two adjacent nodes at the current verification degree v. In the worst case, all nodes in the block chain network do not verify the current block, and when the number of all nodes in the block chain network is set to be n, the probability that all nodes do not verify the current block is set
Figure BDA0003170023630000122
Probability of occurrence of such worst case
Figure BDA0003170023630000123
Extremely small but may still occur. In order to avoid the worst case, initializing the maximum unverified threshold value theta to be 0 by setting the maximum unverified threshold value theta; if the current block is directly stored in a node local chain by a current node without verification, adding 1 to the maximum non-verification threshold value theta; if the current block is verified by a current node and then stored in the local chain of nodes, the maximum unverified threshold value theta can be updated to 0 to ensure that the current block can be verified certainly.
Understandably, through the comparison result of the current non-verification times and the maximum non-verification threshold value, only the nodes which are matched with the maximum non-verification threshold value in number are allowed to pass continuously without verifying the current block, namely, the current non-verification times are larger than the maximum non-verification threshold value, and the current block is necessarily verified, so that the current block is ensured to be verified by the block chain network certainly, and the data security of the block chain network is ensured.
In an embodiment, after step S103, that is, after verifying the current block and storing the current block in the node local chain if the random probability is smaller than the current verification degree, the method for verifying the lightweight probability in the block chain further includes:
setting the current non-verification times corresponding to the current block as 0;
after step S104, that is, after the current block is directly stored in the node local chain if the random probability is not less than the current verification degree, the method for verifying the lightweight probability in the block chain further includes:
and adding 1 to the current unverified times corresponding to the current block so as to update the current unverified times corresponding to the current block.
As an example, during the broadcast transmission of each block to any current node, after the current block is stored in the local chain of nodes, the current number of times of non-verification of the current node is updated, so that when the current block is transmitted to the next node, the next node can read the current number of times of non-verification. Understandably, after step S103, that is, after the current block is verified if the random probability is smaller than the current verification degree, and the current block is stored in the node local chain, since the current node has already verified the current block, the current non-verification frequency corresponding to the current block may be 0. Correspondingly, after step S104, that is, after the random probability is not less than the current verification degree, the current block is directly stored in the node local chain, the current non-verification frequency corresponding to the current block is increased by 1 to update the current non-verification frequency corresponding to the current block, so that the next node of the current node can re-execute steps S401-S403 based on the updated current non-verification frequency.
Simulation tests are performed on the lightweight probability verification method in the block chain and the verification scheme in the prior art. In this example, the lightweight probability verification method in the block chain is defined as an PvS scheme (i.e., abbreviated as PvScheme), the verification scheme for verifying only the block header of the current block is defined as an R1 scheme (i.e., R1_ verify block header scheme), and the verification scheme for verifying only the most critical workload consensus in the current block is defined as an R2 scheme (i.e., R2_ verify block header's differential link scheme).
(1) Setting up a simulated environment
The simulation platform adopted by the simulation test is an open source block chain simulation platform Bitcoin-Simulator realized by Federal institute of technology and engineering, Zurich, Switzerland[1]The simulation platform is mainly constructed on a network simulation platform ns-3, and the construction of a network architecture is completed by utilizing the ns-3.
The software and hardware environment of the experiments herein are as follows:
hardware environment: one server, 32GB memory, 1TB hard disk, 2 8-core CPUs
Software environment: ubuntu16.04 operating system, blockchain simulation platform Bitcoid-Simulator and open source network simulation platform ns-3
This document is developed based on the standard protocol of the current blockchain, and in addition to the contents of some proposed improved standard protocols, other parameter designs still follow the standard protocols. The two studies are parallel to each other and each is based on changes made to the standard protocol.
(2) Results of the experiments and analysis thereof
In the part of experiments, a large number of positive block chain network simulation platforms are obtained in the experiments for reference, protocol modification meeting the requirements of the part of experiments is carried out on the positive block chain network simulation platforms, and relevant parameters needing to be counted in the part of experiments are increased.
In the experimental design, in view of the 51% attack that may exist in the blockchain network, verifying the blocks by nodes less than half of the whole network may bring a great safety hazard to the network. Here, to fully account for the safety and performance tradeoffs in blockchains, the experiments in this section set the validation degree υ to be from 0.5 to 1.0, as shown in table 1.
TABLE 1 Experimental parameters
Figure BDA0003170023630000151
Hereinafter, 5 simulation experiments were performed for each verification degree ν from 0.5 to 1, and the average value thereof was calculated as the experimental data in this section. In the design experiment, a total of 1000 blocks are designed to be broadcast among 6000 nodes, wherein 32 miners nodes are included, and the following experimental data are counted.
Fig. 5 shows the experimental results of the synchronization time of different schemes at different degrees of verification. As shown in fig. 5, for either scheme, as the degree of authentication increases, the synchronization time increases.
Figure 6 shows the experimental results of the cull rate for different protocols at different degrees of validation. As shown in fig. 6, as the degree of validation increases, the cull rate for the different schemes also increases.
Fig. 7 shows the propagation delay of the received blocks at different degrees of validation for different scale nodes. As shown in fig. 7, as the degree of verification increases, more propagation delay is generated as more nodes need to verify the block.
Table 2 below shows the results of simulation tests validated with different protocols and standard protocols. As shown in table 2, the results of the probabilistic validation scheme (i.e., the PsV scheme) were superior to the standard protocol with a 5.7% reduction in the garbage rate (i.e., (1.93% -1.82%)/1.93% ═ 5.7%). Since the waste blocks in the block chain refer to blocks which are not added to the main chain but are located in the bifurcation, these blocks are legal, but are not in the main chain, so that a common consensus cannot be obtained. Generally, the ratio of the waste blocks and the bifurcation rate are the same meaning, so it can be said that the probability verification scheme (i.e. PsV scheme) can reduce the bifurcation rate by 5.7%. Although the R1 scheme may also reduce the block discard rate, since the R1 scheme only verifies the block header, and the R2 scheme only verifies the most critical proof of work (proof of work), and discards the block containing a large amount of data transactions, there is a large data security problem. From the perspective of security, the R1 scheme and the R2 scheme do not verify transactions within a block, cannot distinguish double-cost transactions, and do not consider the situation of a false block, which cannot be corrected once a block is wrong, and the security is obviously inferior to that of a probabilistic verification scheme (i.e., the PsV scheme).
Table 2 simulation test results for different protocols
Figure BDA0003170023630000161
As shown in table 2 above, from the standard protocol solution and the PvS solution, the PvS solution has all other characteristics of the standard protocol except that the correctness of the block time cannot be guaranteed; however, the PvS scheme sacrifices the characteristic of guaranteeing the correctness of the blocks at any moment, and reduces the waste block rate (namely the bifurcation rate), so that unsafe factors such as selfish mining and the like caused by bifurcation can be avoided, and the safety of the whole network is theoretically improved from another aspect. Meanwhile, the requirement of the blockchain network on real-time performance is not high, and a small part of real-time performance and safety are sacrificed.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a lightweight probability verification apparatus in a blockchain is provided, where the lightweight probability verification apparatus in the blockchain corresponds to the lightweight probability verification method in the blockchain in the above embodiment one to one. The functional modules are explained in detail as follows:
a current block acquisition module, configured to acquire a current block for broadcast transmission;
the probability verification degree acquisition module is used for generating random probability and acquiring the current verification degree corresponding to the current block;
the verification processing module is used for verifying the current block and storing the current block in the node local chain if the random probability is smaller than the current verification degree;
and the non-verification processing module is used for directly storing the current block in the node local chain if the random probability is not less than the current verification degree.
Preferably, the verification processing module is further configured to set a verification flag bit corresponding to the current block to 1;
and the non-verification processing module is also used for setting the verification flag bit corresponding to the current block to be 0.
Preferably, the probability verification degree obtaining module includes:
the target verification degree obtaining unit is used for obtaining the target verification degree corresponding to the current block by adopting a verification degree adjusting algorithm;
the first current verification degree obtaining unit is used for determining the target verification degree as the current verification degree corresponding to the current block if the target verification degree is greater than the verification degree threshold;
and the second current verification degree obtaining unit is used for determining the verification degree threshold as the current verification degree corresponding to the current block if the target verification degree is not greater than the verification degree threshold.
Preferably, the verification degree adjusting algorithm is
Figure BDA0003170023630000181
Wherein v isnewThe target verification degree is obtained; v. ofoldThe historical verification degree; t is tiGenerating a time interval for the block; t is trVerifying the actual time used for the previous cycle; n is the number of blocks generated in one cycle.
Preferably, the lightweight probability verification device in the blockchain further includes:
the current non-verification frequency acquisition module is used for acquiring the current non-verification frequency corresponding to the current block;
the first non-verification frequency processing module is used for verifying the current block if the current non-verification frequency is greater than the maximum non-verification threshold value, storing the current block in a node local chain and updating the current non-verification frequency to be 0;
and the second unverified time processing module is used for executing the maximum unverified threshold value if the current unverified time is not greater than the maximum unverified threshold value.
Preferably, the verification processing module is further configured to set the current non-verification frequency corresponding to the current block to 0;
and the non-verification processing module is also used for adding 1 to the current non-verification times corresponding to the current block so as to update the current non-verification times corresponding to the current block.
For the specific definition of the lightweight probability verification device in the blockchain, reference may be made to the above definition of the lightweight probability verification method in the blockchain, and details are not described here. The modules in the lightweight probability verification device in the block chain can be implemented in whole or in part by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the blockchain node, and can also be stored in a memory in the blockchain node in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a block link point is provided that includes a processor, memory, network interface, and database connected by a system bus. Wherein the processor of the blockchain node is configured to provide computational and control capabilities. The memory of the block chain link point comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the blockchain node is used for executing data adopted or generated in the course of the lightweight probability verification method in the blockchain. The network interface of the block link point is used for communicating with an external terminal through network connection. The computer program is executed by a processor to implement a method of lightweight probability verification in a blockchain.
In one embodiment, a block chain link point is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for verifying lightweight probability in a block chain in the foregoing embodiments is implemented, for example, S101 to S104 shown in fig. 1, or shown in fig. 3 to 4, which is not described herein again to avoid repetition. Alternatively, the processor implements the functions of each module/unit in the embodiment of the lightweight probability verification apparatus in the block chain when executing the computer program, and is not described herein again to avoid repetition.
In an embodiment, a computer-readable storage medium is provided, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for verifying lightweight probabilities in a blockchain in the above embodiments is implemented, for example, S101 to S104 shown in fig. 1, or shown in fig. 3 to fig. 4, which is not described herein again to avoid repetition. Alternatively, the computer program, when executed by the processor, implements the functions of each module/unit in the embodiment of the lightweight probability verification apparatus in the block chain, and is not described herein again to avoid redundancy.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A lightweight probability verification method in a blockchain is characterized by comprising the following steps:
acquiring a current block of broadcast transmission;
generating a random probability and acquiring a current verification degree corresponding to the current block;
if the random probability is smaller than the current verification degree, verifying the current block, and storing the current block in a node local chain;
and if the random probability is not less than the current verification degree, directly storing the current block in a node local chain.
2. The method of claim 1, wherein after verifying the current block and storing the current block in a local chain of nodes if the random probability is less than the current verification level, the method further comprises:
setting a verification flag bit corresponding to the current block to be 1;
if the random probability is not less than the current verification degree, after the current block is directly stored in a node local chain, the method for verifying the lightweight probability in the block chain further includes:
and setting the verification flag bit corresponding to the current block to be 0.
3. The method of lightweight probabilistic verification in a blockchain according to claim 1, wherein said obtaining the current verification level corresponding to the current block includes:
acquiring a target verification degree corresponding to the current block by adopting a verification degree adjusting algorithm;
if the target verification degree is greater than a verification degree threshold value, determining the target verification degree as the current verification degree corresponding to the current block;
and if the target verification degree is not greater than the verification degree threshold, determining the verification degree threshold as the current verification degree corresponding to the current block.
4. The method of lightweight probability verification in blockchain according to claim 3, wherein the verification degree adjustment algorithm is
Figure FDA0003170023620000021
Wherein, v isnewThe target verification degree is obtained; v. ofoldThe historical verification degree; t is tiGenerating a time interval for the block; t is trVerifying the actual time used for the previous cycle; n is the number of blocks generated in one cycle.
5. The method of lightweight probability verification in a blockchain of claim 1, wherein after said obtaining a current block of a broadcast transmission, the method of lightweight probability verification in a blockchain further comprises:
acquiring the current non-verification times corresponding to the current block;
if the current non-verification frequency is larger than the maximum non-verification threshold value, verifying the current block, storing the current block in a node local chain, and updating the current non-verification frequency to be 0;
and if the current non-verification times are not more than the maximum non-verification threshold value, executing the maximum non-verification threshold value.
6. The method of claim 1, wherein after verifying the current block and storing the current block in a local chain of nodes if the random probability is less than the current verification level, the method further comprises:
setting the current non-verification times corresponding to the current block to be 0;
if the random probability is not less than the current verification degree, after the current block is directly stored in a node local chain, the method for verifying the lightweight probability in the block chain further includes:
and adding 1 to the current unverified times corresponding to the current block so as to update the current unverified times corresponding to the current block.
7. A lightweight probability verification apparatus in a blockchain, comprising:
a current block acquisition module, configured to acquire a current block for broadcast transmission;
the probability verification degree acquisition module is used for generating random probability and acquiring the current verification degree corresponding to the current block;
the verification processing module is used for verifying the current block and storing the current block in a node local chain if the random probability is smaller than the current verification degree;
and the non-verification processing module is used for directly storing the current block in a node local chain if the random probability is not less than the current verification degree.
8. The block chain lightweight probability verification apparatus of claim 7,
a target verification degree obtaining unit, configured to obtain a target verification degree corresponding to the current block by using a verification degree adjustment algorithm;
a first current verification degree obtaining unit, configured to determine, if the target verification degree is greater than a verification degree threshold, the target verification degree as a current verification degree corresponding to the current block;
and the second current verification degree obtaining unit is used for determining the verification degree threshold as the current verification degree corresponding to the current block if the target verification degree is not greater than the verification degree threshold.
9. A block link point comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements a lightweight probabilistic validation method in a block chain according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out a lightweight probability verification method in a blockchain according to any one of claims 1 to 6.
CN202110815837.1A 2021-07-19 2021-07-19 Lightweight probability verification method and device in block chain, block chain node and medium Pending CN113672680A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110815837.1A CN113672680A (en) 2021-07-19 2021-07-19 Lightweight probability verification method and device in block chain, block chain node and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110815837.1A CN113672680A (en) 2021-07-19 2021-07-19 Lightweight probability verification method and device in block chain, block chain node and medium

Publications (1)

Publication Number Publication Date
CN113672680A true CN113672680A (en) 2021-11-19

Family

ID=78539524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110815837.1A Pending CN113672680A (en) 2021-07-19 2021-07-19 Lightweight probability verification method and device in block chain, block chain node and medium

Country Status (1)

Country Link
CN (1) CN113672680A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924252A (en) * 2018-07-31 2018-11-30 泰链(厦门)科技有限公司 Mitigate method, medium and the block catenary system of node storage load in block catenary system
CN109379396A (en) * 2018-08-23 2019-02-22 泰链(厦门)科技有限公司 Method, medium, device and the block catenary system of hard bifurcation are prevented in block catenary system
CN111881147A (en) * 2019-12-13 2020-11-03 深圳数字生命研究院 Processing method and device of computing task, storage medium and processor
KR20210054895A (en) * 2019-11-06 2021-05-14 주식회사 체인시큐어 System for providing supernode based blockchain generating and verifying service
WO2021108978A1 (en) * 2019-12-03 2021-06-10 深圳市网心科技有限公司 Method for selecting validator node, electronic device, system, and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924252A (en) * 2018-07-31 2018-11-30 泰链(厦门)科技有限公司 Mitigate method, medium and the block catenary system of node storage load in block catenary system
CN109379396A (en) * 2018-08-23 2019-02-22 泰链(厦门)科技有限公司 Method, medium, device and the block catenary system of hard bifurcation are prevented in block catenary system
KR20210054895A (en) * 2019-11-06 2021-05-14 주식회사 체인시큐어 System for providing supernode based blockchain generating and verifying service
WO2021108978A1 (en) * 2019-12-03 2021-06-10 深圳市网心科技有限公司 Method for selecting validator node, electronic device, system, and medium
CN111881147A (en) * 2019-12-13 2020-11-03 深圳数字生命研究院 Processing method and device of computing task, storage medium and processor

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BING LIU ET AL: "Reducing Forks in the Blockchain via Probabilistic Verification", IEEE 35TH INTERNATIONAL CONFERENCE ON DATA ENGINEERING WORKSHOPS (ICDEW), pages 13 - 18 *
MENGYA LI ET AL: "Enhancing the efficiency and scalability of blockchain through probabilistic verification and clustering", INFORMATION PROCESSING AND MANAGEMENT, vol. 58, pages 1 - 19 *

Similar Documents

Publication Publication Date Title
CN110474774B (en) Block creation method and block link point in block chain based system
US11095432B2 (en) System for processing data based on blockchain and operating method thereof
CN109361740B (en) Block generation method, device, equipment and medium of block chain
CN109886681B (en) Block chain consensus method and system
CN108683539B (en) Block chain network management method, block chain network management device, block chain network management medium and electronic equipment
EP3934162B1 (en) Blockchain consensus method and device and electronic equipment
CN110943838A (en) Method, apparatus and storage medium for determining consensus of blocks in a blockchain network
CN111131209B (en) Improved efficient consensus method, system, computer device and storage medium
US20210297238A1 (en) Blockchain consensus method and system, and computer-readable storage medium
CN111614468A (en) Block chain consensus method and system
US20220101318A1 (en) Transaction Assignment Method and Apparatus Based on Structured Directed Acyclic Graph
CN111259078A (en) Block chain consensus method, block chain consensus device, computer equipment and storage medium
CN106850802B (en) Block chain generation method, distributed node and block chain network
CN110084596B (en) Method and device for processing block chain mixed consensus
US20210073186A1 (en) Permissionless blockchain consensus method with adjusting block weight, system and p2p network
CN113114496A (en) Block chain expandability problem solution based on fragmentation technology
CN112910965B (en) Method and system for submitting fragmented block chain down-across-fragmentation transaction
CN112907369A (en) Block chain-based data consensus method and device, electronic equipment and storage medium
CN109919760A (en) Byzantine failure tolerance common recognition algorithm based on voting mechanism
WO2024040796A1 (en) Block chain power transaction system, consensus method, device and storage medium
CN113672680A (en) Lightweight probability verification method and device in block chain, block chain node and medium
CN111061813B (en) Method, apparatus and computing device for data synchronization in blockchain network
Hackfeld A lightweight BFT consensus protocol for blockchains
CN116389040A (en) Reputation-based blockchain consensus method, device and computer equipment
CN114119242A (en) Alliance link performance optimization method and device based on self-adaptive window fragmentation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination