Lightning Network Economics: Topology
Abstract
By design, the Bitcoin protocol has a low throughput. The Lightning Network (LN) is a layer-two solution built to increase throughput by cryptographically securing commitments to transactions and only occasionally converting cumulative balances into on-chain transactions. LN channels enable payments between nodes connected by a path of channels. The payment flow through a channel determines its cost. Different channel topologies can support the same underlying flows but impose different costs. This paper obtains necessary conditions for cost-minimizing topologies by identifying local cost-reducing strategies. The first local strategy entails repositioning of channels. The second entails adding hubs to handle the flows of groups of nodes. The paper also evaluates the efficiency of a global configuration, obtaining bounds on the minimum cost topology and showing the unusual circumstances in which the cost minimal structure is a hub that connects to all other nodes.
This paper was accepted by Joshua Gans, business strategy.
Funding: This work was partially supported by Science Foundation Ireland [Grants 16/IA/4443, 16/SPP/3347], Columbia-International Business Machines Center for Blockchain and Data Transparency, Chaire Fintech at University Paris Dauphine-Paris Sciences et Lettres, Algorand Foundation, and Simons Institute.
1. Introduction
As originally conceived, the Bitcoin payment system records every transaction on its blockchain. This design feature, coupled with the blockchain’s limited capacity, imposes a ceiling on the throughput of the Bitcoin payment system. That ceiling amounts to fewer than 10 transactions per second—a low number in comparison with other payment systems, such as Visa. However, that limited throughput can be expanded, even substantially so, by payers committing to transactions off-chain and only occasionally posting these commitments on-chain. The Lightning Network (LN) is such a device (Poon and Dryja 2015).
The Lightning Network consists of nodes and channels that connect pairs of nodes. Each channel is associated with a net payment flow through it. Two nodes are directly connected if there is a channel between them and are connected if there is a path of channels that enables flows between the nodes. Thus, any node on an LN can pay any other node in the same connected component of the LN. The LN is the leading example of a class of layer-two solutions called payment channel networks (PCNs). This paper’s results apply also to other PCNs.
The cost of a channel in the LN arises from locking funds in the channel and from the fees that occasionally need to be paid to rebalance it.1 At the leading order, the cost of a channel is an increasing function of the average net flow.2 In particular, in a symmetric channel, the flows offset each other, and the overall cost is negligible in comparison with a channel with nonzero net flow. Thus, at the leading order, the cost of a channel between Alice and Bob is approximately the same, whether (i) Alice, on average, sends Bob one unit annually or (ii) Alice, on average, receives one unit from Bob annually or (iii) Alice, on average, sends Bob 11 units annually and Bob, on average, sends her 10 units annually. The cost-minimizing network is always connected because symmetric channels, which have negligible costs, can be added to connect all components as needed. (Guasoni et al. (2024) offer the details.)
The LN is designed to support a given set of flows between a given set of nodes. In principle, these flows could all be posted on the blockchain, but directing them through the LN is less costly. Starting with an arbitrary LN, the paper considers cost-reducing modifications of that LN.
The present paper identifies channel configurations that are excessively costly and offers procedures to replace them with less costly configurations. The first part of the paper shows that a cost-reducing reconfiguration is available if there are two distinct channels attached to the same node, which is the origin in one of the channels and the destination in the other. Direct corollaries of this result are (i) the presence of a cycle with an odd number of channels implies the availability of a cost-reducing channel reconfiguration and (ii) a cost-minimizing LN is always a bipartite graph. The common intuition of both findings is that, in a cost-minimizing configuration, all the flow should be from net payers to net payees, avoiding intermediate steps.
The second part of the paper considers adding a new node to the network, connecting a set of existing nodes to that new node and deleting all the other preexisting channels connecting these nodes to each other. In this new star-like configuration, all flows among the set of nodes go through the star’s center, which is the newly added node. The paper’s second part articulates (i) the conditions that the set of nodes needs to meet for the reconfiguration to be cost-reducing; (ii) a polynomial-time algorithm to find such a set of nodes in a given LN; (iii) a proof that such a set must exist if the average number of channels involving each node is large enough; (iv) a proof that such a set is very likely to exist if the network flows are chosen randomly, according to a distribution whose tails are not thicker than a power law.
The third and last part of the paper establishes bounds on the minimum possible cost of an LN that supports a given set of flows. The upper bound is at most twice as large as the lower bound. A star, in which a single hub connects all nodes, in general, is not the least costly topology, but is no more than twice as costly. Finding the exact cost-minimizing topology is an NP-complete problem in general. However, the concluding result describes a quadratic-complexity algorithm to construct a two-factor approximation of the minimum, which is robust to the improvements identified in the paper.
The paper’s results consider the cost of LN topology from the viewpoint of aggregate welfare, abstracting from the issue of assigning such costs to individual nodes. The rationale for this analysis lies in the familiar Coase (1960) theorem, whereby aggregate cost savings can be achieved by rational participants who are willing to share them. Identifying protocols that encourage participants to share aggregate savings is an important topic that lies beyond the scope of this paper.
The next section briefly reviews the literature on the topology of the lightning network and its implications. The following section presents the model of the LN and the cost functions of channels. Section 3 contains the main results of the paper. Section 4 presents an algorithm that gives an LN that approximates the minimal cost possible, and Section 5 contains empirical results. Concluding remarks are in Section 6. Appendices A–D contain the proofs of the results. Appendix E provides an example of cost function that meets the definitions in the model, whereas Appendix F reports the statistics of the lightning network snapshots examined in the empirical section.
1.1. Related Work
Guasoni et al. (2024) study the economics of channels, (i) identifying conditions for two parties to optimally establish a channel, (ii) finding explicit formulas for channel costs, (iii) obtaining the optimal collateral and savings entailed, and (iv) deriving the resulting reduction in congestion of the blockchain. Brânzei et al. (2022) obtain partial results on the cost of channels.
Ersoy et al. (2020) discuss game-theoretic aspects of channel construction. In Sali and Zohar (2020), together with game-theoretic questions, the authors show that, under the assumption of all channels being symmetric, the cost of an LN with a star topology is at most twice the minimal possible cost. Theorem 4 and Corollary 4 in this paper generalize this result to any set of channels, symmetric or not.
Several papers study the current topology of the LN (e.g., Lin et al. 2020, Martinazzi and Flori 2020, Seres et al. 2020), observing that the topology is tending toward the centralized hub-and-spoke structure. In Bartolucci et al. (2020), the authors predict the future topology of the LN using tools from percolation theory, abstracting from economic incentives.
Network topology has significant security implications. Rohrer and Tschorsch (2020) introduce an attack that allows routing nodes to learn the destination of a payment—information meant to be private. Empirical results concerning privacy attacks in the LN are in Kappos et al. (2021). Channels may be rendered unusable by an adversary performing a denial-of-service attack. This and similar attacks are discussed in Rohrer et al. (2019). (For mitigation strategies, see Shikhelman and Tikhomirov 2022.) Attacks that aim to steal funds by flooding the base blockchain (Harris and Zohar 2020, Sguanci and Sidiropoulos 2023) become significantly easier under certain topologies. The general robustness of the network also heavily depends on its structure as shown in Lee and Kim (2020).
Liquidity management and throughput maximization in the LN influence both the costs of routing nodes and the success probability of payment routing. Several papers (e.g., Pickhardt and Nowostawski 2020; Sivaraman et al. 2020; Papadis and Tassiulas 2022, 2023) study the state of the current network and suggest potential improvements to the protocol.
Payments in the LN and in PCNs in general often use a route between two nodes instead of opening a direct channel. Contemporary routing algorithms take into account not only fees, but also privacy, efficiency, success probability, and other parameters. Examples of such algorithms include Grunspan et al. (2020), Roos et al. (2017), Tang et al. (2020), Varma and Maguluri (2021), Wang et al. (2019), and Yu et al. (2018). The performance of these algorithms depends on the topology of the network.
2. The Model
The starting point is a network of n nodes (or users) with some desired rates of flow. Each user i has some required payment rate (positive or negative) from each other user j. The flow represents the aggregate of such required payments. The problem is how to organize their execution so that each user’s net flow is . In other words, though the problem’s original inputs may be the required payment rates, its solution only depends on aggregate net flows, which are the focus of the discussion that follows. For example, Alice might send at rate three to Bob and receive at rate one from Carol. Thus, her overall flow is . If Bob receives three from Alice and does not send or receive from anyone else, his flow is three.
Denote the sequence of net flows as . Because each payment is debited to the payer and credited to the payee, the sum of all the flows is zero, that is,
At the modeling level, this accounting identity means that represents the aggregate flow to node i within the network, excluding outside means of payments, such as on-chain transactions or physical transfers.
To facilitate these flows over the LN, channels must be established. A flow between two nodes may or may not be supported by a channel connecting them. Rather, it can be supported by a path of connected channels through which the flow is routed with the flow starting in one node (the origin) and ending in the other (the destination). Thus, a node need not have a channel with every other node with which it interacts. If Alice has channels with both Bob and Carol, Bob can send funds to Carol through Alice even in the absence of a direct channel between Bob and Carol.
A channel’s size is the amount locked in it. That amount entails a cost that depends on the expected flow through the channel. We assume that the parties to a channel choose the cost-minimizing size. Moreover, cost minimization implies that the amount locked by each party increases with the relative frequency of payments sent rather than received. (Guasoni et al. (2024) offer a formal development of these results.) Thus, the cost of the channel is a function of the flow. The cost function is general, representing the leading order of the cost of a channel and relying only on a few assumptions that capture some basic properties: it must be increasing in net flow, invariant to its direction, and null for channels with zero net flow (including absent channels).
2.1. Channel Network
Channels connect nodes to support the required net flows. For two nodes, say u and v, denote by the net flow from u to v. If there is no channel between u and v, then . Thus, the matrix is, by definition, antisymmetric as . For example, if the channel is between u and v with u sending three and v sending one, then the net flow of the channel is two. Denote the above channel as .
A given LN supports the underlying payment flow if, for every node i, the sum of net flows in the channels involving i sums up to the net flow of i, that is,
In particular, the matrix describes the flows along each edge, whereas the vector describes the net flows to each node.
2.2. Cost Function
In general, the cost of a channel may depend on a variety of properties, including the statistical properties of arrival times and sizes of payments (as well as the cost of opening and closing a channel, which is common to all channels). Yet both models of money demand (Baumol 1952, Tobin 1956, Miller and Orr 1966) and recent models of Lightning channels (Brânzei et al. 2022, Guasoni et al. 2024) highlight that, at first order, a sufficient statistic of a channel’s cost is its net average flow. In particular, the cost of channels with zero net flow is of second order.
Motivated by these observations, this paper offers a first order analysis in which a channel’s cost is modeled as a function of its average flow. Rather than providing an analysis based on a specific cost function, the results are established for a general cost function that satisfies the following structural conditions:
(MO) for (monotonicity).
(SY) (symmetry).
(CI) (costless inaction).
(SA) for (subadditivity).
Assumption (MO) stipulates that a channel’s cost increases in its average flow. When the flow is unidirectional, it is clear that a larger flow requires a bigger channel so as to reduce the frequency of resets, and a bigger channel implies a larger opportunity cost (creating a channel requires depositing its full amount, which cannot earn interest or be used for other purposes). Further, if the same average flow arises from bidirectional payments, the required channel is even bigger because a party’s balance may be depleted also because of random fluctuations in payments’ directions.
Assumption (SY) specifies that a channel’s cost depends on the average flow without regard to the identities of the two parties: if Alice pays Bob at unit rate or vice versa, the optimal channel’s cost is the same. This property stems from the decentralized nature of PCNs, whereby the same rules and protocol apply to all users without distinction. Note also that the cost function refers to the total cost of operating a channel regardless of how such costs are allocated between the two parties.
Assumption (CI) has a dual meaning. First, it recognizes that the absence of a channel does not generate any costs. Second, it implies that the cost of an average zero flow, such as a symmetric random walk, is negligible in comparison with an average positive flow. Intuitively, the cost of symmetric flows stems entirely from random fluctuations, which occasionally deplete a channel’s balance even in the absence of directional flow and are second order to average flow. This intuition originates from the comparison of unidirectional (Baumol 1952, Tobin 1956) and symmetric (Miller and Orr 1966) models of money demand and is confirmed in recent models of payment channels (Brânzei et al. 2022, Guasoni et al. 2024). This assumption is appropriate in this paper because it aims to study first order effects, which depend on average flows alone.
Assumption (SA) states that combining flows in a single channel is cheaper than handling each of them in a separate channel. This property is natural for three related reasons: First, merging the balances of two channels into one saves on reset costs, which are fixed, regardless of a channel’s size. (Because the total balance is the same, opportunity costs do not vary.) Second, a single channel may be able to handle payments of larger size (two channels of size one and two each cannot process a payment of 2.5, but a channel of size three can). Third, if channels’ balances are affected by random fluctuations, then a single channel can withstand more shocks before requiring a reset.3 In the cryptocurrency context, this property also reflects the fixed costs that creating a channel entails regardless of its size. Such costs are instead related to the space occupied on the blockchain and play the same role as withdrawal costs in models of money demand.
The results below on hermetization (Theorems 2 and 3) also require a slightly stronger property than subadditivity:
(SA+) for some strictly increasing ,
Assumption (SA+) requires that channel costs exhibit economies of scale: as a channel’s flow is scaled by a factor, its average cost (defined as the channel’s cost divided by the factor) should decrease as the factor increases.4 In practice, in the typical setting of for some , this property is satisfied for for and some constant . (Appendix E verifies that the cost function obtained in Guasoni et al. (2024) satisfies these properties.)
A channel maps to a flow of . Denoting by the cost of the specific channel between u and v, it equals the cost function of the net flow:
Let G be an LN with net flows , the cost of G is defined as the sum of the costs of all of the channels:
3. Main Results
This section contains the statements of the main results. Given an underlying payment flow and an LN that supports it, consider different cost-reducing changes to the LN. The first change is to locally restructure channels among a subset of nodes in the LN. The second change is the addition of a new node that serves as a hub for several nodes that previously had channels between them. The problem is to understand which topology minimizes the overall cost among the topologies that support .
Note that the present analysis focuses on recurring costs, that is, costs per unit of time. Thus, the costs of replacing the channels of one topology with the channels of another topology, which are one off, are neglected. Of course, the rationale is that small recurring savings over time exceed their initial one-off costs.
3.1. Local Channel Reconfiguration
First, consider the case in which a given set of nodes reconfigures the channels between them to reduce the overall cost. In general, a smaller node set is more likely to reach an agreement on channel reconfiguration.
Theorem 1 states that, given three nodes u, v, and w, if there is a channel directed from u to v and a channel directed from v to w, then this topology is not cost minimizing. It offers a cost-reducing improvement, which is summarized in Figure 1.

Notes. The first configuration costs more than either the second or the third one. (a) Not cost minimizing. (b) Cost minimizing if . (c) Cost minimizing if .
Let u, v, and w be nodes and assume that there is a flow of from u to v and a flow of from v to w. Then, the structure is not cost minimizing. A less costly structure is either if or if .
An important message of this result is that cost minimization fosters disintermediation in that it is inefficient for a node to merely forward others’ payments. Instead, Figure 1 shows that a natural partner is someone with strong personal flow with one party who can benefit from offsetting some of this flow by forwarding payments in the opposite direction, thereby extending a channel’s life and abating reset costs. Such a partner is not a traditional intermediary for two reasons. First, payments forwarded on behalf of others are less than the partner’s own flow. Second, in a competitive equilibrium, the partner would not charge any fee to forward such payments and would even accept a small negative fee—if it were possible5—because forwarding payments to offset personal flows reduces one’s costs.
A simple example helps illustrate this point: imagine that Alice’s employer (u) pays Alice’s bank (v), which pays Alice (w). This arrangement is not optimal: if Alice’s salary is greater than Alice’s net payments (because she uses some of the salary to buy goods and services), then the employer should pay Alice in relation to her net flow, keeping a channel with her bank. However, if Alice’s net payments are higher than her salary (because she has additional income in excess of expenses), the employer is better off paying her gross salary, leaving her to independently manage unrelated flows.
Note also that Theorem 1 does not require the subadditivity condition (SA). In this sense, disintermediation is a very basic feature of payment-channel networks, independent of economies of scale (or lack thereof) that underpin subadditivity. Instead, disintermediation results from avoiding multiple transfers in the same direction.
Two corollaries follow from Theorem 1: (i) an odd cycle is not cost minimizing, and (ii) a cost-minimizing LN must be a bipartite graph.
Let be a cycle of length k; that is, a channel connects to for every and to . (The flow in the channels can go in either direction.) If the cycle has an odd length, then it is not a cost-minimizing structure.
A stylized implication of Corollary 1 is that a cost-minimizing topology should have no triangles, and therefore, its clustering coefficient should be zero. (The clustering coefficient is the fraction of connected triples that are also triangles. See Section 5 for details.) Section 5 examines empirically this testable prediction and finds that the LN has indeed an unusually low clustering coefficient in comparison with other payment networks.
If an LN is cost minimizing, then it is a bipartite graph with all net flows from A to B.
3.2. Adding a Routing Node
Centralization is a natural means to simplify a network by routing flows through a single node, thereby requiring no more than a channel for each user. In the case of the Lighting Network, the question is whether a low number of channels also translates in low aggregate costs. A broader goal is to understand whether economic forces, such as collective cost minimization, may progressively drive the network’s topology toward a central structure. This section examines the extent to which centralization may reduce costs.
Consider a set of nodes that can benefit from deleting all the channels between them and connecting the nodes to a new node that serves as a single central hub. Such sets are defined as hermetizable. (See Figure 2.) An LN is hermetizable if it contains a hermetizable set.

Notes. (a) Original configuration. (b) Hermetized configuration.
Theorem 2 gives sufficient conditions for the existence of a hermetizable set in an LN and presents an efficient algorithm to find such a set if it exists. Theorem 3 proves that, under mild assumptions on the distribution of channel costs in the LN, the probability of the LN being hermetizable is high.
Note that, in principle, the central hub does not have to be a new node; it could be one of the existing nodes. When thinking about real-world examples, this prospect is not very likely. Nodes represent a specific individual or business and process the transactions to and from their represented entity plus the transactions that transit through them on behalf of others. Being a central hub is another specialization, which demands the continuous maintenance of several channels through refills, resets, and other liquidity-management measures. Thus, we conservatively assume that regular nodes are not amenable to take such a role, leaving it instead to specialized nodes. In principle, if one of the existing nodes became the hub, the cost of the LN would be slightly lower as its own traffic would not be required to pass through another hub. For this reason, both Theorems 2 and 3 hold even if an existing node were used as hub instead of a new node.
Note also that hermetized configurations are not optimal in general even if the central hub is chosen among existing nodes. Unless the central hub is the sole payer or the sole payee, one of the spokes is a payee and another a payer, resulting in payment forwarding, which is suboptimal according to Theorem 1. The main message of Theorems 2 and 3 is that, under mild assumptions, hermetization leads to lower—not minimal—costs.
To state Theorems 2 and 3 formally, the following definitions are necessary.
Let be a graph and a node. Denote by the degree of v, which is the number of channels that involve v, that is, and let be the average degree
Let be an LN. For every node v, let be the smallest flow of a channel adjacent to v and be the largest, that is, and . Define the discrepancy of G as
The hermetization of a set of nodes U in an LN is the graph obtained by
Deleting all channels among nodes in U.
Adding a new node .
Connecting all nodes in U to with channels that aggregate their flows toward other nodes in U.
A set of nodes U is hermetizable if hermetizing it reduces its cost. An LN is hermetizable if there exists a set of nodes U in the LN that is hermetizable.
Theorem 2 offers a sufficient condition for the existence of a hermetizable set and a polynomial-time algorithm to find it.
Assume a cost function with the properties (MO), (SY), (CI), (SA+). If G is an LN with , then it is hermetizible, and there is a polynomial-time algorithm to find a hermetizable set U.
A natural question is whether the conditions of Theorem 2 are met by a typical LN. Theorem 3 shows that, if the LN is chosen randomly using a distribution with tails that are not thicker than a power, then, with high probability, its cost can be reduced by hermetization as in Theorem 2, indicating that cost reduction is the norm, not the exception.
Theorem 3 examines the situation in which flows are chosen randomly (and independently) with the same distribution. If the distribution of the resulting costs in the LN has a tail thinner than power and each is either zero or has a uniform lower bound, then the LN is hermetizable with high probability.
Assume a cost function with the properties (MO), (SY), (CI), (SA+) and that the size of each channel is distributed according to a law such that, for all channels ,
There exist , such that for all .
There exists such that .
Then, the LN is hermetizable with probability greater than or equal to
3.3. Bounds on the Global Minimal Cost of an LN
Finally, consider the minimal possible cost of an LN that supports the flow and denote it by
The following bounds hold for any flow.
For any ,
Recall that a star topology corresponds to a graph in which one node has edges with all others, and no other edges exist. The star topology is a natural candidate for the globally cost-minimal topology because it has the minimal number of edges for a connected graph. The global bounds in Theorem 1 clarify the conditions under which a star is optimal and the extent to which it is close to optimal.
Clearly, if there is only one net payer or only one net payee then a star with such a user as the star’s center minimizes costs because it achieves the lower bound in Theorem 1. The next corollary shows that this condition is also necessary, namely, if there are at least two payers and two payees, then the star does not minimize costs.
Given , if there are distinct such that , then a star is not cost minimizing.
In addition, another implication of Theorem 4 is that the star topology is at most twice as costly as the minimum.
For any flow , a star topology costs at most .
The results so far suggest that a few iterations of the improvements described above could lead to an exact minimal-cost topology. If so, the previous results would imply an exact optimization algorithm with quadratic complexity. In general, this is not the case. The main observation is that the cost-minimization problem for general cost functions nests combinatorial optimization problems that are known to be NP-complete.
For any cost function satisfying the structural conditions (MO), (SY), (CI), (SA), the network cost-minimization problem is NP-complete.
The intuition of this result is relatively simple and is exemplified by a minimal example: if there are many payers and only two payees (or vice versa) and it is possible to assign each payer to a single payee so that both payees receive their flow, then finding the matching subset for a payee is equivalent to identifying (or determining the absence of) a subset of numbers with a given sum. This is the subset-sum problem, which is known to be NP-complete, because its solution requires us to examine nearly all subsets of payers (Karp 1972).
(
input: A vector of flows such that .
output: A LN network supporting the input flow.
; for ; for . Create a star centered at 1.
repeat
Find suboptimal pairs .
for in P do
:= disintermediate() Eliminate suboptimal pair.
until P empty
return .
function getpairs()
posindex[i] := negindex[i] := 0 for i in 1 to n. Initialize sequence of indexes.
pos := 0; neg := 0; P = . Initialize iterators.
for i in 2 to n do
if then
pos += 1; posindex[pos] := i; Record position of outflow from 1.
else if then
neg += 1; negindex[neg] := i; Record position of inflow to 1.
for i in 1 to min(pos,neg) do Add outflow- inflow pair to list.
add (posindex[i],negindex[i]) to P.
return P.
function disintermediate() Improvement in Theorem 1 to .
if then If the flow between i and 1 is greater than the flow between j and 1.
; j routes through i.
; The channel between 1 and i accounts for the flow from j.
j no longer has a channel with 1.
else The flow between i and 1 is at most the flow between j and 1.
; i routes through j.
; The channel between 1 and j accounts for the flow from i.
; i no longer has a channel with 1.
return .
4. Algorithm
The NP-completeness of the exact cost-minimization problem and the previous results on cost reduction motivate the development of an algorithm that approximates the minimum, keeping computational complexity polynomial. In this spirit, the following quadratic-time algorithm yields a two-factor approximation: a network whose cost is less than twice the theoretical lower bound.
Algorithm 1 proceeds by first creating a star centered on node 1. Then, the function getpairs assigns to each other node a payer or payee number, depending on the sign of its flow. Then, payer–payee pairs are created (first payer with first payee, etc.): as each such pair is suboptimal by Theorem 1, the function disintermediate replaces it by a cheaper pair. The identification replacement continues until further improvements are no longer possible.
For any , Algorithm 1
Has quadratic complexity.
Returns a network that cannot be improved by Theorems 1 and 2.
Has cost less than twice the minimal lower bound in Theorem 4.
5. Lightning Network Structure
The preceding sections establish and study attributes of a cost-minimal Lightning Network, thus motivating the empirical examination of the visible parts of the actual LN. The goal is to understand the connectivity properties of the Lightning Network and evaluate the extent to which they are consistent with the implications of the above results.
The LN is decentralized. Its nodes use the gossip protocol to broadcast to each other newly created and deleted public channels. Thereby the information is synchronized across the nodes. (Synchronization delays of a few seconds are possible.) The Lightning Network does not allow entities that do not own a channel to learn anything beyond the channels’ existence and their size and fee policies. Enhanced privacy is one of the main features of the LN, and improvements are regularly implemented to reduce any leakage of information. Such built-in privacy features entail that nodes’ flows cannot be observed, thereby placing limits on testable implications. Yet a key necessary condition within the observable purview is the absence of cliques, which is evaluated quantitatively as low clustering. This section examines clustering in the LN over time and in comparison with other payment networks.
The data set in Table F.1 summarizes 23 monthly snapshots of public channels in the LN from October 2020 to July 2023 obtained from a Lightning node (Decker 2023). (Observations contain gaps from November 2021 to January 2022 and from August 2022 to April 2023. Data in the months immediately before and after the gaps may be incomplete but are, nevertheless, included for the sake of integrity.)
Publicly available information about each channel includes its size and its parties but not their respective balances or balance updates (i.e., payments from one party to another). Moreover, even nodes that act as payment intermediaries in chains of transfers do not know the origin and the destination of the payments they facilitate, but merely the identity of the two nodes from and to which they transfer funds.
Yet even the limited amount of publicly available information allows us to probe some implications of our results. Specifically, Corollary 1 states that a cost-minimizing network should not contain cycles of odd length and, in particular, triangles, that is, cycles of three nodes. In the parlance of graph theory, this property means that the clustering coefficient should be zero as now explained.
Defining a triplet as three nodes i, j, k connected by at least two channels, the clustering coefficient is the fraction of triangles (i.e., triplets connected by three channels) out of all triplets (i.e., connected by at least two channels). It is formally defined as6
Thus, in theory, Corollary 1 implies that it is suboptimal for three channels to exist in any triplet; hence, the numerator in this equation should be zero as should be the clustering coefficient.
In practice, the clustering coefficient need not be zero for multiple reasons. First, a channel may have its balance mostly shifted to one party, making the usual payer unable to make payments and indifferent to closing the channel. Yet the balance’s main owner may delay closure to times when on-chain transactions are cheaper (such as the weekend). Second, a channel may have already been closed but unilaterally, thereby requiring a delay (time lock) of several days to finalize. Third, the channel may serve other purposes than payments, such as liquidity management or redundancy (Papadis and Tassiulas 2020), which are not modeled here.
Notwithstanding these caveats, the broad message of Corollary 1 is that triangles are generally not cost-efficient and, therefore, should be infrequent in comparison with other payment networks with different cost structures. Figure 3 plots the clustering coefficient (along with the number of nodes and edges) of the LN snapshots over time. Two features are apparent despite the gaps in observations: the clustering coefficient is low and steadily decreases over time. (The slope of the regression line in Figure 3 is −0.98 and is significantly negative; .)

The clustering coefficient never exceeds 6% in any of the snapshots considered: choosing three random nodes connected by two channels, it is very unlikely that also a third channel is present among them. In fact, even 6% is a rather low figure for a payment network. As a comparison, consider Venmo, a payment network owned by Paypal, in which users can send funds to each other. Venmo has both differences and similarities to the LN: as in the LN, funds held in Venmo accounts do not earn interest. However, unlike the LN, Venmo balances are held in a single user account rather than in the bilateral channels typical of the LN, and there is no cost in connecting to another user. Also, payments among users are handled centrally rather than routed though nodes.
Absent any incentive to minimize their number of connections, Venmo users create as many of them as their payees. Thus, the resulting network can be considered as a reference case in which channel costs are null. Empirically, Bhattacharya et al. (2020) and Zhang et al. (2017) report that the clustering coefficient in Venmo is 14.7%—more than twice the LN clustering of 6% in October 2020 and more than five times its 2.8% clustering in July 2023.
As, in the LN, clustering is several times smaller than it is in payment networks with costless connections, it is tempting to ascribe such difference to efficiency choices rather than to payment relationships. More broadly, one might interpret the declining clustering coefficient as a gradual evolution of the LN toward a more efficient structure, fueled by growth in its size, reach, and sophistication of participants. Yet these macroscopic network properties do not provide direct observation of the network’s payment efficiency per se because payment flows cannot be observed publicly in the LN.7 Thus, these topological changes could also be related to a natural lower clustering of active payment relationships in general, of Lightning adopters in particular, or may be due to other phenomena.
6. Conclusion
Blockchains are at the heart of multiple protocols designed to manipulate ledgers securely in a decentralized fashion. Low throughput is a weakness shared by many of these protocols. A way to address this weakness is to relegate transaction processing to a device outside the main blockchain, secure these transactions cryptographically off-chain, and periodically post a summary of the transactions on the blockchain, thereby incorporating these originally off-chain transactions into the consensus. The Lightning Network is one of the most popular layer-two solutions. It supports Bitcoin payments.
The term “Lightning Network” often refers to collections of paths that support payments between nodes that are not directly connected. Intermediate nodes of an LN can and often charge fees to facilitate the intermediation. Viability of the LN protocol requires cryptographically guaranteed communication between nodes along the payment route. (For details, see Guasoni et al. (2024).)
This paper focuses on cost reduction through modifications of the LN. LN modifications amount to modifications of the LN topology, which affects various performance aspects, such as payment success rate, node privacy, and censorship resistance. Thus, reconfiguration of the LN to reduce cost can have wide-ranging implications beyond mere cost reduction.
The paper shows that computing the general global minimum cost configuration is an NP-complete problem and then describes a quadratic-time algorithm that is guaranteed to achieve a two-factor approximation. It also addresses the intuitive conjecture that a star-like structure is cost minimal. It is not.
Although the LN protocol treats all nodes equally, each node can differentiate itself from others by offering competitive fee rates for forwarding payments, thereby introducing a layer of heterogeneity in the network and creating the potential for centralization.
For their helpful comments, the authors thank Carla Kirk-Cohen, Jacob Leshno, Jiasun Li, Maarten van Oordt, Julien Prat, Fahad Saleh, and seminar participants at Harvard University, SIAM FME, CEBRA 2021, Chicago SAFM 2023, Amamef 2023, Simons Institute, the Technion, and the 2023 CBER Conference. Special thanks to Joshua Gans (the editor) and four anonymous reviewers who helped strengthen the paper with their insights.
Appendix A. Proofs: Local Channel Reconfiguration
This section states and proves the local change results.
To prove that the structure is not cost minimizing, consider different structures that respect the flow and have an overall cost lower than . Note that
To construct less costly structures, consider the two cases and . (In the unlikely case of , both of the constructions below are less costly than .)
In the case , observe that the structure supports the flows and has a lower overall cost. This channel structure supports the flows because
And its cost is
A symmetric argument shows that, if , the structure is superior. See Figure 1 for an illustration.
Assume the cycle is of length for some . Then, either there are at least channels directed clockwise or at least channels directed counterclockwise. For the channels not to share any nodes, nodes are necessary. As there are only nodes, two of the channels must share a node. As both channels are directed either clockwise or counterclockwise, the node shared by both has an incoming and an outgoing channel. Thus, by Theorem 1, the graph is not cost minimizing.
By Kőnig’s (1931) theorem (see also Wilson 1979), a graph is bipartite if and only if it does not contain an odd cycle. By Corollary 1, a graph that is cost minimizing does not have an odd cycle; thus, a cost-minimizing graph is bipartite. Furthermore, let A be the set of all nodes i such that , and the rest. Then, all of the flows are from A to B.
Appendix B. Proofs: Adding a Routing Node
Throughout this section, assume that the cost function c has all five properties (MO), (SY), (CI), (SA+).
B.1. Proof of Theorem 2
The proof of Theorem 2 requires several lemmas.
Let be an LN, and let be a subset of vertices. U is hermetizable if
Define to be the result of hermetizing U. Denoting the new vertex by zero, and the new channels are , where
To show that , it is enough to show that the cost that each node contributes to U is greater than the cost it contributes to . Note that
Thus, to show that , it is enough to show that, for every i,
Note that
As is increasing, the inverse function exists and is also increasing. From the above inequalities, it follows that (B.1) holds if
Denote by the minimum degree of a graph . A set U is hermetizable if .
Remembering that , , and is a monotone increasing function, it follows that the assumptions of Lemma B.1 hold. Indeed, for every ,
One of the main implications of Lemma B.2 is that a possible business model for an entrepreneur is to find subgraphs G with and offer the service of adding a new vertex. In doing so, the entrepreneur can charge a part of the users’ savings. The following lemma shows how to find such subgraphs.
There is an algorithm that, given a graph G, finds a subgraph H with if there exists one or, alternatively, returns an empty graph if there is no such H. The running time of the algorithm is .
The algorithm is as follows: at each step, delete all the vertices of degree up to until there are no more vertices to remove either because the minimum degree of the graph becomes greater than or because all vertices are deleted.
Every graph G with average degree 2d has a subgraph with .
Finding requires the following steps: define and let for be defined recursively as follows. If or is the empty graph, define . If not, let be a vertex with the smallest degree in and define .
It remains to show that the process stops before all of the vertices are deleted. By contradiction, suppose that all of the vertices in the graph were deleted. Let n be the number of vertices in G.
On one hand, each vertex deleted has degree at most d; thus, the number of edges in the graph is at most . On the other hand, the average degree is at least 2d, so the number of edges is at least dn, which is a contradiction.
Thus, the process could not have terminated with an empty graph, and there must be some subgraph of G with .
The proof of the main theorem now follows.
By Lemma B.4, if the LN G has average degree greater than , then it has a subgraph with minimal degree , and by Lemma B.3, there is an efficient algorithm to find it. By Lemma B.2, this subgraph is hermetizable, and hence, G itself is hermetizable.
B.2. Proof of Theorem 3
In view of Lemma B.1, the graph is hermetizable with a probability of at least
To estimate the last probability, note that
In addition, for any ,
Thus, it follows that, for some constant k,
Appendix C. Proofs: Bounds on the Global Minimal Cost
Consider a star LN; that is, there is a special node h such that all of the other nodes have a single channel to it. Consider the nodes , and note that one of them could be h. Out of the four nodes without loss of generality assume that ; then, as , the channel is . For similar reasons, there is a channel . By Theorem 1, the structure , is not cost effective.
To prove the upper bound, for any given flow , it suffices to construct a network that supports and has a cost of at most . Assume without loss of generality that . For each node , create a channel between node i and node 0 with .
First, note that this network supports because, for each ,
As for ,
Second, the cost of this network is , and so the upper bound holds.
As for the lower bound, examine first the flow of a single node i. A network supports if and only if . Thus, the cost resulting from the flow of is , where the inequality holds because of the subadditivity of the cost function.
Without loss of generality, assume that if and only if for some fixed k. By Theorem 1, if , it cannot be that there is a flow from i to j as this would imply that either i or j is a node that is both the origin and the destination of two different channels. The same holds if . Thus, if or .
Using the above, the lower bounds for the cost are
Repeating the same steps, it also follows that
Without loss of generality, assume that and connect each node to the node 0 with a channel such that . As , it follows that , and thus, this network supports the underlying flow. Call this network G and note that .
Let . Then,
Remembering that M is an upper bound on the minimal cost of an LN that supports the given flow, as needed.
Given a function satisfying the structural conditions, it suffices to construct flows for which the problem is NP-complete. Suppose that for some , whereas for , and that there exists a subset such that . By Corollary 2, the cost-minimal network is bipartite with nodes i, j in one class and all other nodes in the other class. By Theorem 4, the total cost satisfies the lower bound
Appendix D. Proof of Theorem 6
To prove (i), note that the function disintermediate preserves the direction of channels with 1 in that, if in its output (respectively, ), then also in its input ().
Let denote the number of pairs identified in the lth iteration of getpairs and disintermediate. The algorithm stops at the first k for which . Because the degree of node 1 after the kth iteration is and for , it follows that . Because each iteration invokes once getpairs and disintermediate, which both have linear complexity, it follows that the algorithm has quadratic complexity.
To prove (ii), first note that Theorem 1 cannot improve the network because the algorithm stops precisely when the set of improvable pairs P is empty. Second, note that the algorithm starts with a connected graph on n nodes with edges and remains so after each iteration because Theorem 1 does not change the number of edges. Thus, the graph is always a tree, and Lemma D.1 implies that hermetization cannot improve a tree.
To see (iii), recall that a star is already no more than twice as costly as the minimum by Theorem 4 even if disintermediate is never executed (as in the case in which node 1 is the sole payer or payee).
If G is a forest, hermetization does not reduce costs.
By contradiction, suppose there exists a set on nodes U that can be hermetized to reduce costs. To calculate the cost of the original LN, separate U into disjoint sets of vertices, say , such that each has at most one neighbor in . Let be the set of leaves in G. Let , and is the set of leaves in . Continue the process by defining , and is the set of leaves in . As the number of vertices becomes smaller at each step, the processes must end. For each node , denote by its single neighbor when it was a leaf. Note that each channel in the LN is between i and , and hence, the cost before the hermetization is Going back to the original LN, denote by the set of neighbors of node i. Note that . The cost after hermetization is
Because for all , it follows that hermetization did not improve the set U, thereby completing the proof.
Appendix E. An Example of a Cost Function
Guasoni et al. (2024) examine the costs of LN channels in a simple bilateral flow, obtaining the following result for the cost of a channel between two nodes. Guasoni et al. (2024, figure 4) show that first order expansions are very accurate for interest rates of up to 20%; therefore, this section focuses on such expansions for the sake of tractability.
(
And so, given a net flow of in the channel, the first order approximation of the cost function in Guasoni et al. (2024) is
It is straightforward to check that this cost function indeed satisfies properties (MO), (SY), (CI), (SA):
(MO): , for .
(SY): .
(CI): .
(SA): As for any ,
(SA+): Let for some , then
Appendix F. Lightning Network Snapshots
|
Table F.1. Summary Statistics of LN Snapshots (Decker 2023, August 23, 2022 to September 24, 2023)
| Date | Nodes | Edges | Clustering coefficient (%) |
|---|---|---|---|
| 2023-07-15 | 15,110 | 64,284 | 2.8 |
| 2023-06-15 | 14,071 | 60,059 | 3.0 |
| 2023-05-15 | 12,024 | 54,422 | 3.5 |
| 2023-04-15 | NA | NA | NA |
| 2023-03-15 | 8,887 | 44,191 | 3.9 |
| 2023-02-15 | NA | NA | NA |
| 2023-01-15 | NA | NA | NA |
| 2022-12-15 | NA | NA | NA |
| 2022-11-15 | NA | NA | NA |
| 2022-10-15 | NA | NA | NA |
| 2022-09-15 | NA | NA | NA |
| 2022-08-15 | NA | NA | NA |
| 2022-07-15 | 9,963 | 53,291 | 3.6 |
| 2022-06-15 | 5,217 | 17,658 | 2.5 |
| 2022-05-15 | 15,807 | 78,835 | 3.0 |
| 2022-04-15 | 18,739 | 81,390 | 2.8 |
| 2022-03-15 | 19,032 | 82,232 | 2.7 |
| 2022-02-15 | 3,681 | 5,669 | 3.7 |
| 2022-01-15 | NA | NA | NA |
| 2021-12-15 | NA | NA | NA |
| 2021-11-15 | NA | NA | NA |
| 2021-10-15 | 13,985 | 63,967 | 3.2 |
| 2021-09-15 | 14,289 | 66,672 | 3.6 |
| 2021-08-15 | 12,720 | 59,178 | 4.1 |
| 2021-07-15 | 11,362 | 49,776 | 3.8 |
| 2021-06-15 | 10,411 | 42,808 | 3.8 |
| 2021-05-15 | 9,727 | 39,064 | 4.0 |
| 2021-04-15 | 9,145 | 35,732 | 4.4 |
| 2021-03-15 | 7,955 | 32,307 | 4.8 |
| 2021-02-15 | 7,374 | 30,896 | 5.2 |
| 2021-01-15 | 6,806 | 29,768 | 5.7 |
| 2020-12-15 | 6,412 | 29,179 | 6.0 |
| 2020-11-15 | 6,104 | 28,729 | 6.1 |
| 2020-10-15 | 5,982 | 30,015 | 6.0 |
1 This paper focuses on the aggregate costs for the network and, therefore, abstracts from payments that are costs for a user but benefits for others, such as routing fees.
2 The leading order refers to a Taylor expansion around a zero interest rate. As shown in Guasoni et al. (2024, figure 4), the leading order approximation is accurate even for interest rates of 20%.
3 For example, imagine two channels, one of size three with balances one and two for each party, the other of size seven with balances three and four for the same parties. If the first party makes payments of three, then the reset of either channel is necessary. Instead, a single channel of size 10 with balances of four and six, respectively, does not require a reset before the first party’s payments reach four.
4 We are grateful to an anonymous reviewer who provided this clearer interpretation of the (SA+) property.
5 Current implementations of the Lightning Network require fees to be positive.
6 The denominator is the sum of the number of ordered pairs of neighbors of each node and, hence, written in terms of nodes’ degrees. The numerator cannot be written in terms of degrees only.
7 Public information can be obtained from the Bitcoin blockchain, which records the opening and closing of each channel and its balance. A lightning node may also be able to observe the flow passing through its channels but not its origin and destination.
References
- (2020) A percolation model for the emergence of the bitcoin lightning network. Sci. Rep. 10(1):4488.Crossref, Google Scholar
- (1952) The transactions demand for cash: An inventory theoretic approach. Quart. J. Econom. 66(4):545–556.Crossref, Google Scholar
- (2020) Impact of structural properties on network structure for online social networks. Procedia Comput. Sci. 167:1200–1209.Crossref, Google Scholar
- (2022) How to charge lightning: The economics of bitcoin transaction channels. Domínguez-García A, Raginsky M, eds. 2022 58th Annual Allerton Conf. Comm. Control, Comput. (Allerton 2022) (Institute of Electrical and Electronics Engineers (IEEE), Piscataway, NJ), 453–460.Google Scholar
- (1960) The problem of social cost. J. Law Econom. 3(1):1–44.Crossref, Google Scholar
- (2023) Lightning network research—Topology datasets. Accessed September 19, 2023, http://dx.doi.org/10.5281/zenodo.4088530.Google Scholar
- (2020) How to profit from payments channels. Bonneau J, Heninger N, eds. 24th Internat. Conf. Financial Cryptography Data Security, FC 2020 (Springer, Berlin), 284–303.Google Scholar
- (2020) Ant routing scalability for the lightning network. Preprint, submitted February 20, https://arxiv.org/abs/2002.01374.Google Scholar
- (2024) Lightning network economics: Channels. Management Sci. 70(6):3827–3840.Link, Google Scholar
- (2020) Flood & loot: A systemic attack on the lightning network. Meiklejohn S, Shelat A, eds. AFT ’20: Proc. 2nd ACM Conf. Adv. Financial Tech. (Association for Computing Machinery, New York), 202–213.Google Scholar
- (2021) An empirical analysis of privacy in the lightning network. Borisov N, Diaz C, eds. 25th Internat. Conf. Financial Cryptography Data Security, FC 2021 (Springer, Berlin), 167–186.Google Scholar
- (1972)
Reducibility among combinatorial problems . Miller RE, Thatcher JW, eds. Complexity of Computer Computations (Plenum Press, New York), 85–103.Crossref, Google Scholar - (1931) Gráfok és mátrixok. Matematikai és Fizikai Lapok 38, 116–119.Google Scholar
- (2011) Combinatorial Optimization, vol. 1 (Springer, Berlin).Google Scholar
- (2020) On the robustness of lightning network in bitcoin. Pervasive Mobile Comput. 61:101108.Crossref, Google Scholar
- (2020) Lightning network: A second path toward centralisation of the bitcoin economy. New J. Phys. 22(8):083022.Crossref, Google Scholar
- (2020) The evolving topology of the lightning network: Centralization, efficiency, robustness, synchronization, and anonymity. PLoS One 15(1):e0225966.Crossref, Google Scholar
- (1966) A model of the demand for money by firms. Quart. J. Econom. 80(3):413–435.Crossref, Google Scholar
- (2020) Blockchain-based payment channel networks: Challenges and recent advances. IEEE Access 8:227596–227609.Crossref, Google Scholar
- (2022) Payment channel networks: Single-hop scheduling for throughput maximization. Mao S, ed. 41st IEEE Conf. Comput. Comm., INFOCOM 2022 (Institute of Electrical and Electronics Engineers (IEEE), Piscataway, NJ), 900–909.Google Scholar
- (2023) Deep reinforcement learning-based rebalancing policies for profit maximization of relay nodes in payment channel networks. Pardalos P, Kotsireas I, Knottenbelt WJ, Leonardos S, eds. Mathematical Research for Blockchain Economy. MARBLE 2023, Lecture Notes in Operations Research (Springer, Cham, Switzerland), 1–27.Google Scholar
- (2020) Imbalance measure and proactive channel rebalancing algorithm for the lightning network. Plataniotis K, ed. 2nd IEEE Internat. Conf. Blockchain Cryptocurrency, ICBC 2020 (Institute of Electrical and Electronics Engineers (IEEE), Piscataway, NJ), 1–5.Google Scholar
- (2015) The bitcoin lightning network: Scalable off-chain instant payments. Satoshi Nakamoto Institute, Austin, TX.Google Scholar
- (2020) Counting down thunder: Timing attacks on privacy in payment channel networks. Meiklejohn S, Shelat A, eds. AFT ’20: Proc. 2nd ACM Conf. Adv. Financial Tech. (Association for Computing Machinery, New York), 214–227.Google Scholar
- (2019) Discharged payment channels: Quantifying the lightning network’s resilience to topology-based attacks. Plataniotis K, ed. 4th IEEE Eur. Sympos. Security Privacy Workshops, EUROS PW 2019 (Institute of Electrical and Electronics Engineers (IEEE), Piscataway, NJ), 347–356.Google Scholar
- (2017) Settling payments fast and private: Efficient decentralized routing for path-based transactions. Preprint, submitted September 18, https://arxiv.org/abs/1709.05748.Google Scholar
- (2020) Optimizing off-chain payment networks in cryptocurrencies. Preprint, submitted July 18, https://arxiv.org/abs/2007.09410.Google Scholar
- (2020)
Topological analysis of bitcoin’s lightning network . Mathematical Research for Blockchain Economy (Springer, Berlin), 1–12.Crossref, Google Scholar - (2023) Mass exit attacks on the lightning network. Mnaouer B, Stiller, Karray, eds. 2023 IEEE Internat. Conf. Blockchain Cryptocurrency (ICBC) (Institute of Electrical and Electronics Engineers (IEEE), Piscataway, NJ), 1–3.Google Scholar
- (2022) Unjamming lightning: A systematic approach. Cryptology ePrint Archive.Google Scholar
- (2020) High throughput cryptocurrency routing in payment channel networks. Bhagwan, Porter, eds. 17th USENIX Sympos. Networked Systems Design Implementation (Association for Computing Machinery, New York), 777–796.Google Scholar
- (2020) Privacy-utility tradeoffs in routing cryptocurrency over payment channel networks. Chaintreau, Golubchik, Zhang, eds. Proc. ACM Measurement Anal. Comput. Systems, vol. 4, issue 2 (Association for Computing Machinery, New York), 29:1–29:39.Google Scholar
- (1956) The interest-elasticity of transactions demand for cash. Rev. Econom. Statist. 38(3):241–247.Crossref, Google Scholar
- (2021) Throughput optimal routing in blockchain-based payment systems. IEEE Trans. Control Network Systems 8(4):1859–1868.Crossref, Google Scholar
- (2019) Flash: Efficient dynamic routing for offchain networks. Mohaisen, Zhang, eds. 15th Internat. Conf. Emerging Networking Experiments Tech. (CoNEXT ’19) (Association for Computing Machinery, New York), 370–381.Google Scholar
- (1979) Introduction to Graph Theory (Pearson Education India, Chennai, India).Google Scholar
- (2018) Coinexpress: A fast payment routing mechanism in blockchain-based payment channel networks. 27th Internat. Conf. Comput. Comm. Networks (IEEE, Piscataway, NJ), 1–9.Google Scholar
- (2017) Cold hard e-cash: Friends and vendors in the Venmo digital payments system. Zhang, Tang, Zhao, Wang, Zheng, Zhao, eds. Proc. Eleventh Internat. AAAI Conf. Web Social Media (ICWSM 2017) (PKP Publishing Services Network, Burnaby, BC), 387–396.Google Scholar

