exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

taler.tex (111506B)


      1 % RMS wrote:
      2 %The text does not mention GNU anywhere.  This paper is an opportunity
      3 %to make people aware of GNU, but the current text fails to use the
      4 %opportunity.
      5 %
      6 %It should say that Taler is a GNU package.
      7 %
      8 %I suggest using the term "GNU Taler" in the title, once in the
      9 %abstract, and the first time the name is mentioned in the body text.
     10 %In the body text, it can have a footnote with more information
     11 %including a reference to http://gnu.org/gnu/the-gnu-project.html.
     12 %
     13 %At the top of page 3, where it says "a free software implementation",
     14 %it should add "(free as in freedom)", with a reference to
     15 %http://gnu.org/philosophy/free-sw.html and
     16 %http://gnu.org/philosophy/free-software-even-more-important.html.
     17 %
     18 %Would you please include these things in every article or posting?
     19 %
     20 % CG adds:
     21 % We SHOULD do this for the FINAL paper, not for the anon submission.
     22 
     23 % Relate to:
     24 % http://fc14.ifca.ai/papers/fc14_submission_124.pdf
     25 
     26 % Terminology:
     27 % - SEPA-transfer -- avoid 'SEPA transaction' as we use
     28 %       'transaction' already when we talk about taxable
     29 %        transfers of Taler coins and database 'transactions'.
     30 % - wallet = coins at customer
     31 % - reserve = currency entrusted to exchange waiting for withdrawal
     32 % - deposit = SEPA to exchange
     33 % - withdrawal = exchange to customer
     34 % - spending = customer to merchant
     35 % - redeeming = merchant to exchange (and then exchange SEPA to merchant)
     36 % - refreshing = customer-exchange-customer
     37 % - dirty coin = coin with exposed public key
     38 % - fresh coin = coin that was refreshed or is new
     39 % - denomination key = exchange's online key used to (blindly) sign coin
     40 % - reserve key = key used to authorize withdrawals from a reserve
     41 % - message signing key = exchange's online key to sign exchange messages
     42 % - exchange master key = exchange's key used to sign other exchange keys
     43 % - owner = entity that knows coin private key
     44 % - transaction = coin ownership transfer that should be taxed
     45 % - sharing = coin copying that should not be taxed
     46 
     47 % FIXME: As a general comment, I think we're mixing the crypto stuff and the systems
     48 %        stuff too much.  It might be more appropriate to have to systems stuff in a separate
     49 %        section, and the "pure" crypto stuff for the crypto people?
     50 
     51 
     52 \documentclass[sigconf, authordraft]{acmart}
     53 
     54 \usepackage{booktabs} % For formal tables
     55 \usepackage{tikz}
     56 \usetikzlibrary{shapes,arrows}
     57 \usetikzlibrary{positioning}
     58 \usetikzlibrary{calc}
     59 \usepackage{eurosym}
     60 \usepackage[T1]{fontenc}
     61 \usepackage{lmodern}
     62 \usepackage{verbatim}
     63 \usepackage[utf8]{inputenc}
     64 
     65 % Copyright
     66 %\setcopyright{none}
     67 %\setcopyright{acmcopyright}
     68 %\setcopyright{acmlicensed}
     69 \setcopyright{rightsretained}
     70 %\setcopyright{usgov}
     71 %\setcopyright{usgovmixed}
     72 %\setcopyright{cagov}
     73 %\setcopyright{cagovmixed}
     74 
     75 
     76 \newcommand\inecc{\in \mathbb{Z}_{|\mathbb{E}|}}
     77 \newcommand\inept{\in {\mathbb{E}}}
     78 \newcommand\inrsa{\in \mathbb{Z}_{|\mathrm{dom}(\FDH_K)|}}
     79 % DOI
     80 %\acmDOI{10.475/123_4}
     81 
     82 % ISBN
     83 %\acmISBN{123-4567-24-567/08/06}
     84 
     85 %Conference
     86 %\acmConference[CCS'2017]{ACM Conference on Computer and Communications Security}{October 2017}{%
     87   %Dallas, Texas USA}
     88 %\acmYear{2017}
     89 %\copyrightyear{2017}
     90 
     91 %\acmPrice{15.00}
     92 
     93 %\acmSubmissionID{123-A12-B3}
     94 
     95 \begin{document}
     96 \title{Refreshing Coins for Giving Change and Refunds \\ in Chaum-style Anonymous Payment Systems}
     97 %\subtitle{Authors' names blinded for review}
     98 
     99 
    100 %\author{Ben Trovato}
    101 %\affiliation{%
    102 %  \institution{Institute for Clarity in Documentation}
    103 %  \streetaddress{P.O. Box 1212}
    104 %  \city{Dublin}
    105 %  \state{Ohio}
    106 %  \postcode{43017-6221}
    107 %}
    108 %\email{trovato@corporation.com}
    109 %
    110 %
    111 %% The default list of authors is too long for headers}
    112 %\renewcommand{\shortauthors}{B. Trovato et al.}
    113 
    114 \author{Anonymized for blind review}
    115 
    116 
    117 \begin{abstract}
    118 This paper introduces {\em Taler}, a Chaum-style digital payment system that
    119 enables anonymous payments while ensuring that entities that receive
    120 payments are auditable.  In Taler, customers can
    121 never defraud anyone, merchants can only fail to deliver the
    122 merchandise to the customer, and payment service providers are
    123 audited.
    124 All parties receive cryptographic evidence for all
    125 transactions; still, each party only receives the minimum information
    126 required to execute transactions.  Enforcement of honest behavior is
    127 timely, and is at least as strict as with legacy credit card payment
    128 systems that do not provide for privacy.
    129 
    130 The key technical contribution underpinning Taler is a new {\em
    131   refresh protocol} which allows fractional payments and refunds while
    132 maintaining untraceability of the customer and unlinkability of
    133 transactions.  The refresh protocol combines an
    134 efficient cut-and-choose mechanism with a {\em link} step to ensure
    135 that refreshing is not abused for transactional payments.
    136 
    137 We argue that Taler provides a secure digital payment system for modern
    138 liberal societies as it is a flexible, libre and efficient protocol
    139 and adequately balances the state's need for monetary control with the
    140 citizen's needs for private economic activity.
    141 \end{abstract}
    142 
    143 %
    144 % The code below should be generated by the tool at
    145 % http://dl.acm.org/ccs.cfm
    146 % Please copy and paste the code instead of the example below.
    147 %
    148 \begin{CCSXML}
    149 <ccs2012>
    150 <concept>
    151 <concept_id>10002978.10002991.10002994</concept_id>
    152 <concept_desc>Security and privacy~Pseudonymity, anonymity and untraceability</concept_desc>
    153 <concept_significance>300</concept_significance>
    154 </concept>
    155 <concept>
    156 <concept_id>10010405.10003550.10003551</concept_id>
    157 <concept_desc>Applied computing~Digital cash</concept_desc>
    158 <concept_significance>500</concept_significance>
    159 </concept>
    160 <concept>
    161 <concept_id>10003456.10003462.10003544.10003545</concept_id>
    162 <concept_desc>Social and professional topics~Taxation</concept_desc>
    163 <concept_significance>300</concept_significance>
    164 </concept>
    165 </ccs2012>
    166 \end{CCSXML}
    167 
    168 \ccsdesc[500]{Security and privacy~Pseudonymity, anonymity and untraceability}
    169 \ccsdesc[500]{Applied computing~Digital cash}
    170 \ccsdesc[300]{Social and professional topics~Taxation}
    171 
    172 
    173 \keywords{electronic cash, refreshing, refunds}
    174 
    175 \maketitle
    176 
    177 \section{Introduction}
    178 
    179 The design of payment systems shapes economies and societies.  Strong,
    180 developed nation states have adopted highly transparent payment systems,
    181 such as the MasterCard and VisaCard credit card schemes and computerized
    182 bank transactions such as SWIFT.  These systems enable mass surveillance
    183 by both governments and private companies.  Aspects of this surveillance
    184 sometimes benefit society by providing information about tax evasion or
    185 crimes like extortion.
    186 %
    187 %In particular, bribery and corruption are limited to elites who can
    188 %afford to escape the dragnet.
    189 %
    190 At the other extreme, weaker developing nation states have economic
    191 activity based largely on coins, paper money or even barter.  Here,
    192 the state is often unable to effectively monitor or tax economic
    193 activity, and this limits the ability of the state to shape the
    194 society.
    195 % If we remove the sentence above, this one also needs to go as it
    196 % is the dual...
    197 % As bribery is virtually impossible to detect, corruption is
    198 % widespread and not limited to social elites.
    199 %
    200 %
    201 % SHORTER: Zerocash need not be mentioned so early?
    202 % Zerocash~\cite{zerocash} is an example for translating an
    203 % anarchistic economy into the digital realm.
    204 
    205 This paper describes Taler, a simple and practical payment system
    206 which balances accountability and privacy.
    207 
    208 The Taler protocol is an improvement over Chaum's original
    209 design~\cite{chaum1983blind} and also follows Chaum's basic
    210 architecture of customer, merchant and exchange
    211 (Figure~\ref{fig:cmm}).  The two designs share the key first step
    212 where the {\em customer} withdraws digital {\em coins} from the {\em
    213   exchange} with unlinkability provided via blind signatures.  The
    214 coins can then be spent at a {\em merchant} who {\em deposits} them at
    215 the exchange.  Taler uses online detection of double-spending and
    216 provides fair exchange and exculpability via cryptographic proofs.
    217 % Thus merchants are instantly assured that a transaction is valid.
    218 
    219 \begin{figure}[h]
    220 \centering
    221 \begin{tikzpicture}
    222  \tikzstyle{def} = [node distance= 2em and 6.5em, inner sep=1em, outer sep=.3em];
    223  \node (origin) at (0,0) {};
    224  \node (exchange) [def,above=of origin,draw]{Exchange};
    225  \node (customer) [def, draw, below left=of origin] {Customer};
    226  \node (merchant) [def, draw, below right=of origin] {Merchant};
    227  \node (auditor) [def, draw, above right=of origin]{Auditor};
    228 
    229  \tikzstyle{C} = [color=black, line width=1pt]
    230 
    231  \draw [<-, C] (customer) -- (exchange) node [midway, above, sloped] (TextNode) {withdraw coins};
    232  \draw [<-, C] (exchange) -- (merchant) node [midway, above, sloped] (TextNode) {deposit coins};
    233  \draw [<-, C] (merchant) -- (customer) node [midway, above, sloped] (TextNode) {spend coins};
    234  \draw [<-, C] (exchange) -- (auditor) node [midway, above, sloped] (TextNode) {verify};
    235 
    236 \end{tikzpicture}
    237 \caption{Taler's system model for the payment system is based on Chaum~\cite{chaum1983blind}.}
    238 \label{fig:cmm}
    239 \end{figure}
    240 
    241 A key issue for an efficient Chaumian digital payment system is the
    242 need to provide change and existing systems for ``practical
    243 divisible'' electronic cash have transaction costs that are linear in
    244 the amount of value being transacted, sometimes hidden in the double
    245 spending detection logic of the payment service
    246 provider~\cite{martens2015practical}.  The customer should also not be
    247 expected to withdraw exact change, as doing so reduces anonymity due
    248 to the obvious correlation.
    249 
    250 % FIXME:  explain the logarithmic claim!  It's only
    251 % true for a certain denomination structure.
    252 % This denomination structure potentially introduces privacy risks
    253 Taler solves the problem of giving change by introducing a new {\em
    254   refresh protocol} allowing for ``divisible'' transactions with
    255 amortized costs logarithmic in the amount of value being transacted.
    256 Using this protocol, a customer can obtain change or refunds in the
    257 form of fresh coins that other parties cannot link to the original
    258 transaction, the original coin, or each other.  Additionally, the
    259 refresh protocol ensures that the change is owned by the same entity
    260 which owned the original coin.
    261 
    262 % Summarize key contributions...
    263 This paper presents the main Taler concepts and fundamental protocols,
    264 provides correctness arguments, gives an introduction to our freely
    265 available reference implementation.  Initial experimental results show
    266 that the system performs well.  Finally, we also discuss limitations
    267 and practical considerations resulting from the design.
    268 
    269 %\vspace{-0.3cm}
    270 
    271 \section{Related Work}
    272 %\vspace{-0.3cm}
    273 
    274 %\subsection{Blockchain-based currencies}
    275 
    276 % FIXME:  SHORTEN.  This is probably too much information for the audience, they
    277 %         all know this
    278 In recent years, a class of decentralized electronic payment systems,
    279 based on collectively recorded and verified append-only public
    280 ledgers, have gained immense popularity.  The most well-known protocol
    281 in this class is Bitcoin~\cite{nakamoto2008bitcoin}.  The key
    282 contribution of blockchain-based protocols is that they dispense with
    283 the need for a central, trusted authority.  Yet, there are several
    284 major irredeemable problems inherent in their designs:
    285 
    286 \begin{itemize}
    287   \item The computational puzzles solved by Bitcoin nodes with the purpose
    288     of securing the blockchain consume a considerable amount of energy.
    289     So Bitcoin is an environmentally irresponsible design.
    290   \item Bitcoin transactions have pseudonymous recipients, making taxation
    291     hard to systematically enforce.
    292   \item Bitcoin introduces a new currency, creating additional
    293     financial risks from currency fluctuation.
    294   \item Anyone can start an alternative Bitcoin transaction chain,
    295     called an AltCoin, and, if successful, reap the benefits of the low
    296     cost to initially create coins cheaply as the proof-of-work
    297     difficulty adjusts to the computation power of all
    298     miners in the network.  As participants are de facto investors,
    299     AltCoins can become a form of Ponzi scheme.
    300     % As a result, dozens of
    301     % AltCoins have been created, often without any significant changes to the
    302     % technology.  A large number of AltCoins creates additional overheads for
    303     % currency exchange and exacerbates the problems with currency fluctuations.
    304 \end{itemize}
    305 
    306 Bitcoin also lacks anonymity, as all Bitcoin transactions are recorded
    307 for eternity, which can enable identification of users.  Anonymous
    308 payment systems based on Bitcoin such as CryptoNote~\cite{cryptonote}
    309 (Monero), Zerocash~\cite{zerocash} (ZCash) and BOLT~\cite{BOLT}
    310 exacerbate the design issues we mention above.  These systems exploit the
    311 blockchain's decentralized nature to escape anti-money laundering
    312 regulation~\cite{molander1998cyberpayments} as they provide anonymous,
    313 disintermediated transactions.
    314 
    315 Unlike Taler, Zerocash hides transacted amounts as well as both the
    316 sender and receiver, giving it a larger anonymity set than Taler under
    317 equal usage levels.  However, a Taler exchange can process transactions many
    318 orders of magnitude faster and more cheaply than any blockchain-based
    319 cryptocurrency like Zerocash.  It follows that, assuming reasonable
    320 adoption levels for both, Taler can yield stronger anonymity for
    321 ordinary purchases, although this depends upon adoption.
    322 Also, Zerocash should retain an advantage for large transactions that
    323 never get cashed out into another currency.
    324 In addition, Zerocash's anonymity for the receiver facilitates illegal
    325 activities like extortion, money laundering, and tax evasion.
    326 
    327 BOLT~\cite{BOLT} is a proposed off-chain payment channel inspired by
    328 the Lightning Network \cite{LightningNetwork}.  In essence, BOLT is
    329 an e-cash system designed to operate in parallel with Zerocash, along
    330 with a second similar system.  Aside from using Zerocash for resolving
    331 disputes, and ultimately transferring coins, BOLT sacrifices some of
    332 the customer anonymity provided by the e-cash primitives so that the
    333 party acting as the exchange can be an arbitrary miner but cannot
    334 defraud the customer.  BOLT asserts that sacrificing customer anonymity
    335 in this way is acceptable given Zerocash's strong anonymity properties,
    336 but the authors do propose using it outside of Zerocash.
    337 
    338 In general, these off-chain payment channels, like BOLT and the
    339 Lightning Network, improve the blockchain based payment schemes by
    340 centralizing payment processing, but they remain orders of magnitude
    341 more costly than Taler with the same degree of centralization.
    342 In addition, they require nodes act far more like payment processors
    343 than like conventional miners, potentially exposing miners to legal
    344 risks, not unlike the financial violations for which Ripple was fined
    345 \cite{RippleFined:ArsTechnica}.  Taler is explicitly designed to help
    346 a Taler exchange navigate these legal risks.
    347 
    348 GreenCoinX\footnote{\url{https://www.greencoinx.com/}} is a more
    349 recent AltCoin where the company promises to identify the owner of
    350 each coin via e-mail addresses and phone numbers.  While it is unclear
    351 from their technical description how this identification would be
    352 enforced against a determined adversary, the resulting payment system
    353 would also merely impose a financial panopticon on a Bitcoin-style
    354 money supply and transaction model.
    355 
    356 %\subsection{Chaum-style electronic cash}
    357 
    358 Chaum~\cite{chaum1983blind} proposed a digital payment system that
    359 would provide some customer anonymity while disclosing the identity of
    360 the merchants.  DigiCash, a commercial implementation of Chaum's
    361 proposal ultimately failed to be widely adopted.  In our assessment,
    362 key reasons for DigiCash's failure include:
    363 
    364 \begin{itemize}
    365  \item The use of patents to protect the technology; a payment system
    366    should be free software (libre) to have a chance for widespread adoption.
    367  \item Support for payments to off-line merchants, and thus deferred
    368    detection of double-spending, requires the exchange to attempt to
    369    recover funds from delinquent customers via the legal system.
    370    Any system that fails to be self-enforcing creates a major
    371    business risk for the exchange and merchants.
    372 %   In 1983, there were merchants without network connectivity, making that
    373 %   feature relevant, but today network connectivity is feasible for most
    374 %   merchants, and saves both the exchange and merchants the business risks
    375 %   associated with deferred fraud detection.
    376  \item % In addition to the risk of legal disputes wh fraudulent
    377    % merchants and customers,
    378    Chaum's published design does not clearly
    379    limit the financial damage an exchange might suffer from the
    380    disclosure of its private online signing key.
    381  \item Chaum did not support fractional payments or refunds without
    382    weakening customer anonymity.
    383 %, and Brand's
    384 %   extensions for fractional payments broke unlinkability and thus
    385 %   limited anonymity.
    386 % \item Chaum's system was implemented at a time where the US market
    387 %   was still dominated by paper checks and the European market was
    388 %   fragmented into dozens of currencies.  Today, SEPA provides a
    389 %   unified currency and currency transfer method for most of Europe,
    390 %   significantly lowering the barrier to entry into this domain for
    391 %   a larger market.
    392 \end{itemize}
    393 
    394 To our knowledge, the only publicly available effort to implement
    395 Chaum's idea is Opencoin~\cite{dent2008extensions}.  However, Opencoin
    396 is neither actively developed nor used, and it is not clear
    397 to what degree the implementation is even complete.  Only a partial
    398 description of the Opencoin protocol is available to date.
    399 % FIXME: ask OpenCoin dev's about this! Then make statement firmer!
    400 
    401 % FIXME:  not only by brands.  this formulation sounds like
    402 % we're unaware of the huge body of work in the area that is still growing.
    403 Chaum's original digital cash system~\cite{chaum1983blind} was
    404 extended by Brands~\cite{brands1993efficient} with the ability to {\em
    405   divide} coins and thus spend certain fractions of a coin using
    406 restrictive blind signatures.  Restrictive blind signatures create
    407 privacy risks: if a transaction is interrupted, then any coins sent
    408 to the merchant become tainted, but may never arrive or be spent.
    409 It becomes tricky to extract the value of the tainted coins without
    410 linking to the aborted transaction and risking deanonymization.
    411 
    412 Ian Goldberg's HINDE system allowed the merchant to provide change,
    413 but the mechanism could be abused to hide income from
    414 taxation.\footnote{Description based on personal communication. HINDE
    415   was never published.}
    416 In~\cite{brands1993efficient}, $k$-show signatures were proposed to
    417 achieve divisibility for coins.  However, with $k$-show signatures
    418 multiple transactions can be linked to each other.
    419 Performing fractional payments using $k$-show signatures is also
    420 rather expensive.
    421 
    422 In pure blind signature based schemes like Taler, withdrawal and spend
    423 operations require bandwidth logarithmic in the value being withdrawn
    424 or spent.  In~\cite{Camenisch05compacte-cash}, there is a zero-knowledge
    425 scheme that improves upon this, requiring only constant bandwidth for
    426 withdrawals and spend operations, but unfortunately the exchanges' storage and
    427 search costs become linear in the total value of all transactions.
    428 %In principle, one could correct this by adding multiple denominations,
    429 %an open problem stated already in~\cite{Camenisch05compacte-cash}.
    430 % NO: he cannot give change, so that does not really work!
    431 As described, the scheme employs offline double spending protection,
    432 which inherently makes it fragile and creates an unnecessary
    433 deanonymization risk (see Section~\ref{sec:offline}).
    434 %We believe the offline protection from double
    435 %spending could be removed, thus switching the scheme to only protection
    436 %against online double spending, like Taler.
    437 % TOO much detail...
    438 %
    439 %Along with fixing these two issues, an interesting applied research project
    440 %would be to add partial spending and a form of Taler's refresh protocol.
    441 %At present, we feel these relatively new cryptographic techniques incur
    442 %unacceptable financial risks to the exchange, due to underdeveloped
    443 %implementation practice.
    444 %
    445 % SHORTER: Maybe some of the above could be thinned since
    446 % they do not know much about Taler's refresh protocol yet.
    447 % -- yeah, in particular the feeling/speculative parts are not needed...
    448 
    449 %In this vein, there are pure also zero-knowledge proof based schemes
    450 %like~\cite{ST99}, and subsequently Zerocash~\cite{zerocash}, and maybe
    451 %variations on BOLT~\cite{BOLT}, that avoid using any denomination-like
    452 %constructs, slightly reducing metadata leakage.  At present, these all
    453 %incur excessive bandwidth or computational costs however.
    454 % -- commented out, seems excessive.
    455 
    456 %Some argue that the focus on technically perfect but overwhelmingly
    457 %complex protocols, as well as the the lack of usable, practical
    458 %solutions lead to an abandonment of these ideas by
    459 %practitioners~\cite{selby2004analyzing}.
    460 
    461 
    462 
    463 % FIXME:  If we ever add peppercoin stuff, cite Matt Green paper
    464 %         and talk about economics when encoding a punishment-coin
    465 %         as the identity, with limited ticket lifespan
    466 
    467 %\subsection{Peppercoin}
    468 
    469 %Peppercoin~\cite{rivest2004peppercoin} is a microdonation protocol.
    470 %The main idea of the protocol is to reduce transaction costs by
    471 %minimizing the number of transactions that are processed directly by
    472 %the exchange.  Instead of always paying, the customer ``gambles'' with the
    473 %merchant for each microdonation.  Only if the merchant wins, the
    474 %microdonation is upgraded to a macropayment to be deposited at the
    475 %exchange.  Peppercoin does not provide customer-anonymity.  The proposed
    476 %statistical method by which exchanges detect fraudulent cooperation between
    477 %customers and merchants at the expense of the exchange not only creates
    478 %legal risks for the exchange, but would also require that the exchange learns
    479 %about microdonations where the merchant did not get upgraded to a
    480 %macropayment.  It is therefore unclear how Peppercoin would actually
    481 %reduce the computational burden on the exchange.
    482 
    483 The use of refunds for fractional payments has been suggested in the context of
    484 payment systems for public transit fees \cite{rupp2013p4r}.  This approach
    485 relies on 2-showable coins that can be used one time for fractional spending
    486 and another time for refunding the remaining amount without losing anonymity.
    487 Unfortunately this approach cannot be used for a general-purpose payment
    488 system, since the refund operation of Rupp et al. allows transferring money
    489 in a way that hides income from taxation.  Refunding a coin into a wallet that
    490 didn't withdraw the coin is possible in their system, but constitutes a
    491 transaction between two parties that is not recognized by the system for the
    492 purpose of income taxation.
    493 
    494 
    495 %\vspace{-0.3cm}
    496 \section{Design}
    497 %\vspace{-0.3cm}
    498 
    499 The Taler system comprises three principal types of actors
    500 (Figure~\ref{fig:cmm}): The \emph{customer} is interested in receiving
    501 goods or services from the \emph{merchant} in exchange for payment.
    502 To pay, the customer {\em spends} digital coins at the merchant.  When
    503 making a transaction, both the customer and the merchant use the same
    504 \emph{exchange}, which serves as a payment service provider for the
    505 financial transaction between the two.  The exchange is responsible
    506 for allowing the customer to withdraw anonymous digital coins from the
    507 customer's financial reserves, and for enabling the merchant to
    508 deposit digital coins in return for receiving credit at the merchant's
    509 financial reserve.  In addition, Taler includes an \emph{auditor} who
    510 assures customers and merchants that the exchange operates correctly.
    511 
    512 %\vspace{-0.3cm}
    513 \subsection{Security considerations}\label{subsec:security_rough}
    514 %\vspace{-0.3cm}
    515 
    516 As a payment system, Taler naturally needs to make sure that coins are
    517 unforgeable and prevent double-spending.  More precisely, as the same
    518 coin is allowed to be involved in multiple operations, Taler needs to
    519 ensure that the amounts spent per coin remain below the denomination
    520 value and amounts credited to the coin from refunds.  Furthermore,
    521 transactions should be unlinkable; in particular, if a coin has been
    522 partially spent or if a transaction was aborted, Taler must provide a
    523 mechanism for customers to spend the remaining value in another
    524 transaction that remains unlinkable to the first transaction.  Finally,
    525 this mechanism must not introduce a new loophole that might be used to
    526 hide transactions in a way that would enable tax-evasion.
    527 
    528 As a practical system, Taler needs to be concerned with transient
    529 network failures or loss of power.  Thus, it must be possible to
    530 resume protocols and recover from such failures at any point in time,
    531 without any party suffering financial losses.  We require that parties
    532 are able to securely persist information and assume that after
    533 errors they can resume from the previous state that was persisted.
    534 We will explicitly state in the protocol when what state has
    535 to be persisted.  Participants that fail to recover data they were
    536 expected to persist may suffer financial losses in proportion to the
    537 value of the transactions involved.
    538 
    539 Taler assumes that each participant has full control over their
    540 system.  We assume the contact information of the exchange is known to
    541 both customer and merchant from the start, including that the customer
    542 can authenticate the merchant, for example by using X.509
    543 certificates~\cite{rfc6818}.  A Taler merchant is trusted to deliver
    544 the service or goods to the customer upon receiving payment.  The
    545 customer can seek legal relief to achieve this, as the customer
    546 receives cryptographic evidence of the contract and the associated
    547 payment.  We assume each Taler customer has an anonymous
    548 bi-directional channel, such as Tor, to communicate with both the
    549 exchange and the merchant.
    550 
    551 A Taler exchange is trusted to hold funds of its customers and to
    552 forward them when receiving the respective deposit instructions from
    553 the merchants.  Customer and merchant can have assurances about the
    554 exchange's liquidity and operation though published audits by
    555 financial regulators or other trusted third parties.  An exchange's
    556 signing keys expire regularly, allowing the exchange to eventually
    557 destroy the corresponding accumulated cryptographic proofs, and
    558 limiting the exchange's financial liability.
    559 
    560 On the cryptographic side, a Taler exchange demands that coins use a
    561 full domain hash (FDH) to make so-called ``one-more forgery'' attacks
    562 provably hard, assuming the RSA known-target inversion problem is
    563 hard~\cite[Theorem 12]{RSA-FDH-KTIvCTI}.  For a withdrawn coin,
    564 violating the customers anonymity cryptographically requires recognizing
    565 a random blinding factor from a random element of the group of
    566 integers modulo the denomination key's RSA modulus, which appears
    567 impossible even with a quantum computers.  For a refreshed coin,
    568 unlinkability requires the hardness of the discrete logarithm for
    569 Curve25519.
    570 
    571 The cut-and-choose protocol prevents merchants and customers from
    572 conspiring to conceal a merchants income.  We assume that the maximum
    573 tax rate is below $1/\kappa$, and that expected transaction losses of
    574 a factor of $\kappa$ for tax evasion are thus unacceptable.
    575 
    576 
    577 \subsection{Taxability and Entities}
    578 
    579 Taler ensures that the state can tax {\em transactions}.  We must,
    580 however, clarify what constitutes a transaction that can be taxed.
    581 % As we believe citizens should be in control of their computing, as well as for practical reasons,
    582 We assume that coins can freely be
    583 copied between machines, and that coin deletion cannot be verified.
    584 Avoiding these assumptions would require extreme measures, like custom
    585 hardware supplied by the exchange.  Also, it would be inappropriate to
    586 tax the moving of funds between two computers owned by the same
    587 entity.  Finally, we assume that at the time digital coins are
    588 withdrawn, the wallet receiving the coins is owned by the individual
    589 who is performing the authentication to authorize the withdrawal.
    590 Preventing the owner of the reserve from deliberately authorizing
    591 someone else to withdraw electronic coins would require even more
    592 extreme measures.
    593 % SHORTER:
    594 % including preventing them from communicating with anyone but
    595 % the exchange terminal during withdrawal.
    596 % FIXME: Oddly phrased:
    597 % As such measures would be
    598 % totally impractical for a minor loophole, we are not concerned with
    599 % enabling the state to strongly identify the recipient of coins
    600 % from a withdrawal operation.
    601 
    602 % SHORTER: There might be a shorter way to say this and the previous
    603 % paragraph together, but now I see why they were kept apart.
    604 We view ownership of a coin's private key as a ``capability'' to spend
    605 the funds.  A taxable transaction occurs when a merchant entity gains
    606 control over the funds while at the same time a customer entity looses
    607 control over the funds in a manner verifiable to the merchant.  In
    608 other words, we restrict the definition of taxable transactions to
    609 those transfers of funds where the recipient merchant is distrustful
    610 of the spending customer, and requires verification that the customer
    611 lost the capability to spend the funds.
    612 
    613 Conversely, if a coin's private key is shared between two entities,
    614 then both entities have equal access to the credentials represented by
    615 the private key.  In a payment system, this means that either entity
    616 could spend the associated funds.  Assuming the payment system has
    617 effective double-spending detection, this means that either entity has
    618 to constantly fear that the funds might no longer be available to it.
    619 It follows that sharing coins by copying a private key implies mutual
    620 trust between the two parties.
    621 
    622 In Taler, making funds available by copying a private key and thus
    623 sharing control is {\bf not} considered a {\em transaction} and thus
    624 {\bf not} recorded for taxation.  Taler does, however, ensure
    625 taxability when a merchant entity acquires exclusive control over the
    626 value represented by a digital coins.  For such transactions, the state
    627 can obtain information from the exchange that identifies
    628 the entity that received the digital coins as well as the exact value
    629 of those coins.  Taler also allows the exchange, and hence the state,
    630 to learn the value of digital coins withdrawn by a customer---but not
    631 how, where, or when they were spent.
    632 
    633 \subsection{Anonymity}
    634 
    635 We assume that an anonymous communication channel
    636 such as Tor~\cite{tor-design} is
    637 used for all communication between the customer and the merchant,
    638 as well as for refreshing tainted coins with the exchange and for
    639 retrieving the exchange's denomination key.
    640 Ideally, the customer's anonymity is limited only by this channel;
    641 however, the payment system does additionally reveal that the customer
    642 is one of the patrons of the exchange who withdrew enough coin of
    643 given denominations.
    644 There are naturally risks that the business operation that the
    645 merchant runs on behalf of the customer
    646 may require the merchant to learn identifying information about the customer.
    647 We consider information leakage specific to the business logic to be
    648 outside of the scope of the design of Taler.
    649 
    650 Aside from refreshing and obtaining denomination key, the customer
    651 should ideally use an anonymous communication channel with the exchange
    652 to obscure their IP address for location privacy; naturally
    653 the exchange would typically learn the customer's identity from the wire
    654 transfer that funds the customer's withdrawal of anonymous digital coins.
    655 We believe this may even be desirable as there are laws, or bank policies,
    656 that limit the amount of cash that an individual customer can withdraw
    657 in a given time period~\cite{france2015cash,greece2015cash}.
    658 Taler is thus only anonymous with respect to {\em payments}. So
    659 while the exchange does know their customer (KYC), it
    660 is unable to link the known identity of the customer that withdrew
    661 anonymous digital coins to the {\em purchase} performed later at the
    662 merchant.
    663 
    664 While the customer thus has untraceability for purchases, the exchange will
    665 always learn the merchant's identity in order to credit the merchant's
    666 account.  This is also necessary for taxation, as Taler deliberately
    667 exposes these events as anchors for tax audits on income.
    668 
    669 % Technically, the merchant could still
    670 %use an anonymous communication channel to communicate with the exchange.
    671 %However, in order to receive the traditional currency the exchange will
    672 %require (SEPA) account details for the deposit.
    673 
    674 %As both the initial transaction between the customer and the exchange as
    675 %well as the transactions between the merchant and the exchange do not have
    676 %to be done anonymously, there might be a formal business contract
    677 %between the customer and the exchange and the merchant and the exchange.  Such
    678 %a contract may provide customers and merchants some assurance that
    679 %they will actually receive the traditional currency from the exchange
    680 %given cryptographic proof about the validity of the transaction(s).
    681 %However, given the business overheads for establishing such contracts
    682 %and the natural goal for the exchange to establish a reputation and to
    683 %minimize cost, it is more likely that the exchange will advertise its
    684 %external auditors and proven reserves and thereby try to convince
    685 %customers and merchants to trust it without a formal contract.
    686 
    687 
    688 \subsection{Coins}
    689 
    690 A \emph{coin} in Taler is a public-private key pair where the private
    691 key is only known to the owner of the coin.  A coin derives its
    692 financial value from an RSA signature over the full domain hash (FDH)
    693 of the coin's public key. The exchange has multiple RSA
    694 {\em denomination key} pairs available for blind-signing coins of
    695 different values.
    696 
    697 Denomination keys have an expiration date, before which any coins
    698 signed with it must be spent or refreshed.  This allows the exchange
    699 to eventually discard records of old transactions, thus limiting the
    700 records that the exchange must retain and search to detect
    701 double-spending attempts.  If a private denomination key were to be
    702 compromised, the exchange can detect this once more coins are redeemed
    703 than the total that was signed into existence using that denomination
    704 key.  In this case, the exchange can allow authentic customers to
    705 redeem their unspent coins that were signed with the compromised
    706 private key, while refusing further deposits involving coins signed by
    707 the compromised denomination key (see Section~\ref{sec:payback}).
    708 As a result, the financial damage
    709 of losing a private signing key is limited to at most the amount
    710 originally signed with that key, and denomination key rotation can be
    711 used to bound that risk.
    712 
    713 We ensure that the exchange cannot deanonymize users by signing
    714 each coin with a fresh denomination key.  For this, exchanges are
    715 required to publicly announce their denomination keys in advance
    716 with validity periods that imply sufficiently strong anonymity sets.
    717 These announcements are expected to be signed with an off-line
    718 long-term private {\em master signing key} of the exchange and the
    719 auditor.  Additionally, customers should obtain these announcements
    720 using an anonymous communication channel.
    721 
    722 Before a customer can withdraw a coin from the exchange, he has to pay
    723 the exchange the value of the coin, as well as processing fees.  This
    724 is done using other means of payment, such as wire transfers or by
    725 having a financial {\em reserve} at the exchange.  Taler assumes that
    726 the customer has a {\em reserve key} to identify
    727 himself as authorized to withdraw funds from the reserve.  By signing
    728 the withdrawal request using this withdrawal authorization key, the
    729 customer can prove to the exchange that he is authorized to withdraw
    730 anonymous digital coins from his reserve.  The exchange records the
    731 withdrawal message as proof that the reserve was debited correctly.
    732 
    733 %To put it differently, unlike
    734 %modern cryptocurrencies like BitCoin, Taler's design simply
    735 %acknowledges that primitive accumulation~\cite{engels1844} predates
    736 %the system and that a secure method to authenticate owners exists.
    737 
    738 After a coin is issued, the customer is the only entity that knows the
    739 private key of the coin, making him the \emph{owner} of the coin.  Due
    740 to the use of blind signatures, the exchange does not learn the
    741 public key during the withdrawal process.  If the private key is
    742 shared with others, they become co-owners of the coin.  Knowledge of
    743 the private key of the coin and the signature over the coin's public
    744 key by an exchange's denomination key enables spending the
    745 coin.
    746 
    747 
    748 % \subsection{Coin spending}
    749 
    750 A customer spends a coin at a merchant by cryptographically signing a
    751 {\em deposit authorization} with the coin's private key.  A deposit
    752 authorization specifies the fraction of the coin's value to be paid to
    753 the merchant, the salted hash of a merchant's financial reserve
    754 routing information and a {\em business transaction-specific hash}.
    755 Taler exchanges ensure that all transactions involving the same coin
    756 do not exceed the total value of the coin simply by requiring that
    757 merchants clear transactions immediately with the exchange.
    758 
    759 If the customer is cheating and the coin was already spent, the
    760 exchange provides the previous deposit authorization as cryptographic
    761 proof of the fraud to the merchant.  If the deposit authorization is
    762 correct, the exchange transfers the funds to the merchant by crediting
    763 the merchant's financial reserve, e.g. using a wire transfer.
    764 
    765 
    766 \subsection{Refreshing Coins}
    767 
    768 If only a fraction of a coin's value has been spent, or if a
    769 transaction fails for other reasons, it is possible that a customer
    770 has revealed the public key of a coin to a merchant, but not
    771 ultimately spent the full value of the coin.  If the customer then
    772 continues to directly use the coin in other transactions, merchants
    773 and the exchange could link the various transactions as they all share
    774 the same public key for the coin.  We call a coin {\em dirty} if its
    775 public key is known to anyone but the owner.
    776 % FIXME, I'd say: "a coin is dirty if anyone _other than_ the owner
    777 % gets to know its public key"; '.. but the owner ..' sounds like a
    778 % new actor knows the key and the owner does not, which never happens,
    779 % right?
    780 
    781 To avoid linkability of transactions, Taler allows the owner of a
    782 dirty coin to exchange it for a {\em fresh} coin using the {\em coin
    783   refreshing protocol}.  Even if a coin is not dirty, the owner of a
    784 coin may want to exchange it if the respective denomination key is
    785 about to expire.  The {\em coin refreshing protocol}, allows the owner
    786 of a coin to {\em melt} it for fresh coins of the same total value with a
    787 % FIXME: this way it sounds like if I refresh a half-spent coin,
    788 % then I can melt it for the 'same total value', so the reader might
    789 % be misled into thinking that after refreshing a half-spent coin
    790 % the fresh coin will "regain" its old value.
    791 new public-private key pairs.  Refreshing does not use the ordinary
    792 spending operation as the owner of a coin should not have to pay
    793 (income) taxes for refreshing.  However, to ensure that refreshing is
    794 not used for money laundering or tax evasion, the refreshing protocol
    795 assures that the owner stays the same.
    796 
    797 % FIXME: This paragraph could likely be removed and be replaced
    798 % by the proof if we have space.
    799 The refresh protocol has two key properties: First, the exchange is
    800 unable to link the fresh coin's public key to the public key of the
    801 dirty coin.  Second, it is assured that the owner of the dirty coin
    802 % FIXME: better this way? "Second, it is assured that ONLY the owner..."
    803 can determine the private key of the fresh coin, thereby preventing
    804 the refresh protocol from being used to transfer ownership.
    805 
    806 
    807 \section{Taler's Cryptographic Protocols}
    808 
    809 \def\KDF{\textrm{KDF}}
    810 \def\FDH{\textrm{FDH}}
    811 
    812 In this section, we describe the protocols for Taler in detail.
    813 
    814 For the sake of brevity we omit explicitly saying each time that a
    815 recipient of a signed message always first checks that the signature
    816 is valid.  Furthermore, the receiver of a signed message is either
    817 told the respective public key, or knows it from the context.  Also,
    818 all signatures contain additional identification as to the purpose of
    819 the signature, making it impossible to use a signature in a different
    820 context.  A summary of the notation used is in Appendix~\ref{sec:notation}.
    821 
    822 An exchange has a long-term offline key which is used to certify
    823 denomination keys and {\em online message signing keys} of the
    824 exchange.  {\em Online message signing keys} are used for signing
    825 protocol messages; denomination keys are used for blind-signing coins.
    826 The exchange's long-term offline key is assumed to be known to both
    827 customers and merchants and is certified by the auditors.
    828 
    829 We avoid asking either customers or merchants to make trust decisions
    830 about individual exchanges.  Instead, they need only select the auditors.
    831 Auditors must sign all the exchange's public keys.
    832 
    833 As we are dealing with financial transactions, we explicitly describe
    834 whenever entities need to safely write data to persistent storage.
    835 As long as the data persists, the protocol can be safely
    836 resumed at any step.  Persisting data is cumulative, that is an
    837 additional persist operation does not erase the previously stored
    838 information.  Keys and thus coins always have a well-known expiration
    839 date; information persisted can be discarded after the
    840 expiration date of the respective public key.
    841 Customers may discard information once the respective coins have been
    842 fully spent, so long as refunds are not required.
    843 Merchants may discard information once payments from the exchange have
    844 been received, assuming the records are also no longer needed for tax
    845 purposes.  The exchange's bank transfers dealing in traditional currency
    846 are expected to be recorded for tax authorities to ensure taxability.
    847 % FIXME: Auditor?
    848 
    849 $S_K$ denotes RSA signing with denomination key $K$.  Signatures $S_X$
    850 use EdDSA~\cite{eddsa,rfc8032} over elliptic curve $\mathbb{E}$ for
    851 all other types of keys $X \not= K$.  $G$ denotes the generator of
    852 elliptic curve $\mathbb{E}$.
    853 
    854 \subsection{Withdrawal}
    855 
    856 To withdraw anonymous digital coins, the customer first selects an
    857 exchange and one of its public denomination public keys $K_p$ whose
    858 value $K_v$ corresponds to an amount the customer wishes to withdraw.
    859 We let $K_s$ denote the exchange's private key corresponding to $K_p$.
    860 We use $\FDH_K$ to denote a full-domain hash where the domain is the
    861 modulos of the public key $K_p$.  Now the customer carries out the
    862 following interaction with the exchange:
    863 
    864 % FIXME: These steps occur at very different points in time, so probably
    865 % they should be restructured into more of a protocol description.
    866 % It does create some confusion, like is a reserve key semi-ephemeral
    867 % like a linking key?
    868 
    869 \begin{enumerate}
    870   \item The customer randomly generates:
    871     \begin{itemize}
    872       \item reserve key $W := (w_s,W_p)$ with private key $w_s \inecc$ and public key $W_p := w_sG \inept$,
    873       \item coin key $C := (c_s,C_p)$ with private key $c_s$ and public key $C_p := c_s G \inept$,
    874       \item RSA blinding factor $b \inrsa$.
    875     \end{itemize}
    876     The customer first persists\footnote{When we say ``persist'', we mean that the value
    877     is stored in such a way that it can be recovered after a system crash, and
    878     the protocol execution can be re-tried from a checkpoint
    879     without losing money sent in the next step.} $\langle W, C, b \rangle$.
    880     Then the customer transfers an amount of money corresponding to
    881     at least $K_v$ to the exchange, with $W_p$ in the subject line
    882     of the transaction.
    883   \item
    884     The exchange receives the transaction and credits the reserve $W_p$
    885     with the respective amount in its database.
    886   \item
    887     The customer computes $B := B_b(\FDH_K(C_p))$ and sends $S_W(B)$ to
    888     the exchange to request withdrawal of $C$; here, $B_b$ denotes
    889     Chaum-style blinding with blinding factor $b$.
    890   \item
    891     The exchange checks its database if there is an existing withdraw record $\langle S_W(B), x \rangle$
    892     with existing withdraw response $x$; in this case it sends back $x$.\\
    893     Otherwise if this is a fresh withdrawal request, the exchange performs the following transaction:
    894     \begin{enumerate}
    895       \item checks if the reserve $W_p$ has sufficient funds
    896             for a coin of value corresponding to $K$,
    897       \item stores the withdrawal request and response
    898             $\langle S_W(B), S_K(B) \rangle$ in its database
    899             for future reference,
    900       \item deducts the amount corresponding to $K$ from the reserve,
    901     \end{enumerate}
    902     and then sends Chaum-style blind signature $S_K(B)$ to the customer.
    903     If the guards for the transaction fail, the exchange sends a descriptive
    904     error back to the customer, with proof that it operated correctly.
    905     Assuming the signature was valid, this would involve showing the transaction
    906     history for the reserve.
    907   \item The customer computes the unblinded signature $U_b(S_K(B))$ and
    908     verifies that $S_K(\FDH_K(C_p)) = U_b(S_K(B))$.
    909     Finally the customer persists the coin $\langle S_K(\FDH_K(C_p)), c_s \rangle$
    910     in their local wallet.
    911 \end{enumerate}
    912 
    913 
    914 \subsection{Exact and partial spending}
    915 
    916 A customer can spend coins at a merchant, under the condition that the
    917 merchant trusts the exchange that issued the coin, usually because
    918 the exchange is audited by an auditor that is trusted by the merchant.
    919 Merchants are identified by their public key $M_p$ which the
    920 customer's wallet learns through the merchant's Web page, which itself
    921 should be authenticated with X.509c.
    922 
    923 We now describe the protocol between the customer, merchant, and exchange
    924 for a transaction in which the customer spends a coin $C := (c_s, C_p)$
    925 with signature $\widetilde{C} := S_K(\FDH_K(C_p))$
    926  where $K$ is the exchange's denomination key.
    927 
    928 % FIXME: Again, these steps occur at different points in time, maybe
    929 % that's okay, but refresh is slightly different.
    930 
    931 \begin{enumerate}
    932 \item \label{contract}
    933   Let $\vec{X} := \langle X_1, \ldots, X_n \rangle$ denote the list of
    934   exchanges accepted by the merchant where each $X_j$ is a exchange's
    935   public key.
    936 \item
    937   The merchant creates a signed contract
    938   \begin{equation*}
    939     \mathcal{A} := S_M(m, f, a, H(p, r), \vec{X})
    940   \end{equation*}
    941   where $m$ is an identifier for this transaction, $f$ is the price of the offer,
    942   and $a$ is data relevant
    943   to the contract indicating which services or goods the merchant will
    944   deliver to the customer, including the merchant specific URI for the payment.
    945   $p$ is the merchant's payment information (e.g. his IBAN number), and
    946   $r$ is a random nonce.  The merchant persists $\langle \mathcal{A} \rangle$
    947   and sends $\mathcal{A}$ to the customer.
    948 \item
    949   The customer should already possess a coin $\widetilde{C}$ issued by a exchange that is
    950   accepted by the merchant, meaning $K$ of $\widetilde{C}$ should be publicly signed by
    951   some $X_j$ from $\vec{X}$, and has a value $\geq f$.
    952 % \item
    953   Let $X_j$ be the exchange which signed $\widetilde{C}$ with $K$.
    954   The customer generates a \emph{deposit-permission}
    955     $$\mathcal{D} := S_c(\widetilde{C}, m, f, H(a), H(p,r), M_p)$$
    956   and sends $\langle \mathcal{D}, X_j\rangle$ to the merchant. \label{step:first-post}
    957 \item
    958   The merchant gives $(\mathcal{D}, p, r)$ to the exchange, thereby
    959   revealing $p$ only to the exchange.
    960 \item
    961   The exchange validates $\mathcal{D}$ and checks for double spending.
    962   If the coin has been involved in previous transactions and the new
    963   one would exceed its remaining value, it sends an error
    964   with the records from the previous transactions back to the merchant. \\
    965   %
    966   If double spending is not found, the exchange persists $\langle \mathcal{D} \rangle$
    967   and signs a message affirming the deposit operation was successful.
    968 \item
    969   The merchant persists the response and forwards the notification from the exchange to the
    970   customer, confirming the success or failure
    971   of the operation.
    972 \end{enumerate}
    973 
    974 We have simplified the exposition by assuming that one coin suffices,
    975 but in practice a customer can use multiple coins from the same
    976 exchange where the total value adds up to $f$ by running the above
    977 steps for each of the coins.
    978 
    979 If a transaction is aborted after step~\ref{step:first-post}, subsequent
    980 transactions with the same coin could be linked to this operation.
    981 The same applies to partially spent coins where $f$ is smaller than
    982 the actual value of the coin.  To unlink subsequent transactions from
    983 a coin, the customer has to execute the following coin refreshing
    984 protocol with the exchange.
    985 
    986 %\begin{figure}[h]
    987 %\centering
    988 %\begin{tikzpicture}
    989 %
    990 %\tikzstyle{def} = [node distance= 1em, inner sep=.5em, outer sep=.3em];
    991 %\node (origin) at (0,0) {};
    992 %\node (offer) [def,below=of origin]{make offer (merchant $\rightarrow$ customer)};
    993 %\node (A) [def,below=of offer]{permit lock (customer $\rightarrow$ merchant)};
    994 %\node (B) [def,below=of A]{apply lock (merchant $\rightarrow$ exchange)};
    995 %\node (C) [def,below=of B]{confirm (or refuse) lock (exchange $\rightarrow$ merchant)};
    996 %\node (D) [def,below=of C]{sign contract (merchant $\rightarrow$ customer)};
    997 %\node (E) [def,below=of D]{permit deposit (customer $\rightarrow$ merchant)};
    998 %\node (F) [def,below=of E]{make deposit (merchant $\rightarrow$ exchange)};
    999 %\node (G) [def,below=of F]{transfer confirmation (exchange $\rightarrow$ merchant)};
   1000 %
   1001 %\tikzstyle{C} = [color=black, line width=1pt]
   1002 %\draw [->,C](offer) -- (A);
   1003 %\draw [->,C](A) -- (B);
   1004 %\draw [->,C](B) -- (C);
   1005 %\draw [->,C](C) -- (D);
   1006 %\draw [->,C](D) -- (E);
   1007 %\draw [->,C](E) -- (F);
   1008 %\draw [->,C](F) -- (G);
   1009 %
   1010 %\draw [->,C, bend right, shorten <=2mm] (E.east)
   1011 %      to[out=-135,in=-45,distance=3.8cm] node[left] {aggregate} (D.east);
   1012 %\end{tikzpicture}
   1013 %\caption{Interactions between a customer, merchant and exchange in the coin spending
   1014 %  protocol}
   1015 %\label{fig:spending_protocol_interactions}
   1016 %\end{figure}
   1017 
   1018 
   1019 \subsection{Refreshing} \label{sec:refreshing}
   1020 
   1021 We now describe the refresh protocol whereby a dirty coin $C'$ of
   1022 denomination $K$ is melted to obtain a fresh coin $\widetilde{C}$.  To
   1023 simplify the description, this section describes the case where one
   1024 {\em unspent} dirty coin (for example, from an aborted transaction) is
   1025 exchanged for a fresh coin of the same denomination.  We have again
   1026 simplified the exposition by creating only one fresh coin.  In practice,
   1027 Taler uses a natural extension where multiple fresh coins of possibly
   1028 many different denominations are generated at the same time. For this,
   1029 the wallet simply specifies an array of coins wherever the protocol
   1030 below specifies only a single coin. The different denominations of the
   1031 fresh coins must be chosen by the wallet such that their value adds up
   1032 to the remaining balance of the dirty coin.  This way, refreshing
   1033 enables giving precise change matching any amount, assuming the
   1034 exchange offers an adequate value range in its denominations.
   1035 
   1036 In the protocol, $\kappa \ge 2$ is a security parameter for the
   1037 cut-and-choose part of the protocol.  $\kappa = 3$ is actually
   1038 perfectly sufficient in most cases in practice, as the cut-and-choose
   1039 protocol does not need to provide cryptographic security: If the
   1040 maximum applicable tax is less than $\frac{2}{3}$, then $\kappa = 3$
   1041 ensures that cheating results in a negative financial return on
   1042 average as $\kappa - 1$ out of $\kappa$ attempts to hide from taxation
   1043 are detected and penalized by a total loss.  This makes our use of
   1044 cut-and-choose practical and efficient, orders of magnitude faster
   1045 than comparable proposed uses of zk-SNARKs in ZeroCash~\cite{AccountableZerocash}.
   1046 % and orders of magnitude more more bandwidth efficient than
   1047 % comparable proposed uses of zero-knowledge proof in BOLT~\cite{BOLT}.
   1048 
   1049 % FIXME: I'm explicit about the rounds in postquantum.tex
   1050 
   1051 \begin{enumerate}
   1052 \item %[POST {\tt /refresh/melt}]
   1053     For each $i = 1,\ldots,\kappa$, the customer randomly generates
   1054     a transfer private key $t^{(i)}_s \inecc$ and computes
   1055     \begin{enumerate}
   1056     \item the transfer public key $T^{(i)}_p := t^{(i)}_s G \inept$ and
   1057     \item the new coin secret seed $L^{(i)} := H(c'_s T_p^{(i)})$.
   1058     \end{enumerate}
   1059     We have computed $L^{(i)}$ as a Diffie-Hellman shared secret between
   1060     the transfer key pair $T^{(i)} := \left(t^{(i)}_s,T^{(i)}_p\right)$
   1061     and old coin key pair $C' := \left(c_s', C_p'\right)$;
   1062     as a result, $L^{(i)} = H(t^{(i)}_s C'_p)$ also holds.
   1063     Now the customer applies key derivation functions $\KDF_{\textrm{blinding}}$ and $\KDF_{\textrm{Ed25519}}$ to $L^{(i)}$ to generate
   1064     \begin{enumerate}
   1065       \item a blinding factor $b^{(i)} = \FDH_K(\KDF_{\textrm{blinding}}(L^{(i)}))$.
   1066       \item $c_s^{(i)} = \KDF_{\textrm{Ed25519}}(L^{(i)})$
   1067     \end{enumerate}
   1068     Now the customer can compute her new coin key pair
   1069      $C^{(i)} := \left(c_s^{(i)}, C_p^{(i)}\right)$
   1070      where $C^{(i)}_p := c^{(i)}_s G$.
   1071 
   1072     The customer persists $\langle C', \vec{t}\rangle$ where
   1073     $\vec{t} = \langle t^{(1)}_s, \ldots, t^{(\kappa)}_s \rangle$.
   1074     We observe that $t^{(i)}_s$ suffices to regenerate $C^{(i)}$ and $b^{(i)}$
   1075     using the same key derivation functions.
   1076 
   1077   % \item
   1078     The customer computes $B^{(i)} := B_{b^{(i)}}(\FDH_K(C^{(i)}_p))$
   1079     for $i \in \{1,\ldots,\kappa\}$ and sends a signed commitment
   1080      $S_{C'}(\vec{B}, \vec{T_p})$ to the exchange.
   1081   \item % [200 OK / 409 CONFLICT]
   1082     The exchange checks that $C'_p$ is a valid coin of sufficient balance
   1083     to cover the value of the fresh coins to be generated and prevent
   1084     double-spending.  Then,
   1085     the exchange generates a random $\gamma$ with $1 \le \gamma \le \kappa$ and
   1086     marks $C'_p$ as spent by persisting the \emph{refresh-record}
   1087     $\mathcal{F} = \langle C', \gamma, S_{C'}(\vec{B}, \vec{T_p}) \rangle$.
   1088     Auditing processes should assure that $\gamma$ is unpredictable until
   1089     this time to prevent the exchange from assisting tax evasion. \\
   1090     %
   1091     The exchange sends $S_{K'}(C'_p, \gamma)$ to the customer where
   1092     $K'$ is the exchange's message signing key, thereby committing the exchange to $\gamma$.
   1093   \item % [POST {\tt /refresh/reveal}]
   1094     The customer persists $\langle C', S_K(C'_p, \gamma) \rangle$.
   1095     Also, the customer assembles
   1096       $\mathfrak{R} := \left(t_s^{(i)}\right)_{i \ne \gamma}$
   1097     and sends $S_{C'}(\mathfrak{R})$ to the exchange.
   1098   \item %[200 OK / 400 BAD REQUEST]  % \label{step:refresh-ccheck}
   1099     The exchange checks whether $\mathfrak{R}$ is consistent with
   1100     the commitments; specifically, it computes for $i \not= \gamma$:
   1101 
   1102     \vspace{-2ex}
   1103     \begin{minipage}{3.5cm}
   1104     \begin{align*}
   1105       \overline{L^{(i)}} :&= H(t_s^{(i)} C_p') \\
   1106       \overline{c_s^{(i)}} :&= \KDF_{\textrm{Ed25519}}(\overline{L^{(i)}}) \\
   1107       \overline{C^{(i)}_p} :&= \overline{c_s^{(i)}} G
   1108      \end{align*}
   1109     \end{minipage}
   1110     \begin{minipage}{3cm}
   1111      \begin{align*}
   1112        \overline{T_p^{(i)}} :&= t_s^{(i)} G \\
   1113        \overline{b^{(i)}} :&= \FDH_K(\KDF_{\textrm{blinding}}(\overline{L^{(i)}})) \\
   1114        \overline{B^{(i)}} :&= B_{\overline{b^{(i)}}}(\FDH_K\overline{C_p^{(i)}})
   1115      \end{align*}
   1116     \end{minipage}
   1117 
   1118     and checks if $\overline{B^{(i)}} = B^{(i)}$
   1119     and $\overline{T^{(i)}_p} = T^{(i)}_p$.
   1120 
   1121   % \item[200 OK / 409 CONFLICT]  % \label{step:refresh-done}
   1122     If the commitments were consistent, the exchange sends the
   1123     blind signature $\widetilde{C} := S_{K}(B^{(\gamma)})$ to the customer.
   1124     Otherwise, the exchange responds with an error indicating
   1125      the location of the failure.
   1126 \end{enumerate}
   1127 
   1128 % FIXME: Maybe explain why we don't need n-m refreshing?
   1129 % FIXME: What are the privacy implication of not having n-m refresh?
   1130 %        What about the resulting number of large coins, doesn't this reduce the anonymity set?
   1131 
   1132 %\subsection{N-to-M Refreshing}
   1133 %
   1134 %TODO: Explain, especially subtleties regarding session key / the spoofing attack that requires signature.
   1135 
   1136 \subsection{Linking}\label{subsec:linking}
   1137 
   1138 % FIXME: What is \mathtt{link} ?
   1139 
   1140 For a coin that was successfully refreshed, the exchange responds to a
   1141 request $S_{C'}(\mathtt{link})$ with $(T^{(\gamma)}_p, \widetilde{C})$.
   1142 %
   1143 This allows the owner of the melted coin to derive the private key of
   1144 the new coin, even if the refreshing protocol was illicitly executed
   1145 with the help of another party who generated $\vec{c_s}$ and only
   1146 provided $\vec{C_p}$ and other required information to the old owner.
   1147 As a result, linking ensures that access to the new coins issued in
   1148 the refresh protocol is always {\em shared} with the owner of the
   1149 melted coins.  This makes it impossible to abuse the refresh protocol
   1150 for {\em transactions}.
   1151 
   1152 The linking request is not expected to be used at all during ordinary
   1153 operation of Taler.  If the refresh protocol is used by Alice to
   1154 obtain change as designed, she already knows all of the information
   1155 and thus has little reason to request it via the linking protocol.
   1156 The fundamental reason why the exchange must provide the link protocol
   1157 is simply to provide a threat: if Bob were to use the refresh protocol
   1158 for a transaction of funds from Alice to him, Alice may use a link
   1159 request to gain shared access to Bob's coins. Thus, this threat
   1160 prevents Alice and Bob from abusing the refresh protocol to evade
   1161 taxation on transactions. If Bob trusts Alice to not execute the link
   1162 protocol, then they can already conspire to evade taxation by simply
   1163 exchanging the original private coin keys.  This is permitted in our
   1164 taxation model as with such trust they are assumed to be the same
   1165 entity.
   1166 
   1167 The auditor can anonymously check if the exchange correctly implements the
   1168 link request, thus preventing the exchange operator from secretly disabling
   1169 this protocol component.  Without the link operation, Taler would
   1170 devolve into a payment system where both sides can be anonymous, and
   1171 thus no longer provide taxability.
   1172 
   1173 
   1174 \subsection{Refunds}
   1175 
   1176 The refresh protocol offers an easy way to enable refunds to
   1177 customers, even if they are anonymous.  Refunds are supported
   1178 by including a public signing key of the merchant in the transaction
   1179 details, and having the customer keep the private key of the spent
   1180 coins on file.
   1181 
   1182 Given this, the merchant can simply sign a {\em refund confirmation}
   1183 and share it with the exchange and the customer.  Assuming the
   1184 exchange has a way to recover the funds from the merchant, or has not
   1185 yet performed the wire transfer, the exchange can simply add the value
   1186 of the refunded transaction back to the original coin, re-enabling
   1187 those funds to be spent again by the original customer.  This customer
   1188 can then use the refresh protocol to anonymously melt the refunded
   1189 coin and create a fresh coin that is unlinkable to the refunded
   1190 transaction.
   1191 
   1192 
   1193 \subsection{Error handling}
   1194 
   1195 During operation, there are three main types of errors that are
   1196 expected.  First, in the case of faulty clients, the responding server
   1197 will generate an error message with detailed cryptographic proofs
   1198 demonstrating that the client was faulty, for example by providing
   1199 proof of double-spending or providing the previous commit and the
   1200 location of the mismatch in the case of the reveal step in the
   1201 refresh protocol.  It is also possible that the server may claim that
   1202 the client has been violating the protocol.  In these cases, the
   1203 clients should verify any proofs provided and if they are acceptable,
   1204 notify the user that they are somehow faulty.  Similar, if the
   1205 server indicates that the client is violating the protocol, the
   1206 client should record the interaction and enable the user to file a
   1207 bug report.
   1208 
   1209 The second case is a faulty exchange service provider.  Here, faults
   1210 will be detected when the exchange provides a faulty proof or no
   1211 proof.  In this case, the client is expected to notify the auditor,
   1212 providing a transcript of the interaction.  The auditor can then
   1213 anonymously replay the transaction, and either provide the now correct
   1214 response to the client or take appropriate legal action against the
   1215 faulty exchange.
   1216 
   1217 The third case are transient failures, such as network failures or
   1218 temporary hardware failures at the exchange service provider.  Here,
   1219 the client may receive an explicit protocol indication, or simply no
   1220 response.  The appropriate behavior for the client is to automatically
   1221 retry a few times with back-off.  If this still fails, the user can,
   1222 depending on the type of operation, either attempt to recover the now
   1223 dirty coin using the refresh protocol, or notify the auditor about the
   1224 outage.  Using this process, short term failures should be effectively
   1225 obscured from the user, while malicious behavior is reported to the
   1226 auditor who can then presumably rectify the situation, using methods
   1227 such as shutting down the operator and helping customers to regain
   1228 refunds for coins in their wallets.  To ensure that such refunds are
   1229 possible, the operator is expected to always provide adequate
   1230 securities for the amount of coins in circulation as part of the
   1231 certification process.
   1232 
   1233 
   1234 %As with support for fractional payments, Taler addresses these
   1235 %problems by allowing customers to refresh tainted coins, thereby
   1236 %destroying the link between the refunded or aborted transaction and
   1237 %the new coin.
   1238 
   1239 \section{Correctness}
   1240 
   1241 \subsection{Taxability arguments}
   1242 
   1243 We assume the exchange operates honestly when discussing taxability.
   1244 We feel this assumption is warranted mostly because a Taler exchange
   1245 requires licenses to operate as a financial institution, which it
   1246 risks losing if it knowingly facilitates tax evasion.
   1247 We also expect an auditor monitors the exchange similarly to how
   1248 government regulators monitor financial institutions.
   1249 In fact, our auditor software component gives the auditor read access
   1250 to the exchange's database, and carries out test operations anonymously,
   1251 which expands its power over conventional auditors.
   1252 
   1253 \begin{proposition}
   1254 Assuming the exchange operates the refresh protocol honestly,
   1255 a customer operating the refresh protocol dishonestly expects to
   1256 loose $1 - {1 \over \kappa}$ of the value of their coins.
   1257 \end{proposition}
   1258 
   1259 \begin{proof}
   1260 An honest exchange keeps any funds being refreshed if the reveal
   1261 phase is never carried out, does not match the commitment, or shows
   1262 an incorrect commitment.  As a result, a customer dishonestly
   1263 refreshing a coin looses their money if they have more than one
   1264 dishonest commitment.  If they make exactly one dishonest
   1265 commitment, they have a $1 \over \kappa$ chance of their
   1266 dishonest commitment being selected for the refresh.
   1267 \end{proof}
   1268 
   1269 We say a coin $C$ is {\em controlled} by a user if the user's wallet knows
   1270 its secret scalar $c_s$, the signature $S$ of the appropriate denomination
   1271 key on its public key $C_s$, and the residual value of the coin.
   1272 
   1273 We assume the wallet cannot loose knowledge of a particular coin's
   1274 key material, and the wallet can query the exchange to learn the
   1275 residual value of the coin, so a wallet cannot loose control of
   1276 a coin.  A wallet may loose the monetary value associated with a coin
   1277 if another wallet spends it however.
   1278 
   1279 We say a user Alice {\em owns} a coin $C$ if only Alice's wallets can
   1280 gain control of $C$ using standard interactions with the exchange.
   1281 In other words, ownership means exclusive control not just in the
   1282 present, but in the future even if another user interacts with the
   1283 exchange.
   1284 
   1285 \begin{theorem}
   1286 Let $C$ denote a coin controlled by users Alice and Bob.
   1287 Suppose Bob creates a fresh coin $C'$ from $C$ following the refresh protocol.
   1288 Assuming the exchange and Bob operated the refresh protocol correctly,
   1289 and that the exchange continues to operate the linking protocol
   1290 in \S\ref{subsec:linking} correctly, then
   1291  Alice can gain control of $C'$ using the linking protocol.
   1292 \end{theorem}
   1293 
   1294 \begin{proof}
   1295 Alice may run the linking protocol to obtain all transfer keys $T^i$,
   1296 bindings $B^i$ associated to $C$, and those coins denominations,
   1297 including the $T'$ for $C'$.
   1298 
   1299 We assumed both the exchange and Bob operated the refresh protocol
   1300 correctly, so now $c_s T'$ is the seed from which $C'$ was generated.
   1301 Alice rederives both $c_s$ and the blinding factor to unblind the
   1302 denomination key signature on $C'$.  Alice finally asks the exchange
   1303 for the residual value on $C'$ and runs the linking protocol to
   1304 determine if it was refreshed too.
   1305 \end{proof}
   1306 
   1307 As discussed in the next subsection, there are serious privacy risks
   1308 from coins obtained through the linking protocol, so we must not
   1309 implement the linking protocol in the wallet ourselves.
   1310 We assert that Taler is taxable on the grounds that any user who
   1311 modified their wallet to operate dishonestly could similarly modify
   1312 it to use the linking protocol to cheat other users. 
   1313 
   1314 Although this claim holds broadly, one could envision violating it
   1315 with advanced forms of Digital Restrictions Management (DRM) that
   1316 exploited trusted code execution.  We discount this threat as being
   1317 similar to the withdrawal loophole in that participating users must
   1318 trust hostile software, but we recommend that hardware DRM be
   1319 outlawed for posing a threat to the state's tax base.
   1320 % along with more serious concerns. %\cite RMS or EFF or ??
   1321 
   1322 \begin{corollary}
   1323 Assuming the user can operate their computer freely,
   1324 abusing the refresh protocol to transfer ownership has an
   1325 expected loss of $1 - \frac{1}{\kappa}$ of the transaction value.
   1326 \end{corollary}
   1327 
   1328 
   1329 \subsection{Privacy arguments}
   1330 
   1331 The {\em linking problem} for blind signature is,
   1332 if given coin creation transcripts and possibly fewer
   1333 coin deposit transcripts for coins from the creation transcripts,
   1334 then produce a corresponding creation and deposit transcript.
   1335 
   1336 We say an adversary {\em links} coins if it has a non-negligible
   1337 advantage in solving the linking problem, when given the private
   1338 keys of the exchange.
   1339 
   1340 In Taler, there are two forms of coin creation transcripts,
   1341 withdrawal and refresh.
   1342 
   1343 \begin{lemma}
   1344 If there are no refresh operations, any adversary with an
   1345 advantage in linking coins is polynomially equivalent to an
   1346 adversary with the same advantage in recognizing blinding factors.
   1347 \end{lemma}
   1348 
   1349 \begin{proof}
   1350 Let $n$ denote the RSA modulus of the denomination key.
   1351 Also let $d$ and $e$ denote the private and public exponents, respectively.
   1352 In effect, coin withdrawal transcripts consist of numbers
   1353 $b m^d \mod n$ where $m$ is the FDH of the coin's public key
   1354 and $b$ is the blinding factor, while coin deposits transcripts
   1355 consist of only $m^d \mod n$.
   1356 
   1357 If the adversary can link coins then they can compute the blinding
   1358 factors as $b m^d / m^d \mod n$.  Conversely, if the adversary can
   1359 recognize blinding factors then they link coins after first computing
   1360 $b_{i,j} = b_i m_i^d / m_j^d \mod n$ for all $i,j$.
   1361 \end{proof}
   1362 
   1363 % As a corollary, Taler would have information theoretic privacy 
   1364 % if the blinding factors were truly random and
   1365 %  refresh operations were disallowed.
   1366 
   1367 We actually generate blinding factors using an FDH built by
   1368 running HMAC-SHA512 on a secret 256 bit seed and a count until
   1369 it outputs a number $b$ less than $n$ satisfying $\gcd(b,n) = 1$.
   1370 
   1371 \begin{corollary}
   1372 Assuming no refresh operation,
   1373 any adversary with an advantage for linking Taler coins gives rise
   1374 to an adversary with an advantage for recognizing our SHA512 output.
   1375 \end{corollary}
   1376 
   1377 Importantly, we do not consider coins about which wallet learns
   1378 through the linking protocol given in \S\ref{subsec:linking}.
   1379 An honest participant never needs to run the linking protocol,
   1380 so these coins should not appear, and we do not count them in
   1381 the adversary's advantage.   If linked coins do appear, then
   1382 they cannot be spent anonymously because the other user controlling
   1383 the coin can learn about any transactions involving these coins.
   1384 Worse still, the exchange itself could issue tagged coins through
   1385 the linking protocol.  As a result, we limit the refresh protocol to
   1386 a feature offered by the exchange, and test it from the auditor, but
   1387 do not use it in any real Taler protocols and do not implement it in
   1388 the wallet.  We observed in the previous subsection that merely
   1389 the threat of the linking protocol suffices for taxability.
   1390 
   1391 \smallskip
   1392 
   1393 We will now consider the impact of the refresh operation.
   1394 For the sake of the argument, we will first consider an earlier
   1395 encryption-based version of the protocol in which a refresh operation
   1396 consisted of $\kappa$ normal coin withdrawals and the commitment
   1397 consisted of the blinding factors and private keys of the fresh coins
   1398 encrypted using the secret $t^{(i)} C_s$ where $C_s = c_s G$ of the
   1399 dirty coin $C$ being refreshed and $T^{(i)} = t^{(i)} G$ is the
   1400 transfer key.
   1401 %
   1402 In Taler, we replaced this encryption-based scheme with the current
   1403 KDF-based scheme, as the earlier scheme required more storage space,
   1404 an additional encryption primitive, and exposed more random number
   1405 generator output from the wallet.
   1406 
   1407 \begin{proposition}
   1408 Assume the encryption used is semantically (IND-CPA) secure,
   1409 given the security of a Diffie-Hellman key exchange over curve25519.
   1410 Assume also the independence of $c_s$, $t$, and the new coins' key
   1411 materials.
   1412 Then any probabilistic polynomial time (PPT) adversary with an
   1413 advantage for linking Taler coins gives rise to an adversary with
   1414  an advantage for recognizing our SHA512 output.
   1415 \end{proposition}
   1416 % TODO: Is independence here too strong?
   1417 
   1418 In fact, the exchange can launch a chosen ciphertext attack against
   1419 a dishonest customer who uses the linking protocol.  We ignore this
   1420 because we exclude such coins from our privacy garentees and the
   1421 exchange can even invent coins whole cloth.
   1422 
   1423 We shall now replace the encrpytion phase with a KDF as in our actual
   1424 protocol, except we treat the KDF as a random oracle~\cite{BR-RandomOracles}.
   1425 %
   1426 In fact, we expect doing so to increase practical security as in
   1427 \cite{Abdalla2000}, and adding the random oracle assumption need not
   1428 reduce security if it focuses more attention on the usage of hash
   1429 functions throughout the protocol.
   1430 
   1431 \begin{theorem}
   1432 In the random oracle model, any PPT adversary with an advantage
   1433 in linking Taler coins has an advantage in breaking elliptic curve
   1434 Diffie-Hellman key exchange on curve25519.
   1435 \end{theorem}
   1436 % TODO: IND-CPA again anywhere?
   1437 
   1438 \begin{proof}
   1439 We work with the usual instantiation of the random oracle model as
   1440 returning a random string and placing it into a database for future
   1441 queries.  
   1442 % TODO: this paragraph seems superfluous since its kinda sucked into
   1443 % the reference.
   1444 
   1445 We have a shared secret $k$ derived from an ECDH from which we derive
   1446 the encryption key used in the old protocol to encrypt the new coin's
   1447 blinding factor and private key.  We now choose to generate the new
   1448 coin's blinding factor and private key using a random oracle $R$
   1449 keyed by $k$.  We can do this because first the data is encrypted and
   1450 second revealing the new coin's blinding factor or public or private
   1451 keys later reveals nothing about $k$, thanks to \cite[Theorem 4.1]{Rudich88}.
   1452 
   1453 After this modification, our real KDF scheme with the KDF instantiated
   1454 by the random oracle $R$ gives the same result as our scheme that
   1455 encrypts data produced by $R$.  We now observe the encryption has
   1456 becomes superfluous and may be omitted, as another party who learns 
   1457 $t$ also learns $k$.
   1458 \end{proof}
   1459 
   1460 We may now conclude that Taler remains unlinkable even with the
   1461 refresh protocol, assuming the security of elliptic curve Diffie-Hellman
   1462 key exchange on curve25519 and that our SHA512 HMAC construction remains
   1463 strong enough.  We have lost our clean assumption on merely the hardness
   1464 of recognizing our SHA512 output, due to using the random oracle model,
   1465 but recognizing has output remains the most realistic attack. 
   1466 We use an HMAC in our implementation to make this part more robust.
   1467 
   1468 We do not distinguish between information known by the exchange and
   1469 information known by the merchant in the above.  As a result, this
   1470 proves that our linking protocol \S\ref{subsec:linking} does not
   1471 degrade privacy.  We note that the exchange could lie in the linking
   1472 protocol about the transfer public key to generate coins that it can
   1473 link, at a financial loss to the exchange that it would have to share
   1474 with its auditor.  However, in the normal course of payments the link
   1475 protocol is never used.
   1476 
   1477 \subsection{Exculpability arguments}
   1478 
   1479 In \S\ref{subsec:security_rough},
   1480 we quoted \cite[Theorem 12]{RSA-FDH-KTIvCTI} that RSA-FDH blind
   1481 signatures are secure against ``one-more forgery'' attacks, assuming
   1482  the RSA known-target inversion problem is hard.
   1483 We note as well that ``one-more forgery'' attacks cover both the
   1484 refresh operation as well as the withdrawal operarion
   1485  \cite[Definition 12]{RSA-FDH-KTIvCTI,OneMoreInversion}.
   1486 
   1487 \begin{lemma}\label{lemma:double-spending}
   1488 The exchange can detect, prevent, and prove double-spending.
   1489 \end{lemma}
   1490 
   1491 \begin{proof}
   1492 A coin can only be spent by running the deposit protocol or the refresh
   1493 protocol with the exchange.  Thus every time a coin is spent, the exchange
   1494 obtains either a deposit-permission or a refresh-record, both of which
   1495 contain a signature made with the public key of coin to authorizing the
   1496 respective operation.  If the exchange has a set of refresh-records and
   1497 deposit-permissions whose total value exceed the value of the coin, the
   1498 exchange can show this set to prove that double-spending is being
   1499 attempted and justify rejecting the operation.
   1500 \end{proof}
   1501 
   1502 \begin{corollary}
   1503 Merchants and customers can verify proofs of double-spending attempts
   1504 by verifying that the signatures in the set of refresh-records and
   1505 deposit-permissions are correct and that the total value would exceed
   1506 the coin's value.
   1507 \end{corollary}
   1508 
   1509 \begin{lemma}
   1510 % only holds given sufficient time
   1511 Customers can either obtain proof-of-payment or their money back, even
   1512 when the merchant is faulty.
   1513 \end{lemma}
   1514 
   1515 \begin{proof}
   1516 When the customer sends the deposit-permission for a coin to a correct
   1517 merchant, the merchant will pass it on to the exchange, and pass the
   1518 exchange's response, a deposit-confirmation, on to the customer.  If
   1519 the customer does not receive a deposit-confirmation from the
   1520 merchant, it will run the refresh protocol.  If the faulty merchant
   1521 did deposit the coin, the customer will receive the
   1522 deposit-confirmation as part of the double-spending proof from the
   1523 refreshing protocol.  If the merchant did not deposit the coin, the
   1524 customer receives a new, unlinkable coin.
   1525 \end{proof}
   1526 
   1527 \begin{corollary}
   1528 If a customer paid for a contract signed by a merchant,
   1529 they can prove it by showing the deposit permissions for all coins.
   1530 \end{corollary}
   1531 
   1532 \begin{lemma}
   1533 Only the merchant can issue refunds, and only to the original customer.
   1534 \end{lemma}
   1535 
   1536 \begin{proof}
   1537 The refund protocol requires a signature matching the merchant's public
   1538 key, which had to be included in the original contract.
   1539 Since the refund only increases the balance of a coin that the original
   1540 customer owns, only the original customer can use the increased balance.
   1541 \end{proof}
   1542 
   1543 
   1544 \begin{theorem}
   1545   The protocol prevents double-spending and provides exculpability.
   1546 \end{theorem}
   1547 \begin{proof}
   1548   Follows from Lemma~\ref{lemma:double-spending} and the assumption
   1549   that the exchange cannot forge signatures to obtain an fake
   1550   set of deposit-permissions or refresh-records.
   1551 \end{proof}
   1552 
   1553 
   1554 
   1555 \section{Implementation}
   1556 
   1557 We implemented the Taler protocol in the context of a payment system
   1558 for the Web, as shown in Figure~\ref{fig:taler-arch}.  The system was
   1559 designed for real-world usage with current Web technology and within
   1560 the existing financial system.
   1561 
   1562 By instructing their bank to send money to an exchange, the customer
   1563 creates a (non-anonymous) balance, called a \emph{reserve}, at the
   1564 exchange.  The customer can subsequently withdraw coins from this
   1565 reserve into their \emph{wallet}, which stores and manages coins.
   1566 
   1567 To withdrawal of coins from the exchange, the customer's wallet authenticates
   1568 itself using an Ed25519 private key for the customer's reserve.
   1569 The customer must include the corresponding reserve public key in the
   1570 payment instruction from the customer's bank to the exchange's bank
   1571 that funded their reserve.  With a bank that directly supports Taler
   1572 on their online banking website, this process is streamlined for the
   1573 user, since the wallet automatically creates the key pair for the
   1574 reserve and adds the public key to the payment instruction.
   1575 
   1576 While browsing a merchant's website, the website can signal the wallet
   1577 to request a payment from a user.  The user is then asked to confirm
   1578 or reject this proposal.  The merchant deposits coins received from
   1579 the customer's wallet at the exchange.  Since bank transfers are
   1580 usually costly, the exchange delays and aggregates multiple deposits
   1581 into a bigger wire transfer.  This allows Taler to be used even for
   1582 microtransactions of amounts smaller than usually handled by the
   1583 underlying banking system.
   1584 
   1585 As shown in Figure~\ref{fig:taler-arch}, the merchant is internally split
   1586 into multiple components.  The implementation of the Taler prococol and
   1587 cryptographic operations is isolated into a separate component, called
   1588 the \emph{merchant backend}, which the merchant accesses through an API
   1589 or software development kit (SDK) of their choice.
   1590 
   1591 Our implementations of the exchange (70,000 LOC) and merchant backend
   1592 (20,000 LOC) are written in C using PostgreSQL as the database and
   1593 libgcrypt for cryptographic operations.  The \emph{wallet} (10,000
   1594 LOC) is implemented in TypeScript as a cross-browser extension using
   1595 the WebExtensions API, which is available for a majority of widely
   1596 used browsers.  It also uses libgcrypt (compiled to JavaScript) for
   1597 cryptographic operations as the required primitives are not yet
   1598 natively supported by Web browsers.  Sample merchant websites (1,000
   1599 LOC) and an example bank (2,000 LOC) with tight Taler integration are
   1600 provided in Python.
   1601 
   1602 The code is available at \url{https://git.taler.net/} and a demo
   1603 is publicly available at \url{https://demo.taler.net/}.
   1604 
   1605 
   1606 \begin{figure}
   1607   \includegraphics[width=\columnwidth]{taler-arch-full.pdf}
   1608   \caption{The different components of the Taler system in the
   1609     context of a banking system providing money creation,
   1610     wire transfers and authentication. (Auditor omitted.)}
   1611   \label{fig:taler-arch}
   1612 \end{figure}
   1613 
   1614 
   1615 \section{Experimental results}
   1616 
   1617 %\begin{figure}[b!]
   1618 %    \includegraphics[width=\columnwidth]{bw_in.png}
   1619 %    \caption{Incoming traffic at the exchange, in bytes per 5 minutes.}
   1620 %    \label{fig:in}
   1621 %\end{figure}\hfill
   1622 %  \begin{figure}[b!]
   1623 %    \includegraphics[width=\columnwidth]{bw_out.png}
   1624 %    \caption{Outgoing traffic from the exchange, in bytes per 5 minutes.}
   1625 %    \label{fig:out}
   1626 %  \end{figure}
   1627 %  \begin{figure}[b!]
   1628 %    \includegraphics[width=\columnwidth]{db_read.png}
   1629 %    \caption{DB read operations per second.}
   1630 %    \label{fig:read}
   1631 %  \end{figure}
   1632 %  \begin{figure}[b!]
   1633 %    \includegraphics[width=\columnwidth]{db_write.png}
   1634 %    \caption{DB write operations per second.}
   1635 %    \label{fig:write}
   1636 %   \end{figure}
   1637 %  \begin{figure}[b!]
   1638 %    \includegraphics[width=\columnwidth]{cpu_balance.png}
   1639 %    \caption{CPU credit balance. Hitting a balance of 0 shows the CPU is
   1640 %       the limiting factor.}
   1641 %    \label{fig:cpu}
   1642 %  \end{figure}
   1643 %  \begin{figure}[b!]
   1644 %    \includegraphics[width=\columnwidth]{cpu_usage.png}
   1645 %    \caption{CPU utilization. The t2.micro instance is allowed to use 10\% of
   1646 %       one CPU.}
   1647 %    \label{fig:usage}
   1648 %  \end{figure}
   1649 %  \caption{Selected EC2 performance monitors for the experiment in the EC2
   1650 %           (after several hours, once the system was ``warm'').}
   1651 %  \label{fig:ec2}
   1652 %\end{figure}
   1653 
   1654 We ran the Taler exchange v0.0.2 on an Amazon EC2 t2.micro instance
   1655 (10\% of a Xeon E5-2676 at 2.4 GHz) based on Ubuntu 14.04.4 LTS, using
   1656 a db.t2.micro instance with Postgres 9.5 for the database.  We used
   1657 1024-bit RSA keys for blind signatures, Curve25519 for DH, EdDSA
   1658 for non-blind signatures and SHA-512 for hashing.  For the KDF and
   1659 FDH operations we used~\cite{rfc5869} with SHA-512 as XTR and SHA-256
   1660 for PRF as suggested in~\cite{rfc5869}.  Using 16
   1661 concurrent clients performing withdraw, deposit and refresh operations
   1662 we then pushed the t2.micro instance to the resource limit
   1663 %(Figure~\ref{fig:cpu})
   1664 from a network with $\approx$ 160 ms latency to
   1665 the EC2 instance.  At that point, the instance managed about 8 HTTP
   1666 requests per second, which roughly corresponds to one full business
   1667 transaction, given that a full business transaction is expected to
   1668 involve withdrawing and depositing several coins.  The network traffic
   1669 was modest at approximately 50 kbit/sec from the exchange
   1670 %(Figure~\ref{fig:out})
   1671 and 160 kbit/sec to the exchange.
   1672 %(Figure~\ref{fig:in}).
   1673 At network latencies above 10 ms, the delay
   1674 for executing a transaction is dominated by the network latency, as
   1675 local processing virtually always takes less than 10 ms.
   1676 
   1677 Database transactions are dominated by writes%
   1678 %(Figure~\ref{fig:read} vs.  Figure~\ref{fig:write})
   1679 , as Taler mostly needs to log
   1680 transactions and occasionally needs to read to guard against
   1681 double-spending.  Given a database capacity of 2 TB---which should
   1682 suffice for more than one year of full transaction logs---the
   1683 described setup has a hosting cost within EC2 of approximately USD 252
   1684 per month, or roughly 0.0001 USD per full business transaction.  This
   1685 compares favorably to the $\approx$ USD 10 per business transaction
   1686 for Bitcoin and the \EUR{0.35} plus 1.9\% charged by Paypal for
   1687 domestic transfers within Germany.
   1688 
   1689 In the Amazon EC2 billing, the cost for the database (using SSD
   1690 storage) dominates the cost with more than USD 243 per month.  We note
   1691 that these numbers are approximate, as the frontend and backend in our
   1692 configuration uses systems from the AWS Free Usage Tier and is not
   1693 perfectly balanced in between frontend and backend.  Nevertheless,
   1694 these experimental results show that computing-related business costs
   1695 will only marginally contribute to the operational costs of the Taler
   1696 payment system.
   1697 
   1698 Scalability of the design is also not a concern, as the exchange's
   1699 database can be easily shareded over the different public keys as
   1700 desired.  Similar to the RSCoin~\cite{danezis2016rscoin} design, this
   1701 ensures that conflicting transactions end up in the same shard,
   1702 enabling linear scalability of the database operations.  Similarly,
   1703 the cryptographic verification in the frontend can be distributed over
   1704 as many compute nodes as required.
   1705 
   1706 Unfortunately it was not possible to experimentally compare the performance of
   1707 Taler directly to other e-cash systems, since to our best knowledge there
   1708 is no working and publicly available implementation of any of them.
   1709 
   1710 When compared with the current average confirmation time for Bitcoin
   1711 payments, Taler is many orders of magnitude faster.  In a LAN, Taler
   1712 transactions taking about ten milliseconds are doable, given the speed
   1713 of modern SSD drives and RSA/EdDSA signature verification
   1714 algorithms.\footnote{We refer to \url{https://bench.cr.yp.to/} for
   1715   detailed benchmarks of cryptographic primitives.}  In practice, a
   1716 few network round trips for the TCP/HTTPS handshakes and the HTTP
   1717 request dominate overall latency.  While the confirmation time of
   1718 Taler is thus typically in the order of a few hundered milliseconds,
   1719 the time to mine even one block in Bitcoin is around ten
   1720 minutes \footnote{Data retrieved in May 2017 from
   1721   \url{https://blockchain.info/stats}}.  Bitcoin merchants following
   1722 the Bitcoin specification must wait for six such blocks until they
   1723 consider a transaction confirmed.  Thus latency for durable
   1724 transactions in Bitcoin is about three to four orders of magnitude
   1725 lower.
   1726 
   1727 \section{Discussion}
   1728 
   1729 \subsection{Well-known attacks}
   1730 
   1731 Taler's security is largely equivalent to that of Chaum's original
   1732 design without online checks or the cut-and-choose revelation of
   1733 double-spending customers for offline spending.
   1734 We specifically note that the digital equivalent of the ``Columbian
   1735 Black Market Exchange''~\cite{fatf1997} is a theoretical problem for
   1736 both Chaum and Taler, as individuals with a strong mutual trust
   1737 foundation can simply copy electronic coins and thereby establish a
   1738 limited form of black transfers.  However, unlike the situation with
   1739 physical checks with blank recipients in the Columbian black market,
   1740 the transitivity is limited as each participant can deposit the electronic
   1741 coins and thereby cheat any other participant, while in the Columbian
   1742 black market each participant only needs to trust the issuer of the
   1743 check and not also all previous owners of the physical check.
   1744 
   1745 As with any unconditionally anonymous payment system, the ``Perfect
   1746 Crime'' attack~\cite{solms1992perfect} where blackmail is used to
   1747 force the exchange to issue anonymous coins also continues to apply in
   1748 principle.  However, as mentioned Taler does facilitate limits on
   1749 withdrawals, which we believe is a better trade-off than the
   1750 problematic escrow systems where the necessary intransparency
   1751 actually facilitates voluntary cooperation between the exchange and
   1752 criminals~\cite{sander1999escrow} and where the state could
   1753 deanonymize citizens.
   1754 
   1755 \subsection{Offline Payments} \label{sec:offline}
   1756 
   1757 Anonymous digital cash schemes since Chaum were frequently designed
   1758 to allow the merchant to be offline during the transaction,
   1759 by providing a means to deanonymize customers involved in
   1760 double-spending.  We consider this problematic as either the
   1761 exchange or the merchant still requires an out-of-band
   1762 means to recover funds from the customer, an expensive and
   1763 unreliable proposition.  Worse, there are unacceptable risks that
   1764 a customer may accidentally deanonymize herself, for example by
   1765 double-spending a coin after restoring from backup.
   1766 
   1767 \subsection{Merchant Tax Audits}
   1768 
   1769 For a tax audit on the merchant, the exchange includes the business
   1770 transaction-specific hash in the transfer of the traditional
   1771 currency.  A tax auditor can then request the merchant to reveal
   1772 (meaningful) details about the business transaction ($\mathcal{D}$,
   1773 $a$, $p$, $r$), including proof that applicable taxes were paid.
   1774 
   1775 If a merchant is not able to provide these values, they can be
   1776 subjected to financial penalties by the state in relation to the
   1777 amount transferred by the traditional currency transfer.
   1778 
   1779 \subsection{Cryptographic proof vs. evidence}
   1780 
   1781 In this paper we have use the term ``proof'' in many places as the
   1782 protocol provides cryptographic proofs of which parties behave
   1783 correctly or incorrectly. However, as~\cite{fc2014murdoch} point out,
   1784 in practice financial systems need to provide evidence that holds up
   1785 in courts.  Taler's implementation is designed to export evidence and
   1786 upholds the core principles described in~\cite{fc2014murdoch}.  In
   1787 particular, in providing the cryptographic proofs as evidence none of
   1788 the participants have to disclose their core secrets.
   1789 
   1790 \subsection{Business concerns} \label{sec:payback}
   1791 
   1792 The Taler system implementation includes additional protocol elements
   1793 to address real-world concerns.  To begin with, the exchange
   1794 automatically transfers any funds that have been left for an extended
   1795 amount of time in a customer's reserve back to the customer's bank
   1796 account.  Furthermore, we allow the exchange to revoke denomination
   1797 keys, and wallets periodically check for such revocations.  If a
   1798 denomination key has been revoked, the wallets use the {\em payback}
   1799 protocol to deposit funds back to the customer's reserve, from where
   1800 they are either withdrawn with a new denomination key or sent back to
   1801 the customer's bank account.  Unlike ordinary deposits, the payback
   1802 protocol does not incur any transaction fees. The primary use of the
   1803 protocol is to limit the financial loss in cases where an audit
   1804 reveals that the exchange's private keys were compromised, and to
   1805 automatically pay back balances held in a customers' wallet if an
   1806 exchange ever goes out of business.
   1807 
   1808 
   1809 %\subsection{System Performance}
   1810 %
   1811 %We performed some initial performance measurements for the various
   1812 %operations on our exchange implementation.  The main conclusion was that
   1813 %the computational and bandwidth cost for transactions described in
   1814 %this paper is smaller than $10^{-2}$ cent/transaction, and thus
   1815 %dwarfed by the other business costs for the exchange.  However, this
   1816 %figure excludes the cost of currency transfers using traditional
   1817 %banking, which a exchange operator would ultimately have to interact with.
   1818 %Here, exchange operators should be able to reduce their expenses by
   1819 %aggregating multiple transfers to the same merchant.
   1820 
   1821 
   1822 \section{Conclusion}
   1823 
   1824 We have presented an efficient electronic payment system that
   1825 simultaneously addresses the conflicting objectives created by the
   1826 citizen's need for privacy and the state's need for taxation.  The
   1827 coin refreshing protocol makes the design flexible and enables a
   1828 variety of payment methods.  The current balance and profits of the
   1829 exchange are also easily determined, thus audits can be used to ensure
   1830 that the exchange operates correctly.  The free software
   1831 implementation and open protocol may finally enable modern society to
   1832 upgrade to proper electronic wallets with efficient, secure and
   1833 privacy-preserving transactions.
   1834 
   1835 % commented out for anonymized submission
   1836 \subsection*{Acknowledgements}
   1837 
   1838 We thank people (anonymized).
   1839 %This work benefits from the financial support of the Brittany Region
   1840 %(ARED 9178) and a grant from the Renewable Freedom Foundation.
   1841 %We thank Tanja Lange, Dan Bernstein, Luis Ressel and Fabian Kirsch for feedback on an earlier
   1842 %version of this paper, Nicolas Fournier for implementing and running
   1843 %some performance benchmarks, and Richard Stallman, Hellekin Wolf,
   1844 %Jacob Appelbaum for productive discussions and support.
   1845 
   1846 %\newpage
   1847 
   1848 \bibliographystyle{ACM-Reference-Format}
   1849 \bibliography{taler,rfc,rom}
   1850 
   1851 %\end{document}
   1852 
   1853 %\vfill
   1854 %\begin{center}
   1855 % \Large  Demonstration available at \url{https://demo.taler.net/}
   1856 %\end{center}
   1857 %\vfill
   1858 
   1859 \newpage
   1860 \appendix
   1861 
   1862 \section{Notation summary} \label{sec:notation}
   1863 
   1864 The paper uses the subscript $p$ to indicate public keys and $s$ to
   1865 indicate secret (private) keys.  For keys, we also use small letters
   1866 for scalars and capital letters for points on an elliptic curve.  The
   1867 capital letter without the subscript $p$ stands for the key pair.  The
   1868 superscript $(i)$ is used to indicate one of the elements of a vector
   1869 during the cut-and-choose protocol.  Bold-face is used to indicate a
   1870 vector over these elements.  A line above indicates a value computed
   1871 by the verifier during the cut-and-choose operation.  We use $f()$ to
   1872 indicate the application of a function $f$ to one or more arguments. Records of
   1873 data being persisted are represented in between $\langle\rangle$.
   1874 
   1875 \begin{description}
   1876   \item[$K_s$]{Denomination private (RSA) key of the exchange used for coin signing}
   1877   \item[$K_p$]{Denomination public (RSA) key corresponding to $K_s$}
   1878   \item[$K$]{Public-priate (RSA) denomination key pair $K := (K_s, K_p)$}
   1879   \item[$\FDH_K$]{Full domain hash over the modulus of $K_p$}
   1880   \item[$b$]{RSA blinding factor for RSA-style blind signatures}
   1881   \item[$B_b()$]{RSA blinding over the argument using blinding factor $b$}
   1882   \item[$U_b()$]{RSA unblinding of the argument using blinding factor $b$}
   1883   \item[$S_K()$]{Chaum-style RSA signature, $S_K(C) = U_b(S_K(B_b(C)))$}
   1884   \item[$w_s$]{Private key from customer for authentication}
   1885   \item[$W_p$]{Public key corresponding to $w_s$}
   1886   \item[$W$]{Public-private customer authentication key pair $W := (w_s, W_p)$}
   1887   \item[$S_W()$]{Signature over the argument(s) involving key $W$}
   1888   \item[$m_s$]{Private key from merchant for authentication}
   1889   \item[$M_p$]{Public key corresponding to $m_s$}
   1890   \item[$M$]{Public-private merchant authentication key pair $M := (m_s, M_p)$}
   1891   \item[$S_M()$]{Signature over the argument(s) involving key $M$}
   1892   \item[$G$]{Generator of the elliptic curve}
   1893   \item[$c_s$]{Secret key corresponding to a coin, scalar on a curve}
   1894   \item[$C_p$]{Public key corresponding to $c_s$, point on a curve}
   1895   \item[$C$]{Public-private coin key pair $C := (c_s, C_p)$}
   1896   \item[$S_{C}()$]{Signature over the argument(s) involving key $C$ (using EdDSA)}
   1897   \item[$c_s'$]{Private key of a ``dirty'' coin (otherwise like $c_s$)}
   1898   \item[$C_p'$]{Public key of a ``dirty'' coin (otherwise like $C_p$)}
   1899   \item[$C'$]{Dirty coin (otherwise like $C$)}
   1900   \item[$\widetilde{C}$]{Exchange signature $S_K(C_p)$ indicating validity of a fresh coin (with key $C$)}
   1901   \item[$n$]{Number of exchanges accepted by a merchant}
   1902   \item[$j$]{Index into a set of accepted exchanges, $i \in \{1,\ldots,n\}$}
   1903   \item[$X_j$]{Public key of a exchange (not used to sign coins)}
   1904   \item[$\vec{X}$]{Vector of $X_j$ signifying exchanges accepted by a merchant}
   1905   \item[$a$]{Complete text of a contract between customer and merchant}
   1906   \item[$f$]{Amount a customer agrees to pay to a merchant for a contract}
   1907   \item[$m$]{Unique transaction identifier chosen by the merchant}
   1908   \item[$H()$]{Hash function}
   1909   \item[$p$]{Payment details of a merchant (i.e. wire transfer details for a bank transfer)}
   1910   \item[$r$]{Random nonce}
   1911   \item[${\mathcal A}$]{Complete contract signed by the merchant}
   1912   \item[${\mathcal D}$]{Deposit permission, signing over a certain amount of coin to the merchant as payment and to signify acceptance of a particular contract}
   1913   \item[$\kappa$]{Security parameter $\ge 3$}
   1914   \item[$i$]{Index over cut-and-choose set, $i \in \{1,\ldots,\kappa\}$}
   1915   \item[$\gamma$]{Selected index in cut-and-choose protocol, $\gamma \in \{1,\ldots,\kappa\}$}
   1916   \item[$t^{(i)}_s$]{private transfer key, a scalar}
   1917   \item[$T^{(i)}_p$]{public transfer key, point on a curve (same curve must be used for $C_p$)}
   1918   \item[$T^{(i)}$]{public-private transfer key pair $T^{(i)} := (t^{(i)}_s,T^{(i)}_s)$}
   1919   \item[$\vec{t}$]{Vector of $t^{(i)}_s$}
   1920   \item[$c_s^{(i)}$]{Secret key corresponding to a fresh coin, scalar on a curve}
   1921   \item[$C_p^{(i)}$]{Public key corresponding to $c_s^{(i)}$, point on a curve}
   1922   \item[$C^{(i)}$]{Public-private coin key pair $C^{(i)} := (c_s^{(i)}, C_p^{(i)})$}
   1923 %  \item[$\vec{C}$]{Vector of $C^{(i)}$ (public and private keys)}
   1924   \item[$b^{(i)}$]{Blinding factor for RSA-style blind signatures}
   1925   \item[$\vec{b}$]{Vector of $b^{(i)}$}
   1926   \item[$B^{(i)}$]{Blinding of $C_p^{(i)}$}
   1927   \item[$\vec{B}$]{Vector of $B^{(i)}$}
   1928   \item[$L^{(i)}$]{Link secret derived from ECDH operation via hashing}
   1929 %  \item[$E_{L^{(i)}}()$]{Symmetric encryption using key $L^{(i)}$}
   1930 %  \item[$E^{(i)}$]{$i$-th encryption of the private information $(c_s^{(i)}, b_i)$}
   1931 %  \item[$\vec{E}$]{Vector of $E^{(i)}$}
   1932   \item[$\mathcal{R}$]{Tuple of revealed vectors in cut-and-choose protocol,
   1933     where the vectors exclude the selected index $\gamma$}
   1934   \item[$\overline{L^{(i)}}$]{Link secrets derived by the verifier from DH}
   1935   \item[$\overline{B^{(i)}}$]{Blinded values derived by the verifier}
   1936   \item[$\overline{T_p^{(i)}}$]{Public transfer keys derived by the verifier from revealed private keys}
   1937   \item[$\overline{c_s^{(i)}}$]{Private keys obtained from decryption by the verifier}
   1938   \item[$\overline{b_s^{(i)}}$]{Blinding factors obtained from decryption by the verifier}
   1939   \item[$\overline{C^{(i)}_p}$]{Public coin keys computed from $\overline{c_s^{(i)}}$ by the verifier}
   1940 \end{description}
   1941 \end{document}
   1942 \newpage
   1943 \onecolumn
   1944 \section{Supplemental: Reviews and Responses from Financial Cryptography}
   1945 
   1946 \subsection{FC 2016}
   1947 \verbatiminput{taler_FC2016.txt}
   1948 
   1949 \subsection{FC 2017}
   1950 \verbatiminput{taler_FC2017.txt}
   1951 
   1952 \end{document}
   1953 
   1954 
   1955 
   1956 
   1957 
   1958 
   1959 \section{Optional features}
   1960 
   1961 In this appendix we detail various optional features that can
   1962 be added to the basic protocol to reduce transaction costs for
   1963 certain interactions.
   1964 
   1965 However, we note that Taler's transaction costs are expected to be so
   1966 low that these features are likely not particularly useful in
   1967 practice: When we performed some initial performance measurements for
   1968 the various operations on our exchange implementation, the main conclusion
   1969 was that the computational and bandwidth cost for transactions
   1970 described in this paper is smaller than $10^{-3}$ cent/transaction,
   1971 and thus dwarfed by the other business costs for the exchange.  We note
   1972 that the $10^{-3}$ cent/transaction estimate excludes the cost of wire
   1973 transfers using traditional banking, which a exchange operator would
   1974 ultimately have to interact with.  Here, exchange operators should be able
   1975 to reduce their expenses by aggregating multiple transfers to the same
   1976 merchant.
   1977 
   1978 As a result of the low cost of the interaction with the exchange in Taler
   1979 today, we expect that transactions with amounts below Taler's internal
   1980 transaction costs to be economically meaningless.  Nevertheless, we
   1981 document various ways how such transactions could be achieved within
   1982 Taler.
   1983 
   1984 
   1985 
   1986 \subsection{Incremental spending}
   1987 
   1988 For services that include pay-as-you-go billing, customers can over
   1989 time sign deposit permissions for an increasing fraction of the value
   1990 of a coin to be paid to a particular merchant.  As checking with the
   1991 exchange for each increment might be expensive, the coin's owner can
   1992 instead sign a {\em lock permission}, which allows the merchant to get
   1993 an exclusive right to redeem deposit permissions for the coin for a
   1994 limited duration.  The merchant uses the lock permission to determine
   1995 if the coin has already been spent and to ensure that it cannot be
   1996 spent by another merchant for the {\em duration} of the lock as
   1997 specified in the lock permission.  If the coin has insufficient funds
   1998 because too much has been spent or is
   1999 already locked, the exchange provides the owner's deposit or locking
   2000 request and signature to prove the attempted fraud by the customer.
   2001 Otherwise, the exchange locks the coin for the expected duration of the
   2002 transaction (and remembers the lock permission).  The merchant and the
   2003 customer can then finalize the business transaction, possibly
   2004 exchanging a series of incremental payment permissions for services.
   2005 Finally, the merchant then redeems the coin at the exchange before the
   2006 lock permission expires to ensure that no other merchant redeems the
   2007 coin first.
   2008 
   2009 \begin{enumerate}
   2010 \item\label{offer2} The merchant sends an \emph{offer:}
   2011   $\langle S_M(m, f), \vec{X} \rangle$ containing the price of the offer $f$,
   2012   a transaction ID $m$ and the list of exchanges
   2013    $\vec{X} = \langle X_1, \ldots, X_n \rangle$ accepted by the merchant,
   2014    where each $X_j$ is an exchange's public key.
   2015 \item\label{lock2} The customer must possess or acquire a coin $\widetilde{C}$
   2016   signed by a exchange that is accepted by the merchant,
   2017    i.e.\ $K$ should be signed by some $X_j$ and has a value $\geq f$.
   2018 
   2019   Customer then generates a \emph{lock-permission}
   2020   $\mathcal{L} := S_c(\widetilde{C}, t, m, f, M_p)$ where
   2021   $t$ specifies the time until which the lock is valid and sends
   2022   $\langle \mathcal{L}, X_j\rangle$ to the merchant,
   2023   where $X_j$ is the exchange which signed $K$.
   2024 \item The merchant asks the exchange to apply the lock by sending $\langle
   2025   \mathcal{L} \rangle$ to the exchange.
   2026 \item The exchange validates $\widetilde{C}$ and detects double spending
   2027   in the form of existing \emph{deposit-permission} or
   2028   lock-permission records for $\widetilde{C}$.  If such records exist
   2029   and indicate that insufficient funds are left, the exchange sends those
   2030   records to the merchant, who can then use the records to prove the double
   2031   spending to the customer.
   2032 
   2033   If double spending is not found,
   2034   the exchange persists $\langle \mathcal{L} \rangle$
   2035   and notifies the merchant that locking was successful.
   2036 \item\label{contract2} The merchant creates a digitally signed contract
   2037   \begin{equation*}
   2038     \mathcal{A} := S_M(m, f, a, H(p, r))
   2039   \end{equation*}
   2040   where $a$ is data relevant to the contract
   2041   indicating which services or goods the merchant will deliver to the customer, and $p$ is the
   2042   merchant's payment information (e.g. his IBAN number) and $r$ is an random nonce.
   2043   The merchant persists $\langle \mathcal{A} \rangle$ and sends it to the customer.
   2044 \item The customer creates a
   2045   \emph{deposit-permission} $\mathcal{D} := S_c(\widetilde{C}, \widetilde{L}, f, m, M_p, H(a), H(p, r))$, persists
   2046   $\langle \mathcal{A}, \mathcal{D} \rangle$ and sends $\mathcal{D}$ to the merchant.
   2047 \item\label{invoice_paid2} The merchant persists the received $\langle \mathcal{D} \rangle$.
   2048 \item The merchant gives $(\mathcal{D}, p, r)$ to the exchange, revealing his
   2049   payment information.
   2050 \item The exchange verifies $(\mathcal{D}, p, r)$ for its validity and
   2051   checks against double spending, while of
   2052   course permitting the merchant to withdraw funds from the amount that
   2053   had been locked for this merchant.
   2054  \item If $\widetilde{C}$ is valid and no equivalent \emph{deposit-permission} for $\widetilde{C}$ and $\widetilde{L}$ exists, the
   2055   exchange performs the following transaction:
   2056   \begin{enumerate}
   2057     \item $\langle \mathcal{D}, p, r \rangle$ is persisted.
   2058     \item\label{transfer2} transfers an amount of $f$ to the merchant's bank account
   2059       given in $p$.  The subject line of the transaction to $p$ must contain
   2060       $H(\mathcal{D})$.
   2061   \end{enumerate}
   2062   Finally, the exchange sends a confirmation to the merchant.
   2063  \item If the deposit record $\langle \mathcal{D}, p, r \rangle$ already exists,
   2064   the exchange sends the confirmation to the merchant,
   2065   but does not transfer money to $p$ again.
   2066 \end{enumerate}
   2067 
   2068 To facilitate incremental spending of a coin $C$ in a single transaction, the
   2069 merchant makes an offer in Step~\ref{offer2} with a maximum amount $f_{max}$ he
   2070 is willing to charge in this transaction from the coin $C$.  After obtaining the
   2071 lock on $C$ for $f_{max}$, the merchant makes a contract in Step~\ref{contract2}
   2072 with an amount $f \leq f_{max}$.  The protocol follows with the following steps
   2073 repeated after Step~\ref{invoice_paid2} whenever the merchant wants to charge an
   2074 incremental amount up to $f_{max}$:
   2075 
   2076 \begin{enumerate}
   2077   \setcounter{enumi}{4}
   2078 \item The merchant generates a new contract $ \mathcal{A}' := S_M(m, f', a', H(p,
   2079   r)) $ after obtaining the deposit-permission for a previous contract.  Here
   2080   $f'$ is the accumulated sum the merchant is charging the customer, of which
   2081   the merchant has received a deposit-permission for $f$ from the previous
   2082   contract \textit{i.e.}~$f <f' \leq f_{max}$.  Similarly $a'$ is the new
   2083   contract data appended to older contract data $a$.
   2084   The merchant persists $\langle \mathcal{A}' \rangle$ and sends it to the customer.
   2085 \item Customer persists $\langle \mathcal{A}' \rangle$, creates
   2086   $\mathcal{D}' := S_c(\widetilde{C}, \mathcal{L}, f', m, M_p, H(a'), H(p, r))$, persists
   2087   $\langle \mathcal{D'} \rangle$ and sends it to the merchant.
   2088 \item The merchant persists the received $\langle \mathcal{D'} \rangle$ and
   2089   deletes the older $\mathcal{D}$.
   2090 \end{enumerate}
   2091 
   2092 %Figure~\ref{fig:spending_protocol_interactions} summarizes the interactions of the
   2093 %coin spending protocol.
   2094 
   2095 For transactions with multiple coins, the steps of the protocol are
   2096 executed in parallel for each coin.  During the time a coin is locked,
   2097 the locked fraction may not be spent at a different merchant or via a
   2098 deposit permission that does not contain $\mathcal{L}$.  The exchange will
   2099 release the locks when they expire or are used in a deposit operation.
   2100 Thus the coins can be used with other merchants once their locks
   2101 expire, even if the original merchant never executed any deposit for
   2102 the coin.  However, doing so may link the new transaction to older
   2103 transaction.
   2104 
   2105 Similarly, if a transaction is aborted after Step 2, subsequent
   2106 transactions with the same coin can be linked to the coin, but not
   2107 directly to the coin's owner.  The same applies to partially spent
   2108 coins.  Thus, to unlink subsequent transactions from a coin, the
   2109 customer has to execute the coin refreshing protocol with the exchange.
   2110 
   2111 %\begin{figure}[h]
   2112 %\centering
   2113 %\begin{tikzpicture}
   2114 %
   2115 %\tikzstyle{def} = [node distance= 1em, inner sep=.5em, outer sep=.3em];
   2116 %\node (origin) at (0,0) {};
   2117 %\node (offer) [def,below=of origin]{make offer (merchant $\rightarrow$ customer)};
   2118 %\node (A) [def,below=of offer]{permit lock (customer $\rightarrow$ merchant)};
   2119 %\node (B) [def,below=of A]{apply lock (merchant $\rightarrow$ exchange)};
   2120 %\node (C) [def,below=of B]{confirm (or refuse) lock (exchange $\rightarrow$ merchant)};
   2121 %\node (D) [def,below=of C]{sign contract (merchant $\rightarrow$ customer)};
   2122 %\node (E) [def,below=of D]{permit deposit (customer $\rightarrow$ merchant)};
   2123 %\node (F) [def,below=of E]{make deposit (merchant $\rightarrow$ exchange)};
   2124 %\node (G) [def,below=of F]{transfer confirmation (exchange $\rightarrow$ merchant)};
   2125 %
   2126 %\tikzstyle{C} = [color=black, line width=1pt]
   2127 %\draw [->,C](offer) -- (A);
   2128 %\draw [->,C](A) -- (B);
   2129 %\draw [->,C](B) -- (C);
   2130 %\draw [->,C](C) -- (D);
   2131 %\draw [->,C](D) -- (E);
   2132 %\draw [->,C](E) -- (F);
   2133 %\draw [->,C](F) -- (G);
   2134 %
   2135 %\draw [->,C, bend right, shorten <=2mm] (E.east)
   2136 %      to[out=-135,in=-45,distance=3.8cm] node[left] {aggregate} (D.east);
   2137 %\end{tikzpicture}
   2138 %\caption{Interactions between a customer, merchant and exchange in the coin spending
   2139 %  protocol}
   2140 %\label{fig:spending_protocol_interactions}
   2141 %\end{figure}
   2142 
   2143 
   2144 \subsection{Probabilistic donations}
   2145 
   2146 Similar to Peppercoin, Taler supports probabilistic {\em micro}donations of coins to
   2147 support cost-effective transactions for small amounts.  We consider
   2148 amounts to be ``micro'' if the value of the transaction is close or
   2149 even below the business cost of an individual transaction to the exchange.
   2150 
   2151 To support microdonations, an ordinary transaction is performed based
   2152 on the result of a biased coin flip with a probability related to the
   2153 desired transaction amount in relation to the value of the coin.  More
   2154 specifically, a microdonation of value $\epsilon$ is upgraded to a
   2155 macropayment of value $m$ with a probability of $\frac{\epsilon}{m}$.
   2156 Here, $m$ is chosen such that the business transaction cost at the
   2157 exchange is small in relation to $m$.  The exchange is only involved in the
   2158 tiny fraction of transactions that are upgraded.  On average both
   2159 customers and merchants end up paying (or receiving) the expected
   2160 amount $\epsilon$ per microdonation.
   2161 
   2162 Unlike Peppercoin, in Taler either the merchant wins and the customer
   2163 looses the coin, or the merchant looses and the customer keeps the
   2164 coin.  Thus, there is no opportunity for the merchant and the customer
   2165 to conspire against the exchange.  To determine if the coin is to be
   2166 transferred, merchant and customer execute a secure coin flipping
   2167 protocol~\cite{blum1981}.  The commit values are included in the
   2168 business contract and are revealed after the contract has been signed
   2169 using the private key of the coin.  If the coin flip is decided in
   2170 favor of the merchant, the merchant can redeem the coin at the exchange.
   2171 
   2172 One issue in this protocol is that the customer may use a worthless
   2173 coin by offering a coin that has already been spent.  This kind of
   2174 fraud would only be detected if the customer actually lost the coin
   2175 flip, and at this point the merchant might not be able to recover from
   2176 the loss.  A fraudulent anonymous customer may run the protocol using
   2177 already spent coins until the coin flip is in his favor.
   2178 
   2179 As with incremental spending, lock permissions could be used to ensure
   2180 that the customer cannot defraud the merchant by offering a coin that
   2181 has already been spent.  However, as this means involving the exchange
   2182 even if the merchant looses the coin flip, such a scheme is unsuitable
   2183 for microdonations as the transaction costs from involving the exchange
   2184 might be disproportionate to the value of the transaction, and thus
   2185 with locking the probabilistic scheme has no advantage over simply
   2186 using fractional payments.
   2187 
   2188 Hence, Taler uses probabilistic transactions {\em without} online
   2189 double-spending detection.  This enables the customer to defraud the
   2190 merchant by paying with a coin that was already spent.  However, as,
   2191 by definition, such microdonations are for tiny amounts, the incentive
   2192 for customers to pursue this kind of fraud is limited.  Still, to
   2193 clarify that the customer must be honest, we prefer the term
   2194 micro{\em donations} over micro{\em payments} for this scheme.
   2195 
   2196 
   2197 The following steps are executed for microdonations with upgrade probability $p$:
   2198 \begin{enumerate}
   2199   \item The merchant sends an offer to the customer.
   2200   \item The customer sends a commitment $H(r_c)$ to a random
   2201     value $r_c \in [0,2^R)$, where $R$ is a system parameter.
   2202   \item The merchant sends random $r_m \in [0,2^R)$ to the customer.
   2203     \item The customer computes $p' := (|r_c - r_m|) / (2^R)$.
   2204     If $p' < p$, the customer sends a coin with deposit-permission to the merchant.
   2205     Otherwise, the customer sends $r_c$ to the merchant.
   2206   \item The merchant deposits the coin, or checks if $r_c$ is consistent
   2207     with $H(r_c)$.
   2208 \end{enumerate}
   2209 
   2210 Evidently the customer can ``cheat'' by aborting the transaction in
   2211 Step 3 of the microdonation protocol if the outcome is unfavorable ---
   2212 and repeat until he wins.  This is why Taler is suitable for
   2213 microdonations --- where the customer voluntarily contributes ---
   2214 and not for micropayments.
   2215 
   2216 Naturally, if the donations requested are small, the incentive to
   2217 cheat for minimal gain should be quite low.  Payment software could
   2218 embrace this fact by providing an appeal to conscience in form of an
   2219 option labeled ``I am unethical and want to cheat'', which executes
   2220 the dishonest version of the payment protocol.
   2221 
   2222 If an organization detects that it cannot support itself with
   2223 microdonations, it can always choose to switch to the macropayment
   2224 system with slightly higher transaction costs to remain in business.
   2225 
   2226 \newpage
   2227 
   2228 
   2229 
   2230 Taler was designed for use in a modern social-liberal society and
   2231 provides a payment system with the following key properties:
   2232 
   2233 \begin{description}
   2234   \item[Customer Anonymity]
   2235     It is impossible for exchanges, merchants and even a global active
   2236     adversary, to trace the spending behavior of a customer.
   2237     As a strong form of customer anonymity, it is also infeasible to
   2238     link a set of transactions to the same (anonymous) customer.
   2239     %, even when taking aborted transactions into account.
   2240 
   2241     There is, however, a risk of metadata leakage if a customer
   2242     acquires coins matching exactly the price quoted by a merchant, or
   2243     if a customer uses coins issued by multiple exchanges for the same
   2244     transaction.  Hence, our implementation does not allow this.
   2245 
   2246   \item[Taxability]
   2247     In many current legal systems, it is the responsibility of the merchant
   2248     to deduct sales taxes from purchases made by customers, or for workers
   2249     to pay income taxes for payments received for work.
   2250     Taler ensures that merchants are easily identifiable and that
   2251     an audit trail is generated, so that the state can ensure that its
   2252     taxation regime is obeyed.
   2253   \item[Verifiability]
   2254     Taler minimizes the trust necessary between
   2255     participants.  In particular, digital signatures are retained
   2256     whenever they would play a role in resolving disputes.
   2257     Additionally, customers cannot defraud anyone, and
   2258     merchants can only defraud their customers by not
   2259     delivering on the agreed contract.  Neither merchants nor customers
   2260     are able to commit fraud against the exchange.
   2261     Only the exchange needs be tightly audited and regulated.
   2262   \item[No speculation] % It's actually "Speculation not required"
   2263     The digital coins are denominated in existing currencies,
   2264     such as EUR or USD.  This avoids exposing citizens to unnecessary risks
   2265     from currency fluctuations.
   2266   \item[Low resource consumption]
   2267     The design minimizes the operating costs and environmental impact of
   2268     the payment system.  It uses few public key operations per
   2269     transaction and entirely avoids proof-of-work computations.
   2270     The payment system handles both small and large payments in
   2271     an efficient and reliable manner.
   2272 \end{description}