wallet.tex (16064B)
1 \documentclass[aspectratio=169,t]{beamer} 2 \input taler-macros 3 4 \newcommand{\TITLE}{NEXT \\ GENERATION \\ INTERNET} 5 \newcommand{\SUB}{GNU Taler for Developers} 6 \newcommand{\AUTHOR}{Iván Ávalos} 7 \newcommand{\SPEAKER}{Florian Dold} 8 \newcommand{\INST}{Bern University of Applied Sciences} 9 \newcommand{\DATE}{COSIN'24} 10 11 % Do not edit this part 12 \title{\TITLE} 13 \subtitle{\SUB} 14 \date{\DATE} 15 \author[\SPEAKER]{\AUTHOR} 16 \institute{\INST} 17 18 \begin{document} 19 20 \begin{frame}[plain] 21 \maketitle 22 \end{frame} 23 24 25 \begin{frame}{What is Taler?} 26 \framesubtitle{\url{https://taler.net/en/features.html}} 27 \noindent 28 Taler is 29 \vfill 30 \begin{itemize} 31 \item a Free/Libre software \emph{payment system} infrastructure project 32 \item \dots with a surrounding software ecosystem 33 \item \dots and a company (Taler Systems S.A.) and community that wants to deploy it 34 as widely as possible. 35 \end{itemize} 36 \vfill 37 \noindent 38 However, Taler is 39 \begin{itemize} 40 \item \emph{not} a currency 41 \item \emph{not} a long-term store of value 42 \item \emph{not} a network or instance of a system 43 \item \emph{not} decentralized 44 \item \emph{not} based on proof-of-work or proof-of-stake 45 \item \emph{not} a speculative asset / ``get-rich-quick scheme'' 46 \end{itemize} 47 \vfill 48 \end{frame} 49 50 51 \begin{frame}{Taler overview} 52 \begin{center} 53 \begin{tikzpicture} 54 \tikzstyle{def} = [node distance= 4em and 7em, inner sep=1em, outer sep=.3em]; 55 \node (origin) at (0,0) {}; 56 \node (exchange) [def,above=of origin,draw]{Exchange}; 57 \node (customer) [def, draw, below left=of origin] {Customer}; 58 \node (merchant) [def, draw, below right=of origin] {Merchant}; 59 \node (auditor) [def, draw, above right=of origin]{Auditor}; 60 \tikzstyle{C} = [color=black, line width=1pt] 61 \draw [<-, C] (customer) -- (exchange) node [midway, above, sloped] (TextNode) {withdraw coins}; 62 \draw [<-, C] (exchange) -- (merchant) node [midway, above, sloped] (TextNode) {deposit coins}; 63 \draw [<-, C] (merchant) -- (customer) node [midway, above, sloped] (TextNode) {spend coins}; 64 \draw [<-, C] (exchange) -- (auditor) node [midway, above, sloped] (TextNode) {verify}; 65 \end{tikzpicture} 66 \end{center} 67 \end{frame} 68 69 70 \begin{frame}{Architecture of Taler} 71 \begin{center} 72 \includegraphics[width=0.8\textwidth]{operations.png} 73 \end{center} 74 \end{frame} 75 76 77 \begin{frame}{Wallet architecture} 78 \vfill 79 \begin{center} 80 {\footnotesize 81 \begin{tikzpicture} 82 \tikzstyle{def} = [node distance= 3.5em and 2em, inner sep=1em, outer sep=.3em]; 83 \node (android) [def,draw]{Android}; 84 \node (ios) [def,right=of android,draw]{iOS}; 85 \node (webex) [def,right=of ios,draw]{WebEx}; 86 \node (wcore)[def,below=of ios,draw]{wallet-core}; 87 \node (db)[def,right=2cm of wcore,draw]{DB}; 88 \node (exchange)[def,below=of wcore,draw]{Exchange}; 89 \node (merchant)[def,below=of wcore,right=of exchange,draw]{Merchant}; 90 \node (bank)[def,below=of wcore,right=of merchant,draw]{Bank Integration}; 91 \node [draw,frame,fit=(wcore)(db),label={[xshift=2cm]above:{qtart/browser}}] {}; 92 \tikzstyle{C} = [color=black, line width=1pt]; 93 \draw [<->, C] (android) -- (wcore) node [midway,left,xshift=-1cm] (TextNode) {wallet-core API}; 94 \draw [<->, C] (ios) -- (wcore) node (TextNode) {}; 95 \draw [<->, C] (webex) -- (wcore) node (TextNode) {}; 96 \draw [<->, C] (wcore) -- (db) node [midway,above] (TextNode) {sqlite3}; 97 \draw [<->, C] (wcore) -- (exchange) node [midway,left] (TextNode) {HTTP}; 98 \draw [<->, C] (wcore) -- (merchant) node [midway,left] (TextNode) {HTTP}; 99 \draw [<->, C] (wcore) -- (bank) node [midway,left] (TextNode) {HTTP}; 100 \end{tikzpicture} 101 } 102 \end{center} 103 \vfill 104 \end{frame} 105 106 107 \begin{frame}[fragile]{GNU Taler wallet}{wallet-core} 108 \vfill 109 110 \textbf{wallet-core} is the component that powers the Taler wallets across 111 different platforms. It is written in TypeScript and it implements of all 112 the core functionality required by the wallets. It takes care of the 113 following: 114 115 \begin{itemize} 116 \item database management (IndexedDB/SQLite3) 117 \item task shepherding 118 \item cryptography 119 \item state machine for resources (transactions, exchange entries, ...) 120 \item communication with external services (exchange, merchant, bank) 121 \item communication with wallet-core clients 122 \end{itemize} 123 124 Most of its functionality is exposed via \textbf{requests}. Apps using 125 wallet-core can interact with it by calling different request methods, 126 passing parameters, and then e.g.\ rendering in the UI the data contained in 127 the response or showing an error message. 128 129 \vfill 130 \end{frame} 131 132 133 \begin{frame}[fragile]{GNU Taler wallet}{qtart} 134 qtart (\textbf{Q}uickJS \textbf{TA}ler \textbf{R}un\textbf{T}ime) is a 135 QuickJS-based runtime that embeds wallet-core into a native library for 136 usage outside of the browser, such as the mobile apps or any future desktop 137 app. 138 139 \begin{itemize} 140 \item Based on the acclaimed QuickJS JavaScript engine. 141 \item Implements native modules for cryptography. 142 \item Supports native HTTP networking (with multi-threading). 143 \item Provides access to the wallet-core API via a simple callback-based interface. 144 \item Keeps us from having to rewrite wallet-core for every platform! 145 \end{itemize} 146 \end{frame} 147 148 149 \begin{frame}{Wallet-core API}{Introduction} 150 \begin{center} 151 \begin{tikzpicture} 152 \tikzstyle{def} = [node distance= 3.5em and 10em, inner sep=1em, outer sep=.3em]; 153 \node (wallet) [def,draw] {Wallet}; 154 \node (wcore) [def,draw,right=of wallet] {wallet-core}; 155 \tikzstyle{C} = [color=black, line width=1pt]; 156 \draw [->,C,bend left](wallet) to node [above] {request (JSON)} (wcore); 157 \draw [->,C] (wcore) to node [below] {response (JSON)} (wallet); 158 \draw [->,C,bend left,dashed] (wcore) to node [below] {notifications (JSON)} (wallet); 159 \end{tikzpicture} 160 \end{center} 161 162 \begin{itemize} 163 \item Documentation: \url{https://docs.taler.net/wallet/wallet-core.html} 164 \end{itemize} 165 166 \end{frame} 167 168 169 \begin{frame}[fragile]{Wallet-core API}{Request structure} 170 \begin{center} 171 \begin{tabular}{c c c} 172 \hline 173 Field & Type & Description \\ 174 \hline 175 \texttt{id} & integer & request ID \\ 176 \texttt{operation} & string & API operation \\ 177 \texttt{args} & object & request arguments \\ 178 \end{tabular} 179 \end{center} 180 181 Example 182 183 \begin{verbatim} 184 { 185 "id": 0, 186 "operation": "init", 187 "args": { "logLevel": "INFO" } 188 } 189 \end{verbatim} 190 \end{frame} 191 192 193 \begin{frame}[fragile]{Wallet-core API}{Response structure} 194 \begin{center} 195 \begin{tabular}{c c c} 196 \hline 197 Field & Type & Description \\ 198 \hline 199 \texttt{type} & string & either \texttt{response} or \texttt{error} \\ 200 \texttt{id} & integer & request ID \\ 201 \texttt{operation} & string & API operation \\ 202 \texttt{result} & object & response data \\ 203 \end{tabular} 204 \end{center} 205 206 Example 207 208 \begin{verbatim} 209 { "type": "response", 210 "id": 0, 211 "operation": "init", 212 "result": {...} } 213 \end{verbatim} 214 \end{frame} 215 216 217 \begin{frame}[fragile]{Wallet-core API}{Notification structure} 218 \begin{center} 219 \begin{tabular}{c c c} 220 \hline 221 Field & Type & Description \\ 222 \hline 223 \texttt{type} & string & will be \texttt{notification} \\ 224 \texttt{payload} & object & notification data \\ 225 \end{tabular} 226 \end{center} 227 228 Example 229 230 \begin{verbatim} 231 { 232 "type": "notification", 233 "payload": { 234 "type": "task-observability-event" 235 } 236 } 237 \end{verbatim} 238 \end{frame} 239 240 241 \begin{frame}[fragile]{Wallet-core API}{Error structure} 242 An error can be contained inside a response or a notification, and includes 243 the following data, in some cases along with extra fields: 244 245 \begin{center} 246 \begin{tabular}{c c c} 247 \hline 248 Field & Type & Description \\ 249 \hline 250 \texttt{code} & integer & GANA error code \\ 251 \texttt{when} & timestamp? & time when it occurred \\ 252 \texttt{hint} & string? & error message \\ 253 \end{tabular} 254 \end{center} 255 256 Example 257 258 \begin{verbatim} 259 { "code": 7001, 260 "hint": "could not resolve host: demo.taler.net", 261 "when": { "t_ms": 1718726899827 } } 262 \end{verbatim} 263 \end{frame} 264 265 266 \begin{frame}[fragile]{GNU Taler wallet}{Building wallet-core} 267 \begin{enumerate} 268 \item Install Python, Node.js, NPM and pnPM (\url{https://pnpm.io/}) 269 \item Clone the Git repository (\url{https://git.taler.net/wallet-core.git}) 270 \item Run the bootstrap script 271 \begin{verbatim} 272 $ ./bootstrap 273 \end{verbatim} 274 \item Run the configuration script 275 \begin{verbatim} 276 $ ./configure 277 \end{verbatim} 278 \item Build all the components! 279 \begin{verbatim} 280 $ make 281 \end{verbatim} 282 \end{enumerate} 283 284 \textbf{Note:} the relevant \texttt{.mjs} file for building qtart will be 285 created under \texttt{packages/taler-wallet-embedded/dist/taler-wallet-core-qjs.mjs}. 286 \end{frame} 287 288 289 \begin{frame}[fragile]{GNU Taler wallet}{Building web extension} 290 In order to build the web extension, please follow the steps in the previous 291 slide, and then run the following command: 292 293 \begin{verbatim} 294 $ make webextension 295 \end{verbatim} 296 297 This will generate two files under \texttt{packages/taler-wallet-webextension}: 298 299 \begin{itemize} 300 \item \texttt{extension/v2/taler-wallet-webextension-\$VERSION.zip} 301 \item \texttt{extension/v3/taler-wallet-webextension-\$VERSION.zip} 302 \end{itemize} 303 304 Those files are the final packaged extensions. Depending on the manifest 305 version supported by your browser, you should install either \texttt{v2} 306 (e.g. Firefox) or \texttt{v3} (e.g. Chromium/Chrome). 307 \end{frame} 308 309 310 \begin{frame}[fragile]{GNU Taler wallet}{Building qtart (Android)} 311 \begin{enumerate} 312 \item Install Docker and Docker Compose 313 \item Clone the Git repository (\url{https://git.taler.net/quickjs-tart.git}) 314 \item Copy into the root the \texttt{.mjs} file produced when building wallet-core. 315 \item Descend into the \texttt{docker-android} directory. 316 \item Create an empty \texttt{.env} file. 317 \item Run the following command: 318 \begin{verbatim} 319 $ docker-compose run --rm quickjs 320 \end{verbatim} 321 \end{enumerate} 322 323 A local Maven repository will be created under the \texttt{.m2/repository} 324 directory relative to the Git repository root. The absolute path to this 325 directory should be added as a URL to the project-level 326 \texttt{build.gradle} file of the Android app, under 327 \texttt{allprojects/repositories}. 328 \end{frame} 329 330 331 \begin{frame}[fragile]{GNU Taler wallet}{Building Android app} 332 \begin{enumerate} 333 \item Install Android Studio. 334 \item Clone the Git repository (\url{https://git.taler.net/taler-android.git}). 335 \item Open the project with Android Studio. 336 \item Build qtart from source (optional). 337 \begin{itemize} 338 \item Build wallet-core from source. 339 \item Copy the resulting \texttt{.mjs} file to qtart. 340 \item Run the dockerized qtart build. 341 \item Add local Maven repository to the Android project. 342 \end{itemize} 343 \item Build and run the Android app. 344 \end{enumerate} 345 \end{frame} 346 347 348 \begin{frame}[fragile]{GNU Taler wallet}{Building iOS app} 349 \begin{enumerate} 350 \item Install Xcode (in macOS). 351 \item Under the same directory: 352 \begin{itemize} 353 \item Clone the iOS app Git repository (\url{https://git.taler.net/taler-ios.git}) 354 \item Clone the qtart Git repository (\url{https://git.taler.net/quickjs-tart.git}) 355 \end{itemize} 356 \item Build wallet-core from source. 357 \item Copy the resulting \texttt{.mjs} file to qtart. 358 \item Open the iOS project with Xcode. 359 \item Build and run the iOS app. 360 \end{enumerate} 361 \end{frame} 362 363 364 \begin{frame}[fragile]{Wallet-core CLI} 365 The CLI can be used to test wallet-core features quickly. In order to 366 install (only) the wallet-core CLI and other CLI tools, run the following 367 command after setting up the wallet-core repository: 368 \begin{verbatim} 369 $ make install-tools 370 \end{verbatim} 371 \textbf{Useful commands}: 372 {\small 373 \begin{verbatim} 374 $ taler-wallet-cli --help # print help message 375 $ taler-wallet-cli transactions # print transaction list 376 $ taler-wallet-cli handle-uri $URI # handle a Taler URI 377 $ taler-wallet-cli advanced withdraw-manually \ 378 --exchange https://exchange.demo.taler.net/ \ 379 --amount KUDOS:5 # perform manual withdrawal 380 $ taler-wallet-cli run-until-done # run until all work is done 381 \end{verbatim} 382 } 383 \end{frame} 384 385 386 \begin{frame}[fragile]{Wallet-core CLI} 387 It is also possible to call wallet-core API requests directly from the 388 CLI, even when there is not a command for it: 389 390 \begin{verbatim} 391 $ taler-wallet-cli api getWithdrawalDetailsForAmount \ 392 '{"exchangeBaseUrl":"https://exchange.demo.taler.net/", 393 "amount":"KUDOS:10"}' 394 \end{verbatim} 395 \vfill 396 \end{frame} 397 398 399 \begin{frame}[fragile]{Wallet-core CLI} 400 By design, wallet-core CLI only performs background tasks during each 401 execution, and when it completes the requested action, it quits. However, it 402 is also possible to run it as a daemon and run commands in a client-server 403 fashion, as shown below: 404 405 \medskip 406 407 \textbf{Run the wallet as a daemon (in the foreground)} 408 409 \begin{verbatim} 410 $ taler-wallet-cli advanced serve 411 \end{verbatim} 412 413 \textbf{Connect to the daemon and execute an action} 414 415 \begin{verbatim} 416 $ taler-wallet-cli --wallet-connection=$HOME/.wallet-core.sock ... 417 \end{verbatim} 418 \end{frame} 419 420 421 \begin{frame}{Hacking on wallet-core}{Important files} 422 {\small 423 \begin{itemize} 424 \item \texttt{packages/\underline{taler-util}/src/} (common Taler code) 425 \begin{itemize} 426 \item \texttt{taler-types.ts} (core Taler protocol type definitions) 427 \item \texttt{transactions-types.ts} (transaction type definitions) 428 \item \texttt{wallet-types.ts} (core wallet API type definitions) 429 \end{itemize} 430 \item \texttt{packages/\underline{taler-wallet-core}/src/} (main wallet-core code) 431 \begin{itemize} 432 \item \texttt{exchanges.ts} (exchange management and operations) 433 \item \texttt{pay-merchant.ts} (payments to merchants) 434 \item \texttt{pay-peer-*.ts} (p2p send/receive operations) 435 \item \texttt{shepherd.ts} (task scheduler) 436 \item \texttt{testing.ts} (test functions) 437 \item \texttt{transactions.ts} (transaction management) 438 \item \texttt{wallet-api-types.ts} (wallet-core API request/response types) 439 \end{itemize} 440 \item \texttt{packages/\underline{taler-harness}/src/} (integration tests) 441 \end{itemize} 442 } 443 \end{frame} 444 445 446 \begin{frame}{Other components} 447 \begin{itemize} 448 \item Merchant 449 \item Auditor 450 \item Challenger 451 \item Sync 452 \item GNU Anastasis 453 \item Twister 454 \item libeufin 455 \end{itemize} 456 \end{frame} 457 458 459 \begin{frame}{Tutorials} 460 \begin{itemize} 461 \item Wallet tutorials: \url{https://docs.taler.net/taler-wallet.html} 462 \item Video tutorials: \url{https://tutorials.taler.net/} 463 \item Support forum: \url{https://ich.taler.net/} 464 \end{itemize} 465 \end{frame} 466 467 468 \begin{frame}{Funding} 469 \vfill 470 \begin{center} 471 \url{https://nlnet.nl/propose} 472 \end{center} 473 \vfill 474 Candidates that passed 1st round from April 1st submission proposed: 475 \begin{itemize} 476 \item Some more integrations (frameworks, ERP) 477 \item Merchant implementation (?) 478 \item Improvements to wallet usability 479 \end{itemize} 480 \vfill 481 \end{frame} 482 483 484 % This should be last... 485 \begin{frame}{Acknowledgements} 486 487 \begin{minipage}{0.45\textwidth} \ \\ 488 {\tiny Funded by the European Union (Project 101135475).} 489 490 \begin{center} 491 \includegraphics[width=0.5\textwidth]{bandera.jpg} 492 \end{center} 493 \end{minipage} 494 \hfill 495 \begin{minipage}{0.45\textwidth} 496 {\tiny Funded by SERI (HEU-Projekt 101135475-TALER).} 497 498 \begin{center} 499 \includegraphics[width=0.65\textwidth]{sbfi.jpg} 500 \end{center} 501 \end{minipage} 502 503 \vfill 504 505 {\tiny 506 507 Views and opinions expressed are however those of the author(s) only 508 and do not necessarily reflect those of the European Union. Neither the 509 European Union nor the granting authority can be held responsible for 510 them. 511 512 } 513 \end{frame} 514 515 \end{document}