Lightweight blockchain consensus protocol implementation method based on reputation-weighted sampling
By calculating the number of nodes using reputation coefficients and confidence intervals, and combining this with verifiable random functions for node sampling, the computational and storage limitations of IoT devices are overcome, achieving efficient blockchain consensus, improving consensus speed and accuracy, and reducing the impact of Byzantine nodes.
Patent Information
- Application Number
- CN202411076495.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-08-07
AI Technical Summary
The limited computing and storage capabilities of IoT devices conflict with the high computing and storage requirements of blockchain technology, resulting in slower consensus speeds, lower accuracy, and reduced throughput, making it difficult to effectively process transactions and data in large-scale networks.
A reputation-based weighted sampling method is adopted, which calculates the number of nodes by using reputation coefficients and confidence intervals. A verifiable random function is used for node sampling and consensus process to reduce the number of nodes participating in consensus. The influence of Byzantine nodes is controlled by a reputation mechanism.
It accelerates consensus speed, improves consensus accuracy and blockchain throughput, reduces computational and time overhead, and prevents Byzantine nodes from controlling consensus for a long time.
Smart Images

Figure CN118764493B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer science, and particularly relates to a lightweight blockchain consensus protocol implementation method based on reputation weighted sampling. BACKGROUND
[0002] Blockchain is a decentralized and distributed digital record technology. It links data in the form of blocks to form an unalterable and transparent record chain. The characteristics of blockchain include high security, strong credibility and decentralization. It is widely used in the fields of cryptocurrencies, smart contracts and data security.
[0003] The integration of blockchain and IoT is the future development trend, which will create a more credible, secure and efficient digital economic ecosystem. Blockchain provides a secure and reliable data exchange and storage method, ensuring that data in IoT devices is not tampered with and forged, and providing a unique identity for devices. At the same time, through smart contracts, automatic transactions and payments are realized, reducing human intervention and improving the security and efficiency of transactions and payments. In addition, blockchain technology can also realize decentralized data sharing and privacy protection, promoting more extensive data cooperation. The integration of blockchain and IoT will promote digital transformation and intelligent development, and has broad application prospects in the fields of supply chain management, smart cities, and IoT device governance.
[0004] However, the high computing and storage requirements of blockchain are in conflict with the resource limitations of IoT devices. IoT devices are usually composed of relatively low-power end devices, with limited computing and storage capabilities. However, blockchain technology requires a large amount of computing power and storage space to verify and store data, which is in conflict with the resource limitations of IoT devices. In addition, IoT involves a large number of devices, which will cause the size of the blockchain network to expand rapidly. However, some consensus algorithms face the problem of processing a large number of transactions and data in a large-scale network, and the speed of consensus will decrease, the accuracy of consensus will decrease, the throughput of the blockchain will decrease, and the performance will decrease, resulting in delay and slow transaction processing speed.
[0005] In view of the pain points of the current blockchain consensus protocol in the field of IoT, therefore, the present application proposes a lightweight blockchain consensus protocol based on reputation weighted sampling in combination with the analysis of existing typical consensus protocols. SUMMARY
[0006] The purpose of the present application is to overcome the defects of the prior art and provide a lightweight blockchain consensus protocol implementation method based on reputation weighted sampling. The present application enables the blockchain system applied to IoT to use a lighter consensus protocol, thereby speeding up the consensus, improving the accuracy of the consensus, and thus improving the throughput of the blockchain.
[0007] The application is realized by the following technical solutions:
[0008] A lightweight blockchain consensus protocol implementation method based on reputation weighted sampling, which introduces a reputation mechanism based on a reputation coefficient and a sampling mechanism based on a confidence interval, uses a verifiable random function to realize the sampling process, and finally realizes the consensus process, specifically including the following steps:
[0009] (1) Sampling node number calculation
[0010] According to the total number of nodes N, the confidence level 1-α, the error range β and the proportion of Byzantine nodes p, the sample capacity n is calculated by the confidence interval, that is, the number of nodes to be sampled;
[0011] (2) Reputation mechanism:
[0012] Reputation coefficient 1-1: the reputation coefficient is a value with an upper limit of 1 or approaching to 1, and a lower limit approaching to 0, the closer to 1, the higher the reputation of the end node, and vice versa;
[0013] Reputation coefficient 1-2: a specific function is determined, which satisfies the characteristics of the reputation coefficient and can reflect the trend of slow reduction and rapid reduction of the reputation coefficient, and by adding or subtracting the value of the independent variable of the function, the function value is adjusted to achieve the purpose of adjusting the reputation coefficient;
[0014] Reputation score 2-1: the reputation score of all nodes is the same initially, and the end node can increase the reputation score by successfully participating in the consensus once, and decrease the reputation score by failing;
[0015] Reputation weight 1-1: the reputation weight is equal to the reputation coefficient multiplied by the reputation score, and the reputation weight of the end node is proportional to the probability of its sampling into the consensus;
[0016] (3) Node sampling:
[0017] Node sampling 1-1: the edge node selects n nodes from N nodes, and uses a verifiable random function to generate random numbers;
[0018] Node sampling 1-2: the weight of each end node is equal to its reputation weight divided by the sum of the total reputation weight of all nodes, and by generating random numbers, the number of sampling nodes is determined;
[0019] Node sampling 1-3: after determining the n sampling nodes, the edge node generates random numbers again to select the leader node in the sampling nodes;
[0020] (4) Consensus process:
[0021] Consensus process 1-1: The first two stages only need to be completed by the sampling nodes. After the sampling nodes have successfully reached consensus for two rounds, all nodes will reach consensus.
[0022] Consensus process 1-2: If consensus fails, the view replacement mechanism is triggered, the credibility coefficients of all end nodes in the sampling node are lowered, the credibility scores are deducted, and a new sampling phase is restarted;
[0023] Consensus process 1-3: If the consensus succeeds for k rounds, the reputation coefficients of all end nodes are restored, the reputation scores increase, and the nodes in the sampling node set receive a larger recovery reward, and a new sampling phase is restarted.
[0024] The determined specific function is a piecewise function or a continuous function.
[0025] The calculation formula for the number of nodes n is:
[0026]
[0027] Here, z is the critical value of the standard normal distribution.
[0028] The specific function is:
[0029]
[0030] f(x) is the dependent variable of the function, x is the independent variable of the function; e is a natural constant.
[0031] The advantages of the present invention are:
[0032] (1) This invention combines the idea of sampling with consensus. Through the confidence interval, it can greatly reduce the number of nodes participating in the first two stages of consensus, thereby reducing the time and computing overhead of the consensus process, thereby speeding up the consensus process, improving the accuracy of consensus, and increasing the throughput of the blockchain.
[0033] (2) The present invention proposes a reputation mechanism with dual functions of reputation coefficient and reputation score, which can control the probability of a node entering the sampling node according to the node's historical behavior, thereby preventing Byzantine nodes from controlling the consensus for a long time and reducing the proportion of Byzantine nodes entering the sampling node set. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a flow chart of the present invention;
[0035] Figure 2 Schematic diagram of the three-stage consensus of the present invention. DETAILED DESCRIPTION
[0036] like Figure 1 As shown, step 1-1 initial system parameter setting and calculation;
[0037] Step 1-2 designs a reputation coefficient function to meet the interval characteristics and trend characteristics (such as sigmoid function, piecewise function, etc.) of the reputation coefficient;
[0038] Step 1-3 designs the initial value of the reputation score and the reward and punishment amount of the node in the case of consensus success and failure, to ensure that the reward and punishment can reflect the significant change of the reputation score;
[0039] Step 1-4 determines the value of the confidence interval, the confidence and the error range, and calculates the number of sampling nodes;
[0040] As shown in the figure, the consensus protocol runs: Figure 2
[0041] Step 2-1 initializes all parameters of the edge device, and the initial reputation weight of all end nodes of the system is the same;
[0042] Step 2-2 generates random numbers by VRF (verifiable random function) in the edge device, and obtains the sampling node set by weighted random method;
[0043] Step 2-3 generates random numbers by VRF in the edge device, and selects the leader node in the sampling node set by weighted random method;
[0044] Step 2-4 broadcasts the sampling node information by the edge device, and the end node receives it and performs the three-stage consensus algorithm;
[0045] Step 2-5, if the consensus fails or the consensus succeeds for k rounds, the consensus view is changed, and the edge node calculates the new reputation weight of the end node according to the consensus behavior;
[0046] Step 2-6, repeat steps 2-2 to 2-5, and the system is stable and operates the consensus protocol.
[0047] The present application realizes a kind of in the scene of Internet of Things, can guarantee the success rate of block chain consensus, while improving the speed of consensus.The main innovation lies in the combination of sampling idea and consensus, the number of nodes in the first two stages of consensus is greatly reduced by confidence interval, thereby reducing the time and computing overhead of consensus process;At the same time, the reputation mechanism with double action of reputation coefficient and reputation score is proposed, which can control the probability of node entering the sampling node according to the historical behavior of node, so as to prevent the byzantine node from controlling the consensus for a long time, and reduce the proportion of byzantine node entering the sampling node set.The lightweight block chain consensus protocol based on reputation weighted sampling proposed in the present application, the method of transformation and improvement based on the present application also belongs to the protection scope of the present application.
Claims
1. A lightweight blockchain consensus protocol implementation method based on reputation-based weighted sampling, characterized by: By introducing a reputation mechanism based on reputation coefficient and a sampling mechanism based on confidence interval, and using a verifiable random function to implement the sampling process, the consensus process is finally achieved. Specifically, the following steps are included: (1) Calculation of the number of sampling nodes According to the total number of nodes N, the confidence level 1-α, the error range β and the Byzantine node ratio p, the sample capacity n is calculated through the confidence interval, which is the number of nodes that need to be sampled; (2) Reputation mechanism: Reputation coefficient 1-1: The upper limit of the reputation coefficient is 1 or close to 1, and the lower limit is close to 0. The closer it is to 1, the higher the reputation of the end node, and vice versa. Reputation coefficient 1-2: Determine a specific function that satisfies the characteristics of the reputation coefficient and reflects the trend of the reputation coefficient decreasing slowly first and then rapidly. By adding or subtracting the value of the independent variable of the function, the function value is adjusted accordingly to achieve the purpose of adjusting the reputation coefficient; Reputation score 2-1: All nodes have the same initial reputation score. Each time an end node successfully participates in a consensus, its reputation score increases, and if it fails, its reputation score decreases. Reputation weight 1-1: Reputation weight is equal to the reputation coefficient multiplied by the reputation score. The reputation weight of the end node is proportional to the probability of its sampling entering the consensus; (3) Node sampling: Node sampling 1-1: The edge node selects n nodes from N nodes and uses a verifiable random function to generate random numbers; Node sampling 1-2: The weight of each end node is equal to its reputation weight divided by the sum of the total reputation weights of all nodes. The sampling node number is determined by generating a random number; Node sampling 1-3: After determining n sampling nodes, the edge node generates a random number again to select the leader node among the sampling nodes; (4) Consensus process: Consensus process 1-1: The first two stages only need to be completed by the sampling nodes. After the sampling nodes have successfully reached consensus for two rounds, all nodes will reach consensus. Consensus process 1-2: If consensus fails, the view replacement mechanism is triggered, the credibility coefficients of all end nodes in the sampling node are lowered, the credibility scores are deducted, and a new sampling phase is restarted; Consensus process 1-3: If the consensus succeeds for k rounds, the reputation coefficients of all end nodes are restored, the reputation scores increase, and the nodes in the sampling node set receive a larger recovery reward, and a new sampling phase is restarted.
2. The method for implementing a lightweight blockchain consensus protocol based on reputation-based weighted sampling according to claim 1 is characterized in that: The determined specific function is a piecewise function or a continuous function.
3. The method for implementing a lightweight blockchain consensus protocol based on reputation-based weighted sampling according to claim 1, characterized in that: The calculation formula for the number of nodes n is: in, is the critical value of the standard normal distribution.
4. The method for implementing a lightweight blockchain consensus protocol based on reputation-based weighted sampling according to claim 1, characterized in that: The specific function is: f(x) is the dependent variable of the function, x is the independent variable of the function; e is a natural constant.
Citation Information
Patent Citations
Dual-channel consensus system and method of block chain, and computer readable storage medium
CN114048517A
Improved practical Byzantine fault-tolerant algorithm based on reputation value and verifiable random function
CN114978650A