cosin.tex (19622B)
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}{Christian Grothoff \& Florian Dold} 7 \newcommand{\SPEAKER}{Christian Grothoff \& 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 ... with a surrounding software ecosystem 33 \item ... 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}{Merchant architecture} 78 \begin{center} 79 \begin{tikzpicture} 80 \tikzstyle{def} = [node distance= 3.5em and 2em, inner sep=1em, outer sep=.3em]; 81 \node (origin) at (0,0) {}; 82 \node (backend) [def,above=of origin,draw]{{\tiny taler-merchant-httpd}}; 83 \node (frontend) [def,above left=of backend,draw]{{\tiny E-commerce Frontend}}; 84 \node (backoffice) [def,above right=of backend,draw]{Backoffice}; 85 \node (postgres) [def, draw, below=of backend] {Postgres}; 86 87 \tikzstyle{C} = [color=black, line width=1pt] 88 \draw [->, C] (frontend) -- (backend) node [midway, above, sloped] (TextNode) {REST API}; 89 \draw [->, C] (backoffice) -- (backend) node [midway, above, sloped] (TextNode) {REST API}; 90 \draw [<->, C] (backend) -- (postgres) node [midway, right] (TextNode) {SQL}; 91 \end{tikzpicture} 92 \end{center} 93 \end{frame} 94 95 96 \begin{frame}[fragile]{GNU Taler Merchant Backend}{Installation} 97 Add a file {\tt /etc/apt/sources.list.d/taler.list}: 98 \begin{verbatim} 99 deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] \ 100 https://deb.taler.net/apt/debian bookworm main 101 deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] \ 102 https://deb.taler.net/apt/ubuntu/ noble taler-noble 103 \end{verbatim} 104 And import the key and install the package: 105 \begin{verbatim} 106 # wget -O /etc/apt/keyrings/taler-systems.gpg \ 107 https://taler.net/taler-systems.gpg 108 # apt update; apt install taler-merchant 109 \end{verbatim} 110 \end{frame} 111 112 113 \begin{frame}[fragile]{GNU Taler Merchant Backend}{Configuration} 114 Setup database and start the service: 115 \begin{verbatim} 116 # taler-merchant-dbconfig 117 # systemctl enable --now taler-merchant.target 118 \end{verbatim} 119 \begin{itemize} 120 \item Listens by default on 9966 121 \item Change ``[merchant] SERVE=unix'' to listen on 122 UNIX domain socket 123 \item Reverse proxy configuration templates are in 124 {\tt /etc/\{nginx,apache\}/sites-available/}. 125 \end{itemize} 126 \end{frame} 127 128 129 \begin{frame}[fragile]{GNU Taler Merchant Backend}{Authentication} 130 Initially, the service will have no password! 131 \begin{itemize} 132 \item Visit {\tt http://localhost:9966/} with a browser. 133 \item Setup default (admin) account and credentials! 134 \end{itemize} 135 In the REST API, the bearer token is always sent as: 136 \begin{verbatim} 137 Authorization: Bearer secret-token:$TOKEN 138 \end{verbatim} 139 See also: 140 \begin{center} 141 \url{https://www.rfc-editor.org/rfc/rfc8959.pdf} 142 \end{center} 143 \end{frame} 144 145 146 \begin{frame}[fragile]{GNU Taler Merchant Backend}{Test} 147 \vfill 148 \begin{verbatim} 149 $ wget http://localhost:9966/config 150 \end{verbatim} 151 \vfill 152 \end{frame} 153 154 155 \begin{frame}{GNU Taler Merchant Backend}{REST API} 156 \vfill 157 \begin{center} 158 \url{https://docs.taler.net/core/api-merchant.html} 159 \end{center} 160 \vfill 161 \end{frame} 162 163 164 \begin{frame}{GNU Taler Merchant Backend}{Key concepts} 165 \begin{itemize} 166 \item Instances 167 \item Orders 168 \item Inventory 169 \item Templates 170 \item Bank accounts 171 \item OTP devices 172 \item Webhooks 173 \end{itemize} 174 \end{frame} 175 176 177 \begin{frame}{GNU Taler Merchant Backend}{Ongoing developments} 178 \begin{itemize} 179 \item Token families 180 \begin{itemize} 181 \item Subscription 182 \item Discount 183 \end{itemize} 184 \item Donation receipts 185 \end{itemize} 186 \end{frame} 187 188 189 \begin{frame}{Other components for merchants} 190 \begin{itemize} 191 \item Point of sale app 192 \item {\tt taler-mdb} 193 \item WooCommerce (WordPress) plugin 194 \item Joomla! plugin 195 \item Adobe E-commerce (Magento) plugin 196 \end{itemize} 197 \end{frame} 198 199 200 \begin{frame}{Wallet architecture} 201 \vfill 202 \begin{center} 203 {\footnotesize 204 \begin{tikzpicture} 205 \tikzstyle{def} = [node distance= 3.5em and 2em, inner sep=1em, outer sep=.3em]; 206 \node (android) [def,draw]{Android}; 207 \node (ios) [def,right=of android,draw]{iOS}; 208 \node (webex) [def,right=of ios,draw]{WebEx}; 209 \node (wcore)[def,below=of ios,draw]{wallet-core}; 210 \node (db)[def,right=2cm of wcore,draw]{DB}; 211 \node (exchange)[def,below=of wcore,draw]{Exchange}; 212 \node (merchant)[def,below=of wcore,right=of exchange,draw]{Merchant}; 213 \node (bank)[def,below=of wcore,right=of merchant,draw]{Bank Integration}; 214 \node [draw,frame,fit=(wcore)(db),label={[xshift=2cm]above:{qtart/browser}}] {}; 215 \tikzstyle{C} = [color=black, line width=1pt]; 216 \draw [<->, C] (android) -- (wcore) node [midway,left,xshift=-1cm] (TextNode) {wallet-core API}; 217 \draw [<->, C] (ios) -- (wcore) node (TextNode) {}; 218 \draw [<->, C] (webex) -- (wcore) node (TextNode) {}; 219 \draw [<->, C] (wcore) -- (db) node [midway,above] (TextNode) {sqlite3}; 220 \draw [<->, C] (wcore) -- (exchange) node [midway,left] (TextNode) {HTTP}; 221 \draw [<->, C] (wcore) -- (merchant) node [midway,left] (TextNode) {HTTP}; 222 \draw [<->, C] (wcore) -- (bank) node [midway,left] (TextNode) {HTTP}; 223 \end{tikzpicture} 224 } 225 \end{center} 226 \vfill 227 \end{frame} 228 229 230 \begin{frame}[fragile]{GNU Taler wallet}{wallet-core} 231 \vfill 232 233 \textbf{wallet-core} is the component that powers the Taler wallets across 234 different platforms. It is written in TypeScript and it implements of all 235 the core functionality required by the wallets. It takes care of the 236 following: 237 238 \begin{itemize} 239 \item database management (IndexedDB/SQLite3) 240 \item task shepherding 241 \item cryptography 242 \item state machine for resources (transactions, exchange entries, ...) 243 \item communication with external services (exchange, merchant, bank) 244 \item communication with wallet-core clients 245 \end{itemize} 246 247 Most of its functionality is exposed via \textbf{requests}. Apps using 248 wallet-core can interact with it by calling different request methods, 249 passing parameters, and then e.g.\ rendering in the UI the data contained in 250 the response or showing an error message. 251 252 \vfill 253 \end{frame} 254 255 256 \begin{frame}[fragile]{GNU Taler wallet}{qtart} 257 qtart (\textbf{Q}uickJS \textbf{TA}ler \textbf{R}un\textbf{T}ime) is a 258 QuickJS-based runtime that embeds wallet-core into a native library for 259 usage outside of the browser, such as the mobile apps or any future desktop 260 app. 261 262 \begin{itemize} 263 \item Based on the acclaimed QuickJS JavaScript engine. 264 \item Implements native modules for cryptography. 265 \item Supports native HTTP networking (with multi-threading). 266 \item Provides access to the wallet-core API via a simple callback-based interface. 267 \item Keeps us from having to rewrite wallet-core for every platform! 268 \end{itemize} 269 \end{frame} 270 271 272 \begin{frame}{Wallet-core API}{Introduction} 273 \begin{center} 274 \begin{tikzpicture} 275 \tikzstyle{def} = [node distance= 3.5em and 10em, inner sep=1em, outer sep=.3em]; 276 \node (wallet) [def,draw] {Wallet}; 277 \node (wcore) [def,draw,right=of wallet] {wallet-core}; 278 \tikzstyle{C} = [color=black, line width=1pt]; 279 \draw [->,C,bend left](wallet) to node [above] {request (JSON)} (wcore); 280 \draw [->,C] (wcore) to node [below] {response (JSON)} (wallet); 281 \draw [->,C,bend left,dashed] (wcore) to node [below] {notifications (JSON)} (wallet); 282 \end{tikzpicture} 283 \end{center} 284 285 \begin{itemize} 286 \item Documentation: \url{https://docs.taler.net/wallet/wallet-core.html} 287 \end{itemize} 288 289 \end{frame} 290 291 292 \begin{frame}[fragile]{Wallet-core API}{Request structure} 293 \begin{center} 294 \begin{tabular}{c c c} 295 \hline 296 Field & Type & Description \\ 297 \hline 298 \texttt{id} & integer & request ID \\ 299 \texttt{operation} & string & API operation \\ 300 \texttt{args} & object & request arguments \\ 301 \end{tabular} 302 \end{center} 303 304 Example 305 306 \begin{verbatim} 307 { 308 "id": 0, 309 "operation": "init", 310 "args": { "logLevel": "INFO" } 311 } 312 \end{verbatim} 313 \end{frame} 314 315 316 \begin{frame}[fragile]{Wallet-core API}{Response structure} 317 \begin{center} 318 \begin{tabular}{c c c} 319 \hline 320 Field & Type & Description \\ 321 \hline 322 \texttt{type} & string & either \texttt{response} or \texttt{error} \\ 323 \texttt{id} & integer & request ID \\ 324 \texttt{operation} & string & API operation \\ 325 \texttt{result} & object & response data \\ 326 \end{tabular} 327 \end{center} 328 329 Example 330 331 \begin{verbatim} 332 { "type": "response", 333 "id": 0, 334 "operation": "init", 335 "result": {...} } 336 \end{verbatim} 337 \end{frame} 338 339 340 \begin{frame}[fragile]{Wallet-core API}{Notification structure} 341 \begin{center} 342 \begin{tabular}{c c c} 343 \hline 344 Field & Type & Description \\ 345 \hline 346 \texttt{type} & string & will be \texttt{notification} \\ 347 \texttt{payload} & object & notification data \\ 348 \end{tabular} 349 \end{center} 350 351 Example 352 353 \begin{verbatim} 354 { 355 "type": "notification", 356 "payload": { 357 "type": "task-observability-event" 358 } 359 } 360 \end{verbatim} 361 \end{frame} 362 363 364 \begin{frame}[fragile]{Wallet-core API}{Error structure} 365 An error can be contained inside a response or a notification, and includes 366 the following data, in some cases along with extra fields: 367 368 \begin{center} 369 \begin{tabular}{c c c} 370 \hline 371 Field & Type & Description \\ 372 \hline 373 \texttt{code} & integer & GANA error code \\ 374 \texttt{when} & timestamp? & time when it occurred \\ 375 \texttt{hint} & string? & error message \\ 376 \end{tabular} 377 \end{center} 378 379 Example 380 381 \begin{verbatim} 382 { "code": 7001, 383 "hint": "could not resolve host: demo.taler.net", 384 "when": { "t_ms": 1718726899827 } } 385 \end{verbatim} 386 \end{frame} 387 388 389 \begin{frame}[fragile]{GNU Taler wallet}{Building wallet-core} 390 \begin{enumerate} 391 \item Install Python, Node.js, NPM and pnPM (\url{https://pnpm.io/}) 392 \item Clone the Git repository (\url{https://git.taler.net/wallet-core.git}) 393 \item Run the bootstrap script 394 \begin{verbatim} 395 $ ./bootstrap 396 \end{verbatim} 397 \item Run the configuration script 398 \begin{verbatim} 399 $ ./configure 400 \end{verbatim} 401 \item Build all the components! 402 \begin{verbatim} 403 $ make 404 \end{verbatim} 405 \end{enumerate} 406 407 \textbf{Note:} the relevant \texttt{.mjs} file for building qtart will be 408 created under \texttt{packages/taler-wallet-embedded/dist/taler-wallet-core-qjs.mjs}. 409 \end{frame} 410 411 412 \begin{frame}[fragile]{GNU Taler wallet}{Building web extension} 413 In order to build the web extension, please follow the steps in the previous 414 slide, and then run the following command: 415 416 \begin{verbatim} 417 $ make webextension 418 \end{verbatim} 419 420 This will generate two files under \texttt{packages/taler-wallet-webextension}: 421 422 \begin{itemize} 423 \item \texttt{extension/v2/taler-wallet-webextension-\$VERSION.zip} 424 \item \texttt{extension/v3/taler-wallet-webextension-\$VERSION.zip} 425 \end{itemize} 426 427 Those files are the final packaged extensions. Depending on the manifest 428 version supported by your browser, you should install either \texttt{v2} 429 (e.g. Firefox) or \texttt{v3} (e.g. Chromium/Chrome). 430 \end{frame} 431 432 433 \begin{frame}[fragile]{GNU Taler wallet}{Building qtart (Android)} 434 \begin{enumerate} 435 \item Install Docker and Docker Compose 436 \item Clone the Git repository (\url{https://git.taler.net/quickjs-tart.git}) 437 \item Copy into the root the \texttt{.mjs} file produced when building wallet-core. 438 \item Descend into the \texttt{docker-android} directory. 439 \item Create an empty \texttt{.env} file. 440 \item Run the following command: 441 \begin{verbatim} 442 $ docker-compose run --rm quickjs 443 \end{verbatim} 444 \end{enumerate} 445 446 A local Maven repository will be created under the \texttt{.m2/repository} 447 directory relative to the Git repository root. The absolute path to this 448 directory should be added as a URL to the project-level 449 \texttt{build.gradle} file of the Android app, under 450 \texttt{allprojects/repositories}. 451 \end{frame} 452 453 454 \begin{frame}[fragile]{GNU Taler wallet}{Building Android app} 455 \begin{enumerate} 456 \item Install Android Studio. 457 \item Clone the Git repository (\url{https://git.taler.net/taler-android.git}). 458 \item Open the project with Android Studio. 459 \item Build qtart from source (optional). 460 \begin{itemize} 461 \item Build wallet-core from source. 462 \item Copy the resulting \texttt{.mjs} file to qtart. 463 \item Run the dockerized qtart build. 464 \item Add local Maven repository to the Android project. 465 \end{itemize} 466 \item Build and run the Android app. 467 \end{enumerate} 468 \end{frame} 469 470 471 \begin{frame}[fragile]{GNU Taler wallet}{Building iOS app} 472 \begin{enumerate} 473 \item Install Xcode (in macOS). 474 \item Under the same directory: 475 \begin{itemize} 476 \item Clone the iOS app Git repository (\url{https://git.taler.net/taler-ios.git}) 477 \item Clone the qtart Git repository (\url{https://git.taler.net/quickjs-tart.git}) 478 \end{itemize} 479 \item Build wallet-core from source. 480 \item Copy the resulting \texttt{.mjs} file to qtart. 481 \item Open the iOS project with Xcode. 482 \item Build and run the iOS app. 483 \end{enumerate} 484 \end{frame} 485 486 487 \begin{frame}[fragile]{Wallet-core CLI} 488 The CLI can be used to test wallet-core features quickly. In order to 489 install (only) the wallet-core CLI and other CLI tools, run the following 490 command after setting up the wallet-core repository: 491 \begin{verbatim} 492 $ make install-tools 493 \end{verbatim} 494 \textbf{Useful commands}: 495 {\small 496 \begin{verbatim} 497 $ taler-wallet-cli --help # print help message 498 $ taler-wallet-cli transactions # print transaction list 499 $ taler-wallet-cli handle-uri $URI # handle a Taler URI 500 $ taler-wallet-cli advanced withdraw-manually \ 501 --exchange https://exchange.demo.taler.net/ \ 502 --amount KUDOS:5 # perform manual withdrawal 503 $ taler-wallet-cli run-until-done # run until all work is done 504 \end{verbatim} 505 } 506 \end{frame} 507 508 509 \begin{frame}[fragile]{Wallet-core CLI} 510 It is also possible to call wallet-core API requests directly from the 511 CLI, even when there is not a command for it: 512 513 \begin{verbatim} 514 $ taler-wallet-cli api getWithdrawalDetailsForAmount \ 515 '{"exchangeBaseUrl":"https://exchange.demo.taler.net/", 516 "amount":"KUDOS:10"}' 517 \end{verbatim} 518 \vfill 519 \end{frame} 520 521 522 \begin{frame}[fragile]{Wallet-core CLI} 523 By design, wallet-core CLI only performs background tasks during each 524 execution, and when it completes the requested action, it quits. However, it 525 is also possible to run it as a daemon and run commands in a client-server 526 fashion, as shown below: 527 528 \medskip 529 530 \textbf{Run the wallet as a daemon (in the foreground)} 531 532 \begin{verbatim} 533 $ taler-wallet-cli advanced serve 534 \end{verbatim} 535 536 \textbf{Connect to the daemon and execute an action} 537 538 \begin{verbatim} 539 $ taler-wallet-cli --wallet-connection=$HOME/.wallet-core.sock ... 540 \end{verbatim} 541 \end{frame} 542 543 544 \begin{frame}{Hacking on wallet-core}{Important files} 545 {\small 546 \begin{itemize} 547 \item \texttt{packages/\underline{taler-util}/src/} (common Taler code) 548 \begin{itemize} 549 \item \texttt{taler-types.ts} (core Taler protocol type definitions) 550 \item \texttt{transactions-types.ts} (transaction type definitions) 551 \item \texttt{wallet-types.ts} (core wallet API type definitions) 552 \end{itemize} 553 \item \texttt{packages/\underline{taler-wallet-core}/src/} (main wallet-core code) 554 \begin{itemize} 555 \item \texttt{exchanges.ts} (exchange management and operations) 556 \item \texttt{pay-merchant.ts} (payments to merchants) 557 \item \texttt{pay-peer-*.ts} (p2p send/receive operations) 558 \item \texttt{shepherd.ts} (task scheduler) 559 \item \texttt{testing.ts} (test functions) 560 \item \texttt{transactions.ts} (transaction management) 561 \item \texttt{wallet-api-types.ts} (wallet-core API request/response types) 562 \end{itemize} 563 \item \texttt{packages/\underline{taler-harness}/src/} (integration tests) 564 \end{itemize} 565 } 566 \end{frame} 567 568 569 \begin{frame}{Other components} 570 \begin{itemize} 571 \item Wallet app(s) 572 \item Auditor 573 \item Challenger 574 \item Sync 575 \item GNU Anastasis 576 \item Twister 577 \item libeufin 578 \end{itemize} 579 \end{frame} 580 581 582 \begin{frame}{Tutorials} 583 \begin{itemize} 584 \item Merchant payment processing: \url{https://docs.taler.net/taler-merchant-api-tutorial.html} 585 \item Regional/event currency setup: \url{https://docs.taler.net/libeufin/regional-automated-manual.html} 586 \item Video tutorials: \url{https://tutorials.taler.net/} 587 \item Support forum: \url{https://ich.taler.net/} 588 \end{itemize} 589 \end{frame} 590 591 592 \begin{frame}{Funding} 593 \vfill 594 \begin{center} 595 \url{https://nlnet.nl/propose} 596 \end{center} 597 \vfill 598 Candidates that passed 1st round from April 1st submission proposed: 599 \begin{itemize} 600 \item Some more integrations (frameworks, ERP) 601 \item Merchant implementation (?) 602 \item Improvements to wallet usability 603 \end{itemize} 604 \vfill 605 \end{frame} 606 607 608 609 % This should be last... 610 \begin{frame}{Acknowledgements} 611 612 \begin{minipage}{0.45\textwidth} \ \\ 613 {\tiny Funded by the European Union (Project 101135475).} 614 615 \begin{center} 616 \includegraphics[width=0.5\textwidth]{bandera.jpg} 617 \end{center} 618 \end{minipage} 619 \hfill 620 \begin{minipage}{0.45\textwidth} 621 {\tiny Funded by SERI (HEU-Projekt 101135475-TALER).} 622 623 \begin{center} 624 \includegraphics[width=0.65\textwidth]{sbfi.jpg} 625 \end{center} 626 \end{minipage} 627 628 \vfill 629 630 {\tiny 631 632 Views and opinions expressed are however those of the author(s) only 633 and do not necessarily reflect those of the European Union. Neither the 634 European Union nor the granting authority can be held responsible for 635 them. 636 637 } 638 \end{frame} 639 640 \end{document}