introduction.tex (26815B)
1 \chapter{Introduction}\label{chapter:introduction} 2 3 New networking and cryptographic protocols can substantially improve 4 electronic online payment systems. This book is about the design, 5 implementation and security analysis of GNU 6 Taler\footnote{\url{https://taler.net/}}, a privacy-friendly payment 7 system that is designed to be practical for usage as an online 8 (micro-)payment method, and at the same time socially and ethically 9 responsible. 10 11 Payment systems can generally be divided into two types: Register-based 12 and value-based~\cite{riksbank2017riksbank}. A register-based system 13 associates value with identities (e.g., bank account balances with 14 customers), while a value-based system associates value with typically 15 anonymous, digital or physical tokens (such as cash or prepaid credit 16 cards). In practice, these two types of systems are combined, as 17 different layers have different (and often conflicting) requirements: 18 the payment system used to pay for a cappuccino in a coffee shop is 19 most likely not suitable to buy real estate. Value-based payment 20 systems typically provide more anonymity and convenience but also more 21 risk to consumers (as they are responsible to secure the values they 22 hold), while register-based systems shift risks to the payment service 23 provider who has to authenticate consumers and ensure the integrity of 24 the register. 25 26 This book explains GNU Taler, a design and implementation of a value-based 27 payment system, discussing in-depth how to create a practical, 28 privacy-preserving and secure (micro-)payment protocol that integrates nicely 29 with the modern web. Our value-based payment protocol can in principle 30 operate on top of any existing register-based system. 31 32 GNU Taler is an official package of the GNU 33 project\footnote{\url{https://gnu.org/}}. Our free software implementation is 34 freely available from the GNU mirrors. 35 36 37 \section{Design Goals for GNU Taler} 38 39 The design of payment systems shapes economies and societies 40 \cite{zandi2013impact,dalebrant2016monetary}. Payment systems with high 41 transaction costs create an economic burden. Predominantly cash-based 42 societies provide some degree of anonymity for their citizens, but can fail to 43 provide a sound foundation for taxation, facilitate corruption 44 \cite{singh2017does} and thus risk creating weak governments. On the other 45 hand, systems with too much surveillance eliminate personal freedom. 46 47 As the Internet has no standardized payment system, especially not one 48 that is capable of quickly, efficiently and securely settling small 49 transactions (so-called micropayments), the majority of content on the web is 50 financed by advertisements. As a result, advertising (and by 51 implication, collecting data on users) has been a dominant business 52 model on the Internet. This has not only resulted in a loss of 53 independence of publishers---who need to cater to the needs 54 of advertisers---but also in a situation where micro-targeted ads 55 are so wide-spread, that they have been suspected to have influenced 56 multiple major elections~\cite{persily2017election}. Ads are also a 57 vector for malware \cite{provos2007ghost}. Due to the prevalence of 58 ad blockers, ads are also not guaranteed to be a sustainable business 59 model. 60 61 In the world of online payments, credit cards and a sprawling number 62 of smaller, proprietary payment processors are currently dominant, and 63 market shares vary widely between different 64 countries~\cite{adyen2016global,paypers2016ecommerce}. The resulting 65 fragmentation again increases social costs: online shops can either 66 choose to invest in implementing many proprietary protocols, or only 67 implement the most popular ones, thereby reinforcing the dominance of 68 a handful of proprietary payment systems. 69 70 Considering these and other social implications of payment systems, we 71 started the development of GNU Taler with a set of high-level design 72 goals that fit our social agenda. They are ranked by the importance 73 we give to them, and when a trade-off must be made, the one that 74 supports the more highly ranked goal is preferred: 75 76 % what about micropayments -> part of 'efficient' 77 \begin{enumerate} 78 \item \textbf{GNU Taler must be implemented as free software.} 79 80 Free refers to ``free as in free speech'', as opposed to ``free as in free beer''. 81 More specifically, the four essential freedoms of free software 82 \cite{stallman2002essays} must be respected, namely users must have the 83 freedom to (1) run the software, (2) study and modify it, (3) redistribute 84 copies, and (4) distribute copies of the modified version. 85 86 For merchants this prevents vendor lock-in, as another payment provider can 87 take over, should the current one provide inadequate quality of service. 88 As the software of 89 the payment provider itself is free, smaller or disadvantaged countries or 90 organizations can run the payment system without being controlled by a 91 foreign company. Customers benefit from this freedom, as the wallet 92 software can be made to run on a variety of platforms, and user-hostile 93 features such as tracking or telemetry could easily be removed from 94 wallet software. 95 96 This rules out the mandatory usage of specialized 97 hardware such as smart cards or other hardware security modules, as the 98 software they run cannot be modified by the user. These components can, 99 however, be voluntarily used by merchants, customers or payment processors 100 to increase their operational security. 101 102 \item \textbf{GNU Taler must protect the privacy of buyers.}\label{item:privacy} 103 104 Privacy should be guaranteed via technical measures, as opposed to mere 105 policies. Especially with micropayments for online content, a 106 disproportionate amount of rather private data about buyers would be revealed, if 107 the payment system does not have privacy protections. 108 109 %Especially if a payment system is to be used for microtransactions for online 110 %content, the privacy of buyers becomes important: if micropayments were more 111 %commonplace, the transaction data could be used to collect extremely detailed 112 %profiles of users. Unfortunately practically no commercially used payment 113 %system has strong anonymity guarantees. 114 115 In legislations with data protection regulations (such as the recently introduced GDPR in Europe \cite{voigt2017eu}), 116 merchants benefit from this as well, as no data breach of customers can happen if this information 117 is, by design, not collected in the first place. Obviously some private data, such as the shipping 118 address for a physical delivery, must still be collected according to business needs. 119 120 The security of the payment systems also benefits from this, as the model 121 shifts from authentication of customers to mere authorization of payments. 122 This approach rules out whole classes of attacks such as phishing \cite{garera2007framework} or credit 123 card fraud \cite{sahin2010overview}. 124 125 \item \textbf{GNU Taler must enable the state to tax income and crack down on 126 illegal business activities.} 127 128 % FIXME: provide broader ethical justification! 129 As a payment system must still be legal to operate and use, it must comply 130 with these requirements. Furthermore, we consider levying of taxes as 131 beneficial to society. 132 133 \item \textbf{GNU Taler must prevent payment fraud.} 134 135 This imposes requirements on the security of the system, as well as on the 136 general design, as payment fraud can also happen through misleading user 137 interface design or the lack of cryptographic evidence for certain 138 processes. 139 140 \item \textbf{GNU Taler must only disclose the minimal amount of information 141 necessary.} 142 143 The reason behind this goal is similar to (\ref{item:privacy}). The 144 privacy of buyers is given priority, but other parties such as merchants 145 still benefit from it, for example, by keeping details about the merchant's financials 146 hidden from competitors. 147 148 149 \item \textbf{GNU Taler must be usable.} 150 151 Specifically it must be usable for non-expert customers. Usability also 152 applies to the integration with merchants, and informs choices about the 153 architecture, such as encapsulating procedures that require cryptographic 154 operations into an isolated component with a simple API. 155 156 \item \textbf{GNU Taler must be efficient.} 157 158 % FIXME: provide broader ethical justification (environmental impact, 159 % social cost, opportunity cost of lack of micropayments) 160 Approaches such as proof-of-work are ruled out by this requirement. Efficiency is 161 necessary for GNU Taler to be used for micropayments. 162 163 \item \textbf{GNU Taler must avoid single points of failure.} 164 165 While the design we present later is rather centralized, avoiding single 166 points of failure is still a goal. This manifests in architectural choices such as 167 the isolation of certain components, and auditing procedures. 168 169 \item \textbf{GNU Taler must foster competition.} 170 171 It must be relatively easy for competitors to join the systems. While the 172 barriers for this in traditional financial systems are rather high, the 173 technical burden for new competitors to join must be minimized. Another 174 design choice that supports this is to split the whole system into smaller 175 components that can be operated, developed and improved upon independently, 176 instead of having one completely monolithic system. 177 178 \end{enumerate} 179 180 181 182 \section{Features of Value-based Payment Systems}\label{sec:intro:features} 183 184 There are many different possible features that have been proposed for 185 value-based (sometimes called token-based) payment systems in the past. While we 186 will discuss existing work on e-cash in more detail in 187 Section~\ref{sec:related-work:e-cash}, we will begin by a brief 188 summary of the possible features that value-based payment systems 189 could provide, and clarify which high-level features we chose to adopt 190 for GNU Taler. 191 192 % EXPLAIN: in traditional (online) e-cash, spending is never 193 % bound to a contract identifier 194 195 %\subsubsection*{Different signature schemes and zero-knowledge proofs} 196 %Since Chaum's original blind signature scheme based on RSA, many variations 197 %using other cryptographic primitives have been developed. Some newer e-cash 198 %schemes do not use blind signatures, but rely on zero-knowledge proofs instead. 199 % 200 %In GNU Taler, we opt for an RSA-based blind signature scheme, due to the low 201 %complexity, relatively clear security assumptions and small number of 202 %communication rounds compared to other protocols. 203 204 \subsection{Offline vs Online Payments} 205 206 Anonymous digital cash schemes since Chaum~\cite{chaum1983blind} were frequently designed to allow 207 the merchant to be offline during the transaction, by providing a means to 208 deanonymize customers involved in double-spending, typically by encoding the 209 customer's identity into their coins in a way that makes it only possible to 210 decode the identity with two spending transcripts. 211 212 This approach is problematic in practice, as customers that restore a wallet 213 from backup might accidentally double-spend and would then face punishment for 214 it. Enforcing punishment for double-spenders can be rather difficult as well, 215 since the double-spender might have signed up with a false identity or might 216 already have fled to another country, and a large number of merchants might already 217 have been defrauded with the same coins. 218 219 Should the issuer of e-cash be compromised, an attacker could issue coins that 220 fail to identify a culprit or even blame somebody else when they are 221 double-spent. In an offline e-cash system, the detection of such an event is 222 greatly delayed compared to systems with online spending, which can immediately 223 detect when more coins are spent than were issued. 224 225 Thus, in GNU Taler, we decided that all coins must be immediately 226 deposited online during a purchase. Only either a merchant or a customer 227 needs to be online, since one of the two can forward messages to the 228 payment service provider for the other. 229 230 \subsection{Change and Divisibility} 231 232 Customers do not always have the right set of coins available to exactly cover 233 the amount to be paid to a merchant. With physical cash, the store would 234 give the customer change. For e-cash, the situation is more complex, as 235 the customer would have to make sure that the change has not already been 236 spent, does not violate their anonymity and the merchant does not have a 237 digital ``copy'' of the change tokens that the merchant can spend before the customer. Note 238 that it would be unwise to always withdraw the correct amount of e-cash 239 directly before a purchase, as it creates a temporal correlation between the 240 non-anonymous withdrawal event and the spending event. 241 242 Most modern e-cash schemes instead deal with exact spending by providing 243 \emph{divisibility} of coins, where the customer can decide to only spend part 244 of a coin. A significant chunk of the e-cash literature has been concerned 245 with developing schemes that allow the individual, divided parts of a coin to 246 be unlinkable (thus preserving anonymity) and to optimize the storage costs for 247 wallets and the communication cost of withdrawals. 248 249 The current state of the art for divisible e-cash~\cite{pointcheval2017cut} 250 achieves constant-time withdrawal and wallet storage cost for coins that can be 251 split into an arbitrary but fixed (as a system parameter) number of pieces. A 252 continuous ``chunk'' of the smallest pieces of a coin can be spent with 253 constant-time communication complexity. 254 255 While this sounds attractive in theory, these results are mostly of academic 256 interest, as the storage and/or computational complexity for the party that is 257 checking for double spending of coins remains enormous: each smallest piece of 258 every coin needs to be recorded and checked individually. When paying 259 $\$10.00$ with a coin that supports division into cent pieces, $1000$ 260 individual coin pieces must be checked for double spending and recorded, 261 possibliy in compressed form to trade storage costs for more computation. 262 263 For GNU Taler, we use a rather simple and practical approach, made possible by 264 requiring participants to be online during spending: coins can be fractionally 265 spent without having divisible, unlinkable parts. The remaining value on a coin 266 that was spend (and thus revealed) can be used to withdraw fresh, unlinkable 267 coins. The protocol to obtain change takes additional measures to ensure that 268 it cannot be misused to facilitate untaxed transactions. Giving change for 269 e-cash has been proposed before \cite{brickell1995trustee,tracz2001fair}, but 270 to the best of our knowledge, the idea of income-transparent change is novel. 271 272 \subsection{Anonymity Control} 273 274 Some proposed e-cash protocols contain mechanisms to allow selective 275 deanonymization of transactions for scenarios involving crime 276 \cite{sander1999escrow}, specifically blackmailing and tax evasion. 277 278 Unfortunately this does not really work as a countermeasure against 279 blackmailing in practice. As noted in the paper that initially described such 280 a mechanism for blind signatures \cite{stadler1995fair}, a blackmailer could 281 simply request to be paid directly with plain, blindly signed coins, and 282 thereby completely circumvent the threat of revocable anonymity. 283 284 GNU Taler provides \emph{income transparency} as a measure against tax evasion. 285 We furthermore describe a different approach in a blackmailing scenario in 286 Section~\ref{sec:design:blackmailing}, which we believe is more practical in 287 dissuading blackmailers in practice. 288 289 \subsection{User Suspension} 290 291 Anonymous user suspension \cite{au2011electronic} has been proposed as 292 another mechanism to punish users suspected in illicit activities by 293 preventing then from making further transactions until the suspension is 294 lifted. Anonymous suspension is based on transactions; the user 295 involved in a particular transaction is suspended, but their identity is not 296 revealed. 297 298 While the approach is interesting, it is not practical, as it requires 299 a single permanent key pair to be associated with each user. If a 300 user claims they lost their private key and requests a new key pair, 301 their suspension would be effectively lifted. Suspending users from a 302 dominant payment system is also socially problematic, as excluding 303 them from most commercial activities would likely be a 304 disproportionate and cruel punishment. 305 306 \subsection{Transferability} 307 308 Transferability is a feature of certain e-cash systems that allows 309 transfer of e-cash between two parties without breaking anonymity 310 properties \cite{fuchsbauer2009transferable}. Contemporary systems 311 that offer this type of disintermediation attract criminal 312 activity~\cite{richet2016extortion}. 313 314 GNU Taler specifically provides roughly the \emph{opposite} of this property, 315 namely \emph{income transparency}, to guarantee that e-cash is not easily 316 abused for tax evasion. Mutually trusting users, however, can share ownership 317 of a coin. 318 319 \subsection{Atomic Swaps} 320 321 Atomic swaps (often called ``fair exchange'' in the e-cash literature) are a 322 feature of some e-cash systems that allows e-cash 323 to be exchanged against some service or (digital) product, with a trusted third 324 party ensuring that the payee receives the payment if and only if they correctly 325 provided the merchandise. 326 327 GNU Taler supports Camenisch-style atomic swaps~\cite{camenisch2007endorsed}, 328 as explained in Section~\ref{sec:security:atomic-swaps}. 329 330 \subsection{Refunds} 331 332 GNU Taler allows merchants to provide refunds to customers during a limited 333 time after the coins for the payment were deposited. The merchant signs a 334 statement that effectively allows the customer to reclaim a previously spent 335 coin. Customers can request anonymous change for the reclaimed amount. 336 337 While this is a rather simple extension, we are not aware of any other e-cash 338 system that supports refunds. 339 340 341 \section{User Experience and Performance} \label{sec:intro:ux} 342 343 For adoption of a payment system, the user experience is critical. Thus, 344 before diving into {\em how} GNU Taler is implemented, we begin by 345 showing how GNU Taler {\em looks} from the perspective of an end user in the 346 context of web payments, in a desktop browser (Chromium). 347 348 To use GNU Taler, the user must first install a browser extension 349 (Figure~\ref{fig:ux:install-prompt}). Once installed, the user can 350 open a pop-up window by clicking on the Taler logo, to see the 351 initially empty wallet balance (Figure~\ref{fig:ux:installed}). 352 353 The customer logs into their online bank---a simple demo bank in our case--to 354 withdraw digital cash from their bank account into their wallet (Figures~% 355 \ref{fig:ux:bank-login} and~\ref{fig:ux:bank-profile}). Our demo uses 356 \textsc{Kudos} as an imaginary currency. Before the user is asked to confirm, 357 they are given the option to view details about or change the default exchange 358 provider, the GNU Taler payment service provider (Figure~\ref{fig:ux:select-exchange}). 359 360 With a real bank, a second factor (such as a mobile TAN) would now be requested 361 from the user. Our demo instead asks the user to solve a simple CAPTCHA 362 (Figure~\ref{fig:ux:pin-tan}). The amount withdrawn---minus withdrawal 363 fees---is now available as e-cash in the wallet (Figure~% 364 \ref{fig:ux:withdraw-done}). 365 366 The customer can now go to an online shop to spend their digital cash. We've 367 implemented a shop that sells single chapters from Richard Stallman's essay 368 collection ``Free Software, Free Society'' \cite{stallman2002essays} (Figure~% 369 \ref{fig:ux:essay-landing}). The user selects an essay, and is then 370 immediately presented with a confirmation page rendered by the wallet (Figure~\ref{fig:ux:essay-pay}). 371 After paying, the user can immediately read the article (Figure~\ref{fig:ux:essay-done}). 372 373 Our benchmarks, discussed in Chapter \ref{chapter:implementation} show that a 374 single machine can support around 1000 payments per second, and our 375 implementation is easily amenable to further scaling. 376 377 The extra computation required in the customer's wallet is in the order of a 378 few hundred milliseconds even on typical mobile or tablet devices, and thus 379 barely noticeable. 380 381 \begin{figure} 382 \centering 383 \includegraphics[width=\textwidth]{taler-screenshots/wallet-install-prompt.png} 384 \caption{The user is prompted to install the wallet.} 385 \label{fig:ux:install-prompt} 386 \end{figure} 387 388 \begin{figure} 389 \centering 390 \includegraphics[width=\textwidth]{taler-screenshots/wallet-installed.png} 391 \caption{The wallet popup shows an empty balance.} 392 \label{fig:ux:installed} 393 \end{figure} 394 395 \begin{figure} 396 \centering 397 \includegraphics[width=\textwidth]{taler-screenshots/bank-login.png} 398 \caption{The bank asks for login details.} 399 \label{fig:ux:bank-login} 400 \end{figure} 401 402 \begin{figure} 403 \centering 404 \includegraphics[width=\textwidth]{taler-screenshots/bank-profile.png} 405 \caption{Account page of the demo bank.} 406 \label{fig:ux:bank-profile} 407 \end{figure} 408 409 \begin{figure} 410 \centering 411 \includegraphics[width=\textwidth]{taler-screenshots/withdraw-confirm.png} 412 \caption{Exchange selection dialog in the wallet.} 413 \label{fig:ux:select-exchange} 414 \end{figure} 415 416 \begin{figure} 417 \centering 418 \includegraphics[width=\textwidth]{taler-screenshots/pin-tan.png} 419 \caption{PIN/TAN dialog of the demo bank.} 420 \label{fig:ux:pin-tan} 421 \end{figure} 422 423 \begin{figure} 424 \centering 425 \includegraphics[width=\textwidth]{taler-screenshots/withdraw-done.png} 426 \caption{After a successful withdrawal, the balance is shown in the wallet.} 427 \label{fig:ux:withdraw-done} 428 \end{figure} 429 430 \begin{figure} 431 \centering 432 \includegraphics[width=\textwidth]{taler-screenshots/essay-landing.png} 433 \caption{Landing page of a store that sells essays.} 434 \label{fig:ux:essay-landing} 435 \end{figure} 436 437 \begin{figure} 438 \centering 439 \includegraphics[width=\textwidth]{taler-screenshots/essay-pay.png} 440 \caption[Payment prompt for an essay.]{Payment prompt for an essay. Rendered by the wallet.} 441 \label{fig:ux:essay-pay} 442 \end{figure} 443 444 \begin{figure} 445 \centering 446 \includegraphics[width=\textwidth]{taler-screenshots/essay-done.png} 447 \caption{Essay successfully purchased by the user.} 448 \label{fig:ux:essay-done} 449 \end{figure} 450 451 %\begin{figure} 452 %\begin{subfigure}{.5\textwidth} 453 % \centering 454 % \includegraphics[width=.8\linewidth]{taler-screenshots/wallet-installed.png} 455 % \caption{1a} 456 % \label{fig:sfig1} 457 %\end{subfigure}% 458 %\begin{subfigure}{.5\textwidth} 459 % \centering 460 % \includegraphics[width=.8\linewidth]{taler-screenshots/bank-login.png} 461 % \caption{1b} 462 % \label{fig:sfig2} 463 %\end{subfigure} 464 %\caption{plots of....} 465 %\label{fig:fig} 466 %\end{figure} 467 468 % FIXME: perf results 469 470 \section{The Technical Foundation: Anonymous E-Cash} \label{sec:intro:ecash} 471 GNU Taler is based on anonymous e-cash. Anonymous e-cash was invented by David 472 Chaum in the 1980s \cite{chaum1983blind}. The idea behind Chaumian e-cash is 473 both simple and ingenious, and can be best illustrated 474 with the carbon paper\footnote{% 475 Carbon paper is a paper coated with pigment (originally carbon) on one side. 476 When put face-down between two sheets of normal paper, the pressure from 477 writing with a pen or typewriter on the first layer causes pigment to be 478 deposited on the paper beneath, allowing a copy to be made. 479 } analogy: A long, random serial number is generated, for example, by throwing 480 a die a few dozen times, and written on a piece of paper. A carbon paper is 481 placed on top, with the pigmented side facing down, and both pieces of paper 482 are put into an opaque envelope. The envelope is now sealed and brought to a 483 bank. The bank draws a signature on the outside of the envelope, which presses 484 through to the piece of paper with the serial number. In exchange for the 485 signed envelope, the bank deducts a fixed amount (say five dollars) from the 486 customer's bank account. Under the (admittedly rather strong) assumption that 487 the bank's signature cannot be forged, the signed piece of paper with the serial 488 number is now an untraceable bank note worth five dollars, as the bank signed 489 it without seeing the serial number inside the envelope! Since the signed 490 paper can be easily copied, merchants that accept it as payment must check the 491 bank's signature, call the bank and transmit the serial number. The bank keeps 492 a register of all serial numbers that have been used as payment before. If the 493 serial number is already in the bank's register, the bank informs the merchant 494 about the attempted double spending, and the merchant then rejects the payment. 495 496 The digital analogue of this process is called a \emph{blind signature}, where 497 the signer knows that it gave a digital signature, but does not know the 498 contents of the message that it signed. 499 500 In this document, we use \emph{coin} to refer to a token of value in an e-cash 501 system. Note that the analogy of a coin does not always hold up, as certain 502 types of operations possible in some e-cash schemes, such as partial spending, 503 divisibility, etc., do not transfer to physical coins. 504 505 506 %\subsection{Security Properties}\label{sec:intro:security} 507 508 We have the following security and correctness properties for GNU Taler 509 (formally defined in Chapter~\ref{chapter:security}): 510 \begin{itemize} 511 \item \emph{Anonymity} guarantees that transactions cannot be correlated with withdrawals or 512 other transactions made by the same customer. 513 \item \emph{Unforgeability} guarantees that users cannot spend more e-cash than they withdrew. 514 \item \emph{Conservation} guarantees that customers do not lose money due to 515 interrupted protocols or malicious merchants; they can always obtain 516 anonymous change or a proof of successful spending. 517 \item \emph{Income transparency} guarantees that mutually distrusting parties 518 are unable to reliably transfer e-cash between them without the income of 519 participants being visible to tax auditors. 520 \end{itemize} 521 522 While anonymity and unforgeability are common properties of e-cash, we are not 523 aware of any other treatments of income transparency and conservation. 524 525 526 \section{Roadmap} 527 528 Chapter \ref{chapter:design} describes the high-level design of GNU Taler, and 529 compares it to payment systems found in the academic literature and real-world 530 usage. Chapter \ref{chapter:security} first gives a gentle introduction to 531 provable security (which can be skipped by readers with a background in 532 cryptography), and then defines security properties for income-transparent, 533 anonymous e-cash. The cryptographic protocols for GNU Taler are defined in 534 detail, and proofs are given that our protocols satisfy the security 535 properties defined earlier. In Chapter \ref{chapter:implementation}, the 536 implementation of GNU Taler is described, and the performance and scalability 537 is evaluated. Chapter \ref{chapter:future-work} discusses future work and 538 missing pieces to deploy GNU Taler in production. Chapter 539 \ref{chapter:conclusion} concludes with an outlook on the potential impact and 540 practical relevance of this work. 541