-
Notifications
You must be signed in to change notification settings - Fork 0
/
mythesis.tex
264 lines (203 loc) · 12.9 KB
/
mythesis.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
\documentclass[letterpaper,12pt,onecolumn,final]{report}
\pdftrailerid{}
\pdfsuppressptexinfo15
\pdfminorversion=4
%% MANDATORY PACKAGES
\usepackage{cuthesis} % Concordia's thesis style
\usepackage[english]{babel} % load english localization
\usepackage{type1ec} % type 1 font
\usepackage[T1]{fontenc} % correct some font representation, needs cm-super fonts
\usepackage{times} % use Times New Roman font
\usepackage[titletoc,title]{appendix} % include Appendix command, add to ToC
\usepackage{setspace} % control double/single line spacing
\usepackage[pdftex]{graphicx}
\usepackage{caption,tabularx,booktabs}
\usepackage{array}
\usepackage{csquotes}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
%% OPTIONAL PACKAGES
%\counterwithout{footnote}{chapter} % do no reset footnote # between chapters
\usepackage[hyphens]{url} % print links
\usepackage{hyperref} % provides hyperlinks (text different than link)
%\usepackage[hyphenbreaks]{breakurl} % break long URL after hyphens
\hypersetup{
colorlinks=true,
breaklinks=true,
linkcolor=black,
citecolor=black,
urlcolor=black,
filecolor=black,
linktoc=all,
}
\usepackage{graphicx}
%\graphicspath{{img/}}
\usepackage{blindtext}
%% CUSTOM MACROS
\usepackage{xspace}
\newcommand{\etal}{\textit{et al.}\xspace}
\newcommand{\etc}{\textit{etc.}\xspace}
\newcommand{\ie}{\textit{i.e.,}\xspace}
\newcommand{\eg}{\textit{e.g.,}\xspace}
\newcommand{\cf}{\textit{cf.}\xspace}
\newcommand{\supra}{\textit{Supra}\xspace}
\newcommand{\nee}{\textit{n\'ee}\xspace}
\newcommand{\aka}{\textit{a.k.a.,}\xspace}
% = = = Arrow -> (\lt)
\newcommand{\lt}{$\rightarrow$\xspace}
% = = = Keywords (kw)
\newcommand{\kw}[1]{\textsf{#1}}
% = = = Colored text (textblue)
\newcommand{\textblue}[1]{\textcolor{blue}{#1}}
% = = = Compact Lists (compactlist, compactlistn)
\newenvironment{compactlist}
{\begin{itemize}
\setlength{\itemsep}{0pt}
\setlength{\parskip}{0pt}}
{\end{itemize}}
\newenvironment{compactlistn}
{\begin{enumerate}
\setlength{\itemsep}{0pt}
\setlength{\parskip}{0pt}}
{\end{enumerate}}
\renewcommand{\labelitemi}{$\bullet$}
%------------------------Crypto----------------------%
% = = = Zp, Gq and Zq
\newcommand{\Zp}{\mathbb{Z}^{*}_{p}}
\newcommand{\Zq}{\mathbb{Z}_{q}}
\newcommand{\Gq}{\mathbb{G}_{q}}
% = = = Encryption, etc.
\newcommand{\Enc}[1]{\mathsf{Enc}(#1)}
\newcommand{\EncB}[1]{\llbracket #1 \rrbracket}
\newcommand{\ReRand}[1]{\mathsf{ReRand}(#1)}
\newcommand{\Hash}[1]{\mathcal{H}(#1)}
\newcommand{\Sign}[1]{\mathsf{Sig}(#1)}
\newcommand{\Comm}[1]{\mathsf{Comm}(#1)}
\newcommand{\Open}[1]{\mathsf{Open}(#1)}
% = = = Tuples
\newcommand{\tuple}[1]{\left \langle #1 \right \rangle}
%-------------------Custom for Paper----------------------%
% = = = Name
\newcommand{\Name}{\textsf{System Name}\xspace}
\newcommand{\dai}{\textsf{Dai}\xspace}
\newcommand{\cdp}{\textsf{CDP}\xspace}
\newcommand{\vault}{\textsf{Vault}\xspace}
%\newcommand{\tickyes}{{\small\checkmark}}
%\newcommand{\tickno}{{\small$\times$}}
% TABLES:
\usepackage{adjustbox}
\newcommand{\headrow}[1]{\multicolumn{1}{c}{\adjustbox{angle=30,lap=\width-0.5em}{#1}}}
\newcommand{\full}{$\bullet$}
\newcommand{\prt}{$\circ$}
\newcommand{\none}{$\times$}
%% CUSTOM COMMANDS
%\newcommand{\subhead}[1]{\noindent{\textbf{#1.}}}
\input{setup/packages}
%% THESIS SETTINGS
\author{Mehdi Salehi}
\title{An Analysis of Upgradeability, Oracles, and Stablecoins in the Ethereum Blockchain}
% As of 2019, title is no longer used...
%\titleOfPhDAuthor{Mr.} % or Ms., Mrs., Miss, etc. (only for PhD's)
% if PhD, uncomment:
%\PhD
% else if Master's, uncomment:
\mastersDegree{Master of Applied Science}
\program{Information and Systems Engineering}
%\program{Computer Science}
\dept{The Concordia Institute\\for\\Information Systems Engineering}
%\dept{The Department\\of\\Computer Science and Software Engineering}
%% See current GPD at https://www.concordia.ca/admissions/graduate/programs/contacts.html
\GpdOrChairOfDept{Dr.\ Mohammad Mannan}
\isGpd % Chair by default
%% See current Dean at https://www.concordia.ca/ginacody/about/leadership/office-dean/dean-of-engineering-and-computer-science.html
\deanOfENCS{Dr.\ Mourad Debbabi}
\chairOfCommittee{Dr.\ Amr Youssef}
\examinerFirst{Dr.\ Amr Youssef}
\examinerSecond{Dr.\ Ivan Pustogarov}
\supervisor{Dr. Jeremy Clark}
%% Following two lines are required if you have a co-supervisor
\hasCosupervisor
\coSupervisor{Dr. Mohammad Mannan}
%% Comment to use current month, needs to match initial submission
\submitmonth{April}
\submityear{2022}
%% Comment if date of defence is unknown yet, fill for final submission
\defencedate{April 1, 2022}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\doublespacing
\begin{document}
\begin{abstract}
{%trick to force double spacing in the abstract, otherwise some paragraphs may show single spaced
\setstretch{1.6667}
The Ethereum blockchain is a widely adopted global alternative to cloud computing platforms, currently used primarily for financial services. Given the large number of funds held by smart contracts and decentralized applications on top of Ethereum, there are profound security implications for both users and enterprise developers.
Over time, developers have brought more complex logic to Ethereum. For example, contracts often require access to valid, real-world data. In most cases, the system's functionality and security are strongly dependent on the correctness and safeness of the data pushed to the blockchain. One topic of this thesis is an oracle system---infrastructure added to the blockchain to respond to this need.
As contract code becomes more complex, it is increasingly likely that the code has bugs or vulnerabilities. Given smart contracts are immutable and tamper-proof, it seems impossible to upgrade a contract should a fix or patch be needed. Another topic of this thesis examines contract deployment patterns that enable and handle the upgradeability of smart contracts in Ethereum. Finally, the thesis also considers an application of oracle technology: payments made in stable currencies such as USD and not blockchain native currencies such as ETH, which are volatile in price. This thesis explains each topic in detail, evaluating the security risks of each, and examining any consequences for user trust and the degree of decentralization.
% JC: try to keep to 1 page
% broad adoption of decentralized applications brought another need in the service layers. The payments by user need to be This brings the idea of developing stablecoins pegged to a stable currency like the USD.
%Adding upgradeability patterns, oracles, and stablecoins to decentralized applications and smart contract logic adds significant security risks and the need to use a trusted third party, which is against disintermediation in the blockchain ecosystem.
% central trusted points that will be added because of each component. We also try to extend the design choices for each component to give the designer a broader spectrum, which may help make the systems more secure.
}
\end{abstract}
%\doublespacing
\begin{acknowledgments}
I would like to thank my supervisors, Dr. Jeremy Clark and Dr. Mohammad Mannan, for their continued support and guidance during the course of my master's degree. Their constant support gave life to this project and made this thesis possible. I have learned a lot from them and would like to express my gratitude for their patience, motivation, and immense knowledge. I am fortunate to work under the close guidance of them, who inspired me with bright ideas, helpful comments, suggestions, and insights that have contributed to the improvement of this work.
I would like to thank Shayan Eskandari, my colleague, for mentoring me during my master's and sharing his experience, and being by my side through this journey. I want to thank Mahsa Mousavi, my lab-mate, for her continuous feedback and support during our discussions and meetings. She has been very generous with her help during the course of my research.
A very special word of thanks to my best friend in my life Nikoo Farvardin, who has always been a major source of support when things would get a bit discouraging. Her presence was significant in a process that is often felt as tremendously solitaire. She gave me support and help, discussed ideas, and prevented several wrong turns.
In the end, I would like to acknowledge the unconditional affection and continuous support of my parents, my sister Neda, and my brother Saleh. They always fulfill all my silly demands and keep faith in my ability. They have always been the best inspiration in my life. I would like to dedicate this thesis to them. This journey would not have been possible without their encouragement and support. I am incredibly lucky to have them in my life.
\end{acknowledgments}
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
\include{chapters/chapter1/chapter1}
\include{chapters/chapter2/chapter2}
\include{chapters/chapter3/chapter3}
\include{chapters/chapter4/chapter4}
\include{chapters/chapter5/chapter5}
%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Conclusion and Future Work}
\label{chap:conclusion}
In this thesis, we presented an analysis of three Ethereum components---upgradeability, oracles, and stablecoins---which all add a degree of centrality. They each add trust points to an otherwise decentralized system, increasing the attack surface.
The main takeaways from measuring upgradeability on Ethereum (Chapter 3) is that immutability, as a core property of blockchain, is oversold. Also, we show that almost 64\% of smart contracts are in the control of a centralized agent who can decide to change the whole logic of the system. Future work on upgradability might examine our dataset to learn more about actual upgrade events that have happened on Ethereum. For instance, how many upgrades have happened, how frequently, and what can we determine about the reason behind the upgrade? Undisclosed security vulnerabilities could also be reverse-engineered from an upgrade serving as a security patch.
The main takeaways from studying oracle systems on Ethereum (Chapter 4) is that most Ethereum projects depend on the data provided by Chainlink, which can be a single point of failure for the Ethereum ecosystem. It highlights a need to diversify which oracle services are used. We also point out that security is reduced to ensuring that the profit from corruption is less than the cost of corruption. Future work should examine how to capture the full extent of the potential profit, considering that attackers may profit outside of Ethereum by attacking oracles on Ethereum. It might conclude this can never be fully captured.
The main takeways from enumerating the design space of Dai-like stablecoins (Chapter 5) is that they hide risk from the end-user or investor in complex ways that hard to analyze. There is also a prevailing idea that the choices made by MakerDao in designing Dai are the only way to make a stablecoin. We show that there are lots of other suitable designs with differing properties that deserve further research attention. It would also be helpful to have concrete results on the most suitable financial model for the ETH/USD exchange rate (\eg would drift-diffusion or GARCH work better?). Finally, is there a stablecoin design that would be more useful than Dai. Adding fungability to red coins (or CDPs/vaults in Dai) is the most interesting idea from our perspective.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography} % Add Bibliography to TOC
\singlespacing % save space in the bibliography
\bibliographystyle{abbrv}
\bibliography{references,bib/pulp.bib,bib/new.bib,bib/bib.bib}
%%%%%%%%%% Appendices %%%%%%%%%%%%%%%%
% ---- Appendix settings. Please Do NOT change them. -----
\appendix
\setcounter{table}{0} % reset the table counter
\setcounter{figure}{0} % reset the figure counter
\renewcommand{\thefigure}{\Alph{chapter}.\arabic{figure}} % numbering the a figure in Appendix as Figure A.2, Figure B.1, etc.
\renewcommand{\thetable}{\Alph{chapter}.\arabic{table}} % numbering the a table in Appendix as Table A.2, Table B.1, etc.
%%%%%%%%%% Body of Appendix %%%%%%%%%%%%%%%%
%\begin{appendices}
%\doublespacing
%\chapter{First Appendix}
%\label{chap:apdx1}
%\chapter{Concordia Logos}
%\label{chap:logos}
%\begin{figure}[h!]
% \centering
% \includegraphics{logos/Concordia_University_logo}
% \caption{Concordia University}
%\end{figure}
%\vspace{2em}
%\begin{figure}[h!]
% \centering
% \includegraphics{logos/Concordia_GinaCody_vertical}
% \caption{Gina Cody School of Engineering and Computer Science (vertical)}
%\end{figure}
%\vspace{2em}
%\begin{figure}[h!]
% \centering
% \includegraphics{logos/Concordia_GinaCody_horizontal}
% \caption{Gina Cody School of Engineering and Computer Science (horizontal)}
%\end{figure}
%\end{appendices}
\end{document}