Deterministic routing algorithm and system for high-concurrency payment channel network
By obtaining a set of candidate paths and pre-calculating intermediary fees through a deterministic routing algorithm, the problem of transaction failure in payment channel networks is solved, achieving high success rate, low latency, and low cost transactions.
Patent Information
- Application Number
- CN202311414978.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-10-27
AI Technical Summary
Existing payment channel network routing algorithms cannot accurately measure the occupancy of channel balances for other transaction pairs in the network, leading to transaction failures. Furthermore, they do not consider intermediary fees, resulting in inaccurate path calculations and unreasonable costs.
A deterministic routing algorithm is provided, which obtains a set of candidate paths and performs path probing, pre-calculates the intermediary fee, declares the amount occupied when sending a transaction request to the intermediary node, the intermediary node reserves the balance, updates the path balance information, and prioritizes the low-cost path for the transaction.
It improves transaction success rate, reduces transaction latency and costs, and ensures the accuracy and cost-effectiveness of transactions during path detection and transmission.
Smart Images

Figure CN117459446B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of payment network technology, and specifically to a deterministic routing algorithm and system for high-concurrency payment channel networks. Background Technology
[0002] A payment channel network refers to a collection of payment channels among a large number of nodes. It allows parties to a transaction who cannot directly establish a payment channel to complete the payment through a third-party node forwarding. Before a node without a direct payment channel can initiate a transaction, it needs to find one or more payment paths in the payment channel network. The transaction can only be completed if the balance of all payment channels along the payment path is sufficient to meet the forwarding amount requirement. This process is called payment channel network routing.
[0003] To ensure that the transaction amount transmitted along a path in a payment channel network matches the channel balance, some payment channel network routing algorithms perform channel balance probing before transaction transmission. Based on this, they calculate the transaction path and the corresponding transaction amount transmitted along the path. For example, Flash sends probe pointers to other nodes in the network to probe channel balance information before sending a transaction. It then uses breadth-first search to calculate the shortest path and determines the transaction amount on that path based on the probe results. If the transaction amount supported by the path cannot meet the transaction requirements, it further calculates new shortest paths until the total available balance meets the transaction requirements. Autotune uses Yen's algorithm to calculate a candidate path set containing several shortest paths. Then, before sending the transaction, it uses out-of-band channels to obtain the channel balance information of the last hop of the candidate path. After that, it combines the known first-hop balance information, channel capacity information, and historical transaction amounts and completion information of the same source and destination to calculate the path score. It then selects the subset of paths with the highest score that meet the transaction requirements and sends the transaction.
[0004] The aforementioned payment channel network routing algorithm based on balance detection cannot measure the occupancy of the channel balance by other transaction forwarding processes in the network. Therefore, the accuracy of the detection results is very limited in actual transactions, leading to transaction failures. Furthermore, some existing algorithms do not consider intermediary fees (intermediary fees in payment channel networks are equivalent to network overhead in ordinary networks, but they also require network bandwidth for transmission) when calculating the path's transmittable amount, resulting in a discrepancy between the calculated path's transmittable amount and the actual transmittable amount.
[0005] To maximize transaction success and improve network throughput, Spider proposes a payment channel network routing protocol based on a packet switching architecture and a multipath congestion control protocol. This protocol first divides the complete transaction request into several small transaction units, allowing each unit to be transmitted and acknowledged independently. These units are then queued at intermediary nodes until a sufficient balance becomes available before processing. Finally, these transaction units are continuously sent out along multiple paths at a set transmission rate. Employing a congestion control algorithm similar to that in traditional data center networks, the transmission rate is adjusted based on the queuing status of the transaction units. This effectively adapts to changes in channel balance and prevents transaction failures due to insufficient channel balance during the forwarding of large transactions.
[0006] The Spider protocol, based on a packet-switched architecture, suffers from significant transaction completion delays and completely ignores intermediary fees. In real-world payment network networks, intermediary nodes charge transaction fees for forwarding transactions, and these fees vary among nodes. These additional intermediary fees impact the Spider protocol's feedback mechanism, making it impossible to uniformly measure the impact of transaction units on network congestion and effectively adjust transmission rates. Furthermore, independent transmission of transaction units means that intermediary nodes charge separate fees for each unit, potentially leading to unacceptable intermediary costs for users. Summary of the Invention
[0007] To address the aforementioned shortcomings in existing technologies, the deterministic routing algorithm and system for high-concurrency payment channel networks provided by this invention solve the problem that existing routing algorithms fail to accurately determine the available balance of the path, leading to transaction failures due to insufficient channel balance during forwarding.
[0008] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows:
[0009] Firstly, a deterministic routing algorithm for high-concurrency payment channel networks is provided, comprising the following steps:
[0010] S1. Obtain the candidate path set between the transaction initiator and the receiver, and initialize the unexplored path set as the candidate path set, and initialize the explored path set as an empty set;
[0011] S2. Whenever a transaction request needs to be sent, determine whether the probed path set is empty. If it is, proceed to step S5; otherwise, proceed to step S3.
[0012] S3. Move the probe paths in the detected path set whose existence time exceeds the effective time window length to the undetected path set, and calculate the supported transaction amount A of the probe paths in the detected path set. p ;
[0013] S4. Accumulate the total supported transaction amount of all detection paths to obtain the total supported transaction amount, and determine whether it is greater than or equal to the transaction demand value. If yes, proceed to step S8; otherwise, proceed to step S5.
[0014] S5. Select the K paths from the set of unexplored paths that have the lowest intermediary costs for transmitting the transaction demand value, and calculate the amount of money required for each node on the path to complete the transaction transmission.
[0015] S6, nodes on the K paths with the lowest intermediary costs. Send a transaction request, which includes the payment channel used by the path. And the balance value reserved by the expected node for transaction requests
[0016] S7. After waiting for node feedback and completing path detection, record the node feedback information and the time of completing path detection, add K paths to the set of detected paths, and then return to step S3.
[0017] S8. Select the path from the probed path set as the transmission path for the transaction request in ascending order of intermediary fees, and update the remaining available balance of the selected path.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0019] High success rate: The routing mechanism of this scheme sends a transaction request message with a clear transmission amount to the intermediary node. This is equivalent to declaring the amount to be occupied to the intermediary node during the path probing phase. The intermediary node can reserve a portion of the balance in advance based on the transaction request, which makes up for the impact of the difference in channel balance changes during the path probing process and the actual transaction transmission process, and avoids transaction failure caused by concurrent transaction routing occupying the channel balance during the transaction transmission process.
[0020] Low latency: The routing mechanism of this scheme does not need to send probe messages to all nodes in the network when probing the path, but only sends transaction request messages to nodes on a few pre-calculated candidate paths, which greatly reduces the network overhead of the path probing process and thus reduces transaction transmission latency.
[0021] Furthermore, step S8 further includes:
[0022] S81. Initialize the remaining transaction value A R Value representing the transaction demand;
[0023] S82. Based on the channel charging model, calculate the intermediary cost required to transmit the remaining transaction value for each path in the detected path set, and select the path p with the minimum intermediary cost.k ;
[0024] S83, Based on the channel charging model and path p k The balance information of the previous node, and the maximum transaction value that the calculation path can support.
[0025] S84. Select the remaining transaction value and path p k The smaller of the maximum supported transaction values is used as the path for the transfer transaction.
[0026] S85, Update path p k If the balance value is less than or equal to zero, it is moved from the detection path set to the undetected path set.
[0027] S86, Update Remaining Transaction Value If the remaining transaction value A R If the value is 0, then all selected paths are used as the transmission paths for the transaction request; otherwise, return to step S82.
[0028] The beneficial effects of the above technical solution are as follows: low cost: The routing mechanism of this solution takes into account the intermediary costs required by each node on the path during the path detection and transaction sending stages, calculates a more accurate amount of transmission that the path can support, avoids wasting low-cost path resources, and prioritizes the use of paths with lower intermediary costs to transmit transactions, thereby minimizing transaction costs while ensuring successful transaction transmission.
[0029] Furthermore, the maximum transaction value The calculation formula satisfies:
[0030]
[0031] The formula for calculating the balance information of the updated path is:
[0032]
[0033] in, For path p k upper node Feedback Channel Balance information; The path with the minimum mediation cost in the set of explored paths; n k For path p k Length; To pass through the node To the node When forwarding the amount, it is necessary to send it to node v. j The intermediary fees paid; and Path p k The i-th, i+1-th, j-th, and j+1-th nodes on the [theory / system].
[0034] Furthermore, the amount of money required for a node to complete a transaction transfer. The calculation formula is:
[0035]
[0036] in, To complete the transaction transmission node Need to The amount transmitted by the node, where A is the transaction demand value; To pass through the node To the node When forwarding the amount, it is necessary to send a message to node v. j The intermediary fees paid.
[0037] Furthermore, the supported transaction amount A p satisfy:
[0038]
[0039] in, For the path p = {v0, v1, ..., v i …,v n} Intermediate node v i Feedback payment channel [v i ,v i+1 The balance information is ]; n is the total number of shortest paths and the length of path p.
[0040] Furthermore, when the channel charging model At that time, the maximum transaction value The calculation formula is expressed as:
[0041]
[0042] The formula for calculating the balance information of the updated path is expressed as follows:
[0043]
[0044] The amount of money required for a node to complete a transaction transfer The calculation formula is expressed as:
[0045]
[0046] Supported transaction amount A p The calculation formula is expressed as:
[0047]
[0048] in, To pass through node v j To node v j+1 When the forwarding amount is x, it needs to be sent to node v. j Total intermediary fees paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send a message to node v. j The base fee for the intermediary fee paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send a message to node v. j The percentage of intermediary fees charged; To pass through the node To the node When forwarding the amount, it is necessary to send a message to node v. j The intermediary fees paid; To pass through the node To the node When forwarding funds, it is necessary to send a request to the node. The percentage of intermediary fees charged.
[0049] Secondly, a deterministic routing system for high-concurrency payment channel networks is provided. This system includes a candidate path search module for calculating a set of candidate paths between the transaction initiator and the receiver, a transaction request and sending module for executing a deterministic routing algorithm for high-concurrency payment channel networks, and a transaction request feedback module deployed on intermediary nodes for reserving balance resources for the transaction request and sending module and feeding back balance value information. Each node simultaneously deploys the candidate path search module, the transaction request and sending module, and the transaction request feedback module to fulfill the functions of a sender, intermediary node, and receiver. The transaction request and sending module connects and interacts with the candidate path search module deployed on its own node and the transaction request feedback module deployed on the intermediary node, respectively.
[0050] Furthermore, the method by which the candidate path search module calculates the candidate path set includes:
[0051] Step 1: Initialize the topology information and channel charging model of the payment channel network. The topology information includes network nodes, channel connection relationships between nodes, and channel capacity of each payment channel.
[0052] Step 2: Calculate the shortest path from the transaction initiator to the transaction recipient using the breadth-first search method;
[0053] Step 3: Based on the channel capacity information and channel charging model, calculate the maximum transaction amount A that the shortest path p can support when adding intermediary fees. ′p :
[0054]
[0055] in, To pass through node v j To node v j+1 When the forwarding amount is x, it needs to be sent to node v. j The intermediary fees paid; For node v i and v i+1 The channel capacity of the payment channel, where n is the length of the shortest path p; the shortest path p = {v0, v1, ..., v i …,v n};
[0056] Step 4: Determine the maximum transaction amount A ′ p Is it greater than zero? If so, then set the maximum transaction amount A. ′ p The corresponding path is added to the candidate path set and proceeds to step 5; otherwise, proceed to step 6.
[0057] Step 5: Update the capacity of each channel on the shortest path p according to the maximum supported transaction amount. Then return to step 2, channel capacity. The calculation formula is:
[0058]
[0059] Step 6: Determine if there is a path between the transaction initiator and the recipient that supports a transaction amount greater than zero. If yes, return to Step 2; otherwise, output the candidate path set.
[0060] The beneficial effects of the above technical solution are as follows:
[0061] Low latency & low cost: The candidate path search module of this solution uses a breadth-first search approach to find the shortest path between the sender and receiver, thereby reducing transaction transmission latency. Furthermore, a shorter path length means that only a few intermediary fees need to be paid to each node, thus reducing the total transaction cost.
[0062] High success rate: When updating the path capacity, the candidate path search module of this solution includes the intermediary fee that the transaction exchange needs to pay, thus filtering out invalid paths where the channel capacity is insufficient to pay the path intermediary fee and improving the success rate of transaction transmission.
[0063] Furthermore, when the channel charging model At that time, the maximum transaction amount A ′ p The calculation formula is expressed as:
[0064]
[0065] Channel capacity The calculation formula is expressed as:
[0066]
[0067] in, To pass through node v j To node v j+1 When the forwarding amount is x, it needs to be sent to node v. j Total intermediary fees paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send a message to node v. j The base fee for the intermediary fee paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send a message to node v. j The percentage of intermediary fees charged.
[0068] Furthermore, the method by which the transaction request feedback module calculates the node's balance information includes:
[0069] A1. Initialize the payment channel (v i, v j ) corresponding transaction request list Given an empty set, initialize the effective time window length Δ for transaction requests. r ;
[0070] A2. Each received message requires occupying a channel (v) i, v j And the expected occupancy value is The transaction request r is followed by an update to the corresponding transaction request list. The transaction request list has existed for more than Δ time r Path removal;
[0071] A3. Based on the current actual balance of the channel. Feedback values of each transaction request in the transaction request list The amount required to complete the transaction transfer for the current transaction request. Calculate the balance information returned to the transaction requester.
[0072]
[0073] in, For the payment channel [v] corresponding to transaction request l in the transaction request list i ,v j The feedback value;
[0074] A4. The feedback value of the current request. and feedback time T R Add to the transaction request list and send a response value to the transaction request and sending module. The news.
[0075] The beneficial effects of the above technical solution are as follows:
[0076] High success rate: The transaction request feedback module of this solution uses a "deterministic transaction request - resource reservation balance feedback" approach to compensate for the inaccurate path detection caused by changes in channel balance during transaction transmission. The intermediary node records the transmission amount carried by all recently received transaction requests and deducts the total amount corresponding to the stored transaction requests when providing balance feedback. This ensures that the channel balance is not occupied by other transactions during the time difference between path detection and transaction transmission, avoiding transaction failure due to insufficient balance during transmission. Furthermore, it allows transactions to obtain more accurate information about the available channel balance, thereby selecting a path that better meets the transaction's needs and improving the success rate of transaction transmission. Attached Figure Description
[0077] Figure 1 This is a flowchart of a deterministic routing algorithm for high-concurrency payment channel networks.
[0078] Figure 2 This is a block diagram illustrating the principle of a deterministic routing system for high-concurrency payment channel networks.
[0079] Figure 3 This is a flowchart of the candidate path calculation module.
[0080] Figure 4 This is a flowchart of the transaction request feedback module.
[0081] Figure 5 This example compares the successful transaction amounts for each routing scheme.
[0082] Figure 6 This represents the percentage of intermediary fees for each routing scheme in the example, relative to the total amount of successful transactions.
[0083] Figure 7 This example compares the transaction latency of different routing schemes. Detailed Implementation
[0084] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0085] like Figure 1 As shown, this scheme provides a deterministic routing algorithm for high-concurrency payment channel networks, which includes the following steps:
[0086] In step S1, a set of candidate paths between the transaction initiator and the receiver is obtained, and the set of undetected paths is initialized as a set of candidate paths, while the set of detected paths is initialized as an empty set. The set of undetected paths records the set of paths for which balance detection has not yet been performed, while the set of detected paths records the available balance of each intermediary node on the path for which balance detection has been performed, as well as the time when the balance detection was completed for the corresponding path.
[0087] In step S2, whenever a transaction request needs to be sent, it is determined whether the probed path set is empty. If it is, proceed to step S5; otherwise, proceed to step S3.
[0088] In step S3, the probe paths in the detected path set whose existence time exceeds the effective time window length are moved to the undetected path set, and the supported transaction amount A of the probe paths in the detected path set is calculated. p :
[0089]
[0090] in, For the path p = {v0, v1, ..., v i …,v n} Intermediate node v i Feedback payment channel [v] i ,v i+1 The balance information; n is the total number of shortest paths and the length of path p; To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send it to node v. j The intermediary fees paid.
[0091] In step S4, the total supported transaction amount for all probe paths is summed to obtain the total supported transaction amount, and it is determined whether this total supported transaction amount is greater than or equal to the transaction demand value, i.e.: ∑ p∈S A p If the value is ≥A, proceed to step S8; otherwise, proceed to step S5.
[0092] In step S5, select the K paths {p} from the set of unexplored paths that have the lowest intermediary costs for transmitting transaction demand values. 1 ,p 2 ,…,p K} and calculate the amount of money required for each node on the path to complete the transaction transmission.
[0093]
[0094] in, To complete the transaction transmission node Need to The amount transmitted by the node, where A is the transaction demand value; To pass through the node To the node When forwarding the amount, it is necessary to send a message to node v. j The intermediary fees paid.
[0095] In step S6, the nodes on the K paths with the lowest intermediary costs are... Send a transaction request, which includes the payment channel used by the path. And the balance value reserved by the expected node for transaction requests
[0096] In step S7, after waiting for node feedback and completing path detection, record the node feedback information and the time of completing path detection, add K paths to the set of detected paths, and then return to step S3;
[0097] In step S8, paths from the probed path set are selected as the transmission paths for the transaction request in ascending order of intermediary fees, and the remaining available balance of the selected paths is updated.
[0098] In one embodiment of the present invention, step S8 further includes:
[0099] S81. Initialize the remaining transaction value A R Value representing the transaction demand;
[0100] S82. Based on the channel charging model, calculate the intermediary cost required to transmit the remaining transaction value for each path in the detected path set, and select the path p with the minimum intermediary cost. k ;
[0101] S83, Based on the channel charging model and path p k The balance information of the previous node, and the maximum transaction value that the calculation path can support.
[0102]
[0103] S84. Select the remaining transaction value and path p k The smaller of the maximum supported transaction values is used as the path for the transfer transaction.
[0104] S85, Update path p k If the balance value is less than or equal to zero, it is moved from the detection path set to the undetected path set.
[0105] During implementation, the preferred formula for calculating the balance information of the updated path in this scheme is:
[0106]
[0107] in, For path p k upper node Feedback Channel Balance information; The path with the minimum mediation cost in the set of explored paths; n k For path p k Length; To pass through the node To the node When forwarding the amount, it is necessary to send a message to node v. j The intermediary fees paid; and Path p k The i-th, i+1-th, j-th, and j+1-th nodes on the [theory / system].
[0108] S86, Update Remaining Transaction Value If the remaining transaction value A R If the value is 0, then all selected paths are used as the transmission paths for the transaction request; otherwise, return to step S82.
[0109] In one embodiment of the present invention, when the channel charging model At that time, the maximum transaction value The calculation formula is expressed as:
[0110]
[0111] The formula for calculating the balance information of the updated path is expressed as follows:
[0112]
[0113] The amount of money required for a node to complete a transaction transfer The calculation formula is expressed as:
[0114]
[0115] Supported transaction amount A p The calculation formula is expressed as:
[0116]
[0117] in, To pass through node v j To node v j+1 When the forwarding amount is x, it needs to be sent to node v. j Total intermediary fees paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send a message to node v. j The base fee for the intermediary fee paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send a message to node v. j The percentage of intermediary fees charged; To pass through the node To the node When forwarding the amount, it is necessary to send a message to node v. j The intermediary fees paid; To pass through the node To the node When forwarding funds, it is necessary to send a request to the node. The percentage of intermediary fees charged.
[0118] like Figure 2 As shown, this solution also provides a deterministic routing system for high-concurrency payment channel networks. It includes a candidate path search module for calculating a set of candidate paths between the transaction initiator and receiver, a transaction request and sending module for a deterministic routing algorithm for high-concurrency payment channel networks, and a transaction request feedback module deployed on nodes to provide the transaction request and sending module with balance information and the time taken to complete path probing. Each node simultaneously deploys the candidate path search module, the transaction request and sending module, and the transaction request feedback module to fulfill the functions of a sender, intermediary node, and receiver. The transaction request and sending module connects and interacts with the candidate path search module deployed on its own node and the transaction request feedback module deployed on the intermediary node, respectively.
[0119] like Figure 3 As shown, the method by which the candidate path search module calculates the candidate path set includes:
[0120] Step 1: Initialize the topology information and channel charging model of the payment channel network. The topology information includes network nodes, channel connection relationships between nodes, and channel capacity of each payment channel.
[0121] Step 2: Calculate the shortest path p = {v0, v1, ..., v2} from the transaction initiator to the transaction recipient using a breadth-first search method. n};
[0122] Step 3: Based on the channel capacity information and channel charging model, calculate the maximum transaction amount A that the shortest path p can support when adding intermediary fees. ′ p :
[0123]
[0124] in, To pass through node v j To node v j+1 When the forwarding amount is x, it needs to be sent to node v. j The intermediary fees paid; For node v i and v i+1 The channel capacity of the payment channel, where n is the length of the shortest path p; the shortest path p = {v0, v1, ..., v i …,v n};
[0125] Step 4: Determine the maximum transaction amount A ′ p Is it greater than zero? If so, then set the maximum transaction amount A. ′ p The corresponding path is added to the candidate path set and proceeds to step 5; otherwise, proceed to step 6.
[0126] Step 5: Calculate the channel capacity between nodes on the shortest path p based on the maximum supported transaction amount. Then return to step 2, channel capacity. The calculation formula is:
[0127]
[0128] Step 6: Determine if there is a path between the transaction initiator and the recipient that supports a transaction amount greater than zero. If yes, return to Step 2; otherwise, output the candidate path set.
[0129] During implementation, when the channel charging model At that time, the maximum transaction amount A ′ p The calculation formula is expressed as:
[0130]
[0131] Channel capacity The calculation formula is expressed as:
[0132]
[0133] in, To pass through node v j To node v j+1 When the forwarding amount is x, it needs to be sent to node v. j Total intermediary fees paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send a message to node v. j The base fee for the intermediary fee paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send a message to node v. j The percentage of intermediary fees charged.
[0134] like Figure 4 As shown, the method by which the transaction request feedback module calculates the node's balance information includes:
[0135] A1. Initialize the payment channel (v i, v j ) corresponding transaction request list Given an empty set, initialize the effective time window length Δ for transaction requests. r ;
[0136] A2. Each received message requires occupying a channel (v) i, v j And the expected occupancy value is The transaction request r is followed by an update to the corresponding transaction request list. The transaction request list has existed for more than Δ time r Path removal;
[0137] A3. Based on the current actual balance of the channel. Feedback values of each transaction request in the transaction request list The amount required to complete the transaction transfer for the current transaction request. Calculate the balance information returned to the transaction requester.
[0138]
[0139] in, For the payment channel [v] corresponding to transaction request l in the transaction request list i ,v j The feedback value;
[0140] A4. The feedback value of the current request. and feedback time T R Add to the transaction request list and send a response value to the transaction request and sending module. The news.
[0141] The following example illustrates the deterministic routing algorithm for high-concurrency payment channel networks provided in this solution and the performance of the system:
[0142] This example uses the OMNET++ simulator to build a payment channel network model. The topology, channel capacity, and cost model of each payment channel are all derived from the real Lightning Network. A subgraph containing 110 nodes and 366 payment channels is sampled from the Lightning Network for experimentation.
[0143] This example is based on a mean starting from 10. 6 SAT to 9×10 6 SAT scales the payment channel capacity to test the performance of the proposed algorithm under different channel capacities. Each experiment lasts 1000 seconds, and the transaction arrival process on the nodes follows a Poisson distribution, with each node sending an average of 10 transactions per second to 10 receiving nodes. The amount of each transaction is sampled from a credit card transaction dataset with a mean of 88 SAT.
[0144] This example uses existing Autotune, Flash, and Spider algorithms as comparison algorithms. Autotune and Flash algorithms both perform balance probing before transaction transmission, with intermediary nodes only reporting the current channel balance to the sender without resource reservation. Spider, on the other hand, adopts a packet-switching architecture, splitting the complete transaction into several small transaction units for transmission, and adjusting the transmission rate of these units during continuous transmission. Since Spider charges a separate intermediary fee for each transaction unit, and this fee is substantial and can affect the normal operation of the Spider algorithm, this example ignores the intermediary fee and only compares its performance in success rate and transaction latency.
[0145] When the proposed algorithm (our-algorithm) is used to transmit transaction requests, its performance is evaluated as follows: Figures 5-7 As shown, Figure 5 As shown, the routing mechanism proposed in this scheme has a significant improvement in the amount of successful transactions compared to existing schemes. Compared with the Autotune, Flash and Spider algorithms, the total amount of successful transactions can be increased by up to 56.2%, 36.1% and 1.1x respectively.
[0146] like Figure 6As shown, the routing mechanism proposed in this scheme significantly reduces the proportion of intermediary fees for successfully completed transactions compared to existing schemes. Compared to the Autotune and Flash algorithms, the intermediary fees can be reduced by up to 78.3% and 54.1%, respectively.
[0147] like Figure 7 As shown, the routing mechanism proposed in this scheme significantly reduces transaction latency compared to existing schemes, achieving reductions of up to 46.1%, 91.7%, and 99.5% compared to Autotune, Flash, and Spider algorithms, respectively.
Claims
1. A deterministic routing algorithm for high-concurrency payment channel networks, characterized in that, Including the following steps: S1. Obtain the candidate path set between the transaction initiator and the receiver, and initialize the unexplored path set as the candidate path set, and initialize the explored path set as an empty set; S2. Whenever a transaction request needs to be sent, determine whether the probed path set is empty. If it is, proceed to step S5; otherwise, proceed to step S3. S3. Move the probe paths in the detected path set whose existence time exceeds the effective time window length to the undetected path set, and calculate the supported transaction amount A of the probe paths in the detected path set. p ; S4. Accumulate the total supported transaction amount of all detection paths to obtain the total supported transaction amount, and determine whether it is greater than or equal to the transaction demand value. If yes, proceed to step S8; otherwise, proceed to step S5. S5. Select the K paths from the set of unexplored paths that have the lowest intermediary costs for transmitting the transaction demand value, and calculate the amount of money required for each node on the path to complete the transaction transmission. S6. Nodes on the K paths with the lowest intermediary costs. Send a transaction request, which includes the payment channel used by the path. And the balance value reserved by the expected node for transaction requests S7. After waiting for node feedback and completing path detection, record the node feedback information and the time of completing path detection, add K paths to the set of detected paths, and then return to step S3. S8. Select the path from the probed path set as the transmission path for the transaction request in ascending order of intermediary fees, and update the remaining available balance of the selected path.
2. The deterministic routing algorithm for high-concurrency payment channel networks according to claim 1, characterized in that, Step S8 further includes: S81. Initialize the remaining transaction value A R Value representing the transaction demand; S82. Based on the channel charging model, calculate the intermediary cost required to transmit the remaining transaction value for each path in the detected path set, and select the path p with the minimum intermediary cost. k ; S83, Based on the channel charging model and path p k The balance information of the previous node, and the maximum transaction value that the calculation path can support. S84. Select the remaining transaction value and path p k The smaller of the maximum supported transaction values is used as the path for the transfer transaction. S85, Update path p k If the balance value is less than or equal to zero, it is moved from the detection path set to the undetected path set. S86, Update Remaining Transaction Value If the remaining transaction value A R If the value is 0, then all selected paths are used as the transmission paths for the transaction request; otherwise, return to step S82.
3. The deterministic routing algorithm for high-concurrency payment channel networks according to claim 2, characterized in that, The maximum transaction value The calculation formula satisfies: The formula for calculating the balance information of the updated path is: in, For path p k upper node Feedback Channel Balance information; The path with the minimum mediation cost in the set of explored paths; n k For path p k Length; To pass through the node To the node When forwarding the amount, it is necessary to send it to node v. j The intermediary fees paid; and Path p k The i-th, i+1-th, j-th, and j+1-th nodes on the [theory / system].
4. The deterministic routing algorithm for high-concurrency payment channel networks according to claim 1, characterized in that, The amount of money required for a node to complete a transaction transfer The calculation formula is: in, To complete the transaction transmission node Need to The amount transmitted by the node, where A is the transaction demand value; To pass through the node To the node When forwarding the amount, it is necessary to send a message to node v. j The intermediary fees paid.
5. The deterministic routing algorithm for high-concurrency payment channel networks according to claim 1, characterized in that, The supported transaction amount A p satisfy: in, For the path p = {v0, v1, ..., v i …,v n } Intermediate node v i Feedback payment channel [v] i ,v i+1 The balance information is ]; n is the total number of shortest paths and the length of path p.
6. The deterministic routing algorithm for high-concurrency payment channel networks according to any one of claims 2-5, characterized in that, When the channel charging model At that time, the maximum transaction value The calculation formula is expressed as: The formula for calculating the balance information of the updated path is expressed as follows: The amount of money required for a node to complete a transaction transfer The calculation formula is expressed as: Supported transaction amount A p The calculation formula is expressed as: in, To pass through node v j To node v j+1 When the forwarding amount is x, it needs to be sent to node v. j Total intermediary fees paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send it to node v. j The base fee for the intermediary fee paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send it to node v. j The percentage of intermediary fees charged; To pass through the node To the node When forwarding the amount, it is necessary to send it to node v. j The intermediary fees paid; To pass through the node To the node When forwarding funds, it is necessary to send a request to the node. The percentage of intermediary fees charged.
7. A deterministic routing system for high-concurrency payment channel networks, characterized in that: The system includes a candidate path search module for calculating a set of candidate paths between the transaction initiator and the recipient, a transaction request and sending module for executing the deterministic routing algorithm for high-concurrency payment channel networks as described in any one of claims 1-6, and a transaction request feedback module deployed on nodes for reserving balance resources for the transaction request and sending module and feeding back balance value information. Each node simultaneously deploys the candidate path search module, the transaction request and sending module, and the transaction request feedback module to complete the functions of the node as a sender, an intermediary node, and a receiver. The transaction request and sending module connects and interacts with the candidate path search module deployed on its own node and the transaction request feedback module deployed on the intermediary node, respectively.
8. The deterministic routing system for high-concurrency payment channel networks according to claim 7, characterized in that: The candidate path search module calculates the candidate path set using the following methods: Step 1: Initialize the topology information and channel charging model of the payment channel network. The topology information includes network nodes, channel connection relationships between nodes, and channel capacity of each payment channel. Step 2: Calculate the shortest path from the transaction initiator to the transaction recipient using the breadth-first search method; Step 3: Based on the channel capacity information and channel charging model, calculate the maximum transaction amount A′ that the shortest path p can support when calculating additional intermediary fees. p : in, To pass through node v j To node v j+1 When the forwarding amount is x, it needs to be sent to node v. j The intermediary fees paid; For node v i and v i+1 The channel capacity of the payment channel, where n is the length of the shortest path p; the shortest path p = {v0, v1, ..., v i …,v n }; Step 4: Determine the maximum transaction amount A′ p Is it greater than zero? If so, then set the maximum transaction amount A′. p The corresponding path is added to the candidate path set and proceeds to step 5; otherwise, proceed to step 6. Step 5: Update the capacity of each channel on the shortest path p according to the maximum supported transaction amount. Then return to step 2, channel capacity. The calculation formula is: Step 6: Determine if there is a path between the transaction initiator and the recipient that supports a transaction amount greater than zero. If yes, return to Step 2; otherwise, output the candidate path set.
9. The deterministic routing system for high-concurrency payment channel networks according to claim 8, characterized in that: When the channel charging model At that time, the maximum transaction amount A′ p The calculation formula is expressed as: Channel capacity The calculation formula is expressed as: in, To pass through node v j To node v j+1 When the forwarding amount is x, it needs to be sent to node v. j Total intermediary fees paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send it to node v. j The base fee for the intermediary fee paid, To pass through node v j To node v j+1 When forwarding the amount, it is necessary to send it to node v. j The percentage of intermediary fees charged.
10. The deterministic routing system for high-concurrency payment channel networks according to claim 7, characterized in that: The methods used by the transaction request feedback module to calculate the node's balance information include: A1. Initialize the payment channel (v i, v j ) corresponding transaction request list Given an empty set, initialize the effective time window length Δ for transaction requests. r ; A2. Each received message requires occupying a channel (v) i, v j And the expected occupancy value is After the transaction request r is updated, the corresponding transaction request list is updated. The transaction request list has existed for more than Δ time r Path removal; A3. Based on the current actual balance of the channel. Feedback values of each transaction request in the transaction request list The amount required to complete the transaction transfer for the current transaction request. Calculate the balance information returned to the transaction requester. in, For the payment channel [v] corresponding to transaction request l in the transaction request list i ,v j The feedback value; A4. The feedback value of the current request. and feedback time T R Add to the transaction request list and send a response value to the transaction request and sending module. The news.
