-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpaper.tex
More file actions
465 lines (391 loc) · 22.8 KB
/
paper.tex
File metadata and controls
465 lines (391 loc) · 22.8 KB
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
\documentclass[review,12pt]{elsarticle}
\usepackage[left=3.2cm, right=3.2cm, top=3.2cm, bottom=3.2cm]{geometry}
\usepackage{lineno, hyperref}
\modulolinenumbers[5]
% \journal{Theoretical Economics}
\usepackage{graphicx}
% \usepackage[abbr]{harvard}
\usepackage{amsmath}
% \usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{braket}
\usepackage{threeparttable}
\usepackage[table]{xcolor}
% Solution to fix compiler warning https://tex.stackexchange.com/a/515199
\usepackage{regexpatch}
\makeatletter
\regexpatchcmd\ps@pprintTitle
{\cE\}\ \cE\}}{\cE\}\cE\}}
{}{\FailedToPatch}
\makeatother
% \RequirePackage[colorlinks,citecolor=blue,linkcolor=blue,urlcolor=blue,pagebackref]{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%
%% Elsevier bibliography styles
%%%%%%%%%%%%%%%%%%%%%%%
%% To change the style, put a % in front of the second line of the current style and
%% remove the % from the second line of the style you would like to use.
%%%%%%%%%%%%%%%%%%%%%%%
%% Numbered
%\bibliographystyle{model1-num-names}
%% Numbered without titles
%\bibliographystyle{model1a-num-names}
%% Harvard
\bibliographystyle{model2-names.bst}\biboptions{authoryear}
%% Vancouver numbered
%\usepackage{numcompress}\bibliographystyle{model3-num-names}
%% Vancouver name/year
%\usepackage{numcompress}\bibliographystyle{model4-names}\biboptions{authoryear}
%% APA style
%\bibliographystyle{model5-names}\biboptions{authoryear}
%% AMA style
%\usepackage{numcompress}\bibliographystyle{model6-num-names}
%% `Elsevier LaTeX' style
%\bibliographystyle{elsarticle-num}
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% Uncomment next line to change %%
%% the type of equation numbering %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\numberwithin{equation}{section}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% For Assumption, Axiom, Claim, Corollary, %%
%% Lemma, Theorem, Proposition, Hypothesis, %%
%% Fact %%
%% use \theoremstyle{plain} %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \theoremstyle{plain}
\newtheorem{axiom}{Axiom}
\newtheorem{postulate}{Postulate}
\newtheorem{claim}[axiom]{Claim}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newdefinition{remark}{Remark}
\newdefinition{definition}{Definition}
\newproof{proof}{Proof}
% \newtheorem*{fact}{Fact}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% For Definition, Example, Remark, %%
%% Notation, Property %%
%% use \theoremstyle{remark} %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \theoremstyle{remark}
% \newtheorem{definition}[theorem]{Definition}
% \newtheorem*{example}{Example}
\newcommand{\proofofref}{}
\newproof{zproofof}{Proof of \proofofref}
\newenvironment{proofof}[1]
{\renewcommand{\proofofref}{#1}\zproofof}
{\endzproofof}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Local Definitions definitions: %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareMathOperator{\E}{\mathbb{E}}
\DeclareMathOperator{\Var}{\mathrm{Var}}
\DeclareMathOperator{\Cov}{\mathrm{Cov}}
\DeclareMathOperator{\Tr}{\mathrm{Tr}}
\newcolumntype{L}{>{\centering\arraybackslash}p{0.085\linewidth}}
\begin{document}
\begin{frontmatter}
\title{Algorithm for Calculating Lightning Node Fees}
% %% Group authors per affiliation:
\author[1]{Cal Abel\texorpdfstring{\footnote{Declarations of interest: none}}}\corref{cor1}
\address[1]{2600 Century Parkway, Ste. 100, Atlanta, GA, USA}
% %% include affiliations in footnotes:
\author[1]{Skylane Engineering, LLC}
\ead[url]{https://skylaneengineering.com}
\cortext[cor1]{Corresponding author}
\ead{crabel@skylaneengineering.com}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Abstract %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{abstract}
This paper outlines a simple strategy to create channels on a Lightning Network routing node that will tend toward a balanced configuration.
In the derivation of the fee, the central role that a channel's entropy plays in quantify a channel's status is readily apparent.
The algorithm is derived from the principles of statistical mechanics and uses the Helmholtz potential to dynamically assess either inbound or outbound fees.
If this fee strategy is widely adopted, the network will tend toward a state of equilibrium with the lowest overall fee structure.
\end{abstract}
% \begin{keyword}
% \end{keyword}
\end{frontmatter}
\linenumbers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Introduction %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
The objective of this paper is to lay out the structure of an algorithmic fee structure for a routing channel on the Lightning Network.
With current technology, channels are limited in their ability to dynamically assess fees based on channel balance.
What we propose is a method by which a node will use the fee structure to become self balancing, and charging a higher fee for transactions that are routed that take a channel out of balance.
We will need to provide some general concepts and notation to be able to describe a channel mathematically.
Channels, when abstractly considered can best be thought of as vector spaces.
Because of this and due to the physical analogies that we use, we will adopt the Dirac notation for describing complex vector spaces.
Using a classical combinatorics approach to define the possible channel configurations, we propose a metric for a channel's balance.
This is done by treating the sats locked up in a channel as a microcanonical ensemble.
This will provide us with a combinatorial definition of entropy, which when maximized will define a channel being balanced.
The overall approach of this method is to set up a fee structure that considers three factors, the transaction size, the balance point, and the net transaction current.
To develop each of these fees, we will use a variational approach to linearize the fee model to derive expressions for the first fee structures.
The transaction current is an adaptation of a quantum mechanical model for a paramagnet.
A node operator will then have four fees to set based upon how they want the channel balanced.
\section{General Channel Description}
A channel has two orthogonal states in which a satoshi can be: inbound and outbound.
We represent the inbound state with the ket vector $\Ket{+}$ and the outbound state with $\Ket{-}$.
These two vectors provide an orthonormal basis of each satoshi in each channel.
Let's take a channel that has been unilaterally funded with $M$ total satoshi.
Each of the funding satoshi will be in the $\Ket{+}$ state.
When every satoshi is either all in either $\Ket{+}$ or $\Ket{-}$ we call that a pure state.
Our example channel has no inbound liquidity because there are no vacant inbound states in which to accept satoshi.
It can, however, ``spend'' satoshi shifting those satoshi from the inbound state to the outbound state.
We define the $\Ket{+}\rightarrow\Ket{-}$ transition as having a $(+)$ direction.
Conversely, the state transition, $\Ket{-}\rightarrow\Ket{+}$, has a $(-)$ direction.
The signs associated with what is positive and what is negative are purely arbitrary.
As we will later see, the arbitrary nature of the direction follows directly from a symmetry within the channel.
The symmetry results in the conservation of a channels satoshi.
Once a channel is funded, its total number of satoshi are fixed until liquidation.
The only thing that changes with a channel's satoshi is its state.
\subsection{Microcanonical Ensemble}
We now consider a channel in complete isolation from the remainder of the lightning network.
This channel forms what is known as a statistical ensemble, where each of the satoshi acts as an independent element within the ensemble.
Because the satoshi exist classically, we can neglect any quantum interferences and assume that they are orthogonal to each other.
A statistical ensemble that is in complete isolation is called a microcanonical ensemble.
We define the channels multiplicity as,
\begin{equation}
W = \frac{M!}{m_+!m_-!}. \nonumber
\end{equation}
Where, $m_+$ is the number of satoshi in the inbound state and $m_-$ is the number of satoshi in the outbound state.
\subsection{Entropy}
We define a channel's entropy as being,
\begin{equation}
S = \log W. \nonumber
\end{equation}
This is also known as its Boltzmann entropy and is maximal when each state is equally probable.
The maximum entropy of microcanonical ensemble is $\log 2 M$.
Boltzmann entropy reduces the to the Gibbs entropy by using the Sterling approximation,
\begin{equation}
S = \sum_{i\in\left\{+,-\right\}} m_i \log \frac{M}{m_i}. \label{eq:1}
\end{equation}
In our example of a unilaterally funded channel, the one in a pure state, it has an entropy, $S = 0$.
Because our channel exists classically and without quantum interferences, we cannot describe its state as a linear superposition of its basis vectors.
A satoshi's state vector, $\Ket{\psi}$ is either,
\begin{equation}
\Ket{\psi_+} = \begin{pmatrix}
1 \\
0
\end{pmatrix} \textrm{ or }
\Ket{\psi_-} = \begin{pmatrix}
0 \\
1
\end{pmatrix} \nonumber
\end{equation}
for either the inbound or outbound states respectively.
We can describe the mixed state of any linear combination of satoshi within the channel using a density matrix,
\begin{equation}
\hat{\rho} = \sum_{i\in\left\{+,-\right\}} \frac{m_i}{M}\Ket{\psi_i}\Bra{\psi_i}. \nonumber
\end{equation}
From this perspective the Gibbs entropy of equation \ref{eq:1} is the von Neumann entropy, where the diagonal elements of the density matrix are its eigenvalues, $p_i$,
\begin{equation}
\hat{\rho} \Ket{i} = p_i \Ket{i}. \nonumber
\end{equation}
And,
\begin{equation}
S = M s = - M \sum_{i\in\left\{+,-\right\}} p_i \log p_i. \nonumber
\end{equation}
\section{Node Formalism}
We need to establish a number of definitions and concepts that will help with understanding channels in the context of a routing node.
This formalism is taken directly from nuclear physics in describing how neutrons interact with matter.
It is adapted from \cite[pp.~3--6]{Bell:1970}.
While the only part of the formalism used in this paper is the concept of the \emph{satoshi current}, there are many other techniques that can be used in evaluating the lightning network.
An interested reader may want to consider specifically Chapter 6 with the variational methods and the adjoint transport equation.
The adjoint equation is used to describe neutron detectors, which is highly analogous to transaction routing.
% A quadrature interval is defined by,
% \begin{equation}
% \Delta t_{quad} = sum_i \Delta t_i
% \end{equation}
% Where $\Delta t_i = t_i - t_{i -1}$ is the time between transactions through the node.
A valid route through a node consists of an inbound channel, $\Ket{+_j}$ and an outbound channel, $\Ket{-_k}$.
The two channels in a particular route form a joint system.
\begin{equation}
\Ket{jk} = \Ket{j}\Ket{k} = \Ket{+_j} \otimes \Ket{-_k}. \nonumber
\end{equation}
For the route to be valid one channel has to be $\Ket{+}$ and the other in $\Ket{-}$, thus a route is antisymmetric.
Because the route is antisymmetric, the permutation operator, $\hat{P}_{jk}$, is defined by,
\begin{equation}
\hat{P}_{j,k} \Ket{jk} = - \Ket{kj}. \nonumber
\end{equation}
As a result, from the perspective of the $j^\textrm{th}$ node routes of $\Ket{jk}$ are positive and $\Ket{kj}$ are negative.
\begin{definition}[Transaction Velocity]
The transaction velocity is the period between transactions along the route $\Ket{jk}$.
\begin{equation}
\mathbf{v}_i \equiv \frac{1}{\Delta t_i}\Ket{jk}. \nonumber
\end{equation}
\end{definition}
The base unit of the transaction velocity is transactions per second.
\begin{definition} [Route Density]
A route's density, $M_{j,k,i}$, is the total number of satoshi sent in that route's $i^\textrm{th}$ transaction.
\end{definition}
The route density has units of satoshi per transaction.
The sum of all route densities over all possible routes is the \emph{satoshi density},
\begin{definition}[Satoshi Density]
\begin{eqnarray}
m_i & \equiv & \Bra{jk} M_{j,k,i} \Ket{jk} \nonumber \\
& = & \sum_{j,k}M_{j,k,i} \nonumber
\end{eqnarray}
\end{definition}
We need to consider the \emph{vector flux} across a particular channel, which is the product of the \emph{transaction velocity} and the \emph{route density},
\begin{definition}[Vector Flux]
\begin{equation}
\mathbf{\Phi}_{j,k,i} \equiv M_{j,k,i}\mathbf{v}_{j,k,i}. \nonumber
\end{equation}
\end{definition}
The sum of the vector flux over all possible routes for a node is the \emph{total flux} or \emph{scalar flux},
\begin{definition}[Total Flux]
\begin{equation}
\phi_i \equiv \Bra{jk}\mathbf{\Phi}_{j,k,i} = \sum_{j,k} \frac{M_{j,k,i}}{\Delta t_i}. \nonumber
\end{equation}
\end{definition}
We want to consider the rate at which satoshi are crossing a channel in either the inbound or outbound directions.
The rate of satoshi crossing a channel is called the \emph{satoshi current} whose partial currents are,
\begin{definition}[Partial Current]
\begin{eqnarray}
\mathbf{J}_{j,i}^+ & = & \Bra{k}\mathbf{\Phi}_{j,k,i} = \sum_k \frac{M_{j,k,i}}{\Delta t_i}\Ket{j} \nonumber \\
\mathbf{J}_{j,i}^- & = & \Bra{k}\mathbf{\Phi}_{k,j,i} = -\sum_k \frac{M_{k,j,i}}{\Delta t_i}\Ket{j} \nonumber
\end{eqnarray}
\end{definition}
And the total \emph{satoshi current} which is the sum of the partial currents,
\begin{definition}[Satoshi Current]
\begin{equation}
\mathbf{J}_{j,i} \equiv \mathbf{J}_{j,i}^+ + \mathbf{J}_{j,i}^- \nonumber
\end{equation}
\end{definition}
\section{The Hamiltonian and the Canonical Ensemble}
We want to think about how the fees effect the state of a channel, because the fees and the channels connections effect how other nodes see this particular node.
To do this, we define an observable that called the Hamiltonian.
This observable acts similarly to the Hamiltonian of classical and quantum physics.
The idea is that the fees determine the ``energy'' level (state occupancy) in the context of the transactions that are being routed through that particular channel.
Lets take a simple case where the inbound fee is $u_+$ and the outbound fee is $u_-$.
The Hamiltonian is,
\begin{equation}
\hat{H} = \begin{pmatrix}
u_+ & 0 \\
0 & u_- \\
\end{pmatrix}. \nonumber
\end{equation}
% The expectation of the Hamiltonian is given by,
% \begin{eqnarray}
% \Braket{H_{l}} & = & \Tr\left[\hat{\rho}\hat{H}\right] \nonumber \\
% & = & \frac{m_+}{M}u_+ + \frac{m_-}{M}u_- \nonumber
% \end{eqnarray}
% If we perturb around the expectation with small fluctuations of $\delta m_+$,
% \begin{eqnarray}
% \Braket{H_{l}}^* & = & \frac{m_+ + \delta m_+}{M}u_+ + \frac{m_- - \delta m_+}{M}u_- \nonumber \\
% & = & \Braket{H} + \left(u_+ - u_-\right)\frac{\delta m_+}{M} \nonumber \\
% \delta \Braket{H_{l}} & = & \left(u_+ - u_-\right)\frac{\delta m_+}{M}. \label{eq:2}
% \end{eqnarray}
% The sign may seem problematic in equation \ref{eq:2}, however, remember we are considering a channel in an outbound transaction having the positive sign and an inbound transaction having a negative sign.
We want to consider the channel being in statistical equilibrium with the network.
Because the satoshi are fixed on a particular channel, the appropriate ensemble to consider in this case is the canonical ensemble.
Given our knowledge of the liquidity Hamiltonian, we wish to consider the case where the channel is in its most probable configuration.
From statistical mechanics we know that for the canonical ensemble this distribution is,
\begin{equation}
\hat{\rho} = \frac{1}{Z}e^{-\beta M \hat{H}}. \nonumber
\end{equation}
Where the canonical partition function is,
\begin{equation}
Z[\beta] = \Tr\left[e^{-\beta M \hat{H}}\right]. \nonumber
\end{equation}
The process of the channel reaching an equilibrium state is the process of a long random walk, which will favor the state with the lower overall potential.
We will use this property of the canonical ensemble to create better and more adaptive fee structures.
If the channel's liquidity fee is symmetric, each satoshi is equally probable to be in either one state or the other.
A good analogy to this is the card game War, where each of the players represents either the inbound or the outbound state, and the passing of the pile of cards is a transaction.
Eventually, one of the states will loose liquidity and have no cards/sats.
Having an asymmetric Hamiltonian allows one of the players to stack the deck slightly in their favor.
What we will do is to tie the Hamiltonian to the channels state.
So, as a channel is more out of balance or is being consistently ``pushed'' toward a certain state the fee will increase, to make that particular state statistically less favorable.
We can also use the asymmetric fees to set a desired channel equilibrium state.
\section{Fee Design}
For the sake of having a standard reference, we will denote an inbound transaction as $\delta m_+$.
If the channel's inbound state occupancy increases, $\delta m_+ > 0$.
Similarly, an outbound transaction is $\delta m_-$
\subsection{Liquidity Fee}
We begin by setting the desired channel equilibrium distribution.
This is done with the traditionally constant liquidity fee.
We make one modification to this in that we allow a channel to have a different inbound or outbound fee.
This will result in the channel being canonically distributed based upon the balancing fee.
The channel operator would select fixed $u_+$ and $u_-$ such that,
\begin{equation}
\hat{H}_{liq} = \begin{pmatrix}
u_+ & 0 \\
0 & u_- \\
\end{pmatrix}. \nonumber
\end{equation}
\subsection{Balance Fee}
If we consider just the entropy of the channel configuration, we are considering only the case of the microcanonical ensemble.
We need to look at the entropy of the channel's ``energy'', and perturb it with a small transaction.
\begin{eqnarray}
S & = & \frac{2u_+}{u_+ + u_-} m_+ \log \frac{U}{u_+ m_+} + \frac{2u_-}{u_+ + u_-} m_- \log \frac{U}{u_- m_-} \nonumber \\
S^* & = & \frac{2u_+}{u_+ + u_-} (m_+ + \delta m_+) \log \frac{U}{u_+ (m_+ + \delta m_+)} \nonumber\\
& + & \frac{2u_-}{u_+ + u_-} (m_- - \delta m_+) \log \frac{U}{u_- (m_- - \delta m_+)} \nonumber \\
& \approx & S + \delta m_+ \left( \frac{2u_+}{u_+ + u_-}\log \left(1 + \frac{u_- m_-}{u_+ m_+}\right) - \frac{2u_-}{u_+ + u_-} \log \left(1 + \frac{u_+ m_+}{u_- m_-}\right) \right) \nonumber \\
\delta s & = & \frac{2u_+}{u_+ + u_-}\log \left(1 + \frac{u_- m_-}{u_+ m_+}\right) - \frac{2u_-}{u_+ + u_-} \log \left(1 + \frac{u_+ m_+}{u_- m_-}\right) \nonumber
\end{eqnarray}
We add a balance fee $\tau$ and have the balance portion of the fee Hamiltonian as,
\begin{equation}
\hat{H}_{bal} = \begin{pmatrix}
-\tau \delta s & 0 \\
0 & -\tau \delta s \\
\end{pmatrix}. \nonumber
\end{equation}
\subsection{Current Fee}
The final fee that we want to consider is the current fee which uses the satoshi current defined earlier.
The current across a particular channel acts as a force ``pushing'' the channel's satoshi in a particular direction.
This is mathematically analogous to what a magnetic field does to electrons in a paramagnet.
We define the current fee as $\mu$, this is equivalent to the magnetic moment of a particle and use the satoshi current to replace the field vector.
\begin{equation}
\hat{H}_{J} = \begin{pmatrix}
\mu \,\Bra{j}\mathbf{J}_j & 0 \\
0 & -\mu \,\Bra{j}\mathbf{J}_j \\
\end{pmatrix}. \nonumber
\end{equation}
Because the satoshi current is described for an instantaneous current of a transaction, the current needs to be aggregated over some quadrature interval, e.g. the last 10 transactions for each of the inbound and outbound routes.
The fee is then applied to the current that is either positive or negative.
\subsection{Combined Fee}
The combined channel fee is simply the sum of the three sub fees.
\begin{equation}
\hat{F}_j = \begin{pmatrix}
u_{j,+} -\tau_j \delta s_j + \mu_j \,\Bra{j}\mathbf{J}_j & 0 \\
0 & u_{j,-} -\tau_j \delta s_j - \mu_j \,\Bra{j}\mathbf{J}_j \\
\end{pmatrix}. \label{eq:2}
\end{equation}
We represent a transaction as,
\begin{equation}
\delta \hat{m} = \delta m \begin{pmatrix}
p_+ & 0 \\
0 & p_- \\
\end{pmatrix}. \nonumber
\end{equation}
Because a transaction is either inbound $(+)$ or outbound $(-)$, it is always a pure state, either $\left\{p_+, p_-\right\} = \left\{1, 0\right\}$ or $\left\{p_+, p_-\right\} = \left\{0, 1\right\}$.
Thus the routing fee over route $\Ket{jk}$ is,
\begin{equation}
Fee = \max\left(0,\Tr\left[ \delta \hat{m}_+ \hat{F}_j + \delta \hat{m}_- \hat{F}_k \right]\right). \label{eq:3}
\end{equation}
Putting a floor of zero prevents the node operator from paying to route the transaction in the case where the fee potential met the right conditions to be negative.
It would make sense for a node operator to pay to balance a pair of channels, as they do this during channel rebalancing.
I just don't know if that is technically possible with the lightning network.
\section{Conclusion}
By adopting a routing fee structure outlined in here, a node signals to the network the state of their channel and how the proposed route impacts the channel to the network through its fee.
We have a method that creates an incentive to balance the node, because the fee is directly related to the state of the channel and its relationship relative to the transaction being routed.
If enough nodes adopt such a strategy for charging fees, the network can reach a state of statistical equilibrium, where the overall entropy of the network is maximized.
Furthermore, it is apparent the importance that a node's channel entropy plays in its ability to route transactions.
The channel's entropy measures both its capacity, and its overall balance.
Entropy is a critical measure in channel assessment even if the strategy proposed here for calculating routing fees is not adopted.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Acknowledgements %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \section*{Acknowledgements}
\bibliography{paper.bib}
\end{document}