From ZmnSCPxj at protonmail.com Mon Oct 10 07:38:48 2022 From: ZmnSCPxj at protonmail.com (ZmnSCPxj) Date: Mon, 10 Oct 2022 07:38:48 +0000 Subject: [Lightning-dev] Channel Costing Heuristic Based On "No Free Money" Principle. Message-ID: <6KXvBkTHjJXsEz6_fOWMpxyruW10wdAO12-WxhxB3viKjw-mHXt911XQorzGtWl-zLKW8u4TT8Y61W9NKr09QFZeBeuGv9DG3NV9bJAx-CQ=@protonmail.com> Introduction ============ First, a joke: > Once upon a time, an economist and its friend, both of > them being 100% human and not at all AIs out to take > over the Bitcoin world, were walking on a street using > 100% meat legs. > > They spotted a 1 Bitcoin Casascius coin on the street, > and they both expressed surprise and delight at their > discovery. > > Then the economist walked on without picking up the > Casascius coin. > > "Why did you not pick up the Casascius coin?" its > friend asked. > "It was free money!" > > "Because," the economist said patiently, "if it were > truly a real coin, somebody else would have already > picked it up. > Therefore, it must have been a shared delusion and > not a real coin. > There is no such thing as free money." A Heuristic For Payment Success =============================== Let us postulate the existence of a "market rate" for Lightning Network liquidity. That is, we assume that there exists some Lightning forwarding feerate that holds as the average across the entire network. Then, let us consider a path costing function which determines, for each hop, how distant the feerate at that hop (including the base fee, thus requires the payment size) is from the market rate feerate. The greater the distance, the higher the cost of that hop. A payer can make a guess of what this market rate is, by simply recording all successful payments and the feerate at each hop of tha payment, then taking the median (or mean, whatever, I am not a mathist). New nodes may have this record of successful payments to compute this market rate seeded by a node run by one or more developers of the node software. Why would a payer do this? * If the feerate is above the market rate, then it is usurious and we would lose money on that path beyond the market rate. * If the feerate is below the market rate, then by the "no free money" principle, it is unlikely that the available capacity in that direction is "real", i.e. it is likely to not actually be there, because rebalancing profiteers will have taken all the available capacity in that direction and resold it at a higher price elsewhere. As I have noted elsewhere, low feerates are exploited by self-paying rebalancer bots which continuously run. Because they keep running at all times, they are likely to have taken available capacity of low-feerate channels towards net receivers, long before any ordinary payment is ever initiated. Like the economist and its coin, somebody else must have already taken the available capacity in the demanded direction, and thus, there is no low-feerate capacity available in the direction the payer wants. This basically extends the economic "no free money" principle to a "zero free routing" principle. This is particularly relevant to proposals such as the recent proposal by Lisa where channels may have a set of four feerates, with different probability-of-success (i.e. rate cards). As noted before, this can be modelled as the channel being four different virtual channels. Payers using this "zero free routing" heuristic will select the feerate card that is closest to the market rate. Only if payment fails at that hop will the payer attempt a different rate card. We expect that rebalancing nodes will still target a very low cost, ignoring the market rate. This is precisely because they are on the lookout for capacity that has a feerate below the market rate, always looking for a bargain.