forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployable-lightning.lyx
2164 lines (1647 loc) · 42.6 KB
/
deployable-lightning.lyx
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
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass article
\begin_preamble
% for subfigures/subtables
\usepackage[caption=false,font=footnotesize]{subfig}
\end_preamble
\options journal
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package none
\inputencoding default
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command bibtex
\index_command default
\float_placement H
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_title "Your Title"
\pdf_author "Your Name"
\pdf_bookmarks true
\pdf_bookmarksnumbered true
\pdf_bookmarksopen true
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder true
\pdf_colorlinks false
\pdf_backref false
\pdf_pdfusetitle false
\pdf_quoted_options "pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 0
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 0
\use_package mhchem 1
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine basic
\cite_engine_type default
\biblio_style ieeetr
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Title
Reaching The Ground With Lightning (draft 0.2)
\end_layout
\begin_layout Author
Rusty Russell <[email protected]>
\end_layout
\begin_layout Abstract
The Lightning Network (as proposed by Joseph Poon and Thaddeus Dryja
\begin_inset CommandInset citation
LatexCommand cite
key "Poon2015Lightning"
\end_inset
) requires some new sighash modes in order to work with Bitcoin.
This paper proposes a simplified variant which requires only modifications
which are already proposed for bitcoin, and slightly simplifies the revocation
of existing contracts.
\end_layout
\begin_layout Abstract
Keywords: bitcoin, lightning, revocation hash, HTLC, BIP62, BIP65, BIP68
\end_layout
\begin_layout Section
Introduction
\end_layout
\begin_layout Standard
The Bitcoin network
\begin_inset CommandInset citation
LatexCommand cite
key "nakamoto2008bitcoin"
\end_inset
allows the transfer of value between peers using
\emph on
transactions.
\emph default
Each bitcoin transaction consists of one or more
\emph on
outputs
\emph default
(typically specifying the hash of the recipient's key), and one or more
\emph on
inputs
\emph default
(typically containing the recipient's key and a signature of the transaction).
Thus one transfers value to another peer by creating a transaction which
\emph on
spends
\emph default
one or more outputs and creates an output which the recipient can spend
using their private key.
\end_layout
\begin_layout Standard
While such cryptographic transfer of value is near-instantaneous, ensuring
that the transaction has been included in the consensus of the shared ledger
(aka.
\emph on
blockchain
\emph default
) creates delays ranging from a few minutes to hours, depending on the level
of reliability required.
Inclusion in the blockchain is performed by miners, who preferentially
include transactions paying greatest fee per byte.
\end_layout
\begin_layout Standard
Thus using the blockchain directly is slow, and too expensive for genuinely
small transfers (typical fees are a few cents).
\end_layout
\begin_layout Section
Previous Work
\end_layout
\begin_layout Standard
To work around the bitcoin network's delays and fees, several forms of
\emph on
off-chain
\emph default
transaction patterns have been developed, where series of transactions
are sent directly between two parties, with only the initial opening transactio
n and final redemption transaction being included in the bitcoin blockchain.
\end_layout
\begin_layout Standard
The Lightning Network paper proposed a solution, but at the cost of introducing
new signature variants (sighash ops).
Adding a new signature opcode would allow many other improvements
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
Schnorr signatures offer faster batch validation, according to
https://elementsproject.org/elements/schnorr-signatures/
\end_layout
\end_inset
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
DER encoding adds unnecessary bytes and is a cause of malleability
\end_layout
\end_inset
but that is precisely why it's a matter for longer term research and unlikely
to be deployed in Bitcoin in the immediate future.
\end_layout
\begin_layout Subsection
Payment Channels
\end_layout
\begin_layout Standard
The concept of
\emph on
payment channels
\emph default
(sometimes called micropayment channels) has existed in various forms for
several years
\begin_inset CommandInset citation
LatexCommand cite
key "BitcoinChannels"
\end_inset
.
The simplest form is as follows, and allows A to quickly and cheaply pay
B a stream of slightly increasing amounts:
\end_layout
\begin_layout Enumerate
A creates an
\emph on
anchor
\emph default
transaction to
\emph on
open the channel
\emph default
which:
\end_layout
\begin_deeper
\begin_layout Enumerate
Outputs $1,
\end_layout
\begin_layout Enumerate
Requires the signatures of both A and B to redeem.
\end_layout
\end_deeper
\begin_layout Enumerate
A sends the transaction ID of the anchor, which output to spend, and the
amount of that output to B.
\end_layout
\begin_layout Enumerate
B signs a
\begin_inset Quotes eld
\end_inset
refund
\begin_inset Quotes erd
\end_inset
transaction which:
\end_layout
\begin_deeper
\begin_layout Enumerate
spends that anchor output,
\end_layout
\begin_layout Enumerate
outputs the $1 to an address controlled by A, and
\end_layout
\begin_layout Enumerate
can only be spent in 24 hours (using the
\emph on
locktime
\emph default
field)
\end_layout
\end_deeper
\begin_layout Enumerate
B sends A the refund transaction.
\end_layout
\begin_layout Enumerate
A broadcasts the anchor transaction, knowing she can get the funds back
in 24 hours using the refund if B vanishes.
\end_layout
\begin_layout Standard
A can now pay B 1 cent by signing a new
\emph on
commitment
\emph default
transaction to send to B, which spends the anchor output and has two outputs:
one pays A 99c, and the other pays B 1 cent.
A can later pay B another cent by signing another transaction (
\begin_inset Quotes eld
\end_inset
updating the commitment
\begin_inset Quotes erd
\end_inset
) for B which pays A 98c and B 2c, etc.
\end_layout
\begin_layout Standard
At any point, B can
\begin_inset Quotes eld
\end_inset
close the channel
\begin_inset Quotes erd
\end_inset
by signing and broadcasting the latest commitment transaction to collect
the money.
B should do this before 24 hours pass, otherwise A can use the refund transacti
on.
\end_layout
\begin_layout Subsubsection
Limitations Of Simple Payment Channels
\end_layout
\begin_layout Standard
Simple channels have several limitations:
\end_layout
\begin_layout Description
Single
\begin_inset space ~
\end_inset
recipient.
A new recipient requires a new channel, which must wait for consensus on
the anchor transaction.
\end_layout
\begin_layout Description
One
\begin_inset space ~
\end_inset
way.
They cannot be reversed: A can sign a transaction which pays B less money
than the last, but B could still broadcast the older transaction.
\end_layout
\begin_layout Description
Vulnerable
\begin_inset space ~
\end_inset
to
\begin_inset space ~
\end_inset
malleability.
The anchor transaction could be altered in several ways (without invaliding
it completely) before inclusion in the blockchain: this alters its transaction
id and thus makes the refund transaction unusable.
\end_layout
\begin_layout Standard
This last issue is a common one with complex bitcoin transactions, and BIP62
\begin_inset CommandInset citation
LatexCommand cite
key "BIP62"
\end_inset
is proposed to prevent non-signing parties from being able to malleate
transactions.
\end_layout
\begin_layout Subsection
Generalized Payment Channels Using Revocable Transactions
\end_layout
\begin_layout Standard
The Lightning network introduced generalized, bi-directional payment channels,
referred to here as
\emph on
Poon-Dryja channels
\emph default
.
These use a mutual anchor, which both create to provide the channel funding,
and a symmetrical
\emph on
pair
\emph default
of updatable commitment
\emph on
\emph default
transactions rather than the single transaction used in the one-way channel
case, as shown in figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Figure-1-from"
\end_inset
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
Note: this diagram has been corrected since: Commitment Close Tx 1A (CC1b)
-- should be CC1a, and vice-versa
\end_layout
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename ln-draft-fig1.eps
scale 50
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
Figure 1 from the Lightning Network Draft 0.5
\begin_inset CommandInset label
LatexCommand label
name "fig:Figure-1-from"
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
To update the commitment, A sends B a signature for B's new commitment transacti
on, and B sends A a signature for A's new commitment transaction.
\end_layout
\begin_layout Standard
As before, each commitment transaction contains two outputs, one for A and
one for B; but A's commitment transaction output to itself is encumbered
by an additional restriction (as is B's output to itself).
Instead of paying A directly, A's output needs both A and B's signature.
B provides such a signature, but on a
\begin_inset Quotes eld
\end_inset
commitment refund
\begin_inset Quotes erd
\end_inset
transaction which can only be spent after a delay (40 days in the paper).
Thus if A closes the channel by signing and broadcasting its commitment
transaction, B can collect its output immediately, but A must wait 40 days.
\end_layout
\begin_layout Standard
This delay encumbering the output is what makes the commitment transaction
\emph on
revocable;
\emph default
once an updated commitment transaction is agreed upon, the previous commitment
transaction pair is revoked by sharing the private keys needed to redeem
those encumbered outputs.
Thus, A shares its (throwaway) private key, and B shares its throwaway
private key.
If A were to sign and broadcast a revoked commitment transaction, B could
not only immediately spend its own output, but it has both A's key and
its own to generate a transaction which can spend the output which would
normally go to A after a delay.
\end_layout
\begin_layout Subsection
Hashed Timelock Contracts (HTLCs)
\end_layout
\begin_layout Standard
The Lightning Network paper used a set of 4 transactions to implement a
\emph on
hashed timelock contract,
\emph default
which guarantees payment of a given amount on presentation of a secret value
\emph on
R
\emph default
within a certain timespan.
Any number of these could be active within a generalized channel, and this
is what allows a network to form: Node A offers node B $1 for the secret
within 2 days, node B offers node C 99c for the secret within 1 day, etc.
\end_layout
\begin_layout Standard
This arrangement for one side of a single node is shown in figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Figure-2-from"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename ln-draft-fig2.eps
scale 50
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
Figure 2 from the Lightning Network Draft 0.5
\begin_inset CommandInset label
LatexCommand label
name "fig:Figure-2-from"
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Section
Enhancements To Lightning
\end_layout
\begin_layout Standard
This paper proposes various modifications.
\end_layout
\begin_layout Subsection
Poon-Dryja Generalized Payment Channel Modifications
\end_layout
\begin_layout Standard
This paper proposes three changes to the commitment transactions.
\end_layout
\begin_layout Subsubsection
Placing Timeout in Output Script
\end_layout
\begin_layout Standard
Rather than using a separate transaction to enforce the delay, BIP65
\begin_inset CommandInset citation
LatexCommand cite
key "BIP65"
\end_inset
proposes an OP_CHECKLOCKTIMEVERIFY which allows an output to specify the
minimum time at which it can be spent.
With this enhancement, we no longer need a separate
\begin_inset Quotes eld
\end_inset
commitment refund
\begin_inset Quotes erd
\end_inset
transaction.
The commitment transaction to-self output script would be a little more
complex:
\end_layout
\begin_layout Itemize
A and B's signature, OR
\end_layout
\begin_layout Itemize
A's signature and OP_CHECKLOCKTIMEVERIFY <40 days>
\end_layout
\begin_layout Standard
As of Nov.
13, 2015, BIP65 has been deployed and is in the process of being activated.
\end_layout
\begin_layout Subsubsection
Using Relative Locktime
\end_layout
\begin_layout Standard
The Poon-Dryja channel uses a 40 day locktime, because transaction locktime
is absolute.
Before 40 days the channel must be closed, otherwise spending a revoked
transaction and immediately following it with the commit refund transaction
is possible.
\end_layout
\begin_layout Standard
BIP112[#BIP112] proposes OP_CHECKSEQUENCEVERIFY, an opcode which allows
an output to specify a minimum
\emph on
relative
\emph default
time before the output can be spent
\begin_inset CommandInset citation
LatexCommand cite
key "friedenbach_bitcoin-development_2015,BIP112"
\end_inset
can reduce this timeout (say, to 1 day) and avoid placing a lifetime limit
on the channel, like so:
\end_layout
\begin_layout Itemize
A and B's signature, OR
\end_layout
\begin_layout Itemize
A's signature and OP_CHECKSEQUENCEVERIFY <1 day>
\end_layout
\begin_layout Standard
As of Nov.
13, 2015, BIP112 has not been deployed.
\end_layout
\begin_layout Subsubsection
Using Revocation Preimages Instead of Private Keys
\end_layout
\begin_layout Standard
There's a slightly more intuitive and more efficient method than exchanging
private keys, which is to reuse a technique of hash preimages which is
already needed for HTLCs (as we see later).
\end_layout
\begin_layout Standard
Instead of using a private key, B uses knowledge of a hash preimage as well
as its signature to steal funds from a revoked commitment transaction.
Thus, to create a commitment transaction each side provides a hash value;
to revoke a commitment transaction it provides the prehash image.
\end_layout
\begin_layout Standard
The resulting commitment transaction to-self output now looks like:
\end_layout
\begin_layout Itemize
B's signature and a preimage which hashes to <revocation-hash>, OR
\end_layout
\begin_layout Itemize
A's signature and OP_CHECKSEQUENCEVERIFY <1 day>
\end_layout
\begin_layout Standard
This can be expressed fairly easily in bitcoin's script-based scripting
language, as annotated in
\begin_inset CommandInset ref
LatexCommand nameref
reference "sub:Commitment-Outputs-For"
\end_inset
.
The final pair of commitment transaction outputs is shown in Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Commitment-Transaction-Outputs"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename commit-tx.eps
scale 50
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
Commitment Transaction Outputs
\begin_inset CommandInset label
LatexCommand label
name "fig:Commitment-Transaction-Outputs"
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Subsection
Channel Opening Modifications
\end_layout
\begin_layout Standard
The method of creating the first commitment transaction before signing the
anchor transaction (as proposed in the paper) presents two problems in
practice:
\end_layout
\begin_layout Enumerate
The anchor transaction id required for the commitment input will only be
known once the anchor is signed, and
\end_layout
\begin_layout Enumerate
The anchor transaction can be malleated by either party before entering
the blockchain, rendering the commitment input unusable.
\end_layout
\begin_layout Standard
The last of these is particularly pernicious, as BIP62 doesn't solve it:
signatories can always re-sign a transaction, hence altering its transaction
ID.
The paper proposes new SIGHASH flags which mitigate this problem, but we
are attempting to avoid that.
\end_layout
\begin_layout Standard
Our approach is to only have one-sided anchors.
These can be later balanced by the lightning network itself, or an atomic-swap
to an on-chain bitcoin transaction
\begin_inset CommandInset citation
LatexCommand cite
key "go1111111_single_anchor"
\end_inset
.
Any bitcoin transaction fees are initially funded by that anchor, but the
implementation splits fees where possible and never allows either side
to spend funds in the channel if they would no longer be able to pay their
share.
\end_layout
\begin_layout Subsection
Hashed Timelock Contract (HTLC) Modification
\end_layout
\begin_layout Standard
Using the same techniques used above, we can condense each HTLC into a single
output script on the commitment transaction.
This output is spendable under three conditions:
\end_layout
\begin_layout Enumerate
Recipient knows the R value (funds go to recipient), or
\end_layout
\begin_layout Enumerate
The HTLC has timed out (funds return to sender), or
\end_layout
\begin_layout Enumerate
The Commit transaction has been revoked (funds go to other side).
\end_layout
\begin_layout Standard
Unlike the original paper, we use revocation preimages instead of sharing
temporary private keys.
If we also use OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY it is
fairly simple to express these conditions in a single output script.
\end_layout
\begin_layout Standard
For each direction the HTLC could transfer funds, there are two scripts
required; one for A's commitment transaction and one for B's commitment
transaction.
It's also a requirement that the conditions which allow payment to oneself
be delayed, to give the other side an opportunity to take the funds in
case of revocation.
This is shown (omitting the HTLC to-self delays, which depend on the orientatio
n of payer/payee with respect to A and B) in figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:HTLC-Using-Revocation"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename htlc.eps
scale 50
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
HTLC Using Revocation Preimages, OP_CLTV and OP_CSV (simplified)
\begin_inset CommandInset label
LatexCommand label
name "fig:HTLC-Using-Revocation"
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
The scripts for this can be found in
\begin_inset CommandInset ref
LatexCommand nameref
reference "sec:Appendix-A:-Scripts"
\end_inset
.
\end_layout
\begin_layout Section
Conclusions
\end_layout
\begin_layout Standard
Secret preimages can replace exposure of temporary private keys in the Lightning
Network constructs with no loss of generality, and a slight gain in simplicity.
\end_layout
\begin_layout Standard
The use of script conditionals to enforce timeouts instead of using separate
pre-signed transactions reduces an HTLC from a set of four dual-signed
transactions to a single (more complex) output script, and additionally
avoids any requirement for new CHECKSIG flags for HTLCs.
\end_layout
\begin_layout Standard
By using a rebalanced single anchor, channel establishment can also avoid
new CHECKSIG flags, though it loses the important ability to outsource
the enforcement of channel contract terms.
\end_layout
\begin_layout Section*
Acknowlegments
\end_layout
\begin_layout Standard
Thanks to mmeijeri on Reddit's r/Bitcoin for pointing out a flaw in escape
transactions reusing the same A and B keys as the commitment transaction
in
\begin_inset CommandInset ref
LatexCommand nameref
reference "sec:Appendix-B:-Dual"
\end_inset
\begin_inset Foot
status open
\begin_layout Plain Layout
https://www.reddit.com/r/Bitcoin/comments/3dlxw4/reaching_the_ground_with_lightnin
g_lightning/ct80xpp
\end_layout
\end_inset
.
Thanks to John Newbery for multiple formatting and typing corrections.
\end_layout
\begin_layout Standard
Thanks to Joseph Poon for designing the escape/fast-escape dual-anchor method,
as well as finding a flaw in my original formulation of the dual anchor
construct and reviewing an earlier draft of this paper.
Also thanks to him and Thaddeus Dryja for the initial eye-opening Lightning
Network paper.
\end_layout
\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex
bibfiles "bitcoin"
options "bibtotoc,plain"
\end_inset
\end_layout
\begin_layout Section*
Appendix A: Transaction Scripts
\begin_inset CommandInset label
LatexCommand label
name "sec:Appendix-A:-Scripts"
\end_inset
\end_layout
\begin_layout Standard
All outputs are expressed as pay-to-scripthash outputs, where the redeeming
input provides the redeemscript.