\makeatletter\let\ifGm@compatii\relax\makeatother
%\documentclass{beamer}
\documentclass[notes,page number]{beamer}
%\documentclass[trans]{beamer} % PAS OVERLAYS
%\documentclass[handout]{beamer} % PAS OVERLAYS

\mode<article> % only for the article version
{
  \usepackage{fullpage}
  \usepackage{hyperref}
}

\mode<presentation>
{
%\usetheme{Antibes} %++ Bleu noir up +
% \usetheme{Berkeley} %+ Bleu Gauche
%\usetheme{Berlin} % Bleu Gauche up -
% \usetheme{default} % Soft
% \usetheme{Dresden} % bleu Rond
% \usetheme{Goettingen} %soft degrade droit
% \usetheme{Hannover} % soft bleute  gauche
% \usetheme{Luebeck} %++ black bleu milieu
% \usetheme{Malmoe} % ++ black bleu milieu
% \usetheme{Marburg} % ++ black degrade bleu droite
%%%% 


%\usetheme{Pittsburgh} %soft classique droite + item rond
% \usetheme{Rochester} % + bleu up titre
%\usetheme{Copenhagen} % ++ black noir NO GASTEX
% \usetheme{Darmstadt} % black bleu pb NO GASTEX
%\usetheme{Frankfurt} % black bleu NO GASTEX
% \usetheme{Ilmenau} % bleu pb up NO GASTEX
% \usetheme{JuanLesPins} % ++ up black bleu Titre  NO GASTEX
% \usetheme{Malmoe} % ++ black bleu milieu
% \usetheme{Madrid} % +soft bleu titre...  NO GASTEX
% \usetheme{PaloAlto} % bleu bleu gauche.. NO GASTEX
%\usetheme{Singapore} % bleute up Rond  NO GASTEX
% \usetheme{Szeged} % Soft bleute up Rond
% \usetheme{Warsaw} %++ black bleu milie  NO GASTEX

%\usetheme{Montpellier} % ++ soft up plan .. blanc OK 


\usetheme{These} %



\beamertemplatenavigationsymbolsempty

%numero de page enbas gauche
\setbeamertemplate{footline}
{ \begin{flushright}
\textcolor{Violet}{\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}  }
\end{flushright}
}
%  \useinnertheme[shadow=true]{rounded} %PB
% \setbeamertemplate{background canvas}[vertical shading]%[bottom=red!10,top=blue!10]

}
    \usepackage[scr]{rsfso}
\usepackage[english]{babel}
 %\usepackage{pstricks}
%\usepackage{graphicx,epsfig}
\usepackage{amsmath,amssymb}
%\usepackage{mathpartir} 
%\usepackage{url} 
\usepackage{mathtools}

\usepackage[all]{xy}

\usepackage{epsfig}
%\usepackage{pstricks,pst-grad,pst-node}

%\usepackage{pstricks,pst-grad,pst-node,pst-tree,pspicture,pifont}
%\usepackage{graphicx,epsfig}

%\usepackage{gastex}

\usepackage{tikz,pgflibraryarrows,pgffor,pgflibrarysnakes,pgflibraryshapes}

\usepackage{tabularx}

\usepackage{xcolor}

\usepackage[framemethod=tikz]{mdframed}

\definecolor{blueblue}{RGB}{47,72,152}
\definecolor{ugared}{RGB}{184,34,35}
\newcommand{\bblue}[1]{{\color{blueblue}#1}}
\definecolor{graydk}{RGB}{47,72,152}
\definecolor{grayup}{RGB}{125,175,255}

\let\oldtextbf\textbf
\renewcommand{\textbf}[1]{{\color{blueblue}\oldtextbf{#1}}}
\newcommand{\textcolorwhitebold}[1]{\textcolor{white}{\oldtextbf{#1}}}

\beamertemplatenavigationsymbolsempty

\mdfdefinestyle{mystyle}{
  linecolor=blueblue,outerlinewidth=0pt,
  frametitlerule=true,frametitlefont=\sffamily\color{white},
  frametitlerulewidth=0pt,frametitlerulecolor=blueblue,
  frametitlebackgroundcolor=blueblue,
  backgroundcolor=white,
  innertopmargin=\topskip,
  roundcorner=5pt
}

\newmdenv[style=mystyle,roundcorner=2pt,outerlinecolor
= blueblue]{Lblock}
\newenvironment{blockspecial}[1]
{\begin{Lblock}[frametitle={#1}]}
  {\end{Lblock}}

%\logo{\vspace{-10pt}\includegraphics[height=20pt]{logo_ljk_blanc.pdf}\hspace{380pt}\includegraphics[height=20pt]{logo_UGA.pdf}\hspace{-2pt}}
%\institute{Université Grenoble Alpes}
% \subject{}

%\setbeamercolor{footline}{fg=blueblue}
%\addtobeamertemplate{navigation symbols}{}{%
%  \usebeamerfont{footline}%
%  \usebeamercolor[fg]{footline}%
%  \insertframenumber/\inserttotalframenumber%
%  \hspace*{.5\textwidth}
%}

\usepackage{algorithmic}
\usepackage[useregional]{datetime2}

\setbeamercolor{frametitle}{fg=blueblue}
\setbeamercolor{title}{fg=blueblue}
\setbeamercolor{author}{fg=blueblue}
\setbeamercolor{date}{fg=blueblue}
%\usepackage{dingbat,pifont,svgcolor}

%\newcommand{\donc}{{\bf\ding{239}}}
\newcommand{\thumb}{\leftthumbsup}

\newcommand{\warn}{%
 \makebox[1.4em][c]{%
 \makebox[0pt][c]{\raisebox{.1em}{\bf\small!}}%
 \makebox[0pt][c]{\color{ugared}\Large$\boldsymbol{\bigtriangleup}$}}}%

\newcommand{\beamtrgl}{{\color{beamerstructure}\ensuremath{\blacktriangleright}}}
\usepackage{multirow}
\usepackage[num]{hypdestopt}
\usepackage{listings}

\usepackage[official]{eurosym}

\usepackage{pgf-pie}

\usepackage{pgfplots}
\usetikzlibrary{pgfplots.dateplot}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}

\usepackage{datapie}

\DTLsetpiesegmentcolor{1}{blue!60!white}% Additional colour for segment 1
\DTLsetpiesegmentcolor{3}{blue!40!green}% Additional colour for segment 9
\DTLsetpiesegmentcolor{8}{white!90!blue}% Additional colour for segment 9
\DTLsetpiesegmentcolor{9}{black!40!green}% Additional colour for segment 9
\DTLsetpiesegmentcolor{10}{orange!40!pink!}% Additional colour for segment
\DTLsetpiesegmentcolor{11}{yellow!60!green!}% Additional colour for segment
\DTLsetpiesegmentcolor{13}{green!40!white}% Additional colour for segment
\DTLsetpiesegmentcolor{12}{blue!40!white}% Additional colour for segment
\DTLsetpiesegmentcolor{14}{pink!80!white}% Additional colour for segment
\DTLsetpiesegmentcolor{15}{yellow!40!white}% Additional colour for segment
\DTLsetpiesegmentcolor{16}{black!40!white}% Additional colour for segment
%\DTLsetpiesegmentcolor{1}{black!5!white}% Additional colour for segment 1
%\DTLsetpiesegmentcolor{2}{black!9!white}% Additional colour for segment 9
%\DTLsetpiesegmentcolor{3}{black!13!white}% Additional colour for segment 9
%\DTLsetpiesegmentcolor{4}{black!17!white}% Additional colour for segment 9
%\DTLsetpiesegmentcolor{5}{black!21!white}% Additional colour for segment 9
%\DTLsetpiesegmentcolor{6}{black!25!white}% Additional colour for segment 9
%\DTLsetpiesegmentcolor{7}{black!29!white}% Additional colour for segment 9
%\DTLsetpiesegmentcolor{8}{black!33!white}% Additional colour for segment 9
%\DTLsetpiesegmentcolor{9}{black!36!white}% Additional colour for segment 9
%\DTLsetpiesegmentcolor{10}{black!39!white}% Additional colour for segment
%\DTLsetpiesegmentcolor{11}{black!42!white}% Additional colour for segment
%\DTLsetpiesegmentcolor{12}{black!45!white}% Additional colour for segment
%\DTLsetpiesegmentcolor{13}{black!48!white}% Additional colour for segment
%\DTLsetpiesegmentcolor{14}{black!50!white}% Additional colour for segment
%\DTLsetpiesegmentcolor{15}{black!52!white}% Additional colour for segment
%\DTLsetpiesegmentcolor{16}{black!54!white}% Additional colour for segment
\DTLloaddb{market}{poolshares.txt}




\graphicspath{{IMAGES/}}

\xdefinecolor{LemonChiffon}{rgb}{1,.98,.8}
\xdefinecolor{Vert}{rgb}{0.01,.5,0.13}
%\xdefinecolor{Vert}{rgb}{0.07,0.5,0.4}
%\xdefinecolor{Bleu}{rgb}{0,.2,.54}
\xdefinecolor{Bleu}{rgb}{0, .4, .6} % en fait le bleu du LSV
\xdefinecolor{Ver}{rgb}{0.0525,0.375,0.3}
\xdefinecolor{Rouge}{rgb}{1,0,0}
\xdefinecolor{Violet}{rgb}{.5,0,.7}
\xdefinecolor{Bordeaux}{rgb}{.7,.2,0}
\xdefinecolor{Ivory}{rgb}{1,1,0.9}
\xdefinecolor{Marron}{rgb}{0.6,0.4,0.4}
\xdefinecolor{GrisClair}{rgb}{0.75,0.75,0.75}
\xdefinecolor{GrisFonce}{rgb}{0.55,0.55,0.55}
\xdefinecolor{BleuMarine}{rgb}{0,0,0.5}
%\xdefinecolor{BleuMarine}{rgb}{0.2,.1,.9}
%\xdefinecolor{BleuMarine}{rgb}{0,0,0.5}
\xdefinecolor{Turquoise}{rgb}{0.4,1.,1.}
\xdefinecolor{Rose}{rgb}{1.0,0.8,0.8}
\xdefinecolor{RoseFonce}{rgb}{0.8,0.,0.6}
\xdefinecolor{Blanc}{rgb}{0,0,0}
\xdefinecolor{Jaune}{rgb}{1,1,0}
%\xdefinecolor{Jaune}{rgb}{.95,.63,.21}

\xdefinecolor{Mycolor}{rgb}{.95,.81,.81} % 
%\xdefinecolor{Jaune}{rgb}{1,.9,0}
%\xdefinecolor{Jaune}{rgb}{.9,.6,.2}

% \newrgbcolor{orange}{.7 .2 0}

% \definecolor{bleu}{rgb}{0,.2,.54}
% \newrgbcolor{Rouge}{1 0 0}
% \newrgbcolor{ivory}{1 1 0.9}
% \newrgbcolor{Marron}{0.6 0.4 0.4}
% \newrgbcolor{GrisClair}{0.75 0.75 0.75}
% \newrgbcolor{GrisFonce}{0.55 0.55 0.55}
% \newrgbcolor{BleuMarine}{0 0 0.5}
% \newrgbcolor{Turquoise}{0.4 1. 1.}
% \newrgbcolor{ver}{0.0525 0.375 0.3}
% \newrgbcolor{Rose}{1.0 0.8 0.8}
% \newrgbcolor{RoseFonce}{0.8 0. 0.6}
% \newrgbcolor{Violet}{0.5 0. 0.7}
% \newrgbcolor{BleuMarine}{0 0 0.5}
% \newrgbcolor{vert}{0.07 0.5 0.4}
% \newrgbcolor{violet}{0.5 0. 0.7}
% %\definecolor{violet}{rgb}{.5,0,.7}
% \definecolor{bleu}{rgb}{0,.2,.54}
% \definecolor{LemonChiffon}{rgb}{1.,0.98,0.8}
% \newrgbcolor{toto}{0.6 1 0.6}
% \newrgbcolor{LemonChiffon}{1 0.98 0.8}
% \newrgbcolor{RoseFonce}{0.8 0. 0.6}
% \newcmykcolor{WildStrawberry}{0 0.96 0.39 0}

% \newrgbcolor{blanc}{0 0 0}

\usepackage{xcolor,colortbl}

\usepackage{tikzsymbols}
%\newcommand{\smiley}{{\textcolor{ugared}{\Smiley[1.1][white]{}}}}
%\newcommand{\neutrey}{{\textcolor{ugared}{\Neutrey[1.1][white]{}}}}
%\newcommand{\sadey}{{\textcolor{ugared}{\Sadey[1.1][white]{}}}}
%\newcommand{\smiley}{{\textcolor{black}{\Smiley[1][paleturquoise]{}}}}
%\newcommand{\neutrey}{{\textcolor{black}{\Neutrey[1][paleturquoise]{}}}}
%\newcommand{\sadey}{{\textcolor{black}{\Sadey[1][paleturquoise]{}}}}

\newcommand{\checkm}[1][9]{\includegraphics[width=#1pt]{checkmark.png}}
\newcommand{\crossm}[1][9]{\includegraphics[width=#1pt]{crossmark.png}}


\def\pair#1#2{\langle #1, #2 \rangle}    \def\crypt#1#2{\{#1\}_{#2}}           
\def\dect{\vdash}                    


\title{\bf{Bitcoin and Blockchain}}
 \author{\bf{Pascal Lafourcade}  }

\institute{  \includegraphics[width=2cm]{logo_limos_coul_def} \hfill 
\includegraphics[width=1.5cm]{UCA.png}} 

 \date[]{ESC January 2021}


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

\begin{frame}
\frametitle{Organisation}

6 = 4 + 2 sessions in 2 days : 12 january 2021 and 3 february 2021

\begin{enumerate}
\item Bitcoin +  Blockchain 
\item Projects
\item Introduction to Cryptography
\item GDPR
\item Computer Security Introduction
\item Security and Mobility of the futur 
\end{enumerate}

\end{frame}

\begin{frame}
\frametitle{Grade}

Imagine you are the boss of your own company.

\begin{enumerate}
\item Describe your company activities in 2 pages maximum
\item Write the GDPR report for your company
\end{enumerate}

\begin{center}
Deadline : 1st March 2021
\end{center}

\end{frame}

 \AtBeginSection[]
 {
   \begin{frame}<beamer>
     \frametitle{Outline}
     \tableofcontents[currentsection]
   \end{frame}
 }

\pgfdeclareimage[interpolate=true,height=1cm]{lettre}{IMAGES/lettre1}
\pgfdeclareimage[interpolate=true,height=2cm]{alice}{IMAGES/ALICE01}
\pgfdeclareimage[interpolate=true,height=2cm]{bob}{IMAGES/whiterabbit01.jpg}
\pgfdeclareimage[interpolate=true,height=1.5cm]{intrus}{IMAGES/cheshire01.jpg}
\pgfdeclareimage[interpolate=true,height=1.5cm]{chiffre}{IMAGES/chest121.jpg}
%\pgfdeclareimage[interpolate=true,height=.8cm]{k3}{key3.jpeg}
%\pgfdeclareimage[interpolate=true,height=.8cm]{k1}{key2.png}

\pgfdeclareimage[interpolate=true,height=.8cm]{kpub}{IMAGES/clef_publique.pdf}
\pgfdeclareimage[interpolate=true,height=.8cm]{kpriv}{IMAGES/clef_privee.pdf}

\pgfdeclareimage[interpolate=true,height=.8cm]{k2}{IMAGES/key-300}
\pgfdeclareimage[interpolate=true,height=.8cm]{ksym}{IMAGES/pure_clef_sym.pdf}




\pgfdeclareimage[interpolate=true,height=2cm]{lettresceau}{IMAGES/courrier-scelle_318-47739.jpg}





\section{Money}


\begin{frame}%[label=current]
  \frametitle{Sumerians around 3.500 bef. J.C}
  \begin{center}
    \includegraphics[width=8cm]{IMAGES/tablette_argile.png}
  \end{center}
\end{frame}

\begin{frame}
  \frametitle{Money as a functionality: a currency}

  \hfill \includegraphics[height=2.5cm]{IMAGES/troc1194805253} \hfill \includegraphics[height=2.5cm]{tirelire_cochon} \hfill
  \includegraphics[height=2.5cm]{credit-immobilier-monnaie.jpg}
  \hfill~
\bigskip
  \begin{enumerate}
  \item \alert{Medium of Exchange}
    of goods and services between people
  \item \alert{Store of Value}
  \item \alert{Unit of Account}
    (measure of value)
  \end{enumerate}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Many currencies}

  \begin{center}
    \includegraphics[width=10cm]{monnaies-monde.jpg}
  \end{center}

\end{frame}

\begin{frame}
  \frametitle{Principle: central Bank}

  \begin{center}
    \begin{tikzpicture}
      \node at (0,0) (B) {\includegraphics[height=2cm]{boy.png}};
      \node at (6,0) (A) {\includegraphics[height=2cm]{girl.png}};
      \node at (3,4) (Bank) {\includegraphics[height=2cm]{bank-building.png}};

      \draw[-latex, thick= 4pt] (Bank) -- (B);
      \node at (.75,2.5) (Coin1) {1. \includegraphics[height=1cm]{coins.png}};

      \only<2->{\node at (2.75,.75) (Coin) {2. \includegraphics[height=1cm]{coins.png}};}
      \only<2->{\draw[-latex, thick= 4pt] (B) -- (A);}


      \only<3->{\draw[-latex, thick= 4pt] (A) -- (Bank);}
      \only<3->{\node at (6.25,2.5) (Coin2) {\includegraphics[height=1cm]{coins.png}};}
      \only<3->{\node at (3.75,2) {3.};}
      \only<4->{\draw[-latex, thick = 4pt] (4.25,3.25) -- (5.75,1.25);}
      \only<4->{\node at (5.7, 2) {4.};}
    \end{tikzpicture}
  \end{center}
\end{frame}



\begin{frame}%[label=current]
  \frametitle{1988: Digitcash }
\begin{columns}[c]
\column{.6\textwidth}
    \includegraphics[height=4cm]{digicash-chaum.jpg}
\column{.4\textwidth}
\begin{itemize}
\item%[\smiley{}]
Preserves privacy
\item%[\neutrey{}]
Use cryptographic primitives
\item%[\sadey{}]
Requires a third party (bank)
\end{itemize}
\end{columns}
\end{frame}


% \begin{frame}
%   \frametitle{Une id\'ee visionnaire en avance sur son temps }
%   \begin{center}

%     \includegraphics[height=4cm]{timeline.png}

%     \includegraphics[height=2cm]{520px-Amiga500_system.jpg}
%     \includegraphics[height=2cm]{520px-Amstrad_CPC464.jpg}
%     \includegraphics[height=2cm]{600px-Atari_1040STf.jpg}

%     \includegraphics[height=2.5cm]{telephone-vintage-socotel-s63-kaki-a-cadran-1980_original.png}
%   \end{center}
% \end{frame}

\begin{frame}%[label=current]
  \frametitle{Cryptocurrency}
\begin{itemize}
\item Money
\newcounter{myenum}
{\small \begin{enumerate}
  \item {Medium of exchange}
  \item {Store of value}
  \item {Unit of account}\\[10pt]
\setcounter{myenum}{\theenumi}
  \end{enumerate}
}
\bigskip

\item Cryptocurrency: electronic cash, without a third party
{\small \begin{enumerate}\setcounter{enumi}{\themyenum}
  \item \alert{Preserving privacy}
  \item \alert{Unforgeable}
  \item \alert{Preventing double-spending}
  \end{enumerate}
}
\end{itemize}

\end{frame}


\begin{frame}%[label=current]
  \frametitle{Properties: Unforgeability}

  \begin{center}
    \includegraphics[width=6cm]{image161}

    \includegraphics[width=5cm]{forgeability.jpeg}
  \end{center}

\end{frame}

\begin{frame}%[label=keep,label=current]
  \frametitle{Properties: Preventing double spending}

  \begin{center}
%\begin{backgroundblock}{40pt}{20pt}
    \includegraphics[width=0.85\textwidth]{1_QtDFr57ebGUju2ojXDo6jg.png}
%\end{backgroundblock}
  \end{center}

\begin{itemize}
  \item Fraud identification \hfill \includegraphics[width=1.5cm]{fraudeur.jpeg}
  \item Presumption of innocence  \hfill \includegraphics[width=1.25cm]{07273190-photo-business-angel.png}
  \end{itemize}
\end{frame}


\begin{frame}%[label=current]
  \frametitle{Properties: Preserving privacy}

\begin{columns}[c]
\column{.8\textwidth}
  \begin{itemize}
  \item Weak anonymity: non identification of a buyer \\
\bigskip
  \item Strong anonymity: non tractability of a buyer
  \end{itemize}



\column{.2\textwidth}
\includegraphics[width=1.75cm]{internet-anonyme-380x250_c.png}
\\ \includegraphics[width=1.5cm]{SetWidth210-traceability2.png}
\end{columns}
  \begin{center}
    \includegraphics[width=4cm]{cryptocurrency.jpeg}
  \end{center}


\end{frame}

\begin{frame}%[label=current]
  \frametitle{What is a currency? (money creation)}
  \begin{columns}[c]
    \column{.72\textwidth}
    \begin{itemize}
    \item Standard currency
      \begin{itemize}
      \item Guaranteed by gold,
      \item Then by US Dollars (Bretton-Woods),
      \item Then simply fiduciary:
        \begin{itemize}
        \item Legal tender \& forced tender
        \item Creation by authorized institutions
        \item Guaranteed by a central bank\\[10pt]
        \end{itemize}
      \end{itemize}
  \item<2-> Cryptocurrency
    \begin{itemize}
    \item Various creation mechanisms:
      \begin{itemize}
      \item Fixed number
      \item Capped/linear/bounded growth / year
      \item etc.
      \end{itemize}
    \item[\warn{}] Gathering of mining farms (money supply)
    \end{itemize}
    \end{itemize}
    \column{.28\textwidth} % column designated by a command
\vspace{-20pt}\\
Nowadays: only \alert{debt}\\[10pt]
    \includegraphics[width=\columnwidth]{dossier_fotolia_2.jpg}\\
    \bigskip
\onslide<2->{\includegraphics[width=\columnwidth]{all-crypto-monnaie.jpeg}}
  \end{columns}
\end{frame}



\begin{frame}%[label=current]
  \frametitle{Classical and cryptographic currencies}
\centering
\renewcommand{\arraystretch}{1.2}
\begin{tabular}{|c||c|c|c|}
\hline
&\multicolumn{2}{c|}{Classical currency} & \multirow{2}{*}{Cryptocurrency} \\
\cline{2-3}
& Cash & Electronic &\\
\hline
{Medium of exchange} & \checkm &  \checkm &  \checkm \\
{Store of value} & \checkm  &  \checkm &  \checkm \\
{Unit of account} & \checkm  &  \checkm &  \checkm\\
\hline
Creation &  central Bank & Debt & Automatic\\
\hline
{Privacy} & \checkm & \crossm &   \checkm\\
{Peer 2 peer} & \crossm  & \crossm & \checkm  \\
\hline
{Legal guaranty,} & \multirow{2}{*}{\checkm}  &
\multirow{2}{*}{\checkm} & \multirow{2}{*}{\crossm} \\
stabilization & & & \\
\hline
\end{tabular}
\end{frame}

%\section{Bitcoin and cryptocurrencies}
\section{The Bitcoin Revolution}

\begin{frame}%[label=current]
  \frametitle{The Bitcoin revolution 2009}

  \includegraphics[height=4.5cm]{bitcoins.jpg} \hfill
  % \includegraphics[width=4cm]{mystery-man-square1.jpg}
  \includegraphics[height=4.5cm]{ipbitcointalk.png}
  \\
  \begin{center}
    \includegraphics[width=3cm]{bitcoin-stock.jpg}

    $ 21~\text{millions BTC}$
  \end{center}

\end{frame}


\begin{frame}%[label=current]
  \frametitle{Bitcoin}

  \begin{columns}[c] % the "c" option specifies center vertical alignment

    \column{8cm} % column designated by a command

    \begin{itemize}
    \item Decentralized and distributed cryptocurrency

      % \item Auditable et v\'erifiable

      % \item Toutes les transactions sont \alert{publiques}

      %% \item Num\'ero de compte:
      %%   $$ \text{{RIPEMD}-160}( \text{{SHA}-256}( \text{{ECDSA}}_{pub} ) ) $$

      % \item \alert{Blockchain}: un syst\`eme pair-\`a-pair qui garantit la validit\'e des transactions


      % \item S\'ecurit\'e des transactions s'adapte automatiquement \`a la puissance du r\'eseau mondial.
    \includegraphics[width=8cm]{LaREM37-Blockchain.jpg}

\bigskip
\bigskip
    \item Uses a \emph{blockchain}: a shared ledger, known to
      \alert{all} participants

    \end{itemize}
    \column{3cm} % column designated by a command
    \includegraphics[width=3cm]{pki.jpg}

    \ \\

\bigskip
\bigskip
    \includegraphics[width=3cm]{extrait_registre_trascation_action_1889.jpg}


  \end{columns}

\end{frame}

\begin{frame}%[label=current]
  \frametitle{Unstoppable, because distributed}

  \begin{center}
    \includegraphics[width=7cm]{do-not-stop-seo.jpg}
  \end{center}
  \begin{itemize}
  \item Broadcast of all the transactions to all the nodes of the network
\end{itemize}
\end{frame}


\begin{frame}%[label=current]
  \frametitle{Unforgeable}

  \begin{center}
    \includegraphics[width=8cm]{blockchain.png}
  \end{center}

  \begin{itemize}
    \item A fingerprint (hash) of each transaction block is added to
      each new block of transaction (\alert{chain of hashes}) ...
  \end{itemize}

  %% \pause

  %% \begin{itemize}
  %% \item Attaque de  51 \%
  %% \item Hard fork
  %% \end{itemize}

\end{frame}



\begin{frame}%[label=current]
  \frametitle{Auditable}


  \begin{center}\vspace{-25pt}
    \includegraphics[width=4cm]{19968036-m.jpg}

    \includegraphics[width=5cm]{blockchain.png}

  \end{center}

  \begin{itemize}
  \item Every participant owns, \alert{locally}, a copy of the complete
    history of every transactions
  \end{itemize}
\end{frame}


\begin{frame}%[label=current]
  \frametitle{Bitcoin: electronic cash}

  Created at the end of 2008 by Satoshi Nakamoto
  \begin{itemize} \item 1 BTC $\approx$ 15 401 %\input{current_btc.txt}
  \euro{}
    {\small (\today)}
  \end{itemize}
  \begin{center}
    \includegraphics[width=4cm]{Bitcoin.jpg}

    \begin{tabular}{lll}
      $1$ &BTC = 1 Bitcoin&\\
      $0,01$ &BTC = 1 cBTC &= 1 centiBitcoin (or bitcent)	\\
      $0,001$ &BTC = 1 mBTC &= 1 milliBitcoin	\\
      $0,000\,001$ &BTC = 1 $\mu$BTC &= 1 microBitcoin	\\
      $0,000\,000\,01$ &BTC = 1 Satoshi\index{Satoshi}&	\\
    \end{tabular}
  \end{center}

\end{frame}


\begin{frame}%[label=current]
  \frametitle{Bitcoin  \euro{} exchange rates}
\includegraphics[width=11cm]{IMAGES/courbe_bitcoin}
\end{frame}

%% \begin{frame}
%%   \frametitle{Payer 18 BTC avec des pi\`eces}

%%   \begin{center}
%%     \includegraphics[width=5cm]{JPG-Nous-acceptons-les-bitcoins-rouge.jpg}
%%     \ \\
%%     \ \\

%%     \includegraphics[width=8cm]{bitcoin-wallet.pdf}
%%   \end{center}

%% \end{frame}

\section{Technical context}




\begin{frame}%[label=current]{Symmetric keys}
  \begin{center}
    \begin{tikzpicture}
      \path (-1,2) node (A){\hbox to 2pt{\hss encipher \hss}};


      % \path (-1,0) node (A){\hbox to 2pt{\hss clef secr\`ete \hss}};
      % \path (3.5,0) node (A){\hbox to 2pt{\hss clef secr\`ete \hss}};


      \path (3.5,2) node (A){\hbox to 2pt{\hss decipher \hss}};


      \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{lettre}}

      \pgftext[at=\pgfpoint{-4cm}{1cm},left,base]{\pgfuseimage{lettre}}


      \pgftext[at=\pgfpoint{0cm}{1cm},left,base]{\pgfuseimage{chiffre}}


      \pgftext[at=\pgfpoint{-1.75cm}{0.5cm},left,base]{\pgfuseimage{ksym}}
      \pgftext[at=\pgfpoint{3cm}{0.5cm},left,base]{\pgfuseimage{ksym}}


      \draw[-latex',line width=2pt] (-2,1.5) -- (0,1.5);

      \draw[-latex',line width=2pt] (2.5,1.5) -- (4.5,1.5);


    \end{tikzpicture}
  \end{center}

  \begin{block}{Examples}
    \begin{itemize}
    \item 3DES
    \item AES
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}
  \frametitle{Public key cryptography}

  \begin{center}
    \begin{tikzpicture}
      \path (-1,2) node (A){\hbox to 2pt{\hss encipher \hss}};


      % \path (-1,0) node (A){\hbox to 2pt{\hss clef publique \hss}};
      % \path (3.5,0) node (A){\hbox to 2pt{\hss clef secr\`ete  \hss}};


      \path (3.5,2) node (A){\hbox to 2pt{\hss decipher\hss}};


      \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{lettre}}

      \pgftext[at=\pgfpoint{-4cm}{1cm},left,base]{\pgfuseimage{lettre}}


      \pgftext[at=\pgfpoint{0cm}{1cm},left,base]{\pgfuseimage{chiffre}}


      \pgftext[at=\pgfpoint{-1.75cm}{0.5cm},left,base]{\pgfuseimage{kpub}}
      \pgftext[at=\pgfpoint{2.5cm}{0.5cm},left,base]{\pgfuseimage{kpriv}}


      \draw[-latex',line width=2pt] (-2,1.5) -- (0,1.5);

      \draw[-latex',line width=2pt] (2.5,1.5) -- (4.5,1.5);


    \end{tikzpicture}
  \end{center}


  \begin{blockspecial}{Examples}
    \begin{itemize}
    \item RSA: $c= m^e \mod n$
    \item ElGamal: $c \equiv (g^r,h^r \cdot m) $
    \end{itemize}
  \end{blockspecial}

\end{frame}




\begin{frame}%[label=current]{Electronic Signature}
  \begin{center}
    \includegraphics[width = 1.8cm]{courrier-scelle_318-47739.jpg} \qquad      \includegraphics[width = 1.8cm]{cachet-de-cire-law.jpg}
  \end{center}

  \smallskip

  \pause


  \begin{center}
    \begin{tikzpicture}
      \path (-1,2) node (A){\hbox to 2pt{\hss signature \hss}};


      \path (-1,0) node (A){\hbox to 2pt{\hss private key \hss}};
      \path (3.5,0) node (A){\hbox to 2pt{\hss public key \hss}};


      \path (3.5,2) node (A){\hbox to 2pt{\hss verification \hss}};

      % \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{sceau}}
      % \pgftext[at=\pgfpoint{6.5cm}{1cm},left,base]{\pgfuseimage{sceau2}}

      \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{lettre}}

      \pgftext[at=\pgfpoint{-4cm}{1cm},left,base]{\pgfuseimage{lettre}}


      \pgftext[at=\pgfpoint{.25cm}{0.5cm},left,base]{\pgfuseimage{lettresceau}}


      \pgftext[at=\pgfpoint{-1.75cm}{0.5cm},left,base]{\pgfuseimage{kpriv}}
      \pgftext[at=\pgfpoint{3cm}{0.5cm},left,base]{\pgfuseimage{kpub}}


      \draw[-latex',line width=2pt] (-2,1.5) -- (0,1.5);

      \draw[-latex',line width=2pt] (2.5,1.5) -- (4.5,1.5);


    \end{tikzpicture}
  \end{center}

    \begin{itemize}
    \item RSA: $m^d \mod n$
    \item ElGamal: $(g^k ; (H(m)-xg^k)k^{-1} \mod p-1) $
    \end{itemize}
\end{frame}

%% \begin{frame}
%%   \frametitle{Chiffrement \`a clef publique et signature}

%%   \begin{center}
%%     \begin{tikzpicture}
%%       \path (-1,2) node (A){\hbox to 2pt{\hss encryption \hss}};


%%       \path (-1,0) node (A){\hbox to 2pt{\hss public key \hss}};
%%       \path (3.5,0) node (A){\hbox to 2pt{\hss secret key \hss}};


%%       \path (3.5,2) node (A){\hbox to 2pt{\hss decryption \hss}};


%%       \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{lettre}}

%%       \pgftext[at=\pgfpoint{-4cm}{1cm},left,base]{\pgfuseimage{lettre}}


%%       \pgftext[at=\pgfpoint{0cm}{1cm},left,base]{\pgfuseimage{chiffre}}


%%       \pgftext[at=\pgfpoint{-1.75cm}{0.5cm},left,base]{\pgfuseimage{k1}}
%%       \pgftext[at=\pgfpoint{3cm}{0.5cm},left,base]{\pgfuseimage{k3}}


%%       \draw[-latex',line width=2pt] (-2,1.5) -- (0,1.5);

%%       \draw[-latex',line width=2pt] (2.5,1.5) -- (4.5,1.5);


%%     \end{tikzpicture}
%%   \end{center}

%%   \pause
%%   \pgfdeclareimage[interpolate=true,height=2cm]{lettresceau}{courrier-scelle_318-47739.jpg}

%%   \begin{center}
%%     \begin{tikzpicture}
%%       \path (-1,2) node (A){\hbox to 2pt{\hss signature \hss}};


%%       \path (-1,0) node (A){\hbox to 2pt{\hss secret key \hss}};
%%       \path (3.5,0) node (A){\hbox to 2pt{\hss public key \hss}};


%%       \path (3.5,2) node (A){\hbox to 2pt{\hss verification \hss}};

%% %       \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{sceau}}
%% %       \pgftext[at=\pgfpoint{6.5cm}{1cm},left,base]{\pgfuseimage{sceau2}}

%%       \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{lettre}}

%%       \pgftext[at=\pgfpoint{-4cm}{1cm},left,base]{\pgfuseimage{lettre}}


%%       \pgftext[at=\pgfpoint{.25cm}{0.5cm},left,base]{\pgfuseimage{lettresceau}}


%%       \pgftext[at=\pgfpoint{-1.75cm}{0.5cm},left,base]{\pgfuseimage{k3}}
%%       \pgftext[at=\pgfpoint{3cm}{0.5cm},left,base]{\pgfuseimage{k1}}


%%       \draw[-latex',line width=2pt] (-2,1.5) -- (0,1.5);

%%       \draw[-latex',line width=2pt] (2.5,1.5) -- (4.5,1.5);


%%     \end{tikzpicture}
%%   \end{center}


%% \end{frame}



\begin{frame}
  \frametitle{Cryptographic hash function {\small (RIPEMD-160, SHA-256, SHA-3)}}
  \begin{center}
    \includegraphics[width=.5cm]{homme}
    \includegraphics[width=1cm]{fleched}
    % \includegraphics[width=1cm]{adn}
    \includegraphics[width=1cm]{empreinte-digitale}
  \end{center}
  \only<1>{
    \begin{center}
     \includegraphics[width=8.2cm]{fonction_hachage_standalone}
      \begin{itemize}
      \item \alert{uniformity} property:
        $\displaystyle\forall{}a{\neq}b\overset{\$}\leftarrow,{\mathcal P}(h(a)=h(b))\approx\frac{1}{n}$
      \end{itemize}
    \end{center}}

  \only<2->{\begin{blockspecial}{\alert{Resisting} properties}
      \begin{itemize}
      \item<2-> Pre-image
        \vspace{-.75cm}
        \begin{center}
          \includegraphics[width=1cm]{empreinte-digitale}     \includegraphics[width=1cm]{fleched}  \includegraphics[width=.5cm]{homme} \includegraphics[width=.75cm]{Point-d-interrogation.png}
        \end{center}
      \item<3-> Second Pre-image

        \begin{center}
          \includegraphics[width=.5cm]{homme2} \includegraphics[width=1cm]{empreinte-digitale}     \includegraphics[width=1cm]{fleched}  \includegraphics[width=.5cm]{homme3} \includegraphics[width=1cm]{empreinte-digitale} \includegraphics[width=.75cm]{Point-d-interrogation.png}
        \end{center}
      \item<4-> Collision

        \begin{center}
          \includegraphics[width=1cm]{fleched}  \includegraphics[width=.5cm]{homme3} \includegraphics[width=.5cm]{homme2} \includegraphics[width=1cm]{empreinte-digitale} \includegraphics[width=.75cm]{Point-d-interrogation.png}
        \end{center}

      \end{itemize}

    \end{blockspecial}}

\end{frame}




\section{Bitcoin in Details}


\begin{frame}
  \frametitle{Bitcoins: main characteristics}

  \begin{columns}[c] % the "c" option specifies center vertical alignment

    \column{8cm} % column designated by a command

    \begin{itemize}
    \item the total number of bitcoins is \alert{finite}$$ 21~\text{millions BTC}$$
    \item Transactions use \alert{electronic signatures}

    \item Account number:
      $$ \text{{RIPEMD}-160}( \text{{SHA}-256}( \text{{ECDSA}}_{pub} ) ) $$
    \item All the transactions are \alert{public}
    \item \alert{Blockchain}: a peer-to-peer system guaranteeing the
      validity of transactions


      % \item S\'ecurit\'e des transactions s'adapte automatiquement \`a la puissance du r\'eseau mondial.
    \end{itemize}
    \column{3cm} % column designated by a command
    \includegraphics[width=3cm]{bitcoin-stock.jpg}

    \ \\

    \includegraphics[width=3cm]{pki.jpg}

    \ \\

    \includegraphics[width=3cm]{blockchain.png}

  \end{columns}

\end{frame}



\begin{frame}%[label=current]
  \frametitle{How to perform a transaction?}


  Alice gives 12345 Satochis (a few cents) to Bob.

  \begin{center}
    \includegraphics[width=.8\textwidth]{bitcoin-transaction.pdf}
  \end{center}

\vfill\hfill \includegraphics[width=3cm]{blockchain.png}
\end{frame}


\begin{frame}
  \frametitle{Electronic wallet}
\begin{itemize}
\item Consultation of the balance
\item Completion of a transaction
\item Coins storage management
\item Creation of new account keys
\end{itemize}
\bigskip

\warn{~Where are my private keys?}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Digital wallet solutions}
\begin{enumerate}
\item Security
\item Availability
\item Ease of access\\[10pt]
\end{enumerate}
\bigskip
\pause
\begin{tabular}{ccc}
\includegraphics[height=2cm]{ledger.png} &
\includegraphics[height=2cm]{wallet.jpeg} &
\includegraphics[height=2cm]{bitcoin_wallet_cloud_l.jpg}\\
Hardware & Digital & Clouded \\
\end{tabular}
\end{frame}




\begin{frame}%[label=current]
  \frametitle{Main digital wallets}
{\scriptsize
  \begin{tabularx}{\textwidth}{|c|p{0.145\textwidth}|c|Xrr|p{0.15\textwidth}|}
    \rowcolor{graydk}
    \hline
    \textcolorwhitebold{Type} & \textcolorwhitebold{Storage} & \textcolorwhitebold{{Security}} &
    \textcolorwhitebold{{Example}} &
    \multicolumn{2}{r|}{\textcolorwhitebold{{\#currencies}}} &
    \textcolorwhitebold{{mobile version}}   \\\hline
    \hline
    \multirow{3}{*}{\textbf{Hardware}} &
    \multirow{3}{0.145\textwidth}{physical (cold wallet)} &
    %\multirow{3}{*}{tous} &
    \multirow{3}{*}{+++}  &
    Ledger Nano S & & $27$ & n/a \\
    & & & KeepKey & & $7$  & n/a\\
    & & & Trezor  & & $8$  & n/a\\
    \hline
    \multirow{5}{*}{\textbf{Software}} &
    \multirow{5}{*}{local} &
    %\multirow{5}{*}{tous} &
    \multirow{5}{*}{+} &
    Bither         & & $1$   & \checkmark \\
    & & & Coplay   & & $150$ & \checkmark \\
    & & & Electrum & & $1$   & \checkmark (Android) \\
    & & & Exodus   & & $30$  & $\times$ \\
    & & & Jaxx     & & $60$  & \checkmark\\
    \hline
    \multirow{4}{*}{\textbf{Cloud}} &
    \multirow{4}{*}{distant} &
    %\multirow{4}{*}{tous} &
    \multirow{4}{*}{--}  &
    Blockchain.info & & $2$   & n/a \\
    & & & Coinbase  & & $3$   & n/a \\
    & & & Kraken    & & $1$   & n/a \\
    & & & Bittrex   & & $190$ & n/a \\
    \hline
  \end{tabularx}\\[5pt]
  \,\hfill \tiny (march 2018)}
\end{frame}


\begin{frame}%[label=current]
  \frametitle{Pay 18 BTC with coins}

  \begin{center}
    \includegraphics[width=\textwidth]{bitcoin-wallet_standalone.pdf}
    \ \\
    \ \\
\pause
    \begin{itemize}
    \item \alert{Only owned bitcoins can be spend}
    \end{itemize}

  \begin{center}
%    \includegraphics[width=8cm]{bitcoin-validable-18_standalone.pdf}
  \end{center}
  \end{center}

\end{frame}
\begin{frame}%[label=current]
  \frametitle{Mining Bitcoins}

  \begin{center}
    \includegraphics[width=5cm]{picsou-mining.jpg}
  \end{center}

  \pause

  The ``\emph{miners}'' validate transactions and are paid in bitcoins


  \begin{center}
    \includegraphics[width=4cm]{jvm6qydgtswvejv8nzrf.jpg}\quad
    \includegraphics[width=4cm]{mining-rig.jpeg}
  \end{center}

\end{frame}


\begin{frame}%[label=current]
  \frametitle{Mining security}

  \begin{itemize}
  \item<1->[\warn{}] Who is going to mine my transaction?
    \begin{itemize}
    \item Will validate or not (accounts verifications), independently\\[10pt]
    \end{itemize}
  \item<2->[ ]%\thumb{}]
  A miner is \alert{randomly} chosen
    \begin{itemize}
    \item Prevents collusions\\[10pt]
    \end{itemize}
  \item<3->[{}] OK, as soon as a majority of miners is honest
    \begin{itemize}
    \item Correct validations are rewarded\\[10pt]
    \end{itemize}
  \end{itemize}
\end{frame}


\begin{frame}%[label=current]
  \frametitle{Mining Bitcoins = race to be selected}

  \begin{itemize}
  \item Mining = solving {\textbf{hashing target}}
    \begin{itemize}
      \item \alert{Proof of work}: {\textbf{hard}} puzzle to solve \&
        {\textbf{easy}} to check
      \item Uniform partition of the validators\\[10pt]
    \end{itemize}
\pause
  \item  Initial reward: $50$ BTC for a  validation
%    {\tiny (\today: \input{btc_current_bcperblock.tex}BTC)}
  \item  Divided by $2$ every $210 000$ validations ($4$ years)
  \end{itemize}

  $$\sum_{i=0}^{32} \frac{50}{2^i} \times 210\,000 =  21~\text{millions BTC}$$
  \hfill \includegraphics[width=5cm]{golden-bitcoins-d-rendering-white-background-75975248.jpeg} \hfill
  \includegraphics[width=1cm]{picto-61.png}



\end{frame}


\begin{frame}%[label=current]
  \frametitle{Mining: hashing target as a Proof-of-work}
%\hfill  \includegraphics[width=1cm]{cible.jpeg}}

  Example target:\\
  {\scriptsize
    \texttt{0000\,0000} \texttt{0000\,0000} \texttt{002e\,8fcc}
    \texttt{c211\,838c} \texttt{7d12\,c913} \texttt{d13b\,9686}
    \texttt{e8f6\,3127} \texttt{cb57\,e712}
  }\\[5pt]

  % \includegraphics[width=8cm]{bitcoin-chain.pdf}

  Find a number $n$ such that: \hfill  \includegraphics[width=1.25cm]{cible.jpeg}

  \begin{center}
    SHA-256(SHA-256(Transactions, $nonce$)) = $x < \text{Target} $

    \ \\

    \alert{Must have at least $18$ zeroes (even $18*4+2=74$ bits) for
      the msb of $x$}
  \end{center}

  \pause

  \begin{blockspecial}{Strategy: brute force}

    Randomly try the possible values for $nonce$
  \end{blockspecial}

%  {\tiny (Current target as of \today: \input{btc_current_latesthash.tex})}
\end{frame}


%% \begin{frame}%[label=current]
%%   \frametitle{Partial inversion of a cryptographic hash function}
%%   \begin{center}
%%     \includegraphics[height=0.8\textheight]{hashcash_standalone}
%%   \end{center}
%% \end{frame}


\begin{frame}%[label=current]
  \frametitle{Mining Algorithm}
  \begin{algorithmic}[1]
    \STATE \texttt{Nonce} := random value;
    \REPEAT
    \STATE \texttt{hashPrevBlock} := last validated (by the network) block;
    \STATE Fetch all the not yet validated transactions;
    \STATE \texttt{hashMerkleRoot} := hash of the transactions to be validated;
    \STATE \texttt{Time} := time in seconds;
    \STATE \texttt{Bits} := current hashing target;
    \STATE \texttt{Nonce} := \texttt{Nonce} + 1;
    \STATE header := {$(\texttt{Version}||$}{$\texttt{hashPrevBlock}||$}{$\texttt{hashMerkleRoot}||$}{$\texttt{Time}||$}{$\texttt{Bits}||$}{$\texttt{Nonce})$};\\[5pt]
    \UNTIL {$\text{{SHA}-$256$}( \text{{SHA}-$256$}( \text{block header} ) )  < \text{Target}$ }
  \end{algorithmic}

\end{frame}

\begin{frame}%[label=current]
\only<1>{\frametitle{Verify that transactions are present within the chain?}}
\only<2->{\frametitle{Efficiently add transactions as they come?}}
\begin{center}
\only<1-2>{\includegraphics[height=0.5\textheight]{bitcoin-merkletree}}
\only<3->{\includegraphics[height=0.5\textheight]{bitcoin-merkletreeT6}}
\end{center}
\only<1>{{Recompute the Merkle tree + check coherency of the root}}
\only<2->{{dashed zones are not preserved}:}
\onslide<2->{\begin{itemize}
\item a double arrow is a duplication
\item<3-> only \alert{$\log_2(n)$} fingerprints are recomputed/added
\end{itemize}}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{ASCII proof of work simulator}
\definecolor{lightgreen}{rgb}{0.95,1.,0.95}
\begin{center}
{\scriptsize\setlength{\tabcolsep}{3pt}
\hspace*{-20pt}\begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\rowcolor{lightgray}
dec & 45 & 46 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 & 60 & 61 & 62 & 63 & 64\\
char & \verb~-~ & \verb~.~ & \verb~/~ & \verb~0~ & \verb~1~ & \verb~2~
& \verb~3~ & \verb~4~ & \verb~5~ & \verb~6~ & \verb~7~ & \verb~8~ & \verb~9~ & \verb~:~ & \verb~;~ & \verb~<~
& \verb~=~ & \verb~>~ & \verb~?~ & \verb~@~\\
\hline
\hline
\rowcolor{lightgray}
dec & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 & 73 & 74& 75 & 76 & 77 & 78 & 79 & 80 & 81 & 82 & 83 & 84\\
char & \verb~A~ & \verb~B~ & \verb~C~ & \verb~D~ & \verb~E~ & \verb~F~
& \verb~G~ & \verb~H~ & \verb~I~ & \verb~J~ & \verb~K~ & \verb~L~ & \verb~M~ & \verb~N~ & \verb~O~ & \verb~P~ & \verb~Q~ & \verb~R~ & \verb~S~ & \verb~T~\\
\hline
\hline
\rowcolor{lightgray}
dec & 85 & 86 & 87 & 88 & 89 & 90 & 91 & 92 & 93 & 94 & 95 & 96 & 97
&98 & 99 & 100 & 101 & 102 & 103 & 104\\
char & \verb~U~ & \verb~V~ & \verb~W~ & \verb~X~ & \verb~Y~ & \verb~Z~
& \verb~[~ & \textbackslash{} & \verb~]~ & \textasciicircum &
 \_ & \verb~`~ &  \verb~a~ & \verb~b~& \verb~c~& \verb~d~& \verb~e~& \verb~f~& \verb~g~& \verb~h~\\
\hline
\end{tabular}}
\end{center}
\begin{blockspecial}{Validator}
ASCIISUM( ASCIISUM( A, B, 1234, nonce ) ) divisible by 15
\end{blockspecial}
\bigskip\pause
{\small
\begin{columns}[c]
\column{.2\textwidth}
\hfill Example:
\column{.8\textwidth}
ASCIISUM( ASCIISUM( A, B, 1234, 0 ) )\\
= ASCIISUM(65+66+49+50+51+52+48) \\
= ASCIISUM ( 333 + 48 ) = ASCIISUM ( 381 ) \\
= 51+56+49 = 156
\end{columns}
}
% ASCIISUM( ASCIISUM( A, B, 1234, 129 ) ) marche !
% 333 + 49+50+57 = 489
% 52+56+57 = 165 = 11*15
%
% ou
% ./asciisum A B 1234 E | ./asciisum | ifactor
% 65+66+49+50+51+52+(202-202)+69=402
% 52+48+50+(150-150)=150

\end{frame}

\begin{frame}%[label=current]
  \frametitle{Mining: chain of blocks}
\begin{columns}[c]
\column{.65\textwidth}
\includegraphics[width=\columnwidth]{bitcoin_chain_standalone.pdf}
  \begin{itemize}
  \item previous transactions\\ %{\footnotesize(\today:
%      \input{btc_current_getblockcount.txt}blocks, \input{current_btc_chainsize.txt}GB)}
  \item to be validated transactions {\footnotesize{(max. 1MB/block)}}
  \item seconds since 01/01/1970
  \item a nonce
  \end{itemize}
\column{.35\textwidth}
\[\text{{SHA}-256}( \text{{SHA}-256}( \text{header} ) )\]
\bigskip
\includegraphics[width=\columnwidth]{blockchain}
\bigskip
%\input{figure_longestchain}
  \end{columns}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Mining =  Validation of transactions}
%  Target: {\tiny \input{btc_current_latesthash.tex}}

  \begin{center}
   \includegraphics[width=3cm]{blockchain.png}
  \end{center}
  {%\small
    \begin{itemize}
    \item Validation every 10 minutes (6 confirmations recommended)
    \item Larger blocks make full nodes more expensive to operate
    \end{itemize}
  }
  \begin{center}
   \includegraphics[width=8cm]{bitcoin-validable_standalone.pdf}

%   \includegraphics[width=7cm]{courbe-transactions}
    \input{courbe-transactions-en}
  \end{center}
\end{frame}


\begin{frame}%[label=current]
  \frametitle{Forks: Longest Chain Rule}
\begin{itemize}
\item Longest Chain Rule: chain with most work is the main chain
      (51 \% attack)
\end{itemize}
\bigskip
\begin{columns}[c]
\column{.65\textwidth}
\begin{enumerate}
\item<1-> Simultaneously: \alert{Alice mines $B_a$} \& \alert{Bob mines $B_b$}
\\{Both chains are valid for now: \alert{Fork}}
\item<2-> Next miners mine either after $B_a$ or $B_b$
\item<3-> Charlie mines $B_2$
\\{Longest chain wins: $(\ldots\rightarrow C_0 \rightarrow B_b \rightarrow B_2)$}
\end{enumerate}
\column{.35\textwidth}
   \includegraphics[width=4cm]{figure_longestchain}
   %\input{figure_longestchain}
  \end{columns}
%\bigskip
\begin{columns}[c]
\column{.65\textwidth}
\onslide<4>{\begin{blockspecial}{Double spending?}
{If transactions $t_4$ \& $t_5$ are mutually exclusive then $t_4$ will never
  be included by honest miners}

\end{blockspecial}}
\column{.35\textwidth}
\includegraphics[width=\columnwidth]{blockchain}
  \end{columns}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Low Probability of simultaneous mining, except attacks}
\begin{center}
  \includegraphics[width=.75\textwidth]{dynamic_network}
\end{center}
  \begin{itemize}
    \item \# Nodes in the network at a given time
    \item Respective power, stake, activity, communication speed, etc.
  \end{itemize}
\onslide<2>{\begin{blockspecial}{Example: $10$\% of the world computing power, $6$
    confirmations}\center
\ensuremath{\mathcal P}(fake longest chain) $<1/1000$
\end{blockspecial}}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Overdraft is not allowed}
  \begin{center}
    \includegraphics[width=\textwidth]{bitcoin-validable_standalone.pdf}
  \end{center}
\pause
{Preventing double spending}
  \begin{itemize}
    \item All the balances must be positive
    \item Chain of two distinct honest minors cannot differ much;
    \item Chain of blocks: any modification must modify all the
      following blocks\\ (\alert{depth} and \alert{length} of forks);
    \item The network adapts (every 2 weeks) to validate on average
      every 10 minutes.
  \end{itemize}
\end{frame}


\begin{frame}%[label=current]
  \frametitle{Other separations: Soft Fork}
%  \vspace{-20pt}

  \begin{center}
    \includegraphics[width=7cm]{softfork.png}
  \end{center}


  \begin{blockspecial}{Modification of the code}
    \begin{itemize}
    \item Bug corrections
    \item Agreed (consensual) improvements
    \end{itemize}
  \end{blockspecial}

  % https://blog.bitmex.com/bitcoins-consensus-forks/

\end{frame}

\begin{frame}%[label=current]
  \frametitle{Hard Fork}

  \begin{center}
    \includegraphics[width=2cm]{STORY-Bitcoin_Split.jpg}
\vfill
    \includegraphics[width=8cm]{bitcoin-cash-hard-fork.jpg}
  \end{center}

  % https://blog.bitmex.com/44-bitcoin-fork-coins/

  % https://cryptocurrencyfacts.com/a-list-of-upcoming-bitcoin-forks-and-past-forks/
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Hard or Soft Fork}\centering
    \includegraphics[height=0.91\textheight]{1822e46d5adcd07d28ee2f49174353ba.png}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Bitcoin Hard Fork History}

  \begin{itemize}
  \item \textbf{BCH} (Bitcoin Cash) for Bitcoin
    \begin{itemize}\item \DTMdate{2017-08-01}: block 478558\end{itemize}
  \item \textbf{BTG} (Bitcoin Gold, ASIC$\rightarrow$GPU) for Bitcoin
    \begin{itemize}\item \DTMdate{2017-10-24}: bloc 491407\end{itemize}
  \item \textbf{BSV} (Bitcoin SV, Satoshi Version, 64MB) for Bitcoin Cash
    \begin{itemize}\item \DTMdate{2018-11-15}: bloc 556766\end{itemize} %SegWit2x
  \end{itemize}

  \begin{center}
    \begin{tikzpicture}
      \node at (0,0) (B) {\includegraphics[height=2cm]{Bitcoin.jpg}};
      \node at (3,-1.25) (A) {\includegraphics[height=2cm]{bitcoincash.jpg}};
      \node at (3,1.25) (C) {\includegraphics[height=2cm]{Bitcoin-Gold-BTG-300x300.jpg}};
      \node at (6,-1.25) (D) {\includegraphics[width=2cm]{bsv-logo3.png}};

      \draw[-latex, thick= 4pt] (B) -- (C);
      \draw[-latex, thick= 4pt] (B) -- (A);
      \draw[-latex, thick= 4pt] (A) -- (D);
    \end{tikzpicture}

  \end{center}

\end{frame}


\begin{frame}%[label=current]
  \frametitle{Hard Fork History}

  \begin{center}
    \includegraphics[width=.49\textwidth]{List-fork2.png}
    \includegraphics[width=.49\textwidth]{List-fork1.png}
  \end{center}

  % https://www.forks.net/list/Bitcoin//2/2017-01-01/2020-01-01
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Can a hard fork make you richer?}
\begin{itemize}
\item Instantaneous: doubles the number of coins\\  (same balance in
  each branch)
\item Purchasing power is in fact unchanged at the time of the fork\\
  (split in both currencies)
\item<2->{ \alert{Then: each cryptocurrency fluctuates in its own right}}
\end{itemize}

\begin{blockspecial}{Example of Bitcoin Gold}
\begin{tiny}
\begin{tabular}{lcrclcr}
23/10/2017:& BTC $\approx$ & $5\,910$\$\\
24/10/2017:& BTG $\approx $ & $480$\$\\
25/10/2017:& BTC $\approx $ & $5\,380$\$\\[2pt]
\hline
	\onslide<2->{\multirow{2}{*}{10/03/2019:}& BTC $\approx$ & $3\,895$\$ & \hspace{20pt} & \multirow{2}{*}{09/11/2020:}& BTC $\approx$ & $15\,523$\$\\
	& BTG $\approx$ & $12$\$ & & & BTG $\approx$ & $7$\$ }\\
\end{tabular}
\end{tiny}
\end{blockspecial}
\end{frame}


\begin{frame}%[label=current]
  \frametitle{Traceability}

  \begin{center}
    \includegraphics[width=5cm]{bitcoin-anonymous.png}

    \vspace{-2.5cm}\includegraphics[width=2cm]{multiply}

    \ \\
    \ \\

    Tracking criminals:
    \begin{itemize}
    \item The list of \alert{all} the transactions
      is public!
    \item Waiving the anonymity (legally) at entry/exit (classical currencies)
    \end{itemize}
    \pause

    \includegraphics[width=5cm]{monnero} \qquad
    \includegraphics[width=4cm]{golden-cash}
  \end{center}

\end{frame}


\begin{frame}%[label=current]
  \frametitle{Limitations}

  \begin{center}
    \includegraphics[width=2cm]{Speedometer-128}

    10 minutes = 1 block

    \includegraphics[width=2cm]{209902.jpg} \quad  Size of
    transactions  1 MB {\footnotesize ({4MB, after SegWit, 1st August 2017})}
  \end{center}


  \pause
  \begin{center}

    \hfill \includegraphics[width=3cm]{Blockstream_Lightning.png} \hfill  \includegraphics[width=4cm]{logo-ethereum.png} \hfill~

    \vfill

    \hfill Lightning Network \qquad \quad \hfill 12 seconds \qquad \hfill ~

  \end{center}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Energy intensive: Bitcoin power requirements (hashrate)}

  \begin{center}
     \includegraphics[width=4cm]{jvm6qydgtswvejv8nzrf.jpg}\quad
    \only<1>{\includegraphics[height=5.05cm]{miningpools}}%
     \only<2->{\includegraphics[height=5cm]{courbe-hash}}%
%     \only<2->{\input{courbe-hash-en}}%
  \end{center}
  \end{frame}

\begin{frame}%[label=current]
  \frametitle{Energy intensive: Bitcoin power requirements (hashrate)}
  
  Estimation: several yearly TWh (comparable to a small state comsumption)\\
  \only<1->{\begin{itemize}
      \only<1>{\item[\warn] Estimated from 15 to 70 TWh in 2018 (whole of France:
        1800 TWh in 2017)}
      \only<2->{\item[]{Lightning Network}}
      \onslide<2->{\item[] Other consensus algorithm (e.g., Proof of Stake)}
    \end{itemize}}
\end{frame}


\begin{frame}%[label=current]
  \frametitle{New block every 10 minutes}
{\scriptsize
  \begin{tabular}{|c||c|r|r|r|r|}
    \hline
    \rowcolor{graydk}
      & & \textcolorwhitebold{Speed} & \textcolorwhitebold{Efficiency}
      & \textcolorwhitebold{Cost} & \textcolorwhitebold{Average Mining} \\
    \rowcolor{graydk}
    \multirow{-2}{*}{\textcolorwhitebold{Machine}}   &
    \multirow{-2}{*}{\textcolorwhitebold{Type}} &
    \textcolorwhitebold{MH/s} & \textcolorwhitebold{MH/J} & \textcolorwhitebold{MH/s/\euro} & \textcolorwhitebold{Years/block} \\\hline
    \hline
    Core i$5$-$2400$& {CPU} &	 $14$&	$0.15$&	$0.09$& $25.3$ Millions	\\
    PS$3$		 & Cell	   &	 $21$&	$0.35$&	$0.09$& $16.9$ Millions	\\
    ATI $830$	 & {GPU} &	$325$&	$1.98$&	$3.30$&  $1.1$ Millions	\\
    Ebit E$11{+}{+}$   & {ASIC}& $44\,000\,000$&	$22\,200.00$&	$8\,885.00$& $13.6$	\\
    \hline
\end{tabular}
}\\[10pt]

\bigskip
\begin{minipage}{.8\textwidth}
\begin{itemize}
\item Target: 74 initial zeroes, $\displaystyle\frac{1}{2^{74}}$
  chances to mine
\item $44\,000\,000$ MH/s $= 4.4 \,10^{13}$ H/s $\approx 2^{45.3}$ H/s
\item $2^{28.7} \approx 4.3\,10^8$ s $\approx 5\,000$ days
  \alert{$\approx 13.6$ years} of computations of an Ebit E11++
\item World network \alert{$\approx 700\,000$ E11}
\end{itemize}
\end{minipage}\hfill
\begin{minipage}{.18\textwidth}
\includegraphics[width=\textwidth]{Ebit_E11++}%
\end{minipage}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Mining Farms:
share the rewards among the farmers \hfill{\tiny as of November 10, 2020}}
%\hfill{\tiny as of \today}}


  \begin{center}
    \resizebox{!}{0.85\textheight}{%
     \input{courbe-repartitionpuissance-en}
    }
  \end{center}
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Bitcoin: Decentralized Cryptocurrency}


  \begin{itemize}
  \item Proof of work = hashing target
  \item Money creation = reward to miners
  \item Miner = hard work + energy-intensive


    \hfill  \includegraphics[width=3cm]{miner-300x237.png}  \hfill  \includegraphics[width=1.5cm]{picto-61.png} \hfill  \includegraphics[width=3cm]{arnaques-travaux-energetiques.jpeg} \hfill ~
  \end{itemize}

  \pause

  \begin{itemize}
  \item Loss or theft of the private key: permanent
  \item Anonymous and traceable currency
  \end{itemize}

  \hfill
  \includegraphics[width=2cm]{the_gang_char_thief_sq.png}
  \includegraphics[width=2cm]{anonymous.jpeg}   \includegraphics[width=2cm]{SetWidth210-traceability2.png}
  \hspace{50pt}

\end{frame}


\section{Altcoins}
\begin{frame}%[label=current]
  \frametitle{Monetary diversity: marketcap}

\input{courbe-marketcap-en}
   %% \begin{center}
   %%   \includegraphics[width=.8\textwidth]{courbe-marketcap.pdf}
   %% \end{center}

\end{frame}



\begin{frame}
  \frametitle{Other crypto-currencies}

\only<1>{\includegraphics[width=\textwidth]{all-crypto-monnaie.jpeg}}
\only<2>{\includegraphics[width=\textwidth]{releases-dates}}

  %% \includegraphics[width=1.5cm]{peercoin}
  %% \includegraphics[width=1.5cm]{litecoin}
  %% \includegraphics[width=1.5cm]{blackcoin}
  %% \includegraphics[width=1.5cm]{vericoin}
  %% \includegraphics[width=1.5cm]{megacoin}
  %% \includegraphics[width=1.5cm]{primecoin}
  %% \includegraphics[width=1.5cm]{namecoin}

  %% \includegraphics[width=1.5cm]{quarkcoin}
  %% \includegraphics[width=1.5cm]{novacoin}
  %% \includegraphics[width=1.5cm]{feathercoin}
  %% \includegraphics[width=1.5cm]{digitalcoin}
  %% \includegraphics[width=1.5cm]{zetacoin}
  %% \includegraphics[width=1.5cm]{fastcoin}
  %% \includegraphics[width=1.5cm]{capricoin}

  %% \includegraphics[width=1.5cm]{acoin}
  %% \includegraphics[width=1.5cm]{catcoin}
  %% \includegraphics[width=1.5cm]{guncoin}
  %% \includegraphics[width=1.5cm]{cannabiscoin}
  %% \includegraphics[width=1.5cm]{phoenixcoin}
  %% \includegraphics[width=1.5cm]{magicoin}
  %% \includegraphics[width=1.5cm]{rubycoin}


  % \url{https://walletgenerator.net}
\end{frame}


\begin{frame}
  \frametitle{Classification I: lousy}

  \begin{center}
    \includegraphics[width=4cm]{trash-symbol_2_orig}
  \end{center}
\end{frame}


\begin{frame}
  \frametitle{Classification II: Bitcoin Clones}

  \begin{center}
    \includegraphics[width=10cm]{clone_phase_ii_legions_by_efrajoey1-dc5iy9q.png}
  \end{center}


\end{frame}


\begin{frame}
  \frametitle{Classification III: more useful}
  \begin{center}
\begin{tabular}{ccccc}
  \includegraphics[height=1.9cm]{primecoin}&
  \includegraphics[height=1.9cm]{233.png} &
  \includegraphics[height=1.9cm]{FoldingCoin-icon.png}&
  \includegraphics[height=1.9cm]{5168cfb6-ad9a-4b63-b9dd-cf33cbf52c8e}&
  \includegraphics[height=1.9cm]{gridcoin.png}\\
primes & rewarding & \multicolumn{2}{c}{medical computations}& HPC\\
\end{tabular}
  \end{center}

  % + utile Prime coin + econome NRJ
\end{frame}

\begin{frame}%[label=current]
  \frametitle{Classification IV: other consensus algorithms}
  \begin{center}
\begin{tabular}{cccc}
\includegraphics[height=1.9cm]{peercoin.png}&
\includegraphics[height=1.9cm]{burstcoin}&
\includegraphics[height=1.5cm]{ether.png}&
\includegraphics[height=1.5cm]{miota.jpg}\\

PeerCoin& BurstCoin & Ethereum & Iota (miota)\\
&&\\
PoS & Storage & Hybrid PoW/PoS & gossiping (DAG) \\
&&\\
\multicolumn{4}{c}{\pause
\includegraphics[width=4cm]{Blockstream_Lightning.png}}\\
\multicolumn{4}{c}{gathering of transactions}\\
\end{tabular}
  \end{center}

\end{frame}

\begin{frame}
  \frametitle{Etherum}
\vspace{-20pt}
\hfill \includegraphics[width=4cm]{ether.png}

\hfill Speed: 12 seconds

\vspace{-55pt}\hspace{40pt}
\begin{tiny}
  \begin{tabular}{|l|r|}
    \hline
    Unit &	wei   \\\hline
    \hline
    wei &	$1$ wei \\
    Kwei (babbage) &	$10^3$ wei \\
    Mwei (lovelace)&	$10^6$ wei \\
    Gwei (shannon) &	$10^9$ wei \\
    microether (szabo) &	$10^{12}$ wei \\
    milliether (finney) &	$10^{15}$ wei \\
    ether &	$10^{18}$ wei \\
    \hline
  \end{tabular}
  \end{tiny}


\begin{blockspecial}{Rewarding uncles}
  \includegraphics[width=7.5cm]{figure_heaviestchain}
\begin{small}
\[\begin{cases}
B_4&\text{receives}~3\times\left(1+\frac{2}{32}\right)=3.185~\text{ethers}\\
B_b&\text{receives}~\frac{7}{8}{\times}3=2.625~\text{ethers,}~B_a~\text{receives}~\frac{5}{8}{\times}3=1.875~\text{ethers}
\end{cases}\]
\end{small}\vspace{-15pt}
\end{blockspecial}

\end{frame}


\begin{frame}
  \frametitle{Peercoin: coin age}
\hfill \includegraphics[width=2cm]{peercoin.png}

\vspace{-2.25cm}

\vfill
For 10 coins
\vfill
\begin{tabular}{|l|c|c|c|c|}
\hline
Days & 0 & 1 & 2 &  ... \\ \hline
Age & 10 & 10 & 20 &  ... \\ \hline
\end{tabular}
\vfill
After V 0.3:
\begin{itemize}
\item Wait 30 days
\item Maximum 90 days
\end{itemize}

\pause

\begin{blockspecial}{Hashing target}
\centering Hash$(\ldots)<C \times A \times  \frac{1}{2^{32}\times D}$
\begin{itemize}
\item $C$: number of coins
\item $A$: Average Age (days) of the coins
\item $D$: Hardness
\end{itemize}
\end{blockspecial}
\vfill
~

\end{frame}

\begin{frame}
  \frametitle{Lightning Network}

\vspace{-1.25cm}
Xan $\stackrel{2~\text{BTC}}{\longrightarrow}$ Zeke: signed
commitments on open channels \hfill \includegraphics[width=2cm]{Blockstream_Lightning.png}

\begin{center}
\includegraphics[width=11.5cm]{Lightning.jpg}
\end{center}



\end{frame}


\begin{frame}
  \frametitle{Multiculturalism of money creation}

  % \includegraphics[width=3cm]{bitcoin-revolution-bitcoin-revolution-money.png}
  \hfill \includegraphics[width=6cm]{image-3046639_1280.png} \hfill
  \includegraphics[width=3cm]{scn-crypto-revolution_book1_soft_cover.png} \hfill


\end{frame}


\begin{frame}
  \frametitle{Who embraces these crypto-currencies?}

  \hfill  \includegraphics[width=5cm]{groupe} \hfill  \includegraphics[width=2cm]{Les-insultes-de-geek-ayant-le-plus-de-vote} \hfill \includegraphics[width=3cm]{Bank-988164_960_720.png} \hfill~

  % Citoyens Geeks Banque
\end{frame}


\begin{frame}
  \frametitle{Another example: Ğ1}

  \hfill  \includegraphics[width=2cm]{g1} \hfill  \includegraphics[width=2cm]{cesium} \hfill \includegraphics[width=2cm]{lesou.png} %\hfill \includegraphics[width=2cm]{Logo_MFRB_blanc_big.png}
  \hfill~\\

\bigskip

\begin{itemize}
\item Freedom of access to resources
\item Freedom of production
\item Freedom of exchange in the currency
\end{itemize}
{Universal Dividend: proof of existence}
\end{frame}

\begin{frame}
  \frametitle{More obstacles}
\begin{center}
\begin{tabular}{cc}
\includegraphics[width=5cm]{actu-hygiene-informatique.png} &
\includegraphics[width=5cm]{free-iconic-open-mind-vector} \\
&\\
Computer hygiene & Awareness\\
\href{https://www.ssi.gouv.fr/guide/guide-dhygiene-informatique/}{\includegraphics[height=20pt]{logo_anssi.png}}\\
\end{tabular}
\end{center}

\end{frame}




%% \begin{frame}
%%   \frametitle{Classification des Altcoins}

%%   \begin{enumerate}
%%   \item ``Pourris coins'' \vspace{-.45cm}
%%   \item Cl\^ones de Bitcoin \hfill  \vspace{-.1cm} \includegraphics[width=1cm]{guncoin} \includegraphics[width=4cm]{PotCoin.png}
%%   \item Minage plus utiles, moins \'energivores \hfill \includegraphics[width=1cm]{primecoin} \includegraphics[width=1cm]{Curecoin} \includegraphics[width=1cm]{foldingcoin}
%%   \item Non-bas\'es sur la preuve de travail
%%     \vspace{-.5cm}\begin{itemize}
%%     \item Proof of Stake (Peercoin) \hfill \includegraphics[width=1cm]{peercoin}
%%     \item Proof of Retreivability (Permacoin)
%%     \item Proof of Capacity (Burstcoin)
%%     \item Proof of Space (SpaceMint)
%%     \end{itemize}
%%   \end{enumerate}

%%   \hfill \includegraphics[width=3cm]{share.png} \hfill \includegraphics[width=3cm]{stockage-cloud.jpeg} \hfill  \includegraphics[width=3cm]{armoire.jpeg}


%% \end{frame}





%% \section{Bitcoin}

%% \begin{frame}
%%   \frametitle{Bitcoin : monnaie \'electronique}

%% Cr\'e\'ee en 2008 par Satoshi Nakamoto (1 BTC $\approx$ 945 euros) 
%% \begin{center}
%% \includegraphics[width=4cm]{Bitcoin.jpg} 

%% \begin{tabular}{lll}
%% $1$ &BTC = 1 Bitcoin&\\
%% $0,01$ &BTC = 1 cBTC &= 1 centiBitcoin (ou bitcent)	\\
%% $0,001$ &BTC = 1 mBTC &= 1 milliBitcoin	\\
%% $0,000\,001$ &BTC = 1 $\mu$BTC &= 1 microBitcoin	\\
%% $0,000\,000\,01$ &BTC = 1 Satoshi\index{Satoshi}&	\\
%% \end{tabular}
%% \end{center}

%% \end{frame}


%% \begin{frame}
%%   \frametitle{Taux de change du bitcoin}

%% \begin{center}
%% \includegraphics[width=11cm]{Bitcoin_usd_price.png}
%% \end{center}

%% \end{frame}

%% \begin{frame}
%%   \frametitle{Payer 18 BTC avec des pi\`eces}

%% \begin{center}
%% \includegraphics[width=5cm]{JPG-Nous-acceptons-les-bitcoins-rouge.jpg}
%% \ \\
%% \ \\

%% \includegraphics[width=8cm]{bitcoin-wallet.pdf}
%% \end{center}

%% \end{frame}

%% %\subsection{Pr\'e-requis}




%% \begin{frame}{Clef sym\'etrique}
%%    \begin{center}
%% \begin{tikzpicture}
%% \path (-1,2) node (A){\hbox to 2pt{\hss chiffrement \hss}};


%% %\path (-1,0) node (A){\hbox to 2pt{\hss clef secr\'ete \hss}};
%% %\path (3.5,0) node (A){\hbox to 2pt{\hss clef secr\'ete \hss}};


%% \path (3.5,2) node (A){\hbox to 2pt{\hss d\'echiffrement \hss}};


%% \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{lettre}}

%% \pgftext[at=\pgfpoint{-4cm}{1cm},left,base]{\pgfuseimage{lettre}}


%% \pgftext[at=\pgfpoint{0cm}{1cm},left,base]{\pgfuseimage{chiffre}}


%% \pgftext[at=\pgfpoint{-1.75cm}{0.5cm},left,base]{\pgfuseimage{ksym}}
%% \pgftext[at=\pgfpoint{3cm}{0.5cm},left,base]{\pgfuseimage{ksym}}


%%  \draw[-latex',line width=2pt] (-2,1.5) -- (0,1.5);

%%   \draw[-latex',line width=2pt] (2.5,1.5) -- (4.5,1.5);
 

%% \end{tikzpicture}
%% \end{center}

%% \begin{block}{Exemples}
%% \begin{itemize}
%% \item DES
%% \item AES
%% \end{itemize}
%% \end{block}
%% \end{frame}

%% \begin{frame}
%%   \frametitle{Chiffrement \`a clef publique}

%%    \begin{center}
%% \begin{tikzpicture}
%% \path (-1,2) node (A){\hbox to 2pt{\hss chiffrement \hss}};


%% %\path (-1,0) node (A){\hbox to 2pt{\hss clef publique \hss}};
%% %\path (3.5,0) node (A){\hbox to 2pt{\hss clef secr\'ete  \hss}};


%% \path (3.5,2) node (A){\hbox to 2pt{\hss d\'echiffrement \hss}};


%% \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{lettre}}

%% \pgftext[at=\pgfpoint{-4cm}{1cm},left,base]{\pgfuseimage{lettre}}


%% \pgftext[at=\pgfpoint{0cm}{1cm},left,base]{\pgfuseimage{chiffre}}


%% \pgftext[at=\pgfpoint{-1.75cm}{0.5cm},left,base]{\pgfuseimage{kpub}}
%% \pgftext[at=\pgfpoint{2.5cm}{0.5cm},left,base]{\pgfuseimage{kpriv}}


%%  \draw[-latex',line width=2pt] (-2,1.5) -- (0,1.5);

%%   \draw[-latex',line width=2pt] (2.5,1.5) -- (4.5,1.5);
 

%% \end{tikzpicture}
%% \end{center}


%% \begin{block}{Exemples}
%% \begin{itemize}
%% \item RSA : $c= m^e \mod n$
%% \item ElGamal : $c \equiv (g^r,h^r \cdot m) $
%% \end{itemize}
%% \end{block}

%% \end{frame}


%% \begin{frame}{Signature}

%% \begin{center}
%% \includegraphics[width = 2cm]{courrier-scelle_318-47739.jpg} \qquad      \includegraphics[width = 2cm]{cachet-de-cire-law.jpg} 
%%      \end{center}

%% \bigskip

%% \pause


%%    \begin{center}
%% \begin{tikzpicture}
%% \path (-1,2) node (A){\hbox to 2pt{\hss signature \hss}};


%% \path (-1,0) node (A){\hbox to 2pt{\hss clef  secr\'ete \hss}};
%% \path (3.5,0) node (A){\hbox to 2pt{\hss clef publique \hss}};


%% \path (3.5,2) node (A){\hbox to 2pt{\hss v\'erification \hss}};

%% %\pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{sceau}}
%% %\pgftext[at=\pgfpoint{6.5cm}{1cm},left,base]{\pgfuseimage{sceau2}}

%% \pgftext[at=\pgfpoint{4.5cm}{1cm},left,base]{\pgfuseimage{lettre}}

%% \pgftext[at=\pgfpoint{-4cm}{1cm},left,base]{\pgfuseimage{lettre}}


%% \pgftext[at=\pgfpoint{.25cm}{0.5cm},left,base]{\pgfuseimage{lettresceau}}


%% \pgftext[at=\pgfpoint{-1.75cm}{0.5cm},left,base]{\pgfuseimage{kpriv}}
%% \pgftext[at=\pgfpoint{3cm}{0.5cm},left,base]{\pgfuseimage{kpub}}


%%  \draw[-latex',line width=2pt] (-2,1.5) -- (0,1.5);

%%   \draw[-latex',line width=2pt] (2.5,1.5) -- (4.5,1.5);
 

%% \end{tikzpicture}
%% \end{center}

%% RSA: $m^d \mod n$
%% \end{frame}


%% \begin{frame}{Fonction de Hachage (RIPEMD-160, SHA-256, SHA-3)}

%% \begin{center}
%%   \includegraphics[width=.5cm]{homme}
%%     \includegraphics[width=1cm]{fleched} 
%% %\includegraphics[width=1cm]{adn} 
%%   \includegraphics[width=1cm]{empreinte-digitale}
%% \end{center}

%% \pause

%% \begin{block}{Propri\'et\'es de r\'esitance}
%% \begin{itemize}
%% \item Pr\'e-image 
%% \vspace{-.75cm}
%% \begin{center}
%% \includegraphics[width=1cm]{empreinte-digitale}     \includegraphics[width=1cm]{fleched}  \includegraphics[width=.5cm]{homme} \includegraphics[width=.75cm]{Point-d-interrogation.png}
%% \end{center}
%% \pause
%% \item Seconde Pr\'e-image

%% \begin{center}
%% \includegraphics[width=.5cm]{homme2} \includegraphics[width=1cm]{empreinte-digitale}     \includegraphics[width=1cm]{fleched}  \includegraphics[width=.5cm]{homme3} \includegraphics[width=1cm]{empreinte-digitale} \includegraphics[width=.75cm]{Point-d-interrogation.png}
%% \end{center}
%% \pause
%% \item Collision

%% \begin{center}
%% \includegraphics[width=1cm]{fleched}  \includegraphics[width=.5cm]{homme3} \includegraphics[width=.5cm]{homme2} \includegraphics[width=1cm]{empreinte-digitale} \includegraphics[width=.75cm]{Point-d-interrogation.png}
%% \end{center}

%% \end{itemize}

%% \end{block}

%% \end{frame}




%% \begin{frame}
%%   \frametitle{Propri\'et\'es d'une monnaie \'electronique}


%% \vspace{-.75cm}

%% \begin{itemize}
%% \item Non-Falsifiable (Unforgeable) \hfill  \includegraphics[width=2.5cm]{forgeability.jpeg}

%% \hfill \includegraphics[width=1.5cm]{fraudeur.jpeg}



%% \item \vspace{-.5cm} Eviter la double d\'epense \& identifiation fraudeur  
%%  \phantom{Eviter la double d\'epense}  \& ``pr\'esemption d'innocence''

%% \vspace{-.5cm}

%% \hfill \hspace{.5cm}\includegraphics[width=1.25cm]{07273190-photo-business-angel.png}

%% \vspace{-1cm}  \qquad  \includegraphics[width=1cm]{Bitcoin.jpg} \includegraphics[width=1cm]{Bitcoin.jpg}



%% \item Respect de la vie priv\'ee :
%% \vspace{-.75cm}
%% \begin{itemize}
%% \item Anonymat faible : non identification d'un acheteur \includegraphics[width=1.75cm]{internet-anonyme-380x250_c.png}
%% \item Anonymat fort : non tra\c{c}abilit\'e d'un acheteur
%% \end{itemize}
%% \end{itemize}

%% \vspace{-.5cm}

%% \hfill  \includegraphics[width=1.5cm]{SetWidth210-traceability2.png}

%% \vspace{-1cm}
%% \begin{center}
%% \includegraphics[width=4cm]{cryptocurrency.jpeg}
%% \end{center}


%% \end{frame}
  
%% %\subsection{Au coeur de Bitcoin}


%% \begin{frame}
%%   \frametitle{Bitcoins : caract\'eristiques}

%% \begin{columns}[c] % the "c" option specifies center vertical alignment

%% \column{8cm} % column designated by a command

%% \begin{itemize}
%% \item Le nombre total de bitcoins est {\bf fini}$$ 21~\text{millions BTC}$$
%% \item Les transactions utilisent des {\bf PKI}

%% \item Num\'ero de compte :
%% $$ \text{{RIPEMD}-160}( \text{{SHA}-256}( \text{{ECDSA}}_{pub} ) ) $$
%% \item Toutes les transactions sont {\bf publiques}
%% \item {\bf Blockchain} : un syst\`eme pair-\`a-pair qui garantit la validit\'e des transactions


%% %\item S\'ecurit\'e des transactions s'adapte automatiquement \`a la puissance du r\'eseau mondial. 
%% \end{itemize}
%% \column{3cm} % column designated by a command
%% \includegraphics[width=3cm]{bitcoin-stock.jpg}

%% \ \\

%% \includegraphics[width=3cm]{pki.jpg}

%% \ \\

%% \includegraphics[width=3cm]{blockchain}

%% \end{columns}

%% \end{frame}



%% \begin{frame}
%%   \frametitle{Comment faire une transaction?}


%% Alice donne 12345 Satochis ($\approx 5 c$) \`a Bob.

%% \begin{center}
%% \includegraphics[width=8cm]{bitcoin-transaction.pdf}
%% \end{center}

%% \end{frame}

%% \begin{frame}
%%   \frametitle{Payer 18 BTC avec des pi\`eces}

%% \begin{center}

%% \includegraphics[width=8cm]{bitcoin-wallet.pdf}
%% \ \\
%% \ \\

%% \begin{itemize}
%% \item \textcolor{red}{Seuls des bitcoins poss\'ed\'es peuvent \^etre d\'epens\'es}
%% \end{itemize}

%% \end{center}

%% \end{frame}
%% \begin{frame}
%%   \frametitle{Miner des Bitcoins}

%% \begin{center}
%% \includegraphics[width=5cm]{picsou-mining.jpg}
%% \end{center}

%% \pause

%% Les ``\emph{mineurs}'' valident les transactions contre des bitcoins


%% \begin{center}
%% \includegraphics[width=4cm]{jvm6qydgtswvejv8nzrf.jpg}\quad 
%% \includegraphics[width=4cm]{mining-rig.jpeg}
%% \end{center}

%% \end{frame}


%% \begin{frame}
%%   \frametitle{Miner des Bitcoins}

%% \begin{itemize}
%% \item Valider = r\'esoudre un {\bf objectif de hachage}
%% \item  R\'ecompense initiale $50$ BTC pour une validation
%% \item  Divis\'ee par $2$ tous les $210 000$ validations
%% \end{itemize}

%% $$\sum_{i=0}^{32} \frac{50}{2^i} \times 210\,000 =  21~\text{millions BTC}$$
%%  \hfill \includegraphics[width=5cm]{golden-bitcoins-d-rendering-white-background-75975248.jpeg} \hfill 
%% \includegraphics[width=1cm]{picto-61.png}



%% \end{frame}


%% \begin{frame}
%%   \frametitle{Miner : Objectif de hachage }%\hfill  \includegraphics[width=1cm]{cible.jpeg}}

%% \begin{center}
%% Cible = \scriptsize{00000000000000000254845fa930deac4086b3e3bce21147e93f463b206d8076}
%% \end{center}

%% %\includegraphics[width=8cm]{bitcoin-chain.pdf}

%% Trouver une nombre $n$ tel que \hfill  \includegraphics[width=1.25cm]{cible.jpeg}

%% \begin{center}
%%  SHA-256(SHA-256(Transactions, $n$)) = $x < Cible $

%% \ \\

%% \textcolor{red}{Avoir un  $0$ plus de au d\'ebut de $x$}
%% \end{center}

%% \pause

%% \begin{block}{Strat\'egie : brute force}

%% Tester toutes les valeurs possibles de $n$
%% \end{block}

%% \end{frame}
  
%% \begin{frame}
%%   \frametitle{Miner :  Proof of work}
%%  \begin{center}
%% \includegraphics[width=8cm]{bitcoin-chain.pdf}


%% {\bf \textcolor{red}{Avoir un z\'ero de plus au d\'ebut}}

%% $  \text{{SHA}-256}( \text{{SHA}-256}( \text{en-t\^ete de bloc} ) ) $
%% \end{center}
%% \begin{itemize}
%% \item les transactions pass\'ees (95 Go)
%% \item les transactions \`a valider
%% \item les secondes depuis 01/01/1970
%% \item un nonce
%% \item etc ...
%% \end{itemize}



%% \end{frame}


%% \begin{frame}
%%   \frametitle{Miner =  Validation des transactions}
%% Cible: \scriptsize{00000000000000000254845fa930deac4086b3e3bce21147e93f463b206d8076}

%% \begin{center}
%% \includegraphics[width=3cm]{blockchain}
%% \end{center}
%% \begin{itemize}
%% \item La cha\^ine la plus longue persiste (attaque 51 \%)
%% \item Validation toutes les 10 minutes (6 confirmations)
%% \end{itemize}



%% %\includegraphics[width=8cm]{bitcoin-validable.pdf}
%% \begin{center}
%% \includegraphics[width=8.5cm]{orphelins}
%% \end{center}

%% \end{frame}

%% %\subsection{Altcoins}

%% \begin{frame}
%%   \frametitle{Autres crypto-monnaies}

%% \includegraphics[width=11cm]{all-crypto-monnaie.jpeg}

%% %% \includegraphics[width=1.5cm]{peercoin}
%% %% \includegraphics[width=1.5cm]{litecoin}
%% %% \includegraphics[width=1.5cm]{blackcoin}
%% %% \includegraphics[width=1.5cm]{vericoin}
%% %% \includegraphics[width=1.5cm]{megacoin}
%% %% \includegraphics[width=1.5cm]{primecoin}
%% %% \includegraphics[width=1.5cm]{namecoin}

%% %% \includegraphics[width=1.5cm]{quarkcoin}
%% %% \includegraphics[width=1.5cm]{novacoin}
%% %% \includegraphics[width=1.5cm]{feathercoin}
%% %% \includegraphics[width=1.5cm]{digitalcoin}
%% %% \includegraphics[width=1.5cm]{zetacoin}
%% %% \includegraphics[width=1.5cm]{fastcoin}
%% %% \includegraphics[width=1.5cm]{capricoin}

%% %% \includegraphics[width=1.5cm]{acoin}
%% %% \includegraphics[width=1.5cm]{catcoin}
%% %% \includegraphics[width=1.5cm]{guncoin}
%% %% \includegraphics[width=1.5cm]{cannabiscoin}
%% %% \includegraphics[width=1.5cm]{phoenixcoin}
%% %% \includegraphics[width=1.5cm]{magicoin}
%% %% \includegraphics[width=1.5cm]{rubycoin}


%% %\url{https://walletgenerator.net}
%% \end{frame}




%% \begin{frame}
%%   \frametitle{Classification des Altcoins}

%% \begin{enumerate}
%% \item ``Pourris coins'' \vspace{-.45cm}
%% \item Cl\^ones de Bitcoin \hfill  \vspace{-.1cm} \includegraphics[width=1cm]{guncoin} \includegraphics[width=4cm]{PotCoin.png}
%% \item Minage plus utiles, moins \'energivores \hfill \includegraphics[width=1cm]{primecoin} \includegraphics[width=1cm]{Curecoin} \includegraphics[width=1cm]{foldingcoin}
%% \item Non-bas\'es sur la preuve de travail
%% \vspace{-.5cm}\begin{itemize}
%% \item Proof of Stake (Peercoin) \hfill \includegraphics[width=1cm]{peercoin}
%% \item Proof of Retreivability (Permacoin)
%% \item Proof of Capacity (Burstcoin)
%% \item Proof of Space (SpaceMint)
%% \end{itemize}
%% \end{enumerate}

%% \hfill \includegraphics[width=3cm]{share.png} \hfill \includegraphics[width=3cm]{stockage-cloud.jpeg} \hfill  \includegraphics[width=3cm]{armoire.jpeg}


%% \end{frame}



%% \begin{frame}
%%   \frametitle{Bitcoin : Crypto-monnaie d\'emat\'erialis\'ee d\'ecentralis\'ee}


%% \begin{itemize}
%% \item Preuve de travail = Objectif de Hachage
%% \item Cr\'eation de la monnaie = r\'ecompense aux mineurs
%% \item Miner = difficle + energivore


%% \hfill  \includegraphics[width=3cm]{miner-300x237.png}  \hfill  \includegraphics[width=1.5cm]{picto-61.png} \hfill  \includegraphics[width=3cm]{arnaques-travaux-energetiques.jpeg} \hfill ~
%% \end{itemize}

%% \pause

%% \begin{itemize}
%% \item Perte ou vol de la clef secr\`ete = irr\'eversible
%% \item Monnaie anonyme et tra\c{c}able
%% \end{itemize}

%% \hfill
%%   \includegraphics[width=2cm]{the_gang_char_thief_sq.png} 
%% \includegraphics[width=2cm]{anonymous.jpeg}   \includegraphics[width=2cm]{SetWidth210-traceability2.png}

%% \end{frame}
  

%% \section{DNSSEC}

%% \begin{frame}
%% \frametitle{DNS: Domain Name System}

%% \begin{itemize}
%% \item IPv4 : \texttt{xxx.xxx.xxx.xxx}, where \texttt{xxx} $\in \{0,255\}$
%% \item IPv6 : \texttt{xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx},  where \texttt{xxxx} is a hexadecimal
%% \end{itemize}

%% \begin{center}
%% 216.58.198.195 = www.google.fr
%% \end{center}

%% \begin{itemize}
%% \item Top-Level Domain (TLD)  racine fr
%% \item 2eme niveau : google
%% \item 3eme niveau : www
%% \end{itemize}

%% AFNIC : Association Fran\c{c}aise pour le Nommage Internet en Coop\'eration

%% ICANN : Internet Corporation for Assigned Names and Numbers 
%% \end{frame}


%% \begin{frame}[fragile]
%% \frametitle{Where are DNS Server ?}

%% \includegraphics[width=8cm]{DNS-server.png}

%% http://www.root-servers.org/
 
%% The 13 root name servers are operated by 12 independent organisations


%% \end{frame}

%% \begin{frame}[fragile]
%% \frametitle{List of Root Servers}

%% \begin{footnotesize}

%% 13 is max number of named authorities in the delegation data for the root zone

%% \hspace*{-1cm}\begin{tabular}{lll}
%% Hostname & 	IP Addresses& 	Manager\\ \hline

%% a.root-servers.net &198.41.0.4, 2001:503:ba3e::2:30 &VeriSign, Inc.\\
%% b.root-servers.net &199.9.14.201, 2001:500:200::b &Univ. of Southern California (ISI)\\
%% c.root-servers.net &192.33.4.12, 2001:500:2::c &Cogent Communications\\
%% d.root-servers.net &199.7.91.13, 2001:500:2d::d &University of Maryland\\
%% e.root-servers.net &192.203.230.10, 2001:500:a8::e &NASA (Ames Research Center)\\
%% f.root-servers.net &192.5.5.241, 2001:500:2f::f &Internet Systems Consortium, Inc.\\
%% g.root-servers.net &192.112.36.4, 2001:500:12::d0d &US Department of Defense (NIC)\\
%% h.root-servers.net &198.97.190.53, 2001:500:1::53 &US Army (Research Lab)\\
%% i.root-servers.net &192.36.148.17, 2001:7fe::53 &Netnod\\
%% j.root-servers.net &192.58.128.30, 2001:503:c27::2:30 &VeriSign, Inc.\\
%% k.root-servers.net &193.0.14.129, 2001:7fd::1 &RIPE NCC\\
%% l.root-servers.net &199.7.83.42, 2001:500:9f::42 &ICANN\\
%% m.root-servers.net &202.12.27.33, 2001:dc3::35 & WIDE Project\\
%% \end{tabular}
%% \end{footnotesize}

%% https://www.icann.org/news/blog/there-are-not-13-root-servers

%% https://www.iana.org/domains/root/servers

%% DNS Cache poisonning
%% \end{frame}

%% \begin{frame}[fragile]
%% \frametitle{Several hops}

%% \begin{verbatim}
%% nslookup www.google.fr

%% Server:		193.49.117.110
%% Address:	193.49.117.110#53

%% Non-authoritative answer:
%% Name:	www.google.fr
%% Address: 216.58.205.163
%% \end{verbatim}

%% dig www.google.com aaaa

%% \end{frame}


%% \begin{frame}
%% \frametitle{DNSSec: RFC4033, RFC4043, RFC4035}

%% Ensure authentication, integrity of data.

%% \end{frame}


%% \begin{frame}
%% \frametitle{DNSSec = DNS + Security}

%% Add

%% \begin{itemize}
%% \item RRSIG : signature  for authentication of RRSet.
%% \item DNSKEY : Key Signing Key (KSK) and Zone Signing Key (ZSK)
%% \item DS : pointe to the KSK of a child zone
%% \end{itemize}

%% \end{frame}


%% \begin{frame}
%% \frametitle{RRSIG}

%% \begin{itemize}
%% \item Domain name
%% \item TTL (Time To Live)
%% \item Class
%% \item Type
%% \item Cryptography suite used
%% \item Number of labels
%% \item Expiration date
%% \item Id of the signer
%% \end{itemize}

%% \end{frame}



%% \begin{frame}[fragile]
%% \frametitle{Example}

%% \begin{verbatim}
%% www.exemple.org. 86400 IN RRSIG A 10 3 86400
%%        20130316101137 (
%%        20130517060654 49703 exemple.org.
%%        mXS6b [...] xOg ==)
%% \end{verbatim}
%% \begin{itemize}
%% \item le type d'enregistrement concern\'e est A ;
%% \item la suite cryptographique utilis\'e 10 (RSA-SHA256) ;
%% \item le nombre de labels est 3 ;
%% \item le TTL originel est 86400 ;
%% \item la signature expire le 16 juin 2013 ;
%% \item et elle est valide \`a partir du 15 mai 2013 ;
%% \item l'identifiant de la clef de signature est 49703 ;
%% \item le nom de domaine du signataire est exemple.org ;
%% \item la signature est mXS6b [. . .] xOg.
%% \end{itemize}
%% id clef = somme 2 \`a 2 des octets
%% \end{frame}



%% \begin{frame}
%% \frametitle{}
%% \begin{itemize}
%% \item la ZSK est utilis\'ee par une zone pour signer tous ses enregistrements ;
%% \item la KSK est utilis\'ee par une zone pour authentifier sa clef ZSK en la signant. La KSK
%% est authentifi\'ee par la ZSK de sa zone parente.
%% \end{itemize}

%% p\'eriode de renouvellement :  6 mois pour une ZSK et 2 \`a  3 ans pour une KSK.
%% \end{frame}


%% \begin{frame}
%% \frametitle{Chaine de confiance}

%% \begin{center}
%% \includegraphics[width=5cm]{dnssec.png}
%% \end{center}


%% \end{frame}




%% \begin{frame}
%% \frametitle{NSEC et NSEC3.}
%% \begin{block}{NSEC (Next SECure)}

%% pour la non-existence d'un nom de domaine.

%% Donne  le prochain nom de domaine valide : PB : NSEC walking discover !
%% \end{block}

%% \begin{block}{NSEC3 ([RFC5155])}

%% remplace le prochain nom de domaine par l’empreinte des deux noms de
%%  domaine qui encadrent le nom inexistant.
%%  \end{block}
 
%% \end{frame}

%% \section{BoF}

%% \begin{frame}
%% \frametitle{Idea of a BOF}

%% \begin{block}{Definiition}
%% When a programm is writing data to a buffer, overruns the buffer's
%% boundary and overwrites adjacent memory (violation of memory safety).
%% \end{block}

%%  Consequence: erratic program behavior, including 
%% \begin{itemize}
%% \item memory access errors,
%% \item incorrect results, 
%% \item a crash,
%% \item or a {\bf breach of system security}.
%% \end{itemize}

%%  ``Smashing the Stack for Fun and Profit'' by Aleph One.
%% \end{frame}

%% \begin{frame}[fragile]
%% \frametitle{Simple Example to understand the memory}

%% \begin{verbatim}
%% char           A[8] = {};
%% unsigned short B    = 1979;
%% \end{verbatim}

%% \begin{block}{State of the memory}
%% \begin{center}
%% \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}
%% \hline
%% variable name &	A &	B \\ \hline
%% value &	[null string] &	1979 \\ \hline
%% hex value & 00 00 00 00 00 00 00 00 & 07 BB \\ \hline
%% \end{tabular}
%% \end{center}
%% \end{block}
%% \end{frame}

%% \begin{frame}[fragile]
%% \frametitle{Simple Command}

%% \begin{verbatim}
%% strcpy(A, "excessive");
%% \end{verbatim}

%% "excessive" is 9 characters long and encodes to 10 bytes including the
%% terminator, but A can take only 8 bytes. By failing to check the
%% length of the string, it also overwrites the value of B:

%% \begin{block}{State of the memory}
%% \begin{center}
%% \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}
%% \hline
%% variable name & 	A &	B \\ \hline
%% value &	'e' 	'x' 	'c' 	'e' 	's' 	's' 	'i' 	'v'&
%% 25856 \\ \hline
%% hex &	65 	78 	63 	65 	73 	73 	69 	76  &
%% 65 	00\\ \hline
%% \end{tabular}
%% \end{center}
%% \end{block}

%% B's value has now been inadvertently replaced by a number formed from
%% part of the character string. In this example "e" followed by a zero
%% byte would become 25856
%% \end{frame}



%% \subsection{How to mount an attack}


%% \begin{frame}
%%   \frametitle{Several choices by overwriting}

%% \begin{itemize}
%% \item  a local variable near the buffer in memory on the stack to change the behavior of the program
%% \item the return address in a stack frame. Once the function returns,
%%   execution will resume at the return address as specified by the
%%   attacker
%% \item function pointer[1] or exception handler, which is subsequently
%%   executed
%% \item a parameter of a different stack frame or a non-local address
%%   pointed to in the current stack context[2]
%% \end{itemize}

%% \end{frame}


%% \begin{frame}[fragile]
%% \frametitle{Na\"ive Password Code}
%% \begin{verbatim}
%% #include <stdio.h>
%% #include <string.h>
%% int main(void){  
%%  char buff[9];    int pass = 0;
 
%%  printf("\n Enter the password :");
%%  gets(buff);

%%  if(strcmp(buff, "IUTisfun!")) printf ("Bad Pwd \n");
%%  else {
%%         printf ("\n Correct Password \n");
%%         pass = 1; }
%%  if (pass) printf ("\n Root Login \n");
%%  return 0;
%% }
%% \end{verbatim}
%% \end{frame}

%% \begin{frame}[fragile]
%% \frametitle{Simple Tests}

%% \begin{block}{Good password}
%% \begin{verbatim}
%%  Enter the password : IUTisfun!
%%  Correct Password 
%%  Root Login
%% \end{verbatim}
%% \end{block}

%% \begin{block}{Good password}
%% \begin{verbatim}
%%  Enter the password : IUTisfuny
%%  Bad Pwd
%% \end{verbatim}
%% \end{block}

%% \end{frame}

%% \begin{frame}[fragile]
%% \frametitle{Attack !}
%% \begin{block}{Abnormal execution}
%% \begin{verbatim}
%%  Enter the password : 1234567899
%%  Correct Password 
%%  Root Login
%% \end{verbatim}
%% \end{block}

%% Why? 

%% \pause

%% C programming language assumes any non-zero and non-null values as true,
%% \pause

%% The value of pass has been overwriteen by something different of 0, so
%% the programm always give the Root privileges to the user.
%% \end{frame}


%% \begin{frame}[fragile]
%%   \frametitle{Stack-based Overflow }
%% % (``Smashing the Stack for Fun and Profit'' by Aleph One)}

%% \vspace{-1cm}
%% \begin{verbatim}
%% void f (){
%%   char buffer[4] ;
%%   int * ret ;
%%   ret = buffer + 5 ;
%%   (*ret) = *ret +8 ; /* skip  x=1 ; */
%% }  

%% void main(){
%%   int x ;
%%   x = 0 ;
%%   f();
%%   x=1 ;
%%   printf (3d\n », x);
%% }
%% \end{verbatim}
%% %Pile = ... @retour buffer[3] ... buffer[0] ret
%% % \end{frame}

%% % \begin{frame}
%% %   \frametitle{Stack-based Overflow }

%% \vspace{-6.5cm}

%% \hfill\begin{tikzpicture}

%% %\node[draw,circle,fill=gray!50] (A) at (0,0) {1} ;
%% %\node[draw,circle,fill=gray!50] (B) at (0,0) {1} ;

%% \node (A) at (0,0) {};
%% \node (B) at (0,4.5) {};

%% \node (C) at (2,0) {};
%% \node (D) at (2,4.5) {};

%% \node (E) at (0,.75) {};
%% \node (F) at (2,.75) {};

%% \node (G) at (0,1.25) {};
%% \node (H) at (2,1.25) {};

%% \node (I) at (0,1.75) {};
%% \node (J) at (2,1.75) {};

%% \node (K) at (0,2.25) {};
%% \node (L) at (2,2.25) {};

%% \node (M) at (0,2.75) {};
%% \node (N) at (2,2.75) {};

%% \node (O) at (0,3.25) {};
%% \node (P) at (2,3.25) {};

%% \node (Q) at (0,3.75) {};
%% \node (R) at (2,3.75) {};

%% \draw[-] (A) -- (B);
%% \draw[-] (C) -- (D);
%% \draw[-] (E) -- (F);
%% \draw[-] (G) -- (H);
%% \draw[-] (I) -- (J);
%% \draw[-] (K) -- (L);
%% \draw[-] (M) -- (N);
%% \draw[-] (O) -- (P);
%% \draw[-] (Q) -- (R);

%% \node at (1,4.1) {$\vdots$};
%% \node at (1,0.5) {$\vdots$};
%% \node  at (1,1) {@return};
%% \node  at (1,1.5) {buffer[3]};
%% \node  at (1,2) {buffer[2]};
%% \node  at (1,2.5) {buffer[1]};
%% \node  at (1,3) {buffer[0]};
%% \node  at (1,3.5) {ret};

%% \draw(2,3.5)[-latex]..controls (3,2.5) and (3,1.5)..(2,1);

%% \end{tikzpicture}
%% \end{frame}

%% \begin{frame}[fragile]
%%   \frametitle{ShellCode}
%%   shellcode = executable binary code that can launch a shell
%%   '/bin/sh',  represented by a string.

%% \begin{verbatim}
%% char shellcode[] =
%%   "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46"
%%   "\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e"
%%   "\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8"
%%   "\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh";
%% \end{verbatim}
%% \end{frame}

%% \subsection{Some Counter Measures}

%% \begin{frame}
%%   \frametitle{Some counter measures}

%% \begin{itemize}
%% \item Use a ``safe'' language like Ada, Eiffel, Lisp, Modula-2, Smalltalk, OCaml.
%% \item Avoid standard library functions that does not check bounds, such as
%% {\bf gets, scanf and strcpy}

%% \item Address space layout randomization (ASLR)


%% \end{itemize}
%% \end{frame}


%% \begin{frame}
%%   \frametitle{Technique du canari}

%% Canaris (birds) were used to detect grizou gaz in mines.

%% \begin{block}{Principe}
%%   \begin{itemize}
%%   \item Store a secret value, generated at the execution, just before the
%% return address (between the end of the stack and the return address).

%% \item Check if this secrete value is modified or not, once the
%%   function is exectued. 
%%   \end{itemize}
%% \end{block}

%% It avoids execution of bad code but the  code size increase and the
%% call is slower.


%% \end{frame}



\section{Conclusion}

\begin{frame}
\frametitle{Conclusion}

\begin{itemize}
\item Bitcoin
\item Blockchain
\end{itemize}

% Art of Computer Virus Research and Defense by Peter Szor

% https://www.cs.duke.edu/courses/fall13/compsci590.5/lectures/05Malware.pdf

% https://engineering.purdue.edu/kak/compsec/NewLectures/Lecture22.pdf

\end{frame}




\begin{frame}
\frametitle{Projects}

3 groups of 3 persons to constitue as soon as possible.

\begin{enumerate}
\item EcomobiCoin
\item DriveCoin
\item AssureCoin
\end{enumerate}

\end{frame}

\begin{frame}
\frametitle{EcoMobiCoin}

Design a cryptocurrency that promotes the eco-responsible mobility:
walking, running, biking car-pooling, using public transportation ...
\end{frame}


\begin{frame}
\frametitle{DriveCoin}

Design a cryptocurrency that promotes drivers that are using less gaz
and have a eco-responible driving.

\end{frame}


\begin{frame}
\frametitle{AssureCoin}

Design a cryptocurrency that promotes drivers that are respecting the rules and they will have adapted prices for their insurrance.
\end{frame}



\end{document}
