\documentclass{beamer}

\usepackage[utf8x]{inputenc}

\usepackage{amsmath}
\usepackage{amssymb} % math symbols
\usepackage{geometry}
\usetheme{Darmstadt}
\usecolortheme{lily}
\setbeamertemplate{navigation symbols}{}
\usepackage{anyfontsize}
\usepackage{verbatim}

\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\C}{\mathbb{C}}

\author{Axel Angel}
\title{Bitcoin}
\subtitle{GNU Generation}
\institute{EPFL}
\date{April 2013}
\subject{bitcoin presentation}

\begin{document}
\maketitle

\begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[hideallsubsections]
\end{frame}

\section{Introduction}
\subsection{What is bitcoin?}
\begin{frame}
      {\fontsize{80}{80}\selectfont Bitcoin} is a {\it digital} {\large P2P} {\bf decentralized} {\small chaotic} {\fontsize{6}{6}\selectfont maybe-illegal} {\Large free-as-in-free-software} {\it cyberpunk} {\large \bf hype} cool rebel {\rm next-gen} \tiny{bubble}\footnote{ {\tiny but don't told anyone}} {\large EXPERIMENTAL} alternative {\Large \it volatile} underground {\scriptsize anonymous} cryptographic {\scriptsize potential} {\huge currency}
\end{frame}

\subsection{Why was it created?}
\begin{frame}
Bitcoin was created for a money without intermediates. Third parties:
\begin{itemize}
    \item Cost
    \item Have trust problems
    \item Can revert transactions (e.g.: non-reversible services)
    \item Single-point of failure
\end{itemize}
\end{frame}

\subsection{Subjects}
\begin{frame}
Bitcoin is:
\begin{itemize}
    \item Decentralized (double spending)
    \item Cryptographic (SHA, ECDSA)
    \item Emerging (speculation)
    \item Open-source (and free)
\end{itemize}

    \begin{figure}[h]
        \begin{center}
            \includegraphics[width=0.15\textwidth]{bitcoin_logo.png}
        \end{center}
        \caption{Bitcoin logo}
    \end{figure}
\end{frame}

\subsection{Overview}
\begin{frame}
Overview:
\begin{itemize}
    \item Avoid double-spending, all transactions are publicly announced.
    \item Majority of nodes witness transactions order
    \item Block of chains
\end{itemize}
Issuing:
First transaction of mined block is self-reward. \\
$\Rightarrow$ Incentive to play by rules
\end{frame}

\section{Details}
\subsection{Proof-of-work}
\begin{frame}
Proof-of-work:
\begin{itemize}
    \item SHA-256
    \item Target with adaptive difficulty (moving average)
    \item Block: (prev block hash, nonce, [ Tx, … ])
\end{itemize}
  cannot be changed unless redoing work

\begin{figure}[h]
    \begin{center}
        \includegraphics[width=0.75\textwidth]{block_chain.png}
    \end{center}
    \caption{Blocks chain}
\end{figure}
\end{frame}

\subsection{Network}
\begin{frame}
Network:
\begin{enumerate}[(1)]
    \item Transactions broadcast
    \item Nodes collect them into block
    \item Nodes mine
    \item When new block, broadcast
    \item Nodes check validity and mine next block if OK
\end{enumerate}
\end{frame}

\subsection{Merkle Tree}
\begin{frame}
Merkle Tree:
Transactions in a Merkle Tree allows:
\begin{itemize}
    \item Partial verification
    \item Keep only block header
\end{itemize}
\begin{figure}[h]
    \begin{center}
        \includegraphics[width=0.75\textwidth]{merkle_tree.png}
    \end{center}
    \caption{Merkle tree of a block}
\end{figure}

\end{frame}

\subsection{Transactions and privacy}
\begin{frame}
Transactions and privacy:
\begin{itemize}
    \item Transaction is [ in ], [ out ] and in/out amount
    \item Privacy not main goal (public, multi-inputs)
    \item Can be anonymous
\end{itemize}
\end{frame}

\subsection{Script in transactions}
\begin{frame}[fragile]
Script in transactions:
Stack-based and simple language describe how owner can spend.
Words: true/false, if/else, arithmetic, strings, crypto
General case:
\begin{itemize}
    \item Public key of destination + signature with this key
\end{itemize}
Other cases:
\begin{itemize}
    \item Multi-signature ($n$ among $m$)
    \item Can add messages (OP\_DROP)
    \item Bounty for hard problems/puzzles?
\end{itemize}

\begin{verbatim}
scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash>
              OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <sig> <pubKey>
\end{verbatim}
\end{frame}

\subsection{Mining Technology}
\begin{frame}
Mining:
\begin{tabular}[]{c||c|c|c|c}
    Technology & Period & Speed & Example & Watts \\ \hline
CPU   & 2009-2010  & 52   Mhash/s  & Xeon   x5690    & 170W  \\ \hline
GPU   & 2010-2011  & 825  Mhash/s  & ATI    7970     & 214W  \\ \hline
FPGA  & 2011-2012  & 860  Mhash/s  & ZTEX            & 50W   \\ \hline
ASIC  & 2013+      & 10   Ghash/s  & Block  Erupter  & 83W   \\ \hline
\end{tabular}
Current mining speed: 69'570 Ghash/s (883 Peta-FLOPS)
\end{frame}

\subsection{Mining details}
\begin{frame}
Mining details:
Like a lottery. The SHA hash of block must be lower than the 256-bit target string (increment nonce): first to find wins. Probability to win per attempt: $2.59 \times 10^{-17}$.
\end{frame}

\section{Outro}
\subsection{Graphs}
\begin{frame}
Because we love graphs
\begin{tabular}[]{c|c}
    \includegraphics[width=0.5\textwidth]{bitcoin_1year_small.png}
    &
    \includegraphics[width=0.5\textwidth]{bitcoin_mining.png}
    \\
    \includegraphics[width=0.5\textwidth]{bitcoin_transactions.png}
    &
    \includegraphics[width=0.5\textwidth]{bitcoin_volume.png}
    \\
\end{tabular}
\end{frame}

\subsection{Conclusion}
\begin{frame}{}
    \tiny{Do a useless conclusion now}
\end{frame}

\end{document}
