summaryrefslogtreecommitdiff
path: root/pres-brains22/presentation.tex
blob: 9521c9888528b3aa74445bbb33ccd5a3555a6388 (plain)
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
\documentclass[aspectratio=169]{beamer}
\usepackage{tikz}
\usepackage{ragged2e}

\apptocmd{\frame}{}{\justifying}{}

\usetikzlibrary{positioning,fit,patterns}

\title{Depolymerization}
\subtitle{Integrating GNU Taler with blockchain-based cryptocurrencies}
\author{ Antoine d'Aligny \and Emmanuel Benoist \and Christian Grothoff}
\institute{Bern University of Applied Sciences}
\date{\today}
\titlegraphic{\includegraphics[width=2.5cm]{../docs/media/taler.png}}


\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\begin{frame}{GNU Taler}{Overview}
    \begin{tikzpicture}[remember picture,overlay]
        \node (N1)[above right=22mm and 56mm of current page.center]    {\includegraphics[width=18mm]{./google_play_GNU_Taler.jpg}};
        \node [below=-2mm of N1]{wallet.taler.net};
    \end{tikzpicture}
    \begin{columns}
        \column{0.5\textwidth}
        \begin{tikzpicture}[
                rect/.style={circle, draw=black},
                sym/.style={-stealth, shorten >= 2pt, shorten <= 2pt}
            ]
            % Taler payment system
            \node[rect](1) {Exchange};
            \node[rect,below left=1.5cm and 0.7cm of 1](2) {Customer};
            \node[rect,below right=1.5cm and 0.7cm of 1](3) {Merchant};

            \draw[sym] (1) -- node [midway, above, sloped] {\tiny Withdraw coins} (2);
            \draw[sym] (2) -- node [midway, above, sloped] {\tiny Spend coins} (3);
            \draw[sym] (3) -- node [midway, above, sloped] {\tiny Deposit coins} (1);

            % Settlement layer
            \node[left=2cm of 1](E1){};
            \node[right=2cm of 1](E2){};
            \draw[sym] (E1) -- node [midway, above] {\tiny Deposit money} (1);
            \draw[sym] (1) -- node [midway, above] {\tiny Withdraw money} (E2);

            % Auditor
            \node[above= of 1](A){Auditor};
            \draw[sym] (A) -- node [midway, right] {\tiny Verify} (1);

            % Separator
            \node[below=1mm of E1] (S1S) {};
            \node[below=1mm of E2] (S1E) {};
            \node[above=6mm of E1] (S2S) {};
            \node[above=6mm of E2] (S2E) {};

            \draw[dotted] (S1S) -- (S1E);
            \draw[dotted] (S2S) -- (S2E);

            \node[below right=-2mm and -1.5mm of S2S] {\tiny{\emph{Settlement Layer}}};
            \node[below right=-2mm and -1.5mm of S1S] {\tiny{\emph{Taler payment system}}};
        \end{tikzpicture}
        \column{0.47\paperwidth}
       
        
        \begin{block}{Taler payment system}
            \begin{itemize}
                \item Tokenization
                \item Blind signatures (privacy)
            \end{itemize}
        \end{block}
        \begin{block}{Settlement layer}
            \begin{itemize}
                \item Designed for fiat currencies
                \item  BTC and ETH ?
            \end{itemize}
        \end{block}
    \end{columns}
\end{frame}

\begin{frame}{GNU Taler}{Blockchain settlement layer}
    \begin{tikzpicture}[remember picture,overlay]
        \node (N1)[above right=22mm and 56mm of current page.center]    {\includegraphics[width=18mm]{./google_play_GNU_Taler.jpg}};
        \node [below=-2mm of N1]{wallet.taler.net};
    \end{tikzpicture}
    \begin{center}
        \begin{tikzpicture}[
            rect/.style={rectangle, draw=black, minimum width=30mm},
            sym/.style={stealth-stealth, shorten >= 2pt, shorten <= 2pt},
            block/.style={rectangle,draw=black,fill=black!10,minimum size=7mm},
        ]
    
        %% Architecture
        \node(Tt){Taler};
        \node[rect,below=0cm of Tt](Tc){Exchange};
        \node[rect,fit={(Tt) (Tc)}](T){};
    
        \node[rect,below=7mm of Tc](D) {\textbf{Depolymerization}};
    
        \node[rect,below=7mm of D](Bc){Node};
        \node[below=0cm of Bc](Bt){Blockchain};
        \node[rect,fit={(Bt) (Bc)}](B){};
    
        \draw[sym] (T) -- (D);
        \draw[sym] (D) -- (B);
    
        %% Blockchain
        \node[block,right=8mm of B] (1){};
        \node[block,right=4mm of 1] (2){};
        \node[block,right=4mm of 2] (3){};
        \node[block,right=4mm of 3] (4){};
        \node[block,right=4mm of 4] (5){};
        \node[block,right=4mm of 5] (6){};
        \draw[-stealth] (1) -- (2);
        \draw[-stealth] (2) -- (3);
        \draw[-stealth] (3) -- (4);
        \draw[-stealth] (4) -- (5);
        \draw[-stealth] (5) -- (6);
    
        \node[left=4mm of 1] (S){};
        \node[right=4mm of 6] (E){};
        \draw[-stealth] (S) -- (1);
        \draw[-stealth] (6) -- (E);
    
        %% Taler
        \node[block, below right=-7.5mm and 20.5mm of T] (off){Off-chain transactions};
        \node[above=-0.5mm of off] {\includegraphics[height=7mm]{../docs/media/taler.png}};
    
        %% Depolymerization
        \node[right=12mm of D] {\small{Credit}};
        \node[right=55mm of D] {\small{Debit}};
        \draw[dashed,-stealth] (1.north) |- (off.west);
        \draw[dashed,-stealth] (off.east) -| (6.north);
    
        %% Separation
        \draw[dotted] (-2.1,-1.3) -- (9,-1.3);
        \draw[dotted] (-2.1,-2.5) -- (9,-2.5);
    \end{tikzpicture}
    \end{center}
\end{frame}

\begin{frame}{Blockchain-based cryptocurrencies}
    \begin{columns}
        \column{0.4\textwidth}
        \begin{block}{\textbf{BTC} Bitcoin}
            \begin{itemize}
                \item Proof of Work
                \item new block every $\simeq$10 min
                \item $\simeq$4 txs per sec
            \end{itemize}
        \end{block}
        \column{0.4\textwidth}
        \begin{block}{\textbf{ETH} Ethereum}
            \begin{itemize}
                \item Proof of Stake
                \item new block every $\simeq$12 sec
                \item $\simeq$14 txs per sec
            \end{itemize}
        \end{block}
    \end{columns}
\end{frame}

\begin{frame}{Storing metadata}{Bitcoin}
    \begin{block}{Bitcoin - Debit}
        \begin{itemize}
            \item Transactions from code
            \item Only 32B + URI
            \item \textbf{OP\_RETURN}
        \end{itemize}
    \end{block}
    \begin{block}{Bitcoin - Credit}
        \begin{itemize}
            \item Transactions from common wallet software
            \item Only 32B
            \item \textbf{Fake Segwit Addresses}
        \end{itemize}
    \end{block}
\end{frame}

\begin{frame}{Storing metadata}{Ethereum}
    \begin{block}{Smart contract ?}
        \begin{itemize}
            \item Logs in smart contract is the recommended way {\tiny (ethereum.org)}
            \item Expensive (additional storage and execution fees)
            \item Avoidable attack surface (error prone)
        \end{itemize}
    \end{block}
    \begin{block}{Custom input format}
        Use input data in transactions, usually used to call smart contract, to
        store our metadata.
    \end{block}
\end{frame}

\begin{frame}{Chain reorganization}
    \begin{center}
        \begin{tikzpicture}[
                block/.style={rectangle,draw=black,fill=black!10,minimum size=7mm},
                nconf/.style={dotted,fill=none},
                replaced/.style={pattern=north east lines,draw=black!60,fill opacity=0.3},
                err/.style={draw=black!60!red,fill=black!60!red!10,dashed},
                ar/.style={-stealth}
            ]
            % Common
            \node[block](2){};
            \node[block,right=5mm of 2](3){};
            \draw[ar] (2) -- (3);

            % Current
            \node[block,replaced,right=5mm of 3](4){};
            \node[block,replaced,right=5mm of 4](5){$T$};
            \draw[ar] (3) -- (4);
            \draw[ar] (4) -- (5);
          

            % Fork
            \node[block,above=7mm of 4](4p){};
            \only<1>{
                \node[block,right=5mm of 4p](5p){};
            }
            \only<2>{
                \node[block,err,right=5mm of 4p](5p){$T'$};
            }
            \node[block,right=5mm of 5p](6p){};
            \node[block,nconf,right=5mm of 6p](7p){
                \only<1>{$T$}
            };
            \draw[ar] (3.east) -- (4p.west);
            \draw[ar] (4p) -- (5p);
            \draw[ar] (5p) -- (6p);
            \draw[ar] (6p) -- (7p);
            

            % Indication
            \node [right=5mm of 7p]{\emph{active}};
            \node [right=29mm of 5]{\emph{fork}};
        \end{tikzpicture}
    \end{center}
    \begin{center}
        \only<1>{Reorganization can remove transaction from the chain}
        \only<2>{A conflict can invalidate the transaction}
    \end{center}
\end{frame}

\begin{frame}{Stuck transactions}
    \begin{center}
        \begin{tikzpicture}[
            dot/.style={circle,fill,inner sep=1pt,}
        ]
        \node (I) {\includegraphics[width=\textwidth]{../docs/media/fee.png}};
        \node [below left=-2.5mm and -1.5cm of I] (Tx) {\small Tx};
        \node [dot,above=8.4mm of Tx](D) {};
        \draw [dotted,thick] (Tx) -- (D);
        \node [left=-4.5cm of Tx] (C) {\small conf};
        \node [dot,above=8.4mm of C](D1) {};
        \draw [dotted,thick] (C) -- (D1);
        \end{tikzpicture}
    \end{center}
    \begin{center}
        Stuck transactions caused by transaction fees being a market-based value
    \end{center}
\end{frame}

\begin{frame}{Incompatible amount}
    GNU Taler amount follow RFC 8905:  $2^{53}$ unit and 8 decimal digits
    \begin{block}{\textbf{BTC} Bitcoin}
        \begin{itemize}
            \item 1 satoshi = $10^{-8}$ BTC
            \item capped at 21 000 000 BTC
            \item Fit perfectly
        \end{itemize}
    \end{block}
    \begin{block}{\textbf{ETH} Ethereum}
        \begin{itemize}
            \item 1 wei = $10^{-18}$ ETH
            \item actually more than 120 580 000 without cap
            \item average fee: 21 000 * 14 = 294 000 Gwei or 0.000295 ETH
            \item truncated at $10^{-8}$ ETH it can still represent any amount you can send without losing money 
        \end{itemize}
    \end{block}
\end{frame}

\begin{frame}{Implementation} 
    Download a wallet from \url{wallet.taler.net} and add our experimental bitcoin exchange at \url{bitcoin.ice.bfh.ch}
    
    \center\includegraphics[width=10.4cm]{./electrum.jpg}
\end{frame}


\begin{frame}{Conclusion}
    Distributed Ledgers can be used as a settlement layer for GNU Taler
    with Depolymerizer.

    \begin{itemize}
        \item [$-$] Trust exchange operators or auditors
        \item [$+$] Fast and cheap
        \item [$+$] Realtime, ms latency
        \item [$+$] Linear scalability
        \item [$+$] Ecological
        \item [$+$] Privacy when it can, transparency when it must (avoid tax evasion and money laundering)
    \end{itemize}
\end{frame}

\end{document}