updated
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 10 Nov 2015 22:28:03 +0000
changeset 426 6d13b8da019e
parent 425 4a0bff167159
child 427 33f872ba3546
updated
graphics.sty
handouts/ho08.pdf
handouts/ho08.tex
slides.sty
slides/slides08.pdf
slides/slides08.tex
--- a/graphics.sty	Fri Nov 06 08:51:53 2015 +0000
+++ b/graphics.sty	Tue Nov 10 22:28:03 2015 +0000
@@ -2,12 +2,15 @@
 \usepackage{pgf}
 \usetikzlibrary{positioning}
 \usetikzlibrary{calc}
+\usetikzlibrary{fit}
 \usepackage{graphicx} 
 \usepackage{pgfplots}
 
+
 \newenvironment{bubble}[1][]{%
+\addtolength{\leftmargini}{4mm}%
 \begin{tikzpicture}[baseline=(current bounding box.north)]%
 \draw (0,0) node[inner sep=2mm,fill=cream,ultra thick,draw=red,rounded corners=2mm]% 
 \bgroup\begin{minipage}{#1}\raggedright{}}
 {\end{minipage}\egroup;%
-\end{tikzpicture}}
+\end{tikzpicture}\bigskip}
Binary file handouts/ho08.pdf has changed
--- a/handouts/ho08.tex	Fri Nov 06 08:51:53 2015 +0000
+++ b/handouts/ho08.tex	Tue Nov 10 22:28:03 2015 +0000
@@ -2,9 +2,11 @@
 \usepackage{../style}
 \usepackage{../graphics}
 \usepackage{../langs}
+\usepackage{../data}
+
 
 \begin{document}
-\fnote{\copyright{} Christian Urban, 2014}
+\fnote{\copyright{} Christian Urban, 2014, 2015}
 
 \section*{Handout 8 (Bitcoins)}
 
@@ -397,8 +399,7 @@
 controlled by changing the target according to the available
 computational power available. I think the adjustment of the
 hardness of the problems is done every 2060 blocks
-(appr.~every two weeks). I am not sure whether this is an
-automatic process. The aim of the adjustment is that on
+(appr.~every two weeks). The aim of the adjustment is that on
 average the Bitcoin network will most likely solve a puzzle
 within 10 Minutes. 
 
@@ -530,19 +531,21 @@
 group.
 
 Connected with the 6-confirmation rule is an interesting
-phenomenon. On average, it would take several years for a typical
-computer to solve a proof-of-work puzzle, so an individual’s chance of
-ever solving one before the rest of the world, which typically takes
-only 10 minutes, is negligibly low. Therefore many people join groups
-called \emph{mining pools} that collectively work to solve blocks, and
-distribute rewards based on work contributed. These mining pools act
-somewhat like lottery pools among co-workers, except that some of
-these pools are quite large, and comprise more than 20\% of all the
-computers in the network. It is said that BTC, a large mining pool,
-has limited its number of members in order to not solve more than 6
-blocks in a row. Otherwise this would undermine the trust in Bitcoins,
-which is also not in the interest of BTC, I guess.  Some statistics on
-mining pools can be seen at
+phenomenon. On average, it would take several years for a
+typical computer to solve a proof-of-work puzzle, so an
+individual’s chance of ever solving one before the rest of the
+world, which typically takes only 10 minutes, is negligibly
+low. Therefore many people join groups called \emph{mining
+pools} that collectively work to solve blocks, and distribute
+rewards based on work contributed. These mining pools act
+somewhat like lottery pools among co-workers, except that some
+of these pools are quite large, and comprise more than 20\% of
+all the computers in the network. It is said that BTCC, a
+large mining pool, has limited its number of members in order
+to not solve more than 6 blocks in a row. Otherwise this would
+undermine the trust in Bitcoins, which is also not in the
+interest of BTCC, I guess. Some statistics on mining pools can
+be seen at
 
 \begin{center}
 \url{https://blockchain.info/pools}
@@ -550,11 +553,12 @@
 
 \subsubsection*{Bitcoins for Real}
 
-Let us now turn to the nitty gritty details. As a participant in the
-Bitcoin networ you need to generate and store a public-private key
-pair. The public key you need to advertise in order to receive
-payments (transactions). The private key needs to be securely stored.
-For this there seem to be three possibilities
+Let us now turn to the nitty gritty details. As a participant
+in the Bitcoin network you need to generate and store a
+public-private key pair. The public key you need to advertise
+in order to receive payments (transactions). The private key
+needs to be securely stored. For this there seem to be three
+possibilities
 
 \begin{itemize}
 \item an electronic wallet on your computer
@@ -562,13 +566,14 @@
 \item paper-based
 \end{itemize}
 
-\noindent The first two options of course offer convenience for making
-and receiving transactions. But given the nature of the private keys
-and how much security relies on them (recall if somebody gets hold of
-it, your Bitcoins are quickly lost forever) I would opt for the third
-option for anything except for trivial amounts of Bitcoins. As we have
-seen earlier in the course, securing a computer system that it can
-withstand a breakin is still very much an unsolved problem.
+\noindent The first two options of course offer convenience
+for making and receiving transactions. But given the nature of
+the private keys and how much security relies on them (recall
+if somebody gets hold of it, your Bitcoins are quickly lost
+forever) I would opt for the third option for anything except
+for trivial amounts of Bitcoins. As we have seen earlier in
+the course, securing a computer system that it can withstand a
+targeted breakin is still very much an unsolved problem.
 
 An interesting fact with Bitcoin keys is that there is no
 check for duplicate addresses. This means when generating a
@@ -650,7 +655,7 @@
 selling computing power that you can use to run your web site,
 for example. It is \emph{elastic} in the sense that if you
 have a lot of visitors, you pay a lot, if you have only a few,
-then it is cheap. In order to bill you they, you need to set
+then it is cheap. In order to bill you, you need to set
 up an account with Amazon and receive some secret keys in
 order to authenticate you. The clever (but also dangerous) bit
 is that you upload the code of your web site to GitHub and
--- a/slides.sty	Fri Nov 06 08:51:53 2015 +0000
+++ b/slides.sty	Tue Nov 10 22:28:03 2015 +0000
@@ -38,8 +38,9 @@
 \begin{tabular}{@{}c@{}}%
 \insertframetitle%
 \end{tabular}%
-\end{minipage}}%
+\end{minipage}\vspace{-10pt}}%
 }
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
@@ -61,6 +62,7 @@
 \setlength\leftmargini{2mm}
 \setlength\leftmarginii{0.6cm}
 \setlength\leftmarginiii{1.5cm}
+\setbeamertemplate{itemize/enumerate body end}{\vspace{-2mm}}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % blocks
Binary file slides/slides08.pdf has changed
--- a/slides/slides08.tex	Fri Nov 06 08:51:53 2015 +0000
+++ b/slides/slides08.tex	Tue Nov 10 22:28:03 2015 +0000
@@ -2,6 +2,7 @@
 \usepackage{../slides}
 \usepackage{../graphics}
 \usepackage{../langs}
+\usepackage{../data}
 
 \usetikzlibrary{shapes}
 
@@ -38,7 +39,7 @@
 
   \normalsize
   \begin{center}
-  \begin{tabular}{ll}Ch
+  \begin{tabular}{ll}
   Email:  & christian.urban at kcl.ac.uk\\
   Office: & S1.27 (1st floor Strand Building)\\
   Slides: & KEATS (also homework is there)\\
@@ -49,49 +50,6 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}
-\frametitle{Interlock Protocol}
-
-invented by  Ron Rivest and Adi Shamir (198X?)
-
-\begin{center}
-\begin{tabular}{ll@{\hspace{2mm}}l}
-1. & $A \to B :$ & $K^{pub}_A$\smallskip\\
-2. & $B \to A :$ & $K^{pub}_B$\smallskip\\
-3. & & $\{A,m\}_{K^{pub}_B} \;\mapsto\; H_1,H_2$\\
-   & & $\{B,m'\}_{K^{pub}_A} \;\mapsto\; M_1,M_2$\\
-4. & $A \to B :$ & $H_1$\smallskip\\
-5. & $B \to A :$ & $\{H_1, M_1\}_{K^{pub}_A}$\smallskip\\
-6. & $A \to B :$ & $\{H_2, M_1\}_{K^{pub}_B}$\smallskip\\
-7. & $B \to A :$ & $M_2$
-\end{tabular}
-\end{center}
-
-\end{frame}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}
-\frametitle{Car \& Transponder}
-
-\begin{enumerate}
-\item $C$ generates a random number $N$
-\item $C$ calculates $\{N\}_K \mapsto F,G$
-\item $C \to T$: $N, F$
-\item $T$ calculates $\{N\}_K \mapsto F',G'$
-\item $T$ checks that $F = F'$
-\item $T \to C$: $N, G'$
-\item $C$ checks that $G = G'$
-\end{enumerate}
-
-Does the car authenticate the transponder? Does the
-transponder authenticate the car?
-
-\end{frame}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % student prticipation
 %\begin{frame}
 %\frametitle{Bitcoins}
@@ -117,7 +75,7 @@
   of bitcoins 
 \item can be stolen and also lost
 \item anonymous?\pause
-\item surely a ponzi scheme!
+\item surely a scam/ponzi scheme!
 \end{itemize}
 
 \begin{textblock}{7}(11.5,10)
@@ -141,9 +99,9 @@
 \end{itemize}
 and contains only the public-private key
 
-\item Bitcoins can be stolen and lost
+\item Bitcoins can be stolen or lost
 \item Mt.~Gox: hacked $\Rightarrow$ insolvent
-\item no form of dispute resolution (against current
+\item no form of dispute resolution\\ (against current
 consumer laws)
 \end{itemize}
 
@@ -151,7 +109,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}
+\begin{frame}[c]
 \frametitle{Underlying Ideas}
 
 It establishing trust in a completely 
@@ -172,8 +130,8 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}[t]
-\frametitle{Lets Start with Infocoins}
+\begin{frame}[c]
+\frametitle{Lets Start with ``Infocoins''}
 
 \begin{center}
 \bl{$\{\text{I, Alice, am giving Bob one infocoin.}\}_{K^{priv}_{Alice}}$}
@@ -217,7 +175,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}[t]
+\begin{frame}[c]
 \frametitle{No Banks Please}
 
 With banks we could implement:
@@ -244,9 +202,9 @@
 \begin{itemize}
 \item make everybody the bank, everybody has the entire
       transaction history --- will be called
-      \alert{blockchain}\medskip
-\item Bob checks whether infocoin belongs to Alice and then
-      broadcasts the message to anybody else 
+      \alert{\bf blockchain}\medskip
+\item Bob checks whether the infocoin belongs to Alice and then
+      broadcasts the message to everybody else\\[-10mm]\mbox{}
 \end{itemize}
 
 \begin{center}
@@ -288,31 +246,25 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}[t]
+\begin{frame}[squeeze]
 \frametitle{Double Spend Again}
 
-\begin{bubble}[10cm]\addtolength{\leftmargini}{5mm}
+\begin{bubble}[10cm]
 \begin{itemize}
 \item I , Alice, am giving Bob one infocoin, with serial
-      number 1234567.
+      number 1234567. 
 \item I, Alice, am giving \alt<2->{\alert{Alice}}{Charlie} 
       one infocoin with number 1234567.
 \end{itemize}
-\end{bubble}\bigskip
+\end{bubble}
 
 How should other people update their blockchain (public
-register)?\pause
-
+register)?\\[-10mm]\mbox{}\pause
 
 \begin{center}
-\includegraphics[scale=0.3]{../pics/bitcoindisagreement.png}
+\hspace{15mm}\includegraphics[scale=0.35]{../pics/bitcoindisagreement.png}
 \end{center}
 
-
-Once enough people have broadcast that message, everyone
-updates their block chain to show that infocoin 1234567 now
-belongs to Bob, and the transaction is complete.
-
 \end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
@@ -324,7 +276,7 @@
 Once \alert{enough} people have broadcast that message, 
 everyone updates their block chain to show that infocoin 
 1234567 now belongs to Bob, and the transaction is accepted.
-\end{bubble}\bigskip\bigskip
+\end{bubble}\bigskip
 \pause
 
 \small
@@ -342,10 +294,9 @@
 \frametitle{!! Proof-of-Work !!}
 
 The idea is counterintuitive and involves a combination of two
-ideas:\bigskip
+ideas:
 
 \begin{bubble}[10cm]
-\addtolength{\leftmargini}{5mm}
 \begin{itemize}
 
 \item to (artificially) make it computationally costly for
@@ -353,7 +304,7 @@
 
 \item to reward them for trying to help validate transactions
 \end{itemize}
-\end{bubble}\pause\bigskip
+\end{bubble}\pause
 
 \small
 this is called mining: whoever validates a transaction will be awarded with
@@ -401,19 +352,60 @@
 \includegraphics[scale=0.37]{../pics/blockchainsolving.png}
 \end{center}
 
-%\begin{textblock}{7}(7,10)
-%10 mins
-%\end{textblock}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[t]
+\frametitle{Controlling the Hardness}
+
+\begin{itemize}
+\item every 210000 blocks the amount of bitcoins to be 
+  mined halves (``reward era'')
+\item every 2016 blocks the hardness is adjusted\\ (app 2 weeks)
+\end{itemize}
+
+\begin{center}
+\begin{tikzpicture}
+\begin{axis}[
+    xlabel={\footnotesize year},
+    ylabel={\footnotesize \% of total bitcoins},
+    ylabel style={yshift=0.0em},
+    enlargelimits=false,
+    xtick={2009,2011,...,2025},
+    xmin=2009,
+    xmax=2026,
+    ymax=105,
+    ymin=0,
+    ytick={0,20,...,100},
+    scaled ticks=false,
+    axis lines=left,
+    width=9cm,
+    height=6cm,
+    legend entries={\footnotesize plan,\footnotesize in reality 2\% ahead},  
+    legend pos=south east,
+    legend cell align=left,  
+    y tick label style={font=\footnotesize}, 
+    x tick label style={font=\footnotesize,/pgf/number format/1000 sep={}} 
+    ]
+\addplot
+  table {bitcoinestimate.data};
+\only<2>{\addplot[red] 
+  table {bitcoinactual.data};}
+\end{axis}
+\end{tikzpicture}
+\end{center}
 
 \end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \begin{frame}[t]
 \frametitle{Order of Transactions}
 
 If we don’t have such an ordering at any given moment 
-then it may not be clear who owns which infocoins.
+then it may not be clear who owns which Bitcoins.
 
 \begin{center}
 \includegraphics[scale=0.38]{../pics/bitcoin_unconfirmed.png}
@@ -506,7 +498,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}[t]
+\begin{frame}[c]
 \frametitle{Mining Pools}
 
 \begin{bubble}[10cm]
@@ -514,7 +506,7 @@
 to solve a block, so an individual’s chance of ever solving
 one before the rest of the network, which typically takes 10
 minutes, is negligibly low.
-\end{bubble}\bigskip\pause
+\end{bubble}\pause
 
 \small
 Many people join groups called mining pools that collectively
@@ -525,7 +517,7 @@
 network.\medskip
 
 \footnotesize
-BTC, the largest mining pool, has limited its members to 
+BTCC, the largest mining pool, has limited its members to 
 not solve more than 6 blocks in a row.
 
 \end{frame}
@@ -558,18 +550,18 @@
                  numbersep=3pt, 
                  xleftmargin=-6mm]{msg}
 
-\DOWNarrow{2}{3.5}{1.6}
-\LEFTarrow{3}{3.5}{3}
-\LEFTarrow{4}{4.7}{4}
-\LEFTarrow{4}{5.4}{4.8}
-\LEFTarrow{5}{5.4}{5.6}
-\LEFTarrow{6}{5}{6.4}
-\DOWNarrow{7}{6}{8.2}
-\LEFTarrow{8}{5}{9.7}
-\DOWNarrow{9}{7}{9.7}
-\DOWNarrow{9}{10}{9.7}
-\LEFTarrow{10}{9}{12}
-\DOWNarrow{11}{12.5}{12}
+\DOWNarrow{2}{3.5}{1.4}
+\LEFTarrow{3}{3.5}{2.8}
+\LEFTarrow{4}{4.7}{3.8}
+\LEFTarrow{4}{5.4}{4.6}
+\LEFTarrow{5}{5.4}{5.4}
+\LEFTarrow{6}{5.0}{6.2}
+\DOWNarrow{7}{6.0}{8.0}
+\LEFTarrow{8}{5.0}{9.5}
+\DOWNarrow{9}{7.0}{9.5}
+\DOWNarrow{9}{10.0}{9.5}
+\LEFTarrow{10}{9.0}{11.8}
+\DOWNarrow{11}{12.5}{11.9}
 
 
 \begin{textblock}{0}(7,3)%