This repository has been archived by the owner on May 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathappendix.tex
100 lines (92 loc) · 2.26 KB
/
appendix.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
\newtheorem{script}{Script}
\section{Transaction scripts}\label{append1}
For completeness, this appendix lists the scripts for the transactions that are used in the establishment and update of DLC channels.
\begin{script}[Fund transaction output script]\label{script:fundtx} \\
\begin{Verbatim}[samepage=true]
OP_2
<alice public key>
<bob public key>
OP_2
OP_CHECKMULTISIG
\end{Verbatim}
\end{script}
\begin{script}[Script for the first output of an update transaction]\label{script:updatetx1}\\
\begin{Verbatim}[samepage=true]
OP_IF
<delay 1>
OP_CHECKSEQUENCEVERIFY
OP_DROP
OP_2
<alice public key>
<bob public key>
OP_2
OP_CHECKMULTISIG
OP_ELSE
OP_IF
<delay 2>
OP_CHECKSEQUENCEVERIFY
OP_DROP
<alice/bob public key>
OP_ELSE
<alice/bob revocation public key>
OP_ENDIF
OP_CHECKSIG
OP_ENDIF
\end{Verbatim}
Note that \Verb _delay 1_ must be less than \Verb _delay 2_.
\end{script}
\begin{script}[Script for the second output of an update transaction]\label{script:updatetx2}\\
\begin{Verbatim}[samepage=true]
OP_IF
OP_2
<alice public key>
<bob public key>
OP_2
OP_CHECKMULTISIG
OP_ELSE
<delay 2>
OP_CHECKSEQUENCEVERIFY
OP_DROP
<alice/bob public key>
OP_CHECKSIG
OP_ENDIF
\end{Verbatim}
Note that \Verb _delay 2_ should be the same value as used in the first output.
\end{script}
\begin{script}[Buffer transaction output script]\label{script:buffertx}\\
\begin{Verbatim}[samepage=true]
OP_2
<alice public key>
<bob public key>
OP_2
OP_CHECKMULTISIG
\end{Verbatim}
\end{script}
\begin{script}[Script for the first output of a CET]\label{script:cet}\\
\begin{Verbatim}[samepage=true]
OP_IF
<alice/bob public key>
+ <oracle message public key>
OP_ELSE
<delay 3>
OP_CHECKSEQUENCEVERIFY
OP_DROP
<bob/alice public key>
OP_ENDIF
OP_CHECKSIG
\end{Verbatim}
Note that the \Verb _+_ operator represents elliptic curve point addition.
\end{script}
\begin{script}[Output script of a split transaction]~\label{script:splittx}\\
\begin{Verbatim}[samepage=true]
OP_IF
<alice/bob revocation public key>
OP_ELSE
<delay>
OP_CHECKSEQUENCEVERIFY
OP_DROP
<alice/bob public key>
OP_ENDIF
OP_CHECKSIG
\end{Verbatim}
\end{script}