From 414abf9cdaeddf888fbdc19cb22d1482389dd8fc Mon Sep 17 00:00:00 2001 From: Jeff Burdges Date: Mon, 9 May 2016 01:37:41 +0200 Subject: Initial discriotion of offline payments The notation here gets horrible because I started from the post-quantum write up. And it has slightly different needs. --- doc/paper/offline.tex | 228 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 doc/paper/offline.tex diff --git a/doc/paper/offline.tex b/doc/paper/offline.tex new file mode 100644 index 000000000..7913ceb94 --- /dev/null +++ b/doc/paper/offline.tex @@ -0,0 +1,228 @@ +\documentclass{llncs} +%\usepackage[margin=1in,a4paper]{geometry} +\usepackage[T1]{fontenc} +\usepackage{palatino} +\usepackage{xspace} +\usepackage{microtype} +\usepackage{tikz,eurosym} +\usepackage{amsmath,amssymb} +\usepackage{enumitem} +\usetikzlibrary{shapes,arrows} +\usetikzlibrary{positioning} +\usetikzlibrary{calc} + +% Relate to: +% http://fc14.ifca.ai/papers/fc14_submission_124.pdf + +% Terminology: +% - SEPA-transfer -- avoid 'SEPA transaction' as we use +% 'transaction' already when we talk about taxable +% transfers of Taler coins and database 'transactions'. +% - wallet = coins at customer +% - reserve = currency entrusted to exchange waiting for withdrawal +% - deposit = SEPA to exchange +% - withdrawal = exchange to customer +% - spending = customer to merchant +% - redeeming = merchant to exchange (and then exchange SEPA to merchant) +% - refreshing = customer-exchange-customer +% - dirty coin = coin with exposed public key +% - fresh coin = coin that was refreshed or is new +% - coin signing key = exchange's online key used to (blindly) sign coin +% - message signing key = exchange's online key to sign exchange messages +% - exchange master key = exchange's key used to sign other exchange keys +% - owner = entity that knows coin private key +% - transaction = coin ownership transfer that should be taxed +% - sharing = coin copying that should not be taxed + +\def\mathcomma{,} +\def\mathperiod{.} + + +\title{Offline Taler} + +\begin{document} +\mainmatter + +\author{Jeffrey Burdges} +\institute{Intria / GNUnet / Taler} + + +\maketitle + +% \begin{abstract} +% \end{abstract} + + +% \section{Introduction} + + + +% \section{Taler's refresh protocol} + +\def\Nu{N} +\def\newmathrm#1{\expandafter\newcommand\csname #1\endcsname{\mathrm{#1}}} +\newmathrm{FDH} + + +We shall describe Taler's refresh protocol in this section. +All notation defined here persists throughout the remainder of + the article. + +We let $\kappa$ denote the exchange's taxation security parameter, +meaning the highest marginal tax rate is $1/\kappa$. Also, let +$n_\mu$ denote the maximum number of coins returned by a refresh. + +\smallskip + +Let $\iota$ denote a coin idetity paramater that + links together the different commitments but must reemain secret + from the exchange. + +Let $n_\nu$ denote the identity security paramater. +An online coin's identity commitment $\Nu$ is the empty string. +In the offline coin case, we begin with a reserve public key $R$ +and a private identity commitment seed $\nu$. +For $k \le n_\nu$, we define +\[ \begin{aligned} +\nu_{k,0} &= H(\nu || i) \mathcomma \\ +\nu_{k,1} &= H(\nu || i) \oplus R \mathcomma \\ +\Nu_k &= H(\nu_{k,0} || \nu_{k,1} || H(\iota || k) ) \mathperiod \\ +\end{aligned} \] +% We define $\Nu = H( \Nu_i \quad\textrm{for $k \le n_\nu$})$ finally. + +\smallskip + +A coin $(C,\Nu,S)$ consists of + a Ed25519 public key $C = c G$, + an optional set of offline identity commitments $\Nu = \{\Nu_k | k \in \Gamma \}$ + an RSA-FDH signature $S = S_d(\FDH(C) * \Pi_{k \in \Gamma} \FDH(\Nu_k))$ by a denomination key $d$. +A coin is spent by signing a contract with $C$. The contract must +specify the recipiant merchant and what portion of the value denoted +by the denomination $d$ they recieve. + +There was of course a blinding factor $b$ used in the creation of +the coin's signature $S$. In addition, there was a private seed $s$ +used to generate $c$ and $b$ but we need not retain $s$ +outside the refresh protocol. +$$ c = H(\textrm{"Ed25519"} || s) +\qquad b = H(\textrm{"Blind"} || s) $$ +We generate $\nu = H("Offline" || s)$ from $s$ as well, + but only for offline coins. + +\smallskip + +We begin refresh with a possibly tainted coin $(C,S)$ whose value +we wish to save by refreshing it into untainted coins. + +In the change sitaution, our coin $(C,\Nu,S)$ was partially spent and +retains only a part of the value determined by the denominaton $d$. + +For $x$ amongst the symbols $c$, $C$, $b$, and $s$, +we let $x_{j,i}$ denote the value normally denoted $x$ of + the $j$th cut of the $i$th new coin being created. +% So $C_{j,i} = c_{j,i} G$, $\Nu_{j,i}$, $m_{j,i}$, and $b^{j,i}$ +% must be derived from $s^{j,i}$ as above. +We need only consider one such new coin at a time usually, +so let $x'$ denote $x_{j,i}$ when $i$ and $j$ are clear from context. +In other words, $c'$, and $b_j$ are derived from $s_j$, + and both $C' = c' G$. + + +\paragraph{Wallet phase 1.} +\begin{itemize} +\item For $i = 1 \cdots n$, create random coin ids $\iota_i$. +\item For $j = 1 \cdots \kappa$: + \begin{itemize} + \item Create random $\zeta_j$ and $l_j$. + \item Also compute $L_j = l_j G$. + \item Set $k_j = H(l_j C || \eta_j)$. + \end{itemize} +\smallskip +\item For $i = 1 \cdots n$: + \begin{itemize} + \item Create random pre-coin id $\iota'_i$. + \item Set $\iota_i = H("Id" || \iota'_i)$. + \item $j = 1 \cdots \kappa$: + \begin{itemize} + \item Set $s' = H(\zeta_j || i)$. + \item Derive $c'$ and $b'$from $s'$ as above. + \item Compute $C' = c' G$ too. + \item Compute $B_{j,i} = B_{b'}(C' || H(\iota_i || H(s')))$. + \item Encrypt $\Gamma'_{j,i} = E_{k_j}(s')$. + \item Set the coin commitments $\Gamma_{j,i} = (\Gamma'_{j,i},B_{j,i})$. + \end{itemize} + \item For $k = 1 \cdots 2 n_\nu$: + \begin{itemize} + \item Set $\nu_k = H(\iota'_i || k)$. + \item Generate $\Nu_k$ from $\nu_k$ and $H(\iota_i || k)$. + \item Set the coin commitment $\Gamma_{\kappa+k,i} = B_{b'}(\Nu_{i,k})$. + \end{itemize} + \end{itemize} +\smallskip +\item Save $\zeta_*$ and $\iota'_*$. +\item Send $(C,S)$ and the signed commitments + $\Gamma_* = S_C( \Gamma_{j,i} \quad\textrm{for $j=1\cdots\kappa+2n_\nu, i=0 \cdots n$} )$. +\end{itemize} + +\paragraph{Exchange phase 1.} +\begin{itemize} +\item Verify the signature $S$ by $d$ on $C$. +\item Verify the signatures by $C$ on the $\Gamma_{j,i}$ in $\Gamma_*$. +\item Pick random $\gamma \in \{1 \cdots \kappa\}$. +\item Pick random $\Gamma \subset \{1,\ldots,2 n_\nu\}$ with $|\Gamma| = n_\nu$. +\item Mark $C$ as spent by saving $(C,\gamma,\Gamma,\Gamma_*)$. +\item Send $(\gamma,\Gamma)$ as $S(C,\gamma)$. +\end{itemize} + +\paragraph{Wallet phase 2.} +\begin{itemize} +\item Save $S(C,\gamma,\Gamma)$. +\item For $j = 1 \cdots \kappa$ except $\gamma$: + \begin{itemize} + \item Send $S_C(l_j)$. + \item Send $S_C(H(\iota_i || H(s_{j,i})) \quad\textrm{for $i = 1 \cdots n$})$. + \end{itemize} +\item For $i = 1 \cdots n$ and $k \not\in \Gamma$: + \begin{itemize} + \item Send $S_C( \nu_{k,i}, H(\iota_i || k) )$. + \end{itemize} +\end{itemize} + +\paragraph{Exchange phase 2.} +\begin{itemize} +\item Verify the signature by $C$. +\item For $j = 1 \cdots \kappa$ except $\gamma$: + \begin{itemize} + \item Set $k_j = H(l_j C)$. + \item For $i=1 \cdots n$: + \begin{itemize} + \item Decrypt $s' = D_{k_j}(\Gamma'_{j,i})$. + \item Compute $c'$, $m'$, and $b'$ from $s_j$. + \item Compute $C' = c' G$ too. + \item Verify $B' = B_{b'}(C' || H(\iota_i || H(s_{j,i})))$. + \end{itemize} + \end{itemize} +\item For $i=1 \cdots n$ and $k \not\in \Gamma$: + \begin{itemize} + \item Generate $\Nu_k$ from $\nu_k$ and $H(\iota_i || k)$. + \item Verify the coin commitment $\Gamma_{\kappa+k,i} = B_{b'}(\Nu_{i,k})$. + \end{itemize} +\item If verifications all pass then send $S_{d_i}(B_\gamma * \Pi_{k \in \Gamma} B_k)$. +\end{itemize} + + + + + +\bibliographystyle{alpha} +\bibliography{taler,rfc} + +% \newpage +% \appendix + +% \section{} + + + +\end{document} + -- cgit v1.2.3 From 1fb28debe154ace2b2a230ffae63e39c85a5506d Mon Sep 17 00:00:00 2001 From: Jeff Burdges Date: Mon, 9 May 2016 01:45:54 +0200 Subject: Just some comments --- doc/paper/offline.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/paper/offline.tex b/doc/paper/offline.tex index 7913ceb94..bc4ac0abd 100644 --- a/doc/paper/offline.tex +++ b/doc/paper/offline.tex @@ -211,7 +211,11 @@ In other words, $c'$, and $b_j$ are derived from $s_j$, \end{itemize} +!!! PLEASE READ CHAUM BEFORE USING THIS !!! +There are several really deadly attacks that require careful defenses. +Also, one must find a proof of security that works for this product. +And Brands might do better anyways. \bibliographystyle{alpha} -- cgit v1.2.3 From cfb0f5bdbcbdedd676744b6d33fae29ba3216a72 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 10 May 2016 13:50:01 +0200 Subject: including config generator among installed files --- src/exchange/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am index 314bf8ba4..9ffd30e46 100644 --- a/src/exchange/Makefile.am +++ b/src/exchange/Makefile.am @@ -15,6 +15,9 @@ bin_PROGRAMS = \ taler-exchange-aggregator \ taler-exchange-httpd +dis_bin_SCRIPTS = \ + taler-config-generate + taler_exchange_aggregator_SOURCES = \ taler-exchange-aggregator.c taler_exchange_aggregator_LDADD = \ -- cgit v1.2.3 From 4a656428051a96a557bb876173b9461b83daa080 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 10 May 2016 13:51:18 +0200 Subject: typo --- src/exchange/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am index 9ffd30e46..ff4fe91dc 100644 --- a/src/exchange/Makefile.am +++ b/src/exchange/Makefile.am @@ -15,7 +15,7 @@ bin_PROGRAMS = \ taler-exchange-aggregator \ taler-exchange-httpd -dis_bin_SCRIPTS = \ +dist_bin_SCRIPTS = \ taler-config-generate taler_exchange_aggregator_SOURCES = \ -- cgit v1.2.3 From 9aa8fa0d70f8c941f546ee42c389ae4c25739227 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 10 May 2016 14:23:59 +0200 Subject: typo: tears->years --- src/exchange/taler-config-generate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/exchange/taler-config-generate b/src/exchange/taler-config-generate index 5693f920c..a928d12b2 100755 --- a/src/exchange/taler-config-generate +++ b/src/exchange/taler-config-generate @@ -217,7 +217,7 @@ do $CS -s $SECTION -o duration_overlap -V "1 day" || exit 1 $CS -s $SECTION -o duration_withdraw -V "7 days" || exit 1 $CS -s $SECTION -o duration_spend -V "2 years" || exit 1 - $CS -s $SECTION -o duration_legal -V "3 tears" || exit 1 + $CS -s $SECTION -o duration_legal -V "3 years" || exit 1 $CS -s $SECTION -o fee_withdraw -V "${ARG_CURRENCY}:0.01" || exit 1 $CS -s $SECTION -o fee_deposit -V "${ARG_CURRENCY}:0.01" || exit 1 $CS -s $SECTION -o fee_refresh -V "${ARG_CURRENCY}:0.01" || exit 1 @@ -232,7 +232,7 @@ do $CS -s $SECTION -o duration_overlap -V "1 day" || exit 1 $CS -s $SECTION -o duration_withdraw -V "7 days" || exit 1 $CS -s $SECTION -o duration_spend -V "2 years" || exit 1 - $CS -s $SECTION -o duration_legal -V "3 tears" || exit 1 + $CS -s $SECTION -o duration_legal -V "3 years" || exit 1 $CS -s $SECTION -o fee_withdraw -V "${ARG_CURRENCY}:0.01" || exit 1 $CS -s $SECTION -o fee_deposit -V "${ARG_CURRENCY}:0.01" || exit 1 $CS -s $SECTION -o fee_refresh -V "${ARG_CURRENCY}:0.01" || exit 1 -- cgit v1.2.3 From e10fc753df709cc9f6d4adddc7699640a52cf89e Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 10 May 2016 15:03:00 +0200 Subject: typo --- src/exchange/taler-config-generate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exchange/taler-config-generate b/src/exchange/taler-config-generate index a928d12b2..3e9d7a780 100755 --- a/src/exchange/taler-config-generate +++ b/src/exchange/taler-config-generate @@ -135,7 +135,7 @@ then then JSONF=`$CS -s merchant-wireformat -o ${ARG_W}_RESPONSE_FILE -f` mkdir -p `dirname "$JSONF"` - echo "$ARG_J" > "$JSONF" || exit 1 + echo "$ARG_JM" > "$JSONF" || exit 1 else echo "Skipped generating wire details for merchant" fi -- cgit v1.2.3 From be53397fb981db5af597bce0c3bc7c87491e9f84 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 10 May 2016 19:38:38 +0200 Subject: adding EDATE in merchant config generator --- src/exchange/taler-config-generate | 1 + 1 file changed, 1 insertion(+) diff --git a/src/exchange/taler-config-generate b/src/exchange/taler-config-generate index 3e9d7a780..2490f0cb3 100755 --- a/src/exchange/taler-config-generate +++ b/src/exchange/taler-config-generate @@ -130,6 +130,7 @@ fi if (test 1 = "$ARG_M") then $CS -s merchant -o WIREFORMAT -V "$ARG_W" || exit 1 + $CS -s merchant -o EDATE -V "3 week" || exit 1 if (test ! -z "$ARG_JM") then -- cgit v1.2.3 From 17512aa538700fc5f2d23d42ab9020989b943bf7 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 10 May 2016 22:06:55 +0200 Subject: merchant private key in config generator --- src/exchange/taler-config-generate | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/exchange/taler-config-generate b/src/exchange/taler-config-generate index 2490f0cb3..319455a2a 100755 --- a/src/exchange/taler-config-generate +++ b/src/exchange/taler-config-generate @@ -129,6 +129,15 @@ fi # Generate merchant-specific configuration if (test 1 = "$ARG_M") then + MASTER_KEY=`$CS -f -s merchant -o KEYFILE` + +# Generate master key (if missing) + if (test ! -e "$MASTER_KEY") + then + mkdir -p `dirname "$MASTER_KEY"` + gnunet-ecc -g 1 "$MASTER_KEY" || exit 1 + fi + $CS -s merchant -o WIREFORMAT -V "$ARG_W" || exit 1 $CS -s merchant -o EDATE -V "3 week" || exit 1 -- cgit v1.2.3 From 93175857c9c295483d76fe3c6b755ddf2c5ee865 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Wed, 11 May 2016 01:30:30 +0200 Subject: uncommenting PORT in config --- src/exchange/exchange.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exchange/exchange.conf b/src/exchange/exchange.conf index 7dffdd7fa..afb5b8fae 100644 --- a/src/exchange/exchange.conf +++ b/src/exchange/exchange.conf @@ -20,7 +20,7 @@ UNIXPATH = ${TALER_RUNTIME_DIR}/exchange.http UNIXPATH_MODE = 660 # HTTP port the exchange listens to -# PORT = 8081 +PORT = 8081 # Master public key used to sign the exchange's various keys # MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG -- cgit v1.2.3 From 5d2b56c3c39822b4af746142dd0f8a1676351ec5 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Wed, 11 May 2016 01:56:34 +0200 Subject: MASTER_KEY in section merchant-exchange-test used to point exchange's private key. Fixed --- src/exchange/taler-config-generate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exchange/taler-config-generate b/src/exchange/taler-config-generate index 319455a2a..cc77d4798 100755 --- a/src/exchange/taler-config-generate +++ b/src/exchange/taler-config-generate @@ -211,7 +211,7 @@ then then EPORT=`$CS -s exchange -o PORT` $CS -s merchant-exchange-test -o URI -V "http://localhost:$EPORT/" || exit - $CS -s merchant-exchange-test -o MASTER_KEY -V "$MASTER_KEY" + $CS -s merchant-exchange-test -o MASTER_KEY -V `$CS -s exchange -o MASTER_PUBLIC_KEY` else echo "Need to be configuring exchange as well for -t to be useful." fi -- cgit v1.2.3