ssme-thesis/Thesis.tex

1764 lines
114 KiB
TeX
Raw Normal View History

2019-01-27 15:47:19 +01:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2018-06-27 21:49:31 +02:00
%% I, the copyright holder of this work, release this work into the
%% public domain. This applies worldwide. In some countries this may
%% not be legally possible; if so: I grant anyone the right to use
%% this work for any purpose, without any conditions, unless such
%% conditions are required by law.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[
2018-06-29 16:38:17 +02:00
printed, %% This option enables the default options for the
2018-06-27 21:49:31 +02:00
%% digital version of a document. Replace with `printed`
%% to enable the default options for the printed version
%% of a document.
table, %% Causes the coloring of tables. Replace with `notable`
%% to restore plain tables.
2018-06-29 16:38:17 +02:00
nolof, %% Prints the List of Figures. Replace with `nolof` to
2018-06-27 21:49:31 +02:00
%% hide the List of Figures.
2018-06-29 16:38:17 +02:00
nolot, %% Prints the List of Tables. Replace with `nolot` to
2018-06-27 21:49:31 +02:00
%% hide the List of Tables.
2018-06-29 16:38:17 +02:00
oneside, color
2018-06-27 21:49:31 +02:00
%% More options are listed in the user guide at
%% <http://mirrors.ctan.org/macros/latex/contrib/fithesis/guide/mu/fi.pdf>.
]{fithesis3}
%% The following section sets up the locales used in the thesis.
\usepackage[resetfonts]{cmap} %% We need to load the T2A font encoding
\usepackage[T1,T2A]{fontenc} %% to use the Cyrillic fonts with Russian texts.
\usepackage[
2018-07-15 23:39:27 +02:00
main=english, %% By using `czech` or `slovak` as the main locale
2018-06-27 21:49:31 +02:00
%% instead of `english`, you can typeset the thesis
%% in either Czech or Slovak, respectively.
2018-07-15 23:39:27 +02:00
german, russian, czech, slovak %% The additional keys allow
2018-06-27 21:49:31 +02:00
]{babel} %% foreign texts to be typeset as follows:
%%
%% \begin{otherlanguage}{german} ... \end{otherlanguage}
%% \begin{otherlanguage}{russian} ... \end{otherlanguage}
%% \begin{otherlanguage}{czech} ... \end{otherlanguage}
%% \begin{otherlanguage}{slovak} ... \end{otherlanguage}
%%
%% For non-Latin scripts, it may be necessary to load additional
%% fonts:
\usepackage{paratype}
\def\textrussian#1{{\usefont{T2A}{PTSerif-TLF}{m}{rm}#1}}
%%
%% The following section sets up the metadata of the thesis.
\thesissetup{
date = \the\year/\the\month/\the\day,
university = mu,
faculty = fi,
2018-06-29 16:38:17 +02:00
type = mgr,
author = Bc. Radim Lipovčan,
gender = m,
advisor = RNDr. Vlasta Šťavová,
2018-07-15 23:39:27 +02:00
title = {Monero usage and mining from usable security view},
TeXtitle = {Monero usage and mining from usable security view},
2018-06-29 16:38:17 +02:00
keywords = {Monero, usable security, cryptocurrency, mining, pool, blockchain},
TeXkeywords = {Monero, usable security, cryptocurrency, mining, pool, blockchain},
2018-06-27 21:49:31 +02:00
}
\thesislong{abstract}{
This is the abstract of my thesis, which can
span multiple paragraphs.
}
\thesislong{thanks}{
This is the acknowledgement for my thesis, which can
span multiple paragraphs.
}
%% The following section sets up the bibliography.
\usepackage{csquotes}
\usepackage[ %% When typesetting the bibliography, the
backend=biber, %% `numeric` style will be used for the
style=numeric, %% entries and the `numeric-comp` style
citestyle=numeric-comp, %% for the references to the entries. The
sorting=none, %% entries will be sorted in cite order.
sortlocale=auto %% For more unformation about the available
]{biblatex} %% `style`s and `citestyles`, see:
%% <http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf>.
\addbibresource{Thesis.bib} %% The bibliograpic database within
%% the file `example.bib` will be used.
\usepackage{makeidx} %% The `makeidx` package contains
\makeindex %% helper commands for index typesetting.
%% These additional packages are used within the document:
\usepackage{paralist}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{url}
\usepackage{menukeys}
2018-06-29 23:26:35 +02:00
%packages
\usepackage{float}
2018-07-03 10:44:26 +02:00
\usepackage{hyperref}
\usepackage[strings]{underscore}
%timeline
\usepackage{xcolor}
\newcommand\ytl[2]{
2018-07-03 13:50:09 +02:00
\parbox[b]{8em}{\hfill{\color{cyan}\bfseries\sffamily #1}~$\cdots\cdots$~}\makebox[0pt][c]{$\bullet$}\vrule\quad \parbox[c]{.7\linewidth}{\vspace{7pt}\color{red!40!black!80}\raggedright\sffamily #2.\\[7pt]}\\[-3pt]}
2018-07-03 10:44:26 +02:00
2018-07-04 16:04:00 +02:00
%caption
\usepackage{caption}
2018-07-10 23:21:47 +02:00
%branches
\usepackage{tikz}
%
\usetikzlibrary{trees}
2018-08-05 20:04:29 +02:00
%flowchart
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{positioning}
2018-07-28 15:48:28 +02:00
%ringct
\usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,petri}
2018-08-05 20:04:29 +02:00
%table
\usepackage{rotating}
2018-08-08 21:39:58 +02:00
%code
\renewcommand{\texttt}[1]{%
\begingroup
\ttfamily
\begingroup\lccode`~=`/\lowercase{\endgroup\def~}{/\discretionary{}{}{}}%
\begingroup\lccode`~=`[\lowercase{\endgroup\def~}{[\discretionary{}{}{}}%
\begingroup\lccode`~=`.\lowercase{\endgroup\def~}{.\discretionary{}{}{}}%
\catcode`/=\active\catcode`[=\active\catcode`.=\active
\scantokens{#1\noexpand}%
\endgroup
}
2018-08-11 19:44:24 +02:00
%images
\usepackage{graphicx}
\usepackage{float}
\graphicspath{ {./images/} }
2018-09-05 17:48:59 +02:00
%pdf
\usepackage{pdfpages}
2018-09-29 17:40:26 +02:00
%piechart
\usepackage{pgf-pie}
%multicol
\usepackage{multicol}
2018-10-14 21:53:59 +02:00
%code
\usepackage{listings}
2018-11-24 09:54:23 +01:00
\lstset{escapeinside={<@}{@>}}
2018-10-14 21:53:59 +02:00
\usepackage{color}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{frame=tb,
language=Java,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\small\ttfamily},
numbers=none,
numberstyle=\tiny\color{black},
keywordstyle=\color{black},
commentstyle=\color{black},
stringstyle=\color{black},
breaklines=true,
breakatwhitespace=true,
tabsize=3
}
2018-11-26 18:30:47 +01:00
%dirtree
\usepackage{dirtree}
%captions
\usepackage{subcaption}
2018-06-27 21:49:31 +02:00
\begin{document}
2018-07-17 08:05:21 +02:00
\chapter{Introduction}
2018-07-10 23:22:28 +02:00
%% Komentář Vlasta 10.7.: tady někde (možná samostatná kapitola) bude nutné nadefinovat pojmy. Nazvat to "Kryptoměny" a popsat tam myšlenku, z čeho se skládají, co je blockchain, co to znamená fork... a tak.
%% Komentář Vlasta 10.7.: Nechceš to psát anglicky? Myslím, že by sis tím ušetřil hromadu práce s překlady. Dotazník bude v jakém jazyce?
2018-07-10 21:53:33 +02:00
2018-07-13 11:26:12 +02:00
%% Komentář Radim 13.07: Kapitola s pojmy - udělám zvlášť krátkou, ve které popíšu tyto základní principy, ještě tedy před Monero Cryptocurrency kapitolou. Monero specific věci pak budou popsány už pod Monerem.
%% Komentář Radim 13.07: Po domluvě mailem tedy začnu psát Anglicky. Dotazníky budou ve dvou jazykových mutacích - ENG a CZ. Hlavně kvůli CZ komunitě těžařů a pool operátorům - https://bohemianpool.com/#/home bych dal i tu češtinu.
2019-01-27 15:47:19 +01:00
%% Komentář ze schůzky 14.01: ring signature velkým začátky
%% 8page v3
%% z chapter dát všude section s velkým section, table s velkým t a figure s velkým f;
%% 11 page
%%
2019-02-03 20:52:42 +01:00
%% internet se píše s velkým I DONE
%% CAPTCHA velkými všechno DONE
2019-01-27 15:47:19 +01:00
%%
%% strana 25 6.1 úvodní odstavec PŘEPSAT
%% DODAT TEČKY DO TABULEK KDYŽ JE TO NĚCO VĚTŠÍHO
%%
2019-02-03 21:48:25 +01:00
%% projít data a dát to do eng verze > v eng se píše stejně jako u nás, pokud teda nemyslíš USA formát viz https://dictionary.cambridge.org/grammar/british-grammar/writing/dates
2019-02-03 20:52:42 +01:00
%% URL napsat velkým všude DONE
2019-01-27 15:47:19 +01:00
%%
2019-02-03 20:52:42 +01:00
%% figure název s tečkou DONE
2019-01-27 15:47:19 +01:00
%% pokud je to příloha, tak see appendix napsat viz strana 45
%%
%% plan appendix - popsat co je co kde
%%
%% Seznam literatury
%% fluffypony sjednotit
%% místo xarchiv dát přímo odkaz na publikaci
%%
%% Zpracování dat
%% 1. číštění dat, celkově , plně uvedeno vyplněno
%% podívat se na čas správně vyplněných
%% právě jednou pomocí cookies, projít geolokaci dle ipiny
2018-07-17 08:05:21 +02:00
\chapter{Cryptocurrency}
2019-02-03 21:04:27 +01:00
This chapter is aimed as a strating point that explains terms and technology that will occour throughout following pages and chapters. Altough these terms are described in a simple way, it is recommended for every reader to swift through them as in later pages they are discussed and used in detail thoroughly.
2018-12-02 15:22:35 +01:00
\textbf{Cryptocurrency} is a digital currency that is designed to use cryptography to secure and verify its transactions. Cryptocurrencies are decentralized as opposed to traditional money transaction systems used in the banks. Decentralization is established by using distributed blockchain that functions as a transaction database within the currency. First cryptocurrency available was Bitcoin \cite{farell2015analysis}.
2018-07-17 08:05:21 +02:00
\textbf{Altcoin} is a term used for every cryptocurrency that is not Bitcoin as it is a direct concurrent for the first of the cryptocurrency.
2018-12-02 15:22:35 +01:00
The \textbf{fork} happens when developers create a copy of existing project codebase and start their path of development with it.
2018-07-17 22:02:07 +02:00
2018-07-17 08:05:21 +02:00
\textbf{Market Cap} is a total value of cryptocurrency that refers to the total number of emitted coins multiplied by the value of the coin.
\textbf{The blockchain} is a technology responsible for storing every transaction that has ever been processed in the cryptocurrency, also often called as a ledger. The main purpose of the blockchain is to ensure the validity of completed transactions.
2018-07-17 22:02:07 +02:00
\textbf{Transactions} within cryptocurrency are processed together as blocks that are verified by miners and then added to the blockchain as a new mined block.
2018-07-17 08:05:21 +02:00
2018-12-02 15:22:35 +01:00
\textbf{The wallet} is a storage medium that holds private and public keys by which the user can access, send and receive funds. Wallet effectively does not have the coins but is rather a key to access them from the blockchain.
2018-07-17 08:05:21 +02:00
\textbf{Node} is a computer connected to the cryptocurrency network. Node is often referred to as a full node which means that the computer maintains a full copy of blockchain. This results in node downloading every block and transaction and checking them against cryptocurrency rules, especially whether the transaction has correct signatures, data format and the right number of emitted coins per block.
2018-12-02 15:22:35 +01:00
\textbf{The mining} process is done by miners that verify transactions on the network and adds them to the blockchain together in the form of a block which results in new coins being emitted as a reward for block solving.
2018-07-17 22:02:07 +02:00
\textbf{Mining in pools} is the way how individual miners pool their computational resources. Due to resources pooling, there is a higher chance of solving the block thus gaining the reward of newly emitted coins. %After solving each block, the reward is distributed equally to miners connected to the pool according to PPS or PPLNS system.
2018-07-13 11:26:12 +02:00
\chapter{Monero Cryptocurrency}
2018-12-02 15:22:35 +01:00
Monero is an open-source cryptocurrency that is developed under the Monero project to create a decentralized and anonymous currency. Its main goal is to make the user the one who has complete control over own funds.
2018-07-13 11:26:12 +02:00
2018-09-05 17:50:45 +02:00
Meaning that every single digital transaction and the exact number of coins in users wallet cannot be traced back to the user without sharing the view key of the transaction \cite{moneroprojectgithub}. Main distinctive points compared to other cryptocurrencies are:
2018-07-13 11:26:12 +02:00
2018-07-10 21:53:33 +02:00
\begin{itemize}\itemsep0em
2018-07-17 22:48:36 +02:00
\item The blockchain is public, but a large part of it is encrypted.
2019-02-03 21:48:25 +01:00
\item The sender of the transaction is hidden by using Ring Signatures explained in the Chapter \ref{sec:ringsignatures}.
\item The exact amount of transferred coins is encrypted using RingCT as described in the Chapter \ref{sec:ringct}.
2019-02-03 20:52:42 +01:00
\item Transaction history and receiving party is hidden by the usage of stealth addresses that are referenced in the Chapter \ref{sec:stealthaddresses}.
2018-07-10 21:53:33 +02:00
\end{itemize}
2018-07-13 11:49:25 +02:00
2018-07-22 00:10:19 +02:00
\section{Origin and the main focus}
2018-07-13 11:49:25 +02:00
Monero started its way by forking from Bytecoin, which was proof-of-concept cryptocurrency that used as first of its kind protocol called CryptoNote. CryptoNote was published by the start of the year 2014 \cite{githubbytecoin}.
2018-08-04 20:12:33 +02:00
Although Bytecoin had a promising protocol aimed at privacy, there was a problem with premine, meaning that cryptocurrency at the time of publishing had already 82\% of the coins already emitted \cite{fluffyponyonbytecoin}. That was the reason why people interested in anonymous cryptocurrencies decided to create a Bytecoin fork under the name of BitMonero \cite{bitmonero}.
2018-07-04 16:04:00 +02:00
2018-08-17 13:31:29 +02:00
Next important moment was when a significant part of the developers decided to abandon the project in favor of creating a new fork named Monero in 06.23.2014. By this action, Monero cryptocurrency was created with publicly known blockchain from the start, strictly defined goals and motivated team of developers \cite{monerofork}.
2018-12-02 15:22:35 +01:00
%%Komentář Vlasta 15.10.: 06.23.2014 je hrozne divny format datumu, koukni sem: https://dictionary.cambridge.org/grammar/british-grammar/writing/dates
2018-07-13 11:49:25 +02:00
2018-07-10 23:22:28 +02:00
%% Komentář Vlasta 10.7.: Návrh: v téhle kapitole by bylo moc hezká nějaká přehledová tabulka cca 5 největších kryptoměn, kde bys je porovnal podle vybraných kriterii. Třeba kriterium "Množství odesílané měny je šifrováno" by bylo v sloupečku a v pro každou kryptoměnu na řádek vyznačil, zda to splňuje nebo ne. Bylo by pak přehledně vidět čím je Monero tak vyjimečné a jak jsou na tom v těhle kriteriích ostatní kryptoměny.
2018-08-04 20:12:33 +02:00
%% Komentář Radim 4.8.: Tabulku jsem udělal, akorát ještě musím zakomponovat sloupec, který ukazuje samotný market cap. Spíš jsem se totiž nejdříve zaměřil, jak top5 crypto vypadá z hlediska privacy features. Tzn. dávám si tu DOPLNIT .
2018-07-21 19:33:39 +02:00
\section{Monero market cap}
As Monero is often mentioned for its privacy features, decentralization in mind and fungibility as main asset, table \ref{table:monero-top5} puts Monero in the direct comparison against top 5 cryptocurrencies.
2018-08-04 20:06:16 +02:00
To compare different cryptocurrency projects, market capitalization (market cap) is often used as a way of ranking \cite{elbahrawy2017evolutionary}. It indicates the relative size of cryptocurrency by the formula: \\ \centerline{
2018-07-22 12:14:29 +02:00
\textit{\textit{Market Cap = Circulating Supply * Price} }}
2018-07-21 19:33:39 +02:00
\textbf{Privacy} in cryptocurrency is a feature that assures that amount of coin user owns, sends or receives cannot be seen on the blockchain.
2018-08-04 20:06:16 +02:00
\textbf{Decentralization} in cryptocurrency network all nodes are equals. That means that no supernode can override how transactions are being processed as well as there is no single entity in control.
2018-07-21 19:33:39 +02:00
\textbf{Fungibility} means that every coin ever emitted has the same value as the others and cannot be traced back thus there cannot be coin blacklist.
\begin{figure}[H]
\centering\begin{tabular}{{p{0.06\linewidth}p{0.13\linewidth}p{0.17\linewidth}p{0.15\linewidth}p{0.15\linewidth}p{0.15\linewidth}}}
\textbf{Rank} & \textbf{Name} & \textbf{Transactions per day} & \textbf{Privacy} & \textbf{Decentra-lization} & \textbf{Fungibility} \\
1 & Bitcoin & 225039 & No & Yes & No \\
2 & Ethereum & 610953 & No & Yes & No \\
3 & XRP & 633974 & No & No & Varies \\
4 & Bitcoin Cash & 125404 & No & Yes & No \\
5 & EOS & 406380 & No & Yes & Varies \\
13 & Monero & 4010 & Yes & Yes & Yes
\end{tabular}
\captionof{table}{Monero features in top 5 cryptocurrencies.}
\label{table:monero-top5}
\end{figure}
2018-07-22 12:14:29 +02:00
As can be seen from data in table \ref{table:monero-top5}, coins that are most popular by market cap metrics, are not centered around privacy. Altought it is often believed that using cryptography means anonymity, it isn't true in most cryptocurrencies especially in Bitcoin \cite{conti2018survey}.
2018-10-08 00:08:40 +02:00
XRP and EOS are in a unique position compared to typical cryptocurrency as they offer a crypto platform with contracts, so privacy implementation and fungibility varies from contract to contract \cite{domingues2018allvor}.
2018-07-21 19:33:39 +02:00
%Zdroj transaction volume: https://bitinfocharts.com/monero/
%Zdroj Bitcoin: https://bitcoin.org/en/protect-your-privacy
%Zdroj Ethereum: https://ieeexplore.ieee.org/document/8356459/
%Zdroj XRP: https://ieeexplore.ieee.org/document/8356459/
%https://ripple.com/insights/xrp-compares-btc-eth/
%https://bitcoinist.com/not-decentralized-ripple-freezes-1m-user-funds/
2018-07-17 22:48:36 +02:00
\newpage
2018-07-21 19:33:39 +02:00
\section{Monero competitors}
2018-07-29 22:29:03 +02:00
\label{sec:monero-timeline}
2018-08-04 20:06:16 +02:00
Monero is not the only one cryptocurrency that aims at privacy and anonymity features, and there are many privacy coins already in existence. Most similar to Monero is ByteCoin from which Monero was forked, but is overall unpopular due to 82\% premine. A viable alternative to Monero offers its fork Aeon that is more lightweight as opposed to Monero with slightly fewer privacy features.
2018-07-21 19:33:39 +02:00
\begin{figure}[H]
\centering
\begin{tabular}{p{0.1\linewidth}p{0.16\linewidth}p{0.1\linewidth}p{0.15\linewidth}p{0.15\linewidth}p{0.15\linewidth}}
\textbf{Name} & \textbf{Protocol} & \textbf{Block Time {[}s{]}} & \textbf{Stealth Address } & \textbf{Anonymous transactions} & \textbf{Transaction signing} \\
Aeon & CryptoNote-Light & 240 & Yes & Yes & Ring Signature \\
Byte-Coin & CryptoNote & 120 & Yes & Yes & Ring Signature \\
DASH & X11 & 150 & No & Not fully & Yes \\
Monero (XMR) & CryptoNote & 120 & Yes & Yes & RingCT \\
2018-07-22 12:14:29 +02:00
PIVX & Zerocoin & 60 & Partialy & Yes & x \\
2018-07-21 19:33:39 +02:00
Verge (XVG) & Scrypt & 150 & Yes & Ne, TOR\&I2P & RingCT WIP \\
Zcash (ZEC) & Zerocash & 150 & Shielded addresses & Yes by SNARKS & x \\
Zcoin (XZC) & Lyra2 =\textgreater MTP & 600 & Yes & Yes by minting \& spending & Ring Signature
\end{tabular}
\captionof{table}{Comparison of Anonymous Cryptocurrencies and their features.}
\label{table:monero-alternatives}
2018-08-04 20:12:33 +02:00
%Zdroje:
%dash https://bitcointalk.org/index.php?topic=1562109.0
%ďash https://docs.dash.org/en/latest/introduction/information.html
%pivx https://github.com/PIVX-Project/PIVX
%pivx https://www.reddit.com/r/pivx/comments/7gjjyw/what_are_the_benefits_of_multisig_addresses/
%zcoin https://github.com/zcoinofficial/zcoin/wiki/Information-for-exchanges
%zcoin https://zcoin.io/zcoins-privacy-technology-compares-competition/
2018-07-21 19:33:39 +02:00
\end{figure}
2019-02-03 21:48:25 +01:00
Information sources used in the Table \ref{table:monero-alternatives}:\\ %TODO má být velké T u table?
2018-07-21 19:33:39 +02:00
Aeon \cite{moneroalternativeaeon}, ByteCoin \cite{moneroalternativebytecoin}, Dash \cite{moneroalternativedash,moneroalternativedashdev}, Monero \cite{moneroprojectgithub}, Pivx \cite{moneroalternativepivx}, Verge \cite{moneroalternativeverge}, Zcash \cite{moneroalternativezcash}, Zcoin \cite{moneroalternativezcoin}.
2018-07-22 12:14:29 +02:00
\iffalse
2018-07-21 19:33:39 +02:00
\begin{figure}[H]
\centering
\begin{tikzpicture}[sibling distance=10em,
every node/.style = {shape=rectangle, rounded corners,
draw, align=center,
top color=white, bottom color=blue!20}]]
\node {Bytecoin}
child { node {DASH}
child { node {PIVX}}}
child { node {BitMonero}
child { node {Monero}
child { node {AEON} } } };
\node[xshift=21mm]{Verge};
\node[xshift=4cm] {Bitcoin}
child[xshift=25mm] { node {Zcash}}
child[xshift=0cm] { node {Zcoin}};
\end{tikzpicture}
\caption{Codebase overview of the selected cryptocurrencies.}
\label{pict:monero-alternatives-codebase}
\end{figure}
2018-07-22 12:14:29 +02:00
\fi
2018-07-21 19:33:39 +02:00
%verge ma svoji codebase "non-bitcoin coin" viz prvni commit https://github.com/PIVX-Project/PIVX/commit/4405b78d6059e536c36974088a8ed4d9f0f29898
2018-07-17 22:48:36 +02:00
\section{Development cycle}
2018-07-10 23:22:28 +02:00
%% Komentář Vlasta 10.7.: Trochu popiš jak moc je Monero rozšířené. Pro představu v porovnání s dalšími kryptoměnami. Aby bylo jasné, že to není nějaká obskurní kryptoměna.
2018-10-08 00:08:40 +02:00
Monero development cycle is based on planned network updates that occur every six months. By this developers want to encourage work on the project with regular updates in contrast to other cryptocurrencies that don't want any new hard forks in the future as it brings the danger of splitting the coin into several versions \cite{mccorry2017atomically}.
2018-07-04 16:04:00 +02:00
\begin{figure}[H]
\center
2018-07-03 10:44:26 +02:00
\color{gray}
\rule{\linewidth}{1pt}
2018-07-15 23:39:27 +02:00
\ytl{03.03.2014}{Bytecoin - published on GitHub}
2018-08-17 13:31:29 +02:00
\ytl{04.17.2014}{ByteCoin fork - the creation of BitMonero cryptocurrency}
\ytl{07.23.2014}{BitMonero Fork - the creation of Monero cryptocurrency}
\ytl{03.22.2016}{Monero v2 - ring size change, block time set to 120 seconds}
\ytl{09.21.2016}{Monero v3 - transactions are split into smaller amounts}
2018-10-08 00:08:40 +02:00
\ytl{01.05.2017}{Monero v4 - the concurrent run of normal and RingCT transactions}
2018-08-17 13:31:29 +02:00
\ytl{04.15.2017}{Monero v5 - block size update and fee algorithm adjustments}
\ytl{09.16.2017}{Monero v6 - RingCT forced on the network with ring size => 5}
\ytl{04.06.2018}{Monero v7 - change of CryptoNight mining algorithm to prevent ASIC on the network, ring size set to =>7}
\ytl{10.--.2018}{Future network update}
2018-07-03 10:44:26 +02:00
\bigskip
\rule{\linewidth}{1pt}%
2018-07-13 11:49:25 +02:00
\color{black}\caption{Monero development timeline.}
2018-07-04 16:04:00 +02:00
\label{monero-timeline}
2018-07-10 23:21:47 +02:00
\end{figure} \newpage
2018-07-13 11:49:25 +02:00
2018-07-17 22:48:36 +02:00
Updates are meant to improve and enhance the previously established codebase as well as fixing already existing bugs that are continuously being resolved. Known problems in Monero history were:
2018-07-15 23:39:27 +02:00
2018-07-04 16:04:00 +02:00
\begin{itemize}
2018-07-15 23:39:27 +02:00
\item \textbf{Spam attack}
2018-07-04 16:04:00 +02:00
\begin{itemize}
2018-08-04 20:06:16 +02:00
\item Was aimed to oversaturate the Moneros network by sending minimal transactions and leveraging low transaction fee of 0.005 XMR. Immediate fix was established by raising the fee to 0.1 XMR. This problem led to the implementation of dynamic transaction fee based on chosen transaction priority \cite{monerospamattack}.
2018-07-04 16:04:00 +02:00
%zdroj https://bitcointalk.org/index.php?topic=583449.msg8519146#msg8519146
\end{itemize}
2018-07-10 23:21:47 +02:00
\item \textbf{Split chain attack}
2018-07-04 16:04:00 +02:00
\begin{itemize}
2019-02-03 21:48:25 +01:00
\item The successful exploit of Merkle root calculation vulnerability led to the creation of two blocks of the same height and hash, but with two different transactions on the end of the block \cite{macheta2014counterfeiting}. By this, two separate Monero chains were created. Exploit could be applied to all CryptoNote based cryptocurrencies. In the case of Monero, all transactions were stopped on exchanges until next day, when the fix was issued \cite{cryptonotemerkletree}.
2018-07-04 16:04:00 +02:00
\end{itemize}
2018-07-15 23:39:27 +02:00
\item \textbf{Transaction analysis in Monero blockchain}
2018-07-10 21:53:33 +02:00
\begin{itemize}
2019-02-03 20:52:42 +01:00
\item Research published in 2017 uncovered past and present problems in anonymity with Monero transaction system. The most significant discovery was that a substantial portion of transactions used a Ring Signature of zero which caused traceability of the amount of coin in the transaction output on the blockchain \cite{moser2018empirical}.
\item This issue was resolved by Monero team already in 2016 with Monero v2, where Ring Signature was set to =>3 \cite{monerov2release}. Soon after the paper was released, Monero got its v6 update with enforced use of RingCT technology for all transaction outputs \cite{monerov6release}.
2018-07-10 21:53:33 +02:00
\end{itemize}
%zdroj https://eprint.iacr.org/2017/338.pdf
2018-07-04 16:04:00 +02:00
\end{itemize}
%zdroj https://getmonero.org/2017/05/17/disclosure-of-a-major-bug-in-cryptonote-based-currencies.html
2018-07-10 23:21:47 +02:00
\newpage
2018-07-22 22:34:55 +02:00
\section{Transactions in Monero network}
2018-07-23 23:00:28 +02:00
Monero uses a distributed peer-to-peer consensus network to record transaction outputs in a blockchain. That means that balance is not stored in a wallet, but is represented by control over outputs of transactions accessible with wallet keys \cite{seguias2018moneroa}.
2018-07-22 22:34:55 +02:00
2018-08-04 20:06:16 +02:00
By that when user A wants to send funds to user B, the transaction happens in the way of transformation of controlled outputs in one wallet to a new output that belongs to the other wallet. As this is only a principle how coins are transferred between wallets Monero uses additional technology to make transactions private.
2018-07-23 23:00:28 +02:00
\subsection{Monero wallet and stealth addresses}
2018-08-04 20:06:16 +02:00
\label{sec:stealthaddresses}
Monero wallet seed is 95 characters long string that consists of public view and spend key. To send funds from one wallet to another, a one-time public key is created, that contains senders public view and spend key as well as randomized data.
2018-07-17 22:48:36 +02:00
2018-08-04 20:06:16 +02:00
This one-time public key is also referred to as a stealth address and is generated and recorded as part of the transaction to set the controller of the output of the transaction \cite{seguias2018monero}.
2018-07-23 23:00:28 +02:00
2018-12-02 15:22:35 +01:00
Stealth address is visible on the blockchain, by this receiving party can scan the blockchain to find exact transaction using their private view key. After locating transaction output, wallet software is then able to calculate one-time private key that aligns with the one-time public key and can spend this output using private spend key \cite{courtois2017stealth}.
2018-07-23 23:00:28 +02:00
By this, no one from outside can link nor wallet addresses nor people involved in a particular transaction by scanning the blockchain as there is no association with receivers address.
2018-08-04 20:06:16 +02:00
To prove that funds were sent from one wallet to another, the sender has to disclose transactions ID, receivers address and transactions key.
2018-07-17 22:48:36 +02:00
2018-07-22 22:34:55 +02:00
\subsection{Ring Signatures}
2018-08-04 20:06:16 +02:00
\label{sec:ringsignatures}
2019-02-03 21:48:25 +01:00
Ring Signatures present a way to create a distinctive signature that authorizes a transaction. The digital signature of the transaction is compiled from the signer together with past outputs of transactions (decoys) to form a ring where all members are equal and valid. By that, the outside party cannot identify exact singer as it is not clear which input was signed by one time spend key \cite{mercer2016privacy}.
2018-07-23 23:00:28 +02:00
2019-02-03 20:52:42 +01:00
To prevent double spend, a cryptographic key image is derived from the spent output and is part of the Ring Signature. As each key image is unique, miners can verify that there is no other transaction with the same key image, thus preventing the double-spending attack \cite{miller2017empirical}.
2018-07-23 23:00:28 +02:00
2018-07-10 21:53:33 +02:00
\subsection{RingCT}
2018-08-04 20:06:16 +02:00
\label{sec:ringct}
2019-02-03 20:52:42 +01:00
So far, senders anonymity is ensured by Ring Signatures, receivers anonymity relies on stealth addresses, but the amount of Monero transferred would be still visible on the blockchain. To hide transaction amounts, Ring Confidential Transactions are implemented \cite{noether2015ring}.
2018-07-28 15:48:28 +02:00
2018-08-04 20:06:16 +02:00
As one output cannot be spent twice, the sender has to spend entire output in the transaction. That typically results in a transaction having two outputs, one for the receiver and one for the original wallet, where the excess amount of coins is returned.
2018-07-28 15:48:28 +02:00
2018-08-04 20:06:16 +02:00
To prevent manipulation during a transaction, the total input amount must equal the output amount of coins in each transaction. As one could exploit this by committing to value less than zero, range proofs are there to ensure cryptographic evidence of amounts used in transactions is greater than zero and falls into the valid transaction amount range.
2018-07-28 15:48:28 +02:00
2018-10-08 00:08:40 +02:00
To confirm the transaction, the sender reveals the masked amount of coins being sent in the transaction to the network that is later verified by miners \cite{sun2017ringct}.
2018-07-28 15:48:28 +02:00
2018-08-04 20:06:16 +02:00
By that, amounts transferred between wallets in the form of outputs of transactions are hidden, and the network can still confirm that transaction is valid.
2018-07-28 15:48:28 +02:00
2018-07-17 22:48:36 +02:00
\subsection{Kovri}
2018-08-04 20:06:16 +02:00
Kovri is a C++ implementation of the I2P anonymous network under heavy development process in Monero project. It aims to offer secure network transmissions where a user's IP cannot be associated with a particular transaction ID \cite{monerokovri}.
2018-08-04 20:12:33 +02:00
2018-07-17 22:48:36 +02:00
\chapter{Monero usage}
2019-02-03 20:53:15 +01:00
As pointed out in the Chapter \ref{sec:monero-timeline}, Monero is one of the cryptocurrencies that aim to implement as complex anonymity system as possible. Moreover, because of that not only the underlying technology of the network is different from other cryptocurrency projects but the user side as well.
2018-07-17 22:48:36 +02:00
\section{Wallets}
2018-11-19 23:24:26 +01:00
\label{sec:wallets}
2018-07-29 22:29:03 +02:00
The essential part of every currency is the user's ability to access stored funds. In cryptocurrency, this is represented by the wallet and associated software.
2018-07-17 22:48:36 +02:00
2018-08-04 20:06:16 +02:00
Monero wallet contains information that is necessary to send and receive Monero currency. Each wallet is encrypted by the password set in the creation process. Typical wallet created using Monero software named \textit{example-wallet} consists of:
2018-07-29 22:29:03 +02:00
\begin{itemize}\itemsep0em
\item \textbf{example-wallet.keys file}
\begin{itemize}\itemsep0em
\item Is an encrypted file containing private \textbf{spend key} and \textbf{view key} together with \textbf{wallet address}.
2018-10-14 21:53:59 +02:00
\item Keys file also contains user preferences related to transactions and wallet creation height, so wallet software will only read blockchain from the wallet creation point.
2019-02-03 21:48:25 +01:00
\item Using this file, the user can restore wallet by using the monero-wallet-cli command:
\texttt{monero-wallet-cli --generate-from-keys}
2018-07-29 22:29:03 +02:00
\end{itemize}
\item \textbf{example-wallet file}
\begin{itemize}\itemsep0em
\item Acts as an encrypted cache for wallet software that contains:
\begin{itemize}\itemsep0em
2019-01-27 15:47:19 +01:00
\item List of outputs of transactions that are associated with the wallet so it does not need to scan the blockchain every time after startup.
2018-07-29 22:29:03 +02:00
\item History of transactions with metadata containing tx keys.
\end{itemize}
\end{itemize}
\item \textbf{example-wallet.address.txt file}
\begin{itemize}\itemsep0em
\item Stores \textbf{unencrypted} information containing generated wallet address.
\item With recent address-based attacks that swap wallet addresses found in clipboard or files on the hard drive for the attacker's wallet address, this poses a security risk \cite{cryptoshuffler}.
\end{itemize}
\item \textbf{Mnemonic seed}
\begin{itemize}\itemsep0em
\item Mnemonic seed is a 25-word phrase which the last word is being used as a checksum. Together they represent a 256-bit integer that is the accounts private spend key.
2018-08-04 20:06:16 +02:00
\item By having accounts private spend key, wallet software can derive private view key by hashing private key with Keccak-256. That produces another 256-bit integer that represents private view key.
2018-07-29 22:29:03 +02:00
\item Both public keys are then derived from newly recovered private keys.
\end{itemize}
\end{itemize}
Example of Monero wallet address and mnemonic seed:
\begin{itemize}\itemsep0em
\item \textbf{Wallet address}
\begin{itemize}\itemsep0em
\item 461TWLQhsxrR9dD4CXk4p1RRxAAQ3YCEDhNiGCQjj5\\QA33ohhZPnCX6346EyEwC7TiRSB3XB8KgNaJ4vThd5N\\pQqRkGab66
\end{itemize}
\item \textbf{Mnemonic seed}
\begin{itemize}\itemsep0em
\item serving odometer nifty flippant worry sphere were thorn putty bogeys lyrics feast fawns input biscuit hobby outbreak rash tucks dwelt liquid azure inexact isolated liquid
\end{itemize}
\end{itemize}
\subsection{Wallet types}
2018-11-19 23:24:26 +01:00
\label{sec:wallettypes}
2018-08-04 20:06:16 +02:00
As Monero wallet can be represented as little as one file or 25 words, it is rather a small piece of information which user needs to store in the safe place to keep account under own control. To do that, there exist two main types of wallets:
2018-07-29 22:29:03 +02:00
\begin{itemize}\itemsep0em
\item \textbf{Hot wallet}
\begin{itemize}\itemsep0em
2019-02-03 20:52:42 +01:00
\item Refers to wallet software running on a computer that is connected to the Internet, thus Monero network. By being online, the user can verify incoming transactions, spend from the wallet and check balance as well.
2018-07-29 22:29:03 +02:00
\item As this type of wallet is not air-gapped, this poses an external intrusion risk.
2018-08-04 20:06:16 +02:00
\item The hot wallet can also refer to web-based and exchanged wallet that is explained further in this section.
2018-07-29 22:29:03 +02:00
\end{itemize}
\item \textbf{View-only wallet}
\begin{itemize}\itemsep0em
2018-08-04 20:06:16 +02:00
\item Is a wallet containing only private view key pair to see transactions associated with the wallet.
\item As this is a view-only wallet, the user can see incoming transactions but is not able to spend, sign or view outgoing transactions. That results in incorrect balance when the wallet is used for sending funds.
2018-07-29 22:29:03 +02:00
\end{itemize}
\item \textbf{Cold wallet}
\begin{itemize}\itemsep0em
2019-02-03 20:52:42 +01:00
\item Is an offline solution to storing wallet seed or private keys on storage media. Using method, media storing wallet information have no direct access to the Internet. The storage medium can be represented by an external hard drive, air-gapped computer as well as paper with wallet seed written on it.
2018-08-04 20:06:16 +02:00
\item That comes with increased security from the IT standpoint, but the usability of the cryptocurrency suffers. That is mainly due to the hassle of working with funds when the user wants to spend them as it requires:
2018-07-29 22:29:03 +02:00
\begin{itemize}\itemsep0em
\item Cold wallet imported into wallet software in the air-gapped computer.
2019-02-03 20:52:42 +01:00
\item A view-only wallet connected to the Internet.
2018-07-29 22:29:03 +02:00
\end{itemize}
2018-08-04 20:06:16 +02:00
\item This way, the user can generate an unsigned transaction on the view-only wallet, transfer it for signing to the air-gapped computer and then back to submit transfer to the Monero network.
2018-07-29 22:29:03 +02:00
\end{itemize}
\item \textbf{Exchange hosted wallet}
\begin{itemize}\itemsep0em
2018-08-04 20:06:16 +02:00
\item In exchange wallet, users funds are stored under an online account in an online exchange.
2018-07-29 22:29:03 +02:00
\item As opposed to a regular wallet, there is no wallet software or seed required as the whole balance and transaction system is ran by the third party.
Funds can be controlled through users online account that accessible by traditional username and password.
2018-08-04 20:06:16 +02:00
\item This poses a risk as the third party has complete access to users funds and the account's security is directly dependent on exchanges security measures as 2FA implementation, IP restriction or email verification.
2018-07-29 22:29:03 +02:00
\end{itemize}
\item \textbf{Web-based wallet}
\begin{itemize}\itemsep0em
2019-02-03 20:52:42 +01:00
\item Web wallet represents server based Monero client that is served to the user in the browser. By using a web wallet, the user can access funds from any Internet connected device by sharing:
2018-07-29 22:29:03 +02:00
\begin{itemize}\itemsep0em
2018-08-04 20:06:16 +02:00
\item Mnemonic seed or private spend and view key to send and receive funds.
2018-07-29 22:29:03 +02:00
\item Public view key and wallet address to view incoming transactions to the wallet.
\end{itemize}
\end{itemize}
\item \textbf{Hardware wallet}
\begin{itemize}\itemsep0em
\item Dedicated hardware solution like Ledger is still in its beta phase \cite{ledgermonero}.
\item Due to lack of real hardware wallet, the community around Monero recommends as the alternative a USB drive with a live distribution of Linux coupled with persistent storage where Monero client and users private key pairs are stored.
\item Note that although this alternate solution effectively rules out host operating system, there is still a way to capture viable information when interacting with the untrusted machine, for example, GPU output or usage of hardware keylogger.
2018-07-17 22:48:36 +02:00
2018-07-29 22:29:03 +02:00
\end{itemize}
\end{itemize}
2018-07-17 22:48:36 +02:00
\subsection{Attacking the wallet}
2018-08-04 20:06:16 +02:00
With the rapid expansion of cryptocurrencies from 2014 to 2018, this area became a significant spot for malware development \cite{schaupp2018cryptocurrency}. As there are many attack vectors, this section aims to give info about malicious activities on users wallets.
2018-08-04 19:14:03 +02:00
2018-08-05 20:04:29 +02:00
\subsubsection{Wallet thieves}
2019-02-03 21:48:25 +01:00
Aim to compromise the system in a way that malware finds wallet files and steals cryptographic keys or seed belonging to the wallet. Although in Monero, keys are encrypted while stored on the disk. When running wallet software, keys can be obtained from memory. This attack can also be performed by distributing malicious wallet client software.
2018-08-04 19:14:03 +02:00
2018-08-05 20:04:29 +02:00
\subsubsection{Cloud storage}
2018-08-04 20:06:16 +02:00
Cloud storage provides an easy way of sharing files between devices as well as users. As the user does not need to set up the infrastructure and the majority of the services provide free tier, it is usual for people to take this for granted as a safe place to store files \cite{caviglione2017covert}.
2018-08-04 19:14:03 +02:00
2018-08-05 20:04:29 +02:00
This way, user's security depends on the following factors:
2018-08-04 19:14:03 +02:00
\begin{itemize}\itemsep0em
2018-08-04 20:06:16 +02:00
\item Wallet encryption on the file level, user password habits
2019-01-27 15:47:19 +01:00
\item Account security -- login implementation, F2A
2018-08-04 19:14:03 +02:00
\item Client application implementation for caching and data transfer
\item Vendors storage system security
\end{itemize}
2018-08-05 20:04:29 +02:00
\subsubsection{Delivery chain}
2018-08-04 20:06:16 +02:00
Hardware wallets like Ledger are built to ensure the safety of users coins. Therefore owner of such a device should be pretty confident when using this device that came with original undisrupted packaging.
2018-08-04 19:14:03 +02:00
2019-02-03 20:52:42 +01:00
For this attack, malicious vendor puts pre-generated mnemonic seed on a scratchpad. This piece of paper is made to look like an official one-time generated secret key to the wallet for the user. This way when the user puts seed to the hardware wallet and begins to store coins in here, the reseller has complete access as well as both parties know the seed. Delivery chain attack flow is shown in the Figure \ref{pict:delivery-chain-attack}.
2018-08-04 19:14:03 +02:00
2018-08-05 20:04:29 +02:00
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=2.5cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, very thick, color=black!50, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=2.5cm,
minimum height=2em]
\begin{figure}[H]
\center
\begin{tikzpicture}[scale=2, node distance = 2cm, auto]
\shorthandoff{-}
% Place nodes
\node [block,text width=3cm,minimum width=3cm] (init) {\parbox{3cm}{\centering Expedition from the producer}};
\node [cloud, left of=init, node distance=5cm] (expert) {\parbox{3cm}{\centering Original \\ package }};
\node [block, below of=init, node distance=2.5cm,text width=3cm,minimum width=3cm] (identify) {\parbox{3cm}{\centering Repackaging by reseller}};
2018-11-19 23:31:36 +01:00
\node [block, below of=identify, node distance=2.5cm,text width=3cm,minimum width=3cm] (evaluate) {\parbox{3cm}{\centering HW wallet bought by end user}};
2018-08-05 20:04:29 +02:00
\node [cloud, left of=identify, node distance=5cm] (update) {\parbox{3cm}{\centering Malicious scratchpad with seed }};
\node [block, below of=evaluate, node distance=2.5cm,text width=3cm,minimum width=3cm] (attacker) {\parbox{3cm}{\centering Attacker's database of wallets}};
% Draw edges
\path [line] (init) -- (identify);
\path [line] (update) -- (identify);
\path [line] (identify) -- (evaluate);
\path [line] (expert) -- (init);
\path [line,dashed] (update) |- (attacker);
\end{tikzpicture}
2019-01-27 15:47:19 +01:00
\caption{Delivery chain attack.}
2018-08-05 20:04:29 +02:00
\label{pict:delivery-chain-attack}
\end{figure}
2018-08-08 21:39:58 +02:00
\subsubsection{Malicious seed generation}
Similar to Delivery chain attack, the attacker in this scenario provides service that offers secure seed generation to obtain seed information belonging to the wallet. That is usually done by running a malicious web service that offers secure seed generation for cryptocurrencies or developing a standalone software for download.
2018-10-08 00:08:40 +02:00
After the user generates the seed, a package with seed data is automatically sent to the attackers listening service and then saved to the database. Both parties know the private information and can spend funds from the wallet.
2018-08-08 21:39:58 +02:00
2018-08-05 20:04:29 +02:00
\begin{sidewaystable}[]
\subsection{Overview of wallet storage methods}
2018-11-19 23:24:26 +01:00
\label{fig:walletstorage}
2018-08-05 20:04:29 +02:00
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{p{0.1\linewidth}p{0.1\linewidth}p{0.1\linewidth}p{0.2\linewidth}p{0.1\linewidth}p{0.1\linewidth}p{0.1\linewidth}p{0.1\linewidth}p{0.1\linewidth}}
2018-10-08 00:08:40 +02:00
\textbf{Wallet type } & \textbf{Receiving} & \textbf{Spending} & \textbf{Online vulnerability} & \textbf{System security} & \textbf{Control} & \textbf{Location} & \textbf{Recovery} & \textbf{Delivery chain attack} \\
Hot wallet & Always ready & Always ready & Vulnerable, complete access after breach & Under user's control & User & Local storage & Seed & Wallet software \\
View-only wallet & Can see incoming transactions & No, only view-key & Vulnerable, the attacker then could see incoming transactions & Under user's control & User & Local storage & Seed & Wallet software \\
Cold wallet & No & No & No, unless the system is compromised & Under user's control & User & Local storage, paper or other media & Seed & Wallet software \\
Exchange hosted wallet & Yes & Yes & Account breach, MITM, website spoofing & Fully dependent on third-party & User and third party & Someone else's computer & Account recovery & Website spoofing \\
Web-based wallet & Yes & Yes & Wallet key storing against user's will, MITM, website spoofing & User's security keys, third party's systems & User and third party & Local storage, third party's storage & Seed & Website spoofing \\
2018-08-05 20:04:29 +02:00
Hardware wallet & Yes & Yes & & Hardware dependant & User & Dedicated hardware storage & Recovery sheet & Modified firmware, scratchpad
\end{tabular}%
}
\caption{List of wallet types from security view.}
\label{table:wallettypes}
\end{sidewaystable}\newpage
2018-08-04 19:14:03 +02:00
2018-08-05 20:04:29 +02:00
%\subsection{Cryptocurrency wallet software}
2018-07-17 22:48:36 +02:00
2018-08-05 20:04:29 +02:00
%\subsection{Creating a wallet}
2018-07-17 22:48:36 +02:00
2018-08-05 20:04:29 +02:00
\section{Local and remote node}
To spend or view the balance in the wallet, the user is required to have a wallet client software or use third party services to access the Monero network. This section covers the most common type of accessing the funds, hot wallet in combination with official Monero client software available at \url{https://getmonero.org/downloads/}.
2018-07-17 22:48:36 +02:00
2018-10-08 00:08:40 +02:00
Monero client requires to be in sync with the network to show the correct balance as well as to work with the funds. That is done by either running a full local node or connecting to the remote node.
2018-07-17 22:48:36 +02:00
2018-08-05 20:04:29 +02:00
\textbf{Node} is a part of the cryptocurrency network that keeps a synced copy of blockchain in the local storage and provides a service that enables clients to access the information from the blockchain file. In Monero client software, this is represented by monerod, a separate daemon which synchronizes with the network.
2018-10-08 00:08:40 +02:00
\textbf{The local node} is default option when running wallet software, using monerod client downloads from Monero network the blockchain and stores it in local storage. As of July 2018, blockchain size is about 44.3 GB. By running local node, can independently verify transactions as well as blockchain state.
2018-07-17 22:48:36 +02:00
2018-08-05 20:04:29 +02:00
\textbf{The remote node}, on the other hand, represents a lighter version with slightly less privacy when it comes to working with the wallet. By either choosing in GUI to connect to the remote node or running cli with parameter \textit{.\textbackslash monero-wallet-cli.exe --daemon-address node.address:port} , the client connects to the remote node and starts scanning the blockchain as if it was a local one.
2018-07-17 22:48:36 +02:00
2018-08-05 20:04:29 +02:00
\begin{figure}[H]
\center
\begin{tabular}{p{0.45\linewidth}p{0.45\linewidth}}
\textbf{Local node} & \textbf{Remote node} \\
Blockchain stored on locally & Blockchain stored remotely \\
Observable traffic between nodes & Visible connection to the remote server \\
Default way for desktop clients & Default way for mobile wallets \\
%Time delay caused by blockchain download & No initial setup needed \\
Requires 45+ GB and connection to keep in sync & Requires connection to scan blockchain
\end{tabular}
\caption{Monero node comparison.}
\label{table:moneronodes}
\end{figure}
\newpage
2018-07-29 22:29:03 +02:00
\section{Multisig implementation}
2018-07-17 22:48:36 +02:00
2018-08-05 23:49:36 +02:00
Monero started to support multisignature transactions and addresses by 17th of December 2017 when codebase for this feature was merged into master by Fluffypony \cite{moneromultisig}. Multisig became available in the Lithium Luna release that was released 23rd of July 2018 \cite{moneromultisigrelease}.
2018-08-08 21:39:58 +02:00
Multisig in a cryptocurrency is a feature that requires the multisig transaction to be signed by all keys that are required. For multisig, one can create a multisig wallet that is designed as follow:
\begin{itemize}\itemsep0em
\item 1-of-2
\begin{itemize}\itemsep0em \item Requires one of two participating parties to sign a transaction. \item This scheme acts as a shared wallet where each of the key holders can spend funds without the other party signing the transaction. \end{itemize}
\item 2-of-2 \begin{itemize}\itemsep0em \item Requires both parties to sign a transaction. \item Each side has to agree to spend funds and sign the transaction.\end{itemize}
\item M-of-N \begin{itemize}\itemsep0em \item Requires M keys of N to sign a transaction, note that M is a subset of N. \end{itemize}
\end{itemize}
\subsection{Multisig usage}
2019-02-03 20:52:42 +01:00
After Lithium Luna release, only Monero wallet CLI software is ready for processing multisig transactions. In the Figures \ref{pict:multisig-wallet-generation} and \ref{pict:multisig-transaction} example scheme of 2-of-2 is presented with user A as blue and user B as green for wallet generation and transaction using Monero multisig feature.
2018-08-08 21:39:58 +02:00
\newpage
\definecolor{ao(english)}{rgb}{0.0, 0.5, 0.0}
\definecolor{azure(colorwheel)}{rgb}{0.0, 0.5, 1.0}
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=2.5cm, inner sep=0pt]
\tikzstyle{userA} = [rectangle, draw, fill=ao(english)!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{userB} = [rectangle, draw, fill=azure(colorwheel)!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{lineuserA} = [draw, very thick, color=ao(english)!80, -latex']
\tikzstyle{lineuserB} = [draw, very thick, color=azure(colorwheel)!80, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=2.5cm,
minimum height=2em]
\begin{figure}[H]
\center
\begin{tikzpicture}[scale=2, node distance = 2cm, auto]
\shorthandoff{-}
% Place nodes
\node [userA,text width=5cm,minimum width=5cm] (userA1) {\parbox{5cm}{\centering Generates new wallet}};
\node [userB, right of=userA1, node distance=6cm, text width=5cm,minimum width=5cm] (userB1) {\parbox{5cm}{\centering Generates new wallet}};
\node [userA, below of=userA1,node distance=2.5cm,text width=5cm,minimum width=5cm] (userA2) {\parbox{5cm}{\centering Runs \texttt{prepare_multisig} to generate initialization data}};
\node [userB, below of=userB1, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB2) {\parbox{5cm}{\centering Runs \texttt{prepare_multisig} to generate initialization data}};
\node [userA, below of=userA2,node distance=2.5cm,text width=5cm,minimum width=5cm] (userA3) {\parbox{5cm}{\centering User exchanges initialization data}}; %, in cli called multisig wallet password
\node [userB, below of=userB2, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB3) {\parbox{5cm}{\centering User exchanges initialization data}}; %, in cli called multisig wallet password
\node [userA, below of=userA3,node distance=2.5cm,text width=5cm,minimum width=5cm] (userA4) {\parbox{5cm}{\centering Runs \texttt{make_multisig 2 init_data_from_user_B}}};
\node [userB, below of=userB3, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB4) {\parbox{5cm}{\centering Runs \texttt{make_multisig 2 init_data_from_user_A}}};
\node [userA, below of=userA3,node distance=2.5cm,text width=5cm,minimum width=5cm] (userA4) {\parbox{5cm}{\centering Multisig wallet is generated with same address for both users}};
\node [userB, below of=userB3, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB4) {\parbox{5cm}{\centering Multisig wallet is generated with same address for both users}};
% \node [block, below of=init, node distance=2.5cm,text width=3cm,minimum width=3cm] (identify) {\parbox{3cm}{\centering Repackaging by reseller}};
% \node [block, below of=identify, node distance=2.5cm,text width=3cm,minimum width=3cm] (evaluate) {\parbox{3cm}{\centering HW wallet bought by enduser}};
% \node [cloud, left of=identify, node distance=5cm] (update) {\parbox{3cm}{\centering Malicious scratchpad with seed }};
% \node [block, below of=evaluate, node distance=2.5cm,text width=3cm,minimum width=3cm] (attacker) {\parbox{3cm}{\centering Attacker's database of wallets}};
% Draw edges
% \path [line] (init) -- (identify);
\path [lineuserA] (userA1) -- (userA2);
\path [lineuserA] (userA2) -- (userA3);
\path [lineuserA] (userA3) -- (userA4);
\path [lineuserB] (userB1) -- (userB2);
\path [lineuserB] (userB2) -- (userB3);
\path [lineuserB] (userB3) -- (userB4);
\path [lineuserA] (userA3) to[in=-165,out=-15,looseness=0] (userB3);
\path [lineuserB] (userB3) to[in=15,out=165,looseness=0] (userA3);
% \path [line] (identify) -- (evaluate);
%\path [line] (expert) -- (init);
% \path [line,dashed] (update) |- (attacker);
\end{tikzpicture}
2019-01-27 15:47:19 +01:00
\caption{Generating a multisig wallet.}
2018-08-08 21:39:58 +02:00
\label{pict:multisig-wallet-generation}
\begin{tikzpicture}[scale=2, node distance = 2cm, auto]
\shorthandoff{-}
% Place nodes
\node [userA,text width=5cm,minimum width=5cm] (userA1) {\parbox{5cm}{\centering Wallet sync to show correct balance \texttt{import_multisig_info export_multisig_info}}};
\node [userB, right of=userA1, node distance=6cm, text width=5cm,minimum width=5cm] (userB1) {\parbox{5cm}{\centering Wallet sync to show correct balance \texttt{import_multisig_info export_multisig_info}}};
\node [userA, below of=userA1,node distance=2.5cm,text width=5cm,minimum width=5cm] (userA2) {\parbox{5cm}{\centering Runs \texttt{transaction [address] [amount]} to create unsigned transaction}};
\node [userB, below of=userB1, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB2) {\parbox{5cm}{\centering Signs transaction \texttt{sign_multisig [transaction_name]} to sign transaction}};
\node [below of=userA2,node distance=2.5cm,draw=none] (userA3) {}; %, in cli called multisig wallet password
\node [userB, below of=userB2, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB3) {\parbox{5cm}{\centering Submits tran-saction to Monero network \texttt{submit_multisig [transaction_name]}}}; %, in cli called multisig wallet password
\node [userA, below of=userA3,node distance=2.5cm,text width=5cm,minimum width=5cm] (userA4) {\parbox{5cm}{\centering Runs \texttt{make_multisig 2 init_data_from_user_B}}};
\node [userB, below of=userB3, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB4) {\parbox{5cm}{\centering Runs \texttt{make_multisig 2 init_data_from_user_A}}};
\node [userA, below of=userA3,node distance=2.5cm,text width=5cm,minimum width=5cm] (userA4) {\parbox{5cm}{\centering User can check transaction in blockchain explorer using txid}};
\node [userB, below of=userB3, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB4) {\parbox{5cm}{\centering User can check transaction in blockchain explorer using txid}};
% \node [block, below of=init, node distance=2.5cm,text width=3cm,minimum width=3cm] (identify) {\parbox{3cm}{\centering Repackaging by reseller}};
% \node [block, below of=identify, node distance=2.5cm,text width=3cm,minimum width=3cm] (evaluate) {\parbox{3cm}{\centering HW wallet bought by enduser}};
% \node [cloud, left of=identify, node distance=5cm] (update) {\parbox{3cm}{\centering Malicious scratchpad with seed }};
% \node [block, below of=evaluate, node distance=2.5cm,text width=3cm,minimum width=3cm] (attacker) {\parbox{3cm}{\centering Attacker's database of wallets}};
% Draw edges
\path [lineuserA] (userA1) -- (userA2);
\path [lineuserA] (userA2) -- (userA4);
\path [lineuserB] (userB1) -- (userB2);
\path [lineuserB] (userB2) -- (userB3);
\path [lineuserB] (userB3) -- (userB4);
\path [lineuserA] (userA1) to[in=-165,out=-15,looseness=0] (userB1);
\path [lineuserB] (userB1) to[in=15,out=165,looseness=0] (userA1);
% \path [line] (identify) -- (evaluate);
%\path [line] (expert) -- (init);
\path [lineuserA] (userA2) |- (userB2);
\end{tikzpicture}
2019-01-27 15:47:19 +01:00
\caption{Multisig transaction.}
2018-08-08 21:39:58 +02:00
\label{pict:multisig-transaction}
\end{figure}
2018-07-17 22:48:36 +02:00
\section{Problems in Monero environment}
2018-08-10 16:15:39 +02:00
Monero privacy features are welcomed not only by privacy savvy users but malware, phishing, and other malicious software creators as well.
2018-07-17 22:48:36 +02:00
2018-08-10 16:15:39 +02:00
The main reason to use Monero over other cryptocurrencies for them is that Monero is not only harder to trace but when the attack is implemented well, after moving funds in separate batches to multiple wallets an over more extended period, no one will be able to associate the coins with the malicious activity.
2019-01-27 15:47:19 +01:00
There are three main problems concerns in Monero environment:
2018-08-10 16:15:39 +02:00
\subsubsection{Ransomware}
Malware that encrypts user files and then demands a ransom in the form of cryptocurrency, computer and files are no longer accessible unless the user pays the required amount. During its peak time, all popular ransomware demanded payment in Bitcoin.
2018-10-08 00:08:40 +02:00
As malware developers started to get their coins targeted by projects such as one from Netherlands' police called \textit{No More Ransom} available at \url{nomoreransom.org} \cite{martin2017don,paquet2018ransomware}.
2018-12-02 15:22:35 +01:00
Because of this targeting, they had to choose another cryptocurrency to solve this problem, and the solution was Monero \cite{cusack2018points}.
2018-08-10 16:15:39 +02:00
\subsubsection{Scam portals}
2018-10-08 00:08:40 +02:00
As mentioned in section Wallets, online wallets usage is a risky thing due to entrusting user's private keys to the third party. Users often choose them as they are not required to have any additional software. Due to this fact, there are more than ten domains that copy the design, functionality, and name of \url{mymonero.com} official online wallet with added code that steals user's wallet data. Detailed list of domains is available at \url{https://www.reddit.com/r/Monero/wiki/avoid}.
2018-07-17 22:48:36 +02:00
2018-12-02 15:22:35 +01:00
Aside from direct scams, there are also services offering wallet services which have their codebase closed and store all wallet information. The best-known example of such service is \url{freewallet.org}, that is strongly criticized for closed source as well as funds that that are reported as missing from user's accounts \cite{wijayamonero}.
2018-08-11 19:44:24 +02:00
\subsubsection{Crypto-jacking attack}
Crypto-jacking a type of attack where the attacker delivers a malicious payload to the user's computer. Rather than rendering the device unusable either by blocking like ransomware, part of system resources is used for mining.
2018-08-17 13:31:29 +02:00
Crypto-jacking is becoming more frequent than ransomware as it has proven that steady but low income is more profitable than one-time payment in the form of ransomware \cite{higbee2018role}.
2018-08-11 19:44:24 +02:00
\vspace{-1em}
\subsubsection{Black Ruby}
Interesting intersection of ransomware and crypto-jacking category is Black Ruby malware that combines features of both. First, it encrypts files on the target computer and then proceeds to mine Monero using XMRig at full CPU load \cite{blackruby2018}.
\vspace{-1em}
2018-07-17 22:48:36 +02:00
\section{Monero use case}
2018-08-11 19:44:24 +02:00
Aside from code quality and features, another important factor in cryptocurrency success are the ways how users can spend the funds. While numerous community around Monero that centers around Reddit \textit{/r/Monero} created \textit{/r/XMRtrader}, there are also projects that support Monero in day-to-day use like \url{https://xmr.to/}.
2018-07-17 22:48:36 +02:00
2018-08-11 19:44:24 +02:00
What is most noticeable tough, are darknet markets, that started to support payments by Monero. This results in the rather negative use case of the crypto as payments by Monero are not directly likable to one's wallet as described in section \ref{sec:ringsignatures}.
2018-07-17 22:48:36 +02:00
2018-08-11 19:44:24 +02:00
\begin{figure}[H]
\begin{center}
2018-07-17 22:48:36 +02:00
2018-08-17 13:31:29 +02:00
\vspace{-0.8em}
\includegraphics[trim={0 1.8cm 0 0},clip,width=0.71\textwidth]{Screenshot_360.png}
2018-08-11 19:44:24 +02:00
\caption{Darknet market payment options.}
\vspace{-1.5em}
\label{pic:withoutresdrawable}
\end{center}
\end{figure}
2018-07-17 22:48:36 +02:00
2018-08-11 19:44:24 +02:00
Although darknet markets may support Monero, a short inspection of top 10 markets revealed that only 5 of them list Monero as the general way to pay. Rest of them are not forcing the sellers to use Monero. This results at about 40\% availability of Monero payment option on these type of markets.
2018-06-29 16:38:17 +02:00
2018-07-22 00:10:19 +02:00
\chapter{Monero user research}
2018-09-05 17:48:59 +02:00
\label{cha:monerousersurvey}
The goal of this research is to gather information on end users behavior regarding Monero cryptocurrency with emphasis on key management and security practices. For this purpose, an online questionnaire was created.
2018-09-28 12:49:20 +02:00
Specific survey design and research questions are based on Bitcoin security and privacy study, typical usage patterns of cryptocurrency users, online forums and Reddit communities centered around Monero as well as problematic areas regarding computer and data security in general \cite{krombholz2016other}.
2018-09-05 17:48:59 +02:00
\section{Research questions}
The survey was designed around seven question groups, some of them were shown only if the participant chose the appropriate answer.
\begin{itemize}\itemsep0em
\item G01 - Introductory information
\item G02 - Monero usage
\item G03 - Monero key and coin management
\item G04 - Monero and malicious things
\item G05 - Monero recovery
\item G06 - Special question set for miners
\item G07 - Demographics
\end{itemize}
Following this pattern, four research questions were set:
\begin{itemize}\itemsep0em
\item R1: What are Monero's main use cases? How do participants perceive Monero's features?
\item R2: What are participant's ways of wallet access and storage?
\item R3: What security incidents have affected users? How did they deal with them?
\item R4: In case of recovery, how did they recover their keys?
\end{itemize}
\section{Participants and survey's background}
The significant characteristic of Monero is its anonymity, and this feature is not taken by community lightly. Due to this fact, the survey was not hosted on third party servers, but instead on dedicated VPS running Lime Survey self-hosted software with HTTPS interface using signed Letsencrypt certificates.
2019-02-03 20:52:42 +01:00
This means that data exchanged between participants and survey software stays only between these two parties, so Google or other big data company cannot analyze them. To allow extended anonymity features, Tor and proxy connections were allowed, but each participant had to solve the CAPTCHA before starting the survey.
2018-09-05 17:48:59 +02:00
\subsection{Methodology}
Data collection method was online only and was using the survey website software. Participants selection was based on opportunity sampling, links for the research were shared among dedicated Reddit Monero community, Facebook Monero groups as well as Cryptocurrency forums.
2018-12-02 15:22:35 +01:00
To reduce nonresponse rate, participants were asked only to fill out parts that were significant for them, e.g., Monero recovery part stayed hidden in the form if the user selected that he/she had never made any recovery of the seed or wallet keys in the previous part.
2018-09-05 17:48:59 +02:00
2019-02-03 20:52:42 +01:00
The complete survey is attached in the Chapter \ref{monero-user-study-pdf}.
2018-09-05 17:48:59 +02:00
2018-07-22 00:10:19 +02:00
\section{Results international, CZ}
2018-06-29 16:38:17 +02:00
2018-07-22 00:10:19 +02:00
\chapter{Monero usage and storage best practices}
2018-12-02 15:22:35 +01:00
Ease of use is one of the critical aspects of every cryptocurrency and although Monero can offer a wide range of anonymity features it has to be usable and user-friendly to be used by a substantial margin of people. Usability in Monero is a long-term topic that brings out active discussion \cite{monerolang2018}.
2018-10-14 21:53:59 +02:00
Following scenarios represent secure and easy to use instructions for a new Monero user.
2018-10-18 22:48:10 +02:00
\section{Generating the keys and accessing the wallet}
2019-02-03 21:48:25 +01:00
The first challenge for Monero users is generating key pairs and accessing the wallet. This process varies from users platform of choice and used wallet software. As the choice of client wallet software is important for Monero users in terms of user experience and security, following sections are dedicated to available wallet software. %TODO je to better oproti původnímu As the choice of client wallet software is fundamental for users Monero regarding user experience and security standpoint, following sections are dedicated to available wallet software.
2018-10-18 22:48:10 +02:00
\subsection{Windows and Linux platform}
2018-12-02 15:22:35 +01:00
The official client offers CLI and GUI wallet management and is available at \url{https://getmonero.org/downloads/}. Using the client users can generate the wallet keys. Created keys are after generation saved directly into the memory of the device unless specified otherwise.
2018-10-18 22:48:10 +02:00
\begin{figure}[H]
\begin{center}
2018-11-19 23:24:26 +01:00
% \vspace{-0.8em}
2018-10-18 22:48:10 +02:00
\includegraphics[trim={0 0 0 0},clip,width=0.85\textwidth]{Screenshot_4.png}
2019-01-27 15:47:19 +01:00
\caption{GUI wallet generation.}
2018-11-19 23:24:26 +01:00
% \vspace{-1.5em}
2018-10-18 22:48:10 +02:00
\label{pic:guigenerator}
\end{center}
\end{figure}
2018-10-14 21:53:59 +02:00
\begin{figure}[H]
\begin{center}
\begin{lstlisting}
.\monero-wallet-cli.exe
Monero 'Lithium Luna' (v0.12.3.0-release)
Logging to C:\...\monero-wallet-cli.log
Specify wallet file name (e.g., MyWallet). If the wallet
doesn't exist, it will be created.
Wallet file name (or Ctrl-C to quit): ssme-thesis
No wallet found with that name. Confirm creation of new
wallet named: ssme-thesis
(Y/Yes/N/No): Y
Generating new wallet...
\end{lstlisting}
2019-01-27 15:47:19 +01:00
\caption{CLI wallet generation.}
2018-10-18 22:48:10 +02:00
\label{pic:cligenerator}
2018-10-14 21:53:59 +02:00
\end{center}
\end{figure}
2018-11-19 23:24:26 +01:00
Security of this task depends on the origin of the software, delivery chain trust, and the users' operating system. Monero CLI and GUI binaries can be edited, and the app itself does not call any internal checking to alert the user of the unauthorized change.
2018-10-14 21:53:59 +02:00
2018-11-19 23:24:26 +01:00
2019-02-03 20:52:42 +01:00
Code injection was successfully tested on GUI binary of the official Monero wallet as seen in the Figure \ref{pic:codeinjectiongui}. Although SHA256 hash is provided on the website, the user is not specifically instructed to check the hashes of the downloaded software with tools like PowerShell using \texttt{Get-FileHash ./monero-wallet-gui.exe | Format-List} command \cite{pialphapialphagammaiotaacutealphanunualpharhoovarsigma2016study}. GPG-signed list of the hashes is available on the website although there are no instructions on how to verify PGP signature itself.
2018-11-19 23:24:26 +01:00
\begin{figure}[H]
\begin{center}
\begin{lstlisting}
Algorithm : SHA256
Hash : AF9324151909AC7B9BC6D622210EADFBAE5E66...
Path : ./monero-wallet-gui-original.exe
2018-10-14 21:53:59 +02:00
2018-11-19 23:24:26 +01:00
Algorithm : SHA256
Hash : DF4EC49E088284ECC78DBBD8B9CEFF00A78085...
Path : ./monero-wallet-gui-injected.exe
\end{lstlisting}
2019-01-27 15:47:19 +01:00
\caption{Checksum change after code injeciton.}
2018-11-19 23:24:26 +01:00
\label{pic:codeinjectiongui}
\end{center}
\end{figure}
2018-10-18 22:48:10 +02:00
2019-02-03 20:52:42 +01:00
% Wallet key generation process is shown on examples in the Figures \ref{pic:cligenerator} and \ref{pic:guigenerator}. \\
2018-11-19 23:24:26 +01:00
There are also alternative approaches to key generation like an offline javascript based monero-wallet-generator that is available at \url{github.com/moneromooo-monero/monero-wallet-generator}.
2018-10-18 22:48:10 +02:00
\subsection{Hardware wallet}
2018-11-19 23:24:26 +01:00
2018-12-02 15:22:35 +01:00
Hardware way is considered to be in the development, but Monero compatible devices like Ledger Nano S are already on the market. The way how keys are generated in hardware wallets varies on firmware included in each device.
2018-10-14 21:53:59 +02:00
2018-12-02 15:22:35 +01:00
In general, the wallet is required to have Monero app installed from vendors app catalog. Keys are generated on the hardware device within the app itself, and user can only export private view key from the device to view the balance in full CLI/GUI client.
2018-10-18 22:48:10 +02:00
2018-12-02 15:22:35 +01:00
This way, the user has private spend key always on the device, and client PC has only private view key. To sign a transaction, the user has to confirm the transaction on the device itself meaning the hardware wallet will sign the transaction and then sends it to the Monero client. By this, in case of a security breach on the host computer, there is no Monero to steal.
2018-10-18 22:48:10 +02:00
2018-11-17 19:33:57 +01:00
\subsection{Wallet software for mobile devices}
2018-11-19 23:24:26 +01:00
2018-12-02 15:22:35 +01:00
Monero has wallet software available for Android as well as the iOS platform. For both platforms community recommends users to use the open source ones, as their codebase is published on GitHub and everyone can inspect the code. Another common fact for the recommended solutions is that the keypairs for the wallet are stored exclusively on the user's device and restore can be done without third-party tech support.
2018-11-17 19:33:57 +01:00
2018-12-02 15:22:35 +01:00
\textbf{Monerojuro} is an open source Android wallet application that is available on Google Play as well as APK release at Github. By this, users can install the app from the Google Play directly, manually download the APK or compile it from source code themselves. Wallet keys storage is based on the device only, and the app encourages users to back up their seed \cite{xmrwalletgithub}.
2018-11-19 23:24:26 +01:00
2018-12-02 15:22:35 +01:00
\textbf{Monero Wallet} is an app released by Freewallet.org that provides Monero wallets for both Android and iOS. Regarding overall usability, this app is easier for an average user as it does not present any cryptocurrency wallet terms as key, seed, etc. The user is instead instructed to create a Freewallet account which acts as a wallet \cite{freewallet}.
2018-11-19 23:24:26 +01:00
2018-12-02 15:22:35 +01:00
By this, the user does not need to save the seed, wallet keys or make any backups as key management is completely on the side of the service provider, Freewallet.org. This fact is often emphasized in Monero community as the user that does not control the keys does not control the wallet. Also, the source code is not publicly available for the community to review.
2018-11-19 23:24:26 +01:00
2018-12-02 15:22:35 +01:00
\textbf{Cake Wallet} represents open source Monero wallet for iOS that provides wallet generation and local key pair storage with remote node connection and synchronization \cite{cakewalletgithub}.
2018-11-19 23:24:26 +01:00
2019-02-03 20:53:15 +01:00
Guideline for secure wallet access is described in the Chapter \ref{sec:wallettypes}.
2018-11-19 23:24:26 +01:00
\begin{figure}[H]
\begin{center}
\vspace{-0.75em}
\includegraphics[trim={0 1.8cm 0 0},clip,width=0.55\textwidth]{Screenshot_1542566492.png}
2019-01-27 15:47:19 +01:00
\caption{Monerujo for Android.}
2018-11-19 23:24:26 +01:00
\vspace{-1.5em}
\label{pic:withoutresdrawable}
\end{center}
\end{figure}
\vspace{-0.9em}
2018-11-17 19:33:57 +01:00
\begin{figure}[H]
\centering\begin{tabular}{p{0.2\linewidth}p{0.15\linewidth}p{0.1\linewidth}p{0.4\linewidth}}
2018-11-19 23:24:26 +01:00
\textbf{Name} & \textbf{Platform} & \textbf{Source} & \textbf{Wallet keys management} \\
2019-02-03 21:48:25 +01:00
Monerojuro & Android & Open Source & Keypair is stored locally. User has complete control. \\
Monero Wallet & Android iOS & Closed Source & Keypair in cloud storage. No control over keys. \\
Cake Wallet & iOS & Open Source & Keypair is stored locally. User has complete control.
2018-11-17 19:33:57 +01:00
\end{tabular}
2019-01-27 15:47:19 +01:00
\captionof{table}{List of avaiable wallets for mobile platforms.}
2018-11-19 23:24:26 +01:00
\label{table:monero-mobile}
2018-11-17 19:33:57 +01:00
\end{figure}
2018-10-14 21:53:59 +02:00
2018-11-19 23:24:26 +01:00
\section{Secure storage system}
2018-12-02 15:22:35 +01:00
Wallet keys are everything when it comes to cryptocurrency usage. Who has the keys, controls the wallet and can view or transfer the balance to another address. If user loses wallet keys, Monero wallet can still be recovered using mnemonic seed that should be saved on another storage medium.
2018-10-14 21:53:59 +02:00
2019-02-03 20:52:42 +01:00
This section describes possible ways of backing-up wallet keys. Primary storage media security is compared in the Figure \ref{fig:walletstorage}.
2018-11-19 23:24:26 +01:00
\subsubsection{Data characteristics}
2018-12-02 15:22:35 +01:00
As described in the section \ref{sec:wallets}, Monero wallet consists of an encrypted \texttt{wallet.keys} file that contains private spend and view keys. Size of this file is less than a few kilobytes.
2018-10-14 21:53:59 +02:00
2018-11-19 23:24:26 +01:00
Another type of data that is presented to the user is mnemonic seed. Seed can be used for recovery when wallet file is lost and consists of 25 words with the last one being used for checksum.
2018-10-14 21:53:59 +02:00
2018-11-19 23:24:26 +01:00
In total, Monero wallet requires less than 8 kilobytes for key and seed storage. This results in minimal space requirements for backup storage media.
2018-11-21 18:01:46 +01:00
\subsubsection{Backup strategy}
2018-12-02 15:22:35 +01:00
Best practice for backups that isn't too demanding on the user side is the 3-2-1 strategy that is considered in the industry as a bare minimum for keeping the data safe \cite{storage2012data}.
2018-11-21 18:01:46 +01:00
\begin{itemize}
\itemsep0em
\item 3 means having at least 3 copies of your data in total.
2018-12-02 15:22:35 +01:00
\item 2 of them are local but stored on different media types.
2018-11-21 18:01:46 +01:00
\begin{itemize}
\itemsep0em
2018-12-02 15:22:35 +01:00
\item This can be represented as a combination of SSD and tape.
2018-11-21 18:01:46 +01:00
\end{itemize}
2018-12-02 15:22:35 +01:00
\item 1 is offsite, geographically different location.
2018-11-21 18:01:46 +01:00
\begin{itemize}
\itemsep0em
\item E.g. in the next building, different facility, another city.
\end{itemize}
\end{itemize}
In short, this means when your building with external drive burns down and your notebook gets cryptolocker on the same day, you still have your data safe as you have them in the offsite location.
\begin{figure}[H]
\centering
\begin{tabular}{p{0.1\linewidth}p{0.4\linewidth}p{0.25\linewidth}p{0.15\linewidth}}
\textbf{Media type} & \textbf{Available key security} & \textbf{Usage} & \textbf{Average pricing} \\
2019-02-03 21:48:25 +01:00
HDD, SSD & File and volume encryption, can be automated. & Manual transfer from master to external media. & 20-40 USD \\
Optical media & File-based encryption before creating the media, manual process. & For each copy of data, new disc has to be used. & \textless{}1 USD \\
Tape & Hardware assisted drive encryption, software-based encryption. & Specialised backup tape software. & 4500 USD (tape + drive) \\
NAS & File-based encryption on the client side using encryption software or NAS feature. & Manual or automatic transfer to network share. & 200-400 USD \\
Cloud drive & File-based encryption on the client side using encryption software. & Clientside software that syncs files from master & Free or paid 10 USD mo. \\
Paper & Depends on printout content and physical storage properties. & Hiding a sheet of paper. & \textless{}1 USD \\
2018-11-21 18:01:46 +01:00
\end{tabular}
2019-01-27 15:47:19 +01:00
\captionof{table}{Common storage methods with security features.}
2018-11-21 18:01:46 +01:00
\label{table:secure-storage}
\end{figure}
2018-12-02 15:22:35 +01:00
Data that users need to backup are not changing in the day to day usage, but only when the user creates a new or additional wallet. Meaning that backing up the wallet does not need to be made frequently unlike other user data that are changed frequently, e.g., documents. Verification, on the other hand, is more important as not only users should back up the data, they should also be able to restore them. For ease of use, users can verify the integrity of the backup by actually recovering the wallet from the backup media.
2018-10-08 00:08:40 +02:00
2018-11-21 18:01:46 +01:00
\subsubsection{Recommended scheme}
Following cost effectivity of individual media types together with common backup strategy:
\begin{itemize}
\itemsep0em
\item Total number of copies of data: 5
2018-12-02 15:22:35 +01:00
\item The primary data source is on the client device with wallet software. This source is then copied downstream to backup media.
\item All copies of the data should be encrypted using file-level encryption regardless of the security the device, e.g., by a popular opensource tool like VeraCrypt.
2018-11-21 18:01:46 +01:00
\item Local copy
\begin{itemize}
\itemsep0em
2018-12-02 15:22:35 +01:00
\item Located on disk with full volume encryption, e.g., by BitLocker.
\item Paper backup in a secure container at a hidden place.
2018-11-21 18:01:46 +01:00
\end{itemize}
\item Offsite copy
\begin{itemize}
\itemsep0em
\item Located on the flash drive with full volume encryption.
2018-12-02 15:22:35 +01:00
\item Located on the DVD as an encrypted file.
2018-11-21 18:01:46 +01:00
\end{itemize}
\end{itemize}
2018-06-29 16:38:17 +02:00
2018-11-21 18:01:46 +01:00
\subsubsection{Secure Monero usage portal}
As a result of this chapter and Monero user research, all recommendations for secure Monero usage are compiled within one website \url{https://ownercz.github.io/ssme-thesis-portal/}. %TODO UPDATE LINK.
2018-06-29 16:38:17 +02:00
2018-11-21 18:01:46 +01:00
\begin{figure}[H]
\begin{center}
\includegraphics[trim={0 0 5px 1px},clip,width=1\textwidth]{Screenshot_7.png}
2019-01-27 15:47:19 +01:00
\caption{Monero secure usage portal.}
2018-11-21 18:01:46 +01:00
\label{pic:moneroweb}
\end{center}
\end{figure}
2018-07-22 00:10:19 +02:00
\chapter{Obtaining Monero and running the network}
2018-12-02 15:22:35 +01:00
\label{cha:obtaining}
Monero mining is a process done by miners to verify transactions on the network and add them to the blockchain together in the form of a block. This results for them in a reward in the form of new coins that are emitted as a reward for block solving.
2018-09-28 12:49:20 +02:00
2018-10-08 00:08:40 +02:00
Network speed is mainly determined by the average time between individual blocks. %This results in transaction process that takes up to 130s (transaction request \textless 1s, network broadcast \textless 5s and transaction processing time as a time between submission and next mined block \textless 120 seconds).
2019-02-03 20:52:42 +01:00
This results in the transaction process that takes up to 130s (request =\textless 1s, broadcast =\textless 5s and max. time between blocks =\textless 120 seconds). The transaction process is shown in the Figure \ref{pict:network-processing}.
2018-09-29 00:11:09 +02:00
\begin{figure}[H]
\center
\definecolor{ao(english)}{rgb}{0.0, 0.5, 0.0}
\definecolor{azure(colorwheel)}{rgb}{0.0, 0.5, 1.0}
\definecolor{darkorange}{rgb}{1.0, 0.55, 0.0}
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=2.5cm, inner sep=0pt]
\tikzstyle{userA} = [rectangle, draw, fill=ao(english)!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{userB} = [rectangle, draw, fill=azure(colorwheel)!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{userC} = [rectangle, draw, fill=darkorange!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{lineuserA} = [draw, very thick, color=ao(english)!80, -latex']
\tikzstyle{lineuserB} = [draw, very thick, color=azure(colorwheel)!80, -latex']
\tikzstyle{lineuserC} = [draw, very thick, color=darkorange!80, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=2.5cm,
minimum height=2em]
\begin{tikzpicture}[scale=2, node distance = 2cm, auto]
\shorthandoff{-}
% Place nodes
\node [userA,text width=5cm,minimum width=5cm] (userA1) {\parbox{5cm}{\centering Transaction request generated by the client \texttt{transfer ADDRESS AMOUNT}}};
\node [userB, right of=userA1, node distance=6cm, text width=5cm,minimum width=5cm] (userB1) {\parbox{5cm}{\centering Request broadcast to network nodes, shown \texttt{show_transfers pool} }};
\node [below of=userA1,node distance=2.5cm,text width=5cm,minimum width=5cm, draw=none] (userA2){};
\node [userB, below of=userB1, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB2) {\parbox{5cm}{\centering Transaction is added to the block waiting to be mined.}};
\node [userC, below of=userA2,node distance=2.5cm,text width=5cm,minimum width=5cm] (userA3) {\parbox{5cm}{\centering Miners are verifying transactions in the pending block.}}; %, in cli called multisig wallet password
\node [userB, below of=userB2, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB3) {\parbox{5cm}{\centering Every 2 minutes new Monero block is mined and added to the blockchain.}}; %, in cli called multisig wallet password
\node [userC, below of=userA3,node distance=2.5cm,text width=5cm,minimum width=5cm] (userA4) {\parbox{5cm}{\centering Miners are rewarded by block reward.}};
\node [userB, below of=userB3, node distance=2.5cm,text width=5cm,minimum width=5cm] (userB4) {\parbox{5cm}{\centering Receiving party's wallet becomes aware of the transaction.}};
% \node [block, below of=init, node distance=2.5cm,text width=3cm,minimum width=3cm] (identify) {\parbox{3cm}{\centering Repackaging by reseller}};
% \node [block, below of=identify, node distance=2.5cm,text width=3cm,minimum width=3cm] (evaluate) {\parbox{3cm}{\centering HW wallet bought by enduser}};
% \node [cloud, left of=identify, node distance=5cm] (update) {\parbox{3cm}{\centering Malicious scratchpad with seed }};
% \node [block, below of=evaluate, node distance=2.5cm,text width=3cm,minimum width=3cm] (attacker) {\parbox{3cm}{\centering Attacker's database of wallets}};
% Draw edges
\path [lineuserC] (userA3) -- (userB3);
% \path [lineuserA] (userA2) -- (userA4);
\path [lineuserB] (userB1) -- (userB2);
\path [lineuserB] (userB2) -- (userB3);
\path [lineuserB] (userB3) -- (userB4);
\path [lineuserB] (userB3) to[in=14,out=210,looseness=0] (userA4);
\path [lineuserA] (userA1) to[in=-165,out=-15,looseness=0] (userB1);
\path [lineuserB] (userB1) to[in=15,out=165,looseness=0] (userA1);
% \path [line] (identify) -- (evaluate);
%\path [line] (expert) -- (init);
% \path [lineuserA] (userA2) |- (userB2);
\end{tikzpicture}
2019-01-27 15:47:19 +01:00
\caption{Monero network processing.}
2018-09-29 00:11:09 +02:00
\label{pict:network-processing}
\end{figure}
2018-09-29 17:40:26 +02:00
\newpage
\section{Mining nodes}
2019-02-03 20:52:42 +01:00
As was mentioned in the beginning of the Chapter \ref{cha:obtaining}, mining is the main reason for transaction processing in Monero network, and as the mining process has rewards for successfully solving the block, this encourages many different entities to mine.
2018-09-29 17:40:26 +02:00
Since Bitcoin started to gain popularity, mining has divided into five categories, that are described in the following sections:
\iffalse
\begin{itemize}\topsep0em\parskip0em\parsep0em
\begin{minipage}{0.4\linewidth}
\item Mining in pools
\item Solo mining
\item Web mining
\end{minipage}
\begin{minipage}{0.4\linewidth}
\item Botnet mining
\item Cloud mining
\end{minipage}
\end{itemize}
\fi
\subsubsection{Mining in pools}
Very often, miners combine their computational resources into one of the pools on the network. Due to the higher total hash rate, there is a greater chance of solving the block thus gaining the reward of newly emitted coins. After solving each block, the reward is distributed equally to miners connected to the pool according to PPS (per-per-share) or PPLNS (per-per-last-number-of-shares) system \cite{tarasiewicz2015cryptocurrencies}.
As of 29.09.2018 total hash rate of the network was 577.72 Mh/s (100\%), in known pools 530.79 Mh/s (91.88\%) and unknown part of the network 46.93 Mh/s (8.12\%). Unknown part represents either pools that are not listed or solo miners on the network.
2018-11-19 23:31:36 +01:00
2018-09-29 17:40:26 +02:00
\begin{figure}[H]
\begin{center}
\begin{tikzpicture}[]
\tikzstyle{every node}=[font=\footnotesize]
\pie []
{26.79/nanopool.org,
19.17/minexmr.com,
18.02/supportxmr.com,
5.69/miningpoolhub.com,
22.21/other pools,
8.12/unknown}
\end{tikzpicture}
\end{center}
2019-01-27 15:47:19 +01:00
\caption{Hash rate distribution in Monero network.}
2018-09-29 17:40:26 +02:00
\label{chart:range}
2018-09-29 00:11:09 +02:00
2018-09-29 17:40:26 +02:00
\end{figure}
\subsubsection{Solo mining}
Represents "all or nothing" approach when it comes to the rewarding system. As solo miner's hash rate has to compete against all other solo miners as well as big pools, the chance of solving the block is rather small \cite{cong2018decentralized}.
On the other side, when solo miner solves the block successfully, the whole block reward is assigned to the mining address. With high-end, multiple GPU setup, the miner can achieve about 3.2 Kh/s; this would mean chance about 0.46 \% of "winning" the block reward.
\subsubsection{Web mining}
2018-10-06 21:13:47 +02:00
CryptoNight algorithm mining stands out above others in the way how cryptocurrency can be mined. For Monero there are JavaScript-based miners like CoinHive available, that results in individual websites embedding this script and mining using the visitor's resources.
This can result up to 300 hashes per second for users with powerful CPUs and is a viable alternative to advertisements when visitors spend more than 10 minutes on the website \cite{papadopoulos2018truth}. Typical examples of this approach are warez websites offering free online movies and torrent trackers.
2018-07-03 10:44:26 +02:00
% Web mining: https://arxiv.org/pdf/1806.01994.pdf
2018-09-29 17:40:26 +02:00
\subsubsection{Botnet mining}
2018-10-06 21:13:47 +02:00
Using other peoples resources for mining, often also called crypto jacking (a more broad term for hidden cryptocurrency mining without users approval), have become increasingly popular in Monero. As the cryptocurrency provides anonymity features as well as a wide range of mining software that is available for every major platform.
In the current cloud era of computing, this represents vast problems for both service providers and their customers. Providers experience increased power consumption, cooling requirements, customers, on the other hand, are required to pay more for consumed system resources \cite{tahir2017mining}.
2018-09-29 17:40:26 +02:00
\subsubsection{Cloud mining}
2018-10-06 21:13:47 +02:00
\definecolor{ao(english)}{rgb}{0.0, 0.5, 0.0}
\definecolor{azure(colorwheel)}{rgb}{0.0, 0.5, 1.0}
\definecolor{darkorange}{rgb}{1.0, 0.55, 0.0}
2018-10-06 23:46:54 +02:00
Represents managed services by specialists that offer mining power using cloud service providers. Due to managed service providers (MSP) markup, this way of mining is not as profitable and not recommended among Monero community in general. \\Arrows indicate flow of the resources:\\ \textcolor{ao(english)} {Payment for service}; \textcolor{azure(colorwheel)}{Payment for compute time}; \textcolor{darkorange}{Delivered hashrate}
\begin{figure}[H]
\center
2018-10-06 21:13:47 +02:00
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=2.5cm, inner sep=0pt]
\tikzstyle{userA} = [rectangle, draw, fill=ao(english)!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{userB} = [rectangle, draw, fill=azure(colorwheel)!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{userC} = [rectangle, draw, fill=darkorange!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{lineuserA} = [draw, very thick, color=ao(english)!80, -latex']
\tikzstyle{lineuserB} = [draw, very thick, color=azure(colorwheel)!80, -latex']
\tikzstyle{lineuserC} = [draw, very thick, color=darkorange!80, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=2.5cm,
minimum height=2em]
\begin{tikzpicture}[scale=2, node distance = 0.4cm, auto]
\shorthandoff{-}
% Place nodes
\node [userA,text width=2cm,minimum width=2cm] (userA1) {\parbox{2cm}{\centering Hashrate buyer}};
\node [userB, right of=userA1, node distance=4cm, text width=2cm,minimum width=2cm] (userB1) {\parbox{2cm}{\centering MSP }};
\node [userC, right of=userB1, node distance=4cm, text width=2cm,minimum width=2cm] (userC1) {\parbox{2cm}{\centering Datacentre }};
% \node [block, below of=init, node distance=2.5cm,text width=3cm,minimum width=3cm] (identify) {\parbox{3cm}{\centering Repackaging by reseller}};
% \node [block, below of=identify, node distance=2.5cm,text width=3cm,minimum width=3cm] (evaluate) {\parbox{3cm}{\centering HW wallet bought by enduser}};
% \node [cloud, left of=identify, node distance=5cm] (update) {\parbox{3cm}{\centering Malicious scratchpad with seed }};
% \node [block, below of=evaluate, node distance=2.5cm,text width=3cm,minimum width=3cm] (attacker) {\parbox{3cm}{\centering Attacker's database of wallets}};
% Draw edges
\path [lineuserA] (userA1) -- (userB1);
%\path [lineuserB] (userB1) to[in=15,out=165,looseness=0] (userA1);
\path [lineuserB] (userB1) -- (userC1);
\path [lineuserC] (userC1) to[in=35,out=145,looseness=1] (userA1);
% \path [line] (identify) -- (evaluate);
%\path [line] (expert) -- (init);
% \path [lineuserA] (userA2) |- (userB2);
\end{tikzpicture}
2019-01-27 15:47:19 +01:00
\caption{Monero network processing.}
2018-10-06 21:13:47 +02:00
\label{pict:network-processing}
\end{figure}
2018-07-22 00:10:19 +02:00
\section{Mining software}
2018-10-06 23:46:54 +02:00
\subsubsection{Official}
Can be obtained at the official web of the Monero cryptocurrency project at https://getmonero.org/downloads/ . This is an official wallet software that includes solo mining client and cannot be used for pool mining.
\subsubsection{Community-driven}
2018-10-08 00:08:40 +02:00
Is a category that incorporates opensource mining software projects that have source code published on the Github. Mostly used are:
2018-10-06 23:46:54 +02:00
\begin{itemize}\itemsep0em
\item XMR Stak
2019-02-03 20:52:42 +01:00
\begin{itemize}\itemsep0em \item Consolidates CPU, AMD and Nvidia GPU mining under one multiplatform application with integrated webserver and autoconfiguration capability. \item URL: \url{https://github.com/fireice-uk/xmr-stak} \end{itemize}
2018-10-08 00:08:40 +02:00
\setlength\itemsep{1em}
2018-10-06 23:46:54 +02:00
\item XMRig
2018-10-08 00:08:40 +02:00
\setlength\itemsep{0em}
2018-10-06 23:46:54 +02:00
\begin{itemize}\itemsep0em \item Three separately released miners with autoconfiguration GPU and CPU capability. \item AMD: \url{https://github.com/xmrig/xmrig-amd}
\item Nvidia: \url{https://github.com/xmrig/xmrig-nvidia} \item CPU: \url{https://github.com/xmrig/xmrig} \end{itemize}
\item CCminer - Nvidia CUDA miner
2019-02-03 20:52:42 +01:00
\begin{itemize}\itemsep0em \item URL: \url{https://github.com/tpruvot/ccminer/} \end{itemize}
2018-10-06 23:46:54 +02:00
\end{itemize}
\begin{figure}[H]
\begin{center}
\vspace{-0.8em}
2018-10-08 00:08:40 +02:00
\includegraphics[trim={0 0 0 0},clip,width=0.85\textwidth]{Screenshot_9.png}
2019-01-27 15:47:19 +01:00
\caption{XMR-Stak web interface.}
2018-10-06 23:46:54 +02:00
\vspace{-1.5em}
\label{pic:withoutresdrawable}
\end{center}
\end{figure}
\subsubsection{Proprietary}
Having closed source code that community cant inspect, mining software of this category has less reputation compared to the community-driven. This is caused mainly by the fact that the exact produced hash rate and client reported hash rate differed in the past at least regarding the MinerGate miner available at \url{https://minergate.com/downloads/gui} .
\iffalse
2018-07-22 00:10:19 +02:00
\section{XMR obtaining comparison}
2018-09-29 17:40:26 +02:00
\begin{figure}[H]
\center
\begin{tabular}{p{0.2\linewidth}p{0.16\linewidth}p{0.16\linewidth}p{0.16\linewidth}p{0.16\linewidth}p{0.16\linewidth}}
\textbf{Mining type} & \textbf{Security} & \textbf{Depenence} & \textbf{Payout} & \textbf{Avaiability} & \textbf{Profitability} \\
Pool mining & & & & & \\
Solo mining & & & & & \\
Web mining & & & & & \\
Botnet mining & & & & & \\
Cloud mining & & & & &
\end{tabular}
2019-01-27 15:47:19 +01:00
\caption{Monero network processing.}
2018-09-29 17:40:26 +02:00
\label{pict:network-processing}
\end{figure}
2018-10-06 23:46:54 +02:00
\fi
2018-09-05 17:48:59 +02:00
\chapter{Monero miners research}
2018-09-28 12:49:20 +02:00
%tento výzkum jsem nenašel, takže říct, že tam nic dalšího není napsat to tam
%zobrazování voleb pro multiple choice randomizovat
% total hardware dát pryč a místo toho jen hashrate OK
%obtain software > official github OK
%2x mám incident OK
%pooly podle abecedy OK
%vypustit verzi windows OK
%other u linux os OK
%mining os dodat OK
% škola > dodá Vlasta info
% místo interested in modern technologies >> eearly adopter OK
% privacy aspect vygooglit části
2018-09-05 17:48:59 +02:00
The goal of this research is to gather information on people who run mining cryptocurrency software and map their behavior regarding system administration with the emphasis on security practices. For this purpose, an online questionnaire was created.
2018-10-06 21:13:47 +02:00
To the best of my knowledge, this is the first work that studies cryptocurrency miners. Specific research questions are based on cryptocurrency mining setup patterns, used software and problematic areas regarding computer and data security in general.
2018-09-05 17:48:59 +02:00
\section{Research questions}
The survey was designed around seven question groups, some of them were shown only if the participant chose the appropriate answer.
\begin{itemize}\itemsep0em
\item G01 - Introductory information
\item G02 - Mining setup
\item G03 - Mining software
\item G04 - Pool choice
\item G05 - Windows platform
\item G06 - Linux platform
\item G07 - Demographics
\end{itemize}
Following this pattern, five research questions were set:
\begin{itemize}\itemsep0em
\item R1: Who are Monero miners in general? What are their typical mining setups?
\item R2: Which types of software do participants use as operating systems, management, and mining tools?
\item R3: What security and update policies miners follow?
\item R4: Do miners suffer from security incidents like compromised mining operation? How do they deal with them?
\item R5: What are the factors that affect pool choice?
\end{itemize}
\section{Participants and survey's background}
2019-02-03 20:52:42 +01:00
As mentioned in the Chapter \ref{cha:monerouserresearch}, the survey was not hosted on third party servers, but instead on dedicated VPS running Lime Survey self-hosted software with HTTPS interface using signed Letsencrypt certificates.
2018-09-05 17:48:59 +02:00
2019-02-03 20:52:42 +01:00
This means that data exchanged between participants and survey software stays only between these two parties, so Google or other big data company cannot analyze them. To allow extended anonymity features, Tor and proxy connections were allowed, but each participant had to solve the CAPTCHA before starting the survey.
2018-09-05 17:48:59 +02:00
\subsection{Methodology}
Data collection method was online only and was using the survey website software. Participants selection was based on opportunity sampling, links for the research were shared among dedicated Reddit Monero community, Facebook Mining groups as well as Cryptocurrency forums. This form was distributed together with the Monero User Research survey in mentioned mining communities.
2018-12-02 15:22:35 +01:00
To reduce nonresponse rate, participants were asked only to fill out parts that were significant for them, e.g., Windows OS part stayed hidden in the form if the user selected that he/she used Linux OS only.
2018-09-05 17:48:59 +02:00
2018-12-02 15:22:35 +01:00
The complete survey is attached in chapter \ref{monero-miner-study-pdf}.
2018-07-22 00:10:19 +02:00
\section{Results international, CZ}
2018-06-29 16:38:17 +02:00
2019-01-27 15:47:19 +01:00
\iffalse
2018-09-05 17:48:59 +02:00
\chapter{Monero pool operators research}
The goal of this research is to gather information about people who run mining pools and are indirectly responsible for Monero transactions processing. The research aims to map mining pool administration consisting of coin management, attacks mitigation, and disaster recovery scenarios. For this purpose, an online questionnaire was created.
2018-10-06 21:13:47 +02:00
To the best of my knowledge, this is the first work that studies cryptocurrency pool operators. Specific research questions are based on available pool software, infrastructure services, hosting software and problematic areas regarding computer and data security in general.
2018-09-05 17:48:59 +02:00
\section{Research questions}
2018-09-28 12:49:20 +02:00
%antiDDOS!!!!! OK
%co znamena zaloha poolu rozepsat OK
2018-09-05 17:48:59 +02:00
The survey was designed around five question groups, some of them were shown only if the participant chose the appropriate answer.
\begin{itemize}\itemsep0em
\item G01 - Introductory information
\item G02 - Coin management
\item G03 - Defending against attackers
\item G04 - Backups and disaster recovery
\item G05 - Demographics
\end{itemize}
Following this pattern, four research questions were set:
\begin{itemize}\itemsep0em
\item R1: What technical infrastructure background is typical for pool operations?
\item R2: How do pool operators manage pool wallet and coins in general?
\item R3: Do pool operators use any attack mitigation services?
\item R4: What are backup solutions do pool operators use?
\end{itemize}
\section{Participants and survey's background}
2019-02-03 20:52:42 +01:00
As mentioned in the Chapter \ref{cha:monerousersurvey}, the survey was not hosted on third party servers, but instead on dedicated VPS running Lime Survey self-hosted software with HTTPS interface using signed Letsencrypt certificates.
2018-09-05 17:48:59 +02:00
2019-02-03 20:52:42 +01:00
This means that data exchanged between participants and survey software stays only between these two parties, so Google or other big data company cannot analyze them. To allow extended anonymity features, Tor and proxy connections were allowed, but each participant had to solve the CAPTCHA before starting the survey.
2018-09-05 17:48:59 +02:00
\subsection{Methodology}
Data collection method was online only and was using the survey website software. Participants selection was based on systematic sampling as links for the research were sent to the pool operators only.
2019-02-03 20:52:42 +01:00
The complete survey is attached in the Chapter \ref{monero-pool-study-pdf}.
2018-07-22 00:10:19 +02:00
\section{Results international, CZ}
2018-06-29 16:38:17 +02:00
2019-01-27 15:47:19 +01:00
\fi
2018-06-29 16:38:17 +02:00
\chapter{Mining malware}
2019-01-27 15:47:19 +01:00
\section{Monero position in malware world}
\section{Types of malware miners}
\section{Unwanted mining in SOHO envionment}
\section{Unwanted mining in large scale}
%\subsection{Systems administrators perspective}
2018-07-04 16:04:00 +02:00
%kitty https://www.incapsula.com/blog/crypto-me0wing-attacks-kitty-cashes-in-on-monero.html
2019-01-27 15:47:19 +01:00
%\subsection{Regular users}
2018-06-29 16:38:17 +02:00
2018-07-22 00:10:19 +02:00
\chapter{Designing secure mining environment}
2018-12-02 13:58:52 +01:00
\section{Automation}
2019-02-03 20:52:42 +01:00
Automation is a key aspect for designing and running IT operations that are secure, up-to-date, scalable and easy to maintain. To do that, proposed mining node provisioning scheme is divided into two parts, first being OS installation with early configuration and second is automated configuration of provisioned nodes using Ansible. Workflow is described in the Figure \ref{pict:deployment-workflow}.
2018-12-02 13:58:52 +01:00
\begin{figure}[H]
\center
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=2.5cm, inner sep=0pt]
\tikzstyle{userA} = [rectangle, draw, fill=ao(english)!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{userB} = [rectangle, draw, fill=azure(colorwheel)!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{userC} = [rectangle, draw, fill=darkorange!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{lineuserA} = [draw, very thick, color=ao(english)!80, -latex']
\tikzstyle{lineuserB} = [draw, very thick, color=azure(colorwheel)!80, -latex']
\tikzstyle{lineuserC} = [draw, very thick, color=darkorange!80, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=2.5cm,
minimum height=2em]
\begin{tikzpicture}[scale=2, node distance = 0.4cm, auto]
\shorthandoff{-}
% Place nodes
\node [userA,text width=3cm,minimum width=3cm] (userA1) {\parbox{3cm}{\centering Automated OS installation by \texttt{kickstart or unattend} files.}};
\node [userB, right of=userA1, node distance=4cm, text width=2.5cm,minimum width=2.5cm] (userB1) {\parbox{2.5cm}{\centering Software provisioning using Ansible. }};
\node [userC, right of=userB1, node distance=4cm, text width=2.5cm,minimum width=2.5cm] (userC1) {\parbox{2.5cm}{\centering Periodic updates using Ansible. }};
% \node [block, below of=init, node distance=2.5cm,text width=3cm,minimum width=3cm] (identify) {\parbox{3cm}{\centering Repackaging by reseller}};
% \node [block, below of=identify, node distance=2.5cm,text width=3cm,minimum width=3cm] (evaluate) {\parbox{3cm}{\centering HW wallet bought by enduser}};
% \node [cloud, left of=identify, node distance=5cm] (update) {\parbox{3cm}{\centering Malicious scratchpad with seed }};
% \node [block, below of=evaluate, node distance=2.5cm,text width=3cm,minimum width=3cm] (attacker) {\parbox{3cm}{\centering Attacker's database of wallets}};
% Draw edges
\path [lineuserA] (userA1) -- (userB1);
%\path [lineuserB] (userB1) to[in=15,out=165,looseness=0] (userA1);
\path [lineuserB] (userB1) -- (userC1);
\path [lineuserC] (userC1) to[in=35,out=145,looseness=1.8] (userC1);
% \path [line] (identify) -- (evaluate);
%\path [line] (expert) -- (init);
% \path [lineuserA] (userA2) |- (userB2);
\end{tikzpicture}
\caption{Deployment nodes workflow.}
\label{pict:deployment-workflow}
\end{figure}
\section{Ansible introduction}
2018-12-03 23:44:14 +01:00
\textbf{Ansible} is an IT automation engine that in this case is used for configuration and application management of local mining nodes \cite{hochstein2017ansible}.
2018-12-02 13:58:52 +01:00
\\
2018-12-02 15:22:35 +01:00
\textbf{Playbook} is a YAML formatted file that provides the declaration of hosts and plays that are executed when running the playbook.
2018-12-02 13:58:52 +01:00
\\
2018-12-02 15:22:35 +01:00
\textbf{Hosts} file declares connection information about hosts, e.g., IP and login credentials.
2018-12-02 13:58:52 +01:00
\\
2018-12-02 15:22:35 +01:00
\texttt{\textbf{ansible-playbook -i hosts xmr01.yml}} is a CLI command that executes \texttt{xmr01.yml} playbook file and takes connection information about hosts and groups involved from the \texttt{hosts} file.
2018-12-02 13:58:52 +01:00
\newpage
2018-07-22 00:10:19 +02:00
\section{Linux-based solution}
2018-11-24 09:54:23 +01:00
\subsection{Kickstart installation media}
2018-12-02 15:22:35 +01:00
To easily scale the mining operation, every bit of the software provisioning has to be automated. This part describes a process of creating automated Centos 7 or RHEL 7 installation media with minimal package installation without GUI.
2018-11-24 09:54:23 +01:00
2018-12-02 15:22:35 +01:00
The first step is to obtain installation media at \url{https://www.centos.org/download/}. After downloading the Minimal ISO version, extract the iso file into a separate folder. From there navigate to the \texttt{isolinux} folder and edit \texttt{isolinux.cfg} configuration file.
2018-11-26 18:30:47 +01:00
2018-12-02 15:22:35 +01:00
For reference, \texttt{CentOS-7-x86_64-Minimal-1804.iso} was used in the following steps.
2018-11-24 09:54:23 +01:00
\subsubsection{Isolinux.cfg file}
Four changes are needed to get the installation process working:
\begin{itemize}
\itemsep0em
2018-12-02 15:22:35 +01:00
\item \texttt{timeout} property changed from 600 to 50 (seconds * 10)
2018-11-24 09:54:23 +01:00
\item Change boot menu to go straight for the install
\item Edit paths for custom ISO image
\item Add kickstart file entry
\end{itemize}
\begin{figure}[H]
\begin{center}
\begin{lstlisting}
<@\textcolor{blue}{timeout 50}@>
# only relevant part of the file is displayed
label linux
menu label ^Install CentOS 7
<@\textcolor{blue}{menu default}@>
kernel vmlinuz
append initrd=initrd.img <@\textcolor{blue}{inst.ks=hd:LABEL=CENTOS:/ks/ks.cfg inst.stage2=hd:LABEL=CENTOS}@> quiet
\end{lstlisting}
2019-01-27 15:47:19 +01:00
\caption{Customised installator entry.}
2018-11-24 09:54:23 +01:00
\label{pic:codeinjectiongui}
\end{center}
\end{figure}
\subsection{Kickstart file}
2018-12-03 23:44:14 +01:00
The kickstart file is a single file that contains all OS installation parameters for RHEL based operating systems \cite{van2015red}. This installation method enables automated provisioning of machines without the need of administrator input. When the file is presented to the installer, it reads the required parameters resulting in the unattended installation process \cite{leemans2015red}.
2018-11-24 09:54:23 +01:00
2019-02-03 20:52:42 +01:00
Created kickstart file for Centos 7 mining installation media is available in the Figure \ref{fig:kickstart}.
2018-11-24 09:54:23 +01:00
\subsection{Generating ISO}
2018-12-02 15:22:35 +01:00
The specific process of packaging extracted CentOS installation media back into the iso file varies by used operating system. In both mentioned scenarios, few specific parameters have to be set:
2018-11-24 09:54:23 +01:00
\begin{itemize}
\itemsep0em
\item Boot image file \texttt{/isolinux/isolinux.bin}
\item Updated boot information table
2018-12-02 15:22:35 +01:00
\item Volume label for ISO9660 and UDF set to \texttt{CENTOS} (depends on the configuration that is set in the \texttt{isolinux.cfg} file).
2018-11-24 09:54:23 +01:00
\end{itemize}
\subsubsection{Windows}
2018-12-02 15:22:35 +01:00
For creating iso image on Windows, opensource ImgBurn software was used.
2018-11-24 09:54:23 +01:00
2018-11-26 18:30:47 +01:00
%\iffalse
2018-11-24 09:54:23 +01:00
\begin{figure}[H]
2018-11-26 18:30:47 +01:00
\begin{subfigure}{.5\textwidth}
%\includegraphics[trim=left bottom right top, clip]{file}
2018-11-24 09:54:23 +01:00
\begin{center}
2018-11-26 18:30:47 +01:00
\includegraphics[trim={9.1cm 3cm 0.4cm 3cm},clip,width=.8\textwidth]{Screenshot_16.png}
\caption{Volume label.}
2018-11-24 09:54:23 +01:00
\label{pic:withoutresdrawable}
2018-11-26 18:30:47 +01:00
\label{fig:sub1}\end{center}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
2018-11-24 09:54:23 +01:00
\begin{center}
2018-11-26 18:30:47 +01:00
\includegraphics[trim={9.1cm 3cm 0.4cm 3cm},clip,width=.8\textwidth]{Screenshot_17.png}
\caption{Boot image selection.}
2018-11-24 09:54:23 +01:00
\end{center}
2018-11-26 18:30:47 +01:00
\end{subfigure}
\label{fig:test}\caption{Ansible playbook and roles.}
\end{figure}
2018-11-24 09:54:23 +01:00
\subsubsection{Linux}
2018-12-02 15:22:35 +01:00
Once files are prepared, packaging into the iso at Linux is done by one-liner command:
2018-11-24 09:54:23 +01:00
\begin{figure}[H]
\begin{center}
\begin{lstlisting}
mkisofs -o centos7.iso -b isolinux.bin -c boot.cat -no-emul-boot -V 'CENTOS' -boot-load-size 4 -boot-info-table -R -J -v -T isolinux/
\end{lstlisting}
\caption{ISO packaging under Linux.}
\label{pic:codeinjectiongui}
\end{center}
\end{figure}
2018-11-26 18:30:47 +01:00
%Installation to the target mining machine from this media can be done using optical media, USB drive that has the ISO unpackaged (e.g. using Rufus available from \url{rufus.ie}) or PXE boot (e.g. using open source network boot firmware iPXE available from \url{ipxe.org}).
\subsection{Setting up OS using Ansible}
2018-12-02 13:58:52 +01:00
%Ansible is an IT automation engine that in this case is used for configuration and application management of local mining nodes.
2018-12-03 23:44:14 +01:00
After installation from the ISO that was prepared with the kickstart file, the target machine is accepting SSH connections under root account using password-based authentification. Without proper configuration, this would leave machine open to brute force attempts for the root account.
2018-11-26 18:30:47 +01:00
2018-12-03 23:44:14 +01:00
To provision mining nodes with software and configuration, Ansible uses following set of files:
2018-11-26 18:30:47 +01:00
\begin{figure}[H]
%\begin{subfigure}{.5\textwidth}
\dirtree{%
.1 /.
.2 xmr01.yml.
.2 hosts.
.2 ansible.cfg.
.2 roles/.
.3 ansible-sw-common-apps.
.3 ansible-sw-firewalld.
.3 ansible-sw-ntp.
.3 ansible-sw-postfix.
.3 ansible-sw-sshsec.
.3 ansible-sw-xmrstak.
.3 ansible-sys-hostname.
.3 ansible-user-add.
.3 ansible-yum-cron.
.3 ansible-yum-update.
}
\label{fig:sub1}
\caption{Ansible prepared roles.}
\end{figure}
%\begin{subfigure}{.5\textwidth}
2018-11-27 00:38:14 +01:00
\begin{itemize}
\itemsep0em
2018-12-02 15:22:35 +01:00
\item \texttt{Xmr01.yml} represents a playbook file that defines what group of nodes will be provisioned together with the list of roles that will be applied to them. \\
2018-11-27 00:38:14 +01:00
\texttt{Hosts} file contains groups of hosts with information how Ansible can connect to them.
2018-12-02 15:22:35 +01:00
\item \texttt{Ansible.cfg} was used only in the testing environment where host key checking was disabled.
2018-11-27 00:38:14 +01:00
\item \texttt{Roles} folder contains roles that are applied when running the playbook.
\end{itemize}
2018-11-26 18:30:47 +01:00
2018-11-27 00:38:14 +01:00
\subsection{Ansible roles}
2018-12-03 23:44:14 +01:00
To make Linux mining nodes updated and secure, following roles were written:
2018-11-27 00:38:14 +01:00
\subsubsection{ansible-sw-common-apps}
2018-12-02 15:22:35 +01:00
The common baseline for all mining nodes that consists of the following tasks:
2018-11-27 00:38:14 +01:00
\begin{enumerate}
\itemsep0em
\item Ensure EPEL repo is configured or install it.
\item Install following packages: \texttt{htop, rsync, screen, tmux, iftop, iotop, nano, git, wget, unzip, mc}.
\end{enumerate}
\subsubsection{ansible-sw-firewalld}
2018-12-02 15:22:35 +01:00
Installs and enables firewalld service that has default policy for connections set to \texttt{public network} and accepts incoming connections only for SSH service.
2018-11-27 00:38:14 +01:00
\subsubsection{ansible-sw-ntp}
2018-12-02 15:22:35 +01:00
To report correct information through the web interface of the mining software, the target machine has to be in sync with NTP servers to do that role establishes the following:
2018-11-27 00:38:14 +01:00
\begin{enumerate}
\itemsep0em
2018-12-02 15:22:35 +01:00
\item Package \texttt{ntpdate} installed from the CentOS repository.
2018-11-27 00:38:14 +01:00
\item Ensures correct timezone using \texttt{timedatectl} interface.
2018-12-02 15:22:35 +01:00
\item Creates daily cronjob for synchronization of system time.
2018-11-27 00:38:14 +01:00
\end{enumerate}
\subsubsection{ansible-sw-postfix}
2018-12-02 15:22:35 +01:00
Sets up email gateway for correct email delivery together with internal mail aliases mapped to a single outbound address. Email gateway can deliver email on its own to the recipient's server or can also act as a relay to Gmail account that is used for sending out emails.
2018-11-27 00:38:14 +01:00
2019-02-03 20:52:42 +01:00
Using Gmail account is preferred as this solution is an Internet Service Provider (ISP) agnostic (blocked SMTP and SSMTP communication for outbound connections at the ISP level would be a problem for the gateway mode).
2018-12-02 13:58:52 +01:00
2018-12-03 23:44:14 +01:00
Separate Gmail account for sending out email alerts is recommended as Postfix has login credentials saved in \texttt{/etc/postfix/sasl_passwd} file in plaintext \cite{van2015red}. This can be made more secure if the credentials file has appropriate permissions, e.g., ownership set to root, the group to wheel and chmod changed to 0600.
2018-12-02 13:58:52 +01:00
\subsubsection{ansible-sw-sshsec}
2018-12-02 15:22:35 +01:00
Takes care about incoming SSH connections in case somebody wants to try brute force attack on the mining machine. After a predefined amount of failed login attempts, incoming IP address is put into "jail".
2018-12-02 13:58:52 +01:00
2018-12-02 15:22:35 +01:00
Under the hood, fail2ban monitors sshd log for incoming failed attempts and after certain threshold creates a firewalld rule to block the IP for a predefined amount of time. The default setting for this rule is relatively strict, 3 failed attempts in 10-hour window result in a 10-hour ban for incoming connections from the IP address.
2018-12-02 13:58:52 +01:00
2018-12-02 15:22:35 +01:00
This role is a fork of \texttt{ansible-role-fail2ban} that is available at \url{https://github.com/resmo/ansible-role-fail2ban}.
2018-12-02 13:58:52 +01:00
%TODO prolézt všechny role a zkontrolovat default vars
\subsubsection{ansible-sw-xmrstak}
Installs software collections \texttt{centos-release-scl} package for Centos together with \texttt{cmake3, devtoolset-4-gcc*, hwloc-devel, make, \newline libmicrohttpd-devel, openssl-devel} packages used for compiling XMR-Stak from source code.
2018-12-03 23:44:14 +01:00
After that, folder structure inside non-privileged user account is created, and XMR-Stak repo is cloned into the user directory. With appropriate permissions set, cmake compiles the source code with following flags \texttt{cmake3 .. -DCPU_ENABLE=ON -DCUDA_ENABLE=OFF -DOpen\newline CL_ENABLE=OFF} resulting in CPU only miner for Centos \cite{xmrstakcompile}.
2018-12-02 13:58:52 +01:00
2018-12-02 15:22:35 +01:00
If the mining node would use GPU, appropriate drivers from AMD or Nvidia website are a prior requirement for running the miner. As GPU feature is only a flag, it can be enabled on demand in the playbook file as cmake3 flags are set as variables in the tasks file of the \texttt{ansible-sw-xmrstak} role in the Jinja2 format: \\ \texttt{cmake3 .. -DCPU_ENABLE=\{\{ DCPU_ENABLE \}\} -DCUDA_ENABLE=\{\{ \newline DCUDA_ENABLE \}\} -DOpenCL_ENABLE=\{\{ DOpenCL_ENABLE \}\}}
2018-12-02 13:58:52 +01:00
2018-12-02 15:22:35 +01:00
As next step, role copies over to the node cpu, pool and miner configuration and creates a crontab entry for automatic miner start. For the final touch, HugePages are set to \texttt{vm.nr_hugepages=128} in \texttt{/etc/sysctl.conf} for CPU mining memory allocation, and sysctl is reloaded.
2018-12-02 13:58:52 +01:00
\subsubsection{ansible-sys-hostname}
Changes system hostname to inventory hostname set in \texttt{hosts} file using \texttt{hostnamectl} Ansible module.
\subsubsection{ansible-user-add}
2018-12-02 15:22:35 +01:00
\texttt{User-add-role} is used for creating the mining user that is not within wheel group (unpriviledged user).
2018-12-02 13:58:52 +01:00
\subsubsection{ansible-yum-cron}
2018-12-03 23:44:14 +01:00
Installs and configures automatic security updates for Centos that are daily checked against the online repository. If packages marked for security update are found, email notification to root is sent \cite{pelz2016centos}.
2018-12-02 13:58:52 +01:00
\subsubsection{ansible-yum-update}
All packages including kernel are updated so that mining node is ready to use and won't send update notification on the next day (unless there are new updates in the meantime).
\subsubsection{Additional notes}
2018-12-02 15:22:35 +01:00
Roles are installed in the order specified in the \texttt{xmr01.yml} file as system update is done as first to prevent any problems with XMR-Stak compilation.
2018-12-02 13:58:52 +01:00
2018-12-02 15:22:35 +01:00
Using root account login on SSH is not recommended as the proper way would be to disable root login in \texttt{/etc/sshd_config} and login to SSH using created non-privileged user account (ideally using ssh-key based authentification).
2018-12-02 13:58:52 +01:00
2018-12-02 15:22:35 +01:00
Later if the user needs to login as user, this can be done by \texttt{su root} command. To minimize the chance of success brute force attack of the root account using SSH, fail2ban is set to strict mode. Although this is not the most secure way to access the system, with above settings this acts as a middle ground between security and usability of the mining operation.
2018-12-02 13:58:52 +01:00
%Ansible, Centos 7
2018-07-22 00:10:19 +02:00
\section{Windows-based solution}
2018-11-26 18:30:47 +01:00
\subsection{Installation media}
2018-12-02 13:58:52 +01:00
For Windows scenario, Win10 image from autumn 2018 was used. As installation is intended to run unattended, custom media has to be created.
2018-12-02 15:22:35 +01:00
There are many ways how to provision changes to original Windows media, most straightforward is generating an \texttt{autounattend.xml} file that covers all installation steps for Windows 10 installer.
2018-12-02 13:58:52 +01:00
2018-12-03 23:44:14 +01:00
This process of Windows image customization can be done using Windows Assessment and Deployment Kit (Windows ADK) as it includes Windows System Image Manager (Windows SIM) that is an authoring tool for \texttt{autounattend.xml} files. Using Windows ADK, more complex Windows deployment can be achieved as the administrator can bundle applications and drivers in the image \cite{rhodes2016introduction}.
2018-12-02 13:58:52 +01:00
2018-12-03 23:44:14 +01:00
For this guide, generating \texttt{autounattend.xml} file is based on online autounattend generator tool located at \url{windowsafg.com}. After generating the file, a block of commands that is executed after the first logon, was added.
2018-12-02 13:58:52 +01:00
\begin{figure}[H]
\begin{center}
\begin{lstlisting}
<SynchronousCommand wcm:action="add">
<CommandLine>powershell -Command "Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\ .NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord"</CommandLine>
<Description>Set PowerShell ExecutionPolicy</Description>
<Order>42</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
\end{lstlisting}
\caption{More than 20 commands are executed after first logon to prepare the environment.}
\label{fig:securecrypto}
\end{center}
\end{figure}
2019-02-03 20:52:42 +01:00
For example, .NetFramework in Windows 10 doesn't have strong cryptography enabled for all .Net applications. Due to this, in the default state, Powershell can't be used for downloading updated code that is required for setting up the environment for Ansible. To fix that, one of the commands after the first logon is dedicated to this issue as shown in the Figure \ref{fig:securecrypto}.
2018-12-02 13:58:52 +01:00
After finishing the installation process and provisioning the Windows environment with \texttt{<FirstLogonCommands>} included in the unattended file, Ansible can connect to the Windows machine and set up thing properly.
2018-12-02 15:22:35 +01:00
Note that installer opens RDP, WinRM, temporarily disables Windows Firewall (which will be properly configured by Ansible later) and sets up self-signed WinRM HTTPS certificate using Ansible Powershell file \texttt{ConfigureRemotingForAnsible.ps1} \cite{ansibleremoteps}. Mining node has to be connected to the network to download all required files properly.
2018-12-02 13:58:52 +01:00
\subsection{Ansible at Windows}
2018-12-03 23:44:14 +01:00
Before applying roles in Ansible for Windows, unlike in Ansible with Linux machines, environment for both Windows and Linux controller has to be prepared \cite{windowsansible}.
2018-12-02 13:58:52 +01:00
2018-12-02 15:22:35 +01:00
\textbf{Windows} needs to have WinRM setup, this is already done as it was part of the installation process where Ansible Powershell script set up HTTPS WinRM environment \cite{windowshostansible}.
2018-12-02 13:58:52 +01:00
2018-12-02 15:22:35 +01:00
\textbf{Linux} doesn't have Ansible modules for Windows in default Ansible install. Those can be install using the package manager, e.g.:
2018-12-02 13:58:52 +01:00
\vspace{-0.7em}
\begin{itemize}
\itemsep0em
\item Ubuntu:
\begin{itemize}
\itemsep0em \vspace{-0.7em}
\item Python 2: apt-get install python-winrm
\item Python 3: apt-get install python3-winrm
\end{itemize}
\item Centos:
\begin{itemize}
\itemsep0em \vspace{-0.7em}
\item With EPEL enabled: yum install python2-winrm
\end{itemize}
\item Or using PIP:
\begin{itemize}
\itemsep0em \vspace{-0.7em}
\item pip install pywinrm
\end{itemize}
\end{itemize}
\subsection{Ansible roles}
Once Ansible is ready to launch \texttt{xmratwin.yml} playbook, following roles are played:
\begin{figure}[H]
%\begin{subfigure}{.5\textwidth}
\dirtree{%
.1 /.
.2 xmratwin.yml.
.2 hosts.
.2 ansible.cfg.
.2 roles/.
.3 ansible-win-sec.
.3 ansible-win-updates.
.3 ansible-win-xmrstak.
}
\label{fig:sub1}
\caption{Ansible roles for Windows.}
\end{figure}
\subsubsection{ansible-win-sec}
Sets up firewall rules for RDP, WinRM and XMR-Stak web interface, enables Windows firewall for all zones.
\subsubsection{ansible-win-updates}
Windows update policy is set to download and notify for install as Windows updates are managed by this Ansible role.
2018-12-03 23:44:14 +01:00
The administrator can configure which updates category will be included in the updates, in default role install updates from \texttt{SecurityUpdates} and \texttt{CriticalUpdates} category \cite{windowshostansible}. This can be changed using variable \texttt{UpdateEverything} in the playbook.
2018-12-02 13:58:52 +01:00
\subsubsection{ansible-win-xmrstak}
2018-12-02 15:22:35 +01:00
Downloads latest release of XMR-Stak from developers GitHub page, configures mining software and downloads required libraries from Microsoft site. It also creates scheduled task under mining user to run with elevated permissions after logon so that UAC can be kept enabled and the miner is running without UAC prompts.
2018-12-02 13:58:52 +01:00
2018-12-02 15:22:35 +01:00
Also adds the exception in Windows Defender to ignore Desktop folder as a binary XMR-Stak file is considered as a malicious file for being a mining software.
2018-11-26 18:30:47 +01:00
2018-06-29 16:38:17 +02:00
2018-07-22 00:10:19 +02:00
\chapter{Plan}
2018-06-29 23:26:35 +02:00
\begin{figure}[H]
\center
\begin{tabular}{ll}
2018-07-22 00:10:19 +02:00
Month & Task \\
1.7.2018 & Monero cryptocurrency; Monero Usage \\
1.8.2018 & Research design \\
1.9.2018 & Data collection; Monero mining and running the network \\
1.10.2018 & Data summary \\
1.11.2018 & Best practices for usage and storage \\
1.12.2018 & Mining malware; Secure mining system design \\
1.1.2019 & Cryptocore.cz web \\
1.2.2019 & Spare time \\
1.3.2019 & Month for completion \\
1.4.2019 & Final version + print
2018-06-29 23:26:35 +02:00
\end{tabular}
2019-01-27 15:47:19 +01:00
\caption{Diploma thesis plan.}
2018-06-29 23:26:35 +02:00
\label{ssme-thesis-plan}
\end{figure}
2018-06-29 16:38:17 +02:00
\printbibliography[heading=bibintoc]
2018-09-05 17:48:59 +02:00
\appendix
\includepdf[pages=1,pagecommand=\chapter{Monero User Survey},scale=0.7]{monerousersurvey.pdf}
\label{monero-user-study-pdf}
\includepdf[pages={2,3,4,5,6,7,8,9},scale=0.7, pagecommand={}]{monerousersurvey.pdf}
\includepdf[pages=1,pagecommand=\chapter{Monero Miners Survey},scale=0.7]{monerominersurvey.pdf}
\label{monero-miners-study-pdf}
\includepdf[pages={2,3,4,5,6,7,8,9,10},scale=0.7, pagecommand={}]{monerominersurvey.pdf}
2018-12-03 23:44:14 +01:00
%\includepdf[pages=1,pagecommand=\chapter{Monero User Survey},scale=0.7]{moneropoolsurvey.pdf}
%\label{monero-pool-study-pdf}
%\includepdf[pages={2,3,4,5},scale=0.7, pagecommand={}]{moneropoolsurvey.pdf}
2018-11-24 09:54:23 +01:00
\section{Kickstart file}
\label{kickstart}
\begin{lstlisting}
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use network installation
url --url="http://ftp.fi.muni.cz/pub/linux/centos/7/os/x86_64/"
repo --name="base" --baseurl=http://ftp.fi.muni.cz/pub/linux/centos/7/os/x86_64/
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=dhcp --device=ens192 --ipv6=auto --activate
network --bootproto=dhcp --hostname=changeme.lipovcan.cz
# Reboot after installation
reboot
# Root password
rootpw --iscrypted $6$jtf4WZQD/5Ozocag$5UcoItitnW58zDBA3k.itRf7ozUA391
# System services
services --enabled="chronyd"
# System timezone
timezone Europe/Prague --isUtc --ntpservers=tik.cesnet.cz
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
autopart --type=lvm
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
%packages
@^minimal
@core
chrony
kexec-tools
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=50 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=50 --notstrict --nochanges --notempty
pwpolicy luks --minlen=6 --minquality=50 --notstrict --nochanges --notempty
%end
\end{lstlisting}
\begin{figure}[H]
\center
2019-01-27 15:47:19 +01:00
\caption{Centos 7 kickstart file.}
2018-11-24 09:54:23 +01:00
\label{fig:kickstart}
\end{figure}
2018-09-05 17:48:59 +02:00
%% Start the appendices.
2018-07-10 23:21:47 +02:00
%\chapter{Zdroje k tabulce 2.2}
%dash https://bitcointalk.org/index.php?topic=1562109.0
%dash https://docs.dash.org/en/latest/introduction/information.html
2018-07-12 08:56:33 +02:00
%pivx https://github.com/PIVX-Project/PIVX
%pivx https://www.reddit.com/r/pivx/comments/7gjjyw/what_are_the_benefits_of_multisig_addresses/
%zcoin https://github.com/zcoinofficial/zcoin/wiki/Information-for-exchanges
%zcoin https://zcoin.io/zcoins-privacy-technology-compares-competition/
2018-06-27 21:49:31 +02:00
\end{document}