-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathliquidity.tex
3096 lines (2558 loc) · 146 KB
/
liquidity.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\RequirePackage{etex}
\documentclass[10pt,a4paper]{article}
\usepackage{hyperref}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{listings}
\usepackage{pgfcore}
\usepackage{url}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows}
\tikzset{
->, % makes the edges directed
>=stealth', % makes the arrow heads bold
every state/.style={thick, fill=gray!10}, % sets the properties for each ’state’ node
initial text=$ $, % sets the text that appears on the start arrow
}
\hypersetup{final}
\usepackage[
n, % o r lambda
advantage,
operators,
sets,
adversary,
landau,
probability,
notions,
logic,
ff,
mm,
primitives,
events,
complexity,
oracles,
asymptotics,
keys]{cryptocode}
\usepackage{gitinfo2}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\title{\texttt{\detokenize{Lightning Pool:}} \\
A Non-Custodial Channel Lease Marketplace}
\author{
Olaoluwa Osuntokun \\
\small{roasbeef@lightning.engineering}
\and
Conner Fromknecht \\
\small{conner@lightning.engineering}
\and
Wilmer Paulino \\
\small{wilmer@lightning.engineering}
\and
Oliver Gugger \\
\small{oliver@lightning.engineering}
\and
Johan Halseth \\
\small{johan@lightning.engineering}
}
\date{November 2nd, 2020 \\~\\ DRAFT (commit \gitAbbrevHash)}
\maketitle
\begin{abstract}
In this paper we examine the core inbound liquidity bootstrapping problem the
Lightning Network faces, and frame it as a resource allocation problem to be
solved by the application of market design and auction theory. We present
Lightning Pool, a non-custodial channel lease marketplace, implemented as a
sealed-bid frequent batched uniform clearing price auction which allows
participants to buy and sell capital obligations on the network. We call these
capital obligations \emph{channel leases}. A channel lease can be viewed as a
cross between a traditional fixed-income asset and an internet bandwidth
peering agreement. Channel leases allow nodes on the network with idle capital
to earn yield (based on a derived \emph{per-block} interest rate) by selling
channels to other agents in the marketplace. The duration of such contracts is
enforced on-chain using Bitcoin Script. We construct \textbf{Lightning Pool}
using a novel design for constructing overlay applications on top of Bitcoin: a
shadow chain. Shadow chains allow users to remain in full custody of their
funds at all times while also participating in higher level applications that
scale via an optimistic transaction cut-through protocol.
\end{abstract}
\newpage
\tableofcontents
\vfill
\section{Introduction}
\textbf{Lightning Network Bootstrapping Challenges}. The Lightning Network (LN)
is the largest deployed Layer 2 payment channel network \cite{lnpaper}. A
payment channel network is comprised of a series of individual payment
channels, which, when strung together, enable rapid low-latency payments
between participants in the network. Due to the off-chain nature of these
payments (only the final summary hits the blockchain), the cost of payments on
the LN are typically much lower than an equivalent payment on the base
blockchain. In order to be able to send funds on a network, a user must open a
payment channel to another participant on the network. Once the channel has
been opened, both participants are able to send and receive a nearly unbounded
number of payments off-chain, possibly never closing the channel on-chain.
Similarly, in order to receive on the network, a user requires \emph{another
individual} to open a channel \emph{to} the receiver. A participant can only
send and receive up to the total amount of Bitcoin in a channel committed to by
both parties. This allocation of capital by one party to enable another party
to receive funds on the network is typically referred to as \emph{inbound
liquidity} or \emph{inbound bandwidth}. Because a would-be user of the network
must somehow convince \emph{others} to allocate capital towards them in order
to receive funds on the network, the inbound bandwidth problem remains a
significant barrier to the adoption and bootstrapping of the Lightning Network.
\textbf{Routing Node Capital Requirements}. In order to incentivize users to
commit capital to the network so as to help other users of the network send and
receive payments, each time a node forwards a payment successfully they receive
a fee. As commonly implemented, this fee has a fixed base amount to be paid for
all forwards independent of payment size, and a fee rate or proportional amount
that must be paid for each millionth of a satoshi forwarded \cite{bolt7}. We
refer to nodes that join in order to facilitate payments and collect forwarding
fees as \emph{routing nodes}. In order to forward a payment of size $N$ on the
network, a routing node needs to have $N_{in} + F$ Bitcoin allocated
\emph{towards} it as inbound bandwidth, and $N_{out}$ Bitcoin allocated to
another node as outbound bandwidth. The factor of $F$ is the fee collected by
the routing node, with the following constraint being met $F = N_{in} -
N_{out}$. Due to this requirement that there be sufficient inbound \emph{and}
outbound bandwidth, even those nodes that exist solely to help other nodes send
and receive payments, themselves face the inbound bandwidth allocation problem,
a fundamental bootstrapping issue for the LN.
\textbf{Market Design Resource Allocation Problems}. The field of market design
is a sub-field of economics which is concerned primarily with the efficient
allocation of scarce resources \cite{cramton2010} . Within this sub-field, of
interest is a branch of market design concerned with instances wherein money is
used to govern the exchange of goods and services: auction design.
Auction design can be used to effectively allocate scarce resources within a
domain. Common established examples of market design widely used today
include: carbon emissions credits, electricity markets, auctions for airport
gates, and wireless spectrum auctions. In each of these examples, market design
is used to allow more effective communication of pricing information, resource
availability, and the expression of preferences. Our first insight is framing
the solution to the inbound bandwidth bootstrapping problem within the lens of
market design. In the context of the LN, the scarce resource we aim to more
efficiently allocate is inbound channel bandwidth.
\textbf{LN Bootstrapping as Resource Allocation Problem}. In the absence of a
proper venue, those that need inbound capital to operate their Lightning
services often turn to soliciting capital on various chat groups, forums, or
public venues like Twitter. On the other side, those seeking to deploy capital
in order to facilitate network operation and gain routing fees must guess as to
exactly where their capital is most demanded. As node operators may not
necessarily know where their capital is most demanded, they risk opening
channels to locations where they aren't actually needed, leading to poor
resource utilization and capital inefficiency. It's as if node operators are
speculatively building roads that no one will use (why isn't my node
forwarding?), and those seeking to receive aren't able to flag their service as
an attractive destination to be connected to internal network "highways".
Lightning Pool solves this resource allocation problem using an auction that
matches up those seeking to deploy capital (by opening channels) to those that
need these channels to operate their Lightning Service or business. With each
executed batch, the participants of the auction derive a \emph{per block}
interest rate which is effectively the current lease rate for capital on the
Lightning Network. The auctioneer or an independent agency is also able to
provide Node Ratings to participants of the network, which can be used to make
more informed decisions with respect to the \emph{quality} of the channel lease
being purchased.
\textbf{Channel Lease Marketplaces}. In this paper, we present Lightning Pool,
a non-custodial channel lease marketplace (CLM) that draws on modern auction
theory to construct an auction that enables participants to buy and sell
inbound channel bandwidth. Participants in the marketplace buy and sell a
channel capital obligation, which we call a Lightning Channel Lease (LCL). An
LCL is similar to a traditional bond in that one party acquires capital from
another for productive use, with the party parting with their capital being
compensated for their cost of capital. However as the funds within an LCL can
only be used in the Lightning Network for sending/receiving, an LCL is
analogous to the creation of a new virtual "road" within the LN connecting two
destinations. Critically, when one purchases an LCL, the period of time those
funds must be committed is enforced on-chain using Bitcoin Script. As a result,
buyers of inbound channel bandwidth can be sure the capital will be committed
for a set period of time. The auction itself contains several sub-auctions for
the exchange of particular duration intervals expressed in blocks (similar to
the various U.S Treasury auctions \cite{usTreasury}). A non-trusted auctioneer
facilities the marketplace by accepting sealed-bid orders, clearing the market
using a uniform clearing price for each duration bucket, and finally executing
batches of contracts using execution transactions that update all involved
accounts, delivering the purchased channels to all parties in an atomic manner.
Lightning Pool and the LCL solve the inbound bandwidth problem by allowing
participants on the network to effectively exchange pricing signals to
determine exactly \emph{where} in the network capital should be allocated.
\textbf{Shadowchains as an Application Framework}. Lightning Pool is the first
application built on top of Bitcoin that utilizes the \emph{Shadowchain}
paradigm to construct an application-specific overlay system on top of existing
Bitcoin unspent transaction outputs (UTXOs). A user joins a shadowchain by
creating a special multi-signature based output using a public key provided by
the target shadowchain manager. Once a user has joined the shadowchain,
proposed state transitions are packaged up (in the form of a block) by the
shadowchain manager and proposed to each active participant. A shadowchain
block updates the application state of all participants and is embedded within
a normal Bitcoin transaction. Depending on the application, a shadowchain block
may be indistinguishable from a normal Bitcoin transaction. Shadowchains are
able to \emph{compress} state transitions \emph{off-chain} by employing a form
of multi-party transaction cut-through \cite{maxCutThru}. As participants of a
shadowchain remain in custody of their funds at all times, complex fraud proofs
or exit games are unnecessary, significantly simplifying the implementation of
a given shadowchain. We note that the shadowchain concept itself can be used
for other applications as well.
\subsection{Our Contributions}
In summary, we make the following contributions:
\begin{itemize}
\item We propose a solution to the inbound bandwidth problem of the LN in
the form of a marketplace to buy and sell inbound bandwidth
obligations.
\item We propose the Lightning Channel Lease, an inbound bandwidth
obligation contract that pays a per-block interest rate to the seller
from the buyer, and whose duration is enforced on-chain with Bitcoin
Script.
\item We put forth the concept of a Node Rating agency for channel leases
in order to provide marketplace participants with
information about the \emph{quality} of a channel lease.
\item We construct a new system, Lightning Pool, which is a non-custodial
marketplace with off-chain order submission and on-chain batch
execution that allows parties to exchange LCLs in an atomic
manner.
\item We design a new Bitcoin application design framework, the
shadowchain, which can also serve other applications.
\end{itemize}
% hash function
% signature
% random usage
% security param
% higher level transaction notation?
\section{Background}
In this section, we aim to introduce some necessary background that will be
built upon in later sections to construct our solution. First, we'll describe
multi-hop payment channels and the Lightning Network as deployed today. Next,
we'll explore the nature of the inbound bandwidth bootstrapping problem the
Lightning Network faces today. Along the way, we'll explain the dynamics of
routing nodes in the network, as they're a key component of the system. Next,
we introduce the field of market design and more specifically the sub-field of auction
design, to demonstrate how auction design can be used to solve resource
allocation problems in the real world. Finally, we provide some brief background
on money markets in the traditional financial system, and how this relates to
our concept of channel leases.
\subsection{Payment Channels \& the Lightning Network}
\begin{center}
\textbf{Basic Payment Channels}
\end{center}
A payment channel in its simplest form is an on-chain 2-of-2 multi-signature
output created by parties $A$ and $B$. One or both parties deposit funds into a
Bitcoin Script output constructed using two public keys $P_{a}$ and $P_{b}$.
The transaction that creates this multi-sig output is referred to as the
\emph{funding transaction}. Before broadcasting the funding transaction,
another transaction dubbed the \emph{commitment transaction} is constructed
using a series of agreed upon parameters by the two parties \cite{bolt3}. The
commitment transaction spends the funding transaction and creates two new
outputs $D_{a}$ and $D_{b}$ that if broadcast, will \emph{deliver} the
up-to-date balances allocated between the parties to the channel. Once the
funding transaction is confirmed and broadcasted, both parties are able to
rapidly update the balance of the delivery outputs, $D_{a}$ and $D_{b}$ so as
to facilitate efficient payments between the parties. \\
\begin{center}
\textbf{Bi-Directional Payment Channels}
\end{center}
In order to safely make bi-directional payments between both parties to a
payment channel, modern channel designs also employ a \emph{commitment
invalidation mechanism} \cite{chanSok} to ensure that only the latest
commitment transaction state can be broadcasted and redeemed via the underlying
blockchain. The most commonly used commitment invalidation scheme is the
\textbf{replace-by-revocation} construct. In this construction, during channel
negotiation, a security parameter $T$ (which may be asymmetric for both
parties) is negotiated. Using this value $T$ which is typically expressed in
blocks, a commitment transaction state can only be fully redeemed by the
broadcasting party after a period of $T$ blocks has passed. During this
interval, the non-broadcasting party $P_{defender}$ is able to provide the
contested delivery output $D_{a_i}$ with a valid witness $W_{r_n}$ which
\emph{proves} that there exists a \emph{newer} state $n$ with $n > i$ that has
been ratified by both parties. The exact details of this construct are outside
the scope of this paper, but Bitcoin Script and basic cryptography are used to
allow a defending party to present an objective statement of contract violation
by the opposing party. \\
\begin{center}
\textbf{Hash Time Lock Contracts \& Multi-Hop Payments}
\end{center}
The final component of modern multi-hop payment channels is the Hash Time
Locked Contract, or the HTLC. The HTLC enables payments to travel over a
\emph{series} of payment channels, allowing a set of interlinked payment
channels to be composed into a logical \emph{payment network}. An HTLC can be
viewed as a specific case of a time locked commit and reveal puzzle. Loosely,
an HTLC consists of four parameters: the public key of the sender $P_{s}$, the
public key of the receiver $P_{r}$, the payment amount expressed in satoshis
$A_{sat}$, a payment secret $r$ s.t $H(r) = h$, and an absolute block timeout
$T$. Given these parameters, a Bitcoin Script is set up such that, the funds
deposited in the script hash output can be redeemed by the receiver $P_{r}$ via
a public key signature by their public key and the revelation of the payment
pre-image $r$, or by the sender $P_{s}$ after the absolute timeout $T$ has
elapsed. This construct can be chained by several parties (up to 20 in the
modern Lightning Network \cite{bolt4}) to create a multi-hop payment within the
network. One implication of this security model is that each party must ensure
that their outgoing hash lock puzzle's absolute timelock $T_o$ is offset from
the incoming absolute timelock $T_i$ by a value of $C_{delta}$. This value
$C_{delta}$ is commonly referred to as the CLTV delta \cite{bolt7}. This value
$C_{delta}$ is an important security parameter, as if $C_{delta}$ blocks passes
and the outgoing hash lock isn't fully resolved, then a \emph{race condition}
occurs as the time out clauses of \emph{both} the incoming and outgoing hash
locks have expired. \\
\begin{center}
\textbf{Routing Nodes as Profit-Seeking Capital Allocators}
\end{center}
Entities on the Lightning Network that exist primarily to collect fees for
successfully forwarding payments are referred to as \emph{routing nodes}. A
routing node commits capital to the network within payment channels in order to
be able to facilitate payments in the network. As routing nodes incur an
opportunity cost by committing capital to the network, they specify a fee $F$
to be paid upon completion of a successful payment forward. This fee $F =
F_{base} + F_{rate} \cdot A_{sat}$ is comprised of two parts: a proportional
amount (a rate) and a fixed amount, which are both expressed in
\emph{millisatoshis}, which are $1/1000$ of the base satoshi unit.
Note that routing nodes are not compensated on an ongoing basis, and are not
compensated for anything other than a completed payment. As a result, many
routing nodes may be allocating capital in a non-productive manner
\cite{avivCharge} as they've speculatively opened channels to areas of the
network where no true transaction demand exists. If the Lightning Network was
a physical transportation network, then it would be as if eager contractors
started building roads to seemingly random destinations, only to find that
those roads weren't actually demanded at all. This information asymmetry
(where new channels are actually demanded) and the current inability for
today's network participants to exchange these key demand signals lies at the
crux of the bootstrapping problems of the Lightning Network.
\subsection{Liquidity Boostrapping Problems in the Lightning Network}
In this section, building on the background provided above, we aim to detail
the various liquidity bootstrapping problems that exist in the Lightning
Network today. These problems will serve motivation for our solution, the
Channel Lease Marketplace, and a specific instantiation of such a construct:
Lightning Pool.
\subsection{New Routing Node Boostrapping}
As the Lightning Network is a fully collaterized network, in order to
\emph{join} the system, a participant must commit capital in the form of
Bitcoin charged into payment channels on the network. Routing nodes, however, are
in a unique situation, as they need to both \emph{commit} their own capital to
the network, as well as \emph{solicit} committed capital from \emph{other}
routing nodes. This is due to the fact that in order to be able to forward a
payment of size $P_{sat}$, the routing node must first have $P_{sat_{out}}$
satoshis committed as \emph{outbound} payment bandwidth (to use for sending)
and $P_{sat_{in}}$ committed as \emph{inbound} payment bandwidth, with the
difference of the two amounts, $F = P_{sat_{in}} - P_{sat_{out}}$ being collected
as a forwarding fee upon payment completion. This \emph{pair-wise} capital
commitment requirement is commonly cited as a major barrier to Lightning
Network adoption, as well as why large "hubs" are inherently
economically inefficient.
A routing node operator faces two key questions when attempting to join the
network in a productive manner, while also attempting to optimize for
\emph{capital} efficiency:
\begin{enumerate}
\item \emph{Where} should I open channels (thereby committing outbound
capital) within the network in order to \emph{maximize} the
velocity of transactions through my channels, along with the
corresponding fee revenue $F_r$?
\item \emph{How} can I attract \emph{other} routing node operators to
commit capital to my node such that I can actually forward payments
to earn \emph{any} revenue $F_r$?
\end{enumerate}
We argue that the above two questions, optimizing for capital efficiency and
velocity of committed channels, can only properly be addressed by the
\emph{existence} of a \emph{marketplace} that allows agents (routing node
operators) to communicate their preferences using demand signals. Intuitively,
a channel open to an undesirable location (possibly over-served) will have low
transaction velocity $C_{v}$, and result in overall lower total fee revenue
$F_r$. In order to maximize both $C_v$ and $F_r$, a routing node should only
open channels to where they're \emph{most demanded}. If an agent is willing to
pay up to $P_{premium}$ Bitcoin for inbound bandwidth, then they must gain more
utility than the paid premium $P_{premium}$, as otherwise, such a transaction
would not be economically rational. Thus, the existence of a marketplace that
allows routing nodes to efficiently commit their outbound capital, as well as
\emph{purchase} new inbound capital is a key component to solving the
boostrapping problem for routing nodes.
\subsection{New Service Boostrapping}
If routing nodes are the backbone or highway of the Lightning Network, then so
called Lightning Services are the primary \emph{destinations} for a given
payment. For simplicity, we assume that a given Lightning Service is primarily
a payment \emph{sink}, in that it's primarily \emph{receiving} over the LN. Eventually,
it may become common for a service to be balanced in terms of sending
\emph{and} receiving, resulting in a net-flow of zero, but today in the
network, most flows are uni-directional, creating the need for on/off
chain bridges such as Lightning Loop.
\begin{center}
\textbf{Demand for Incoming Bandwidth}
\end{center}
Focusing on the case of a Lightning Service that's primarily a \emph{payment
sink}, in order to receive up to $N$ Bitcoin, the service requires $S_b$
Bitcoin to be committed as inbound capital, with $S_b > N$. Otherwise, assuming
only channel churn, all inbound bandwidth will become saturated, rendering a
service unable to receive additional Bitcoin over the LN. Therefore, the
operative question a service operator needs to ask when attempting to join the
network is:
\begin{itemize}
\item How can I solicit enough inbound bandwidth to be able to receive
up to $S_b$ Bitcoin?
\end{itemize}
\begin{center}
\textbf{Preference for Quality of Bandwidth}
\end{center}
It's important to note, that as operating a \emph{valid} routing node on the
network requires a degree of skill and commitment, some routing nodes are able
to provide more \emph{effective} service than others. As an example, imagine a
routing node \textbf{Bob}, who has sufficient capital committed to his node in
both the inbound and outbound directions, but who is chronically
\emph{offline}. As a node must be \emph{online} in order to be able to forward
payments, any capital committed by \textbf{Bob}, can essentially be considered
dead weight. With this insight in mind, we revisit the bootstrapping questions
of the Lightning Service to also require a high \emph{quality of service}:
\begin{itemize}
\item How can I solicit enough \emph{high quality} inbound bandwidth
within the network to be able to receive up to $S_b$ Bitcoin?
\end{itemize}
\begin{center}
\textbf{Time Committed Incoming Bandwidth}
\end{center}
However, from the point of view of an active Lightning Service, just having
sufficient high quality inbound bandwidth may not be enough. Consider that a
high quality node $Carol$ may erroneously decide to commit capital elsewhere,
resulting in overall lower channel velocity $C_v$ for their channels. This
type of fair-weather behavior serves as a detriment to our Lightning Services;
they're unable to properly plan for the future, as they don't know \emph{how
long} the inbound bandwidth will be available for receiving payments. As a
result, it's critical that the Lightning Service has a hard guarantee with
respect to \emph{how long} capital will be committed to their node. Taking this
new criteria into account, we further revisit our new service boostrapping
problem statement:
\begin{itemize}
\item How can I solicit enough \emph{high quality} inbound bandwidth
to be able to receive up to $S_b$ Bitcoin, that
will be committed for \emph{at least} time $T_{blocks}$?
\end{itemize}
Summarizing, in addition to the existence of a marketplace for buying and
selling capital commitment obligations, a would-be buyer requires some sort of
\emph{rating system} to reduce information asymmetry (distinguish the good
nodes from the lemons), and also requires that any capital committed must be
committed for a period of $T_{blocks}$. These new requirements argue for the
existence of a Node Rating agency, as well as a facility that ensures that
capital will be committed for a set period of time in a trust-minimized manner.
\subsection{End User Boostrapping}
Finally, we turn to the end users of the system. In our model, the end users of
the system are those that are frequently \emph{transacting}. If routing nodes
are the highways in our payment transportation network, with Lightning
services as popular destinations, then users trigger \emph{payment flows} that
traverse the backbone created by routing nodes, to arrive at the Lightning
services. Note that within our model, we permit end users to both send
\emph{and} receive. Compared to boostrapping a new user to a Layer 1 system
such as the Bitcoin blockchain, boostrapping to a Layer 2 system like the
Lightning Network presents additional challenges. The core challenge is created
by the constraint that in order for a user to send $K_s$ Bitcoin, they also
need $K_s$ Bitcoin committed within the network. Similarly, in order to receive
up to $K_r$ Bitcoin, they need up to $K_r$ Bitcoin committed as inbound
bandwidth.
From the perspective of attempting to achieve a similar user-experience as a
base Layer 1 system, the receiving constraint is the most challenging. Notice
that a user cannot simply download a Lightning wallet and start receiving
funds. Instead, they need to first solicit \emph{inbound} capital to their node
first. Many wallet providers such as Breez and Phoenix have started to overcome
this issue by committing capital to the users themselves. This is essentially a
customer acquisition cost: by providing this inbound bandwidth to users, the
wallet becomes more attractive as it enables both sending and receiving.
However, just receiving isn't enough. A user needs to be able to send
\emph{and} receive. In addition to this required symmetry, a typical user also
has all the same quality of service, and time-committed capital requirements as
well.
With this background, we can phrase the end user boostrapping problem as
follows:
\begin{itemize}
\item How can a new user join the Lighting Network in a manner that
allows them to both send and receive to relevant destinations in
the network?
\end{itemize}
\subsection{Market Design \& Auction Theory}
In this section, we make a brief detour to the economic field of auction design
to examine how similar resource allocation problems have been addressed by
market design in existing industries. These examples include both digital and
physical goods. In the modern age, market design and proper construction of
corresponding \emph{auctions} can be used to improve resource utilization and
capital efficiency \cite{cramton2010}. Within a particular domain,
context-specific design decisions can be made so as to better optimize resource
allocations for all participants. Common uses of auction design in the wild
include wireless spectrum auctions by the Federal Communications Commission
(FCC), package auctions for auctioning off takeoff and landing rights at
airports, real-time electricity markets, and also carbon credits. Market design
bridges both theory and practice in order to solve real-world resource
allocation constraints \cite{cramton2008}.
A commonly used tool in the field of market design is the concept of
\emph{auctions}. Auctions allow agents to gather and exchange pricing signals
in order to determine who gets which goods, and at which price. The design of a
proper auction for a particular resource allocation problem has a vast design
space. For example, should a first or second price auction be used
\cite{auctionCS}? How frequently should the auction run? What \emph{type} of
auction should be used? Should participants be able to see the bids of other
participants? And so on.
Building off the series of boostrapping problems posed above, we turn to market
design as a tool to efficiently allocate our scare resource in question:
inbound channel bandwidth. Our problem-space is unique, however, in that as
we're dealing with the allocation of capital, there are inherent opportunity
costs: why should a routing node commit capital to the Lightning Network,
compared to some other asset that has a similar risk adjusted rate of return?
In this context, our end solution may take the form of a \emph{money market},
which is used by entities to trade short-term debt instruments.
%add a sub-section on transportation systems?
\subsection{Money Markets \& Capital Leases} % Capital Markets & Channel Leases?
In traditional financial markets, money markets are used to allow entities to
trade short term debt instruments. Examples of such instruments include U.S
Treasury Bills, certificates of deposit, and repurchase agreements. Capital
markets on the other hand, are the long-term analogue of money markets, in that
they deal with longer timeframes, and also are more heavily traded on secondary
markets with retail traders being more involved.
In the context of the Lightning Network, our concept of capital obligations
appears similar to a bond, in that we require a period of time for which
capital is allocated. However, unlike a bond, the committed funds can only be
used on the Lightning Network to provide a new type of service: the
\emph{propensity} to receive or send funds on the network. As a result, we
don't require funds in channels to be borrowed, instead they only need to be
\emph{leased} for a period of time. Also unlike bonds, wherein it's possible
for the issuer of a bond to \emph{default}, thereby failing to repay the
borrowed money, in the context of the LN, there is \emph{no inherent default
risk}. Instead, arguably the concept of channel leases can be viewed as a risk
free rate of return in the context of Bitcoin, and specifically in the context
of the Lightning Network.
The existence of a \emph{channel lease} serves to provide routing nodes with an
additional monetary incentive (in the form of a premium paid by the lessee of
the coins) to operate a routing node. As a result, we can model the revenue
$R_c$ earned by a routing node for a given channel $C$, as a function of the
lease interval $T$ and channel size $A_{sat}$. Factoring in transaction values
during the interval (as routing fee revenue is a function of them), we assume
that transaction values fall in the range of: $[1, A_{sat}]$ satoshis and
follow a distribution $K$. Given these considerations, we express the revenue
of a given routing node as:
\begin{equation}
R_c(T, A_{sat}) = (P_c \cdot T \cdot A_{sat}) + \sum_{k=1}^{A_{sat}} \prob{K=k} \int_{i=0}^{T} F_c(k) \cdot X_{t}(k, C) \,dt
\end{equation}
where $P_c$ is the current \emph{per-block} interest rate, $(F_c(k)\cdot
X_{t}(k, C))$ is the \emph{expected} routing fee revenue of the channel within
that interval, for a payment of $k$ satoshis, and $X_{t}(k, C)$ is a function
describing the random event of a payment of $k$ satoshis passing through the
channel $C$ on the outgoing edge during a time-slice $t$. \\
Our model is similar to the one put forth in \cite{payChanProfit}, however were
concerned with the fee revenue over an interval rather than the gain of an
objective function. We reference an \emph{expectation} for fee revenue, as fees
are effectively a \emph{speculative} component of the routing revenue of a
node. If a channel was allocated to a node in high demand, one would expect the
latter portion of the question to possibly dominate the premium. If the
opposite is the case, then a routing node would derive most of its revenue from
the yield earned by leasing a channel. In this manner, the existence of a
concept such as a channel lease actually serves to \emph{reduce} the variance
in a routing node's revenue, similar to how joining a mining pool can reduce
the variance of a Bitcoin miner's earnings \cite{meniVariance}.
Finally, we argue that the existence of a channel lease that pays a premium
based on a \emph{per-block} interest rate would result in a novel low-risk
yield-generating instrument for the greater Bitcoin network. Such a per-block
interest rate $r_{b_i}$ would serve to allow market participants to effectively
price the cost of capital on the Lightning Network. Assuming the existence of
varying durations ${D_1, ..., D_n}$, a \emph{yield} curve conveying the relative
short and long term interest rates of channel yields could be constructed. Such
an instrument would then potentially serve as the basis for higher level
structured products and derivates built on top of the base channel lease
instrument.
%also add a solution overview here?
\section{Bootstrapping Problems as Solved by CLM}
Prior to outlining our design for a channel lease marketplace, we seek to
provide a set of real-world cases that demonstrate the benefit of such markets
for the Lightning Network.
\subsection{Bootstrapping New Users via Sidecar Channels}
A common question concerning the Lightning Network goes something like: Alice
is new to Bitcoin entirely, how can she join the Lightning Network without
making any new \emph{on-chain} Bitcoin transactions? On-boarding for a
non-Lightning Bitcoin user is as simple as sending coins to a fresh address.
For off-chain payment channel networks to achieve widespread usage, a similar,
seamless on-boarding flow should exist.
We frame the solution to this use case in our model of channel liquidity
markets. In this case, Alice is a \emph{new} user to the network that requires
\emph{inbound} and \emph{outbound} liquidity. Without outbound liquidity, she's
unable to send to any other node on the network. Without inbound liquidity,
she's unable to receive payments via the network. "Sidecar channels" allow an
acquaintance of Alice, let's call her Carol, to engage in a protocol with an
existing routing node on the network, Bob, to provide \emph{both} inbound and
outbound liquidity for Alice. Carol is able to provide liquidity with an
off-chain, or on-chain payment. At the end of the engagement, Carol has
provided channel liquidity to Alice via Bob, who himself is compensated
accordingly for his role in the protocol.
\subsection{Demand Fueled Routing Node Channel Selection}
A "routing" node on the Lightning Network is a node categorized as having a
persistent, publicly reachable Internet address, a set of inbound channels from
leaf nodes, and an intention to actively facilitate payment flows on the
network in return for fee revenue. A common question asked in the initial
bootstrapping phase of the Lighting Network by node operators is: "where should
I open my channels to, such that they'll actually be routed through"? We posit
that channel liquidity markets provide the answer to this question.
Channel liquidity markets can be combined with autopilot \cite{autopilot}
techniques that automatically manage channel creation based on static and
dynamic graph signals. A key drawback of autopilot techniques alone is that for
the most part, they're devoid of \emph{economic} context. A particular location
in the sub-graph may be "fit" or attractive from a graph theoretic perspective,
but may not lead to a high velocity channel, as there might not be inherent
demand for a channel created at that particular location. Using a CLM, a node
operator can enter a targeted venue to determine what the \emph{time value} of
his liquidity is on the network. New services such as exchanges or merchants on
the network can bid for the node's liquidity in order to serve their
prospective customers, with the node earning a small interest rate up-front for
committing his liquidity in the first place (scaled by the worst-case CSV
delay).
\subsection{Bootstrapping New Services to Lightning}
Any new service operator or merchant that wishes join the Lightning Network
faces the same problem: "How can I incentivize nodes to create \emph{inbound}
channels to my node in order to be able to accept payments?". CLMs provide an
elegant solution. The merchant/exchange/service uses their existing on-chain
funds to enter the liquidity marketplace in order to exchange their on-chain
coins for off-chain coins. Once the trade has been atomically executed, the
merchant immediately has usable inbound liquidity that can be used to accept
payments from users. As the merchant acquires more liquidity and more channels
in the future, they make additional contributions to the path diversity and
strength of the network.
\subsection{Cross-Chain Market Maker Liquidity Sourcing}
As currency traders become more aware of the counterparty risk of trading on
centralized exchanges, they become more motivated to find non-custodial
exchange venues. The flexibility of channels on the Lightning Network make it a
desirable platform for such a venue: channels allow for non-custodial trading
at similar execution speeds to that of centralized exchanges. Additionally,
channel based non-custodial exchanges are not vulnerable to front-running
tactics executed by miners that can occur with other non-custodial concepts.
Instead, the trade execution and even the prior trade history are \emph{only}
known to the participants, providing a greater degree of financial privacy.
Once again, we encounter a bootstrapping issue. How is a market maker on a
payment channel-based non-custodial exchange meant to gather an initial pool of
liquidity to service orders? We see CLMs as a natural solution. The market
maker can seek out liquidity for relevant trading pairs by purchasing inbound
channel liquidity, in addition to putting up its own outbound channel liquidity
to other market makers. A balanced distribution of liquidity amongst market
makers allows for new traders to participate in the exchange, knowing that
their flows are balanced, meaning they can receive as much as they can send via
the market maker, allowing them to instantly start to execute cross-chain
atomic swaps.
\subsection{Instant Lightning Wallet User On Boarding}
Wallets commonly face the UX challenge of ensuring that a user can receive
funds as soon as they set up a wallet. Some wallet providers have chosen to
open new inbound channels to users themselves. This gives users the inbound
bandwidth they need to receive, but can come at a high capital cost to the
wallet provider as they need to commit funds at a 1:1 ratio. A CLM like
Lightning Pool would allow wallet developers to lower their customer
acquisition costs, as they would need to pay a relatively small amount relative
to the volume of liquidity to be allocated to a new user. Just like the
merchant purchasing inbound liquidity in the above segment, a wallet provider
could pay something like one thousand satoshis to have one million satoshis
allocated to a user, instead of fronting the entire one million satoshis
themselves.
\subsection{Variance Reduction in Routing Node Revenue}
Today, routing node operators aim to join the network in order to facilitate
the transfer of payments as well as to earn fees over time by successfully
facilitating payments. However, if a node isn't regularly routing payments
(thereby earning a forwarding fee), then they aren't compensated for the
various (though minor) risks they expose their capital to. With Pool, routing
node operators are able to ensure that they're predictably compensated for the
cost of their capital.
\section{The Channel Lease Marketplace} %definition
In this section, we present an overview of the Channel Lease Marketplace
architectural design. In section 6, we make a brief detour to define the
\emph{Shadowchain} application framework, before presenting a concrete
instantiation of a CLM in the form of \textbf{Lightning Pool}.
\subsection{High-Level Description}
First, we describe our solution at a high-level. Drawing heavily from existing
market auction design, we're interested specifically in double-call auctions
that allow both the buyer and the seller to transact \emph{indivisible} units
of the good in question, which in this case is a channel lease. We then build
upon this base double-call auction by leveling the informational playing field
\cite{milgromSealedBid} by making all orders \emph{sealed-bid}. Rather than the
auction being cleared continually within a central-limit order book, we instead
opt to utilize a discrete interval, frequent batched auction so as to mitigate
front-running and other undesirable side effects \cite{hftBatch}. Rather than
participants paying what they bid (commonly called a pay-as-you-bid auction),
all participants will instead pay the same \emph{uniform clearing price}.
Finally, all operations that result from a successful auction are batched and
committed in a \emph{single} atomic blockchain transaction.
\clearpage
\begin{figure}[!htb]
\begin{tikzpicture}[node distance=5cm,on grid,auto]
\node[initial, state] (s0) {Account Creation};
\node[state, right of=s0] (s1) {Order Submission};
\node[state, below of=s1] (s2) {Match Making};
\node[state, below of=s2] (s3) {Market Clearing};
\node[state, accepting, below of=s3] (s4) {Batch Execution};
\draw (s0) edge[right] node{} (s1)
(s1) edge[below] node{batch tick} (s2)
(s2) edge[bend right, above] node{no market} (s1)
(s2) edge[right] node{market made} (s3)
(s3) edge[right] node{market cleared} (s4)
(s4) edge[bend left] node{restart} (s1);
\end{tikzpicture}
\caption{Auction State Machine}
\end{figure}
\begin{center}
\textbf{Marketplace Auctioneer}
\end{center}
We assume the existence of a \emph{non-trusted} auctioneer $\Lambda$ that
publishes a master auctioneer key $A_{auction}$ ahead of time. The auction
itself is uniquely identified by $A_{auction}$ from the perspective of the
system due to its \emph{Shadowchain} qualities. The auctioneer implements a
non-custodial auction via \texttt{Marketplace Accounts} that use a new unique
key derived from $A_{auction}$ as the second public key in the 2-of-2
multi-sig. The auctioneer accepts and validates orders off-chain, facilitates
required account modifications, proposes a valid batch to each of the agents
matched in an instance of the auction, and produces a batch execution
transaction that creates the series of corresponding channel leases.
\begin{center}
\textbf{Account Creation}
\end{center}
Before being able to participate in the marketplace, we require that an agent
first create a \texttt{Marketplace Account}. A \texttt{Marketplace Account} is
a non-custodial account that forces an agent to commit capital in the form of
Bitcoin to the market for a period of time. As we require agents to fully back
all orders within an account, we eliminate a number of order spoofing vectors.
Additionally, the time-locked, non-custodial nature of the account ensures a user
is able to recover their funds fully without any additional on-chain
transactions (aside from the sweeping transaction).
\begin{center}
\textbf{Marketplace Order Units}
\end{center}
We abstract over the base Bitcoin satoshi unit and define a \texttt{unit} from
the point-of-view of the marketplace that serves as the base unit that all
orders are expressed in and settled in. We assume that the value of a given
\texttt{unit} is set such that even a single lease of the smallest unit is
still economical from the perspective of the base blockchain and on-chain fees.
All orders \emph{must} be divisible by a whole unit, and the final clearing
volume of a given batch is also expressed in these units.
\begin{center}
\textbf{Order Submission}
\end{center}
Once an agent has created a valid \texttt{Marketplace Account}, they can enter
the order submission phase. It's important to note that this order submission
takes place \emph{off-chain}. Only the final execution of an auction batch
takes place on-chain. During the order submission phase, agents are free to
modify their accounts and orders. Only valid orders will be accepted as
eligible for the next auction iteration.
\begin{center}
\textbf{Market Clearing}
\end{center}
Every $\Upsilon$ minutes, the auctioneer attempts to \emph{clear} the
marketplace. An auction can be cleared if the lines of supply and demand cross
such that at least a single unit is bought/sold. As the market has no explicit
closing time, it's possible that during a market epoch, no market can be made.
In the scenario that a market can be made, rather than each participant paying
what they bid, the auctioneer instead uses a single clearing price based on the
market's clearing price algorithm.
\begin{center}
\textbf{Batch Execution}
\end{center}
Once a market has been cleared, the batch execution phase begins. During this
phase, the auctioneer sends a batch proposal $\Pi$, which describes the
proposed market clearing structure. $\Pi$ may either be a plaintext description
of a valid clearing solution, or an "argument" describing one. Valid batches
are then bundled into a single \texttt{Batch Execution Transaction} that
updates all involved accounts, and creates any channel leases initiated within
the batch. After a period of time $\Upsilon$ has elapsed, the market is
restarted with any new orders and accounts being considered for market
clearing.
\subsection{Lightning Channel Leases}
\begin{center}
\textbf{Liquidity Maker \& Taker}
\end{center}
We begin by introducing the concept of a \texttt{Liquidity Taker}:
\theoremstyle{definition}
\begin{definition}{(Liquidity Taker).} % call Lease instead? also define CLM earlier in the process?
A Liquidity Taker is an agent in a Channel Liquidity Market seeking to
\emph{obtain} new \emph{inbound} channel liquidity of size $A_{sat}$ for a
period of $T_{block}$ Bitcoin blocks.
\end{definition}
A taker is prepared to either boostrap the inbound liquidity with their own
on-chain coins, or pay a \emph{premium} in order to receive a "lease" of
liquidity from another agent in the market. Takers populate the \emph{demand}
side of our market. They require new inbound liquidity in order to be able to
immediately receive payments on the network, or to better position themselves
as a routing node within the network.
A natural companion to the Liquidity Taker agent within a \texttt{CLM} is the
\texttt{Liquidity Maker}:
\theoremstyle{definition}
\begin{definition}{(Liquidity Maker).}
A Liquidity Maker is an agent in a Channel Liquidity Market seeking to earn
\emph{yield} by deploying up to $A_{sat}$ Bitcoin into the Lightning Network
for up to a period of $T_{block}$ Bitcoin blocks, earning a profit $\alpha$.
\end{definition}
Notice that we utilize Bitcoin block-time rather than wall-clock time (Median Past
Time) \cite{bip113} in these definitions, as we seek to enforce these durations using
Bitcoin Script and using block-time is more objective compared to wall-clock time.
The profit ($\alpha$) earned by a \texttt{Liquidity Maker} takes two forms:
\begin{itemize}
\item A one-time \emph{premium}, $R_{premium}$, commanded by the Maker which
reflects the latent demand and time-value of regular coins vs "lifted
coins" (coins placed in channels).
\item Ongoing recurring revenue, $F_c$, in the form of forwarding fees
earned by facilitating payments to their matched taker.
\end{itemize}
We argue that the existence of such Channel Liquidity Markets will increase the
\emph{efficiency} of capital deployed to a payment channel network by allowing
agents to signal the relative demand of lifted coins compared to non-lifted
coins. Additionally, such markets also allow an existing routing node on the
network to \emph{re-allocate} lifted coins from a low-velocity section of the
sub-graph, to one of higher velocity:
\begin{theorem}[Channel velocity revenue] % remove? never used in a proof or anything
Holding all channel liquidity equal, channels allocated to a higher velocity
section of the sub-graph will yield a higher $F_c$ than channel allocated to a
low-velocity section of the sub-graph.
\end{theorem}
Intuitively, if each payment flow sourced at an incoming channel $C_i$ and sunk
at an outgoing channel $C_o$ pays an equal forwarding fee per flow, then for a
fixed unit of time, a higher velocity channel will result in higher total
revenue in a time slice.
The role of Channel Liquidity Markets in a payment channel network is to reduce
information asymmetry by allowing agents to signal their preferences for lifted
coins vs non-lifted coins. The existence of \emph{venues} where these markets
can be carried out benefits the wider network by allowing agents to determine
where their liquidity is most demanded on the network. % remove?
\begin{center}
\textbf{Channel Leases}
\end{center}
With our two primary agents defined, we now move on to the definition of a
Lightning Channel Lease:
\begin{definition}{(Lightning Channel Lease).}
A Lightning Channel Lease is defined as, $\Gamma = \{P_{T}, P_{M}, A_{sat},
D_{block}, r_{i} \}$, where:
\end{definition}
\begin{itemize}
\item $P_{T}$ is the \texttt{secp256k1} public key of the \texttt{Liquidity Taker}.
\item $P_{M}$ the public key for the \texttt{Liquidity Maker}.
\item $A_{sat}$ is the total amount of Bitcoin within the contract.
\item $D_{block}$ is the duration of the contract expressed in Blocks.
\item $r_{i}$ is the per-block interest rate as discovered in the $i$th
instance of the market.
\end{itemize}
Note that the premium $R_{P}$ as referenced above is parametrized in using the
\emph{lease duration} $D_{blocks}$: $R_{P}(D_{blocks}) = r_i \cdot D_{blocks}$ as
we deal in simple, rather than compounding, interest. The duration of the
contract $D_{blocks}$ is of great interest, as similar to U.S Treasury
auctions, a \emph{yield-curve} can be constructed based on the matched
contents of a given auction iteration.
\subsection{Non-Custodial Auction Accounts}
In order to participate in the auction, we require all participants to deposit their
trading balance into a Marketplace Account:
\theoremstyle{definition}
\begin{definition}{(Marketplace Account).}
A marketplace account is a \emph{non-custodial} account defined as, $\Psi =
\{K_{sat}, T_{blocks}, P_{acct}, \Omega_{nodes} \}$ where.
\end{definition}
\begin{itemize}
\item $K_{sat}$ is the total amount of Bitcoin available within the account.
\item $T_{blocks}$ is the absolute expiry height of the account.
\item $P_{acct}$ is a \texttt{secp256k1} public key that \emph{uniqely} identifies the account.
\item $\Omega_{nodes}$ is a set of Lighting Network nodes controlled by the account.
\end{itemize}