<div>Good morning Robert,<br></div><div><br></div><div>I assume, this functionality is transported also via the same onion-routing-packet style that current payment routing uses?<br></div><div><br></div><div>If so, then it seems this feature can be used by a payer and payee to coordinate to locate some route that would, if paid normally, charge fees, but if using the "free rebalancing" could be made free.&nbsp; The payer simply locates some route, adds a synthetic initial balance that is much higher than the payment to be forwarded, and then request for a "free rebalancing" from the payer to the payee.&nbsp; If at the payee node, the resulting "max" is greater than the actual payment being sent, then the payer and payee have found a fee-free route between them.<br></div><div><br></div><div>After all, since the functionality is transported by onion-routing-packet, then intermediate hop routes cannot know that the ultimate source and ultimate destination are different nodes.<br></div><div><br></div><div><div>Note that intermediate nodes cannot detect this at all.&nbsp; A fee-free rebalance request that follows the fee-free rebalance query may be lower than the max it forwarded, since, a later intermediate node on the route might have lowered the maximum already.<br></div><div><div><br></div><div>--<br></div><div><br></div><div>For myself, I think rebalancing is not a particular good solution to anything (similar to splice).<br></div><div><br></div><div>Imagine a simple 3-member cyclic-superhub network composed of A -&gt; B -&gt; C (looping back to -&gt; A).&nbsp; Node A may pay node C via B, and so on.&nbsp; Now if C is a popular merchant for both B and A, then both the B-C and C-A channels will saturate in favor of C.&nbsp; In such a case, no rebalancing is possible.<br></div><div><br></div><div>A better solution is for C to purchase more incoming balance by asking either of B or A to transfer onchain funds in exchange for a preimage (i.e. swap offchain funds for onchain funds).&nbsp; This is effectively "batching" the earnings that C gains in LN: C might earn a lot of small amounts, each one too small individually to justify onchain transfers, but which batched together can justify the onchain transfer.&nbsp; Further, this batching is noncustodial and C can close the channel at any time (incurring an onchain fee), unlike current payment processors (PayPal, credit cards) where payment batching is custodial and may be frozen by the custodian; on LN, at worst the money will be locked for a few days or weeks, but will definitely be returned to you as long as you did not actually cheat.<br></div><div><br></div><div>Further this swapping can be done on a separate layer/software that interacts with ordinary existing LN software without requiring additional changes at the LN protocol level, which is always a good thing: I believe we should prefer to make LN a layer that supports further layers, not put every possible feature into LN.<br></div><div><br></div><div>This off-to-on and on-to-off swapping solves the same problems that both rebalancing and splcing do (channel balancing, incoming channels, channel reloading) without requiring changes at the LN layer, merely adding an application on top of LN.<br></div><div><br></div><div>Regards,<br></div><div>ZmnSCPxj<br></div><div><br></div><div><br></div></div></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><br></div><div class="protonmail_signature_block-proton">Sent with <a target="_blank" href="https://protonmail.com">ProtonMail</a> Secure Email.<br></div></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On August 12, 2018 7:31 AM, Robert Olsson &lt;robban@robtex.com&gt; wrote:<br></div><div> <br></div><blockquote type="cite" class="protonmail_quote"><div dir="ltr"><div><div>Dear All,<br></div><div><br></div><div>I'd like to suggest a new function in the network, "Free Rebalancing Proposals"<br></div><div>It is a fee-less, omni-beneficial rebalancing scheme<br></div><div><br></div><div>Background:<br></div><div><br></div><div>I currently balance my nodes in the following way, extremely simplified:<br></div><div><br></div><div>1) Identify channels that have too low remote_balance (A) and too low local_balance (B) for being of any use (in that direction)&nbsp;<br></div><div>2) Find potential routes and amounts between all channels A and all channels B that would optimize at least one of them<br></div><div>3) Send a payment along those possible routes for different amounts, sorted after fee, until one succeeds<br></div><div><br></div><div>It works quite good and is quite straight forward until the third step. So I would like to propose a better solution which works like this:<br></div><div><br></div><div>Send a proposal-for-balancing-message over channel A, and the max amount you would propose to balance in that direction.<br></div><div><br></div><div>Each node analyses the in and out channels and adjusts the max to it's own desire to balance. Max can only be adjusted down. Let's say the function is `int freeBalancerMax(channel in,channel out)`. It could be as simple as checking how near "in" is to 100ksat local_balance and "out" is to 100ksat remote_balance. The node passes that message with new max value on to the next node, much like a normal payment.&nbsp;<br></div><div><br></div><div>When this packet comes back to the origin it will know how much the intermediate nodes are willing to let you balance, or if someone is reluctant to balance (and the final max value would be 0)<br></div><div><br></div><div>If everyone is happy (i.e. max&gt;0), the origin node sends a payment along this node, *without* dropping off any fees along the way, since all nodes agreed and benefit from the rebalancing act.<br></div><div><br></div><div>Since all intermediate nodes benefit they are happy to do this without fees. Since they adjust max values to their desire it will stop multiple attempts from different nodes from starting to oscillate the balances in the channels, but will instead reach some kind of equilibrium as long as the node suggesting proposal uses it's freeBalancerMax when proposing and accepting proposals.<br></div><div><br></div><div>The intermediate nodes might not need to keep track of any agreements to balancing proposals, it can simply call the freeBalancerMax function, and if the payment is lower, it passes on the payment even if it didn't get any fees, otherwise it fails as usual. If someone tries to send a non agreed payment without fees, but it coincides with the nodes own desire to rebalance, there is no harm done. Only problem with that is that senders might flood a path with creative attempts trying to find a path with a fee-free hop. I think things like that will be stopped by a general throttle functionality which probably will be needed anyhow.<br></div><div><br></div><div>Best regards<br></div><div>Robert Olsson<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></blockquote><div><br></div>