CN111724257B - Rebalancing strategy execution method for sub-chain payment in blockchain - Google Patents

Rebalancing strategy execution method for sub-chain payment in blockchain Download PDF

Info

Publication number
CN111724257B
CN111724257B CN202010468395.3A CN202010468395A CN111724257B CN 111724257 B CN111724257 B CN 111724257B CN 202010468395 A CN202010468395 A CN 202010468395A CN 111724257 B CN111724257 B CN 111724257B
Authority
CN
China
Prior art keywords
rebalancing
node
leader
strategy
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010468395.3A
Other languages
Chinese (zh)
Other versions
CN111724257A (en
Inventor
喻梅
韩铭
于瑞国
王建荣
于健
赵满坤
牛炳辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin University
Original Assignee
Tianjin University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin University filed Critical Tianjin University
Priority to CN202010468395.3A priority Critical patent/CN111724257B/en
Publication of CN111724257A publication Critical patent/CN111724257A/en
Application granted granted Critical
Publication of CN111724257B publication Critical patent/CN111724257B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06315Needs-based resource requirements planning or analysis

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Business, Economics & Management (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Educational Administration (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a rebalancing strategy execution method for sub-chain payment in a blockchain, which improves the final effect of the rebalancing strategy and can find out as many effective paths as possible under the condition of small time complexity improvement; on the basis of ensuring that the policy is fairer and more reasonable in the execution process, the irregular behavior of some malicious nodes in the rebalancing policy is restrained, and the benefit of honest nodes in the rebalancing process is maintained; meanwhile, the fund offset problem in the blockchain payment channel is relieved, and the usability of the payment channel is improved.

Description

Rebalancing strategy execution method for sub-chain payment in blockchain
Technical Field
The invention belongs to the fields of databases and information security, relates to related principles and technologies of network flows and payment channels, and particularly relates to a rebalancing strategy execution method for sub-chain payment in a blockchain.
Background
In order to solve the capacity problem of the blockchain, the main current capacity expansion schemes mainly have two main types, and the capacity expansion effect is realized respectively aiming at the two-layer structure of the blockchain transaction system. The capacity expansion scheme aiming at the first layer structure directly modifies the structure of the blocks in the blockchain so as to increase the running efficiency of the blockchain and realize faster verification speed. Common ways include directly increasing the size of the block, employing a slicing mechanism, improving the consensus mechanism, etc. However, such a capacity expansion scheme is limited by objective conditions such as hardware level and network conditions.
The capacity expansion scheme for the second layer structure adopts an Off-chain payment mode to reduce resource consumption on the chain. A common approach is mainly payment channels (PaymentChannels).
Through payment channel technology, a user can transfer a large number of small transactions from on-chain to off-chain, directly skipping the process of on-chain verification. Payment channel technology can alleviate the capacity pressure of blockchain transaction systems to some extent, but this solution remains to be perfected. For example, after a period of transactions, serious funds drift may occur within the payment channel, resulting in subsequent transactions not being successful. On this basis, khalil and Gervais proposed a "re-balancing" solution in 2017. By using a rebalancing strategy, the payment channel can adjust the balance of the payment channel with less loss. The proposal of the scheme improves the usability of the payment channel. However, the scheme only provides an adjustment thought, and many problems still remain to be perfected.
The rebalancing strategy for the sub-chain payment in the blockchain improves the rebalancing algorithm of the sub-chain payment channel network and improves the setting of strategy selection optimization problems and reward and punishment mechanisms in the rebalancing strategy; based on the path discovery algorithm in the traditional directed graph network, a path discovery algorithm (Payment ChannelsRoutingAlgorithm, PCRA) in the Payment channel is proposed. The improved path discovery algorithm is able to find as many effective paths as possible with less temporal complexity improvement. Meanwhile, in order to be able to improve the final effect of the rebalancing strategy, a rebalancing decision improvement algorithm (ImpvedRe-balancingDecision Algorithm, IRDA) is proposed.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides a rebalancing strategy execution method for the payment under a block chain, which improves the final effect of the rebalancing strategy and can find out as many effective paths as possible under the condition of small time complexity improvement; on the basis of ensuring that the policy is fairer and more reasonable in the execution process, the irregular behavior of some malicious nodes in the rebalancing policy is restrained, and the benefit of honest nodes in the rebalancing process is maintained; meanwhile, the fund offset problem in the blockchain payment channel is relieved, and the usability of the payment channel is improved.
The invention solves the technical problems by the following technical proposal:
a rebalancing policy enforcement method for sub-chain payments in a blockchain, characterized by: the method comprises the following steps:
1) Determining a leader of the rebalancing strategy, and selecting the leader;
2) The node reports information and rebalancing requirements to a leader;
3) Reporting to a leader after the fund deviation condition occurs in the payment channel and the rebalancing requirement is generated, counting the rebalancing requirement by the leader, and starting a rebalancing strategy after the counted number reaches a certain specific threshold;
4) Merging partial paths of the rebalancing strategy;
5) After receiving report messages of other nodes, the leader carries out statistical verification on the execution result of the whole rebalancing strategy, and judges whether the execution result meets the requirements.
Moreover, the rebalancing policy enforcement method for blockchain mid-chain sub-chain payments of claim 1, wherein: the specific operations of the step 1) electing the leader of the rebalancing strategy are as follows:
(1) At a certain appointed moment, nodes in the payment channel network adopt a PoW calculation mode, and all the nodes perform calculation once in a unified way;
(2) The node A which completes the calculation sends the calculation result of the node A to all other nodes and announces participation in leader election; meanwhile, other nodes begin to verify the calculation result of A, and after calculation is finished, a leader cannot select the value immediately and needs to wait for a hash time period;
(3) After other nodes in the network verify, send out the acknowledgement message to node A, after receiving the acknowledgement message of 2+1/node, confirm node A as the leader of this stage;
(4) After the node A selects the time period leader, when a certain payment channel has a rebalancing requirement, reporting the rebalancing requirement and other related information to the node A, and simultaneously, counting and judging whether the rebalancing strategy can be executed by the node A;
(5) After a period of time, the node A completes the leader work in the period of time, a new random number is randomly generated by the system, other non-leader nodes operate the random number, and the next leader election process is started;
(6) As the other node B completes the specified operation, the operation result is broadcasted, other nodes except the node A and the node B in the network are verified, and the node B becomes a leader of a new round of rebalancing strategy after being verified and confirmed;
(7) Node a sends the rebalancing demand to node B that has not timed out during its tenure, and makes a working handoff with node B.
And, the node reporting information in the step 2) to the leader includes the node information of both sides of the payment channel, the balanced direction and the required amount, the deadline of rebalancing the requirement reservation, the balanced maximum amount of the node and the confirmation signature of both sides.
Moreover, the specific operation of the step 3) is as follows:
(1) Participants report rebalancing requirements;
(2) After the rebalancing demand meets a certain threshold, the leader declares that the rebalancing process is ready to begin to all nodes in the network;
(3) All nodes re-measure the re-balance demand of the nodes, and re-count and report the re-balance demand; meanwhile, the transaction amount in the current payment channel is frozen according to the self demand, so that the rebalancing strategy can be smoothly executed;
(4) Starting a rebalancing strategy process, and calculating by a leader to make a rebalancing strategy;
(5) The leader broadcasts a rebalancing strategy to all the participating nodes and waits for the confirmation of the nodes;
(6) After the node receives the rebalancing strategy, whether the rebalancing strategy is fair and reasonable is calculated, and then a confirmation message is replied to the leader;
(7) The leader establishes the execution time of the policy and requires all nodes to uniformly execute the rebalancing policy before the rebalancing policy expires;
(8) All participating nodes that rebalance the policy execute the policy;
(9) Reporting the execution result to a leader by the participant of the rebalancing strategy; the leader calculates rebalancing strategy execution cost according to the execution result;
(10) Each node settles the procedure fee of the rebalancing process, and the rebalancing process is finished.
Moreover, the specific operation of the step 5) is as follows: carrying out statistical verification, judging whether the requirements are met, and if all the nodes finish the rebalancing scheme according to the requirements, indicating that the rebalancing scheme is successfully executed; at the moment, the leader broadcasts the execution result of the whole rebalancing strategy in the payment channel network, so that traceability of the execution of the rebalancing strategy is ensured; if a node does not complete its rebalancing policy task as defined, then the node is considered a malicious node, its "rebalancing guarantee" is deducted, and the guarantee is used to compensate the affected node. The entire rebalancing process ends.
The invention has the advantages and beneficial effects that:
1. the rebalancing strategy execution method for the block chain mid-chain payment effectively reduces the complexity of the directed graph topological structure, and is obviously improved on the aspect of large-scale network problems compared with the prior improvement.
2. According to the rebalancing strategy execution method for the sub-chain payment in the blockchain, the availability of the sub-chain payment channel is improved, the times of disassembling or reconstructing the payment channel are reduced, and the transaction capability of the payment channel is improved through the rebalancing strategy.
3. The invention discloses a rebalancing strategy execution method for sub-chain payment in a blockchain, which invents novel PCRA and IRDA algorithms, and can readjust the balance state in each payment channel with very little loss, and reasonably utilizes the rebalancing strategy to reduce the consumption of resources on the blockchain and reduce the commission loss of a payment channel network in cross-channel transaction; in the whole rebalancing process, the honest node is guaranteed not to have any loss, and the fund safety of the honest node can be guaranteed.
Drawings
FIG. 1 is a schematic diagram of path merging in a rebalancing strategy;
FIG. 2 is a bar graph of the balance total in the rebalancing strategy;
FIG. 3 is a bar graph of the number of participating nodes in the rebalancing process;
FIG. 4 is a bar graph of rebalancing calculation process time consumption;
FIG. 5 is a histogram of overall evaluation metrics;
FIG. 6 is a schematic diagram of an election process;
fig. 7 is a diagram of overall policy path evaluation function.
Detailed Description
The invention is further illustrated by the following examples, which are intended to be illustrative only and not limiting in any way.
A rebalancing policy enforcement method for sub-chain payments in a blockchain, characterized by: the method comprises the following steps:
step S0101: the novel leader election mechanism is adopted for leader election, and the election process is as shown in fig. 6:
step S0201: the node reports the information of the nodes of the two parties of the payment channel, the balanced direction and the demand amount, the deadline of the rebalancing demand reservation, the balanced maximum amount of the node, the confirmation signature of the two parties and the like to the leader.
Step S0202: the participant reports the rebalancing demand, and when the rebalancing demand meets a certain threshold, the leader announces that the rebalancing process is ready to start to all nodes in the network;
step S0203: all nodes re-measure their own re-balancing requirements and will re-count and report the balancing requirements. Meanwhile, the transaction amount in the current payment channel is frozen according to the self demand, so that the rebalancing strategy can be smoothly executed;
step S0301: starting a rebalancing strategy process, and calculating by a leader to make a rebalancing strategy;
step S0302: the leader broadcasts a rebalancing strategy to all the participating nodes and waits for the confirmation of the nodes;
step S0303: after the node receives the rebalancing strategy, whether the rebalancing strategy is fair and reasonable is calculated, and then a confirmation message is replied to the leader;
step S0304: the leader establishes the execution time of the policy and requires all nodes to uniformly execute the rebalancing policy before the rebalancing policy expires;
step S0305: all participating nodes that rebalance the policy execute the policy;
step S0306: reporting the execution result to a leader by the participant of the rebalancing strategy; the leader calculates rebalancing strategy execution cost according to the execution result;
step S0307: each node settles the commission of the rebalancing process, and the rebalancing process is finished;
step S0401: in order to increase the efficiency of the execution of the rebalancing strategy as much as possible, partial paths in the rebalancing strategy can be combined.
Step S0501: after receiving the report messages of other nodes, the leader needs to carry out statistical verification on the execution result of the whole rebalancing strategy to judge whether the execution result meets the requirements. If all nodes complete the rebalancing scheme as required, the rebalancing scheme is successfully executed. At this time, the leader broadcasts the execution result of the whole rebalancing strategy in the payment channel network, so as to ensure traceability of the execution of the rebalancing strategy.
The specific algorithm of using the novel policy path discovery algorithm PCRA in the novel rebalancing policy for payment under the chain is performed as follows:
(1) All nodes with all Outegrees (OD) of 0 or with all Ingrees (ID) of 0 in one directed graph G (V, E) are deleted. If node v.front=null|v next=null, node V is deleted from the network.
(2) And re-recording the nodes with the out degree of 1 and the in degree of 1 in the original graph. If one node V in the graph satisfies OD V =1&&ID V =1, i.e. node V is contained only on edge E i→V E V→j In (a), in (b). Then node V is deleted in the graph if there is no E in the original graph i→j Newly adding the edge; if the original image contains edge E i→j ,E i→j E, newly adding records in the paths, and recording more than one path of nodes i-j.
(3) If node i, j are included in path E only i→j ,E j→i And stopping the merging process of the nodes.
(4) Repeating steps (2) - (3) until all remaining nodes V' in the graph satisfy
(5) The new directed graph G '(V', E ') is reconstructed from the remaining nodes V'.
(6) Placing an untagged node A in a buffer stack, and setting the tag variable A.mark of the node as a new traversal order number q i Indicating that the node participates in the code q i Is performed during the traversal process of (a). Setting a traversal position variable A.count=0 and A.visit=0 of the current node;
(7) And traversing the subsequent nodes of the A in sequence, and judging whether a loop is formed or not until all the nodes are traversed. Next [ A.count ]]The corresponding node B is put in the stack, and the marking variable B.mark=q of the node B is set i Set b.count=0, b.visit=a.visit+1;
(8) Assuming that the current stack top element is P, if the node T currently corresponding to p.next [ p.count ] is already in the stack, i.e., t.visit +.0 +. & t.mark=p.mark, then the description path forms a directed ring, then all elements of the node t→p in the stack are output, while p.count++; if the node T is not in the stack, i.e., t.visit=0 & (t.mark=0|t.mark=p.mark). If all the nodes traversed before the node T do not form a loop, the node T is pushed to a stack, and meanwhile P.count++;
(9) If p.count=p.next.size indicates that node P has been traversed, node P is popped off the stack and p.count=0, p.visit=0 is set. And (3) repeating the step (7) on the stack top element.
(10) If the stack is empty, then find an untagged node a ', node a ' satisfying a '. Mark=0&&A '. Visit=0, and the node a' is reassigned with the traversal number q j Repeating the processes of steps (6) - (9). The traversal process encounters node bs that have been marked, but the strong connectivity number is not q j I.e. B.mark. Noteq.0&&B.mark≠q j The node is skipped directly.
(11) The loops of all outputs of step (11) are simply processed, and all loops R 'in the directed graph G' (V ', E') can be obtained in steps (4) to (9) above: { l' 1 ,l′ 2 ……l′ m }。
(12) Combining all the saved temporary paths in (2) with the loop set R' obtained in (10) to obtain all the loop sets R: { l in the directed graph G (V, E) 1 ,l 2 ……l n }。
The novel optimization algorithm IRDA algorithm is adopted in the novel rebalancing strategy of the payment under the chain, so that the final rebalancing effect is improved. Let δmin represent the rebalancing requirement of the payment channel with the lowest required amount in the policy path; delta represents the rebalancing demand it needs to adjust; r represents a commission proportion; Δr represents the amount of adjustment required for the commission; c represents the loss in one payment channel during rebalancing; cs represents the fee for performing the verification. Can obtain a payment channel with no need of adjusting rebalancing requirement and its evaluation function STI E1 For the payment channel requiring adjustment of rebalancing requirement, its evaluation function STI is shown in formula (1) E2 Is formula (2).
As shown in the formula (2), for the node requiring the adjustment of the rebalancing requirement, the overall evaluation function has a negative correlation with the adjustment amount Δ and a positive correlation with the loss. For a policy path l, the overall effect is also related to rebalancing the total amount and losses in the path. The evaluation index thereof can be formulated as formula (3).
In equation (3), δl represents the rebalancing requirement of all payment channels in the path, and βl represents the total amount actually balanced for the entire path. Cl represents all losses in the path due to the rebalancing strategy. The physical meaning of the compound is shown in a formula (4).
The simultaneous expression (3) and the expression (4) can give the expression (5):
in equation (5), STIl represents the final overall satisfaction of a policy path.
The adjustment amount delta and the commission rate r are specified within a certain reasonable range, so that the fairness of the rebalancing strategy can be ensured. Meanwhile, on the premise of ensuring fairness of the strategy, the overall rebalancing strategy effect should be improved as much as possible, namely, the STIL obtains the maximum value in the value range. The simultaneous equations (2), (4) and (5) can give equation (6).
By equation (6), a relationship between the loss C and the adjustment amount Δ is established. And (5) a simultaneous formula and a common formula (6). Equation (7) is obtained.
Fig. 7 is a graphical representation of equation (7), and fig. 7 shows the relationship between the overall evaluation and the demand adjustment amount Δ in a loop of four nodes. By combining the formula (7) and fig. 7, the fee is appropriately adjusted within a reasonable range, and a better policy evaluation can be obtained.
As shown in formula (8), σ has two extrema within a certain range of values. And (3) obtaining the result of the formula (9) according to the change rule and the mathematical rule of the derivative function of the formula (7).
In the actual calculation process, the maximum value of the formula (7) in the value range can be obtained by only bringing the result (9) into the formula (7).
Decision optimization for IRDA algorithms is shown by various constraints as equation (10):
simultaneous equation (7), equation (9), equation (10). In the actual strategy, the adjustment value is shown in formula (11).
According to the calculation result of the formula (11), a weight Wl can be calculated for each rebalancing strategy path, then all paths are ordered according to the order of the weights from big to small, and the optimal path under the current condition is selected for the rebalancing strategy in sequence.
A comparative experiment was performed on the optimized path discovery algorithm PCRC in the rebalancing strategy. The complexity of the directed graph topology structure is effectively reduced through a path discovery algorithm of a rebalancing strategy, and the directed graph topology structure is obviously improved on the aspect of larger-scale network problems compared with the prior art.
The execution speed of multiple traversals by PCRA versus Tarjan's. In table 1, E represents the number of nodes, V represents the number of directed edges in the graph, R represents the number of directed loops found after the experiment, T1 represents the time required for multiple traversals of Tarjan's, T2 represents the running time of PCRA, V/E represents the proportional relationship of directed edges to the number of nodes, and I represents the degree of improvement in the improvement algorithm over the sequential traversals time.
TABLE 1 PCRA vs Tarjan's traversal comparison results Table
As shown in table 1, the time complexity of the two algorithms is comparable with less number of paths, and no significant difference is exhibited. However, when the number of nodes is increased, the PCRA can effectively reduce the complexity of the topological structure of the directed graph due to the increased preprocessing stage of the data. PCRA presents certain advantages in cases of a large number of nodes. In some cases, it may even happen that PCRA is able to calculate the result, but Tarjan's cannot. Indicating that PCRA has significantly improved over prior improvements in larger scale network problems. Table 1 shows that PCRA has significant run-time advantages for graphs G (V, E) when 1<V/E <2 is satisfied when the number of paths is proportional to the number of nodes. The reason is that for when 1<V/E <2 is satisfied, there must be a node that satisfies the condition in step 2 in the algorithm. After the nodes are preprocessed, the complexity of the topological structure in the original image can be effectively reduced. So that the consumption of the subsequent steps can be greatly reduced.
To sum up, in order to be able to find all possible policy paths within a certain time complexity and to be able to guarantee the rebalancing effect, in the test procedure of the IRS, when V/e=1.7 is taken, the simulation execution of the rebalancing policy procedure is started.
In experiments conducted on the IDRA algorithm, it can be found that compared with the existing Revive algorithm, the IDRA can obviously improve the overall effect of the whole rebalancing strategy. The time consumption is controlled through simple addition operation and decision process, so that the decision process of the rebalancing strategy can be effectively completed within a certain time, and the final overall effect is improved. The availability of payment under the chain can be effectively improved by using a rebalancing strategy.
In the experimental process, three different data sets are selected, and are respectively: data set 1: the Internet TopologyZoo, dataset 2: dolphin Social Network, dataset 3: american College Football in this experiment, a random number between 200 and 4000 was simulated for each payment channel, representing the total amount of funds for that payment channel. At the beginning of the experiment, this amount was distributed equally to the nodes at both ends of the channel. Thereafter, at intervals, 10 transaction data were randomly generated, simulating the transaction process of the user in the daily case. When a channel meets the start-up condition, it is considered that this channel is severely shifted. At the same time, the amount and the existing state in this payment channel are frozen waiting for the rebalancing strategy to begin. The rebalancing strategy starts to be executed when the number of payment channels that are shifted meets the path node number ratio approaching 1.7.
Meanwhile, in the comparison of the IDRA algorithm and the Revive algorithm, the total transaction amount, the number of participating nodes and channels and the time consumption are used as evaluation indexes, and the experimental results are shown in fig. 2, 3, 4 and 5, so that the overall effect of the whole rebalancing strategy can be obviously improved. The time consumption is controlled through simple addition operation and decision process, so that the decision process of the rebalancing strategy can be effectively completed within a certain time, and the final overall effect is improved. The availability of off-chain payments can be effectively improved using a rebalancing strategy
Although the embodiments of the present invention and the accompanying drawings have been disclosed for illustrative purposes, those skilled in the art will appreciate that: various substitutions, changes and modifications are possible without departing from the spirit and scope of the invention and the appended claims, and therefore the scope of the invention is not limited to the embodiments and the disclosure of the drawings.

Claims (1)

1. A rebalancing policy enforcement method for sub-chain payments in a blockchain, characterized by: the method comprises the following steps:
1) Determining a leader of the rebalancing strategy, and selecting the leader;
2) The node reports information and rebalancing requirements to a leader;
3) Reporting to a leader after the fund deviation condition occurs in the payment channel and the rebalancing requirement is generated, counting the rebalancing requirement by the leader, and starting a rebalancing strategy after the counted number reaches a certain specific threshold;
4) Merging partial paths of the rebalancing strategy;
after receiving report messages of other nodes, the leader carries out statistical verification on the execution result of the whole rebalancing strategy and judges whether the execution result meets the requirements;
the specific operations of the step 1) electing the leader of the rebalancing strategy are as follows:
(1) At a certain appointed moment, nodes in the payment channel network adopt a PoW calculation mode, and all the nodes perform calculation once in a unified way;
(2) The node A which completes the calculation sends the calculation result of the node A to all other nodes and announces participation in leader election; meanwhile, other nodes begin to verify the calculation result of A, and after calculation is finished, a leader cannot select the value immediately and needs to wait for a hash time period;
(3) After other nodes in the network verify, sending a confirmation message to the node A, and after the confirmation message of n < 2+ > 1/node is received, determining the node A as a leader in the stage;
(4) After the node A selects the time period leader, when a certain payment channel has a rebalancing requirement, reporting the rebalancing requirement and other related information to the node A, and simultaneously, counting and judging whether the rebalancing strategy can be executed by the node A;
(5) After a period of time, the node A completes the leader work in the period of time, a new random number is randomly generated by the system, other non-leader nodes operate the random number, and the next leader election process is started;
(6) As the other node B completes the specified operation, the operation result is broadcasted, other nodes except the node A and the node B in the network are verified, and the node B becomes a leader of a new round of rebalancing strategy after being verified and confirmed;
(7) The node A sends the rebalancing requirement which is not overtime in the period of the node A to the node B, and the node A performs work handover with the node B;
the step 2) of reporting information to the leader by the node comprises node information of both sides of the payment channel, balanced direction and demand amount, deadline of rebalancing demand reservation, balanced maximum amount of the node and confirmation signature of both sides;
the specific operation of the step 3) is as follows:
(1) Participants report rebalancing requirements;
(2) After the rebalancing demand meets a certain threshold, the leader declares that the rebalancing process is ready to begin to all nodes in the network;
(3) All nodes re-measure the re-balance demand of the nodes, and re-count and report the re-balance demand; meanwhile, the transaction amount in the current payment channel is frozen according to the self demand, so that the rebalancing strategy can be smoothly executed;
(4) Starting a rebalancing strategy process, and calculating by a leader to make a rebalancing strategy;
(5) The leader broadcasts a rebalancing strategy to all the participating nodes and waits for the confirmation of the nodes;
(6) After the node receives the rebalancing strategy, whether the rebalancing strategy is fair and reasonable is calculated, and then a confirmation message is replied to the leader;
(7) The leader establishes the execution time of the policy and requires all nodes to uniformly execute the rebalancing policy before the rebalancing policy expires;
(8) All participating nodes that rebalance the policy execute the policy;
(9) Reporting the execution result to a leader by the participant of the rebalancing strategy; the leader calculates rebalancing strategy execution cost according to the execution result;
(10) Each node settles the commission of the rebalancing process, and the rebalancing process is finished;
the specific operation of the step 5) is as follows: carrying out statistical verification, judging whether the requirements are met, and if all the nodes finish the rebalancing scheme according to the requirements, indicating that the rebalancing scheme is successfully executed; at the moment, the leader broadcasts the execution result of the whole rebalancing strategy in the payment channel network, so that traceability of the execution of the rebalancing strategy is ensured; if the node does not finish the task of the rebalancing strategy according to the definition, the node is considered as a malicious node, the rebalancing guarantee gold is deducted, the guarantee gold is used for compensating the affected node, and the whole rebalancing process is ended;
step S0101: the novel leader election mechanism is adopted for leader election, and the election process is as follows:
step S0201: the node reports the information of the rebalancing requirements such as node information of both sides, balancing direction and demand amount of the payment channel, the deadline of the rebalancing requirement reservation, the maximum amount of the node which can be balanced, confirmation signature of both sides and the like to a leader;
step S0202: the participant reports the rebalancing demand, and when the rebalancing demand meets a certain threshold, the leader announces that the rebalancing process is ready to start to all nodes in the network;
step S0203: all nodes re-measure the re-balance demand of the nodes, and re-count and report the re-balance demand; meanwhile, the transaction amount in the current payment channel is frozen according to the self demand, so that the rebalancing strategy can be smoothly executed;
step S0301: starting a rebalancing strategy process, and calculating by a leader to make a rebalancing strategy;
step S0302: the leader broadcasts a rebalancing strategy to all the participating nodes and waits for the confirmation of the nodes;
step S0303: after the node receives the rebalancing strategy, whether the rebalancing strategy is fair and reasonable is calculated, and then a confirmation message is replied to the leader;
step S0304: the leader establishes the execution time of the policy and requires all nodes to uniformly execute the rebalancing policy before the rebalancing policy expires;
step S0305: all participating nodes that rebalance the policy execute the policy;
step S0306: reporting the execution result to a leader by the participant of the rebalancing strategy; the leader calculates rebalancing strategy execution cost according to the execution result;
step S0307: each node settles the commission of the rebalancing process, and the rebalancing process is finished;
step S0401: in order to improve the efficiency of executing the rebalancing strategy as much as possible, partial paths in the rebalancing strategy can be combined;
step S0501: after receiving report messages of other nodes, the leader needs to carry out statistical verification on the execution result of the whole rebalancing strategy, and judges whether the execution result meets the requirements; if all nodes finish the rebalancing scheme according to the requirement, the rebalancing scheme is successfully executed; at the moment, the leader broadcasts the execution result of the whole rebalancing strategy in the payment channel network, so that traceability of the execution of the rebalancing strategy is ensured;
the specific algorithm of using the novel policy path discovery algorithm PCRA in the novel rebalancing policy for payment under the chain is performed as follows:
(1) Deleting all nodes with all Outegrees (OD) of 0 or with all Incoming Degrees (ID) of 0 in one directed graph G (V, E); if node v.front=null|v next=null, then node V is deleted from the network.
(2) Re-recording the node with the output degree of 1 and the input degree of 1 in the original graph, and if one node V in the graph meets the OD V =1&&ID V =1, i.e. node V is contained only on edge E i→V E V→j In (3); then node V is deleted in the graph if there is no E in the original graph i→j Newly adding the edge; if the original image contains edge E i→j ,E i→j E, newly adding records in the paths, and recording more than one path from node i to node j;
(3) If node i, j are included in path E only i→j ,E j→i If yes, stopping the merging process of the nodes;
(4) Repeating steps (2) - (3) until all remaining nodes V' in the graph satisfyOD V ≥1&&ID V ≥1&&OD V +ID V ≥3;
(5) Reconstructing a new directed graph G '(V', E ') from the remaining nodes V';
(6) Placing an untagged node A in a buffer stack, and setting the tag variable A.mark of the node as a new traversal order number q i Indicating that the node participates in the code q i Setting a traversal position variable A.count=0 and A.visit=0 of the current node in the traversal process;
(7) Traversing the subsequent nodes of A in turn, judging whether a loop is formed or not, until all the nodes are traversed, and completing the traversal of A.next [ A.count ]]The corresponding node B is put in the stack, and the marking variable B.mark=q of the node B is set i Set b.count=0, b.visit=a.visit+1;
(8) Assuming that the current stack top element is P, if the node T currently corresponding to p.next [ p.count ] is already in the stack, i.e., t.visit +.0 +. & t.mark=p.mark, then the description path forms a directed ring, then all elements of the node t→p in the stack are output, while p.count++; if the node T is not in the stack, i.e., t.visit=0 & (t.mark=0|t.mark=p.mark); if all the nodes traversed before the node T do not form a loop, the node T is pushed to a stack, and meanwhile P.count++;
(9) If p.count=p.next.size, indicating that node P has been traversed, popping node P, setting p.count=0, p.visit=0, and repeating step (7) for the top of stack element;
(10) If the stack is empty, then find an untagged node a ', node a ' satisfying a '. Mark=0&&A '. Visit=0, and the node a' is reassigned with the traversal number q j Repeating the steps (6) - (9), if the node B which is marked is encountered in the traversing process, but the strong communication number is not q j I.e. B.mark. Noteq.0&&B.mark≠q j Directly skipping the node;
(11) The loops of all the outputs of the step (11) are simply processed, and all the loops R ' in the directed graph G ' (V ', E ') can be obtained by the steps (4) - (9) ' 1 ,l' 2 ……l' m };
(12) Combining all the saved temporary paths in (2) with the loop set R' obtained in (10) to obtain all the loop sets R: { l in the directed graph G (V, E) 1 ,l 2 ……l n };
The final rebalancing effect is improved by adopting a novel optimization algorithm IRDA algorithm in the novel rebalancing strategy of the under-chain payment, so that δmin represents the rebalancing requirement of the payment channel with the lowest required amount in the strategy path; delta represents the rebalancing demand it needs to adjust; r represents a commission proportion; Δr represents the amount of adjustment required for the commission; c represents the loss in one payment channel during rebalancing; cs represents the commission for performing the verification; can obtain a payment channel with no need of adjusting rebalancing requirement and its evaluation function STI E1 For the payment channel requiring adjustment of rebalancing requirement, its evaluation function STI is shown in formula (1) E2 Is formula (2);
as shown in the formula (2), for the node needing to adjust the rebalancing requirement, the overall evaluation function and the adjustment amount delta are in negative correlation and positive correlation with the loss, and for a policy path l, the overall effect is also related to the rebalancing total amount and the loss in the path, and the evaluation index can be formulated as formula (3):
in formula (3), δl represents the rebalancing requirement of all payment channels in the path, βl represents the total amount of the actual balancing of the whole path, cl represents all losses in the path due to the rebalancing strategy, and its physical meaning is as shown in formula (4):
the simultaneous expression (3) and the expression (4) can give the expression (5):
in equation (5), STIl represents the final overall satisfaction of a policy path;
the adjustment quantity delta and the commission rate r are specified within a certain reasonable range, so that the fairness of the rebalancing strategy can be ensured, and meanwhile, the overall rebalancing strategy effect is improved as much as possible on the premise of ensuring the fairness of the strategy, namely, the STIl obtains the maximum value within the value range, and the formulas (6) can be obtained by the simultaneous formulas (2), (4) and (5):
through the formula (6), the relation between the loss C and the adjustment quantity delta is established, and the formula (5) and the consensus (6) are combined to obtain the formula (7):
the relation between the overall evaluation and the required adjustment amount delta can be obtained by combining the formula (7) and the figure 7, and the proper adjustment of the commission cost in a reasonable interval range can be obtained, so that better strategy evaluation can be obtained;
as shown in formula (8), sigma has two extreme values in a certain value range, and the result of formula (9) is obtained according to the change rule and mathematical rule of the derivative function of formula (7):
in the actual calculation process, the maximum value of the formula (7) in the value range can be obtained by only bringing the result (9) into the formula (7);
decision optimization for IRDA algorithms is shown by various constraints as equation (10):
simultaneous equation (7), equation (9), equation (10), and in the actual strategy, the adjustment value is shown in equation (11):
according to the calculation result of the formula (11), a weight Wl can be calculated for each rebalancing strategy path, then all paths are ordered according to the order of the weights from big to small, and the optimal path under the current condition is selected for the rebalancing strategy in sequence.
CN202010468395.3A 2020-05-28 2020-05-28 Rebalancing strategy execution method for sub-chain payment in blockchain Active CN111724257B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010468395.3A CN111724257B (en) 2020-05-28 2020-05-28 Rebalancing strategy execution method for sub-chain payment in blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010468395.3A CN111724257B (en) 2020-05-28 2020-05-28 Rebalancing strategy execution method for sub-chain payment in blockchain

Publications (2)

Publication Number Publication Date
CN111724257A CN111724257A (en) 2020-09-29
CN111724257B true CN111724257B (en) 2024-04-12

Family

ID=72565381

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010468395.3A Active CN111724257B (en) 2020-05-28 2020-05-28 Rebalancing strategy execution method for sub-chain payment in blockchain

Country Status (1)

Country Link
CN (1) CN111724257B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113411338B (en) * 2021-06-17 2022-06-07 北京工业大学 Resource transaction method based on-chain-down cooperation of state channel
CN113763163B (en) * 2021-07-22 2023-11-17 中山大学 Block chain payment channel network transaction commission distribution method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106651089A (en) * 2016-09-19 2017-05-10 清华大学 Modeling and optimization method for production scheduling problem distribution set robust model
CN110852485A (en) * 2019-10-15 2020-02-28 中山大学 Transaction path short-circuiting method of block chain payment channel network
WO2020041878A1 (en) * 2018-08-30 2020-03-05 Neuralia Technologies Inc. System and method for improved blockchain-implemented smart contract

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190095879A1 (en) * 2017-09-26 2019-03-28 Cornell University Blockchain payment channels with trusted execution environments

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106651089A (en) * 2016-09-19 2017-05-10 清华大学 Modeling and optimization method for production scheduling problem distribution set robust model
WO2020041878A1 (en) * 2018-08-30 2020-03-05 Neuralia Technologies Inc. System and method for improved blockchain-implemented smart contract
CN110852485A (en) * 2019-10-15 2020-02-28 中山大学 Transaction path short-circuiting method of block chain payment channel network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
High Throughput Cryptocurrency Routing in Payment Channel Networks;Vibhaalakshmi Sivaraman et.al.;《17th USENIX Symposium on Networked Systems Design and Implementation》;第777-796页 *
Revive: Rebalancing Off-Blockchain Payment Networks;Rami Khalil et. al.;《CCS’17:Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security》;第439-453页 *

Also Published As

Publication number Publication date
CN111724257A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN110427433B (en) Block chain consensus method and storage medium
CN111754000B (en) Quality-aware edge intelligent federal learning method and system
CN111724257B (en) Rebalancing strategy execution method for sub-chain payment in blockchain
CN102710508B (en) Virtual network resource allocation method
CN110503558A (en) A kind of processing method and processing device based on block catenary system
US20210083849A1 (en) Contribution incentive-based blockchain collaboration method and system
CN110119399B (en) Business process optimization method based on machine learning
WO2022267715A1 (en) Oracle machine node screening method and apparatus, and storage medium and electronic apparatus
He et al. Three-stage stackelberg game enabled clustered federated learning in heterogeneous UAV swarms
CN107483355B (en) Data center-oriented online scene low-bandwidth overhead traffic scheduling scheme
CN116366669A (en) Consensus method based on reputation value weight balance suitable for crowdsourcing system
CN107454009A (en) The offline scenario low bandwidth overhead flow scheduling scheme at data-oriented center
CN113448694B (en) Block chain consensus method for improving transaction processing capability
CN113342418B (en) Distributed machine learning task unloading method based on block chain
An et al. Market Based Resource Allocation with Incomplete Information.
CN110119268B (en) Workflow optimization method based on artificial intelligence
CN115329985B (en) Unmanned cluster intelligent model training method and device and electronic equipment
CN116774657A (en) Dynamic scheduling method for remanufacturing workshop based on robust optimization
CN115115064A (en) Semi-asynchronous federal learning method and system
Landis et al. Stackelberg attacks on auctions and blockchain transaction fee mechanisms
CN110135747B (en) Flow customization method based on neural network
CN114218776A (en) Distributed simulation implementation method based on block chain
CN102869026A (en) Distributed estimation method and system based on cooperative communication
CN113761450A (en) PPP project interest distribution method based on correction interval fuzzy sharey value
CN115460080B (en) Blockchain-assisted time-varying average field game edge calculation unloading optimization method

Legal Events

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