An efficient PCN routing protocol based on node stability

By classifying nodes in the PCN network and building routing tables, combining multi-path search algorithms and scoring functions to optimize payment path selection, the problem of insufficient transaction success rate of existing PCN routing protocols is solved, and higher transaction success rate and lower transaction delay are achieved.

CN119676145BActive Publication Date: 2025-05-13ZHEJIANG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510180815.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-05-13
Estimated Expiration
2045-02-19

AI Technical Summary

Technical Problem

The existing PCN routing protocols have shortcomings in improving transaction success rate, especially in a dynamically changing stateful network environment, where channel state changes frequently, resulting in a low transaction success rate.

Method used

Using an efficient routing protocol based on node stability, by dividing PCN nodes into neighbor nodes, landmark nodes and beacon nodes, building a routing table to store routing-related information, using multi-path search algorithms and scoring functions to optimize payment path selection, and improving transaction success rate.

Benefits of technology

By comprehensively considering node distance, connectivity and stability, and optimizing the routing protocol, the PCN transaction success rate is significantly improved and transaction delay is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676145B_ABST
    Figure CN119676145B_ABST
Patent Text Reader

Abstract

The invention discloses a PCN efficient routing protocol based on node stability, including: dividing PCN nodes into neighbor nodes, landmark nodes and beacon nodes, constructing a routing table to store routing related information of the three types of nodes; after the routing table is initialized, when there is a transaction request in the network, using a multi-path search algorithm to find a feasible payment path between the source node and the sink node, and obtaining an alternative path set; for all feasible payment paths in the alternative path set, according to the historical transaction data and historical transaction weight of the channel on the payment path, using a scoring function to calculate the path score, and selecting a path with a high path score as the final payment path. The invention combines the node distance and connectivity characteristics in PCN and the stability of the nodes to improve the transaction success rate of PCN.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of blockchain, and in particular to a PCN efficient routing protocol based on node stability. Background Art

[0002] In order to solve the problem of insufficient scalability of blockchain, researchers are committed to designing secondary payment methods to transfer payments on the blockchain to off-chain, thereby alleviating the pressure of on-chain transactions. PCN is a technology that effectively transfers payments on the chain to off-chain, and has received widespread attention from researchers in recent years.

[0003] PCN is implemented based on smart contracts. The specific process is that the on-chain user submits the smart contract to the blockchain. The smart contract creates a payment channel for both parties of the smart contract off-chain. At the same time, both parties of the smart contract use part of the on-chain funds as the investment (funding transaction) for the transaction in the channel, allowing blockchain users to freely conduct commitment transactions (commitment transactions) in the channel. Transactions in the channel are actually the redistribution of channel funds. When any party in the payment channel wants to close the payment channel, it only needs to submit the latest commitment transaction to the blockchain, and the blockchain will divide the user assets on the chain according to the content of the commitment transaction. Through technical means such as encrypted digital signatures and the design of the signature process, the payment channel ensures that malicious users cannot embezzle the funds of normal users by declaring expired historical states. On-chain users can conduct multiple transactions in the payment channel off-chain, but when they are finally uploaded to the chain, only the channel fund status after the latest transaction will be submitted, which is equivalent to aggregating the results of multiple transactions, thereby reducing the number of transactions recorded in the blockchain.

[0004] When a PCN user wants to trade with a non-adjacent PCN user, he needs to use the payment channel between other users to complete the transaction.

[0005] At present, the research based on PCN mainly focuses on effectiveness, efficiency and privacy. Effectiveness refers to the ability to successfully execute a single transaction within the PCN, and the indicator indicating effectiveness is generally the transaction success rate. Efficiency refers to the execution speed of a single transaction and the transaction frequency within the network. The indicator for measuring transaction efficiency is usually the time delay of the transaction or the maximum number of hops of the transaction path (the number of intermediate nodes from the source node to the sink node). At this stage, the algorithm design generally does not use efficiency as the main improvement indicator, but usually as an auxiliary indicator of transaction effectiveness. In the algorithm design stage, the focus is on ensuring transaction effectiveness, and when testing the algorithm performance in the experimental stage, the transaction success rate and the maximum number of transaction hops / maximum transaction delay are measured to measure the effectiveness and efficiency of the routing algorithm. Privacy means that the private information of the transaction will not be leaked during the transaction process. Privacy can be divided into value privacy and identity privacy.

[0006] Unlike traditional networks, PCN is a stateful network. The link traffic in traditional traffic networks is a fixed value, and the network topology is stable. However, the payment capacity that the payment channel in PCN can carry will change after each payment. It is a dynamic update process. PCN nodes change more frequently than traditional networks. Users on the chain may create channels to enter the network at any time, and users in PCN may close channels and exit the network at any time. However, even in this dynamically changing environment, borrowing from the routing protocols in traditional networks is still a major direction for designing PCN routing algorithms.

[0007] At present, the main ways to improve the effectiveness of the PCN routing algorithm are: 1) Transaction splitting and multi-path transmission: split a transaction into multiple sub-transactions, and select a payment path for each transaction to make full use of the PCN transmission capacity. The advantage of this method is that the sub-transactions after splitting have low requirements on the carrying capacity of the payment channel, which not only reduces the possibility of transaction failure due to insufficient funds in a certain channel on the payment path, but also improves the ability of PCN to transmit large transactions. The disadvantage is that when a transaction fails, it is necessary to ensure the complete execution of the transaction by retransmitting it overtime or rolling back transactions on all other paths, which increases control overhead and routing complexity. 2) Redundant path: Redundant path is similar to multi-path transmission, but the general multi-path transmission requires that the sum of the amounts of all sub-transactions is consistent with the amount of the total transaction, while the transaction transmission of redundant paths does not require the total amount to be consistent in the path discovery stage, but in the actual payment stage, the paths with the same total amount are selected from all discovered connections, and transaction payments are made on these paths. The advantage of redundant payment is that it provides a greater fault tolerance solution, allowing the transaction receiver to select the path that supports the transaction more quickly. The disadvantage is that the value of the collateral when the path is established is increased, and the interests of some intermediate nodes are lost, because the establishment of a payment path in the form of HTLC requires funds as collateral, and these pledged funds cannot be used in other transactions. If the transaction is not completed in the end, the intermediate node loses the possibility of using this part of the funds to earn transaction benefits. 3) Selection and sorting scheme of transaction paths. The single-source shortest path algorithm, such as the classic Dijkstra algorithm, is usually used to select payment paths in PCN. Although short paths may increase the transaction success rate, in actual environments, the overall transaction success rate of PCN is affected not only by the path length, but also by the path success rate. If the shortest path happens to be a path with a low path success rate, that is, the recent transaction failure rate through this path is high, the number of times the transaction needs to be retransmitted is greater. The factors that affect the path success rate are mainly the allocation of channel funds of each node on the payment path, the reliability and stability of the node, and other factors. The reliability and stability of the node refers to the ability of the node to provide transaction routing for a long time and the ability of the payment path containing the node to be successfully completed. If a payment channel belonging to a certain node frequently transfers funds in the channel to the chain or frequently invests on-chain funds into off-chain channels, since the process involves the confirmation and redistribution of funds in the channel, the channel funds cannot be used during this period, which will cause transactions using this payment path to fail.

[0008] The existing PCN routing protocol solutions to improve transaction success rates are mainly focused on transaction splitting and multi-path transmission or redundant transmission. The stability and reliability of the channel are less considered. In fact, as a dynamically changing stateful network, changes in channel status may be very common. Summary of the invention

[0009] The present invention provides a PCN efficient routing protocol based on node stability, which integrates the node distance and connectivity characteristics in the PCN and the stability of the nodes to improve the transaction success rate of the PCN.

[0010] A PCN efficient routing protocol based on node stability, including:

[0011] PCN nodes are divided into neighbor nodes, landmark nodes and beacon nodes, and routing tables are constructed to store routing related information of the three types of nodes;

[0012] After the routing table is initialized, when there is a transaction request in the network, a multi-path search algorithm is used to find a feasible payment path from the source node to the sink node to obtain a set of alternative paths;

[0013] For all feasible payment paths in the alternative path set, the path score is calculated using a scoring function based on the historical transaction data and historical transaction weight of the channel on the payment path, and the path with a high path score is selected as the final payment path.

[0014] Furthermore, the neighbor node is a node whose hop distance to the current node is less than the set neighbor distance, and the hop count on the shortest path between nodes is used as the hop distance between nodes;

[0015] The landmark node is connected to 20-40 other PCN nodes, and the path obtained based on landmark routing is not the shortest path;

[0016] The beacon nodes are the 20-40 nodes closest to the current node in terms of node address distance; the node address is the hash value of the node identity information, and the node address distance is the XOR of the two node addresses.

[0017] Furthermore, a routing table is constructed to store routing related information of three types of nodes, specifically:

[0018] For neighbor nodes, the routing table stores the payment channels in which all neighbor nodes participate; for landmark nodes and beacon nodes, a routing table is constructed to store all valid path information to the landmark nodes and beacon nodes.

[0019] Furthermore, the routing table is initialized through several rounds of synchronization of routing information, thereby establishing an initial routing table.

[0020] Furthermore, the information update process in the routing table is as follows:

[0021] When the node and nodes Establish a new payment channel, exchange information in the routing table, and then the nodes According to the node The routing table finds the connected paths of beacon nodes, neighbor nodes and landmark nodes; the updated nodes Adjusting Nodes distance and add neighbor nodes ;

[0022] After the update is completed, the node The incremental information in its routing table is only notified to the nodes directly connected to it, rather than to all neighboring nodes, to prevent neighboring nodes from receiving the same update information.

[0023] Furthermore, a multi-path search algorithm is used to find feasible payment paths from the source node to the sink node, and a set of candidate paths is obtained, which is as follows:

[0024] The routing tables of the source node and the sink node are merged, and according to the neighbor node channel information of the merged routing table, a multi-path search algorithm is used to search for the transmission path between the source node and the sink node, and the transmission path is put into the candidate path set as a feasible payment path;

[0025] Determine whether the number of paths in the candidate path set reaches the preset value. If so, it is used as the final candidate path set. If not, find out whether there are overlapping landmark nodes in the routing tables of the source node and the sink node. If there are overlapping landmark nodes, and the length of the feasible payment path found through the landmark node is less than the set value, add the feasible payment path to the candidate path set.

[0026] It is determined again whether the number of paths in the alternative path set reaches the preset value. If it reaches the preset value, it is used as the final alternative path set; if it does not reach the preset value, a feasible payment path is discovered through the beacon node and added to the alternative path set.

[0027] Furthermore, the path with a high path score is selected as the final payment path, specifically:

[0028] Arrange the path scores of feasible payment paths from high to low and select the one with the highest score. The feasible payment paths are included in the payment path set, and the final payment path among them is used for transactions.

[0029] Furthermore, the scoring function is based on the weighted payment path length The reciprocal of is returned as the value, which is the length of the weighted payment path. The calculation formula is:

[0030] ;

[0031] in, The length of the payment path at the last success; is the historical transaction weight; is the expected failure path length, which is calculated by accumulating the transmitted paths when all channels fail.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] 1. The present invention divides PCN nodes into three types of nodes: neighbors, landmarks, and beacons. Different processing procedures are adopted in the routing link according to the characteristics of different nodes to improve the efficiency of routing discovery.

[0034] 2. The present invention uses the existing multi-path search algorithm to find the transmission path from the source node to the sink node; after obtaining the candidate path set, the path score is calculated according to the historical transaction data of the channel on the payment path and the designed scoring function, and the function with a high path score is selected as the final payment path. Since the fund allocation status of each channel in the PCN is uncertain and the stability of the channels varies from one another, the scoring function reflects the ability of the node to transmit stably based on the historical successful transaction rate, providing a way to evaluate the effectiveness of path transactions. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is an implementation flow chart of the present invention.

[0036] Figure 2 This is the network topology used when searching for payment paths in the embodiments of the present invention. DETAILED DESCRIPTION

[0037] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be pointed out that the embodiments described below are intended to facilitate the understanding of the present invention and do not have any limiting effect on the present invention.

[0038] The present invention designs an efficient PCN routing protocol based on node stability. Based on the design concept of a hybrid routing protocol, the dynamic and rapidly changing information in PCN (such as the allocation status of funds in a channel, the transaction fees charged by the channel, and the historical transaction success rate of the channel) and relatively stable information (whether the channel exists in the network graph topology structure) are considered, and a node scoring mechanism is introduced to measure the stability of the node, so as to optimize the routing performance of the PCN routing protocol, improve the transaction success rate in PCN and reduce transaction delay.

[0039] Hybrid routing protocols are a balance between passive routing protocols and active routing protocols. Active routing protocols require each node to update the routing table every time the network information changes to ensure that the routing information is true and valid. Passive routing protocols only update the routing table when it is necessary to update. For example, when the carrying capacity of a link in the network decreases or a routing update event occurs, the node in the active routing protocol will notify other reachable nodes in the routing table of the change in the link information, while the passive routing protocol maintains the routing table unchanged. If the path is selected during the routing process and the path cannot meet the transmission requirements, the passive routing protocol will update the routing table and reroute. The advantage of active routing is that the selected path is real and reliable, and the disadvantage is that the overhead of maintaining the routing table increases with the increase in the number of nodes, and the management method of maintaining the routing table is more complicated than that of passive routing protocols. On the contrary, passive routing protocols do not need to maintain huge control overhead, but the time to calculate the effective path during routing may be slower, because the selected path of the passive routing protocol may be invalid during the route discovery phase, and the routing table needs to be updated and re-routed.

[0040] Taking the Lightning Network as the data representative of PCN, the Lightning Network data statistics website (1ml.com) shows that the number of nodes in the network changes at an average monthly rate of about 1%-2%, and the number of channel states updated daily is close to the number of channels in PCN. Assuming that most PCN channels have the same update frequency except for the channels (key channels) that are frequently selected in the routing protocol, this means that each channel may be updated every day. Relative to the change in the number of PCN nodes, the PCN channel state changes more frequently and the maintenance overhead is greater. Therefore, in the process of routing design, the channel state is used as information collected by passive routing. When the channel state changes, the update information will not be broadcast to the local network, but only collected during routing. On the contrary, the control overhead of maintaining the routing information of whether the PCN node exists or not is small, and active routing is used for collection.

[0041] The present invention divides PCN nodes as a whole into three types, namely neighbor nodes, landmark nodes and beacon nodes. Neighbor nodes are nodes that are closer to the current node in hops, and the number of hops on the shortest path between nodes can be used as the hop distance between nodes. Landmark nodes have the characteristic of wide connection. Landmark nodes are usually connected to a large number of other PCN nodes. The probability of discovering other nodes through landmark nodes is higher, but the path obtained based on landmark routing is usually not the shortest path. The beacon node is closer to the current node in the node address space. The node address is another set of indicators for measuring node distance. Different from using the shortest path hops between nodes to measure node distance, the node address is a hash value of the node identity information. The node address distance is the XOR of the two node addresses: Beacon nodes are close in the node address space, but may be far away in hop distance.

[0042] The routing table needs to store the routing related information of the above three types of nodes: For neighbor nodes, the routing table stores the payment channels participated by all neighbor nodes, and the range of neighbor nodes is calculated by neighbor distance. Limit, all hop distances less than All nodes in the routing table are considered as neighbor nodes. For landmark nodes and beacon nodes, the routing table stores all valid path information to the node. When the routing table is initialized, several rounds of routing information synchronization are required to establish the initial routing table.

[0043] like Figure 1 As shown in the figure, the active routing module is responsible for collecting topological information of different types of nodes (neighboring nodes, landmark nodes, beacon nodes), including channel capacity and node information at both ends of the channel. The passive routing module is responsible for collecting transaction-sensitive information of the node, including transaction routing fees and the fund allocation status within the channel, that is, the funds held by the node in the channel. and nodes Establishing new payment channels , exchange information in the routing table with each other, and then Will be based on The routing table discovers the connectivity paths among beacon nodes, neighbor nodes, and landmark nodes. Figure 1 Updated Node Will adjust neighbor nodes distance and add neighbor nodes After the update is complete Notify the nodes directly connected to it of the incremental information in its routing table. The reason why it does not notify all neighboring nodes is to prevent neighboring nodes from receiving the same update information. and Send routing table update messages to neighboring nodes ,but The same routing table update message may be received, resulting in unnecessary control overhead.

[0044] The selection criteria of the three types of nodes are different, and the probability of being selected into the payment path in different scenarios is also different. The characteristics of neighbor nodes are that the physical hop count from the current node is small and the number of channels passed by the path is small. When the hop count from the target node to the current node is also small, there is a greater possibility of directly discovering a sufficient number of payment paths in the routing table after the source node and the sink node are spliced. When only neighbor nodes participate in route discovery, the number of hops obtained for the payment path is generally small, and when other conditions of PCN are similar, the longer the payment path, the lower the success rate, and the shorter the payment path, the higher the success rate. Therefore, it is ideal and the routing effectiveness is higher to use only the neighbor nodes of the source node and the sink node as intermediate nodes. When the payment path cannot be obtained by searching the neighbor nodes of both parties, beacon nodes and landmark nodes are required to become intermediate nodes to find the payment path with them as intermediaries. Beacon nodes show randomness in both connectivity and hop count, while landmark nodes require nodes to have extensive connectivity. Extensive connectivity means that through landmark nodes, paths to the target node can generally be found, but the reasonable length of the path is not guaranteed.

[0045] like Figure 2 As shown, the network topology used when searching for payment paths in an embodiment of the present invention is shown. , the red edge represents the newly established payment channel, the letters represent the node name, and the numbers represent the node address.

[0046] Consider Figure 2 Search for a slave node To Node Ideally, the payment path can be discovered only through neighbor nodes. If the value is 2, the payment path cannot be found. and The node's routing table is based on the overlapping landmark nodes Search the payment path and get a payment path with 6 hops. Since this path is not necessarily the shortest payment path, Figure 2 It can be seen that w can find a better path through its own beacon node x In this example, randomly distributing beacon nodes in the topology graph helps to find payment paths with shorter path lengths. Nodes with strong connectivity in a small-world network usually show clustering, and newly added nodes tend to establish connections with nodes with higher degrees. Assume Figure 2 The network in has the property of a small-world network. New nodes tend to establish connections with node y, making node y a landmark node for node w in the subsequent routing update. Then the payment path connecting node z discovered by w through y is The number of hops is 8, which is much longer than the shortest path with 5 hops found through beacon node x. In the routing selection phase, the payment path is first discovered based on the landmark nodes. If the payment path is too long and exceeds the set maximum payment path length threshold, a shorter payment path is then attempted through the beacon nodes.

[0047] The graph structure of PCN is express, Midpoint The routing table is denoted as ,node The capacity is The channel is denoted as , the shortest hop distance between nodes is recorded as ,node The path is recorded as , the routing table stores the paths to beacon nodes and landmark nodes as well as payment channels containing neighboring nodes. The communication process of establishing a routing table is as follows:

[0048] ① From Remove For repeated channels, for non-repeated channels , calculate the channel based on the merged routing table information The distance from each end node to node v and .

[0049] ② If the node to node at both ends of the channel The minimum distance , then add the channel to .

[0050] ③ Routing table Landmark nodes in ,like Not Available Repeated in the splicing path and As a node To the landmark node The initial path of for and The shortest path between .

[0051] ④Judgment arrive Path Does it exist on Neighbors' Day Point, if present, is compared go through arrive Is the distance less than the currently stored and The shortest distance between If it is less than, update and .

[0052] ⑤ Determine the path obtained Is the length lower than the set landmark path length threshold? If it is less than this value, the landmark node will be added to middle.

[0053] The above communication process ensures that the path to the landmark node in the routing table is not too long, and all channels have at least one end node as a neighbor node. The update process of the beacon node, this design refers to the update process of Beacon_Update in the PCN routing protocol Flare, which will not be repeated here.

[0054] After the routing table is established, when there is a transaction request in the network, the path selection module will first merge the routing tables of the source node and the sink node, and search whether there are sufficient feasible paths between the source node and the sink node based on the neighbor node channel information of the merged routing table. If a sufficient number of feasible paths can be found, the path sorting link will be directly entered. If there are no sufficient number of feasible paths, the routing tables of the source node and the sink node will be checked for overlapping landmark nodes. If there are overlapping landmark nodes and the length of the payment path found through the landmark node meets the requirements, the routing sorting link will be directly entered. Otherwise, the payment path will be found through the beacon node until the number of attempts of the beacon node reaches the upper limit or a sufficient number of payment paths are found, and then the path sorting link will be entered.

[0055] In the path sorting stage, the historical transaction data of the channel is found from the scoring module, and the payment path is scored according to the set weight and historical transaction data. If the score is high enough, it is directly selected as the final payment path, otherwise it is temporarily retained in the alternative path.

[0056] The entire process of route selection and route sorting is as follows:

[0057] ①Merge source nodes Sink Node Routing table and , using a path finding algorithm Discover the path set based on the channel containing neighbor nodes and the alternative path The existing mature multi-path algorithms include max-flow, push-relabel and shortest If the number of candidate paths is sufficient, jump to ④.

[0058] ②From the routing table and The intersection of the landmark nodes is recorded as , search for landmark nodes that have not been searched . Connection Path and Get new path , if the path If the length of the path is less than the set value, Add it to the alternative path set. If the number of alternative path sets is sufficient after adding, jump to ④.

[0059] ③From the routing table Select the unselected nodes from the beacon nodes ,merge and , and then ) whose length does not exceed The result is incorporated into the set of alternative paths, and the processing process is similar to ①.

[0060] ④Based on the historical transaction data in the scoring module and historical transaction weight , use the scoring function defined in the present invention to give the paths in the candidate path set Score, if you score If the number of payment path sets exceeds a certain value, they will be directly included in the returned results. , directly enter ⑤.

[0061] ⑤ Determine whether the number of payment paths has reached If yes, return directly, otherwise, the alternative paths are concentrated in descending order of scores. Path to The paths are added to the payment path set and the results are returned.

[0062] The node scoring module is responsible for providing historical data of nodes on the payment path during routing sorting and scoring the payment path accordingly. The fund allocation status of the channel in PCN is private, which means that nodes outside the channel cannot know the payment capacity of the channel in a specific direction. In the process of route discovery, the routing algorithm selects feasible paths according to the channel capacity. However, the path screened in this way cannot guarantee that the channel on the selected path has the ability to pay for the transaction, especially when the payment flow is in the form of an acyclic graph, the funds in the PCN channel will eventually gather at one end. Traditional routing protocols will lock the funds in the channel as a transaction guarantee during the HTLC establishment phase. This part of the funds is pledged in the HTLC as collateral for the transaction. It cannot be used for other transactions before the timer triggers a timeout event or before the transaction is completed, thereby ensuring that the path after the HTLC is established has the ability to pay for the transaction. The specific principle of HTLC refers to the Lightning Network White Paper, which ensures that the payment from the sink node to the source node is sequential and atomic. The establishment of HTLC requires time cost. Due to the atomicity of HTLC, if the fund allocation status of a channel does not allow the establishment of HTLC in the payment direction during the gradual establishment of HTLC from the sink node to the source node, all established HTLCs will fail. In addition, even if the fund allocation in the channel allows all channels on the path to establish HTLC, there may still be fund allocation disputes between node pairs in a channel during the routing process, resulting in the need for on-chain fund confirmation. In the fund confirmation link, the node pairs cannot change the fund allocation in the channel through commitment transactions. If the HTLC is transmitted to the channel during this period, the transaction will fail and all transactions that have occurred on the payment path will be rolled back. In addition to these two cases, HTLC timeout caused by node offline and the presence of malicious nodes in the channel will also cause HTLC failure. Routing simulation data shows that the routing success rate of the Lightning Network is indeed at a low level, usually not exceeding 40%.

[0063] There is a theoretical analysis of the potential number of retransmissions of transactions by inferring the state of fund allocation in the node based on the node's historical transaction data. This invention introduces a path sorting algorithm based on the node's historical transaction success rate. For a selected payment path, channel The historical transaction success rate is recorded as , payment path The path transaction success rate is , assuming that the historical transaction success rate over a certain period of time can reflect the future short-term transaction success rate. Path success rate Expressed as the channel's historical success rate:

[0064] ;

[0065] The payment path has a success rate Retransmission required The probability of (before Failures):

[0066] ;

[0067] Remember that it satisfies the Bernoulli distribution A random variable exist of for:

[0068] ;

[0069] Assume that the path success rate is equal for each retransmission, that is, Both , then the path Retransmission The probability of It can be expressed as , this probability distribution satisfies the negative Bernoulli test. Negative Bernoulli test means that the Bernoulli test is continued until k successes occur. The test appeared successes, the last trial must be successful, then the probability is According to the research results of negative Bernoulli test, The expected value of ,when When When the test succeeds once, . So in the payment path Retransmission The expectation is .

[0070] Before Assumption The location of the failed channel is distributed according to the ratio of the failure probability of each channel, that is, in the channel The number of failures for:

[0071] ;

[0072] Since each payment failure is retransmitted on the same path Then the expected number of retransmissions is , the source node is , the sink node is Payment path , in the channel When it fails, the length of The expected silence cost is the expected failure path length. for:

[0073] ;

[0074] According to the weight set , and obtain the weighted payment path length of the present invention:

[0075] ;

[0076] in, The length of the payment path at the time of the last success.

[0077] Summarizing the above steps, we can obtain the scoring function algorithm of the present invention. The scoring function is based on the weighted path length. The reciprocal of is used as the return value. The higher the score, the shorter the path length. The high-score path is preferred:

[0078] Summarizing the above process, Figure 1 As shown, the steps of discovering the payment path for a transaction using the present invention include:

[0079] ① The transaction initiator inputs transaction-related information to the passive routing module, including the initiator of the transaction , Receiver , Transaction Amount , additional transaction fees , the number of parallel transaction paths and other transaction related information.

[0080] ② The passive routing module discovers a set of alternative payment paths based on transaction-related information and information in the routing table. .

[0081] ③ The node scoring module evaluates the candidate path set based on the node’s historical transaction data. Score the paths in The set of payment paths that meet the conditions .

[0082] ④Return payment path set , use the path to establish HTLC to complete the transaction.

[0083] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A PCN efficient routing protocol based on node stability, characterized in that: include: PCN nodes are divided into neighbor nodes, landmark nodes and beacon nodes, and routing tables are constructed to store routing related information of the three types of nodes; The process of updating information in the routing table is as follows: When the node and nodes Establish a new payment channel, exchange information in the routing table, and then the nodes According to the node The routing table finds the connected paths of beacon nodes, neighbor nodes and landmark nodes; the updated nodes Adjusting Nodes distance and add neighbor nodes ; After the update is completed, the node Notify only the nodes directly connected to it of the incremental information in its routing table, rather than all neighboring nodes, to prevent neighboring nodes from receiving the same update information. After the routing table is initialized, when there is a transaction request in the network, a multi-path search algorithm is used to find a feasible payment path from the source node to the sink node to obtain a set of alternative paths; For all feasible payment paths in the alternative path set, the path score is calculated using a scoring function based on the historical transaction data and historical transaction weight of the channel on the payment path, and the path with a high path score is selected as the final payment path; among which, the historical transaction data is the node's historical transaction success rate.

2. The PCN efficient routing protocol based on node stability according to claim 1 is characterized in that: A neighbor node is a node whose hop distance to the current node is less than the set neighbor distance. The hop count on the shortest path between nodes is used as the hop distance between nodes. Landmark nodes are connected to 20-40 PCN nodes, and the path obtained based on landmark routing is not the shortest path; The beacon nodes are the 20-40 nodes closest to the current node in terms of node address distance; the node address is the hash value of the node identity information, and the node address distance is the XOR of the two node addresses.

3. The PCN efficient routing protocol based on node stability according to claim 1 is characterized in that: A routing table is constructed to store routing related information of three types of nodes, specifically: For neighbor nodes, the routing table stores the payment channels in which all neighbor nodes participate; for landmark nodes and beacon nodes, a routing table is constructed to store all valid path information to the landmark nodes and beacon nodes.

4. The PCN efficient routing protocol based on node stability according to claim 1 is characterized in that: The routing table is initialized through several rounds of synchronization of routing information to establish the initial routing table.

5. The PCN efficient routing protocol based on node stability according to claim 1 is characterized in that: Use the multi-path search algorithm to find the feasible payment path from the source node to the sink node and obtain the candidate path set, which is as follows: The routing tables of the source node and the sink node are merged, and according to the neighbor node channel information of the merged routing table, a multi-path search algorithm is used to search for the transmission path between the source node and the sink node, and the transmission path is put into the candidate path set as a feasible payment path; Determine whether the number of paths in the candidate path set reaches the preset value. If so, it is used as the final candidate path set. If not, find out whether there are overlapping landmark nodes in the routing tables of the source node and the sink node. If there are overlapping landmark nodes, and the length of the feasible payment path found through the landmark node is less than the set value, add the feasible payment path to the candidate path set. It is determined again whether the number of paths in the alternative path set reaches the preset value. If it reaches the preset value, it is used as the final alternative path set; if it does not reach the preset value, a feasible payment path is discovered through the beacon node and added to the alternative path set.

6. The PCN efficient routing protocol based on node stability according to claim 1, characterized in that: The path with the highest path score is selected as the final payment path, specifically: Arrange the path scores of feasible payment paths from high to low and select the one with the highest score. The feasible payment paths are included in the payment path set, and the final payment path among them is used for transactions.

7. The PCN efficient routing protocol based on node stability according to claim 1 is characterized in that: Scoring function based on weighted payment path length The reciprocal of is used as the return value, and the calculation formula for the weighted payment path length L is: ; in, The length of the payment path at the last success; is the historical transaction weight; is the expected failure path length, which is calculated by accumulating the transmitted paths when all channels fail.

Citation Information

Patent Citations

  • Blockchain flux improvement method and system based on off-chain channel routing evaluation mechanism

    CN110992177A