Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Paper - Modeling a Steady-State Lightning Network Economy

3 messages, Aug 9 to 14, 2019. Started by Gregorio Guidi.

Gregorio Guidi (2), ZmnSCPxj

Permalink First message in the Wayback Machine

Gregorio Guidi permalink original

Hello,

I am a mostly a passive observer in this mailing list, trying to follow the very interesting discussions and experimenting a bit with running a node on mainnet (even if I cannot always keep pace with the new developments due to limited time).

Running a node during the last months inspired some reflections and some mildly interesting mathematical explorations, which I collected in a sort of paper which might be of interest to the list:

https://github.com/gr-g/ln-steady-state-model/releases/download/v20190808/Modeling.a.Steady-State.Lightning.Network.Economy.pdf

I say "sort of paper" because there is no bibliography, and no awareness of the greater context in which these ideas can fit. That said, if anyone would be interested in making something out of these ideas (e.g. a real co-authored paper), they are very welcome to do so.

Below is the abstract. Any comment is appreciated!

Best,

Gregorio

Abstract:

In this paper, we consider an idealized scenario in which the Lightning Network (or any similar payment network) has scaled to the size and volume of a self-sustained economy, meaning that the number of on-chain transactions - including channel opening and closing - has become negligible when compared to the number of off-chain transactions, and payments continuously flow across a network with relatively stable topology. We take this scenario to the extreme and model a network where the channels are fixed, so that payments form a completely closed system, and where nodes have (on a long enough timescale) stable and perfectly balanced incoming and outgoing payments (i.e. they spend exactly what they earn). We call this scenario the "steady-state economy" of the payment network.

We argue that in such scenario, in a network of /n/ connected nodes, there is a tendency towards a state where exactly /n/-1 channels have perfectly balanced flows in the two directions ("self-balancing" channels), while all other channels are either unused, or have a permanent tendency towards imbalance: the channel balance accumulates at one end and the channel is only intermittently available in one direction ("stuttering" channels). We note that the "self-balancing" channels form a spanning tree of the network graph, which we call the "core spanning tree" of the payment network.

We also try to derive some practical lessons from this idealized scenario, hopefully providing some useful insight to node operators of the current (embryonic) Lightning Network.

At the end of the paper, we provide some remarks on the more general case in which nodes do not balance their income and expenses.

https://github.com/gr-g/ln-steady-state-model

ZmnSCPxj in reply to Gregorio Guidi permalink original

Good morning Gregorio,

Quoted text (1 line)
> We argue that in such scenario, in a network of n connected nodes, there is a tendency towards a state where exactly n-1 channels have perfectly balanced flows in the two directions ("self-balancing" channels), while all other channels are either unused, or have a permanent tendency towards imbalance: the channel balance accumulates at one end and the channel is only intermittently available in one direction ("stuttering" channels). We note that the "self-balancing" channels form a spanning tree of the network graph, which we call the "core spanning tree" of the payment network.

I have observed this as well in my armchair. Indeed, the worst-case scenario for this would be a single central hub with n-1 channels to n-1 client nodes, with the hub itself as the nth node.

Fortunately, it seems to me that such a steady state will mildly shift and additional channels will still be used intermittently. (I have not read your paper in completeness yet, only the abstract above, so if my ramblings have already been considered in your paper, do feel free to ignore me).

For instance, consider a world where Lamborghini production experiences a paradigm shift that massively reduces the cost of production while increase quality. Inevitably, Lambo prices in terms of Bitcoin will decline, as a consequence of this improvement. Thus, capacity in channels going Lamborghini producers becomes underutilized as demand for the product saturates while supply increases.

However, "complementary goods" of such products are highly unlikely to experience a commensurate increase in their own production. For example, simply because Lamborghini production increases its efficiency, does not mean that car insurance will experience the same increase in its efficiency. Thus, the supply of car insurance will remain largely the same, but demand increases due to increased usage of Lamborghinis (a well-known phenomenon in economics). This implies that capacity in channels going to car insurance providers will be overutilized and eventually saturate, leading to opportunistic reallocation of funds from Lamborghini producers to car insurance providers (and concomitant onchain activity to do this reallocation!).

Thus, I think that the minimum of n-1 channels would not remain stable for long, given an actual real-world where change *is* the steady-state. Assuming a continuously thriving and innovating global economy, we will expect that there will be transient situations where demand and supply for various products changes wildly. In such situations, any "extra, unneeded" channels would end up catching the additional capacity need as various innovations and improvements in the economy occur and create change in demand and supply. I believe the overall steady state will have c*n channels rather than merely n-1, where c is some constant greater than 1, due to various local transient demand/supply shocks.

Regards, ZmnSCPxj

Gregorio Guidi in reply to ZmnSCPxj permalink original

On August 13, 2019 6:23:31 AM GMT+02:00, ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:

Quoted text (23 lines)
>Good morning Gregorio,
>
>
>> We argue that in such scenario, in a network of n connected nodes,
>there is a tendency towards a state where exactly n-1 channels have
>perfectly balanced flows in the two directions ("self-balancing"
>channels), while all other channels are either unused, or have a
>permanent tendency towards imbalance: the channel balance accumulates
>at one end and the channel is only intermittently available in one
>direction ("stuttering" channels). We note that the "self-balancing"
>channels form a spanning tree of the network graph, which we call the
>"core spanning tree" of the payment network.
>
>I have observed this as well in my armchair.
>Indeed, the worst-case scenario for this would be a single central hub
>with n-1 channels to n-1 client nodes, with the hub itself as the nth
>node.
>
>Fortunately, it seems to me that such a steady state will mildly shift
>and additional channels will still be used intermittently.
>(I have not read your paper in completeness yet, only the abstract
>above, so if my ramblings have already been considered in your paper,
>do feel free to ignore me).

Indeed even in the abstract steady-state scenario described in the paper, more than n-1 channels are expected to be used (although intermittently).

But the more general point, anyway, is that no steady state will ever exist in practice. Thinking in terms of black and white in this case helped to clarify my thoughts around the problem (and makes for more elegant math :) ), and as sometimes happens it lets some useful knowledge emerge: this is in the end the spirit of the paper. I would say that your intuition about the continuously shifting equilibrium is in line with mine.

Quoted text (24 lines)
>For instance, consider a world where Lamborghini production experiences
>a paradigm shift that massively reduces the cost of production while
>increase quality.
>Inevitably, Lambo prices in terms of Bitcoin will decline, as a
>consequence of this improvement.
>Thus, capacity in channels going Lamborghini producers becomes
>underutilized as demand for the product saturates while supply
>increases.
>
> [...]
>
>Thus, I think that the minimum of n-1 channels would not remain stable
>for long, given an actual real-world where change *is* the
>steady-state.
>Assuming a continuously thriving and innovating global economy, we will
>expect that there will be transient situations where demand and supply
>for various products changes wildly.
>In such situations, any "extra, unneeded" channels would end up
>catching the additional capacity need as various innovations and
>improvements in the economy occur and create change in demand and
>supply.
>I believe the overall steady state will have c*n channels rather than
>merely n-1, where c is some constant greater than 1, due to various
>local transient demand/supply shocks.

I would put it simply in this way: the always-shifting patterns of demand and supply in a dense web of channels will naturally cause agents to add traffic to channels that were previously not used, and remove traffic from channels previously used, resulting in a continuous shift in equilibrium.

In this case I would not say it is a matter of "additional capacity needs", though. I think it could be misleading... a hypothetical Lambo dealer could have just one channel used for inflows/outflows of funds, and immediately send back through the channel all the received income (to buy some store of value). In such case the capacity would not matter much even with a big shift in demand.

(... and not included in the paper are a whole bunch of considerations about how having many channels helps the general resilience and flexibility of the network, but those should also be kept in mind.)

Thanks for the feedback!

Regards, Gregorio

Quoted text (2 lines)
>Regards,
>ZmnSCPxj