A Fast and Secret Leader Election Method for Lightweight Blockchain Networks
By leveraging the characteristics of signal path loss and power calculation, secret leader elections are realized in lightweight blockchain networks, solving the problem of high demand for equipment performance in the existing technology, and improving network security and election efficiency.
Patent Information
- Application Number
- CN202510075136.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-01-17
AI Technical Summary
The existing hidden leader election technology is difficult to apply in lightweight blockchain networks, mainly due to the reliance on a large number of encryption and decryption operations and communication processes, resulting in high demand for device performance.
By leveraging the characteristics of signal path loss and power calculation, the secret leader election of nodes is realized, and the encryption and decryption operations are avoided and the equipment performance needs are reduced. Specific steps include server and node initializing network information, server broadcasting signals, nodes calculate road loss and participate in elections, server monitoring channel calculates power and election termination signals, etc.
It significantly reduces the demand for device performance of lightweight blockchains, expands application scenarios on performance-constrained devices, and improves the security of blockchain networks, avoiding the risk of openness of leader information and network attacks.
Smart Images

Figure CN119520215B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer networks and relates to a method for quickly electing a secret leader for a lightweight blockchain network. Background Art
[0002] In blockchain technology, the leader election algorithm is the core of the consensus mechanism. Figure 1 As shown in the figure, the formula node links various IoT systems and records the core data of the system. The leader election algorithm is responsible for selecting leaders from the formula nodes in each block proposal round to decide the next block to be added to the blockchain main chain. With the increasing attention paid to the energy consumption of blockchain, the optimization of the leader election algorithm has become particularly important to reduce energy consumption and improve efficiency.
[0003] The design of the leader election algorithm must take into account the efficient use of resources, avoid high energy consumption, and be able to adapt to the growing size of the network. Fairness and transparency are also important considerations in algorithm design to ensure the rights and interests of all participants in the election process.
[0004] The traditional Proof of Work (PoW) consensus mechanism has been criticized for its waste of resources and inefficiency. PoW obtains the right to record accounts through computing power competition, which leads to huge electricity consumption and potential impact on the environment. To solve this problem, many new consensus mechanisms have been proposed, such as Proof of Stake (PoS), Delegated Proof of Stake (DPoS), etc., which aim to reduce energy consumption while maintaining the security and decentralization of the network.
[0005] In order to deal with the high energy consumption problem in the blockchain leader election algorithm, researchers have proposed a variety of optimization strategies. First, the introduction of a verifiable random function (VRF) can safely and efficiently select block producers and validators in nodes, reducing energy consumption. The Raft algorithm improves consensus efficiency and system stability by optimizing the node information replication process, adjusting the leader election mechanism, and adopting a log replication strategy based on the dispatching idea.
[0006] The mainstream leader election algorithm focuses on quickly selecting a leader through fierce competition. This process inevitably leads to the disclosure of leader information, which makes the leader's information exposed to the entire network, thereby increasing the risk of network attacks. In view of this, scholars have proposed the secret leader election technology (SSLE), which ensures that network nodes can elect a leader while other nodes cannot obtain the leader's information, so we call it a secret leader.
[0007] However, the existing hidden leader election technology relies on a large number of encryption and decryption operations and communication processes, which means that there must be a powerful server in the network. Therefore, this solution is difficult to apply in a lightweight distributed blockchain network. Summary of the Invention
[0008] In view of the above technical problems, the present invention provides a method for hidden leader election for a lightweight blockchain network, which is realized through the following technical solutions:
[0009] A method for fast hidden leader election for a lightweight blockchain network, the method comprising:
[0010] S1: The server and nodes initialize the basic network information;
[0011] S2: The server broadcasts a signal to all nodes in the network at a predetermined power;
[0012] S3: The node calculates the path loss between it and the server according to the power of the received signal and the predetermined power. The node participates in the election with a certain probability, randomly and uniformly generates an ID within a predetermined range, and sends a signal at a certain power;
[0013] S4: The server monitors the channel, calculates the sum of the powers of the received signals, and sends the sum of the received powers to all nodes, and monitors the election termination signal. If there is a termination signal, then the election stops;
[0014] S5: The node monitors the channel, determines whether it becomes the leader according to the sum of the powers. If so, then it sends a termination signal, otherwise it continues with S3.
[0015] Further, in step S1:
[0016] The basic network information includes the predetermined signal transmission power of the server , the number of network nodes , the minimum number of competing nodes , the ID scaling factor , the maximum number of election rounds , the termination signal coefficient .
[0017] In step S3:
[0018] The path loss from node v to the server is , the probability of the node participating in the election is , where , the predetermined generation range of the node ID is , the power of the node sending the signal .
[0019] In step S4:
[0020] The termination signal is that the sum of the termination signals received by the server is greater than .
[0021] In step S5:
[0022] The leader judgment rule is that if the square of its own ID multiplied by 2 is greater than or equal to half of the sum, then the node becomes the leader, and the transmission power of the termination signal is , where is a random number generated in the interval . Beneficial effects
[0023] (1) The present invention utilizes the characteristics of signal path loss and power calculation to ensure that the ID of each node cannot be eavesdropped, avoiding the need for nodes and servers to perform encryption and decryption operations to ensure message security, significantly reducing the requirements of the lightweight blockchain for device performance, and thus expanding the application scenarios of the lightweight blockchain on devices with limited performance.
[0024] (2) The present invention aims to further enhance the security of the blockchain network. The algorithm can elect a hidden leader node, avoiding attacks such as leader-based denial of service, and proposes an election mechanism to ensure that the leader hides its own information, thus effectively avoiding attacks by malicious nodes.
[0025] (3) Since we can ensure that the algorithm can generate unique IDs for each node with a high probability, the present invention can efficiently complete the leader election process within a constant number of rounds; compared with traditional leader election algorithms, the present invention greatly improves the probability of electing a leader within a constant number of rounds. Given that the current communication technology can complete one round of election within milliseconds, the present invention can therefore achieve the election of a hidden leader within milliseconds. Description of the drawings
[0026] Figure 1 is the architecture diagram of the blockchain system;
[0027] Figure 2 is the flowchart of the method of the present invention. Detailed implementation manners
[0028] In order to make the purpose, technical solutions and advantages of the present invention clearer, the following will further describe the present invention in detail with reference to the attached Figure 2 drawings and 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.
[0029] See Figure 1-2As shown in the figure. A method for fast election of a hidden leader for a lightweight blockchain network, the method comprising:
[0030] S1: The server and network nodes initialize the basic network information, including the signal transmission power agreed upon by the server , the number of network nodes , the minimum number of candidate nodes , the ID scaling factor , the maximum number of election rounds , the termination signal coefficient .
[0031] Specifically, in the stage of initializing network information, the server and nodes can complete the exchange of information through network communication. Specifically, the server first broadcasts the set parameters to all nodes in the network. All nodes obtain the IP address of the server based on the received message and send their device information. The server calculates the number of nodes in the network , and broadcasts the number of nodes to all nodes in the network again.
[0032] S2: The server sends a signal according to the agreed power and starts listening to the channel.
[0033] Specifically, the server can use a communication chip to send a signal at a specified power. The communication chip controls the output power of the signal through a radio frequency power amplifier (PA). In order to obtain the total signal power of candidate nodes, the radio frequency signal amplitude is sampled through a detection circuit or ADC, the signal amplitude is converted into a digital quantity, and the signal power is calculated for monitoring the power intensity of the signal.
[0034] S3: The node calculates the path loss between itself and the server , the probability of participating in the election . If the node chooses to participate in the election for the leader, then it changes to a candidate node.
[0035] Specifically, assume that the current node is node . After the server broadcasts a signal at the agreed power , the signal power monitored by node is . According to the signal-to-interference-plus-noise ratio, the path loss represents the attenuation multiple of the signal from the transmission location to the reception location, obtained from the ratio of the agreed power to the received signal power, which is a conventional technique.
[0036] The probability of the node participating in the election adopts aiming to control the number of candidate nodes within . Specifically, we let the indicator variable indicate whether node participates in the leader election. Let the random variable be the sum of all node decisions. Since the node's election probability , and takes the and maximum value, it can be concluded that the expected value of the random variable is . Combining with the Chernoff inequality, we can obtain and . Because the number of nodes in this network is often very large, it can be guaranteed that the number of candidate nodes is very likely to be within .
[0037] S4: The candidate node randomly and uniformly generates its own within the range , and sends a signal according to the power .
[0038] The ID generation range described above can ensure that there is at least one round in which the IDs of candidate nodes are all different. Specifically, we set the random variable to indicate that the IDs generated by node and node conflict. Since the ID generation range of the node is , then the probability of conflict in one round is:
[0039]
[0040] Then the probability of having ID-conflicting nodes among all nodes is:
[0041]
[0042] After , the probability that there are still ID conflicts is . Also, because is very large, it can be guaranteed that with a very high probability, there is at least one round in which the IDs generated by all candidate nodes do not conflict.
[0043] The transmission power described above can ensure that when the IDs of all nodes do not conflict, when the signal sent by the largest node is monitored by the server, its signal value satisfies , where is the sum of the signal transmission powers of all candidate nodes monitored by the server. Specifically, due to signal loss, the server receives the node The signal power of is such that the sum of the signal powers received by the server is , where is the set of all candidate nodes. According to we can obtain , so it is easy to get .
[0044] S5: The server receives the signals sent by all candidate nodes and calculates the sum of the powers , and broadcasts the sum of the powers to all nodes in the network.
[0045] Specifically, the detection of the signal strength in this process can be implemented using the signal listening technology described in S3. The broadcast of the message can be completed using the UDP protocol. Specifically, a program for receiving messages is defaultly run on the node, the server sets the format of the broadcast data packet, and after the message is broadcast, the node can receive the data packet and parse the content of the data packet to obtain the message broadcast by the server.
[0046] S6: The candidate nodes listen to the channel. If they receive the message , and , then this node becomes the covert leader; otherwise, it remains a candidate node.
[0047] It has been proven in step S4 that when the IDs of the candidate nodes do not conflict, there is exactly one node that satisfies , and then this node can become the leader, and at the same time satisfies covertness (all nodes do not know the IDs of other nodes) and uniqueness (only one node satisfies this property).
[0048] S7: The covert leader sends a termination signal with power , where is a random integer generated within the interval , and the candidate nodes send termination signals with power .
[0049] The technology of sending signals with a specified power is the same as that used in step S2. If no leader is elected in this round, then all nodes send signals with power . If a covert leader node is elected, then the power of sending the signal is slightly larger than that of other nodes. Therefore, we set a random amplification parameter to make the distinction.
[0050] S8: The server calculates the sum of the received termination signals. If it is greater than , then the election is terminated and the covert leader is generated; otherwise, continue from S3.
[0051] Specifically, if no leader is elected in a round, the power signals sent by all nodes are , and the signal power received by the server is . On the contrary, since the signal power sent by the leader is greater, the signal power received by the server is greater than . The server can determine whether there is a hidden leader based on this threshold. If there is already one, the leader election process can be stopped.
[0052] The leader election method proposed by the present invention demonstrates remarkable flexibility and efficiency, and can adapt to network environments with extremely different performances. By introducing the function of custom rounds , the present invention greatly reduces the requirements for device performance. For networks with uneven performances, it can determine the performance range suitable for the network by adjusting parameters, thus ensuring the flexibility and efficiency of the method.
[0053] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification is only the principle of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.
Claims
1. A fast election method for secret leader nodes in a lightweight blockchain network, characterized by: S1: The server and the node initialize basic network information; the basic network information includes the server's agreed signal transmission power 、Number of network nodes , minimum number of election nodes , ID scaling factor , Maximum election round , termination signal coefficient , N is the number of nodes in the current network; S2: The server broadcasts a signal to all nodes in the network at an agreed power; S3: The node calculates the path loss between it and the server based on the power of the received signal and the agreed power. The node participates in the election with a certain probability, randomly and evenly generates an ID according to the agreed range, and sends a signal with a certain power. The path loss to the server is ,node The probability of participating in the election is ,in ,node ID, that is The agreed generation range is , the power of the signal sent by the node ; S4: The server monitors the channel, calculates the power sum of the received signals, sends the received power sum to all nodes, and monitors the election termination signal. If there is a termination signal, the election is stopped. S5: The node monitors the channel and determines whether it becomes the leader node based on the power and if so, it sends a termination signal, otherwise it continues with S3.
2. According to the method for fast election of secret leader nodes for lightweight blockchain networks in claim 1, it is characterized in that, in step S4: the termination signal is the sum of the termination signals received by the server is greater than .
3. According to the method for fast election of secret leader nodes for lightweight blockchain networks according to claim 2, Its characteristic is that step S5 In: The leadership node judgment rule is if the node satisfy , then the node can become the leader node, where G is the sum of the signal powers of all candidate nodes monitored by the server, and the sending power of the termination signal is ,in For the interval Generates random numbers.
4. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein the program controls the device where the non-volatile storage medium is located to execute the method according to any one of claims 1 to 3 when the program is executed.
5. An electronic device, characterized in that: It comprises a processor and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein the computer-readable instructions execute the method described in any one of claims 1 to 3 when executed.