anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

anastasis.texi (224487B)


      1 \input texinfo   @c -*-texinfo-*-
      2 @c %**start of header
      3 @setfilename anastasis.info
      4 @documentencoding UTF-8
      5 @ifinfo
      6 @*Generated by Sphinx 4.3.2.@*
      7 @end ifinfo
      8 @settitle Anastasis Manual
      9 @defindex ge
     10 @paragraphindent 0
     11 @exampleindent 4
     12 @finalout
     13 @dircategory CATEGORY
     14 @direntry
     15 * MENU ENTRY: (anastasis.info). DESCRIPTION
     16 @end direntry
     17 
     18 @definfoenclose strong,`,'
     19 @definfoenclose emph,`,'
     20 @c %**end of header
     21 
     22 @copying
     23 @quotation
     24 Anastasis 0.0.0pre0, Aug 12, 2023
     25 
     26 Anastasis SARL
     27 
     28 Copyright @copyright{} 2020-2021 Anastasis SARL (AGPLv3+ or GFDL 1.3+)
     29 @end quotation
     30 
     31 @end copying
     32 
     33 @titlepage
     34 @title Anastasis Manual
     35 @insertcopying
     36 @end titlepage
     37 @contents
     38 
     39 @c %** start of user preamble
     40 
     41 @c %** end of user preamble
     42 
     43 @ifnottex
     44 @node Top
     45 @top Anastasis Manual
     46 @insertcopying
     47 @end ifnottex
     48 
     49 @c %**start of body
     50 @anchor{index doc}@anchor{0}
     51 @c This file is part of GNU Anastasis.
     52 @c Copyright (C) 2020-2021 Anastasis SARL
     53 @c 
     54 @c Anastasis is free software; you can redistribute it and/or modify it under the
     55 @c terms of the GNU Affero General Public License as published by the Free Software
     56 @c Foundation; either version 2.1, or (at your option) any later version.
     57 @c 
     58 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
     59 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     60 @c A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
     61 @c 
     62 @c You should have received a copy of the GNU Affero General Public License along with
     63 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     64 @c 
     65 @c @author Christian Grothoff
     66 
     67 Anastasis is a Free Software protocol and implementation that allows
     68 users to securely deposit @strong{core secrets} with an open set of escrow
     69 providers and to recover these secrets if their original copies are
     70 lost.
     71 
     72 Anastasis is intended for users that want to make backups of key
     73 material, such as OpenPGP encryption keys, hard disk encryption keys
     74 or master keys of electronic wallets. Anastasis is NOT intended to
     75 store large amounts of secret data, it is only designed to safeguard
     76 key material.
     77 
     78 Anastasis solves the issue of keeping key material both available
     79 to the authorized user(s), and confidential from anyone else.
     80 
     81 With Anastasis, the @strong{core secrets} are protected from the Anastasis
     82 escrow providers by encrypting each with a @strong{master key}.  The
     83 @strong{master key} can be split and distributed across the escrow
     84 providers to ensure that no single escrow provider can recover the
     85 @strong{master key} on its own.  Which subset(s) of Anastasis providers
     86 must be contacted to recover a @strong{master key} is freely configurable.
     87 
     88 With Anastasis, users can reliably recover their @strong{core secret},
     89 while Anastasis makes this difficult for everyone else.  This is even
     90 true if the user is unable to reliably remember any secret with
     91 sufficiently high entropy: Anastasis does not simply reduce the
     92 problem to encrypting the @strong{core secret} using some other key
     93 material in possession of the user.
     94 
     95 @menu
     96 * Documentation Overview:: 
     97 
     98 @detailmenu
     99  --- The Detailed Node Listing ---
    100 
    101 Documentation Overview
    102 
    103 * Introduction:: 
    104 * Installation:: 
    105 * Configuration:: 
    106 * Cryptography:: 
    107 * REST API:: 
    108 * Reducer API:: 
    109 * Authentication Methods:: 
    110 * DB Schema:: 
    111 * Anastasis licensing information:: 
    112 * Man Pages:: 
    113 * Complete Index:: 
    114 * GNU Free Documentation License:: 
    115 
    116 Introduction
    117 
    118 * User Identifiers:: 
    119 * Adversary models:: 
    120 * The recovery document:: 
    121 
    122 Installation
    123 
    124 * Installing from source:: 
    125 * Installing Anastasis binary packages on Debian:: 
    126 * Installing Anastasis binary packages on Ubuntu:: 
    127 
    128 Installing from source
    129 
    130 * Installing GNUnet:: 
    131 * Installing the Taler Exchange:: 
    132 * Installing the Taler Merchant:: 
    133 * Installing Anastasis:: 
    134 * Installing GNUnet-gtk:: 
    135 * Installing Anastasis-gtk:: 
    136 
    137 Installing Anastasis binary packages on Debian
    138 
    139 * Installing the graphical front-end:: 
    140 * Installing the backend:: 
    141 
    142 Installing Anastasis binary packages on Ubuntu
    143 
    144 * Installing the graphical front-end: Installing the graphical front-end<2>. 
    145 * Installing the backend: Installing the backend<2>. 
    146 
    147 Configuration
    148 
    149 * Configuration format:: 
    150 * Using anastasis-config:: 
    151 * Terms of Service:: 
    152 * Privacy Policy:: 
    153 * Legal policies directory layout:: 
    154 * Generating the Legal Terms:: 
    155 * Adding translations:: 
    156 * Updating legal documents:: 
    157 
    158 Legal policies directory layout
    159 
    160 * Example:: 
    161 
    162 Cryptography
    163 
    164 * Key derivations:: 
    165 * Key Usage:: 
    166 * Availability Considerations:: 
    167 
    168 Key derivations
    169 
    170 * Verification:: 
    171 * Encryption:: 
    172 
    173 Key Usage
    174 
    175 * Encryption: Encryption<2>. 
    176 * Signatures:: 
    177 
    178 REST API
    179 
    180 * HTTP Request and Response:: 
    181 * Protocol Version Ranges:: 
    182 * Common encodings:: 
    183 * Receiving Configuration:: 
    184 * Receiving Terms of Service:: 
    185 * Managing policy:: 
    186 * Managing truth:: 
    187 
    188 Common encodings
    189 
    190 * Binary Data:: 
    191 * Hash codes:: 
    192 * Large numbers:: 
    193 * Timestamps:: 
    194 * Integers:: 
    195 * Objects:: 
    196 * Keys:: 
    197 * Signatures: Signatures<2>. 
    198 * Amounts:: 
    199 * Time:: 
    200 * Cryptographic primitives:: 
    201 * Signatures: Signatures<3>. 
    202 
    203 Reducer API
    204 
    205 * States:: 
    206 * Backup Reducer:: 
    207 * Recovery Reducer:: 
    208 * Reducer transitions:: 
    209 
    210 Reducer transitions
    211 
    212 * Initial state:: 
    213 * Common transitions:: 
    214 * Backup transitions:: 
    215 * Recovery transitions:: 
    216 
    217 Authentication Methods
    218 
    219 * SMS (sms): SMS sms. 
    220 * Email verification (email): Email verification email. 
    221 * Video identification (vid): Video identification vid. 
    222 * Security question (qa): Security question qa. 
    223 * Snail mail verification (post): Snail mail verification post. 
    224 
    225 Anastasis licensing information
    226 
    227 * Anastasis (git;//git.taler.net/anastasis): Anastasis git //git taler net/anastasis. 
    228 * Anastasis-gtk (git;//git.taler.net/anastasis-gtk): Anastasis-gtk git //git taler net/anastasis-gtk. 
    229 * Documentation:: 
    230 
    231 Anastasis (git://git.taler.net/anastasis)
    232 
    233 * Runtime dependencies:: 
    234 
    235 Anastasis-gtk (git://git.taler.net/anastasis-gtk)
    236 
    237 * Runtime dependencies: Runtime dependencies<2>. 
    238 
    239 Man Pages
    240 
    241 * anastasis-config(1): anastasis-config 1. 
    242 * anastasis-dbconfig(1): anastasis-dbconfig 1. 
    243 * anastasis-dbinit(1): anastasis-dbinit 1. 
    244 * anastasis-gtk(1): anastasis-gtk 1. 
    245 * anastasis-helper-authorization-iban(1): anastasis-helper-authorization-iban 1. 
    246 * anastasis-httpd(1): anastasis-httpd 1. 
    247 * anastasis-reducer(1): anastasis-reducer 1. 
    248 * anastasis.conf(5): anastasis conf 5. 
    249 
    250 anastasis-config(1)
    251 
    252 * Synopsis:: 
    253 * Description:: 
    254 * See Also:: 
    255 * Bugs:: 
    256 
    257 anastasis-dbconfig(1)
    258 
    259 * Synopsis: Synopsis<2>. 
    260 * Description: Description<2>. 
    261 * See Also: See Also<2>. 
    262 * Bugs: Bugs<2>. 
    263 
    264 anastasis-dbinit(1)
    265 
    266 * Synopsis: Synopsis<3>. 
    267 * Description: Description<3>. 
    268 * See Also: See Also<3>. 
    269 * Bugs: Bugs<3>. 
    270 
    271 anastasis-gtk(1)
    272 
    273 * Synopsis: Synopsis<4>. 
    274 * Description: Description<4>. 
    275 * See Also: See Also<4>. 
    276 * Bugs: Bugs<4>. 
    277 
    278 anastasis-helper-authorization-iban(1)
    279 
    280 * Synopsis: Synopsis<5>. 
    281 * Description: Description<5>. 
    282 * See Also: See Also<5>. 
    283 * Bugs: Bugs<5>. 
    284 
    285 anastasis-httpd(1)
    286 
    287 * Synopsis: Synopsis<6>. 
    288 * Description: Description<6>. 
    289 * Signals:: 
    290 * See also:: 
    291 * Bugs: Bugs<6>. 
    292 
    293 anastasis-reducer(1)
    294 
    295 * Synopsis: Synopsis<7>. 
    296 * Description: Description<7>. 
    297 * See Also: See Also<6>. 
    298 * Bugs: Bugs<7>. 
    299 
    300 anastasis.conf(5)
    301 
    302 * Description: Description<8>. 
    303 * SEE ALSO:: 
    304 * BUGS:: 
    305 
    306 Description
    307 
    308 * GLOBAL OPTIONS:: 
    309 * Backend options:: 
    310 * Authorization options:: 
    311 * Postgres database configuration:: 
    312 
    313 Authorization options
    314 
    315 * SMS Authorization options:: 
    316 * Email Authorization options:: 
    317 * Post Authorization options:: 
    318 * IBAN Authorization options:: 
    319 
    320 GNU Free Documentation License
    321 
    322 * 0. PREAMBLE: 0 PREAMBLE. 
    323 * 1. APPLICABILITY AND DEFINITIONS: 1 APPLICABILITY AND DEFINITIONS. 
    324 * 2. VERBATIM COPYING: 2 VERBATIM COPYING. 
    325 * 3. COPYING IN QUANTITY: 3 COPYING IN QUANTITY. 
    326 * 4. MODIFICATIONS: 4 MODIFICATIONS. 
    327 * 5. COMBINING DOCUMENTS: 5 COMBINING DOCUMENTS. 
    328 * 6. COLLECTIONS OF DOCUMENTS: 6 COLLECTIONS OF DOCUMENTS. 
    329 * 7. AGGREGATION WITH INDEPENDENT WORKS: 7 AGGREGATION WITH INDEPENDENT WORKS. 
    330 * 8. TRANSLATION: 8 TRANSLATION. 
    331 * 9. TERMINATION: 9 TERMINATION. 
    332 * 10. FUTURE REVISIONS OF THIS LICENSE: 10 FUTURE REVISIONS OF THIS LICENSE. 
    333 * 11. RELICENSING: 11 RELICENSING. 
    334 * ADDENDUM; How to use this License for your documents: ADDENDUM How to use this License for your documents. 
    335 
    336 @end detailmenu
    337 @end menu
    338 
    339 @node Documentation Overview,,Top,Top
    340 @anchor{index anastasis-documentation}@anchor{1}@anchor{index documentation-overview}@anchor{2}
    341 @chapter Documentation Overview
    342 
    343 
    344 @c This file is part of Anastasis
    345 @c Copyright (C) 2019-2021 Anastasis SARL
    346 @c 
    347 @c Anastasis is free software; you can redistribute it and/or modify it under the
    348 @c terms of the GNU Affero General Public License as published by the Free Software
    349 @c Foundation; either version 2.1, or (at your option) any later version.
    350 @c 
    351 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
    352 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
    353 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
    354 @c 
    355 @c You should have received a copy of the GNU Affero General Public License along with
    356 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
    357 @c 
    358 @c @author Christian Grothoff
    359 @c @author Dominik Meister
    360 @c @author Dennis Neufeld
    361 
    362 @menu
    363 * Introduction:: 
    364 * Installation:: 
    365 * Configuration:: 
    366 * Cryptography:: 
    367 * REST API:: 
    368 * Reducer API:: 
    369 * Authentication Methods:: 
    370 * DB Schema:: 
    371 * Anastasis licensing information:: 
    372 * Man Pages:: 
    373 * Complete Index:: 
    374 * GNU Free Documentation License:: 
    375 
    376 @end menu
    377 
    378 @node Introduction,Installation,,Documentation Overview
    379 @anchor{introduction doc}@anchor{3}@anchor{introduction introduction}@anchor{4}
    380 @section Introduction
    381 
    382 
    383 To understand how Anastasis works, you need to understand three key
    384 concepts: user identifiers, our adversary model and the role of the
    385 recovery document.
    386 
    387 @menu
    388 * User Identifiers:: 
    389 * Adversary models:: 
    390 * The recovery document:: 
    391 
    392 @end menu
    393 
    394 @node User Identifiers,Adversary models,,Introduction
    395 @anchor{introduction user-identifiers}@anchor{5}
    396 @subsection User Identifiers
    397 
    398 
    399 To uniquely identify users, an “unforgettable” @strong{identifier} is used.  This
    400 identifier should be difficult to guess for anybody but the user. However, the
    401 @strong{identifier} is not expected to have sufficient entropy or secrecy to be
    402 cryptographically secure. Examples for such identifier would be a
    403 concatenation of the full name of the user and their social security or
    404 passport number(s).  For Swiss citizens, the AHV number could also be used.
    405 
    406 @node Adversary models,The recovery document,User Identifiers,Introduction
    407 @anchor{introduction adversary-models}@anchor{6}
    408 @subsection Adversary models
    409 
    410 
    411 The adversary model of Anastasis has two types of adversaries: weak
    412 adversaries which do not know the user’s @strong{identifier}, and strong
    413 adversaries which somehow do know a user’s @strong{identifier}.  For weak
    414 adversaries the system guarantees full confidentiality.  For strong
    415 adversaries, breaking confidentiality additionally requires that Anastasis
    416 escrow providers must have colluded.  The user is able to specify a set of
    417 @strong{policies} which determine which Anastasis escrow providers would need to
    418 collude to break confidentiality. These policies also set the bar for the user
    419 to recover their core secret.
    420 
    421 @node The recovery document,,Adversary models,Introduction
    422 @anchor{introduction the-recovery-document}@anchor{7}
    423 @subsection The recovery document
    424 
    425 
    426 A @strong{recovery document} includes all of the information a user needs
    427 to recover access to their core secret.  It specifies a set of
    428 @strong{escrow methods}, which specify how the user should convince the
    429 Anastasis server that they are “real”.  Escrow methods can for example
    430 include SMS-based verification, video identification or a security
    431 question.  For each escrow method, the Anastasis server is provided
    432 with @strong{truth}, that is data the Anastasis operator may learn during
    433 the recovery process.  Truth always consists of an encrypted key share
    434 and associated data to authenticate the user.  Examples for truth
    435 would be a phone number (for SMS), a picture of the user (for video
    436 identification), or the (hash of) a security answer.  A strong
    437 adversary is assumed to be able to learn the truth, while weak
    438 adversaries must not.  In addition to a set of escrow methods and
    439 associated Anastasis server operators, the @strong{recovery document} also
    440 specifies @strong{policies}, which describe the combination(s) of the
    441 escrow methods that suffice to obtain access to the core secret.  For
    442 example, a @strong{policy} could say that the escrow methods (A and B)
    443 suffice, and a second policy may permit (A and C).  A different user
    444 may choose to use the policy that (A and B and C) are all required.
    445 Anastasis imposes no limit on the number of policies in a @strong{recovery
    446 document}, or the set of providers or escrow methods involved in
    447 guarding a user’s secret.  Weak adversaries must not be able to deduce
    448 information about a user’s @strong{recovery document} (except for its
    449 length, which may be exposed to an adversary which monitors the user’s
    450 network traffic).
    451 
    452 @c This file is part of Anastasis
    453 @c Copyright (C) 2019-2021 Anastasis SARL
    454 @c 
    455 @c Anastasis is free software; you can redistribute it and/or modify it under the
    456 @c terms of the GNU Affero General Public License as published by the Free Software
    457 @c Foundation; either version 2.1, or (at your option) any later version.
    458 @c 
    459 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
    460 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
    461 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
    462 @c 
    463 @c You should have received a copy of the GNU Affero General Public License along with
    464 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
    465 @c 
    466 @c @author Christian Grothoff
    467 @c @author Dominik Meister
    468 @c @author Dennis Neufeld
    469 
    470 @node Installation,Configuration,Introduction,Documentation Overview
    471 @anchor{installation doc}@anchor{8}@anchor{installation installation}@anchor{9}
    472 @section Installation
    473 
    474 
    475 @cartouche
    476 @quotation Note 
    477 Currently, GNU Anastasis is released as alpha-quality software.
    478 When testing Anastasis, please choose @code{demoland} as
    479 your country of residence!
    480 @strong{It is not yet production ready! You cannot rely on it to keep
    481 your secrets recoverable today!}  In particular, we need to
    482 still review the various country-specific questions used to create
    483 unique user identifiers at the beginning of the backup and
    484 recovery process.  Community feedback on those inputs would be
    485 particularly welcome!
    486 @end quotation
    487 @end cartouche
    488 
    489 Please install the following packages before proceeding with the
    490 exchange compilation.
    491 
    492 
    493 @itemize -
    494 
    495 @item 
    496 libsqlite3 >= 3.16.2
    497 
    498 @item 
    499 GNU libunistring >= 0.9.3
    500 
    501 @item 
    502 libcurl >= 7.26 (or libgnurl >= 7.26)
    503 
    504 @item 
    505 libqrencode >= 4.0.0
    506 
    507 @item 
    508 GNU libgcrypt >= 1.6
    509 
    510 @item 
    511 libsodium >= 1.0
    512 
    513 @item 
    514 libargon2 >= 20171227
    515 
    516 @item 
    517 libjansson >= 2.7
    518 
    519 @item 
    520 Postgres >= 9.6, including libpq
    521 
    522 @item 
    523 GNU libmicrohttpd >= 0.9.71
    524 
    525 @item 
    526 GNUnet >= 0.14.0 (from source tarball@footnote{http://ftpmirror.gnu.org/gnunet/})
    527 
    528 @item 
    529 GNU Taler exchange
    530 
    531 @item 
    532 GNU Taler merchant backend
    533 @end itemize
    534 
    535 Except for the last two, these are available in most GNU/Linux distributions
    536 and should just be installed using the respective package manager.
    537 
    538 @menu
    539 * Installing from source:: 
    540 * Installing Anastasis binary packages on Debian:: 
    541 * Installing Anastasis binary packages on Ubuntu:: 
    542 
    543 @end menu
    544 
    545 @node Installing from source,Installing Anastasis binary packages on Debian,,Installation
    546 @anchor{installation installing-from-source}@anchor{a}
    547 @subsection Installing from source
    548 
    549 
    550 The following instructions will show how to install libgnunetutil and
    551 the GNU Taler exchange from source.
    552 
    553 @menu
    554 * Installing GNUnet:: 
    555 * Installing the Taler Exchange:: 
    556 * Installing the Taler Merchant:: 
    557 * Installing Anastasis:: 
    558 * Installing GNUnet-gtk:: 
    559 * Installing Anastasis-gtk:: 
    560 
    561 @end menu
    562 
    563 @node Installing GNUnet,Installing the Taler Exchange,,Installing from source
    564 @anchor{installation installing-gnunet}@anchor{b}
    565 @subsubsection Installing GNUnet
    566 
    567 
    568 Before you install GNUnet, you must download and install the dependencies
    569 mentioned in the previous section, otherwise the build may succeed, but could
    570 fail to export some of the tooling required by GNU Taler.
    571 
    572 To install GNUnet, unpack the tarball and change
    573 into the resulting directory, then proceed as follows:
    574 
    575 @example
    576 $ ./configure [--prefix=GNUNETPFX]
    577 $ # Each dependency can be fetched from non standard locations via
    578 $ # the '--with-<LIBNAME>' option. See './configure --help'.
    579 $ make
    580 # make install
    581 # ldconfig
    582 @end example
    583 
    584 If you did not specify a prefix, GNUnet will install to @code{/usr/local},
    585 which requires you to run the last step as @code{root}.
    586 The @code{ldconfig} command (also run as @code{root}) makes the
    587 shared object libraries (@code{.so} files)
    588 visible to the various installed programs.
    589 
    590 @node Installing the Taler Exchange,Installing the Taler Merchant,Installing GNUnet,Installing from source
    591 @anchor{installation installing-the-taler-exchange}@anchor{c}
    592 @subsubsection Installing the Taler Exchange
    593 
    594 
    595 After installing GNUnet, unpack the GNU Taler exchange tarball,
    596 change into the resulting directory, and proceed as follows:
    597 
    598 @example
    599 $ ./configure [--prefix=EXCHANGEPFX] \
    600               [--with-gnunet=GNUNETPFX]
    601 $ # Each dependency can be fetched from non standard locations via
    602 $ # the '--with-<LIBNAME>' option. See './configure --help'.
    603 $ make
    604 # make install
    605 @end example
    606 
    607 If you did not specify a prefix, the exchange will install to @code{/usr/local},
    608 which requires you to run the last step as @code{root}.  You have to specify
    609 @code{--with-gnunet=/usr/local} if you installed GNUnet to @code{/usr/local} in the
    610 previous step.
    611 
    612 @node Installing the Taler Merchant,Installing Anastasis,Installing the Taler Exchange,Installing from source
    613 @anchor{installation installing-the-taler-merchant}@anchor{d}
    614 @subsubsection Installing the Taler Merchant
    615 
    616 
    617 GNU Taler merchant has these additional dependencies:
    618 
    619 
    620 @itemize -
    621 
    622 @item 
    623 libqrencode >= 4.0.0
    624 @end itemize
    625 
    626 The following steps assume all dependencies are installed.
    627 
    628 First, unpack the GNU Taler merchant tarball and change into
    629 the resulting directory.
    630 Then, use the following commands to build and install the merchant backend:
    631 
    632 @example
    633 $ ./configure [--prefix=PFX] \
    634               [--with-gnunet=GNUNETPFX] \
    635               [--with-exchange=EXCHANGEPFX]
    636 $ # Each dependency can be fetched from non standard locations via
    637 $ # the '--with-<LIBNAME>' option. See './configure --help'.
    638 $ make
    639 # make install
    640 @end example
    641 
    642 If you did not specify a prefix, the exchange will install to
    643 @code{/usr/local}, which requires you to run the last step as @code{root}.
    644 
    645 You have to specify @code{--with-exchange=/usr/local} and/or
    646 @code{--with-gnunet=/usr/local} if you installed the exchange and/or
    647 GNUnet to @code{/usr/local} in the previous steps.
    648 
    649 Depending on the prefixes you specified for the installation and the
    650 distribution you are using, you may have to edit @code{/etc/ld.so.conf}, adding
    651 lines for @code{GNUNETPFX/lib/} and @code{EXCHANGEPFX/lib/} and @code{PFX/lib/}
    652 (replace the prefixes with the actual paths you used). Afterwards, you should
    653 run @code{ldconfig}. Without this step, it is possible that the linker may not
    654 find the installed libraries and launching the Taler merchant backend would
    655 then fail.
    656 
    657 @node Installing Anastasis,Installing GNUnet-gtk,Installing the Taler Merchant,Installing from source
    658 @anchor{installation installing-anastasis}@anchor{e}
    659 @subsubsection Installing Anastasis
    660 
    661 
    662 The following steps assume all dependencies are installed.
    663 
    664 First, unpack the Anastasis tarball and change into
    665 the resulting directory.
    666 Then, use the following commands to build and install Anastasis:
    667 
    668 @example
    669 $ ./configure [--prefix=PFX] \
    670               [--with-gnunet=GNUNETPFX] \
    671               [--with-exchange=EXCHANGEPFX]
    672 $ # Each dependency can be fetched from non standard locations via
    673 $ # the '--with-<LIBNAME>' option. See './configure --help'.
    674 $ make
    675 # make install
    676 @end example
    677 
    678 If you did not specify a prefix, Anastasis will be installed to
    679 @code{/usr/local}, which requires you to run the last step as @code{root}.
    680 
    681 You have to specify @code{--with-exchange=/usr/local} and/or
    682 @code{--with-gnunet=/usr/local} if you installed the exchange and/or
    683 GNUnet to @code{/usr/local} in the previous steps.
    684 
    685 Depending on the prefixes you specified for the installation and the
    686 distribution you are using, you may have to edit @code{/etc/ld.so.conf}, adding
    687 lines for @code{GNUNETPFX/lib/} and @code{EXCHANGEPFX/lib/} and @code{PFX/lib/}
    688 (replace the prefixes with the actual paths you used). Afterwards, you should
    689 run @code{ldconfig}. Without this step, it is possible that the linker may not
    690 find the installed libraries and launching the Anastasis backend would
    691 then fail.
    692 
    693 @node Installing GNUnet-gtk,Installing Anastasis-gtk,Installing Anastasis,Installing from source
    694 @anchor{installation installing-gnunet-gtk}@anchor{f}
    695 @subsubsection Installing GNUnet-gtk
    696 
    697 
    698 The following steps assume at least the GNUnet and Gtk+ dependencies are installed.
    699 
    700 First, unpack the gnunet-gtk tarball and change into the resulting directory.
    701 Then, use the following commands to build and install gnunet-gtk:
    702 
    703 @example
    704 $ ./configure [--prefix=$PFX] \
    705               [--with-gnunet=$GNUNETPFX]
    706 $ # Each dependency can be fetched from non standard locations via
    707 $ # the '--with-<LIBNAME>' option. See './configure --help'.
    708 $ make
    709 # make install
    710 @end example
    711 
    712 It is highly recommended to use the same prefix ($PFX) for gnunet-gtk that was
    713 used for GNUnet ($GNUNETPFX).  If you did not specify a prefix, gnunet-gtk
    714 will be installed to @code{/usr/local}, which requires you to run the last step
    715 as @code{root}.
    716 
    717 You have to specify @code{--with-gnunet=/usr/local} if you installed
    718 GNUnet to @code{/usr/local} in the previous steps.
    719 
    720 Depending on the prefixes you specified for the installation and the
    721 distribution you are using, you may have to edit @code{/etc/ld.so.conf}, adding
    722 lines for @code{$GNUNETPFX/lib/} and @code{$PFX/lib/} (replace the prefixes with the
    723 actual paths you used). Afterwards, you should run @code{ldconfig}. Without this
    724 step, it is possible that the linker may not find the installed libraries and
    725 launching gnunet-gtk would then fail.
    726 
    727 @node Installing Anastasis-gtk,,Installing GNUnet-gtk,Installing from source
    728 @anchor{installation installing-anastasis-gtk}@anchor{10}
    729 @subsubsection Installing Anastasis-gtk
    730 
    731 
    732 The following steps assume at least the GNUnet, gnunet-gtk and Anastasis
    733 dependencies are installed.
    734 
    735 First, unpack the anastasis-gtk tarball and change into the resulting
    736 directory.  Then, use the following commands to build and install
    737 anastasis-gtk:
    738 
    739 @example
    740 $ ./configure [--prefix=PFX] \
    741               [--with-gnunet=GNUNETPFX] \
    742               [--with-exchange=EXCHANGEPFX] \
    743               [--with-anastasis=ANASTASISPFX]
    744 $ # Each dependency can be fetched from non standard locations via
    745 $ # the '--with-<LIBNAME>' option. See './configure --help'.
    746 $ make
    747 # make install
    748 @end example
    749 
    750 If you did not specify a prefix, anastasis-gtk will be installed to
    751 @code{/usr/local}, which requires you to run the last step as @code{root}.
    752 
    753 You have to specify @code{-with-anastasis=/usr/local}, @code{--with-exchange=/usr/local} and/or
    754 @code{--with-gnunet=/usr/local} if you installed the exchange and/or
    755 GNUnet to @code{/usr/local} in the previous steps.
    756 
    757 Depending on the prefixes you specified for the installation and the
    758 distribution you are using, you may have to edit @code{/etc/ld.so.conf}, adding
    759 lines for @code{GNUNETPFX/lib/} and @code{EXCHANGEPFX/lib/} and @code{PFX/lib/}
    760 (replace the prefixes with the actual paths you used). Afterwards, you should
    761 run @code{ldconfig}. Without this step, it is possible that the linker may not
    762 find the installed libraries and launching anastasis-gtk would then fail.
    763 
    764 @node Installing Anastasis binary packages on Debian,Installing Anastasis binary packages on Ubuntu,Installing from source,Installation
    765 @anchor{installation installing-anastasis-binary-packages-on-debian}@anchor{11}
    766 @subsection Installing Anastasis binary packages on Debian
    767 
    768 
    769 To install the GNU Taler Debian packages, first ensure that you have
    770 the right Debian distribution. At this time, the packages are built for
    771 Bullseye.
    772 
    773 You need to add a file to import the GNU Taler packages. Typically,
    774 this is done by adding a file @code{/etc/apt/sources.list.d/taler.list} that
    775 looks like this:
    776 
    777 @example
    778 deb https://deb.taler.net/apt/debian bullseye main
    779 @end example
    780 
    781 Next, you must import the Taler Systems SA public package signing key
    782 into your keyring and update the package lists:
    783 
    784 @example
    785 # wget -O - https://taler.net/taler-systems.gpg.key | apt-key add -
    786 # apt update
    787 @end example
    788 
    789 @cartouche
    790 @quotation Note 
    791 You may want to verify the correctness of the Taler Systems key out-of-band.
    792 @end quotation
    793 @end cartouche
    794 
    795 Now your system is ready to install the official GNU Taler binary packages
    796 using apt.
    797 
    798 @menu
    799 * Installing the graphical front-end:: 
    800 * Installing the backend:: 
    801 
    802 @end menu
    803 
    804 @node Installing the graphical front-end,Installing the backend,,Installing Anastasis binary packages on Debian
    805 @anchor{installation installing-the-graphical-front-end}@anchor{12}
    806 @subsubsection Installing the graphical front-end
    807 
    808 
    809 To install the Anastasis Gtk+ frontend, you can simply run:
    810 
    811 @example
    812 # apt install anastasis-gtk
    813 @end example
    814 
    815 To use @code{anastasis-gtk}, you can simply run:
    816 
    817 @example
    818 $ anastasis-gtk
    819 @end example
    820 
    821 @node Installing the backend,,Installing the graphical front-end,Installing Anastasis binary packages on Debian
    822 @anchor{installation installing-the-backend}@anchor{13}
    823 @subsubsection Installing the backend
    824 
    825 
    826 If you want to install the Anastasis backend-end (which normal users do not
    827 need), you should run:
    828 
    829 @example
    830 # apt install -t sid anastasis-httpd
    831 @end example
    832 
    833 Note that the latter package does not perform all of the configuration work.
    834 It does setup the user users and the systemd service scripts, but you still
    835 must configure the database backup, HTTP reverse proxy (typically with TLS
    836 certificates), Taler merchant backend for payments, authentication services,
    837 prices and the terms of service.
    838 
    839 Sample configuration files for the HTTP reverse proxy can be found in
    840 @code{/etc/anastasis.conf}.
    841 
    842 Note that the package does not complete the integration of the backend
    843 with the HTTP reverse proxy (typically with TLS certificates).  A
    844 configuration fragment for Nginx or Apache will be placed in
    845 @code{/etc/@{apache,nginx@}/conf-available/anastasis.conf}.
    846 
    847 To operate an Anastasis backend with payments, you additionally
    848 need to install a Taler merchant backend via:
    849 
    850 @example
    851 # apt install -t sid taler-merchant-httpd
    852 @end example
    853 
    854 @node Installing Anastasis binary packages on Ubuntu,,Installing Anastasis binary packages on Debian,Installation
    855 @anchor{installation installing-anastasis-binary-packages-on-ubuntu}@anchor{14}
    856 @subsection Installing Anastasis binary packages on Ubuntu
    857 
    858 
    859 To install the GNU Taler Ubuntu packages, first ensure that you have
    860 the right Ubuntu distribution. At this time, the packages are built for
    861 Ubuntu 20.04 LTS (Focal Fossa).
    862 
    863 A typical @code{/etc/apt/sources.list.d/taler.list} file for this setup
    864 would look like this:
    865 
    866 @example
    867 deb https://deb.taler.net/apt/ubuntu/ focal-fossa main
    868 @end example
    869 
    870 The last line is crucial, as it adds the GNU Taler packages.
    871 
    872 Next, you must import the Taler Systems SA public package signing key
    873 into your keyring and update the package lists:
    874 
    875 @example
    876 # wget -O - https://taler.net/taler-systems.gpg.key | apt-key add -
    877 # apt update
    878 @end example
    879 
    880 @cartouche
    881 @quotation Note 
    882 You may want to verify the correctness of the Taler Systems key out-of-band.
    883 @end quotation
    884 @end cartouche
    885 
    886 Now your system is ready to install the official GNU Taler binary packages
    887 using apt.
    888 
    889 @menu
    890 * Installing the graphical front-end: Installing the graphical front-end<2>. 
    891 * Installing the backend: Installing the backend<2>. 
    892 
    893 @end menu
    894 
    895 @node Installing the graphical front-end<2>,Installing the backend<2>,,Installing Anastasis binary packages on Ubuntu
    896 @anchor{installation id1}@anchor{15}
    897 @subsubsection Installing the graphical front-end
    898 
    899 
    900 To install the Anastasis front-end, you can now simply run:
    901 
    902 @example
    903 # apt install -t focal-fossa anastasis-gtk
    904 @end example
    905 
    906 To use @code{anastasis-gtk}, you can simply run:
    907 
    908 @example
    909 $ anastasis-gtk
    910 @end example
    911 
    912 @node Installing the backend<2>,,Installing the graphical front-end<2>,Installing Anastasis binary packages on Ubuntu
    913 @anchor{installation id2}@anchor{16}
    914 @subsubsection Installing the backend
    915 
    916 
    917 If you want to install the Anastasis backend-end (which normal users do not
    918 need), you should run:
    919 
    920 @example
    921 # apt install -t focal-fossa anastasis-httpd
    922 @end example
    923 
    924 Note that the latter package does not perform all of the configuration work.
    925 It does setup the user users and the systemd service scripts, but you still
    926 must configure the database backup, HTTP reverse proxy (typically with TLS
    927 certificates), Taler merchant backend for payments, authentication services,
    928 prices and the terms of service.
    929 
    930 Sample configuration files for the HTTP reverse proxy can be found in
    931 @code{/etc/anastasis.conf}.
    932 
    933 To operate an Anastasis backend with payments, you additionally
    934 need to install a Taler merchant backend via:
    935 
    936 @example
    937 # apt install -t sid taler-merchant-httpd
    938 @end example
    939 
    940 @c This file is part of Anastasis
    941 @c Copyright (C) 2019-2021 Anastasis SARL
    942 @c 
    943 @c Anastasis is free software; you can redistribute it and/or modify it under the
    944 @c terms of the GNU Affero General Public License as published by the Free Software
    945 @c Foundation; either version 2.1, or (at your option) any later version.
    946 @c 
    947 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
    948 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
    949 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
    950 @c 
    951 @c You should have received a copy of the GNU Affero General Public License along with
    952 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
    953 @c 
    954 @c @author Christian Grothoff
    955 @c @author Dominik Meister
    956 @c @author Dennis Neufeld
    957 
    958 @node Configuration,Cryptography,Installation,Documentation Overview
    959 @anchor{configuration doc}@anchor{17}@anchor{configuration configuration}@anchor{18}
    960 @section Configuration
    961 
    962 
    963 Details about the contents of the configuration file are describe in
    964 the @code{anastasis.conf(5)} chapter.  This chapter only describes the
    965 configuration format.
    966 
    967 @menu
    968 * Configuration format:: 
    969 * Using anastasis-config:: 
    970 * Terms of Service:: 
    971 * Privacy Policy:: 
    972 * Legal policies directory layout:: 
    973 * Generating the Legal Terms:: 
    974 * Adding translations:: 
    975 * Updating legal documents:: 
    976 
    977 @end menu
    978 
    979 @node Configuration format,Using anastasis-config,,Configuration
    980 @anchor{configuration configuration-format}@anchor{19}
    981 @subsection Configuration format
    982 
    983 
    984 In Taler realm, any component obeys to the same pattern to get
    985 configuration values. According to this pattern, once the component has
    986 been installed, the installation deploys default values in
    987 $@{prefix@}/share/taler/config.d/, in .conf files. In order to override
    988 these defaults, the user can write a custom .conf file and either pass
    989 it to the component at execution time, or name it taler.conf and place
    990 it under $HOME/.config/.
    991 
    992 A config file is a text file containing sections, and each section
    993 contains its values. The right format follows:
    994 
    995 @example
    996 [section1]
    997 value1 = string
    998 value2 = 23
    999 
   1000 [section2]
   1001 value21 = string
   1002 value22 = /path22
   1003 @end example
   1004 
   1005 Throughout any configuration file, it is possible to use @code{$}-prefixed
   1006 variables, like @code{$VAR}, especially when they represent filesystem
   1007 paths. It is also possible to provide defaults values for those
   1008 variables that are unset, by using the following syntax:
   1009 @code{$@{VAR:-default@}}. However, there are two ways a user can set
   1010 @code{$}-prefixable variables:
   1011 
   1012 by defining them under a @code{[paths]} section, see example below,
   1013 
   1014 @example
   1015 [paths]
   1016 TALER_DEPLOYMENT_SHARED = $@{HOME@}/shared-data
   1017 ..
   1018 [section-x]
   1019 path-x = $@{TALER_DEPLOYMENT_SHARED@}/x
   1020 @end example
   1021 
   1022 or by setting them in the environment:
   1023 
   1024 @example
   1025 $ export VAR=/x
   1026 @end example
   1027 
   1028 The configuration loader will give precedence to variables set under
   1029 @code{[path]}, though.
   1030 
   1031 The utility @code{taler-config}, which gets installed along with the
   1032 exchange, serves to get and set configuration values without directly
   1033 editing the .conf. The option @code{-f} is particularly useful to resolve
   1034 pathnames, when they use several levels of @code{$}-expanded variables. See
   1035 @code{taler-config --help}.
   1036 
   1037 Note that, in this stage of development, the file
   1038 @code{$HOME/.config/taler.conf} can contain sections for @emph{all} the
   1039 component. For example, both an exchange and a bank can read values from
   1040 it.
   1041 
   1042 The repository @code{git://git.taler.net/deployment} contains examples of
   1043 configuration file used in our demos. See under @code{deployment/config}.
   1044 
   1045 @node Using anastasis-config,Terms of Service,Configuration format,Configuration
   1046 @anchor{configuration using-anastasis-config}@anchor{1a}
   1047 @subsection Using anastasis-config
   1048 
   1049 
   1050 The tool @code{anastasis-config} can be used to extract or manipulate
   1051 configuration values; however, the configuration use the well-known INI
   1052 file format and can also be edited by hand.
   1053 
   1054 Run
   1055 
   1056 @example
   1057 $ anastasis-config -s $SECTION
   1058 @end example
   1059 
   1060 to list all of the configuration values in section @code{$SECTION}.
   1061 
   1062 Run
   1063 
   1064 @example
   1065 $ anastasis-config -s $section -o $option
   1066 @end example
   1067 
   1068 to extract the respective configuration value for option @code{$option} in
   1069 section @code{$section}.
   1070 
   1071 Finally, to change a setting, run
   1072 
   1073 @example
   1074 $ anastasis-config -s $section -o $option -V $value
   1075 @end example
   1076 
   1077 to set the respective configuration value to @code{$value}. Note that you
   1078 have to manually restart the Taler backend after you change the
   1079 configuration to make the new configuration go into effect.
   1080 
   1081 Some default options will use $-variables, such as @code{$DATADIR} within
   1082 their value. To expand the @code{$DATADIR} or other $-variables in the
   1083 configuration, pass the @code{-f} option to @code{anastasis-config}. For example,
   1084 compare:
   1085 
   1086 @example
   1087 $ anastasis-config -s ACCOUNT-bank \
   1088                -o WIRE_RESPONSE
   1089 $ anastasis-config -f -s ACCOUNT-bank \
   1090                -o WIRE_RESPONSE
   1091 @end example
   1092 
   1093 While the configuration file is typically located at
   1094 @code{$HOME/.config/taler.conf}, an alternative location can be specified
   1095 to @code{taler-merchant-httpd} and @code{anastasis-config} using the @code{-c}
   1096 option.
   1097 
   1098 @c This file is part of GNU TALER.
   1099 @c 
   1100 @c Copyright (C) 2014-2023 Taler Systems SA
   1101 @c 
   1102 @c TALER is free software; you can redistribute it and/or modify it under the
   1103 @c terms of the GNU Affero General Public License as published by the Free Software
   1104 @c Foundation; either version 2.1, or (at your option) any later version.
   1105 @c 
   1106 @c TALER is distributed in the hope that it will be useful, but WITHOUT ANY
   1107 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   1108 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
   1109 @c 
   1110 @c You should have received a copy of the GNU Affero General Public License along with
   1111 @c TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
   1112 @c 
   1113 @c @author Christian Grothoff
   1114 
   1115 The service has well-known API endpoints to return its legal conditions to the
   1116 user in various languages and various formats.  This section describes how to
   1117 setup and configure the legal conditions.
   1118 
   1119 @node Terms of Service,Privacy Policy,Using anastasis-config,Configuration
   1120 @anchor{configuration terms-of-service}@anchor{1b}
   1121 @subsection Terms of Service
   1122 
   1123 
   1124 The service has an endpoint “/terms” to return the terms of service (in legal
   1125 language) of the service operator.  Client software show these terms of
   1126 service to the user when the user is first interacting with the service.
   1127 Terms of service are optional for experimental deployments, if none are
   1128 configured, the service will return a simple statement saying that there are
   1129 no terms of service available.
   1130 
   1131 To configure the terms of service response, there are two options
   1132 in the configuration file for the service:
   1133 
   1134 
   1135 @itemize -
   1136 
   1137 @item 
   1138 @code{TERMS_ETAG}: The current “Etag” to return for the terms of service.
   1139 This value must be changed whenever the terms of service are
   1140 updated. A common value to use would be a version number.
   1141 Note that if you change the @code{TERMS_ETAG}, you MUST also provide
   1142 the respective files in @code{TERMS_DIR} (see below).
   1143 
   1144 @item 
   1145 @code{TERMS_DIR}: The directory that contains the terms of service.
   1146 The files in the directory must be readable to the service
   1147 process.
   1148 @end itemize
   1149 
   1150 @node Privacy Policy,Legal policies directory layout,Terms of Service,Configuration
   1151 @anchor{configuration privacy-policy}@anchor{1c}
   1152 @subsection Privacy Policy
   1153 
   1154 
   1155 The service has an endpoint “/pp” to return the terms privacy policy (in legal
   1156 language) of the service operator.  Clients should show the privacy policy to
   1157 the user when the user explicitly asks for it, but it should not be shown by
   1158 default.  Privacy policies are optional for experimental deployments, if none
   1159 are configured, the service will return a simple statement saying that there
   1160 is no privacy policy available.
   1161 
   1162 To configure the privacy policy response, there are two options
   1163 in the configuration file for the service:
   1164 
   1165 
   1166 @itemize -
   1167 
   1168 @item 
   1169 @code{PRIVACY_ETAG}: The current “Etag” to return for the privacy policy.
   1170 This value must be changed whenever the privacy policy is
   1171 updated. A common value to use would be a version number.
   1172 Note that if you change the @code{PRIVACY_ETAG}, you MUST also provide
   1173 the respective files in @code{PRIVACY_DIR} (see below).
   1174 
   1175 @item 
   1176 @code{PRIVACY_DIR}: The directory that contains the privacy policy.
   1177 The files in the directory must be readable to the service
   1178 process.
   1179 @end itemize
   1180 
   1181 @node Legal policies directory layout,Generating the Legal Terms,Privacy Policy,Configuration
   1182 @anchor{configuration legal-policies-directory-layout}@anchor{1d}
   1183 @subsection Legal policies directory layout
   1184 
   1185 
   1186 The @code{TERMS_DIR} and @code{PRIVACY_DIR} directory structures must follow a
   1187 particular layout.  You may use the same directory for both the terms of
   1188 service and the privacy policy, as long as you use different ETAGs.  Inside of
   1189 the directory, there should be sub-directories using two-letter language codes
   1190 like “en”, “de”, or “jp”.  Each of these directories would then hold
   1191 translations of the current terms of service into the respective language.
   1192 Empty directories are permitted in case translations are not available.
   1193 
   1194 Then, inside each language directory, files with the name of the value set as
   1195 the @code{TERMS_ETAG} or @code{PRIVACY_ETAG} must be provided. The extension of each
   1196 of the files should be typical for the respective mime type.  The set of
   1197 supported mime types is currently hard-coded in the service, and includes
   1198 “.epub”, “.html”, “.md”, “.pdf” and “.txt” files. If other files are present,
   1199 the service may show a warning on startup.
   1200 
   1201 @menu
   1202 * Example:: 
   1203 
   1204 @end menu
   1205 
   1206 @node Example,,,Legal policies directory layout
   1207 @anchor{configuration example}@anchor{1e}
   1208 @subsubsection Example
   1209 
   1210 
   1211 A sample file structure for a @code{TERMS_ETAG} of “tos-v0” would be:
   1212 
   1213 
   1214 @itemize -
   1215 
   1216 @item 
   1217 TERMS_DIR/en/tos-v0.txt
   1218 
   1219 @item 
   1220 TERMS_DIR/en/tos-v0.html
   1221 
   1222 @item 
   1223 TERMS_DIR/en/tos-v0.pdf
   1224 
   1225 @item 
   1226 TERMS_DIR/en/tos-v0.epub
   1227 
   1228 @item 
   1229 TERMS_DIR/en/tos-v0.md
   1230 
   1231 @item 
   1232 TERMS_DIR/de/tos-v0.txt
   1233 
   1234 @item 
   1235 TERMS_DIR/de/tos-v0.html
   1236 
   1237 @item 
   1238 TERMS_DIR/de/tos-v0.pdf
   1239 
   1240 @item 
   1241 TERMS_DIR/de/tos-v0.epub
   1242 
   1243 @item 
   1244 TERMS_DIR/de/tos-v0.md
   1245 @end itemize
   1246 
   1247 If the user requests an HTML format with language preferences “fr” followed by
   1248 “en”, the service would return @code{TERMS_DIR/en/tos-v0.html} lacking a version in
   1249 French.
   1250 
   1251 @node Generating the Legal Terms,Adding translations,Legal policies directory layout,Configuration
   1252 @anchor{configuration generating-the-legal-terms}@anchor{1f}
   1253 @subsection Generating the Legal Terms
   1254 
   1255 
   1256 The @code{taler-terms-generator} script can be used to generate directories with
   1257 terms of service and privacy policies in multiple languages and all required
   1258 data formats from a single source file in @code{.rst} format and GNU gettext
   1259 translations in @code{.po} format.
   1260 
   1261 To use the tool, you need to first write your legal conditions in English in
   1262 reStructuredText (rst).  You should find a templates in
   1263 @code{$PREFIX/share/terms/*.rst} where @code{$PREFIX} is the location where you
   1264 installed the service to. Whenever you make substantive changes to the legal
   1265 terms, you must use a fresh filename and change the respective @code{ETAG}.  The
   1266 resulting file must be called @code{$ETAG.rst} and the first line of the file should be the title of the document.
   1267 
   1268 Once you have written the @code{$ETAG.rst} file in English, you can
   1269 generate the first set of outputs:
   1270 
   1271 @example
   1272 $ taler-terms-generator -i $ETAG
   1273 @end example
   1274 
   1275 Afterwards, you should find the terms in various formats for all configured
   1276 languages (initially only English) in @code{$PREFIX/share/terms/}.  The generator
   1277 has a few options which are documented in its man page.
   1278 
   1279 @node Adding translations,Updating legal documents,Generating the Legal Terms,Configuration
   1280 @anchor{configuration adding-translations}@anchor{20}
   1281 @subsection Adding translations
   1282 
   1283 
   1284 Translations must be available in subdirectories
   1285 @code{locale/$LANGUAGE/LC_MESSAGES/$ETAG.po}.
   1286 To start translating, you first need to add a new
   1287 language:
   1288 
   1289 @example
   1290 $ taler-terms-generator -i $ETAG -l $LANGUAGE
   1291 @end example
   1292 
   1293 Here, @code{$LANGUAGE} should be a two-letter language
   1294 code like @code{de} or @code{fr}.  The command will generate
   1295 a file @code{locale/$LANGUAGE/LC_MESSAGES/$ETAG.po}
   1296 which contains each English sentence or paragraph
   1297 in the original document and an initially empty
   1298 translation.  Translators should update the @code{.po}
   1299 file. Afterwards, simply re-run
   1300 
   1301 @example
   1302 $ taler-terms-generator -i $ETAG
   1303 @end example
   1304 
   1305 to make the current translation(s) available to the
   1306 service.
   1307 
   1308 @cartouche
   1309 @quotation Note 
   1310 You must restart the service whenever adding or updating legal documents or their translations.
   1311 @end quotation
   1312 @end cartouche
   1313 
   1314 @node Updating legal documents,,Adding translations,Configuration
   1315 @anchor{configuration updating-legal-documents}@anchor{21}
   1316 @subsection Updating legal documents
   1317 
   1318 
   1319 When making minor changes without legal implications, edit the @code{.rst} file,
   1320 then re-run the step to add a new language for each existing translation to
   1321 produce an updated @code{.po} file. Translate the sentences that have changed and
   1322 finally run the generator (without @code{-l}) on the ETAG (@code{-i $ETAG}) to
   1323 create the final files.
   1324 
   1325 When making major changes with legal implications, you should first rename (or
   1326 copy) the existing @code{.rst} file and the associated translation files to a new
   1327 unique name.  Afterwards, make the major changes, update the @code{.po} files,
   1328 complete the translations and re-create the final files.  Finally, do not
   1329 forget to update the @code{ETAG} configuration option to the new name and to
   1330 restart the service.
   1331 
   1332 @c This file is part of Anastasis
   1333 @c Copyright (C) 2019-2021 Anastasis SARL
   1334 @c 
   1335 @c Anastasis is free software; you can redistribute it and/or modify it under the
   1336 @c terms of the GNU Affero General Public License as published by the Free Software
   1337 @c Foundation; either version 2.1, or (at your option) any later version.
   1338 @c 
   1339 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
   1340 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   1341 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
   1342 @c 
   1343 @c You should have received a copy of the GNU Affero General Public License along with
   1344 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
   1345 @c 
   1346 @c @author Christian Grothoff
   1347 @c @author Dominik Meister
   1348 @c @author Dennis Neufeld
   1349 
   1350 @node Cryptography,REST API,Configuration,Documentation Overview
   1351 @anchor{cryptography doc}@anchor{22}@anchor{cryptography cryptography}@anchor{23}
   1352 @section Cryptography
   1353 
   1354 
   1355 When a user needs to interact with Anastasis, the system first derives some key
   1356 material, but not the master secret, from the user’s @strong{identifier} using
   1357 different HKDFs.  These HKDFs are salted using the respective escrow
   1358 provider’s @strong{server salt}, which ensures that the accounts for the same user
   1359 cannot be easily correlated across the various Anastasis servers.
   1360 
   1361 Each Anastasis server uses an EdDSA @strong{account key} to identify the account of
   1362 the user.  The account private key is derived from the user’s @strong{identifier} using
   1363 a computationally expensive cryptographic hash function.  Using an
   1364 expensive hash algorithm is assumed to make it infeasible for a weak adversary to
   1365 determine account keys by brute force (without knowing the user’s identifier).
   1366 However, it is assumed that a strong adversary performing a targeted attack can
   1367 compute the account key pair.
   1368 
   1369 The public account key is Crockford base32-encoded in the URI to identify the
   1370 account, and used to sign requests.  These signatures are also provided in
   1371 base32-encoding and transmitted using the HTTP header
   1372 @code{Anastasis-Account-Signature}.
   1373 
   1374 When confidential data is uploaded to an Anastasis server, the respective
   1375 payload is encrypted using AES-GCM with a symmetric key and initialization
   1376 vector derived from the @strong{identifier} and a high-entropy @strong{nonce}.  The
   1377 nonce and the GCM tag are prepended to the ciphertext before being uploaded to
   1378 the Anastasis server.  This is done whenever confidential data is stored with
   1379 the server.
   1380 
   1381 The @strong{core secret} of the user is (AES) encrypted using a symmetric @strong{master
   1382 key}.  Recovering this master key requires the user to satisfy a particular
   1383 @strong{policy}.  Policies specify a set of @strong{escrow methods}, each of which leads
   1384 the user to a @strong{key share}. Combining those key shares (by hashing) allows
   1385 the user to obtain a @strong{policy key}, which can be used to decrypt the @strong{master
   1386 key}.  There can be many policies, satisfying any of these will allow the
   1387 user to recover the master key.  A @strong{recovery document} contains the
   1388 encrypted @strong{core secret}, a set of escrow methods and a set of policies.
   1389 
   1390 @menu
   1391 * Key derivations:: 
   1392 * Key Usage:: 
   1393 * Availability Considerations:: 
   1394 
   1395 @end menu
   1396 
   1397 @node Key derivations,Key Usage,,Cryptography
   1398 @anchor{cryptography key-derivations}@anchor{24}
   1399 @subsection Key derivations
   1400 
   1401 
   1402 EdDSA and ECDHE public keys are always points on Curve25519 and represented
   1403 using the standard 256 bit Ed25519 compact format.  The binary representation
   1404 is converted to Crockford Base32 when transmitted inside JSON or as part of
   1405 URLs.
   1406 
   1407 To start, a user provides their private, unique and unforgettable
   1408 @strong{identifier} as a seed to identify their account.  For example, this could
   1409 be a social security number together with their full name.  Specifics may
   1410 depend on the cultural context, in this document we will simply refer to this
   1411 information as the @strong{identifier}.
   1412 
   1413 This identifier will be first hashed with Argon2, to provide a @strong{kdf_id}
   1414 which will be used to derive other keys later. The Hash must also include the
   1415 respective @strong{server_salt}. This also ensures that the @strong{kdf_id} is different
   1416 on each server. The use of Argon2 and the respective @strong{server_salt} is intended
   1417 to make it difficult to brute-force @strong{kdf_id} values and help protect the user’s
   1418 privacy. Also this ensures that the @strong{kdf_id}s on every server differs. However,
   1419 we do not assume that the @strong{identifier} or the @strong{kdf_id} cannot be
   1420 determined by an adversary performing a targeted attack, as a user’s
   1421 @strong{identifier} is likely to always be known to state actors and may
   1422 likely also be available to other actors.
   1423 
   1424 @example
   1425 kdf_id := Argon2( identifier, server_salt, keysize )
   1426 @end example
   1427 
   1428 @strong{identifier}: The secret defined from the user beforehand.
   1429 
   1430 @strong{server_salt}: The salt from the Server.
   1431 
   1432 @strong{keysize}: The desired output size of the KDF, here 32 bytes.
   1433 
   1434 @menu
   1435 * Verification:: 
   1436 * Encryption:: 
   1437 
   1438 @end menu
   1439 
   1440 @node Verification,Encryption,,Key derivations
   1441 @anchor{cryptography verification}@anchor{25}
   1442 @subsubsection Verification
   1443 
   1444 
   1445 For users to authorize “policy” operations we need an EdDSA key pair.  As we
   1446 cannot assure that the corresponding private key is truly secret, such policy
   1447 operations must never be destructive: Should an adversary learn the private
   1448 key, they could access (and with the @strong{kdf_id}, decrypt) the user’s policy (but
   1449 not the core secret), or upload a new version of the
   1450 @strong{encrypted recovery document} (but not delete an existing version).
   1451 
   1452 For the generation of the private key we use the @strong{kdf_id} as the entropy source,
   1453 hash it to derive a base secret which will then be processed to fit the
   1454 requirements for EdDSA private keys.  From the private key we can then
   1455 generate the corresponding public key.  Here, “ver” is used as a salt for the
   1456 HKDF to ensure that the result differs from other cases where we hash
   1457 @strong{kdf_id}.
   1458 
   1459 @example
   1460 ver_secret := HKDF(kdf_id, "ver", keysize)
   1461 eddsa_priv := ver_secret
   1462 eddsa_pub := get_EdDSA_Pub(eddsa_priv)
   1463 @end example
   1464 
   1465 @strong{HKDF()}: The HKDF-function uses two phases: First we use HMAC-SHA512 for the extraction phase, then HMAC-SHA256 is used for expansion phase.
   1466 
   1467 @strong{kdf_id}: Hashed identifier.
   1468 
   1469 @strong{key_size}: Size of the output, here 32 bytes.
   1470 
   1471 @strong{ver_secret}: Derived key from the @code{kdf_id}, serves as intermediate step for the generation of the private key.
   1472 
   1473 @strong{eddsa_priv}: The generated EdDSA private key.
   1474 
   1475 @strong{eddsa_pub}: The generated EdDSA public key.
   1476 
   1477 @node Encryption,,Verification,Key derivations
   1478 @anchor{cryptography encryption}@anchor{26}
   1479 @subsubsection Encryption
   1480 
   1481 
   1482 For symmetric encryption of data we use AES256-GCM. For this we need a
   1483 symmetric key and an initialization vector (IV).  To ensure that the
   1484 symmetric key changes for each encryption operation, we compute the
   1485 key material using an HKDF over a @code{nonce} and the @code{kdf_id}.
   1486 
   1487 @example
   1488 (iv,key) := HKDF(kdf_id, nonce, keysize + ivsize)
   1489 @end example
   1490 
   1491 @strong{HKDF()}: The HKDF-function uses two phases: First we use HMAC-SHA512 for the extraction phase, then HMAC-SHA256 is used for expansion phase.
   1492 
   1493 @strong{kdf_id}: Hashed identifier.
   1494 
   1495 @strong{keysize}: Size of the AES symmetric key, here 32 bytes.
   1496 
   1497 @strong{ivsize}: Size of the AES GCM IV, here 12 bytes.
   1498 
   1499 @strong{prekey}: Original key material.
   1500 
   1501 @strong{nonce}: 32-byte nonce, must never match “ver” (which it cannot as the length is different). Of course, we must
   1502 avoid key reuse. So, we have to use different nonces to get different keys and IVs (see below).
   1503 
   1504 @strong{key}: Symmetric key which is later used to encrypt the documents with AES256-GCM.
   1505 
   1506 @strong{iv}: IV which will be used for AES-GCM.
   1507 
   1508 @node Key Usage,Availability Considerations,Key derivations,Cryptography
   1509 @anchor{cryptography key-usage}@anchor{27}
   1510 @subsection Key Usage
   1511 
   1512 
   1513 The keys we have generated are then used to encrypt the @strong{recovery document} and
   1514 the @strong{key_share} of the user.
   1515 
   1516 @menu
   1517 * Encryption: Encryption<2>. 
   1518 * Signatures:: 
   1519 
   1520 @end menu
   1521 
   1522 @node Encryption<2>,Signatures,,Key Usage
   1523 @anchor{cryptography id1}@anchor{28}
   1524 @subsubsection Encryption
   1525 
   1526 
   1527 Before every encryption a 32-byte nonce is generated.
   1528 From this the symmetric key is computed as described above.
   1529 We use AES256-GCM for the encryption of the @strong{recovery document} and
   1530 the @strong{key_share}.  To ensure that the key derivation for the encryption
   1531 of the @strong{recovery document} differs fundamentally from that of an
   1532 individual @strong{key share}, we use different salts (“erd” and “eks”, respectively).
   1533 
   1534 @example
   1535 (iv0, key0) := HKDF(key_id, nonce0, "erd", keysize + ivsize)
   1536 (encrypted_recovery_document, aes_gcm_tag) := AES256_GCM(recovery_document, key0, iv0)
   1537 (iv_i, key_i) := HKDF(key_id, nonce_i, "eks", [optional data], keysize + ivsize)
   1538 (encrypted_key_share_i, aes_gcm_tag_i) := AES256_GCM(key_share_i, key_i, iv_i)
   1539 @end example
   1540 
   1541 @strong{encrypted_recovery_document}: The encrypted @strong{recovery document} which contains the escrow methods, policies
   1542 and the encrypted @strong{core secret}.
   1543 
   1544 @strong{nonce0}: Nonce which is used to generate @emph{key0} and @emph{iv0} which are used for the encryption of the @emph{recovery document}.
   1545 This key derivation must be done using the salt “erd”.
   1546 
   1547 @strong{optional data}: Key material that optionally is contributed from the authentication method to further obfuscate the key share from the escrow provider.
   1548 
   1549 @strong{encrypted_key_share_i}: The encrypted @strong{key_share} which the escrow provider must release upon successful authentication.
   1550 Here, @strong{i} must be a positive number used to iterate over the various @strong{key shares} used for the various @strong{escrow methods}
   1551 at the various providers.
   1552 
   1553 @strong{nonce_i}: Nonce which is used to generate @emph{key_i} and @emph{iv_i} which are used for the encryption of the @strong{key share}. @strong{i} must be
   1554 the same number as specified above for @emph{encrypted_key_share_i}.
   1555 Key derivation must be done using the salt “eks”.
   1556 
   1557 As a special rule, when a @strong{security question} is used to authorize access to an
   1558 @strong{encrypted_key_share_i}, then the salt “eks” is replaced with an (expensive) hash
   1559 of the answer to the security question as an additional way to make the key share
   1560 inaccessible to those who do not have the answer:
   1561 
   1562 @example
   1563 powh := POW_HASH (qsalt, answer)
   1564 ekss := HKDF("Anastasis-secure-question-uuid-salting",
   1565              powh,
   1566              uuid);
   1567 (iv_i, key_i) := HKDF(key_id, nonce_i, ekss, [optional data], keysize + ivsize)
   1568 @end example
   1569 
   1570 @strong{qsalt}: Salt value used to hash answer to satisfy the challenge to prevent the provider from determining the answer via guessing.
   1571 
   1572 @strong{answer}: Answer to the security question, in UTF-8, as entered by the user.
   1573 
   1574 @strong{powh}: Result of the (expensive, proof-of-work) hash algorithm.
   1575 
   1576 @strong{uuid}: UUID of the challenge associated with the security question and the encrypted key share.
   1577 
   1578 @strong{ekss}: Replacement salt to be used instead of “eks” when deriving the key to encrypt/decrypt the key share.
   1579 
   1580 @node Signatures,,Encryption<2>,Key Usage
   1581 @anchor{cryptography signatures}@anchor{29}
   1582 @subsubsection Signatures
   1583 
   1584 
   1585 The EdDSA keys are used to sign the data sent from the client to the
   1586 server. This signature ensures that an adversary that observes the upload is not
   1587 able to upload a new version of the policy without knowing the user’s identity attributes.
   1588 The signature is made over a hash of the request body. The following
   1589 algorithm is equivalent for @strong{Anastasis-Policy-Signature}.
   1590 
   1591 @example
   1592 (anastasis-account-signature) := eddsa_sign(h_body, eddsa_priv)
   1593 ver_res := eddsa_verifiy(h_body, anastasis-account-signature, eddsa_pub)
   1594 @end example
   1595 
   1596 @strong{anastasis-account-signature}: Signature over the SHA-512 hash of the body using the purpose code @code{TALER_SIGNATURE_ANASTASIS_POLICY_UPLOAD} (1400) (see GNUnet EdDSA signature API for the use of purpose).
   1597 
   1598 @strong{h_body}: The hashed body.
   1599 
   1600 @strong{ver_res}: A boolean value. True: Signature verification passed, False: Signature verification failed.
   1601 
   1602 @node Availability Considerations,,Key Usage,Cryptography
   1603 @anchor{cryptography availability-considerations}@anchor{2a}
   1604 @subsection Availability Considerations
   1605 
   1606 
   1607 Anastasis considers two main threats against availability. First, the
   1608 Anastasis server operators must be protected against denial-of-service attacks
   1609 where an adversary attempts to exhaust the operator’s resources.  The API protects
   1610 against these attacks by allowing operators to set fees for all
   1611 operations. Furthermore, all data stored comes with an expiration logic, so an
   1612 attacker cannot force servers to store data indefinitely.
   1613 
   1614 A second availability issue arises from strong adversaries that may be able to
   1615 compute the account keys of some user.  While we assume that such an adversary
   1616 cannot successfully authenticate against the truth, the account key does
   1617 inherently enable these adversaries to upload a new policy for the account.
   1618 This cannot be prevented, as the legitimate user must be able to set or change
   1619 a policy using only the account key.  To ensure that an adversary cannot
   1620 exploit this, policy uploads first of all never delete existing policies, but
   1621 merely create another version.  This way, even if an adversary uploads a
   1622 malicious policy, a user can still retrieve an older version of the policy to
   1623 recover access to their data.  This append-only storage for policies still
   1624 leaves a strong adversary with the option of uploading many policies to
   1625 exhaust the Anastasis server’s capacity.  We limit this attack by requiring a
   1626 policy upload to include a reference to a @strong{payment identifier} from a payment
   1627 made by the user.  Thus, a policy upload requires both knowledge of the
   1628 @strong{identity} and making a payment.  This effectively prevents an adversary
   1629 from using the append-only policy storage from exhausting Anastasis server
   1630 capacity.
   1631 
   1632 @c This file is part of Anastasis
   1633 @c Copyright (C) 2019-2022 Anastasis SARL
   1634 @c 
   1635 @c Anastasis is free software; you can redistribute it and/or modify it under the
   1636 @c terms of the GNU Affero General Public License as published by the Free Software
   1637 @c Foundation; either version 2.1, or (at your option) any later version.
   1638 @c 
   1639 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
   1640 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   1641 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
   1642 @c 
   1643 @c You should have received a copy of the GNU Affero General Public License along with
   1644 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
   1645 @c 
   1646 @c @author Christian Grothoff
   1647 @c @author Dominik Meister
   1648 @c @author Dennis Neufeld
   1649 
   1650 @node REST API,Reducer API,Cryptography,Documentation Overview
   1651 @anchor{rest doc}@anchor{2b}@anchor{rest rest-api}@anchor{2c}
   1652 @section REST API
   1653 
   1654 
   1655 @c This file is part of Anastasis
   1656 @c 
   1657 @c Copyright (C) 2014-2021 Anastasis SARL
   1658 @c 
   1659 @c Anastasis is free software; you can redistribute it and/or modify it under the
   1660 @c terms of the GNU Affero Public License as published by the Free Software
   1661 @c Foundation; either version 2.1, or (at your option) any later version.
   1662 @c 
   1663 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
   1664 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   1665 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
   1666 @c 
   1667 @c You should have received a copy of the GNU Affero General Public License along with
   1668 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
   1669 @c 
   1670 @c @author Christian Grothoff
   1671 
   1672 @menu
   1673 * HTTP Request and Response:: 
   1674 * Protocol Version Ranges:: 
   1675 * Common encodings:: 
   1676 * Receiving Configuration:: 
   1677 * Receiving Terms of Service:: 
   1678 * Managing policy:: 
   1679 * Managing truth:: 
   1680 
   1681 @end menu
   1682 
   1683 @node HTTP Request and Response,Protocol Version Ranges,,REST API
   1684 @anchor{rest http-common}@anchor{2d}@anchor{rest http-request-and-response}@anchor{2e}
   1685 @subsection HTTP Request and Response
   1686 
   1687 
   1688 Certain response formats are common for all requests. They are documented here
   1689 instead of with each individual request.  Furthermore, we note that clients may
   1690 theoretically fail to receive any response.  In this case, the client should
   1691 verify that the Internet connection is working properly, and then proceed to
   1692 handle the error as if an internal error (500) had been returned.
   1693 
   1694 @anchor{rest any--*}@anchor{2f}
   1695 @deffn {HTTP Any} ANY /*
   1696 
   1697 @strong{Request:}
   1698 
   1699 Unless specified otherwise, HTTP requests that carry a message body must
   1700 have the content type @code{application/json}.
   1701 
   1702 @*Request Headers: 
   1703 
   1704 @itemize *
   1705 
   1706 @item 
   1707 Content-Type@footnote{https://tools.ietf.org/html/rfc7231#section-3.1.1.5} – application/json
   1708 @end itemize
   1709 
   1710 
   1711 @strong{Response:}
   1712 
   1713 @*Response Headers: 
   1714 
   1715 @itemize *
   1716 
   1717 @item 
   1718 Content-Type@footnote{https://tools.ietf.org/html/rfc7231#section-3.1.1.5} – application/json
   1719 @end itemize
   1720 
   1721 
   1722 
   1723 @table @asis
   1724 
   1725 @item 200 Ok@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}:
   1726 
   1727 The request was successful.
   1728 
   1729 @item 400 Bad request@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1}:
   1730 
   1731 One of the arguments to the request is missing or malformed.
   1732 
   1733 @item 500 Internal server error@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1}:
   1734 
   1735 This always indicates some serious internal operational error of the Anastasis
   1736 provider, such as a program bug, database problems, etc., and must not be used for
   1737 client-side problems.  When facing an internal server error, clients should
   1738 retry their request after some delay.  We recommended initially trying after
   1739 1s, twice more at randomized times within 1 minute, then the user should be
   1740 informed and another three retries should be scheduled within the next 24h.
   1741 If the error persists, a report should ultimately be made to the auditor,
   1742 although the auditor API for this is not yet specified.  However, as internal
   1743 server errors are always reported to the exchange operator, a good operator
   1744 should naturally be able to address them in a timely fashion, especially
   1745 within 24h.
   1746 @end table
   1747 
   1748 Unless specified otherwise, all error status codes (4xx and 5xx) have a message
   1749 body with an @ref{30,,ErrorDetail} JSON object.
   1750 
   1751 @strong{Details:}
   1752 
   1753 @example
   1754 interface ErrorDetail @{
   1755 
   1756   // Numeric error code unique to the condition, see `@w{`}gnu-taler-error-codes`@w{`} in GANA.
   1757   // The other arguments are specific to the error value reported here.
   1758   code: number;
   1759 
   1760   // Human-readable description of the error, i.e. "missing parameter", "commitment violation", ...
   1761   // Should give a human-readable hint about the error's nature. Optional, may change without notice!
   1762   hint?: string;
   1763 
   1764 @}
   1765 @end example
   1766 @end deffn
   1767 
   1768 @node Protocol Version Ranges,Common encodings,HTTP Request and Response,REST API
   1769 @anchor{rest protocol-version-ranges}@anchor{31}
   1770 @subsection Protocol Version Ranges
   1771 
   1772 
   1773 Anastasis services expose the range of API versions they support.  Clients in
   1774 turn have an API version range they support.  These version ranges are written
   1775 down in the libtool version format@footnote{https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html}.
   1776 
   1777 A protocol version is a positive, non-zero integer.  A protocol version range consists of three components:
   1778 
   1779 
   1780 @enumerate 
   1781 
   1782 @item 
   1783 The @code{current} version.  This is the latest version of the protocol supported by the client or service.
   1784 
   1785 @item 
   1786 The @code{revision} number.  This value should usually not be interpreted by the client/server, but serves
   1787 purely as a comment.  Each time a service/client for a protocol is updated while supporting the same
   1788 set of protocol versions, the revision should be increased.
   1789 In rare cases, the revision number can be used to work around unintended breakage in deployed
   1790 versions of a service.  This is discouraged and should only be used in exceptional situations.
   1791 
   1792 @item 
   1793 The @code{age} number.  This non-zero integer identifies with how many previous protocol versions this
   1794 implementation is compatible.  An @code{age} of 0 implies that the implementation only supports
   1795 the @code{current} protocol version.  The @code{age} must be less or equal than the @code{current} protocol version.
   1796 @end enumerate
   1797 
   1798 To avoid confusion with semantic versions, the protocol version range is written down in the following format:
   1799 
   1800 @example
   1801 current[:revision[:age]]
   1802 @end example
   1803 
   1804 The angle brackets mark optional components. If either @code{revision} or @code{age} are omitted, they default to 0.
   1805 
   1806 Examples:
   1807 
   1808 
   1809 @itemize *
   1810 
   1811 @item 
   1812 “1” and “1” are compatible
   1813 
   1814 @item 
   1815 “1” and “2” are @strong{incompatible}
   1816 
   1817 @item 
   1818 “2:0:1” and “1:0:0” are compatible
   1819 
   1820 @item 
   1821 “2:5:1” and “1:10:0” are compatible
   1822 
   1823 @item 
   1824 “4:0:1” and “2:0:0” are @strong{incompatible}
   1825 
   1826 @item 
   1827 “4:0:1” and “3:0:0” are compatible
   1828 @end itemize
   1829 
   1830 @cartouche
   1831 @quotation Note 
   1832 Semantic versions@footnote{https://semver.org/} are not a good tool for this job, as we concisely want to express
   1833 that the client/server supports the last @code{n} versions of the protocol.
   1834 Semantic versions don’t support this, and semantic version ranges are too complex for this.
   1835 @end quotation
   1836 @end cartouche
   1837 
   1838 @cartouche
   1839 @quotation Warning 
   1840 A client doesn’t have one single protocol version range.  Instead, it has
   1841 a protocol version range for each type of service it talks to.
   1842 @end quotation
   1843 @end cartouche
   1844 
   1845 @cartouche
   1846 @quotation Warning 
   1847 For privacy reasons, the protocol version range of a client should not be
   1848 sent to the service.  Instead, the client should just use the two version ranges
   1849 to decide whether it will talk to the service.
   1850 @end quotation
   1851 @end cartouche
   1852 
   1853 @node Common encodings,Receiving Configuration,Protocol Version Ranges,REST API
   1854 @anchor{rest common-encodings}@anchor{32}@anchor{rest encodings-ref}@anchor{33}
   1855 @subsection Common encodings
   1856 
   1857 
   1858 This section describes how certain types of values are represented throughout the API.
   1859 
   1860 @menu
   1861 * Binary Data:: 
   1862 * Hash codes:: 
   1863 * Large numbers:: 
   1864 * Timestamps:: 
   1865 * Integers:: 
   1866 * Objects:: 
   1867 * Keys:: 
   1868 * Signatures: Signatures<2>. 
   1869 * Amounts:: 
   1870 * Time:: 
   1871 * Cryptographic primitives:: 
   1872 * Signatures: Signatures<3>. 
   1873 
   1874 @end menu
   1875 
   1876 @node Binary Data,Hash codes,,Common encodings
   1877 @anchor{rest base32}@anchor{34}@anchor{rest binary-data}@anchor{35}
   1878 @subsubsection Binary Data
   1879 
   1880 
   1881 @example
   1882 type Base32 = string;
   1883 @end example
   1884 
   1885 Binary data is generally encoded using Crockford’s variant of Base32
   1886 (@indicateurl{http://www.crockford.com/wrmg/base32.html}), except that “U” is not excluded
   1887 but also decodes to “V” to make OCR easy.  We will still simply use the JSON
   1888 type “base32” and the term “Crockford Base32” in the text to refer to the
   1889 resulting encoding.
   1890 
   1891 @node Hash codes,Large numbers,Binary Data,Common encodings
   1892 @anchor{rest hash-codes}@anchor{36}
   1893 @subsubsection Hash codes
   1894 
   1895 
   1896 Hash codes are strings representing base32 encoding of the respective
   1897 hashed data. See @ref{34,,base32}.
   1898 
   1899 @example
   1900 // 64-byte hash code.
   1901 type HashCode = string;
   1902 @end example
   1903 
   1904 @example
   1905 // 32-byte hash code.
   1906 type ShortHashCode = string;
   1907 @end example
   1908 
   1909 @node Large numbers,Timestamps,Hash codes,Common encodings
   1910 @anchor{rest large-numbers}@anchor{37}
   1911 @subsubsection Large numbers
   1912 
   1913 
   1914 Large numbers such as 256 bit keys, are transmitted as other binary data in
   1915 Crockford Base32 encoding.
   1916 
   1917 @node Timestamps,Integers,Large numbers,Common encodings
   1918 @anchor{rest timestamps}@anchor{38}
   1919 @subsubsection Timestamps
   1920 
   1921 
   1922 Timestamps are represented by the following structure:
   1923 
   1924 @example
   1925 interface Timestamp @{
   1926   // Milliseconds since epoch, or the special
   1927   // value "never" to represent an event that will
   1928   // never happen.
   1929   t_ms: number | "never";
   1930 @}
   1931 @end example
   1932 
   1933 @example
   1934 interface Duration @{
   1935   // Duration in milliseconds or "forever"
   1936   // to represent an infinite duration.
   1937   d_ms: number | "forever";
   1938 @}
   1939 @end example
   1940 
   1941 @node Integers,Objects,Timestamps,Common encodings
   1942 @anchor{rest integers}@anchor{39}@anchor{rest publickey}@anchor{3a}
   1943 @subsubsection Integers
   1944 
   1945 
   1946 @example
   1947 // JavaScript numbers restricted to integers.
   1948 type Integer = number;
   1949 @end example
   1950 
   1951 @node Objects,Keys,Integers,Common encodings
   1952 @anchor{rest objects}@anchor{3b}
   1953 @subsubsection Objects
   1954 
   1955 
   1956 @example
   1957 // JavaScript objects, no further restrictions.
   1958 type Object = object;
   1959 @end example
   1960 
   1961 @node Keys,Signatures<2>,Objects,Common encodings
   1962 @anchor{rest keys}@anchor{3c}
   1963 @subsubsection Keys
   1964 
   1965 
   1966 @example
   1967 // EdDSA and ECDHE public keys always point on Curve25519
   1968 // and represented  using the standard 256 bits Ed25519 compact format,
   1969 // converted to Crockford `Base32`.
   1970 type EddsaPublicKey = string;
   1971 @end example
   1972 
   1973 @example
   1974 // EdDSA and ECDHE public keys always point on Curve25519
   1975 // and represented  using the standard 256 bits Ed25519 compact format,
   1976 // converted to Crockford `Base32`.
   1977 type EddsaPrivateKey = string;
   1978 @end example
   1979 
   1980 @node Signatures<2>,Amounts,Keys,Common encodings
   1981 @anchor{rest signature}@anchor{3d}@anchor{rest signatures}@anchor{3e}
   1982 @subsubsection Signatures
   1983 
   1984 
   1985 @example
   1986 // EdDSA signatures are transmitted as 64-bytes `base32`
   1987 // binary-encoded objects with just the R and S values (base32_ binary-only).
   1988 type EddsaSignature = string;
   1989 @end example
   1990 
   1991 @node Amounts,Time,Signatures<2>,Common encodings
   1992 @anchor{rest amount}@anchor{3f}@anchor{rest amounts}@anchor{40}
   1993 @subsubsection Amounts
   1994 
   1995 
   1996 @example
   1997 type Amount = string;
   1998 @end example
   1999 
   2000 Amounts of currency are serialized as a string of the format
   2001 @code{<Currency>:<DecimalAmount>}.  Taler treats monetary amounts as
   2002 fixed-precision numbers, with 8 decimal places.  Unlike floating point numbers,
   2003 this allows accurate representation of monetary amounts.
   2004 
   2005 The following constrains apply for a valid amount:
   2006 
   2007 
   2008 @enumerate 
   2009 
   2010 @item 
   2011 The @code{<Currency>} part must be at most 11 characters long and may only consist
   2012 of ASCII letters (@code{a-zA-Z}).
   2013 
   2014 @item 
   2015 The integer part of @code{<DecimalAmount>} may be at most 2^52.
   2016 
   2017 @item 
   2018 The fractional part of @code{<DecimalAmount>} may contain at most 8 decimal digits.
   2019 @end enumerate
   2020 
   2021 @cartouche
   2022 @quotation Note 
   2023 “EUR:1.50” and “EUR:10” are valid amounts.  These are all invalid amounts: “A:B:1.5”, “EUR:4503599627370501.0”, “EUR:1.”, “EUR:.1”.
   2024 @end quotation
   2025 @end cartouche
   2026 
   2027 An amount that is prefixed with a @code{+} or @code{-} character is also used in certain contexts.
   2028 When no sign is present, the amount is assumed to be positive.
   2029 
   2030 @node Time,Cryptographic primitives,Amounts,Common encodings
   2031 @anchor{rest time}@anchor{41}
   2032 @subsubsection Time
   2033 
   2034 
   2035 In signed messages, time is represented using 64-bit big-endian values,
   2036 denoting microseconds since the UNIX Epoch.  @code{UINT64_MAX} represents “never”.
   2037 
   2038 @example
   2039 struct GNUNET_TIME_Absolute @{
   2040   uint64_t timestamp_us;
   2041 @};
   2042 struct GNUNET_TIME_AbsoluteNBO @{
   2043   uint64_t abs_value_us__;       // in network byte order
   2044 @};
   2045 struct GNUNET_TIME_Timestamp @{
   2046   // must be round value (multiple of seconds)
   2047   struct GNUNET_TIME_Absolute abs_time;
   2048 @};
   2049 struct GNUNET_TIME_TimestampNBO @{
   2050   // must be round value (multiple of seconds)
   2051   struct GNUNET_TIME_AbsoluteNBO abs_time;
   2052 @};
   2053 @end example
   2054 
   2055 @node Cryptographic primitives,Signatures<3>,Time,Common encodings
   2056 @anchor{rest cryptographic-primitives}@anchor{42}
   2057 @subsubsection Cryptographic primitives
   2058 
   2059 
   2060 All elliptic curve operations are on Curve25519.  Public and private keys are
   2061 thus 32 bytes, and signatures 64 bytes.  For hashing, including HKDFs, Taler
   2062 uses 512-bit hash codes (64 bytes).
   2063 
   2064 @example
   2065 struct GNUNET_HashCode @{
   2066   uint8_t hash[64];      // usually SHA-512
   2067 @};
   2068 @end example
   2069 @anchor{rest taler-ecdhephemeralpublickeyp}@anchor{43}
   2070 @example
   2071 struct TALER_EcdhEphemeralPublicKeyP @{
   2072   uint8_t ecdh_pub[32];
   2073 @};
   2074 @end example
   2075 @anchor{rest anastasis-truthkeyp}@anchor{44}
   2076 @example
   2077 struct ANASTASIS_TruthKeyP @{
   2078   struct GNUNET_HashCode key;
   2079 @};
   2080 @end example
   2081 
   2082 @example
   2083 struct UUID @{
   2084   uint32_t value[4];
   2085 @};
   2086 @end example
   2087 
   2088 @node Signatures<3>,,Cryptographic primitives,Common encodings
   2089 @anchor{rest id1}@anchor{45}@anchor{rest id2}@anchor{46}
   2090 @subsubsection Signatures
   2091 
   2092 
   2093 Any piece of signed data, complies to the abstract data structure given below.
   2094 
   2095 @example
   2096 struct Data @{
   2097   struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2098   type1_t payload1;
   2099   type2_t payload2;
   2100   ...
   2101 @};
   2102 
   2103 /*From gnunet_crypto_lib.h*/
   2104 struct GNUNET_CRYPTO_EccSignaturePurpose @{
   2105   /**
   2106 
   2107   The following constraints apply for a valid amount:
   2108 
   2109    * This field is used to express the context in
   2110    * which the signature is made, ensuring that a
   2111    * signature cannot be lifted from one part of the protocol
   2112    * to another. See `src/include/taler_signatures.h` within the
   2113    * exchange's codebase (git://taler.net/exchange).
   2114    */
   2115   uint32_t purpose;
   2116   /**
   2117    * This field equals the number of bytes being signed,
   2118    * namely 'sizeof (struct Data)'.
   2119    */
   2120   uint32_t size;
   2121 @};
   2122 @end example
   2123 @anchor{rest salt}@anchor{47}
   2124 @node Receiving Configuration,Receiving Terms of Service,Common encodings,REST API
   2125 @anchor{rest config}@anchor{48}@anchor{rest receiving-configuration}@anchor{49}
   2126 @subsection Receiving Configuration
   2127 
   2128 
   2129 @anchor{rest get--config}@anchor{4a}
   2130 @deffn {HTTP Get} GET /config
   2131 
   2132 Obtain the configuration details of the escrow provider.
   2133 
   2134 @strong{Response:}
   2135 
   2136 Returns an @ref{4b,,EscrowConfigurationResponse}.
   2137 @anchor{rest escrowconfigurationresponse}@anchor{4b}
   2138 @example
   2139 interface EscrowConfigurationResponse @{
   2140 
   2141   // Protocol identifier, clarifies that this is an Anastasis provider.
   2142   name: "anastasis";
   2143 
   2144   // libtool-style representation of the Exchange protocol version, see
   2145   // https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning
   2146   // The format is "current:revision:age".
   2147   version: string;
   2148 
   2149   // Currency in which this provider processes payments.
   2150   currency: string;
   2151 
   2152   // Supported authorization methods.
   2153   methods: AuthorizationMethodConfig[];
   2154 
   2155   // Maximum policy upload size supported.
   2156   storage_limit_in_megabytes: number;
   2157 
   2158   // Payment required to maintain an account to store policy documents for a year.
   2159   // Users can pay more, in which case the storage time will go up proportionally.
   2160   annual_fee: Amount;
   2161 
   2162   // Payment required to upload truth.  To be paid per upload.
   2163   truth_upload_fee: Amount;
   2164 
   2165   // Limit on the liability that the provider is offering with
   2166   // respect to the services provided.
   2167   liability_limit: Amount;
   2168 
   2169   // Salt value with 128 bits of entropy.
   2170   // Different providers
   2171   // will use different high-entropy salt values. The resulting
   2172   // **provider salt** is then used in various operations to ensure
   2173   // cryptographic operations differ by provider.  A provider must
   2174   // never change its salt value.
   2175   provider_salt: string;
   2176 
   2177 @}
   2178 @end example
   2179 @anchor{rest authorizationmethodconfig}@anchor{4c}
   2180 @example
   2181 interface AuthorizationMethodConfig @{
   2182   // Name of the authorization method.
   2183   type: string;
   2184 
   2185   // Fee for accessing key share using this method.
   2186   cost: Amount;
   2187 
   2188 @}
   2189 @end example
   2190 @end deffn
   2191 
   2192 @node Receiving Terms of Service,Managing policy,Receiving Configuration,REST API
   2193 @anchor{rest receiving-terms-of-service}@anchor{4d}@anchor{rest terms}@anchor{4e}
   2194 @subsection Receiving Terms of Service
   2195 
   2196 
   2197 @anchor{rest get--terms}@anchor{4f}
   2198 @deffn {HTTP Get} GET /terms
   2199 
   2200 Obtain the terms of service provided by the escrow provider.
   2201 
   2202 @strong{Response:}
   2203 
   2204 Returns the terms of service of the provider, in the best language
   2205 and format available based on the client’s request.
   2206 @end deffn
   2207 
   2208 @anchor{rest get--privacy}@anchor{50}
   2209 @deffn {HTTP Get} GET /privacy
   2210 
   2211 Obtain the privacy policy of the service provided by the escrow provider.
   2212 
   2213 @strong{Response:}
   2214 
   2215 Returns the privacy policy of the provider, in the best language
   2216 and format available based on the client’s request.
   2217 @end deffn
   2218 
   2219 @node Managing policy,Managing truth,Receiving Terms of Service,REST API
   2220 @anchor{rest manage-policy}@anchor{51}@anchor{rest managing-policy}@anchor{52}
   2221 @subsection Managing policy
   2222 
   2223 
   2224 This API is used by the Anastasis client to deposit or request encrypted
   2225 recovery documents with the escrow provider.  Generally, a client will deposit
   2226 the same encrypted recovery document with each escrow provider, but provide
   2227 a different truth to each escrow provider.
   2228 
   2229 Operations by the client are identified and authorized by @code{$ACCOUNT_PUB}, which
   2230 should be kept secret from third parties. @code{$ACCOUNT_PUB} should be an account
   2231 public key using the Crockford base32-encoding.
   2232 
   2233 In the following, UUID is always defined and used according to RFC 4122@footnote{https://tools.ietf.org/html/rfc4122}.
   2234 
   2235 @anchor{rest get--policy-$ACCOUNT_PUB-meta[?max_version=$NUMBER]}@anchor{53}
   2236 @deffn {HTTP Get} GET /policy/$ACCOUNT_PUB/meta[?max_version=$NUMBER]
   2237 
   2238 Get meta data about a customer’s encrypted recovery documents.
   2239 If @code{max_version} is specified, only return results up to the
   2240 given version number. The response may not contain meta data
   2241 for all versions if there are way too many. In this case,
   2242 @code{max_version} must be used to incrementally fetch more versions.
   2243 
   2244 @strong{Response}:
   2245 
   2246 
   2247 @table @asis
   2248 
   2249 @item 200 OK@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}:
   2250 
   2251 The escrow provider responds with a @ref{54,,RecoveryMetaSummary} object.
   2252 
   2253 @item 400 Bad request@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1}:
   2254 
   2255 The @code{$ACCOUNT_PUB} is not an EdDSA public key.
   2256 
   2257 @item 402 Payment Required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}:
   2258 
   2259 The account’s balance is too low for the specified operation.
   2260 See the Taler payment protocol specification for how to pay.
   2261 
   2262 @item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}:
   2263 
   2264 The requested resource was not found.
   2265 @end table
   2266 
   2267 @strong{Details:}
   2268 @anchor{rest recoverymetasummary}@anchor{54}
   2269 @example
   2270 interface RecoveryMetaSummary @{
   2271   // Version numbers as a string (!) are used as keys.
   2272   "$VERSION": MetaData;
   2273 @}
   2274 
   2275 interface MetaData @{
   2276   // The meta value can be NULL if the document
   2277   // exists but no meta data was provided.
   2278   meta: string;
   2279 
   2280   // Server-time indicative of when the recovery
   2281   // document was uploaded.
   2282   upload_time: Timestamp;
   2283 @}
   2284 @end example
   2285 @end deffn
   2286 
   2287 @anchor{rest get--policy-$ACCOUNT_PUB[?version=$NUMBER]}@anchor{55}
   2288 @deffn {HTTP Get} GET /policy/$ACCOUNT_PUB[?version=$NUMBER]
   2289 
   2290 Get the customer’s encrypted recovery document.  If @code{version}
   2291 is not specified, the server returns the latest available version.  If
   2292 @code{version} is specified, returns the policy with the respective
   2293 @code{version}.  The response must begin with the nonce and
   2294 an AES-GCM tag and continue with the ciphertext.  Once decrypted, the
   2295 plaintext is expected to contain:
   2296 
   2297 
   2298 @itemize *
   2299 
   2300 @item 
   2301 the escrow policy
   2302 
   2303 @item 
   2304 the separately encrypted master public key
   2305 @end itemize
   2306 
   2307 Note that the key shares required to decrypt the master public key are
   2308 not included, as for this the client needs to obtain authorization.
   2309 The policy does provide sufficient information for the client to determine
   2310 how to authorize requests for @strong{truth}.
   2311 
   2312 The client MAY provide an @code{If-None-Match} header with an Etag.
   2313 In that case, the server MUST additionally respond with an @code{304} status
   2314 code in case the resource matches the provided Etag.
   2315 
   2316 @strong{Response}:
   2317 
   2318 
   2319 @table @asis
   2320 
   2321 @item 200 OK@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}:
   2322 
   2323 The escrow provider responds with an @ref{56,,EncryptedRecoveryDocument} object.
   2324 
   2325 @item 304 Not modified@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5}:
   2326 
   2327 The client requested the same resource it already knows.
   2328 
   2329 @item 400 Bad request@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1}:
   2330 
   2331 The @code{$ACCOUNT_PUB} is not an EdDSA public key.
   2332 
   2333 @item 402 Payment Required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}:
   2334 
   2335 The account’s balance is too low for the specified operation.
   2336 See the Taler payment protocol specification for how to pay.
   2337 
   2338 @item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}:
   2339 
   2340 The requested resource was not found.
   2341 @end table
   2342 
   2343 @emph{Anastasis-Version}: $NUMBER — The server must return actual version of the encrypted recovery document via this header.
   2344 If the client specified a version number in the header of the request, the server must return that version. If the client
   2345 did not specify a version in the request, the server returns latest version of the @ref{56,,EncryptedRecoveryDocument}.
   2346 
   2347 @emph{Etag}: Set by the server to the Base32-encoded SHA512 hash of the body. Used for caching and to prevent redundancies. The server MUST send the Etag if the status code is @code{200 OK}.
   2348 
   2349 @emph{If-None-Match}: If this is not the very first request of the client, this contains the Etag-value which the client has received before from the server.
   2350 The client SHOULD send this header with every request (except for the first request) to avoid unnecessary downloads.
   2351 @end deffn
   2352 
   2353 @anchor{rest post--policy-$ACCOUNT_PUB}@anchor{57}
   2354 @deffn {HTTP Post} POST /policy/$ACCOUNT_PUB
   2355 
   2356 Upload a new version of the customer’s encrypted recovery document.
   2357 While the document’s structure is described in JSON below, the upload
   2358 should just be the bytestream of the raw data (i.e. 32-byte nonce followed
   2359 by 16-byte tag followed by the encrypted document).
   2360 If the request has been seen before, the server should do nothing, and otherwise store the new version.
   2361 The body must begin with a nonce, an AES-GCM tag and continue with the ciphertext.  The format
   2362 is the same as specified for the response of the GET method. The
   2363 Anastasis server cannot fully validate the format, but MAY impose
   2364 minimum and maximum size limits.
   2365 
   2366 @strong{Request}:
   2367 
   2368 @*Query Parameters: 
   2369 
   2370 @itemize *
   2371 
   2372 @item 
   2373 @code{storage_duration=YEARS} – For how many years from now would the client like us to
   2374 store the recovery document? Defaults to 0 (that is, do
   2375 not extend / prolong existing storage contract).
   2376 The server will respond with a @code{402 Payment required}, but only
   2377 if the rest of the request is well-formed (account
   2378 signature must match).  Clients that do not actually
   2379 intend to make a new upload but that only want to pay
   2380 may attempt to upload the latest backup again, as this
   2381 option will be checked before the @code{304 Not modified}
   2382 case.
   2383 
   2384 @item 
   2385 @code{timeout_ms=NUMBER} – @emph{Optional.}  If specified, the Anastasis server will
   2386 wait up to @code{timeout_ms} milliseconds for completion of the payment before
   2387 sending the HTTP response.  A client must never rely on this behavior, as the
   2388 backend may return a response immediately. If a @code{timeout_ms} is not given, the Anastasis server may apply a default timeout (usually 30s) when talking to the merchant backend.
   2389 @end itemize
   2390 
   2391 
   2392 @emph{If-None-Match}: This header MUST be present and set to the SHA512 hash (Etag) of the body by the client.
   2393 The client SHOULD also set the @code{Expect: 100-Continue} header and wait for @code{100 continue}
   2394 before uploading the body.  The server MUST
   2395 use the Etag to check whether it already knows the encrypted recovery document that is about to be uploaded.
   2396 The server MUST refuse the upload with a @code{304} status code if the Etag matches
   2397 the latest version already known to the server.
   2398 
   2399 @emph{Anastasis-Policy-Meta-Data}: Encrypted meta data to be stored by the server and returned with the respective endpoint to provide an overview of the available policies. Encrypted using a random nonce and a key derived from the user ID using the salt “rmd”. The plaintext metadata must consist of the policy hash (for deduplication) and the (human readable) secret name.
   2400 
   2401 @emph{Anastasis-Policy-Signature}: The client must provide Base-32 encoded EdDSA signature over hash of body with @code{$ACCOUNT_PRIV}, affirming desire to upload an encrypted recovery document.
   2402 
   2403 @emph{Payment-Identifier}: Base-32 encoded 32-byte payment identifier that was included in a previous payment (see @code{402} status code). Used to allow the server to check that the client paid for the upload (to protect the server against DoS attacks) and that the client knows a real secret of financial value (as the @strong{kdf_id} might be known to an attacker). If this header is missing in the client’s request (or the associated payment has exceeded the upload limit), the server must return a @code{402} response.  When making payments, the server must include a fresh, randomly-generated payment-identifier in the payment request.  If a payment identifier is given, the Anastasis backend may block for the payment to be confirmed by Taler as specified by the @code{timeout_ms} argument.
   2404 
   2405 @strong{Response}:
   2406 
   2407 
   2408 @table @asis
   2409 
   2410 @item 204 No content@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5}:
   2411 
   2412 The encrypted recovery document was accepted and stored.  @code{Anastasis-Version}
   2413 indicates what version was assigned to this encrypted recovery document upload by the server.
   2414 @code{Anastasis-Policy-Expiration} indicates the time until the server promises to store the policy,
   2415 in seconds since epoch.
   2416 
   2417 @item 304 Not modified@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5}:
   2418 
   2419 The same encrypted recovery document was previously accepted and stored.  @code{Anastasis-Version} header
   2420 indicates what version was previously assigned to this encrypted recovery document.
   2421 
   2422 @item 400 Bad request@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1}:
   2423 
   2424 The @code{$ACCOUNT_PUB} is not an EdDSA public key or mandatory headers are missing.
   2425 The response body MUST elaborate on the error using a Taler error code in the typical JSON encoding.
   2426 
   2427 @item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}:
   2428 
   2429 The account’s balance is too low for the specified operation.
   2430 See the Taler payment protocol specification for how to pay.
   2431 The response body MAY provide alternative means for payment.
   2432 
   2433 @item 403 Forbidden@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4}:
   2434 
   2435 The required account signature was invalid.  The response body may elaborate on the error.
   2436 
   2437 @item 413 Request entity too large@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14}:
   2438 
   2439 The upload is too large @emph{or} too small. The response body may elaborate on the error.
   2440 @end table
   2441 
   2442 @strong{Details:}
   2443 @anchor{rest encryptedrecoverydocument}@anchor{56}
   2444 @example
   2445 interface EncryptedRecoveryDocument @{
   2446   // Nonce used to compute the (iv,key) pair for encryption of the
   2447   // encrypted_compressed_recovery_document.
   2448   nonce: [32]; //bytearray
   2449 
   2450   // Authentication tag.
   2451   aes_gcm_tag: [16]; //bytearray
   2452 
   2453   // Variable-size encrypted recovery document. After decryption,
   2454   // this contains a gzip compressed JSON-encoded `RecoveryDocument`.
   2455   // The salt of the HKDF for this encryption must include the
   2456   // string "erd".
   2457   encrypted_compressed_recovery_document: []; //bytearray of undefined length
   2458 
   2459 @}
   2460 @end example
   2461 @anchor{rest recoverydocument}@anchor{58}
   2462 @example
   2463 interface RecoveryDocument @{
   2464   // Human-readable name of the secret
   2465   secret_name?: string;
   2466 
   2467   // Encrypted core secret.
   2468   encrypted_core_secret: string; // bytearray of undefined length
   2469 
   2470   // List of escrow providers and selected authentication method.
   2471   escrow_methods: EscrowMethod[];
   2472 
   2473   // List of possible decryption policies.
   2474   policies: DecryptionPolicy[];
   2475 
   2476 @}
   2477 @end example
   2478 @anchor{rest escrowmethod}@anchor{59}
   2479 @example
   2480 interface EscrowMethod @{
   2481   // URL of the escrow provider (including possibly this Anastasis server).
   2482   url : string;
   2483 
   2484   // Type of the escrow method (e.g. security question, SMS etc.).
   2485   escrow_type: string;
   2486 
   2487   // UUID of the escrow method (see /truth/ API below).
   2488   uuid: string;
   2489 
   2490   // Key used to encrypt the `Truth` this `EscrowMethod` is related to.
   2491   // Client has to provide this key to the server when using `@w{`}/truth/`@w{`}.
   2492   truth_key: [32]; //bytearray
   2493 
   2494   // Salt used to hash the security answer if appliccable.
   2495   question_salt: [32]; //bytearray
   2496 
   2497   // Salt from the provider to derive the user ID
   2498   // at this provider.
   2499   provider_salt: [32]; //bytearray
   2500 
   2501   // The instructions to give to the user (i.e. the security question
   2502   // if this is challenge-response).
   2503   // (Q: as string in base32 encoding?)
   2504   // (Q: what is the mime-type of this value?)
   2505   //
   2506   // The plaintext challenge is not revealed to the
   2507   // Anastasis server.
   2508   instructions: string;
   2509 
   2510 @}
   2511 @end example
   2512 @anchor{rest decryptionpolicy}@anchor{5a}
   2513 @example
   2514 interface DecryptionPolicy @{
   2515   // Salt included to encrypt master key share when
   2516   // using this decryption policy.
   2517   master_salt: [32]; //bytearray
   2518 
   2519   // Master key, AES-encrypted with key derived from
   2520   // salt and keyshares revealed by the following list of
   2521   // escrow methods identified by UUID.
   2522   master_key: [32]; //bytearray
   2523 
   2524   // List of escrow methods identified by their UUID.
   2525   uuids: string[];
   2526 
   2527 @}
   2528 @end example
   2529 @end deffn
   2530 
   2531 @node Managing truth,,Managing policy,REST API
   2532 @anchor{rest managing-truth}@anchor{5b}@anchor{rest truth}@anchor{5c}
   2533 @subsection Managing truth
   2534 
   2535 
   2536 Truth always consists of an encrypted key share and encrypted
   2537 authentication data.  The key share and the authentication data
   2538 are encrypted using different keys. Additionally, truth includes
   2539 the name of the authentication method, the mime-type of the
   2540 authentication data, and an expiration time in
   2541 cleartext.
   2542 
   2543 This API is used by the Anastasis client to deposit @strong{truth} or request a (encrypted) @strong{key share} with
   2544 the escrow provider.
   2545 
   2546 An @strong{escrow method} specifies an Anastasis provider and how the user should
   2547 authorize themself.  The @strong{truth} API allows the user to provide the
   2548 (encrypted) key share to the respective escrow provider, as well as auxiliary
   2549 data required for such a respective escrow method.
   2550 
   2551 An Anastasis-server may store truth for free for a certain time period, or
   2552 charge per truth operation using GNU Taler.
   2553 
   2554 @anchor{rest post--truth-$UUID}@anchor{5d}
   2555 @deffn {HTTP Post} POST /truth/$UUID
   2556 
   2557 @strong{Request:}
   2558 
   2559 Upload a @ref{5e,,TruthUploadRequest}-Object according to the policy the client created before (see @ref{58,,RecoveryDocument}).
   2560 If request has been seen before, the server should do nothing, and otherwise store the new object.
   2561 
   2562 @*Query Parameters: 
   2563 
   2564 @itemize *
   2565 
   2566 @item 
   2567 @code{timeout_ms=NUMBER} – @emph{Optional.}  If specified, the Anastasis server will
   2568 wait up to @code{timeout_ms} milliseconds for completion of the payment before
   2569 sending the HTTP response.  A client must never rely on this behavior, as the
   2570 backend may return a response immediately.
   2571 @end itemize
   2572 
   2573 
   2574 @strong{Response:}
   2575 
   2576 
   2577 @table @asis
   2578 
   2579 @item 204 No content@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5}:
   2580 
   2581 Truth stored successfully.
   2582 
   2583 @item 304 Not modified@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5}:
   2584 
   2585 The same truth was previously accepted and stored under this UUID.  The
   2586 Anastasis server must still update the expiration time for the truth when returning
   2587 this response code.
   2588 
   2589 @item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}:
   2590 
   2591 This server requires payment to store truth per item.
   2592 See the Taler payment protocol specification for how to pay.
   2593 The response body MAY provide alternative means for payment.
   2594 
   2595 @item 409 Conflict@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10}:
   2596 
   2597 The server already has some truth stored under this UUID. The client should check that it
   2598 is generating UUIDs with enough entropy.
   2599 
   2600 @item 412 Precondition failed@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13}:
   2601 
   2602 The selected authentication method is not supported on this provider.
   2603 @end table
   2604 
   2605 @strong{Details:}
   2606 @anchor{rest truthuploadrequest}@anchor{5e}
   2607 @example
   2608 interface TruthUploadRequest @{
   2609   // Contains the information of an interface `EncryptedKeyShare`, but simply
   2610   // as one binary block (in Crockford Base32 encoding for JSON).
   2611   key_share_data: []; //bytearray
   2612 
   2613   // Key share method, i.e. "security question", "SMS", "e-mail", ...
   2614   type: string;
   2615 
   2616   // Variable-size truth. After decryption,
   2617   // this contains the ground truth, i.e. H(challenge answer),
   2618   // phone number, e-mail address, picture, fingerprint, ...
   2619   // **base32 encoded**.
   2620   //
   2621   // The nonce of the HKDF for this encryption must include the
   2622   // string "ECT".
   2623   encrypted_truth: []; //bytearray
   2624 
   2625   // MIME type of truth, i.e. text/ascii, image/jpeg, etc.
   2626   truth_mime?: string;
   2627 
   2628   // For how many years from now would the client like us to
   2629   // store the truth?
   2630   storage_duration_years: number;
   2631 
   2632 @}
   2633 @end example
   2634 
   2635 @anchor{rest post--truth-$UUID-solve}@anchor{5f}
   2636 @deffn {HTTP Post} POST /truth/$UUID/solve
   2637 @end deffn
   2638 
   2639 Solve the challenge and get the stored encrypted key share.
   2640 Also, the user has to provide the correct @emph{truth_encryption_key} with the request (see below).
   2641 The encrypted key share is returned simply as a byte array and not in JSON format.
   2642 
   2643 @strong{Request}:
   2644 
   2645 @quotation
   2646 
   2647 Upload a @ref{60,,TruthSolutionRequest}-Object.
   2648 
   2649 @*query timeout_ms=NUMBER: 
   2650 @emph{Optional.}  If specified, the Anastasis server will
   2651 wait up to @code{timeout_ms} milliseconds for completion of the payment or the
   2652 challenge before sending the HTTP response.  A client must never rely on this
   2653 behavior, as the backend may return a response immediately.
   2654 
   2655 @end quotation
   2656 
   2657 @strong{Response}:
   2658 
   2659 
   2660 @table @asis
   2661 
   2662 @item 200 OK@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}:
   2663 
   2664 @ref{61,,EncryptedKeyShare} is returned in body (in binary).
   2665 
   2666 @item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}:
   2667 
   2668 The service requires payment for access to truth.
   2669 See the Taler payment protocol specification for how to pay.
   2670 The response body MAY provide alternative means for payment.
   2671 
   2672 @item 403 Forbidden@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4}:
   2673 
   2674 The h_response provided is not a good response to the challenge associated
   2675 with the UUID, or at least the answer is not valid yet.  A generic
   2676 response is provided with an error code.
   2677 
   2678 @item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}:
   2679 
   2680 The server does not know any truth under the given UUID.
   2681 
   2682 @item 429 Too Many Requests@footnote{http://tools.ietf.org/html/rfc6585#section-4}:
   2683 
   2684 The client exceeded the number of allowed attempts at providing
   2685 a valid response for the given time interval.
   2686 The response format is given by @ref{62,,RateLimitedMessage}.
   2687 
   2688 @item 503 Service Unavailable@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4}:
   2689 
   2690 Server is out of Service.
   2691 @end table
   2692 
   2693 @strong{Details:}
   2694 @anchor{rest truthsolutionrequest}@anchor{60}
   2695 @example
   2696 interface TruthSolutionRequest @{
   2697 
   2698    // Hash over the response that solves the challenge
   2699    // issued for this truth.  This can be the
   2700    // hash of the security question (as specified before by the client
   2701    // within the `TruthUploadRequest`_ (see `@w{`}encrypted_truth`@w{`})), or the hash of the
   2702    // PIN code sent via SMS, E-mail or postal communication channels.
   2703    // Only when `@w{`}$H_RESPONSE`@w{`} is correct, the server responds with the encrypted key share.
   2704    h_response: HashCode;
   2705 
   2706    // Key that was used to encrypt the **truth** (see encrypted_truth within `TruthUploadRequest`_)
   2707    // and which has to provided by the user. The key is stored with
   2708    // the according `EscrowMethod`_. The server needs this key to get the
   2709    // info out of `TruthUploadRequest`_ to verify the `@w{`}h_response`@w{`}.
   2710    truth_decryption_key: ANASTASIS_TruthKeyP;
   2711 
   2712    // Reference to a payment made by the client to
   2713    // pay for this request. Optional.
   2714    payment_secret?: ANASTASIS_PaymentSecretP;
   2715 @}
   2716 @end example
   2717 @anchor{rest encryptedkeyshare}@anchor{61}
   2718 @example
   2719 interface EncryptedKeyShare @{
   2720   // Nonce used to compute the decryption (iv,key) pair.
   2721   nonce_i: [32]; //bytearray
   2722 
   2723   // Authentication tag.
   2724   aes_gcm_tag_i: [16]; //bytearray
   2725 
   2726   // Encrypted key-share in base32 encoding.
   2727   // After decryption, this yields a `KeyShare`.  Note that
   2728   // the `KeyShare` MUST be encoded as a fixed-size binary
   2729   // block (instead of in JSON encoding).
   2730   //
   2731   // HKDF for the key generation must include the
   2732   // string "eks" as salt.
   2733   // Depending on the method,
   2734   // the HKDF may additionally include
   2735   // bits from the response (i.e. some hash over the
   2736   // answer to the security question).
   2737   encrypted_key_share_i: [32]; //bytearray
   2738 
   2739 @}
   2740 
   2741 
   2742 interface KeyShare @{
   2743   // Key material to derive the key to decrypt the master key.
   2744   key_share: [32]; //bytearray
   2745 @}
   2746 @end example
   2747 @anchor{rest ratelimitedmessage}@anchor{62}
   2748 @example
   2749 interface RateLimitedMessage @{
   2750 
   2751   // Taler error code, TALER_EC_ANASTASIS_TRUTH_RATE_LIMITED.
   2752   code: number;
   2753 
   2754   // How many attempts are allowed per challenge?
   2755   request_limit: number;
   2756 
   2757   // At what frequency are new challenges issued?
   2758   request_frequency: RelativeTime;
   2759 
   2760   // The error message.
   2761   hint: string;
   2762 
   2763 @}
   2764 @end example
   2765 
   2766 @anchor{rest post--truth-$UUID-challenge}@anchor{63}
   2767 @deffn {HTTP Post} POST /truth/$UUID/challenge
   2768 @end deffn
   2769 
   2770 NEW API (#7064):
   2771 
   2772 Initiate process to solve challenge associated with the given truth object.
   2773 
   2774 @strong{Request}:
   2775 
   2776 @quotation
   2777 
   2778 Upload a @ref{64,,TruthChallengeRequest}-Object.
   2779 @end quotation
   2780 
   2781 @strong{Response}:
   2782 
   2783 
   2784 @table @asis
   2785 
   2786 @item 200 Ok@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}:
   2787 
   2788 The escrow provider will respond out-of-band (i.e. SMS).
   2789 The body may contain human- or machine-readable instructions on next steps.
   2790 In case the response is in JSON, the format is given
   2791 by @ref{65,,ChallengeInstructionMessage}.
   2792 
   2793 @item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}:
   2794 
   2795 The service requires payment to issue a challenge.
   2796 See the Taler payment protocol specification for how to pay.
   2797 The response body MAY provide alternative means for payment.
   2798 
   2799 @item 403 Forbidden@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4}:
   2800 
   2801 This type of truth does not permit requests to trigger a challenge.
   2802 This is the case for security questions and TOTP methods.
   2803 
   2804 @item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}:
   2805 
   2806 The server does not know any truth under the given UUID.
   2807 
   2808 @item 424 Failed Dependency@footnote{http://tools.ietf.org/html/rfc4918#section-11.4}:
   2809 
   2810 The decrypted @code{truth} does not match the expectations of the authentication
   2811 backend, i.e. a phone number for sending an SMS is not a number, or
   2812 an e-mail address for sending an E-mail is not a valid e-mail address.
   2813 
   2814 @item 503 Service Unavailable@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4}:
   2815 
   2816 Server is out of Service.
   2817 @end table
   2818 
   2819 @strong{Details:}
   2820 @anchor{rest truthchallengerequest}@anchor{64}
   2821 @example
   2822 interface TruthChallengeRequest @{
   2823 
   2824    // Key that was used to encrypt the **truth** (see encrypted_truth within `TruthUploadRequest`_)
   2825    // and which has to provided by the user. The key is stored with
   2826    // the according `EscrowMethod`_. The server needs this key to get the
   2827    // info out of `TruthUploadRequest`_ to verify the `@w{`}h_response`@w{`}.
   2828    truth_decryption_key: ANASTASIS_TruthKeyP;
   2829 
   2830    // Reference to a payment made by the client to
   2831    // pay for this request. Optional.
   2832    payment_secret?: ANASTASIS_PaymentSecretP;
   2833 @}
   2834 @end example
   2835 @anchor{rest challengeinstructionmessage}@anchor{65}
   2836 @example
   2837 type ChallengeInstructionMessage =
   2838   | FileChallengeInstructionMessage
   2839   | IbanChallengeInstructionMessage
   2840   | PinChallengeInstructionMessage;
   2841 
   2842 interface IbanChallengeInstructionMessage @{
   2843 
   2844   // What kind of challenge is this?
   2845   method: "IBAN_WIRE";
   2846 
   2847   // How much should be wired?
   2848   amount: Amount;
   2849 
   2850   // What is the target IBAN?
   2851   credit_iban: string;
   2852 
   2853   // What is the receiver name?
   2854   business_name: string;
   2855 
   2856   // What is the expected wire transfer subject?
   2857   wire_transfer_subject: string;
   2858 
   2859   // What is the numeric code (also part of the
   2860   // wire transfer subject) to be hashed when
   2861   // solving the challenge?
   2862   answer_code: number;
   2863 
   2864   // Hint about the origin account that must be used.
   2865   debit_account_hint: string;
   2866 
   2867 @}
   2868 
   2869 interface PinChallengeInstructionMessage @{
   2870 
   2871   // What kind of challenge is this?
   2872   method: "TAN_SENT";
   2873 
   2874   // Where was the PIN code sent? Note that this
   2875   // address will most likely have been obscured
   2876   // to improve privacy.
   2877   tan_address_hint: string;
   2878 
   2879 @}
   2880 
   2881 interface FileChallengeInstructionMessage @{
   2882 
   2883   // What kind of challenge is this?
   2884   method: "FILE_WRITTEN";
   2885 
   2886   // Name of the file where the PIN code was written.
   2887   filename: string;
   2888 
   2889 @}
   2890 @end example
   2891 @end deffn
   2892 
   2893 @c This file is part of Anastasis
   2894 @c Copyright (C) 2019-2022 Anastasis SARL
   2895 @c 
   2896 @c Anastasis is free software; you can redistribute it and/or modify it under the
   2897 @c terms of the GNU Affero General Public License as published by the Free Software
   2898 @c Foundation; either version 2.1, or (at your option) any later version.
   2899 @c 
   2900 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
   2901 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   2902 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
   2903 @c 
   2904 @c You should have received a copy of the GNU Affero General Public License along with
   2905 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
   2906 @c 
   2907 @c @author Christian Grothoff
   2908 @c @author Dominik Meister
   2909 @c @author Dennis Neufeld
   2910 
   2911 @node Reducer API,Authentication Methods,REST API,Documentation Overview
   2912 @anchor{reducer doc}@anchor{66}@anchor{reducer reducer-api}@anchor{67}
   2913 @section Reducer API
   2914 
   2915 
   2916 This section describes the Anastasis Reducer API which is used by client applications
   2917 to store or load the different states the client application can have.
   2918 The reducer takes a @ref{68,,state} in JSON syntax and returns the new state in JSON syntax.
   2919 
   2920 For example a @strong{state} may take the following structure:
   2921 
   2922 @example
   2923 @{
   2924   "backup_state": "CONTINENT_SELECTING",
   2925   "continents": [
   2926     "Europe",
   2927     "North_America"
   2928   ]
   2929 @}
   2930 @end example
   2931 
   2932 The new state depends on the previous one and on the transition @ref{69,,action} with its
   2933 arguments given to the reducer. A @strong{transition argument} also is a statement in JSON syntax:
   2934 
   2935 @example
   2936 @{
   2937   "continent": "Europe"
   2938 @}
   2939 @end example
   2940 
   2941 The new state returned by the reducer with the state and transition argument defined
   2942 above would look like following for the transition @ref{69,,action} @code{select_continent}:
   2943 
   2944 @example
   2945 @{
   2946   "backup_state": "COUNTRY_SELECTING",
   2947   "continents": [
   2948     "Europe",
   2949     "North_America"
   2950   ],
   2951   "selected_continent": "Europe",
   2952   "countries": [
   2953     @{
   2954       "code": "ch",
   2955       "name": "Switzerland",
   2956       "continent": "Europe",
   2957       "name_i18n": @{
   2958         "de_DE": "Schweiz",
   2959         "de_CH": "Schwiiz",
   2960         "fr": "Suisse",
   2961         "en": "Swiss"
   2962       @},
   2963       "currency": "CHF"
   2964     @},
   2965     @{
   2966       "code": "de",
   2967       "name": "Germany",
   2968       "continent": "Europe",
   2969       "continent_i18n": @{
   2970         "de": "Europa"
   2971       @},
   2972       "name_i18n": @{
   2973         "de_DE": "Deutschland",
   2974         "de_CH": "Deutschland",
   2975         "fr": "Allemagne",
   2976         "en": "Germany"
   2977       @},
   2978       "currency": "EUR"
   2979     @}
   2980   ]
   2981 @}
   2982 @end example
   2983 
   2984 An action may also result into an @emph{error response} instead of a new state.
   2985 Clients should then render this error response to the user and allow the user
   2986 to continue from the old state.  An error response looks like this:
   2987 
   2988 @example
   2989 @{
   2990   "code": 123,
   2991   "hint": "something went wrong",
   2992   "details": "parameter foo failed to frobnify"
   2993 @}
   2994 @end example
   2995 
   2996 @menu
   2997 * States:: 
   2998 * Backup Reducer:: 
   2999 * Recovery Reducer:: 
   3000 * Reducer transitions:: 
   3001 
   3002 @end menu
   3003 
   3004 @node States,Backup Reducer,,Reducer API
   3005 @anchor{reducer states}@anchor{6a}
   3006 @subsection States
   3007 
   3008 
   3009 Overall, the reducer knows the following states:
   3010 
   3011 @quotation
   3012 
   3013 
   3014 @itemize -
   3015 
   3016 @item 
   3017 
   3018 @table @asis
   3019 
   3020 @item @strong{CONTINENT_SELECTING}: The user should specify the continent where they are living,
   3021 
   3022 so that we can show a list of countries to choose from.
   3023 @end table
   3024 
   3025 @item 
   3026 
   3027 @table @asis
   3028 
   3029 @item @strong{COUNTRY_SELECTING}: The user should specify the country where they are living,
   3030 
   3031 so that we can determine appropriate attributes, currencies and Anastasis
   3032 providers.
   3033 @end table
   3034 
   3035 @item 
   3036 
   3037 @table @asis
   3038 
   3039 @item @strong{USER_ATTRIBUTES_COLLECTING}: The user should provide the country-specific personal
   3040 
   3041 attributes.
   3042 @end table
   3043 
   3044 @item 
   3045 
   3046 @table @asis
   3047 
   3048 @item @strong{AUTHENTICATIONS_EDITING}: The user should add authentication methods to be used
   3049 
   3050 during recovery.
   3051 @end table
   3052 
   3053 @item 
   3054 @strong{POLICIES_REVIEWING}: The user should review the recovery policies.
   3055 
   3056 @item 
   3057 @strong{SECRET_EDITING}: The user should edit the secret to be backed up.
   3058 
   3059 @item 
   3060 
   3061 @table @asis
   3062 
   3063 @item @strong{TRUTHS_PAYING}: The user needs to pay for one or more uploads of data associated
   3064 
   3065 with an authentication method.
   3066 @end table
   3067 
   3068 @item 
   3069 @strong{POLICIES_PAYING}: The user needs to pay for storing the recovery policy document.
   3070 
   3071 @item 
   3072 @strong{BACKUP_FINISHED}: A backup has been successfully generated.
   3073 
   3074 @item 
   3075 
   3076 @table @asis
   3077 
   3078 @item @strong{SECRET_SELECTING}: The user needs to select a recovery policy document with
   3079 
   3080 the secret that is to be recovered.
   3081 @end table
   3082 
   3083 @item 
   3084 
   3085 @table @asis
   3086 
   3087 @item @strong{CHALLENGE_SELECTING}: The user needs to select an authorization challenge to
   3088 
   3089 proceed with recovery.
   3090 @end table
   3091 
   3092 @item 
   3093 @strong{CHALLENGE_PAYING}: The user needs to pay to proceed with the authorization challenge.
   3094 
   3095 @item 
   3096 @strong{CHALLENGE_SOLVING}: The user needs to solve the authorization challenge.
   3097 
   3098 @item 
   3099 @strong{RECOVERY_FINISHED}: The secret of the user has been recovered.
   3100 @end itemize
   3101 @end quotation
   3102 
   3103 State names:
   3104 
   3105 @quotation
   3106 
   3107 
   3108 @itemize -
   3109 
   3110 @item 
   3111 In SELECTING-states, the user has to choose one value out of a predefined set of values (for example a continent out of a set of continents).
   3112 
   3113 @item 
   3114 In COLLECTING-states, the user has to give certain values.
   3115 
   3116 @item 
   3117 In EDITING-states, the user is free to choose which values he wants to give.
   3118 
   3119 @item 
   3120 In REVEIWING-states, the user may make a few choices, but primarily is expected to affirm something.
   3121 
   3122 @item 
   3123 in PAYING-states, the user must make a payment.
   3124 
   3125 @item 
   3126 in FINISHED-states, the operation has definitively concluded.
   3127 @end itemize
   3128 @end quotation
   3129 
   3130 @node Backup Reducer,Recovery Reducer,States,Reducer API
   3131 @anchor{reducer backup-reducer}@anchor{6b}
   3132 @subsection Backup Reducer
   3133 
   3134 @anchor{reducer state}@anchor{68}@anchor{reducer action}@anchor{69}
   3135 
   3136 @float Figure
   3137 
   3138 @image{anastasis-figures/anastasis_reducer_backup,,,fig-anastasis_reducer_backup,png}
   3139 
   3140 @caption{Backup states and their transitions.}
   3141 
   3142 @end float
   3143 
   3144 
   3145 The illustration above shows the different states the reducer can have during a backup
   3146 process.
   3147 
   3148 @node Recovery Reducer,Reducer transitions,Backup Reducer,Reducer API
   3149 @anchor{reducer recovery-reducer}@anchor{6c}
   3150 @subsection Recovery Reducer
   3151 
   3152 
   3153 
   3154 @float Figure
   3155 
   3156 @image{anastasis-figures/anastasis_reducer_recovery,,,fig-anastasis_reducer_recovery,png}
   3157 
   3158 @caption{Recovery states and their transitions.}
   3159 
   3160 @end float
   3161 
   3162 
   3163 The illustration above shows the different states the reducer can have during a recovery
   3164 process.
   3165 
   3166 @node Reducer transitions,,Recovery Reducer,Reducer API
   3167 @anchor{reducer reducer-transitions}@anchor{6d}
   3168 @subsection Reducer transitions
   3169 
   3170 
   3171 In the following, the individual transitions will be specified in more detail.
   3172 Note that we only show fields added by the reducer, typically the previous
   3173 state is preserved to enable “back” transitions to function smoothly.
   3174 
   3175 @menu
   3176 * Initial state:: 
   3177 * Common transitions:: 
   3178 * Backup transitions:: 
   3179 * Recovery transitions:: 
   3180 
   3181 @end menu
   3182 
   3183 @node Initial state,Common transitions,,Reducer transitions
   3184 @anchor{reducer initial-state}@anchor{6e}
   3185 @subsubsection Initial state
   3186 
   3187 
   3188 The initial states for backup and recovery processes are:
   3189 
   3190 @strong{Initial backup state:}
   3191 
   3192 @example
   3193 @{
   3194   "backup_state": "CONTINENT_SELECTING",
   3195   "continents": [
   3196     "Europe",
   3197     "North America"
   3198   ]
   3199 @}
   3200 @end example
   3201 
   3202 @strong{Initial recovery state:}
   3203 
   3204 @example
   3205 @{
   3206   "recovery_state": "CONTINENT_SELECTING",
   3207   "continents": [
   3208     "Europe",
   3209     "North America"
   3210   ]
   3211 @}
   3212 @end example
   3213 
   3214 Here, “continents” is an array of English strings with the names of the
   3215 continents which contain countries for which Anastasis could function (based
   3216 on having providers that are known to operate and rules being provided for
   3217 user attributes from those countries).
   3218 
   3219 For internationalization, another field @code{continents_i18n} may be present.
   3220 This field would be a map of language names to arrays of translated
   3221 continent names:
   3222 
   3223 @example
   3224 @{
   3225   "recovery_state": "CONTINENT_SELECTING",
   3226   "continents": [
   3227     "Europe",
   3228     "North America"
   3229   ]
   3230   "continents_i18n":
   3231   @{
   3232     "de_DE" : [
   3233       "Europa",
   3234       "Nordamerika"
   3235       ],
   3236     "de_CH" : [
   3237       "Europa",
   3238       "Nordamerika"
   3239       ]
   3240   @}
   3241 @}
   3242 @end example
   3243 
   3244 Translations must be given in the same order as the main English array.
   3245 
   3246 @node Common transitions,Backup transitions,Initial state,Reducer transitions
   3247 @anchor{reducer common-transitions}@anchor{6f}
   3248 @subsubsection Common transitions
   3249 
   3250 
   3251 @strong{select_continent:}
   3252 
   3253 Here the user specifies the continent they live on.  Arguments (example):
   3254 
   3255 @example
   3256 @{
   3257   "continent": "Europe"
   3258 @}
   3259 @end example
   3260 
   3261 The continent must be given using the English name from the @code{continents} array.
   3262 Using a translated continent name is invalid and may result in failure.
   3263 
   3264 The reducer returns an updated state with a list of countries to choose from,
   3265 for example:
   3266 
   3267 @example
   3268 @{
   3269   "backup_state": "COUNTRY_SELECTING",
   3270   "selected_continent": "Europe",
   3271   "countries": [
   3272     @{
   3273       "code": "ch",
   3274       "name": "Switzerland",
   3275       "continent": "Europe",
   3276       "name_i18n": @{
   3277         "de_DE": "Schweiz",
   3278         "de_CH": "Schwiiz",
   3279         "fr": "Suisse",
   3280         "en": "Swiss"
   3281       @},
   3282       "currency": "CHF"
   3283     @},
   3284     @{
   3285       "code": "de",
   3286       "name": "Germany",
   3287       "continent": "Europe",
   3288       "continent_i18n": @{
   3289         "de": "Europa"
   3290       @},
   3291       "name_i18n": @{
   3292         "de_DE": "Deutschland",
   3293         "de_CH": "Deutschland",
   3294         "fr": "Allemagne",
   3295         "en": "Germany"
   3296       @},
   3297       "currency": "EUR"
   3298     @}
   3299   ]
   3300 @}
   3301 @end example
   3302 
   3303 Here @code{countries} is an array of countries on the @code{selected_continent}.  For
   3304 each country, the @code{code} is the ISO 3166-1 alpha-2 country code.  The
   3305 @code{continent} is only present because some countries span continents, the
   3306 information is redundant and will always match @code{selected_continent}.  The
   3307 @code{name} is the name of the country in English, internationalizations of the
   3308 name may be provided in @code{name_i18n}.  The @code{currency} is @strong{an} official
   3309 currency of the country, if a country has multiple currencies, it may appear
   3310 multiple times in the list.  In this case, the user should select the entry
   3311 with the currency they intend to pay with.  It is also possible for users
   3312 to select a currency that does not match their country, but user interfaces
   3313 should by default try to use currencies that match the user’s residence.
   3314 
   3315 @strong{select_country:}
   3316 
   3317 Selects the country (via the country code) and specifies the currency.
   3318 The latter is needed as some countries have more than one currency,
   3319 and some use-cases may also involve users insisting on paying with
   3320 foreign currency.
   3321 
   3322 Arguments (example):
   3323 
   3324 @example
   3325 @{
   3326   "country_code": "de",
   3327   "currency": "EUR"
   3328 @}
   3329 @end example
   3330 
   3331 The @code{country_code} must be an ISO 3166-1 alpha-2 country code from
   3332 the array of @code{countries} of the reducer’s state.  The @code{currency}
   3333 field must be a valid currency accepted by the Taler payment system.
   3334 
   3335 The reducer returns a new state with the list of attributes the
   3336 user is expected to provide, as well as possible authentication
   3337 providers that accept payments in the selected currency:
   3338 
   3339 @example
   3340 @{
   3341   "backup_state": "USER_ATTRIBUTES_COLLECTING",
   3342   "selected_country": "de",
   3343   "currency": "EUR",
   3344   "required_attributes": [
   3345     @{
   3346       "type": "string",
   3347       "name": "full_name",
   3348       "label": "Full name",
   3349       "label_i18n": @{
   3350         "de_DE": "Vollstaendiger Name",
   3351         "de_CH": "Vollstaendiger. Name",
   3352         "fr": "Nom complet",
   3353         "en": "Full name"
   3354       @},
   3355       "widget": "anastasis_gtk_ia_full_name",
   3356       "uuid" : "9e8f463f-575f-42cb-85f3-759559997331"
   3357     @},
   3358     @{
   3359       "type": "date",
   3360       "name": "birthdate",
   3361       "label": "Birthdate",
   3362       "label_i18n": @{
   3363         "de_DE": "Geburtsdatum",
   3364         "de_CH": "Geburtsdatum",
   3365         "fr": "Date de naissance",
   3366         "en": "Birthdate"
   3367       @},
   3368       "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854"
   3369       "widget": "anastasis_gtk_ia_birthdate"
   3370     @},
   3371         @{
   3372            "type": "string",
   3373            "name": "tax_number",
   3374            "label": "Taxpayer identification number",
   3375            "label_i18n":@{
   3376                  "de_DE": "Steuerliche Identifikationsnummer",
   3377                  "de_CH": "Steuerliche Identifikationsnummer",
   3378                  "en": "German taxpayer identification number"
   3379            @},
   3380            "widget": "anastasis_gtk_ia_tax_de",
   3381            "uuid": "dae48f85-e3ff-47a4-a4a3-ed981ed8c3c6",
   3382            "validation-regex": "^[0-9]@{11@}$",
   3383            "validation-logic": "DE_TIN_check"
   3384         @},
   3385     @{
   3386       "type": "string",
   3387       "name": "social_security_number",
   3388       "label": "Social security number",
   3389       "label_i18n": @{
   3390         "de_DE": "Sozialversicherungsnummer",
   3391         "de_CH": "Sozialversicherungsnummer",
   3392         "fr": "Numéro de sécurité sociale",
   3393         "en": "Social security number"
   3394       @},
   3395       "widget": "anastasis_gtk_ia_ssn",
   3396       "validation-regex": "^[0-9]@{8@}[[:upper:]][0-9]@{3@}$",
   3397       "validation-logic": "DE_SVN_check"
   3398       "optional" : true
   3399   @}
   3400   ],
   3401   "authentication_providers": @{
   3402     "http://localhost:8089/": @{
   3403       "http_status": 200,
   3404       "methods": [
   3405         @{ "type" : "question",
   3406           "usage_fee" : "EUR:0.0" @},
   3407         @{ "type" : "sms",
   3408           "usage_fee" : "EUR:0.5" @}
   3409       ],
   3410       "annual_fee": "EUR:4.99",
   3411       "truth_upload_fee": "EUR:4.99",
   3412       "liability_limit": "EUR:1",
   3413       "currency": "EUR",
   3414       "truth_lifetime": @{ "d_ms" : 50000000 @},
   3415       "storage_limit_in_megabytes": 1,
   3416       "provider_name": "Anastasis 4",
   3417       "salt": "CXAPCKSH9D3MYJTS9536RHJHCW"
   3418     @},
   3419     "http://localhost:8088/": @{
   3420       "http_status": 200,
   3421       "methods": [
   3422         @{ "type" : "question",
   3423           "usage_fee" : "EUR:0.01" @},
   3424         @{ "type" : "sms",
   3425           "usage_fee" : "EUR:0.55" @}
   3426       ],
   3427       "annual_fee": "EUR:0.99",
   3428       "truth_upload_fee": "EUR:3.99",
   3429       "liability_limit": "EUR:1",
   3430       "currency": "EUR",
   3431       "truth_lifetime": @{ "d_ms" : 50000000 @},
   3432       "storage_limit_in_megabytes": 1,
   3433       "provider_name": "Anastasis 4",
   3434       "salt": "CXAPCKSH9D3MYJTS9536RHJHCW"
   3435     @}
   3436   @}
   3437 @}
   3438 @end example
   3439 
   3440 The array of @code{required_attributes} contains attributes about the user
   3441 that must be provided includes:
   3442 
   3443 @quotation
   3444 
   3445 
   3446 @itemize -
   3447 
   3448 @item 
   3449 @strong{type}: The type of the attribute, for now only @code{string} and @code{date} are
   3450 supported.
   3451 
   3452 @item 
   3453 @strong{name}: The name of the attribute, this is the key under which the
   3454 attribute value must be provided later. The name must be unique per response.
   3455 
   3456 @item 
   3457 @strong{label}: A human-readable description of the attribute in English.
   3458 Translated descriptions may be provided under @strong{label_i18n}.
   3459 
   3460 @item 
   3461 @strong{uuid}: A UUID that uniquely identifies identical attributes across
   3462 different countries. Useful to preserve values should the user enter
   3463 some attributes, and then switch to another country.  Note that
   3464 attributes must not be preserved if they merely have the same @strong{name},
   3465 only the @strong{uuid} will be identical if the semantics is identical.
   3466 
   3467 @item 
   3468 @strong{widget}: An optional name of a widget that is known to nicely render
   3469 the attribute entry in user interfaces where named widgets are
   3470 supported.
   3471 
   3472 @item 
   3473 @strong{validation-regex}: An optional extended POSIX regular expression
   3474 that is to be used to validate (string) inputs to ensure they are
   3475 well-formed.
   3476 
   3477 @item 
   3478 @strong{validation-logic}: Optional name of a function that should be called
   3479 to validate the input.  If the function is not known to the particular
   3480 client, the respective validation can be skipped (at the expense of
   3481 typos by users not being detected, possibly rendering secrets
   3482 irrecoverable).
   3483 
   3484 @item 
   3485 @strong{optional}: Optional boolean field that, if @code{true}, indicates that
   3486 this attribute is not actually required but optional and users MAY leave
   3487 it blank in case they do not have the requested information. Used for
   3488 common fields that apply to some large part of the population but are
   3489 not sufficiently universal to be actually required.
   3490 @end itemize
   3491 @end quotation
   3492 
   3493 The authentication providers are listed under a key that is the
   3494 base URL of the service. For each provider, the following
   3495 information is provided if the provider was successfully contacted:
   3496 
   3497 @quotation
   3498 
   3499 
   3500 @itemize -
   3501 
   3502 @item 
   3503 @strong{http_status}: HTTP status code, always @code{200} on success.
   3504 
   3505 @item 
   3506 @strong{methods}: Array of authentication methods supported by this
   3507 provider. Includes the @strong{type} of the authentication method
   3508 and the @strong{usage_fee} (how much the user must pay for authorization
   3509 using this method during recovery).
   3510 
   3511 @item 
   3512 @strong{annual_fee}: Fee the provider charges to store the recovery
   3513 policy for one year.
   3514 
   3515 @item 
   3516 @strong{truth_upload_fee}: Fee the provider charges to store a key share.
   3517 
   3518 @item 
   3519 @strong{liability_limit}: Amount the provider can be held liable for in
   3520 case a key share or recovery document cannot be recovered due to
   3521 provider failures.
   3522 
   3523 @item 
   3524 @strong{currency}: Currency in which the provider wants to be paid,
   3525 will match all of the fees.
   3526 
   3527 @item 
   3528 @strong{storage_limit_in_megabytes}: Maximum size of an upload (for
   3529 both recovery document and truth data) in megabytes.
   3530 
   3531 @item 
   3532 @strong{provider_name}: Human-readable name of the provider’s business.
   3533 
   3534 @item 
   3535 @strong{salt}: Salt value used by the provider, used to derive the
   3536 user’s identity at this provider. Should be unique per provider,
   3537 and must never change for a given provider.  The salt is
   3538 base32 encoded.
   3539 @end itemize
   3540 @end quotation
   3541 
   3542 If contacting the provider failed, the information returned is:
   3543 
   3544 @quotation
   3545 
   3546 
   3547 @itemize -
   3548 
   3549 @item 
   3550 @strong{http_status}: HTTP status code (if available, possibly 0 if
   3551 we did not even obtain an HTTP response).
   3552 
   3553 @item 
   3554 @strong{error_code}: Taler error code, never 0.
   3555 @end itemize
   3556 @end quotation
   3557 
   3558 @strong{add_provider}:
   3559 
   3560 This operation can be performed in state @code{USER_ATTRIBUTES_COLLECTING}.
   3561 It
   3562 adds one or more Anastasis providers to the list of providers the reducer
   3563 should henceforth consider.  Note that removing providers is not possible at
   3564 this time.
   3565 
   3566 Here, the client must provide an object with the base URLs of the
   3567 providers to add or disable. The object maps the
   3568 URLs to status information about the provider to
   3569 use. For example:
   3570 
   3571 @example
   3572 @{
   3573   "http://localhost:8088/" : @{ "disabled" : false @},
   3574   "http://localhost:8089/" : @{ "disabled" : false @},
   3575   "http://localhost:8090/" : @{ "disabled" : true @}
   3576 @}
   3577 @end example
   3578 
   3579 Note that existing providers will remain in the state they were in.  The following is an
   3580 example for an expected new state where the service on port 8089 is
   3581 unreachable, the services on port 8088 and 8888 were previously known, and service on
   3582 port 8088 was now added, and on 8090 is disabled:
   3583 
   3584 @example
   3585 @{
   3586   "backup_state": "USER_ATTRIBUTES_COLLECTING",
   3587   "authentication_providers": @{
   3588     "http://localhost:8089/": @{
   3589       "disabled": false,
   3590       "error_code": 11,
   3591       "http_status": 0
   3592     @},
   3593     "http://localhost:8090/": @{
   3594       "disabled": true
   3595     @},
   3596     "http://localhost:8088/": @{
   3597       "disabled": false,
   3598       "http_status": 200,
   3599       "methods": [
   3600         @{ "type" : "question",
   3601           "usage_fee" : "EUR:0.01" @},
   3602         @{ "type" : "sms",
   3603           "usage_fee" : "EUR:0.55" @}
   3604       ],
   3605       "annual_fee": "EUR:0.99",
   3606       "truth_upload_fee": "EUR:3.99",
   3607       "liability_limit": "EUR:1",
   3608       "currency": "EUR",
   3609       "truth_lifetime": @{ "d_ms" : 50000000 @},
   3610       "storage_limit_in_megabytes": 1,
   3611       "provider_name": "Anastasis 4",
   3612       "salt": "CXAPCKSH9D3MYJTS9536RHJHCW"
   3613     @}
   3614     "http://localhost:8888/": @{
   3615       "methods": [
   3616         @{ "type" : "question",
   3617           "usage_fee" : "EUR:0.01" @},
   3618         @{ "type" : "sms",
   3619           "usage_fee" : "EUR:0.55" @}
   3620       ],
   3621       "annual_fee": "EUR:0.99",
   3622       "truth_upload_fee": "EUR:3.99",
   3623       "liability_limit": "EUR:1",
   3624       "currency": "EUR",
   3625       "truth_lifetime": @{ "d_ms" : 50000000 @},
   3626       "storage_limit_in_megabytes": 1,
   3627       "provider_name": "Anastasis 42",
   3628       "salt": "BXAPCKSH9D3MYJTS9536RHJHCX"
   3629     @}
   3630   @}
   3631 @}
   3632 @end example
   3633 
   3634 @node Backup transitions,Recovery transitions,Common transitions,Reducer transitions
   3635 @anchor{reducer backup-transitions}@anchor{70}
   3636 @subsubsection Backup transitions
   3637 
   3638 
   3639 @strong{enter_user_attributes:}
   3640 
   3641 This transition provides the user’s personal attributes. The specific set of
   3642 attributes required depends on the country of residence of the user.  Some
   3643 attributes may be optional, in which case they should be omitted entirely
   3644 (that is, not simply be set to @code{null} or an empty string).  Example
   3645 arguments would be:
   3646 
   3647 @example
   3648 @{
   3649   "identity_attributes": @{
   3650     "full_name": "Max Musterman",
   3651     "social_security_number": "123456789",
   3652     "birthdate": "2000-01-01",
   3653     "birthplace": "Earth"
   3654  @}
   3655 @}
   3656 @end example
   3657 
   3658 Note that at this stage, the state machines between backup and
   3659 recovery diverge and the @code{recovery_state} will begin to look
   3660 very different from the @code{backup_state}.
   3661 
   3662 For backups, if all required attributes are present, the reducer will
   3663 transition to an @code{AUTHENTICATIONS_EDITING} state with the attributes added
   3664 to it:
   3665 
   3666 @example
   3667 @{
   3668   "backup_state": "AUTHENTICATIONS_EDITING",
   3669   "identity_attributes": @{
   3670     "full_name": "Max Musterman",
   3671     "social_security_number": "123456789",
   3672     "birthdate": "2000-01-01",
   3673     "birthplace": "Earth"
   3674   @}
   3675 @}
   3676 @end example
   3677 
   3678 If required attributes are missing, do not match the required regular
   3679 expression, or fail the custom validation logic, the reducer SHOULD return an
   3680 error response indicating that the transition has failed and what is wrong about
   3681 the input and not transition to a new state.  A reducer that does not support
   3682 some specific validation logic MAY accept the invalid input and proceed anyway.
   3683 The error state will include a Taler error code that is specific to the
   3684 failure, and optional details.
   3685 
   3686 Example:
   3687 
   3688 @example
   3689 @{
   3690   "code": 8404,
   3691   "hint": "An input did not match the regular expression.",
   3692   "detail": "social_security_number"
   3693 @}
   3694 @end example
   3695 
   3696 Clients may safely repeat this transition to validate the user’s inputs
   3697 until they satisfy all of the constraints.  This way, the user interface
   3698 does not have to perform the input validation directly.
   3699 
   3700 @strong{add_authentication}:
   3701 
   3702 This transition adds an authentication method.  The method must be supported
   3703 by one or more providers that are included in the current state.  Adding an
   3704 authentication method requires specifying the @code{type} and @code{instructions} to
   3705 be given to the user.  The @code{challenge} is encrypted and stored at the
   3706 Anastasis provider. The specific semantics of the value depend on the
   3707 @code{type}.  Typical challenges values are a phone number (to send an SMS to),
   3708 an e-mail address (to send a PIN code to) or the answer to a security
   3709 question.  Note that these challenge values will still be encrypted (and
   3710 possibly hashed) before being given to the Anastasis providers.
   3711 
   3712 Note that the @code{challenge} must be given in Crockford Base32 encoding, as it
   3713 MAY include binary data (such as a photograph of the user).  In the latter
   3714 case, the optional @code{mime_type} field must be provided to give the MIME type
   3715 of the value encoded in @code{challenge}.
   3716 
   3717 @example
   3718 @{
   3719   "authentication_method":
   3720   @{
   3721     "type": "question",
   3722     "mime_type" : "text/plain",
   3723     "instructions" : "What is your favorite GNU package?",
   3724     "challenge" : "E1QPPS8A",
   3725   @}
   3726 @}
   3727 @end example
   3728 
   3729 If the information provided is valid, the reducer will add the new
   3730 authentication method to the array of authentication methods:
   3731 
   3732 @example
   3733 @{
   3734   "backup_state": "AUTHENTICATIONS_EDITING",
   3735   "authentication_methods": [
   3736     @{
   3737       "type": "question",
   3738       "mime_type" : "text/plain",
   3739       "instructions" : "What is your favorite GNU package?",
   3740       "challenge" : "E1QPPS8A",
   3741     @},
   3742     @{
   3743       "type": "email",
   3744       "instructions" : "E-mail to user@@*le.com",
   3745       "challenge": "ENSPAWJ0CNW62VBGDHJJWRVFDM50"
   3746     @}
   3747   ]
   3748 @}
   3749 @end example
   3750 
   3751 @strong{delete_authentication}:
   3752 
   3753 This transition can be used to remove an authentication method from the
   3754 array of authentication methods. It simply requires the index of the
   3755 authentication method to remove. Note that the array is 0-indexed:
   3756 
   3757 @example
   3758 @{
   3759   "authentication_method": 1
   3760 @}
   3761 @end example
   3762 
   3763 Assuming we begin with the state from the example above, this would
   3764 remove the @code{email} authentication method, resulting in the following
   3765 response:
   3766 
   3767 @example
   3768 @{
   3769   "backup_state": "AUTHENTICATIONS_EDITING",
   3770   "authentication_methods": [
   3771     @{
   3772       "type": "question",
   3773       "mime_type" : "text/plain",
   3774       "instructions" : "What is your favorite GNU package?",
   3775       "challenge" : "gdb",
   3776     @}
   3777   ]
   3778 @}
   3779 @end example
   3780 
   3781 If the index is invalid, the reducer will return an error
   3782 response instead of making a transition.
   3783 
   3784 @strong{next} (from @code{AUTHENTICATIONS_EDITING}):
   3785 
   3786 This transition confirms that the user has finished adding (or removing)
   3787 authentication methods, and that the system should now automatically compute
   3788 a set of reasonable recovery policies.
   3789 
   3790 This transition does not take any mandatory arguments.  Optional arguments can
   3791 be provided to upload the recovery document only to a specific subset of the
   3792 providers:
   3793 
   3794 @example
   3795 @{
   3796   "providers": [
   3797     "http://localhost:8088/",
   3798     "http://localhost:8089/"
   3799   ]
   3800 @}
   3801 @end example
   3802 
   3803 The resulting state provides the suggested recovery policies in a way suitable
   3804 for presentation to the user:
   3805 
   3806 @example
   3807 @{
   3808   "backup_state": "POLICIES_REVIEWING",
   3809   "policy_providers" : [
   3810       @{ "provider_url" : "http://localhost:8088/" @},
   3811       @{ "provider_url" : "http://localhost:8089/" @}
   3812   ],
   3813   "policies": [
   3814     @{
   3815       "methods": [
   3816         @{
   3817           "authentication_method": 0,
   3818           "provider": "http://localhost:8088/"
   3819         @},
   3820         @{
   3821           "authentication_method": 1,
   3822           "provider": "http://localhost:8089/"
   3823         @},
   3824         @{
   3825           "authentication_method": 2,
   3826           "provider": "http://localhost:8087/"
   3827         @}
   3828       ]
   3829     @},
   3830     @{
   3831       "methods": [
   3832         @{
   3833           "authentication_method": 0,
   3834           "provider": "http://localhost:8088/"
   3835         @},
   3836         @{
   3837           "authentication_method": 1,
   3838           "provider": "http://localhost:8089/"
   3839         @},
   3840         @{
   3841           "authentication_method": 3,
   3842           "provider": "http://localhost:8089/"
   3843         @}
   3844       ]
   3845     @}
   3846   ]
   3847 @}
   3848 @end example
   3849 
   3850 For each recovery policy, the state includes the specific details of which
   3851 authentication @code{methods} must be solved to recovery the secret using this
   3852 policy.  The @code{methods} array specifies the index of the
   3853 @code{authentication_method} in the @code{authentication_methods} array, as well as
   3854 the provider that was selected to supervise this authentication.
   3855 
   3856 If no authentication method was provided, the reducer will
   3857 return an error response instead of making a transition.
   3858 
   3859 @strong{add_policy}:
   3860 
   3861 Using this transition, the user can add an additional recovery policy to the
   3862 state.  The argument format is the same that is used in the existing state.
   3863 An example for a possible argument would thus be:
   3864 
   3865 @example
   3866 @{
   3867   "policy": [
   3868     @{
   3869       "authentication_method": 1,
   3870       "provider": "http://localhost:8088/"
   3871     @},
   3872     @{
   3873       "authentication_method": 3,
   3874       "provider": "http://localhost:8089/"
   3875     @}
   3876   ]
   3877 @}
   3878 @end example
   3879 
   3880 Note that the specified providers must already be in the
   3881 @code{authentication_providers} of the state. You cannot add new providers at
   3882 this stage.  The reducer will simply attempt to append the suggested policy to
   3883 the “policies” array, returning an updated state:
   3884 
   3885 @example
   3886 @{
   3887   "backup_state": "POLICIES_REVIEWING",
   3888   "policies": [
   3889     @{
   3890       "methods": [
   3891         @{
   3892           "authentication_method": 0,
   3893           "provider": "http://localhost:8089/"
   3894         @},
   3895         @{
   3896           "authentication_method": 1,
   3897           "provider": "http://localhost:8088/"
   3898         @}
   3899       ]
   3900     @},
   3901     @{
   3902       "methods": [
   3903         @{
   3904           "authentication_method": 0,
   3905           "provider": "http://localhost:8089/"
   3906         @},
   3907         @{
   3908           "authentication_method": 2,
   3909           "provider": "http://localhost:8088/"
   3910         @}
   3911       ]
   3912     @},
   3913     @{
   3914       "methods": [
   3915         @{
   3916           "authentication_method": 1,
   3917           "provider": "http://localhost:8089/"
   3918         @},
   3919         @{
   3920           "authentication_method": 2,
   3921           "provider": "http://localhost:8088/"
   3922         @}
   3923       ]
   3924     @},
   3925     @{
   3926       "methods": [
   3927         @{
   3928           "authentication_method": 1,
   3929           "provider": "http://localhost:8088/"
   3930         @},
   3931         @{
   3932           "authentication_method": 3,
   3933           "provider": "http://localhost:8089/"
   3934         @}
   3935       ]
   3936     @}
   3937   ]
   3938 @}
   3939 @end example
   3940 
   3941 If the new policy is invalid, for example because it adds an unknown
   3942 authentication method, or the selected provider does not support the type of
   3943 authentication, the reducer return an error response instead of
   3944 adding the new policy.
   3945 
   3946 @strong{update_policy}:
   3947 
   3948 Using this transition, the user can modify an existing recovery policy
   3949 in the state.
   3950 The argument format is the same that is used in @strong{add_policy},
   3951 except there is an additional key @code{policy_index} which
   3952 identifies the policy to modify.
   3953 An example for a possible argument would thus be:
   3954 
   3955 @example
   3956 @{
   3957   "policy_index" : 1,
   3958   "policy": [
   3959     @{
   3960       "authentication_method": 1,
   3961       "provider": "http://localhost:8088/"
   3962     @},
   3963     @{
   3964       "authentication_method": 3,
   3965       "provider": "http://localhost:8089/"
   3966     @}
   3967   ]
   3968 @}
   3969 @end example
   3970 
   3971 If the new policy is invalid, for example because it adds an unknown
   3972 authentication method, or the selected provider does not support the type of
   3973 authentication, the reducer will return an error response instead of
   3974 modifying the policy.
   3975 
   3976 @strong{delete_policy:}
   3977 
   3978 This transition allows the deletion of a recovery policy. The argument
   3979 simply specifies the index of the policy to delete, for example:
   3980 
   3981 @example
   3982 @{
   3983   "policy_index": 3
   3984 @}
   3985 @end example
   3986 
   3987 Given as input the state from the example above, the expected new state would
   3988 be:
   3989 
   3990 @example
   3991 @{
   3992   "backup_state": "POLICIES_REVIEWING",
   3993   "policies": [
   3994     @{
   3995       "methods": [
   3996         @{
   3997           "authentication_method": 0,
   3998           "provider": "http://localhost:8089/"
   3999         @},
   4000         @{
   4001           "authentication_method": 1,
   4002           "provider": "http://localhost:8088/"
   4003         @}
   4004       ]
   4005     @},
   4006     @{
   4007       "methods": [
   4008         @{
   4009           "authentication_method": 0,
   4010           "provider": "http://localhost:8089/"
   4011         @},
   4012         @{
   4013           "authentication_method": 2,
   4014           "provider": "http://localhost:8088/"
   4015         @}
   4016       ]
   4017     @},
   4018     @{
   4019       "methods": [
   4020         @{
   4021           "authentication_method": 1,
   4022           "provider": "http://localhost:8089/"
   4023         @},
   4024         @{
   4025           "authentication_method": 2,
   4026           "provider": "http://localhost:8088/"
   4027         @}
   4028       ]
   4029     @}
   4030   ]
   4031 @}
   4032 @end example
   4033 
   4034 If the index given is invalid, the reducer will return an error response
   4035 instead of deleting a policy.
   4036 
   4037 @strong{delete_challenge:}
   4038 
   4039 This transition allows the deletion of an individual
   4040 challenge from a recovery policy. The argument
   4041 simply specifies the index of the policy and challenge
   4042 to delete, for example:
   4043 
   4044 @example
   4045 @{
   4046   "policy_index": 1,
   4047   "challenge_index" : 1
   4048 @}
   4049 @end example
   4050 
   4051 Given as input the state from the example above, the expected new state would
   4052 be:
   4053 
   4054 @example
   4055 @{
   4056   "backup_state": "POLICIES_REVIEWING",
   4057   "policies": [
   4058     @{
   4059       "methods": [
   4060         @{
   4061           "authentication_method": 0,
   4062           "provider": "http://localhost:8089/"
   4063         @},
   4064         @{
   4065           "authentication_method": 1,
   4066           "provider": "http://localhost:8088/"
   4067         @}
   4068       ]
   4069     @},
   4070     @{
   4071       "methods": [
   4072         @{
   4073           "authentication_method": 0,
   4074           "provider": "http://localhost:8089/"
   4075         @}
   4076       ]
   4077     @},
   4078     @{
   4079       "methods": [
   4080         @{
   4081           "authentication_method": 1,
   4082           "provider": "http://localhost:8089/"
   4083         @},
   4084         @{
   4085           "authentication_method": 2,
   4086           "provider": "http://localhost:8088/"
   4087         @}
   4088       ]
   4089     @}
   4090   ]
   4091 @}
   4092 @end example
   4093 
   4094 If the index given is invalid, the reducer will return an error response
   4095 instead of deleting a challenge.
   4096 
   4097 @strong{next} (from @code{POLICIES_REVIEWING}):
   4098 
   4099 Using this transition, the user confirms that the policies in the current
   4100 state are acceptable. The transition does not take any arguments.
   4101 
   4102 The reducer will simply transition to the @code{SECRET_EDITING} state:
   4103 
   4104 @example
   4105 @{
   4106   "backup_state": "SECRET_EDITING",
   4107   "upload_fees" : [ @{ "fee": "KUDOS:42" @} ],
   4108   "expiration" : @{ "t_ms" : 1245362362 @}
   4109 @}
   4110 @end example
   4111 
   4112 Here, @code{upload_fees} is an array of applicable upload fees for the
   4113 given policy expiration time. This is an array because fees could
   4114 be in different currencies.  The final cost may be lower if the
   4115 user already paid for some of the time.
   4116 
   4117 If the array of @code{policies} is currently empty, the reducer will
   4118 return an error response instead of allowing the user to continue.
   4119 
   4120 @strong{enter_secret:}
   4121 
   4122 This transition provides the reducer with the actual core @code{secret} of the user
   4123 that Anastasis is supposed to backup (and possibly recover). The argument is
   4124 simply the Crockford-Base32 encoded @code{value} together with its @code{mime} type, or a @code{text} field with a human-readable secret text.
   4125 For example:
   4126 
   4127 @example
   4128 @{
   4129   "secret": @{
   4130      "value": "EDJP6WK5EG50",
   4131      "mime" : "text/plain"
   4132   @},
   4133   "expiration" : @{ "t_ms" : 1245362362 @}
   4134 @}
   4135 @end example
   4136 
   4137 If the application is unaware of the format, it set the @code{mime} field to @code{null}.
   4138 The @code{expiration} field is optional.
   4139 
   4140 The reducer remains in the @code{SECRET_EDITING} state, but now the secret and
   4141 updated expiration time are part of the state and the cost calculations will
   4142 be updated.
   4143 
   4144 @example
   4145 @{
   4146   "backup_state": "SECRET_EDITING",
   4147   "core_secret" : @{
   4148      "value": "EDJP6WK5EG50",
   4149      "mime" : "text/plain"
   4150   @},
   4151   "expiration" : @{ "t_ms" : 1245362362 @},
   4152   "upload_fees" : [ @{ "fee": "KUDOS:42" @} ]
   4153 @}
   4154 @end example
   4155 
   4156 @strong{clear_secret:}
   4157 
   4158 This transition removes the core secret from the state.  It is simply a
   4159 convenience function to undo @code{enter_secret} without providing a new value
   4160 immediately. The transition takes no arguments.  The resuting state will no
   4161 longer have the @code{core_secret} field, and be otherwise unchanged. Calling
   4162 @strong{clear_secret} on a state without a @code{core_secret} will result in an error.
   4163 
   4164 @strong{enter_secret_name:}
   4165 
   4166 This transition provides the reducer with a name for the core @code{secret} of the user. This name will be given to the user as a hint when seleting a recovery policy document during recovery, prior to satisfying any of the challenges. The argument simply contains the name for the secret.
   4167 Applications that have built-in support for Anastasis MUST prefix the
   4168 secret name with an underscore and an application-specific identifier
   4169 registered in GANA so that they can use recognize their own backups.
   4170 An example argument would be:
   4171 
   4172 @example
   4173 @{
   4174   "name": "_TALERWALLET_MyPinePhone",
   4175 @}
   4176 @end example
   4177 
   4178 Here, @code{MyPinePhone} might be chosen by the user to identify the
   4179 device that was being backed up.
   4180 
   4181 The reducer remains in the @code{SECRET_EDITING} state, but now the
   4182 secret name is updated:
   4183 
   4184 @example
   4185 @{
   4186   "secret_name" : "_TALERWALLET_MyPinePhone"
   4187 @}
   4188 @end example
   4189 
   4190 @strong{update_expiration:}
   4191 
   4192 This transition asks the reducer to change the desired expiration time
   4193 and to update the associated cost. For example:
   4194 
   4195 @example
   4196 @{
   4197   "expiration" : @{ "t_ms" : 1245362362 @}
   4198 @}
   4199 @end example
   4200 
   4201 The reducer remains in the @code{SECRET_EDITING} state, but the
   4202 expiration time and cost calculation will be updated.
   4203 
   4204 @example
   4205 @{
   4206   "backup_state": "SECRET_EDITING",
   4207   "expiration" : @{ "t_ms" : 1245362362 @},
   4208   "upload_fees" : [ @{ "fee": "KUDOS:43" @} ]
   4209 @}
   4210 @end example
   4211 
   4212 @strong{next} (from @code{SECRET_EDITING}):
   4213 
   4214 Using this transition, the user confirms that the secret and expiration
   4215 settings in the current state are acceptable. The transition does not take any
   4216 arguments.
   4217 
   4218 If the secret is currently empty, the reducer will return an
   4219 error response instead of allowing the user to continue.
   4220 
   4221 After adding a secret, the reducer may transition into different states
   4222 depending on whether payment(s) are necessary.  If payments are needed, the
   4223 @code{secret} will be stored in the state under @code{core_secret}.  Applications
   4224 should be careful when persisting the resulting state, as the @code{core_secret}
   4225 is not protected in the @code{PAYING} states.  The @code{PAYING} states only differ
   4226 in terms of what the payments are for (key shares or the recovery document),
   4227 in all cases the state simply includes an array of Taler URIs that refer to
   4228 payments that need to be made with the Taler wallet.
   4229 
   4230 If all payments are complete, the reducer will transition into the
   4231 @code{BACKUP_FINISHED} state and (if applicable) delete the @code{core_secret} as an
   4232 additional safety measure.
   4233 
   4234 Example results are thus:
   4235 
   4236 @example
   4237 @{
   4238   "backup_state": "TRUTHS_PAYING",
   4239   "secret_name" : "$NAME",
   4240   "core_secret" : @{ "$anything":"$anything" @},
   4241   "payments": [
   4242     "taler://pay/...",
   4243     "taler://pay/..."
   4244   ]
   4245 @}
   4246 @end example
   4247 
   4248 @example
   4249 @{
   4250   "backup_state": "POLICIES_PAYING",
   4251   "secret_name" : "$NAME",
   4252   "core_secret" : @{ "$anything":"$anything" @},
   4253   "payments": [
   4254     "taler://pay/...",
   4255     "taler://pay/..."
   4256   ]
   4257 @}
   4258 @end example
   4259 
   4260 @example
   4261 @{
   4262   "backup_state": "BACKUP_FINISHED",
   4263   "success_details": @{
   4264     "http://localhost:8080/" : @{
   4265       "policy_version" : 1,
   4266       "policy_expiration" : @{ "t_ms" : 1245362362000 @}
   4267     @},
   4268     "http://localhost:8081/" : @{
   4269       "policy_version" : 3,
   4270       "policy_expiration" : @{ "t_ms" : 1245362362000 @}
   4271     @}
   4272   @}
   4273 @}
   4274 @end example
   4275 
   4276 @strong{pay:}
   4277 
   4278 This transition suggests to the reducer that a payment may have been made or
   4279 is immanent, and that the reducer should check with the Anastasis service
   4280 provider to see if the operation is now possible.  The operation takes one
   4281 optional argument, which is a @code{timeout} value that specifies how long the
   4282 reducer may wait (in long polling) for the payment to complete:
   4283 
   4284 @example
   4285 @{
   4286   "timeout":  @{ "d_ms" : 5000 @},
   4287 @}
   4288 @end example
   4289 
   4290 The specified timeout is passed on to the Anastasis service provider(s), which
   4291 will wait this long before giving up.  If no timeout is given, the check is
   4292 done as quickly as possible without additional delays.  The reducer will continue
   4293 to either an updated state with the remaining payment requests, to the
   4294 @code{BACKUP_FINISHED} state (if all payments have been completed and the backup
   4295 finished), or return an error response in case there was an irrecoverable error,
   4296 indicating the specific provider and how it failed.  An example for this
   4297 final error state would be:
   4298 
   4299 @example
   4300 @{
   4301   "http_status" : 500,
   4302   "upload_status" : 52,
   4303   "provider_url" : "https://bad.example.com/",
   4304 @}
   4305 @end example
   4306 
   4307 Here, the fields have the following meaning:
   4308 
   4309 @quotation
   4310 
   4311 
   4312 @itemize -
   4313 
   4314 @item 
   4315 @strong{http_status} is the HTTP status returned by the Anastasis provider.
   4316 
   4317 @item 
   4318 @strong{upload_status} is the Taler error code return by the provider.
   4319 
   4320 @item 
   4321 @strong{provider_url} is the base URL of the failing provider.
   4322 @end itemize
   4323 @end quotation
   4324 
   4325 In the above example, 52 would thus imply that the Anastasis provider failed to
   4326 store information into its database.
   4327 
   4328 @node Recovery transitions,,Backup transitions,Reducer transitions
   4329 @anchor{reducer recovery-transitions}@anchor{71}
   4330 @subsubsection Recovery transitions
   4331 
   4332 
   4333 @strong{enter_user_attributes:}
   4334 
   4335 This transition provides the user’s personal attributes. The specific set of
   4336 attributes required depends on the country of residence of the user.  Some
   4337 attributes may be optional, in which case they should be omitted entirely
   4338 (that is, not simply be set to @code{null} or an empty string).  The
   4339 arguments are identical to the @strong{enter_user_attributes} transition from
   4340 the backup process.  Example arguments would thus be:
   4341 
   4342 @example
   4343 @{
   4344   "identity_attributes": @{
   4345     "full_name": "Max Musterman",
   4346     "social_security_number": "123456789",
   4347     "birthdate": "2000-01-01",
   4348     "birthplace": "Earth"
   4349   @}
   4350 @}
   4351 @end example
   4352 
   4353 Afterwards, the reducer transitions into the @code{SECRET_SELECTING} state:
   4354 
   4355 @example
   4356 @{
   4357   "recovery_state": "SECRET_SELECTING",
   4358   "identity_attributes": @{
   4359     "full_name": "Max Musterman",
   4360     "social_security_number": "123456789",
   4361     "birthdate": "2000-01-01",
   4362     "birthplace": "Earth"
   4363   @}
   4364 @}
   4365 @end example
   4366 
   4367 Typically, the special policy discovery process (outside of the state
   4368 machine) is expected to be run in this state.  The discovery process
   4369 will use the state (and in particular the identity attributes and the
   4370 list of active providers) to discover a set of possible recovery
   4371 documents with their respective provider URLs, policy version and
   4372 identity attribute mask. An identity attribute mask is a bitmask that
   4373 describes which of the optional attributes from the identity
   4374 attributes should be omitted to recover this backup.  Once the user
   4375 has selected a backup providing this triplet, it is possible to
   4376 proceed using @code{next}.
   4377 
   4378 Especially if the discovered policies are inadequate, it is again
   4379 possible to add providers using @code{add_provider}.
   4380 
   4381 @strong{add_provider}:
   4382 
   4383 This operation can be performed in state @code{SECRET_SELECTING}.  It
   4384 adds one additional Anastasis provider to the list of providers that
   4385 the discovery process should henceforth consider.  Note that removing
   4386 providers is not possible at this time.
   4387 
   4388 Here, the client must provide an object with the base URL of the
   4389 providers to add, for example:
   4390 
   4391 @example
   4392 @{
   4393   "provider_url" : "http://localhost:8088/"
   4394 @}
   4395 @end example
   4396 
   4397 @strong{select_version}:
   4398 
   4399 Using the @code{select_version} transition in the @code{SECRET_SELECTING} state,
   4400 it is possible to trigger the download and decryption of a recovery
   4401 policy document. Here, the arguments specify which provider, version
   4402 and mask should be used to download the document:
   4403 
   4404 @example
   4405 @{
   4406   "providers" : [ @{
   4407     "url": "https://localhost:8088/",
   4408     "version": 0
   4409   @} ],
   4410   "attribute_mask": 0
   4411 @}
   4412 @end example
   4413 
   4414 The reducer will attempt to retrieve the specified recovery document
   4415 from that provider.  If a recovery document was found, the reducer
   4416 will attempt to load it and transition to a state where the user can
   4417 choose which challenges to satisfy:
   4418 
   4419 @example
   4420 @{
   4421   "recovery_state": "CHALLENGE_SELECTING",
   4422   "recovery_information": @{
   4423     "challenges": [
   4424       @{
   4425         "uuid": "MW2R3RCBZPHNC78AW8AKWRCHF9KV3Y82EN62T831ZP54S3K5599G",
   4426         "uuid-display": "MW2R3RC",
   4427         "type": "question",
   4428         "instructions": "q1"
   4429       @},
   4430       @{
   4431         "uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4432         "uuid-display": "TXYKGE",
   4433         "type": "email",
   4434         "instructions": "e-mail address m?il@@f*.bar"
   4435       @},
   4436     ],
   4437     "policies": [
   4438       [
   4439         @{
   4440           "uuid": "MW2R3RCBZPHNC78AW8AKWRCHF9KV3Y82EN62T831ZP54S3K5599G"
   4441         @},
   4442         @{
   4443           "uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0"
   4444         @},
   4445       ],
   4446     ],
   4447     "provider_url": "http://localhost:8088/",
   4448     "version": 1,
   4449   @},
   4450   "recovery_document": @{
   4451     "...": "..."
   4452   @}
   4453 @}
   4454 @end example
   4455 
   4456 The @code{recovery_document} is an internal representation of the recovery
   4457 information and of no concern to the user interface. The pertinent information
   4458 is in the @code{recovery_information}. Here, the @code{challenges} array is a list
   4459 of possible challenges the user could attempt to solve next, while @code{policies}
   4460 is an array of policies, with each policy being an array of challenges.
   4461 Satisfying all of the challenges of one of the policies will enable the secret
   4462 to be recovered.  The @code{provider_url} from where the recovery document was
   4463 obtained and its @code{version} are also provided.  Each challenge comes with
   4464 four mandatory fields:
   4465 
   4466 @quotation
   4467 
   4468 
   4469 @itemize -
   4470 
   4471 @item 
   4472 @strong{uuid}: A unique identifier of the challenge; this is what the
   4473 UUIDs in the policies array refer to.
   4474 
   4475 @item 
   4476 @strong{uuid-display}: Shortened idenfier which is included in messages
   4477 send to the user.  Allows the user to
   4478 distinguish different PIN/TANs should say the same phone number be
   4479 used for SMS-authentication with different providers.
   4480 
   4481 @item 
   4482 @strong{type}: This is the type of the challenge, as a string.
   4483 
   4484 @item 
   4485 @strong{instructions}: Contains additional important hints for the user
   4486 to allow the user to satisfy the challenge.  It typically includes
   4487 an abbreviated form of the contact information or the security
   4488 question. Details depend on @code{type}.
   4489 @end itemize
   4490 @end quotation
   4491 
   4492 If a recovery document was not found, either the user never performed
   4493 a backup, entered incorrect attributes, or used a provider not yet in
   4494 the list of Anastasis providers.  Hence, the user must now either
   4495 select a different provider, or go @code{back} and update the identity
   4496 attributes.  In the case a recovery document was not found, the
   4497 transition fails, returning the error code and a human-readable error
   4498 message together with a transition failure:
   4499 
   4500 @example
   4501 @{
   4502   "error_message": "account unknown to Anastasis server",
   4503   "error_code": 9,
   4504 @}
   4505 @end example
   4506 
   4507 Here, the @code{error_code} is from the @code{enum ANASTASIS_RecoveryStatus}
   4508 and describes precisely what failed about the download, while the
   4509 @code{error_message} is a human-readable (English) explanation of the code.
   4510 Applications may want to translate the message using GNU gettext;
   4511 translations should be available in the @code{anastasis} text domain.
   4512 However, in general it should be sufficient to display the slightly
   4513 more generic Taler error code that is returned with the new state.
   4514 
   4515 @strong{sync_providers}
   4516 
   4517 The downloaded policy may include secrets from providers for which
   4518 we do not (yet) have the cost structure or even the salt. So here
   4519 an application can use the @code{sync_providers} request to download
   4520 @code{/config} from providers that are in the challenge list but not
   4521 yet known with their salt and other attributes in the provider list.
   4522 
   4523 The transition fails if all providers relevant for the selected
   4524 policy are already downloaded. Applications may either internally
   4525 check the state for this, or call @code{sync_providers} until it fails
   4526 with this error:
   4527 
   4528 @example
   4529 @{
   4530   "detail": "already in sync",
   4531   "code": 8400,
   4532   "hint": "The given action is invalid for the current state of the reducer."
   4533 @}
   4534 @end example
   4535 
   4536 As providers may fail to respond, this action may need to be called
   4537 repeatedly. The action will block until progress is made on any provider.
   4538 As some providers may never respond, the application should disable
   4539 challenge buttons for challenges where providers are down.  However,
   4540 users should be able to solve challenges where the provider is up while
   4541 the reducer is polling for @code{/config} in the background.
   4542 
   4543 @strong{select_challenge:}
   4544 
   4545 Selecting a challenge takes different, depending on the state of the payment.
   4546 A comprehensive example for @code{select_challenge} would be:
   4547 
   4548 @example
   4549 @{
   4550     "uuid": "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30"
   4551     "timeout" : @{ "d_ms" : 5000 @},
   4552     "payment_secret": "3P4561HAMHRRYEYD6CM6J7TS5VTD5SR2K2EXJDZEFSX92XKHR4KG"
   4553 @}
   4554 @end example
   4555 
   4556 The @code{uuid} field is mandatory and specifies the selected challenge.
   4557 The other fields are optional, and are needed in case the user has
   4558 previously been requested to pay for the challenge.  In this case,
   4559 the @code{payment_secret} identifies the previous payment request, and
   4560 @code{timeout} says how long the Anastasis service should wait for the
   4561 payment to be completed before giving up (long polling).
   4562 
   4563 Depending on the type of the challenge and the need for payment, the
   4564 reducer may transition into @code{CHALLENGE_SOLVING} or @code{CHALLENGE_PAYING}
   4565 states.  In @code{CHALLENGE_SOLVING}, the new state will primarily specify
   4566 the selected challenge:
   4567 
   4568 @example
   4569 @{
   4570   "backup_state": "CHALLENGE_SOLVING",
   4571   "selected_challenge_uuid": "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30"
   4572 @}
   4573 @end example
   4574 
   4575 In @code{CHALLENGE_PAYING}, the new state will include instructions for payment
   4576 in the @code{challenge_feedback}. In general, @code{challenge_feedback} includes
   4577 information about attempted challenges, with the final state being @code{solved}:
   4578 
   4579 @example
   4580 @{
   4581   "recovery_state": "CHALLENGE_SELECTING",
   4582   "recovery_information": @{
   4583     "...": "..."
   4584   @}
   4585   "challenge_feedback": @{
   4586     "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30" : @{
   4587       "state" : "solved"
   4588     @}
   4589   @}
   4590 @}
   4591 @end example
   4592 
   4593 Challenges feedback for a challenge can have many different @code{state} values
   4594 that applications must all handle. States other than @code{solved} are:
   4595 
   4596 
   4597 @itemize -
   4598 
   4599 @item 
   4600 @strong{payment}: Here, the user must pay for a challenge. An example would be:
   4601 
   4602 @example
   4603 @{
   4604   "backup_state": "CHALLENGE_PAYING",
   4605   "selected_challenge_uuid": "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30",
   4606   "challenge_feedback": @{
   4607     "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30" : @{
   4608      "state" : "payment",
   4609      "taler_pay_uri" : "taler://pay/...",
   4610      "provider" : "https://localhost:8080/",
   4611      "payment_secret" : "3P4561HAMHRRYEYD6CM6J7TS5VTD5SR2K2EXJDZEFSX92XKHR4KG"
   4612     @}
   4613   @}
   4614 @}
   4615 @end example
   4616 
   4617 @item 
   4618 @strong{body}: Here, the server provided an HTTP reply for
   4619 how to solve the challenge, but the reducer could not parse
   4620 them into a known format. A mime-type may be provided and may
   4621 help parse the details.
   4622 
   4623 @example
   4624 @{
   4625   "recovery_state": "CHALLENGE_SOLVING",
   4626   "recovery_information": @{
   4627       "...": "..."
   4628   @}
   4629   "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4630   "challenge_feedback": @{
   4631     "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
   4632       "state": "body",
   4633       "body": "CROCKFORDBASE32ENCODEDBODY",
   4634       "http_status": 403,
   4635       "mime_type" : "anything/possible"
   4636     @}
   4637   @}
   4638 @}
   4639 @end example
   4640 
   4641 @item 
   4642 @strong{hint}: Here, the server provided human-readable hint for
   4643 how to solve the challenge.  Note that the @code{hint} provided this
   4644 time is from the Anastasis provider and may differ from the @code{instructions}
   4645 for the challenge under @code{recovery_information}:
   4646 
   4647 @example
   4648 @{
   4649   "recovery_state": "CHALLENGE_SOLVING",
   4650   "recovery_information": @{
   4651       "...": "..."
   4652   @}
   4653   "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4654   "challenge_feedback": @{
   4655     "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
   4656       "state": "hint",
   4657       "hint": "Recovery TAN send to email mail@@DOMAIN",
   4658       "http_status": 403
   4659     @}
   4660   @}
   4661 @}
   4662 @end example
   4663 
   4664 @item 
   4665 @strong{details}: Here, the server provided a detailed JSON status response
   4666 related to solving the challenge:
   4667 
   4668 @example
   4669 @{
   4670   "recovery_state": "CHALLENGE_SOLVING",
   4671   "recovery_information": @{
   4672      "...": "..."
   4673   @}
   4674   "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4675   "challenge_feedback": @{
   4676     "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
   4677       "state": "details",
   4678       "details": @{
   4679         "code": 8111,
   4680         "hint": "The client's response to the challenge was invalid.",
   4681         "detail" : null
   4682       @},
   4683       "http_status": 403
   4684     @}
   4685   @}
   4686 @}
   4687 @end example
   4688 
   4689 @item 
   4690 @strong{redirect}: To solve the challenge, the user must visit the indicated
   4691 Web site at @code{redirect_url}, for example to perform video authentication:
   4692 
   4693 @example
   4694 @{
   4695   "recovery_state": "CHALLENGE_SOLVING",
   4696   "recovery_information": @{
   4697      "...": "..."
   4698   @}
   4699   "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4700   "challenge_feedback": @{
   4701     "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
   4702       "state": "redirect",
   4703       "redirect_url": "https://videoconf.example.com/",
   4704       "http_status": 303
   4705     @}
   4706   @}
   4707 @}
   4708 @end example
   4709 
   4710 @item 
   4711 @strong{server-failure}: This indicates that the Anastasis provider encountered
   4712 a failure and recovery using this challenge cannot proceed at this time.
   4713 Examples for failures might be that the provider is unable to send SMS
   4714 messages at this time due to an outage.  The body includes details about
   4715 the failure. The user may try again later or continue with other challenges.
   4716 
   4717 @example
   4718  @{
   4719    "recovery_state": "CHALLENGE_SELECTING",
   4720    "recovery_information": @{
   4721        "...": "..."
   4722    @}
   4723    "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4724    "challenge_feedback": @{
   4725      "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
   4726       "state": "server-failure",
   4727       "http_status": "500",
   4728       "error_code": 52
   4729     @}
   4730   @}
   4731 @}
   4732 @end example
   4733 
   4734 @item 
   4735 @strong{truth-unknown}: This indicates that the Anastasis provider is unaware of
   4736 the specified challenge. This is typically a permanent failure, and user
   4737 interfaces should not allow users to re-try this challenge.
   4738 
   4739 @example
   4740 @{
   4741   "recovery_state": "CHALLENGE_SELECTING",
   4742   "recovery_information": @{
   4743       "...": "..."
   4744   @}
   4745   "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4746   "challenge_feedback": @{
   4747     "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
   4748       "state": "truth-unknown",
   4749       "error_code": 8108
   4750     @}
   4751   @}
   4752 @}
   4753 @end example
   4754 
   4755 @item 
   4756 @strong{rate-limit-exceeded}: This indicates that the user has made too many invalid attempts in too short an amount of time.
   4757 
   4758 @example
   4759 @{
   4760   "recovery_state": "CHALLENGE_SELECTING",
   4761   "recovery_information": @{
   4762       "...": "..."
   4763   @}
   4764   "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4765   "challenge_feedback": @{
   4766     "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
   4767       "state": "rate-limit-exceeded",
   4768       "error_code": 8121
   4769     @}
   4770   @}
   4771 @}
   4772 @end example
   4773 
   4774 @item 
   4775 @strong{authentication-timeout}: This indicates that the challenge is awaiting for some external authentication process to complete. The application should @code{poll} for it to complete, or proceed with selecting other challenges.
   4776 
   4777 @example
   4778 @{
   4779   "recovery_state": "CHALLENGE_SELECTING",
   4780   "recovery_information": @{
   4781       "...": "..."
   4782   @}
   4783   "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4784   "challenge_feedback": @{
   4785     "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
   4786       "state": "authentication-timeout",
   4787       "error_code": 8122
   4788     @}
   4789   @}
   4790 @}
   4791 @end example
   4792 
   4793 @item 
   4794 @strong{external-instructions}: This indicates that the challenge requires the user to perform some authentication method-specific actions. Details about what the user should do are provided.
   4795 
   4796 @example
   4797 @{
   4798   "recovery_state": "CHALLENGE_SELECTING",
   4799   "recovery_information": @{
   4800       "...": "..."
   4801   @}
   4802   "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
   4803   "challenge_feedback": @{
   4804     "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
   4805       "state": "external-instructions",
   4806       "method": "iban",
   4807       "async": true, // optional
   4808       "answer_code": 987654321, // optional
   4809       "details": @{
   4810         "...": "..."
   4811       @}
   4812     @}
   4813   @}
   4814 @}
   4815 @end example
   4816 
   4817 If “async” is “true”, then the client should
   4818 poll for the challenge being satisfied using
   4819 the “answer_code” that has been provided.
   4820 
   4821 The specific instructions on how to satisfy
   4822 the challenge depend on the @code{method}.
   4823 They include:
   4824 
   4825 
   4826 @itemize -
   4827 
   4828 @item 
   4829 @strong{iban}: The user must perform a wire transfer from their account to the Anastasis provider.
   4830 
   4831 @example
   4832 @{
   4833   "challenge_amount": "EUR:1",
   4834   "credit_iban": "DE12345789000",
   4835   "business_name": "Data Loss Incorporated",
   4836   "wire_transfer_subject": "Anastasis 987654321"
   4837 @}
   4838 @end example
   4839 
   4840 Note that the actual wire transfer subject must contain both
   4841 the numeric @code{answer_code} as well as
   4842 the string @code{Anastasis}.
   4843 @end itemize
   4844 @end itemize
   4845 
   4846 @strong{poll:}
   4847 
   4848 With a @code{poll} transition, the application indicates that it wants to wait longer for one or more of the challenges that are awaiting some external authentication (state @code{external-instructions}) or experienced some kind of timeout (state @code{authentication-timeout}) to possibly complete.  While technically optional, the @code{timeout} argument should really be provided to enable long-polling, for example:
   4849 
   4850 @example
   4851 @{
   4852     "timeout" : @{ "d_ms" : 5000 @},
   4853 @}
   4854 @end example
   4855 
   4856 @strong{pay:}
   4857 
   4858 With a @code{pay} transition, the application indicates to the reducer that
   4859 a payment may have been made. Here, it is again possible to specify an
   4860 optional @code{timeout} argument for long-polling, for example:
   4861 
   4862 @example
   4863 @{
   4864     "payment_secret": "ABCDADF242525AABASD52525235ABABFDABABANALASDAAKASDAS"
   4865     "timeout" : @{ "d_ms" : 5000 @},
   4866 @}
   4867 @end example
   4868 
   4869 Depending on the type of the challenge and the result of the operation, the
   4870 new state may be @code{CHALLENGE_SOLVING} (if say the SMS was now sent to the
   4871 user), @code{CHALLENGE_SELECTING} (if the answer to the security question was
   4872 correct), @code{RECOVERY_FINISHED} (if this was the last challenge that needed to
   4873 be solved) or still @code{CHALLENGE_PAYING} (if the challenge was not actually
   4874 paid for).  For sample messages, see the different types of
   4875 @code{challenge_feedback} in the section about @code{select_challenge}.
   4876 
   4877 @strong{solve_challenge:}
   4878 
   4879 Solving a challenge takes various formats, depending on the type of the
   4880 challenge and what is known about the answer.  The different supported
   4881 formats are:
   4882 
   4883 @example
   4884 @{
   4885     "answer": "answer to security question"
   4886 @}
   4887 @end example
   4888 
   4889 @example
   4890 @{
   4891     "pin": 1234
   4892 @}
   4893 @end example
   4894 
   4895 @example
   4896 @{
   4897     "hash": "SOMEBASE32ENCODEDHASHVALUE"
   4898 @}
   4899 @end example
   4900 
   4901 @c This file is part of Anastasis
   4902 @c Copyright (C) 2019-2021 Anastasis SARL
   4903 @c 
   4904 @c Anastasis is free software; you can redistribute it and/or modify it under the
   4905 @c terms of the GNU Affero General Public License as published by the Free Software
   4906 @c Foundation; either version 2.1, or (at your option) any later version.
   4907 @c 
   4908 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
   4909 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   4910 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
   4911 @c 
   4912 @c You should have received a copy of the GNU Affero General Public License along with
   4913 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
   4914 @c 
   4915 @c @author Christian Grothoff
   4916 @c @author Dominik Meister
   4917 @c @author Dennis Neufeld
   4918 
   4919 @node Authentication Methods,DB Schema,Reducer API,Documentation Overview
   4920 @anchor{authentication doc}@anchor{72}@anchor{authentication anastasis-auth-methods}@anchor{73}@anchor{authentication authentication-methods}@anchor{74}
   4921 @section Authentication Methods
   4922 
   4923 
   4924 This section describes the supported authentication methods in detail.  We
   4925 note that the server implements rate limiting for all authentication methods
   4926 to ensure that malicious strong attackers cannot guess the values by
   4927 brute-force. Typically, a user is given three attempts per hour to enter the
   4928 correct code from 2^63 possible values.  Transmitted codes also come with an
   4929 expiration date. If the user re-requests a challenge to be sent, the same
   4930 challenge may be transmitted (with the three attempts counter not increasing!)
   4931 for a limited period of time (depending on the authentication method) before
   4932 the service eventually rotates to a fresh random code with a fresh retry
   4933 counter. Given the default value range and time intervals (which providers are
   4934 at liberty to adjust), brute-force attacks against this are expected to
   4935 succeed with a 50% probability after about 200000 years of attempts at the
   4936 maximum permissible frequency.
   4937 
   4938 @menu
   4939 * SMS (sms): SMS sms. 
   4940 * Email verification (email): Email verification email. 
   4941 * Video identification (vid): Video identification vid. 
   4942 * Security question (qa): Security question qa. 
   4943 * Snail mail verification (post): Snail mail verification post. 
   4944 
   4945 @end menu
   4946 
   4947 @node SMS sms,Email verification email,,Authentication Methods
   4948 @anchor{authentication sms-sms}@anchor{75}
   4949 @subsection SMS (sms)
   4950 
   4951 
   4952 Sends an SMS with a code (prefixed with @code{A-}) to the user’s phone, including
   4953 a UUID which identifies the challenge the code is for.  The user must send
   4954 this code back with his request (see @code{$RESPONSE} under @ref{5c,,Managing truth}).
   4955 If the transmitted code is correct, the server responses with the requested
   4956 encrypted key share.
   4957 
   4958 @node Email verification email,Video identification vid,SMS sms,Authentication Methods
   4959 @anchor{authentication email-verification-email}@anchor{76}
   4960 @subsection Email verification (email)
   4961 
   4962 
   4963 Sends an email with a code (prefixed with @code{A-}) to the user’s mail address,
   4964 including a UUID which identifies the challenge the code is for.  The user
   4965 must send this code back with his request (see @code{$RESPONSE} under @ref{5c,,Managing truth}).
   4966 If the transmitted code is correct, the server responses with the
   4967 requested encrypted key share.
   4968 
   4969 @node Video identification vid,Security question qa,Email verification email,Authentication Methods
   4970 @anchor{authentication video-identification-vid}@anchor{77}
   4971 @subsection Video identification (vid)
   4972 
   4973 
   4974 Requires the user to identify via video-call.  In the video-call, the
   4975 user is told the code (prefixed with @code{A-}) needed to authenticate.
   4976 
   4977 The user is expected to delete all metadata revealing personal information
   4978 from the images before uploading them. Since the respective images must be
   4979 passed on to the video identification service in the event of password
   4980 recovery, it should be ensured that no further information about the user can
   4981 be derived from them.
   4982 
   4983 Video identification will typically result in the Anastasis provider
   4984 requesting the user to be redirected to a Web site (or other URL) for the
   4985 video-call.
   4986 
   4987 @node Security question qa,Snail mail verification post,Video identification vid,Authentication Methods
   4988 @anchor{authentication security-question-qa}@anchor{78}
   4989 @subsection Security question (qa)
   4990 
   4991 
   4992 Asks the user a security question.  The user sends back a @strong{salted}
   4993 hash over the answer.  The @strong{question-salt} is stored encrypted as
   4994 part of the recovery document and never revealed to the providers. This
   4995 ensures that providers cannot derive the answer from the hash value.
   4996 Furthermore, the security question itself is also only in the recovery
   4997 document and never given to the Anastasis provider.  A moderately expensive
   4998 hash function is used to further limit strong attackers that have obtained
   4999 the recovery document from brute-forcing the answer.
   5000 
   5001 If the hash value matches with the one the server is expecting, the server
   5002 answers with the requested encrypted key share.  However, unlike other
   5003 encrypted key shares, the encrypted key share of a security question uses a
   5004 special variation of the Anastasis encryption: Here, a different hash function
   5005 over the security answer is used to provide an additional @strong{key-salt} for the
   5006 decryption of the (encrypted) @strong{key share}.  This ensures that the key share
   5007 remains irrecoverable without the answer even if the Anastasis provider
   5008 storing the security question is malicious.
   5009 
   5010 @node Snail mail verification post,,Security question qa,Authentication Methods
   5011 @anchor{authentication snail-mail-verification-post}@anchor{79}
   5012 @subsection Snail mail verification (post)
   5013 
   5014 
   5015 Sends physical mail (snail mail) with a code (prefixed with @code{A-}) to the
   5016 user’s mail address, including a UUID which identifies the challenge the code
   5017 is for.  The user must send this code back with their request (see
   5018 @code{$RESPONSE} under @ref{5c,,Managing truth}).  If the transmitted code is correct,
   5019 the server responds with the requested encrypted key share.
   5020 
   5021 @c This file is part of Anastasis
   5022 @c Copyright (C) 2019-2021 Anastasis SARL
   5023 @c 
   5024 @c Anastasis is free software; you can redistribute it and/or modify it under the
   5025 @c terms of the GNU Affero General Public License as published by the Free Software
   5026 @c Foundation; either version 2.1, or (at your option) any later version.
   5027 @c 
   5028 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
   5029 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   5030 @c A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
   5031 @c 
   5032 @c You should have received a copy of the GNU Affero General Public License along with
   5033 @c Anastasis; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
   5034 @c 
   5035 @c @author Christian Grothoff
   5036 @c @author Dominik Meister
   5037 @c @author Dennis Neufeld
   5038 
   5039 @node DB Schema,Anastasis licensing information,Authentication Methods,Documentation Overview
   5040 @anchor{db doc}@anchor{7a}@anchor{db db-schema}@anchor{7b}
   5041 @section DB Schema
   5042 
   5043 
   5044 @image{anastasis-figures/anastasis-db,,,,png}
   5045 
   5046 @image{anastasis-figures/anastasis_challengecode,,,,png}
   5047 
   5048 @image{anastasis-figures/anastasis_challenge_payment,,,,png}
   5049 
   5050 @image{anastasis-figures/anastasis_truth,,,,png}
   5051 
   5052 @image{anastasis-figures/anastasis_truth_payment,,,,png}
   5053 
   5054 @node Anastasis licensing information,Man Pages,DB Schema,Documentation Overview
   5055 @anchor{global-licensing doc}@anchor{7c}@anchor{global-licensing anastasis-licensing-information}@anchor{7d}
   5056 @section Anastasis licensing information
   5057 
   5058 
   5059 This file gives an overview of all Anastasis component’s licensing and
   5060 of runtime dependencies thereof. For “component” here is meant a set
   5061 of source files which can be retrieved from a single repository.  If
   5062 components consist of sources under different licensing regimes, i.e.
   5063 because we want to enable third party developments to easily integrate
   5064 with Taler, those are described as well.
   5065 
   5066 All Anastasis components are generally released under the Affero
   5067 GPL.
   5068 
   5069 @menu
   5070 * Anastasis (git;//git.taler.net/anastasis): Anastasis git //git taler net/anastasis. 
   5071 * Anastasis-gtk (git;//git.taler.net/anastasis-gtk): Anastasis-gtk git //git taler net/anastasis-gtk. 
   5072 * Documentation:: 
   5073 
   5074 @end menu
   5075 
   5076 @node Anastasis git //git taler net/anastasis,Anastasis-gtk git //git taler net/anastasis-gtk,,Anastasis licensing information
   5077 @anchor{global-licensing anastasis-git-git-taler-net-anastasis}@anchor{7e}@anchor{global-licensing exchange-repo}@anchor{7f}
   5078 @subsection Anastasis (git://git.taler.net/anastasis)
   5079 
   5080 
   5081 Anastasis core logic is under AGPL.
   5082 
   5083 @menu
   5084 * Runtime dependencies:: 
   5085 
   5086 @end menu
   5087 
   5088 @node Runtime dependencies,,,Anastasis git //git taler net/anastasis
   5089 @anchor{global-licensing runtime-dependencies}@anchor{80}
   5090 @subsubsection Runtime dependencies
   5091 
   5092 
   5093 The following list encompasses all the runtime dependencies for this
   5094 project, and gives the copyright holder for each of them:
   5095 
   5096 
   5097 @itemize *
   5098 
   5099 @item 
   5100 libjansson: MIT License, AGPL- and LGPL-Compatible, owned by Petri Lehtinen and other individuals
   5101 
   5102 @item 
   5103 libgcrypt: LGPL, owned by Free Software Foundation
   5104 
   5105 @item 
   5106 postgresql: PostgreSQL License, AGPL- and LGPL-Compatible, owned by The PostgreSQL Global Development Group
   5107 
   5108 @item 
   5109 libgnunetutil (in all of its variants): GPLv3+, owned by GNUnet e.V.
   5110 
   5111 @item 
   5112 libgnunetjson: GPLv3+, GNUnet e.V.
   5113 
   5114 @item 
   5115 GNU Taler: LGPLv3+ / GPLv3+ / AGPLv3+: owned by Taler Systems SA
   5116 @end itemize
   5117 
   5118 @node Anastasis-gtk git //git taler net/anastasis-gtk,Documentation,Anastasis git //git taler net/anastasis,Anastasis licensing information
   5119 @anchor{global-licensing anastasis-gtk-git-git-taler-net-anastasis-gtk}@anchor{81}
   5120 @subsection Anastasis-gtk (git://git.taler.net/anastasis-gtk)
   5121 
   5122 
   5123 Anastasis-gtk is under AGPL.
   5124 
   5125 @menu
   5126 * Runtime dependencies: Runtime dependencies<2>. 
   5127 
   5128 @end menu
   5129 
   5130 @node Runtime dependencies<2>,,,Anastasis-gtk git //git taler net/anastasis-gtk
   5131 @anchor{global-licensing id1}@anchor{82}
   5132 @subsubsection Runtime dependencies
   5133 
   5134 
   5135 The following list encompasses all the runtime dependencies for this
   5136 project, and gives the copyright holder for each of them:
   5137 
   5138 
   5139 @itemize *
   5140 
   5141 @item 
   5142 libjansson: MIT License, AGPL- and LGPL-Compatible, owned by Petri Lehtinen and other individuals
   5143 
   5144 @item 
   5145 libgcrypt: LGPL, owned by Free Software Foundation
   5146 
   5147 @item 
   5148 postgresql: PostgreSQL License, AGPL- and LGPL-Compatible, owned by The PostgreSQL Global Development Group
   5149 
   5150 @item 
   5151 libgnunetutil (in all of its variants): GPLv3+, owned by GNUnet e.V.
   5152 
   5153 @item 
   5154 libgnunetjson: GPLv3+, GNUnet e.V.
   5155 
   5156 @item 
   5157 libgnunetgtk: GPLv3+, GNUnet e.V.
   5158 
   5159 @item 
   5160 GNU Taler: LGPLv3+ / GPLv3+ / AGPLv3+: owned by Taler Systems SA
   5161 @end itemize
   5162 
   5163 @node Documentation,,Anastasis-gtk git //git taler net/anastasis-gtk,Anastasis licensing information
   5164 @anchor{global-licensing documentation}@anchor{83}
   5165 @subsection Documentation
   5166 
   5167 
   5168 The documentation is licensed under the GNU Free Documentation License Version 1.3 or later.
   5169 
   5170 @node Man Pages,Complete Index,Anastasis licensing information,Documentation Overview
   5171 @anchor{manindex doc}@anchor{84}@anchor{manindex man-pages}@anchor{85}
   5172 @section Man Pages
   5173 
   5174 
   5175 @menu
   5176 * anastasis-config(1): anastasis-config 1. 
   5177 * anastasis-dbconfig(1): anastasis-dbconfig 1. 
   5178 * anastasis-dbinit(1): anastasis-dbinit 1. 
   5179 * anastasis-gtk(1): anastasis-gtk 1. 
   5180 * anastasis-helper-authorization-iban(1): anastasis-helper-authorization-iban 1. 
   5181 * anastasis-httpd(1): anastasis-httpd 1. 
   5182 * anastasis-reducer(1): anastasis-reducer 1. 
   5183 * anastasis.conf(5): anastasis conf 5. 
   5184 
   5185 @end menu
   5186 
   5187 @node anastasis-config 1,anastasis-dbconfig 1,,Man Pages
   5188 @anchor{manpages/anastasis-config 1 doc}@anchor{86}@anchor{manpages/anastasis-config 1 anastasis-config-1}@anchor{87}
   5189 @subsection anastasis-config(1)
   5190 
   5191 
   5192 
   5193 @menu
   5194 * Synopsis:: 
   5195 * Description:: 
   5196 * See Also:: 
   5197 * Bugs:: 
   5198 
   5199 @end menu
   5200 
   5201 @node Synopsis,Description,,anastasis-config 1
   5202 @anchor{manpages/anastasis-config 1 synopsis}@anchor{88}
   5203 @subsubsection Synopsis
   5204 
   5205 
   5206 @strong{anastasis-config}
   5207 [@strong{-b} @emph{backend} | @strong{––supported-backend=}@emph{backend}]
   5208 [@strong{-c} @emph{filename} | @strong{––config=}@emph{filename}]
   5209 [@strong{-f} | @strong{––filename}]
   5210 [@strong{-F} | @strong{––full}]
   5211 [@strong{-h} | @strong{––help}]
   5212 [@strong{-L} @emph{loglevel} | @strong{––loglevel=}@emph{loglevel}]
   5213 [@strong{-l} @emph{filename} | @strong{––logfile=}‌@emph{filename}]
   5214 [@strong{-o} @emph{option} | @strong{––option=}@emph{option}]
   5215 [@strong{-r} | @strong{––rewrite}]
   5216 [@strong{-S} | @strong{––list-sections}]
   5217 [@strong{-s} @emph{section} | @strong{––section=}@emph{section}]
   5218 [@strong{-V} @emph{value} | @strong{––value=}@emph{value}]
   5219 [@strong{-v} | @strong{––version}]
   5220 
   5221 @node Description,See Also,Synopsis,anastasis-config 1
   5222 @anchor{manpages/anastasis-config 1 description}@anchor{89}
   5223 @subsubsection Description
   5224 
   5225 
   5226 @strong{anastasis-config} can be used to read or modify Anastasis configuration files.
   5227 
   5228 
   5229 @table @asis
   5230 
   5231 @item @strong{-b} @emph{BACKEND} | @strong{––supported-backend=}@emph{BACKEND}
   5232 
   5233 Tests whether the specified @emph{BACKEND} is supported by the current installation.
   5234 The backend must match the name of a plugin, i.e. “namestore_postgres” for
   5235 the Postgres database backend of the “NAMESTORE” service.  If @emph{BACKEND} is
   5236 supported, anastasis-config will return a status code of 0 (success), otherwise
   5237 77 (unsupported).  When this option is specified, no other options may be
   5238 specified. Specifying this option together with other options will cause
   5239 anastasis-config to return a status code of 1 (error).
   5240 
   5241 @item @strong{-c} @emph{FILENAME} | @strong{––config=}@emph{FILENAME}
   5242 
   5243 Use the configuration file @emph{FILENAME}.
   5244 
   5245 @item @strong{-f} | @strong{––filename}
   5246 
   5247 Try to perform expansions as if the option values represent filenames (will
   5248 also be applied even if the option is not really a filename).
   5249 
   5250 @item @strong{-F} | @strong{––full}
   5251 
   5252 Write the full configuration file, not just the differences to the defaults.
   5253 
   5254 @item @strong{-h} | @strong{––help}
   5255 
   5256 Print short help on options.
   5257 
   5258 @item @strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}@emph{LOGLEVEL}
   5259 
   5260 Use @emph{LOGLEVEL} for logging.
   5261 Valid values are @code{DEBUG}, @code{INFO}, @code{WARNING}, and @code{ERROR}.
   5262 
   5263 @item @strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}
   5264 
   5265 Send logging output to @emph{FILENAME}.
   5266 
   5267 @item @strong{-o} @emph{OPTION} | @strong{––option=}@emph{OPTION}
   5268 
   5269 Which configuration option should be accessed or edited.  Required to set a
   5270 value.  If not given, all values of a given section will be printed in the
   5271 format “OPTION = VALUE”.
   5272 
   5273 @item @strong{-r} | @strong{––rewrite}
   5274 
   5275 Write the configuration file even if nothing changed. Will remove all comments!
   5276 
   5277 @item @strong{-S} | @strong{––list-sections}
   5278 
   5279 List available configuration sections for use with @code{--section}.
   5280 
   5281 @item @strong{-s} @emph{SECTION} | @strong{––section=}@emph{SECTION}
   5282 
   5283 Which configuration section should be accessed or edited.
   5284 Required option.
   5285 
   5286 @item @strong{-V} @emph{VALUE} | @strong{––value=}@emph{VALUE}
   5287 
   5288 Configuration value to store in the given section under the given option.
   5289 Must only be given together with @code{-s} and @code{-o} options.
   5290 
   5291 
   5292 @table @asis
   5293 
   5294 @item Note:
   5295 
   5296 Changing the configuration file with @code{-V} will remove comments
   5297 and may reorder sections and remove @code{@@INLINE@@} directives.
   5298 @end table
   5299 
   5300 @item @strong{-v} | @strong{––version}
   5301 
   5302 Print Anastasis version number.
   5303 @end table
   5304 
   5305 @node See Also,Bugs,Description,anastasis-config 1
   5306 @anchor{manpages/anastasis-config 1 see-also}@anchor{8a}
   5307 @subsubsection See Also
   5308 
   5309 
   5310 anastasis.conf(5)
   5311 
   5312 @node Bugs,,See Also,anastasis-config 1
   5313 @anchor{manpages/anastasis-config 1 bugs}@anchor{8b}
   5314 @subsubsection Bugs
   5315 
   5316 
   5317 Report bugs by using @indicateurl{https://bugs.anastasis.lu} or by sending electronic
   5318 mail to <@email{contact@@anastasis.lu}>.
   5319 
   5320 @node anastasis-dbconfig 1,anastasis-dbinit 1,anastasis-config 1,Man Pages
   5321 @anchor{manpages/anastasis-dbconfig 1 doc}@anchor{8c}@anchor{manpages/anastasis-dbconfig 1 anastasis-dbconfig-1}@anchor{8d}
   5322 @subsection anastasis-dbconfig(1)
   5323 
   5324 
   5325 
   5326 @menu
   5327 * Synopsis: Synopsis<2>. 
   5328 * Description: Description<2>. 
   5329 * See Also: See Also<2>. 
   5330 * Bugs: Bugs<2>. 
   5331 
   5332 @end menu
   5333 
   5334 @node Synopsis<2>,Description<2>,,anastasis-dbconfig 1
   5335 @anchor{manpages/anastasis-dbconfig 1 synopsis}@anchor{8e}
   5336 @subsubsection Synopsis
   5337 
   5338 
   5339 @strong{anastasis-dbconfig}
   5340 [@strong{-c} @emph{FILENAME} @emph{]
   5341 [*}-h**]
   5342 [@strong{-n} @emph{NAME} @emph{]
   5343 [*}-r**]
   5344 [@strong{-s}]
   5345 [@strong{-u} @emph{USER} >>*<<]
   5346 
   5347 @node Description<2>,See Also<2>,Synopsis<2>,anastasis-dbconfig 1
   5348 @anchor{manpages/anastasis-dbconfig 1 description}@anchor{8f}
   5349 @subsubsection Description
   5350 
   5351 
   5352 @strong{anastasis-dbconfig} is a simple shell script that configures
   5353 a Postgresql database for use by the GNU Anastasis servers.
   5354 
   5355 Its options are as follows:
   5356 
   5357 
   5358 @table @asis
   5359 
   5360 @item @strong{-c} @emph{FILENAME}
   5361 
   5362 Write the database configuration to FILENAME. The tool
   5363 will append the required @code{CONFIG} option for the
   5364 Postgresql access to the respective file.
   5365 
   5366 @item @strong{-h}
   5367 
   5368 Print short help on options.
   5369 
   5370 @item @strong{-n} @emph{DBNAME}
   5371 
   5372 Use DBNAME for the name of the created database.
   5373 
   5374 @item @strong{-r}
   5375 
   5376 Reset any existing database. Looses all existing data. DANGEROUS.
   5377 
   5378 @item @strong{-s}
   5379 
   5380 Skip database initialization. Useful if you want to run
   5381 @code{anastasis-dbinit} manually.
   5382 
   5383 @item @strong{-u} @emph{USER}
   5384 
   5385 Specifies the (main) Anastasis user that will access the database.
   5386 @end table
   5387 
   5388 @node See Also<2>,Bugs<2>,Description<2>,anastasis-dbconfig 1
   5389 @anchor{manpages/anastasis-dbconfig 1 see-also}@anchor{90}
   5390 @subsubsection See Also
   5391 
   5392 
   5393 anastassis-dbinit(1), anastasis.conf(5).
   5394 
   5395 @node Bugs<2>,,See Also<2>,anastasis-dbconfig 1
   5396 @anchor{manpages/anastasis-dbconfig 1 bugs}@anchor{91}
   5397 @subsubsection Bugs
   5398 
   5399 
   5400 Report bugs by using @indicateurl{https://bugs.taler.net} or by sending electronic
   5401 mail to <@email{taler@@gnu.org}>.
   5402 
   5403 @node anastasis-dbinit 1,anastasis-gtk 1,anastasis-dbconfig 1,Man Pages
   5404 @anchor{manpages/anastasis-dbinit 1 doc}@anchor{92}@anchor{manpages/anastasis-dbinit 1 anastasis-dbinit-1}@anchor{93}
   5405 @subsection anastasis-dbinit(1)
   5406 
   5407 
   5408 
   5409 @menu
   5410 * Synopsis: Synopsis<3>. 
   5411 * Description: Description<3>. 
   5412 * See Also: See Also<3>. 
   5413 * Bugs: Bugs<3>. 
   5414 
   5415 @end menu
   5416 
   5417 @node Synopsis<3>,Description<3>,,anastasis-dbinit 1
   5418 @anchor{manpages/anastasis-dbinit 1 synopsis}@anchor{94}
   5419 @subsubsection Synopsis
   5420 
   5421 
   5422 @strong{anastasis-dbinit}
   5423 [@strong{-c} @emph{FILENAME} | @strong{–config=}‌@emph{FILENAME}]
   5424 [@strong{-g} | @strong{–gc}]
   5425 [@strong{-h} | @strong{–help}]
   5426 [@strong{-L} @emph{LOGLEVEL} | @strong{–loglevel=}‌@emph{LOGLEVEL}]
   5427 [@strong{-l} @emph{FILENAME} | @strong{–logfile=}‌@emph{FILENAME}]
   5428 [@strong{-r} | @strong{–reset}]
   5429 [@strong{-v} | @strong{–version}]
   5430 
   5431 @node Description<3>,See Also<3>,Synopsis<3>,anastasis-dbinit 1
   5432 @anchor{manpages/anastasis-dbinit 1 description}@anchor{95}
   5433 @subsubsection Description
   5434 
   5435 
   5436 @strong{anastasis-dbinit} is a command-line tool to initialize the GNU
   5437 Anastasis database. It creates the necessary tables and indices for
   5438 an Anastasis server to operate.
   5439 
   5440 Its options are as follows:
   5441 
   5442 
   5443 @table @asis
   5444 
   5445 @item @strong{-c} @emph{FILENAME} | @strong{–config=}‌@emph{FILENAME}
   5446 
   5447 Use the configuration and other resources for the exchange to operate
   5448 from @emph{FILENAME}.
   5449 
   5450 @item @strong{-g} | @strong{–gc}
   5451 
   5452 Garbage collect database. Deletes all unnecessary data in the
   5453 database.
   5454 
   5455 @item @strong{-h} | @strong{–help}
   5456 
   5457 Print short help on options.
   5458 
   5459 @item @strong{-L} @emph{LOGLEVEL} | @strong{–loglevel=}‌@emph{LOGLEVEL}
   5460 
   5461 Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO},
   5462 @code{WARNING}, @code{ERROR}.
   5463 
   5464 @item @strong{-l} @emph{FILENAME} | @strong{–logfile=}‌@emph{FILENAME}
   5465 
   5466 Send logging output to @emph{FILENAME}.
   5467 
   5468 @item @strong{-r} | @strong{–reset}
   5469 
   5470 Drop tables. Dangerous, will delete all existing data in the database
   5471 before creating the tables.
   5472 
   5473 @item @strong{-v} | @strong{–version}
   5474 
   5475 Print version information.
   5476 @end table
   5477 
   5478 @node See Also<3>,Bugs<3>,Description<3>,anastasis-dbinit 1
   5479 @anchor{manpages/anastasis-dbinit 1 see-also}@anchor{96}
   5480 @subsubsection See Also
   5481 
   5482 
   5483 anastasis-httpd(1), anastasis.conf(5).
   5484 
   5485 @node Bugs<3>,,See Also<3>,anastasis-dbinit 1
   5486 @anchor{manpages/anastasis-dbinit 1 bugs}@anchor{97}
   5487 @subsubsection Bugs
   5488 
   5489 
   5490 Report bugs by using @indicateurl{https://bugs.taler.net} or by sending electronic
   5491 mail to <@email{taler@@gnu.org}>.
   5492 
   5493 @node anastasis-gtk 1,anastasis-helper-authorization-iban 1,anastasis-dbinit 1,Man Pages
   5494 @anchor{manpages/anastasis-gtk 1 doc}@anchor{98}@anchor{manpages/anastasis-gtk 1 anastasis-gtk-1}@anchor{99}
   5495 @subsection anastasis-gtk(1)
   5496 
   5497 
   5498 
   5499 @menu
   5500 * Synopsis: Synopsis<4>. 
   5501 * Description: Description<4>. 
   5502 * See Also: See Also<4>. 
   5503 * Bugs: Bugs<4>. 
   5504 
   5505 @end menu
   5506 
   5507 @node Synopsis<4>,Description<4>,,anastasis-gtk 1
   5508 @anchor{manpages/anastasis-gtk 1 synopsis}@anchor{9a}
   5509 @subsubsection Synopsis
   5510 
   5511 
   5512 @strong{anastasis-gtk}
   5513 [@strong{-A**_*ID*_|_}–application=**@emph{ID}]
   5514 [@strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}]
   5515 [@strong{-h} | @strong{––help}]
   5516 [@strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}‌@emph{LOGLEVEL}]
   5517 [@strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}]
   5518 [@strong{-v} | @strong{––version}]
   5519 
   5520 @node Description<4>,See Also<4>,Synopsis<4>,anastasis-gtk 1
   5521 @anchor{manpages/anastasis-gtk 1 description}@anchor{9b}
   5522 @subsubsection Description
   5523 
   5524 
   5525 @strong{anastasis-gtk} is a graphical tool to run Anastasis
   5526 key recover and backup operations.
   5527 
   5528 
   5529 @table @asis
   5530 
   5531 @item @strong{-A} @emph{ID} | @strong{–application=}@emph{ID}
   5532 
   5533 Set the application ID to @emph{ID}. Default is @code{anastasis-gtk}. Used
   5534 to store different types of secrets from different applications
   5535 while using the same user attributes. Basically the application ID
   5536 is included in the user attributes. Not changable by the GUI as
   5537 only advanced users should even known about this. Applications that
   5538 tightly integrate Anastasis should set the application ID to their
   5539 respective unique name, for example the GNU Taler wallet may use
   5540 @code{gnu-taler-wallet} for the application ID. If anastasis-gtk is
   5541 to be used to recover such a secret, the respective application ID
   5542 must be provided on the command-line. Users that only use
   5543 anastasis-gtk to backup and restore secrets should not set the
   5544 application ID, as forgetting the ID makes the secrets irrecoverable.
   5545 
   5546 @item @strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}
   5547 
   5548 Use the configuration from @emph{FILENAME}.
   5549 
   5550 @item @strong{-h} | @strong{––help}
   5551 
   5552 Print short help on options.
   5553 
   5554 @item @strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}‌@emph{LOGLEVEL}
   5555 
   5556 Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO},
   5557 @code{WARNING}, @code{ERROR}.
   5558 
   5559 @item @strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}
   5560 
   5561 Send logging output to @emph{FILENAME}.
   5562 
   5563 @item @strong{-v} | @strong{––version}
   5564 
   5565 Print version information.
   5566 @end table
   5567 
   5568 @node See Also<4>,Bugs<4>,Description<4>,anastasis-gtk 1
   5569 @anchor{manpages/anastasis-gtk 1 see-also}@anchor{9c}
   5570 @subsubsection See Also
   5571 
   5572 
   5573 anastasis-reducer(1), anastasis-httpd(1), anastasis.conf(5).
   5574 
   5575 @node Bugs<4>,,See Also<4>,anastasis-gtk 1
   5576 @anchor{manpages/anastasis-gtk 1 bugs}@anchor{9d}
   5577 @subsubsection Bugs
   5578 
   5579 
   5580 Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic
   5581 mail to <@email{contact@@anastasis.lu}>.
   5582 
   5583 @node anastasis-helper-authorization-iban 1,anastasis-httpd 1,anastasis-gtk 1,Man Pages
   5584 @anchor{manpages/anastasis-helper-authorization-iban 1 doc}@anchor{9e}@anchor{manpages/anastasis-helper-authorization-iban 1 anastasis-helper-authorization-iban-1}@anchor{9f}
   5585 @subsection anastasis-helper-authorization-iban(1)
   5586 
   5587 
   5588 
   5589 @menu
   5590 * Synopsis: Synopsis<5>. 
   5591 * Description: Description<5>. 
   5592 * See Also: See Also<5>. 
   5593 * Bugs: Bugs<5>. 
   5594 
   5595 @end menu
   5596 
   5597 @node Synopsis<5>,Description<5>,,anastasis-helper-authorization-iban 1
   5598 @anchor{manpages/anastasis-helper-authorization-iban 1 synopsis}@anchor{a0}
   5599 @subsubsection Synopsis
   5600 
   5601 
   5602 @strong{anastasis-helper-authorization-iban}
   5603 [@strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}]
   5604 [@strong{-h} | @strong{––help}]
   5605 [@strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}‌@emph{LOGLEVEL}]
   5606 [@strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}]
   5607 [@strong{-t} | @strong{––test}]
   5608 [@strong{-v} | @strong{––version}]
   5609 
   5610 @node Description<5>,See Also<5>,Synopsis<5>,anastasis-helper-authorization-iban 1
   5611 @anchor{manpages/anastasis-helper-authorization-iban 1 description}@anchor{a1}
   5612 @subsubsection Description
   5613 
   5614 
   5615 @strong{anastasis-helper-authorization-iban} monitors the Anastasis provider’s bank account for incoming wire transfers. This process supports the IBAN authentication method.  It must be configured with the respective wire configuration to talk to LibEuFin/Nexus.
   5616 
   5617 
   5618 @table @asis
   5619 
   5620 @item @strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}
   5621 
   5622 Use the configuration from @emph{FILENAME}.
   5623 
   5624 @item @strong{-h} | @strong{––help}
   5625 
   5626 Print short help on options.
   5627 
   5628 @item @strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}‌@emph{LOGLEVEL}
   5629 
   5630 Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO},
   5631 @code{WARNING}, @code{ERROR}.
   5632 
   5633 @item @strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}
   5634 
   5635 Send logging output to @emph{FILENAME}.
   5636 
   5637 @item @strong{-t} | @strong{––test}
   5638 
   5639 Run in test mode. Causes the process to terminate after importing current wire transfers instead of running forever in the background.
   5640 
   5641 @item @strong{-v} | @strong{––version}
   5642 
   5643 Print version information.
   5644 @end table
   5645 
   5646 @node See Also<5>,Bugs<5>,Description<5>,anastasis-helper-authorization-iban 1
   5647 @anchor{manpages/anastasis-helper-authorization-iban 1 see-also}@anchor{a2}
   5648 @subsubsection See Also
   5649 
   5650 
   5651 anastasis-httpd(1), anastasis.conf(5).
   5652 
   5653 @node Bugs<5>,,See Also<5>,anastasis-helper-authorization-iban 1
   5654 @anchor{manpages/anastasis-helper-authorization-iban 1 bugs}@anchor{a3}
   5655 @subsubsection Bugs
   5656 
   5657 
   5658 Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic
   5659 mail to <@email{contact@@anastasis.lu}>.
   5660 
   5661 @node anastasis-httpd 1,anastasis-reducer 1,anastasis-helper-authorization-iban 1,Man Pages
   5662 @anchor{manpages/anastasis-httpd 1 doc}@anchor{a4}@anchor{manpages/anastasis-httpd 1 anastasis-httpd-1}@anchor{a5}
   5663 @subsection anastasis-httpd(1)
   5664 
   5665 
   5666 
   5667 @menu
   5668 * Synopsis: Synopsis<6>. 
   5669 * Description: Description<6>. 
   5670 * Signals:: 
   5671 * See also:: 
   5672 * Bugs: Bugs<6>. 
   5673 
   5674 @end menu
   5675 
   5676 @node Synopsis<6>,Description<6>,,anastasis-httpd 1
   5677 @anchor{manpages/anastasis-httpd 1 synopsis}@anchor{a6}
   5678 @subsubsection Synopsis
   5679 
   5680 
   5681 @strong{anastasis-httpd}
   5682 
   5683 @node Description<6>,Signals,Synopsis<6>,anastasis-httpd 1
   5684 @anchor{manpages/anastasis-httpd 1 description}@anchor{a7}
   5685 @subsubsection Description
   5686 
   5687 
   5688 Banastasis-httpd is a command line tool to run the Anastasis (HTTP
   5689 backend).  The required configuration and database must exist before
   5690 running this command.
   5691 
   5692 Its options are as follows:
   5693 
   5694 
   5695 @table @asis
   5696 
   5697 @item @strong{-C} | @strong{–connection-close}
   5698 
   5699 Force each HTTP connection to be closed after each request.
   5700 
   5701 @item @strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}
   5702 
   5703 Use the configuration and other resources for the merchant to operate
   5704 from FILENAME.
   5705 
   5706 @item @strong{-h} | @strong{––help}
   5707 
   5708 Print short help on options.
   5709 
   5710 @item @strong{-v} | @strong{––version}
   5711 
   5712 Print version information.
   5713 @end table
   5714 
   5715 @node Signals,See also,Description<6>,anastasis-httpd 1
   5716 @anchor{manpages/anastasis-httpd 1 signals}@anchor{a8}
   5717 @subsubsection Signals
   5718 
   5719 
   5720 @strong{anastasis-httpd} responds to the following signals:
   5721 
   5722 
   5723 @table @asis
   5724 
   5725 @item @code{SIGTERM}
   5726 
   5727 Sending a SIGTERM to the process will cause it to shutdown cleanly.
   5728 @end table
   5729 
   5730 @node See also,Bugs<6>,Signals,anastasis-httpd 1
   5731 @anchor{manpages/anastasis-httpd 1 see-also}@anchor{a9}
   5732 @subsubsection See also
   5733 
   5734 
   5735 anastasis-dbinit(1), anastasis-config(1), anastasis-gtk(1), anastasis-reducer(1)
   5736 
   5737 @node Bugs<6>,,See also,anastasis-httpd 1
   5738 @anchor{manpages/anastasis-httpd 1 bugs}@anchor{aa}
   5739 @subsubsection Bugs
   5740 
   5741 
   5742 Report bugs by using @indicateurl{https://bugs.anastasis.lu} or by sending
   5743 electronic mail to <@email{contact@@anastasis.lu}>.
   5744 
   5745 @node anastasis-reducer 1,anastasis conf 5,anastasis-httpd 1,Man Pages
   5746 @anchor{manpages/anastasis-reducer 1 doc}@anchor{ab}@anchor{manpages/anastasis-reducer 1 anastasis-reducer-1}@anchor{ac}
   5747 @subsection anastasis-reducer(1)
   5748 
   5749 
   5750 
   5751 @menu
   5752 * Synopsis: Synopsis<7>. 
   5753 * Description: Description<7>. 
   5754 * See Also: See Also<6>. 
   5755 * Bugs: Bugs<7>. 
   5756 
   5757 @end menu
   5758 
   5759 @node Synopsis<7>,Description<7>,,anastasis-reducer 1
   5760 @anchor{manpages/anastasis-reducer 1 synopsis}@anchor{ad}
   5761 @subsubsection Synopsis
   5762 
   5763 
   5764 @strong{anastasis-reducer}
   5765 [@strong{-A**_*ID*_|_}–application=**@emph{ID}]
   5766 [@strong{-a**_*JSON*_|_}–arguments=@emph{JSON}]
   5767 [@strong{-b**_|_}–backup]
   5768 [@strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}]
   5769 [@strong{-h} | @strong{––help}]
   5770 [@strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}‌@emph{LOGLEVEL}]
   5771 [@strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}]
   5772 [@strong{-r**_|_}–restore]
   5773 [@strong{-v} | @strong{––version}] COMMAND
   5774 
   5775 @node Description<7>,See Also<6>,Synopsis<7>,anastasis-reducer 1
   5776 @anchor{manpages/anastasis-reducer 1 description}@anchor{ae}
   5777 @subsubsection Description
   5778 
   5779 
   5780 @strong{anastasis-reducer} is a command-line tool to run Anastasis
   5781 key recover and backup operations using a reducer-style interface.
   5782 The reducer will read the current state from standard input and
   5783 write the resulting state to standard output.  A COMMAND must
   5784 be given on the command line.  The arguments (if any) are to
   5785 be given in JSON format to the @strong{-a} option.  A list of
   5786 commands can be found in the @ref{66,,Reducer API}
   5787 chapter.
   5788 
   5789 
   5790 @table @asis
   5791 
   5792 @item @strong{-a} @emph{JSON} | @strong{––arguments=}@emph{JSON}
   5793 
   5794 Provide JSON inputs for the given command.
   5795 
   5796 @item @strong{-A} @emph{ID} | @strong{–application=}@emph{ID}
   5797 
   5798 Set the application ID to @emph{ID}. Default is empty, which means the application-id must be explicitly provided
   5799 as part of the JSON inputs or it will be omitted.
   5800 The @strong{-A} option overrides any application ID that
   5801 may be given in the @strong{-a} arguments. Application IDs
   5802 are used to store different types of secrets from different applications
   5803 while using the same user attributes. Basically the application ID
   5804 is included in the user attributes. Applications that
   5805 tightly integrate Anastasis should set the application ID to their
   5806 respective unique name, for example the GNU Taler wallet may use
   5807 @code{gnu-taler-wallet} for the application ID.
   5808 Forgetting the application ID makes the secrets irrecoverable.
   5809 
   5810 @item @strong{-b} | @strong{–backup}
   5811 
   5812 Begin fresh reducer operation for a back up operation.
   5813 
   5814 @item @strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}
   5815 
   5816 Use the configuration from @emph{FILENAME}.
   5817 
   5818 @item @strong{-h} | @strong{––help}
   5819 
   5820 Print short help on options.
   5821 
   5822 @item @strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}‌@emph{LOGLEVEL}
   5823 
   5824 Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO},
   5825 @code{WARNING}, @code{ERROR}.
   5826 
   5827 @item @strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}
   5828 
   5829 Send logging output to @emph{FILENAME}.
   5830 
   5831 @item @strong{-r} | @strong{–restore}
   5832 
   5833 Begin fresh reducer operation for a restore operation.
   5834 
   5835 @item @strong{-v} | @strong{––version}
   5836 
   5837 Print version information.
   5838 @end table
   5839 
   5840 @node See Also<6>,Bugs<7>,Description<7>,anastasis-reducer 1
   5841 @anchor{manpages/anastasis-reducer 1 see-also}@anchor{af}
   5842 @subsubsection See Also
   5843 
   5844 
   5845 anastasis-gtk(1), anastasis-httpd(1), anastasis.conf(5).
   5846 
   5847 @node Bugs<7>,,See Also<6>,anastasis-reducer 1
   5848 @anchor{manpages/anastasis-reducer 1 bugs}@anchor{b0}
   5849 @subsubsection Bugs
   5850 
   5851 
   5852 Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic
   5853 mail to <@email{contact@@anastasis.lu}>.
   5854 
   5855 @node anastasis conf 5,,anastasis-reducer 1,Man Pages
   5856 @anchor{manpages/anastasis conf 5 doc}@anchor{b1}@anchor{manpages/anastasis conf 5 anastasis-conf-5}@anchor{b2}
   5857 @subsection anastasis.conf(5)
   5858 
   5859 
   5860 
   5861 @menu
   5862 * Description: Description<8>. 
   5863 * SEE ALSO:: 
   5864 * BUGS:: 
   5865 
   5866 @end menu
   5867 
   5868 @node Description<8>,SEE ALSO,,anastasis conf 5
   5869 @anchor{manpages/anastasis conf 5 description}@anchor{b3}
   5870 @subsubsection Description
   5871 
   5872 
   5873 The configuration file is line-oriented.
   5874 Blank lines and whitespace at the beginning and end of a line are ignored.
   5875 Comments start with @code{#} or @code{%} in the first column
   5876 (after any beginning-of-line whitespace) and go to the end of the line.
   5877 
   5878 The file is split into sections.
   5879 Every section begins with “[SECTIONNAME]” and
   5880 contains a number of options of the form “OPTION=VALUE”.
   5881 There may be whitespace around the @code{=} (equal sign).
   5882 Section names and options are @emph{case-insensitive}.
   5883 
   5884 The values, however, are @emph{case-sensitive}.
   5885 In particular, boolean values are one of @code{YES} or @code{NO}.
   5886 Values can include whitespace by surrounding
   5887 the entire value with @code{"} (double quote).
   5888 Note, however, that there are no escape characters in such strings;
   5889 all characters between the double quotes (including other double quotes)
   5890 are taken verbatim.
   5891 
   5892 Values that represent filenames can begin with a @code{/bin/sh}-like
   5893 variable reference.
   5894 This can be simple, such as @code{$TMPDIR/foo}, or complex,
   5895 such as @code{$@{TMPDIR:-$@{TMP:-/tmp@}@}/foo}.
   5896 See @code{[PATHS]} (below).
   5897 
   5898 Values that represent a time duration are represented as a series of one or
   5899 more @code{NUMBER UNIT} pairs, e.g. @code{60 s}, @code{4 weeks 1 day}, @code{5 years 2 minutes}.
   5900 
   5901 Values that represent an amount are in the usual amount syntax:
   5902 @code{CURRENCY:VALUE.FRACTION}, e.g. @code{EUR:1.50}.
   5903 The @code{FRACTION} portion may extend up to 8 places.
   5904 
   5905 Files containing default values for many of the options described below
   5906 are installed under @code{$ANASTASIS_PREFIX/share/taler/config.d/}.
   5907 The configuration file given with @strong{-c} to Anastasis binaries
   5908 overrides these defaults.
   5909 
   5910 A configuration file may include another, by using the @code{@@INLINE@@} directive,
   5911 for example, in @code{main.conf}, you could write @code{@@INLINE@@ sub.conf} to
   5912 include the entirety of @code{sub.conf} at that point in @code{main.conf}.
   5913 .. TODO: Document ‘anastasis-config -V’ in light of ‘@@INLINE@@’ in taler-config(1).
   5914 
   5915 @menu
   5916 * GLOBAL OPTIONS:: 
   5917 * Backend options:: 
   5918 * Authorization options:: 
   5919 * Postgres database configuration:: 
   5920 
   5921 @end menu
   5922 
   5923 @node GLOBAL OPTIONS,Backend options,,Description<8>
   5924 @anchor{manpages/anastasis conf 5 global-options}@anchor{b4}
   5925 @subsubsection GLOBAL OPTIONS
   5926 
   5927 
   5928 The following options are from the @code{[anastasis]} section and used by
   5929 the @strong{anastasis-httpd} service.
   5930 
   5931 
   5932 @table @asis
   5933 
   5934 @item ANNUAL_FEE
   5935 
   5936 Annual fee to be paid for policy uploads, i.e. “EUR:1.5”.
   5937 
   5938 @item TRUTH_UPLOAD_FEE
   5939 
   5940 Annual fee to be paid for truth uploads, i.e. “EUR:1.5”.
   5941 
   5942 @item INSURANCE
   5943 
   5944 Amount up to which key shares are warranted, i.e. “EUR:1000000”.
   5945 
   5946 @item DB
   5947 
   5948 Database backend to use, only @code{postgres} is supported right now.
   5949 
   5950 @item UPLOAD_LIMIT_MB
   5951 
   5952 Maximum upload size for policy uploads in megabytes. Default is 1.
   5953 
   5954 @item ANNUAL_POLICY_UPLOAD_LIMIT
   5955 
   5956 Maximum number of policies uploaded per year of service. Default is 42.
   5957 
   5958 @item BUSINESS_NAME
   5959 
   5960 Name of the business.
   5961 
   5962 @item SERVER_SALT
   5963 
   5964 Must be set to a high-entropy random server salt that the provider must never
   5965 change after the initial configuration.
   5966 
   5967 @item PORT
   5968 
   5969 TCP port on which the HTTP service should listen on.
   5970 @end table
   5971 
   5972 @node Backend options,Authorization options,GLOBAL OPTIONS,Description<8>
   5973 @anchor{manpages/anastasis conf 5 backend-options}@anchor{b5}
   5974 @subsubsection Backend options
   5975 
   5976 
   5977 The following options are from the @code{[anastasis-merchant-backend]} section and used by
   5978 the @strong{anastasis-httpd} service.
   5979 
   5980 
   5981 @table @asis
   5982 
   5983 @item PAYMENT_BACKEND_URL
   5984 
   5985 Base-URL of the Taler merchant backend instance to use for payments.
   5986 
   5987 @item API_KEY
   5988 
   5989 API key to transmit to the merchant backend for authentication.
   5990 @end table
   5991 
   5992 @node Authorization options,Postgres database configuration,Backend options,Description<8>
   5993 @anchor{manpages/anastasis conf 5 authorization-options}@anchor{b6}
   5994 @subsubsection Authorization options
   5995 
   5996 
   5997 For each active authorization plugin, options must be configured in a
   5998 section called @code{[authorization-$PLUGIN]} where @code{$PLUGIN} is the
   5999 name of the authorization plugin.  Specific plugins may require
   6000 additional options, which are described in the respective sections
   6001 below.
   6002 
   6003 
   6004 @table @asis
   6005 
   6006 @item COST
   6007 
   6008 Fee the user has to pay to obtain a challenge from this
   6009 authorization plugin during recovery.
   6010 
   6011 @item ENABLED
   6012 
   6013 @code{yes} to enable this plugin, @code{no} to disable.
   6014 @end table
   6015 
   6016 @menu
   6017 * SMS Authorization options:: 
   6018 * Email Authorization options:: 
   6019 * Post Authorization options:: 
   6020 * IBAN Authorization options:: 
   6021 
   6022 @end menu
   6023 
   6024 @node SMS Authorization options,Email Authorization options,,Authorization options
   6025 @anchor{manpages/anastasis conf 5 sms-authorization-options}@anchor{b7}
   6026 @subsubsection SMS Authorization options
   6027 
   6028 
   6029 
   6030 @table @asis
   6031 
   6032 @item COMMAND
   6033 
   6034 Helper command to run to send SMS.  The command will be given the phone number as its first argument. The message to be transmitted will be passed via STDIN.
   6035 @end table
   6036 
   6037 @node Email Authorization options,Post Authorization options,SMS Authorization options,Authorization options
   6038 @anchor{manpages/anastasis conf 5 email-authorization-options}@anchor{b8}
   6039 @subsubsection Email Authorization options
   6040 
   6041 
   6042 
   6043 @table @asis
   6044 
   6045 @item COMMAND
   6046 
   6047 Helper command to run to send E-mail.  The command will be given the e-mail address as its first argument. The message to be transmitted will be passed via STDIN.
   6048 @end table
   6049 
   6050 @node Post Authorization options,IBAN Authorization options,Email Authorization options,Authorization options
   6051 @anchor{manpages/anastasis conf 5 post-authorization-options}@anchor{b9}
   6052 @subsubsection Post Authorization options
   6053 
   6054 
   6055 
   6056 @table @asis
   6057 
   6058 @item COMMAND
   6059 
   6060 Helper command to run to send physical mail.  The command will be given the mailing address address as its first argument in JSON object fields ‘full_name’, ‘street’, ‘city’, ‘postcode’ and ‘country’. The message to be transmitted will be passed via STDIN.
   6061 @end table
   6062 
   6063 @node IBAN Authorization options,,Post Authorization options,Authorization options
   6064 @anchor{manpages/anastasis conf 5 iban-authorization-options}@anchor{ba}
   6065 @subsubsection IBAN Authorization options
   6066 
   6067 
   6068 
   6069 @table @asis
   6070 
   6071 @item CREDIT_IBAN
   6072 
   6073 IBAN number where the consumers must
   6074 wire the money to for authentication.
   6075 
   6076 @item BUSINESS_NAME
   6077 
   6078 Name of the account holder.
   6079 
   6080 @item WIRE_GATEWAY_URL
   6081 
   6082 Base URL of the LibEuFin wire gateway (Anastasis facade).
   6083 
   6084 @item WIRE_GATEWAY_AUTH_METHOD
   6085 
   6086 Authentication method used to talk to the LibEuFin wire gateway, i.e. ‘basic’ for HTTP basic authentication.
   6087 
   6088 @item USERNAME
   6089 
   6090 Username to use when using HTTP basic authentication.
   6091 
   6092 @item PASSWORD
   6093 
   6094 Password to use when using HTTP basic authentication.
   6095 @end table
   6096 
   6097 @node Postgres database configuration,,Authorization options,Description<8>
   6098 @anchor{manpages/anastasis conf 5 postgres-database-configuration}@anchor{bb}
   6099 @subsubsection Postgres database configuration
   6100 
   6101 
   6102 The following options must be in the section @code{[statis-postgres]} if
   6103 @code{postgres} was used for the database under @code{DB} in the
   6104 @code{[anastasis]} section.
   6105 
   6106 
   6107 @table @asis
   6108 
   6109 @item CONFIG
   6110 
   6111 Path under which the Postgres database is that the service
   6112 should use, i.e. @code{postgres://anastasis}.
   6113 @end table
   6114 
   6115 @node SEE ALSO,BUGS,Description<8>,anastasis conf 5
   6116 @anchor{manpages/anastasis conf 5 see-also}@anchor{bc}
   6117 @subsubsection SEE ALSO
   6118 
   6119 
   6120 anastasis-httpd(1), anastasis-config(1)
   6121 
   6122 @node BUGS,,SEE ALSO,anastasis conf 5
   6123 @anchor{manpages/anastasis conf 5 bugs}@anchor{bd}
   6124 @subsubsection BUGS
   6125 
   6126 
   6127 Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic
   6128 mail to <@email{contact@@anastasis.lu}>.
   6129 
   6130 @node Complete Index,GNU Free Documentation License,Man Pages,Documentation Overview
   6131 @anchor{genindex doc}@anchor{be}@anchor{genindex complete-index}@anchor{bf}
   6132 @section Complete Index
   6133 
   6134 
   6135 @node GNU Free Documentation License,,Complete Index,Documentation Overview
   6136 @anchor{fdl-1 3 doc}@anchor{c0}@anchor{fdl-1 3 gnu-fdl-1-3}@anchor{c1}@anchor{fdl-1 3 gnu-free-documentation-license}@anchor{c2}
   6137 @section GNU Free Documentation License
   6138 
   6139 
   6140 Version 1.3, 3 November 2008
   6141 
   6142 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation,
   6143 Inc. @indicateurl{https://fsf.org/}
   6144 
   6145 Everyone is permitted to copy and distribute verbatim copies of this
   6146 license document, but changing it is not allowed.
   6147 
   6148 @menu
   6149 * 0. PREAMBLE: 0 PREAMBLE. 
   6150 * 1. APPLICABILITY AND DEFINITIONS: 1 APPLICABILITY AND DEFINITIONS. 
   6151 * 2. VERBATIM COPYING: 2 VERBATIM COPYING. 
   6152 * 3. COPYING IN QUANTITY: 3 COPYING IN QUANTITY. 
   6153 * 4. MODIFICATIONS: 4 MODIFICATIONS. 
   6154 * 5. COMBINING DOCUMENTS: 5 COMBINING DOCUMENTS. 
   6155 * 6. COLLECTIONS OF DOCUMENTS: 6 COLLECTIONS OF DOCUMENTS. 
   6156 * 7. AGGREGATION WITH INDEPENDENT WORKS: 7 AGGREGATION WITH INDEPENDENT WORKS. 
   6157 * 8. TRANSLATION: 8 TRANSLATION. 
   6158 * 9. TERMINATION: 9 TERMINATION. 
   6159 * 10. FUTURE REVISIONS OF THIS LICENSE: 10 FUTURE REVISIONS OF THIS LICENSE. 
   6160 * 11. RELICENSING: 11 RELICENSING. 
   6161 * ADDENDUM; How to use this License for your documents: ADDENDUM How to use this License for your documents. 
   6162 
   6163 @end menu
   6164 
   6165 @node 0 PREAMBLE,1 APPLICABILITY AND DEFINITIONS,,GNU Free Documentation License
   6166 @anchor{fdl-1 3 preamble}@anchor{c3}
   6167 @subsection 0. PREAMBLE
   6168 
   6169 
   6170 The purpose of this License is to make a manual, textbook, or other
   6171 functional and useful document “free” in the sense of freedom: to assure
   6172 everyone the effective freedom to copy and redistribute it, with or
   6173 without modifying it, either commercially or noncommercially.
   6174 Secondarily, this License preserves for the author and publisher a way
   6175 to get credit for their work, while not being considered responsible for
   6176 modifications made by others.
   6177 
   6178 This License is a kind of “copyleft”, which means that derivative works
   6179 of the document must themselves be free in the same sense. It
   6180 complements the GNU General Public License, which is a copyleft license
   6181 designed for free software.
   6182 
   6183 We have designed this License in order to use it for manuals for free
   6184 software, because free software needs free documentation: a free program
   6185 should come with manuals providing the same freedoms that the software
   6186 does. But this License is not limited to software manuals; it can be
   6187 used for any textual work, regardless of subject matter or whether it is
   6188 published as a printed book. We recommend this License principally for
   6189 works whose purpose is instruction or reference.
   6190 
   6191 @node 1 APPLICABILITY AND DEFINITIONS,2 VERBATIM COPYING,0 PREAMBLE,GNU Free Documentation License
   6192 @anchor{fdl-1 3 applicability-and-definitions}@anchor{c4}
   6193 @subsection 1. APPLICABILITY AND DEFINITIONS
   6194 
   6195 
   6196 This License applies to any manual or other work, in any medium, that
   6197 contains a notice placed by the copyright holder saying it can be
   6198 distributed under the terms of this License. Such a notice grants a
   6199 world-wide, royalty-free license, unlimited in duration, to use that
   6200 work under the conditions stated herein. The “Document”, below, refers
   6201 to any such manual or work. Any member of the public is a licensee, and
   6202 is addressed as “you”. You accept the license if you copy, modify or
   6203 distribute the work in a way requiring permission under copyright law.
   6204 
   6205 A “Modified Version” of the Document means any work containing the
   6206 Document or a portion of it, either copied verbatim, or with
   6207 modifications and/or translated into another language.
   6208 
   6209 A “Secondary Section” is a named appendix or a front-matter section of
   6210 the Document that deals exclusively with the relationship of the
   6211 publishers or authors of the Document to the Document’s overall subject
   6212 (or to related matters) and contains nothing that could fall directly
   6213 within that overall subject. (Thus, if the Document is in part a
   6214 textbook of mathematics, a Secondary Section may not explain any
   6215 mathematics.) The relationship could be a matter of historical
   6216 connection with the subject or with related matters, or of legal,
   6217 commercial, philosophical, ethical or political position regarding them.
   6218 
   6219 The “Invariant Sections” are certain Secondary Sections whose titles are
   6220 designated, as being those of Invariant Sections, in the notice that
   6221 says that the Document is released under this License. If a section does
   6222 not fit the above definition of Secondary then it is not allowed to be
   6223 designated as Invariant. The Document may contain zero Invariant
   6224 Sections. If the Document does not identify any Invariant Sections then
   6225 there are none.
   6226 
   6227 The “Cover Texts” are certain short passages of text that are listed, as
   6228 Front-Cover Texts or Back-Cover Texts, in the notice that says that the
   6229 Document is released under this License. A Front-Cover Text may be at
   6230 most 5 words, and a Back-Cover Text may be at most 25 words.
   6231 
   6232 A “Transparent” copy of the Document means a machine-readable copy,
   6233 represented in a format whose specification is available to the general
   6234 public, that is suitable for revising the document straightforwardly
   6235 with generic text editors or (for images composed of pixels) generic
   6236 paint programs or (for drawings) some widely available drawing editor,
   6237 and that is suitable for input to text formatters or for automatic
   6238 translation to a variety of formats suitable for input to text
   6239 formatters. A copy made in an otherwise Transparent file format whose
   6240 markup, or absence of markup, has been arranged to thwart or discourage
   6241 subsequent modification by readers is not Transparent. An image format
   6242 is not Transparent if used for any substantial amount of text. A copy
   6243 that is not “Transparent” is called “Opaque”.
   6244 
   6245 Examples of suitable formats for Transparent copies include plain ASCII
   6246 without markup, Texinfo input format, LaTeX input format, SGML or XML
   6247 using a publicly available DTD, and standard-conforming simple HTML,
   6248 PostScript or PDF designed for human modification. Examples of
   6249 transparent image formats include PNG, XCF and JPG. Opaque formats
   6250 include proprietary formats that can be read and edited only by
   6251 proprietary word processors, SGML or XML for which the DTD and/or
   6252 processing tools are not generally available, and the machine-generated
   6253 HTML, PostScript or PDF produced by some word processors for output
   6254 purposes only.
   6255 
   6256 The “Title Page” means, for a printed book, the title page itself, plus
   6257 such following pages as are needed to hold, legibly, the material this
   6258 License requires to appear in the title page. For works in formats which
   6259 do not have any title page as such, “Title Page” means the text near the
   6260 most prominent appearance of the work’s title, preceding the beginning
   6261 of the body of the text.
   6262 
   6263 The “publisher” means any person or entity that distributes copies of
   6264 the Document to the public.
   6265 
   6266 A section “Entitled XYZ” means a named subunit of the Document whose
   6267 title either is precisely XYZ or contains XYZ in parentheses following
   6268 text that translates XYZ in another language. (Here XYZ stands for a
   6269 specific section name mentioned below, such as “Acknowledgements”,
   6270 “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of
   6271 such a section when you modify the Document means that it remains a
   6272 section “Entitled XYZ” according to this definition.
   6273 
   6274 The Document may include Warranty Disclaimers next to the notice which
   6275 states that this License applies to the Document. These Warranty
   6276 Disclaimers are considered to be included by reference in this License,
   6277 but only as regards disclaiming warranties: any other implication that
   6278 these Warranty Disclaimers may have is void and has no effect on the
   6279 meaning of this License.
   6280 
   6281 @node 2 VERBATIM COPYING,3 COPYING IN QUANTITY,1 APPLICABILITY AND DEFINITIONS,GNU Free Documentation License
   6282 @anchor{fdl-1 3 verbatim-copying}@anchor{c5}
   6283 @subsection 2. VERBATIM COPYING
   6284 
   6285 
   6286 You may copy and distribute the Document in any medium, either
   6287 commercially or noncommercially, provided that this License, the
   6288 copyright notices, and the license notice saying this License applies to
   6289 the Document are reproduced in all copies, and that you add no other
   6290 conditions whatsoever to those of this License. You may not use
   6291 technical measures to obstruct or control the reading or further copying
   6292 of the copies you make or distribute. However, you may accept
   6293 compensation in exchange for copies. If you distribute a large enough
   6294 number of copies you must also follow the conditions in section 3.
   6295 
   6296 You may also lend copies, under the same conditions stated above, and
   6297 you may publicly display copies.
   6298 
   6299 @node 3 COPYING IN QUANTITY,4 MODIFICATIONS,2 VERBATIM COPYING,GNU Free Documentation License
   6300 @anchor{fdl-1 3 copying-in-quantity}@anchor{c6}
   6301 @subsection 3. COPYING IN QUANTITY
   6302 
   6303 
   6304 If you publish printed copies (or copies in media that commonly have
   6305 printed covers) of the Document, numbering more than 100, and the
   6306 Document’s license notice requires Cover Texts, you must enclose the
   6307 copies in covers that carry, clearly and legibly, all these Cover Texts:
   6308 Front-Cover Texts on the front cover, and Back-Cover Texts on the back
   6309 cover. Both covers must also clearly and legibly identify you as the
   6310 publisher of these copies. The front cover must present the full title
   6311 with all words of the title equally prominent and visible. You may add
   6312 other material on the covers in addition. Copying with changes limited
   6313 to the covers, as long as they preserve the title of the Document and
   6314 satisfy these conditions, can be treated as verbatim copying in other
   6315 respects.
   6316 
   6317 If the required texts for either cover are too voluminous to fit
   6318 legibly, you should put the first ones listed (as many as fit
   6319 reasonably) on the actual cover, and continue the rest onto adjacent
   6320 pages.
   6321 
   6322 If you publish or distribute Opaque copies of the Document numbering
   6323 more than 100, you must either include a machine-readable Transparent
   6324 copy along with each Opaque copy, or state in or with each Opaque copy a
   6325 computer-network location from which the general network-using public
   6326 has access to download using public-standard network protocols a
   6327 complete Transparent copy of the Document, free of added material. If
   6328 you use the latter option, you must take reasonably prudent steps, when
   6329 you begin distribution of Opaque copies in quantity, to ensure that this
   6330 Transparent copy will remain thus accessible at the stated location
   6331 until at least one year after the last time you distribute an Opaque
   6332 copy (directly or through your agents or retailers) of that edition to
   6333 the public.
   6334 
   6335 It is requested, but not required, that you contact the authors of the
   6336 Document well before redistributing any large number of copies, to give
   6337 them a chance to provide you with an updated version of the Document.
   6338 
   6339 @node 4 MODIFICATIONS,5 COMBINING DOCUMENTS,3 COPYING IN QUANTITY,GNU Free Documentation License
   6340 @anchor{fdl-1 3 modifications}@anchor{c7}
   6341 @subsection 4. MODIFICATIONS
   6342 
   6343 
   6344 You may copy and distribute a Modified Version of the Document under the
   6345 conditions of sections 2 and 3 above, provided that you release the
   6346 Modified Version under precisely this License, with the Modified Version
   6347 filling the role of the Document, thus licensing distribution and
   6348 modification of the Modified Version to whoever possesses a copy of it.
   6349 In addition, you must do these things in the Modified Version:
   6350 
   6351 
   6352 @itemize -
   6353 
   6354 @item 
   6355 A. Use in the Title Page (and on the covers, if any) a title distinct
   6356 from that of the Document, and from those of previous versions (which
   6357 should, if there were any, be listed in the History section of the
   6358 Document). You may use the same title as a previous version if the
   6359 original publisher of that version gives permission.
   6360 
   6361 @item 
   6362 B. List on the Title Page, as authors, one or more persons or
   6363 entities responsible for authorship of the modifications in the
   6364 Modified Version, together with at least five of the principal
   6365 authors of the Document (all of its principal authors, if it has
   6366 fewer than five), unless they release you from this requirement.
   6367 
   6368 @item 
   6369 C. State on the Title page the name of the publisher of the Modified
   6370 Version, as the publisher.
   6371 
   6372 @item 
   6373 
   6374 @enumerate 4
   6375 
   6376 @item 
   6377 Preserve all the copyright notices of the Document.
   6378 @end enumerate
   6379 
   6380 @item 
   6381 E. Add an appropriate copyright notice for your modifications
   6382 adjacent to the other copyright notices.
   6383 
   6384 @item 
   6385 F. Include, immediately after the copyright notices, a license notice
   6386 giving the public permission to use the Modified Version under the
   6387 terms of this License, in the form shown in the Addendum below.
   6388 
   6389 @item 
   6390 G. Preserve in that license notice the full lists of Invariant
   6391 Sections and required Cover Texts given in the Document’s license
   6392 notice.
   6393 
   6394 @item 
   6395 
   6396 @enumerate 8
   6397 
   6398 @item 
   6399 Include an unaltered copy of this License.
   6400 @end enumerate
   6401 
   6402 @item 
   6403 I. Preserve the section Entitled “History”, Preserve its Title, and
   6404 add to it an item stating at least the title, year, new authors, and
   6405 publisher of the Modified Version as given on the Title Page. If
   6406 there is no section Entitled “History” in the Document, create one
   6407 stating the title, year, authors, and publisher of the Document as
   6408 given on its Title Page, then add an item describing the Modified
   6409 Version as stated in the previous sentence.
   6410 
   6411 @item 
   6412 J. Preserve the network location, if any, given in the Document for
   6413 public access to a Transparent copy of the Document, and likewise the
   6414 network locations given in the Document for previous versions it was
   6415 based on. These may be placed in the “History” section. You may omit
   6416 a network location for a work that was published at least four years
   6417 before the Document itself, or if the original publisher of the
   6418 version it refers to gives permission.
   6419 
   6420 @item 
   6421 K. For any section Entitled “Acknowledgements” or “Dedications”,
   6422 Preserve the Title of the section, and preserve in the section all
   6423 the substance and tone of each of the contributor acknowledgements
   6424 and/or dedications given therein.
   6425 
   6426 @item 
   6427 L. Preserve all the Invariant Sections of the Document, unaltered in
   6428 their text and in their titles. Section numbers or the equivalent are
   6429 not considered part of the section titles.
   6430 
   6431 @item 
   6432 M. Delete any section Entitled “Endorsements”. Such a section may not
   6433 be included in the Modified Version.
   6434 
   6435 @item 
   6436 N. Do not retitle any existing section to be Entitled “Endorsements”
   6437 or to conflict in title with any Invariant Section.
   6438 
   6439 @item 
   6440 
   6441 @enumerate 15
   6442 
   6443 @item 
   6444 Preserve any Warranty Disclaimers.
   6445 @end enumerate
   6446 @end itemize
   6447 
   6448 If the Modified Version includes new front-matter sections or appendices
   6449 that qualify as Secondary Sections and contain no material copied from
   6450 the Document, you may at your option designate some or all of these
   6451 sections as invariant. To do this, add their titles to the list of
   6452 Invariant Sections in the Modified Version’s license notice. These
   6453 titles must be distinct from any other section titles.
   6454 
   6455 You may add a section Entitled “Endorsements”, provided it contains
   6456 nothing but endorsements of your Modified Version by various
   6457 parties—for example, statements of peer review or that the text has
   6458 been approved by an organization as the authoritative definition of a
   6459 standard.
   6460 
   6461 You may add a passage of up to five words as a Front-Cover Text, and a
   6462 passage of up to 25 words as a Back-Cover Text, to the end of the list
   6463 of Cover Texts in the Modified Version. Only one passage of Front-Cover
   6464 Text and one of Back-Cover Text may be added by (or through arrangements
   6465 made by) any one entity. If the Document already includes a cover text
   6466 for the same cover, previously added by you or by arrangement made by
   6467 the same entity you are acting on behalf of, you may not add another;
   6468 but you may replace the old one, on explicit permission from the
   6469 previous publisher that added the old one.
   6470 
   6471 The author(s) and publisher(s) of the Document do not by this License
   6472 give permission to use their names for publicity for or to assert or
   6473 imply endorsement of any Modified Version.
   6474 
   6475 @node 5 COMBINING DOCUMENTS,6 COLLECTIONS OF DOCUMENTS,4 MODIFICATIONS,GNU Free Documentation License
   6476 @anchor{fdl-1 3 combining-documents}@anchor{c8}
   6477 @subsection 5. COMBINING DOCUMENTS
   6478 
   6479 
   6480 You may combine the Document with other documents released under this
   6481 License, under the terms defined in section 4 above for modified
   6482 versions, provided that you include in the combination all of the
   6483 Invariant Sections of all of the original documents, unmodified, and
   6484 list them all as Invariant Sections of your combined work in its license
   6485 notice, and that you preserve all their Warranty Disclaimers.
   6486 
   6487 The combined work need only contain one copy of this License, and
   6488 multiple identical Invariant Sections may be replaced with a single
   6489 copy. If there are multiple Invariant Sections with the same name but
   6490 different contents, make the title of each such section unique by adding
   6491 at the end of it, in parentheses, the name of the original author or
   6492 publisher of that section if known, or else a unique number. Make the
   6493 same adjustment to the section titles in the list of Invariant Sections
   6494 in the license notice of the combined work.
   6495 
   6496 In the combination, you must combine any sections Entitled “History” in
   6497 the various original documents, forming one section Entitled “History”;
   6498 likewise combine any sections Entitled “Acknowledgements”, and any
   6499 sections Entitled “Dedications”. You must delete all sections Entitled
   6500 “Endorsements”.
   6501 
   6502 @node 6 COLLECTIONS OF DOCUMENTS,7 AGGREGATION WITH INDEPENDENT WORKS,5 COMBINING DOCUMENTS,GNU Free Documentation License
   6503 @anchor{fdl-1 3 collections-of-documents}@anchor{c9}
   6504 @subsection 6. COLLECTIONS OF DOCUMENTS
   6505 
   6506 
   6507 You may make a collection consisting of the Document and other documents
   6508 released under this License, and replace the individual copies of this
   6509 License in the various documents with a single copy that is included in
   6510 the collection, provided that you follow the rules of this License for
   6511 verbatim copying of each of the documents in all other respects.
   6512 
   6513 You may extract a single document from such a collection, and distribute
   6514 it individually under this License, provided you insert a copy of this
   6515 License into the extracted document, and follow this License in all
   6516 other respects regarding verbatim copying of that document.
   6517 
   6518 @node 7 AGGREGATION WITH INDEPENDENT WORKS,8 TRANSLATION,6 COLLECTIONS OF DOCUMENTS,GNU Free Documentation License
   6519 @anchor{fdl-1 3 aggregation-with-independent-works}@anchor{ca}
   6520 @subsection 7. AGGREGATION WITH INDEPENDENT WORKS
   6521 
   6522 
   6523 A compilation of the Document or its derivatives with other separate and
   6524 independent documents or works, in or on a volume of a storage or
   6525 distribution medium, is called an “aggregate” if the copyright resulting
   6526 from the compilation is not used to limit the legal rights of the
   6527 compilation’s users beyond what the individual works permit. When the
   6528 Document is included in an aggregate, this License does not apply to the
   6529 other works in the aggregate which are not themselves derivative works
   6530 of the Document.
   6531 
   6532 If the Cover Text requirement of section 3 is applicable to these copies
   6533 of the Document, then if the Document is less than one half of the
   6534 entire aggregate, the Document’s Cover Texts may be placed on covers
   6535 that bracket the Document within the aggregate, or the electronic
   6536 equivalent of covers if the Document is in electronic form. Otherwise
   6537 they must appear on printed covers that bracket the whole aggregate.
   6538 
   6539 @node 8 TRANSLATION,9 TERMINATION,7 AGGREGATION WITH INDEPENDENT WORKS,GNU Free Documentation License
   6540 @anchor{fdl-1 3 translation}@anchor{cb}
   6541 @subsection 8. TRANSLATION
   6542 
   6543 
   6544 Translation is considered a kind of modification, so you may distribute
   6545 translations of the Document under the terms of section 4. Replacing
   6546 Invariant Sections with translations requires special permission from
   6547 their copyright holders, but you may include translations of some or all
   6548 Invariant Sections in addition to the original versions of these
   6549 Invariant Sections. You may include a translation of this License, and
   6550 all the license notices in the Document, and any Warranty Disclaimers,
   6551 provided that you also include the original English version of this
   6552 License and the original versions of those notices and disclaimers. In
   6553 case of a disagreement between the translation and the original version
   6554 of this License or a notice or disclaimer, the original version will
   6555 prevail.
   6556 
   6557 If a section in the Document is Entitled “Acknowledgements”,
   6558 “Dedications”, or “History”, the requirement (section 4) to Preserve its
   6559 Title (section 1) will typically require changing the actual title.
   6560 
   6561 @node 9 TERMINATION,10 FUTURE REVISIONS OF THIS LICENSE,8 TRANSLATION,GNU Free Documentation License
   6562 @anchor{fdl-1 3 termination}@anchor{cc}
   6563 @subsection 9. TERMINATION
   6564 
   6565 
   6566 You may not copy, modify, sublicense, or distribute the Document except
   6567 as expressly provided under this License. Any attempt otherwise to copy,
   6568 modify, sublicense, or distribute it is void, and will automatically
   6569 terminate your rights under this License.
   6570 
   6571 However, if you cease all violation of this License, then your license
   6572 from a particular copyright holder is reinstated (a) provisionally,
   6573 unless and until the copyright holder explicitly and finally terminates
   6574 your license, and (b) permanently, if the copyright holder fails to
   6575 notify you of the violation by some reasonable means prior to 60 days
   6576 after the cessation.
   6577 
   6578 Moreover, your license from a particular copyright holder is reinstated
   6579 permanently if the copyright holder notifies you of the violation by
   6580 some reasonable means, this is the first time you have received notice
   6581 of violation of this License (for any work) from that copyright holder,
   6582 and you cure the violation prior to 30 days after your receipt of the
   6583 notice.
   6584 
   6585 Termination of your rights under this section does not terminate the
   6586 licenses of parties who have received copies or rights from you under
   6587 this License. If your rights have been terminated and not permanently
   6588 reinstated, receipt of a copy of some or all of the same material does
   6589 not give you any rights to use it.
   6590 
   6591 @node 10 FUTURE REVISIONS OF THIS LICENSE,11 RELICENSING,9 TERMINATION,GNU Free Documentation License
   6592 @anchor{fdl-1 3 future-revisions-of-this-license}@anchor{cd}
   6593 @subsection 10. FUTURE REVISIONS OF THIS LICENSE
   6594 
   6595 
   6596 The Free Software Foundation may publish new, revised versions of the
   6597 GNU Free Documentation License from time to time. Such new versions will
   6598 be similar in spirit to the present version, but may differ in detail to
   6599 address new problems or concerns. See @indicateurl{https://www.gnu.org/licenses/}.
   6600 
   6601 Each version of the License is given a distinguishing version number. If
   6602 the Document specifies that a particular numbered version of this
   6603 License “or any later version” applies to it, you have the option of
   6604 following the terms and conditions either of that specified version or
   6605 of any later version that has been published (not as a draft) by the
   6606 Free Software Foundation. If the Document does not specify a version
   6607 number of this License, you may choose any version ever published (not
   6608 as a draft) by the Free Software Foundation. If the Document specifies
   6609 that a proxy can decide which future versions of this License can be
   6610 used, that proxy’s public statement of acceptance of a version
   6611 permanently authorizes you to choose that version for the Document.
   6612 
   6613 @node 11 RELICENSING,ADDENDUM How to use this License for your documents,10 FUTURE REVISIONS OF THIS LICENSE,GNU Free Documentation License
   6614 @anchor{fdl-1 3 relicensing}@anchor{ce}
   6615 @subsection 11. RELICENSING
   6616 
   6617 
   6618 “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any World
   6619 Wide Web server that publishes copyrightable works and also provides
   6620 prominent facilities for anybody to edit those works. A public wiki that
   6621 anybody can edit is an example of such a server. A “Massive Multiauthor
   6622 Collaboration” (or “MMC”) contained in the site means any set of
   6623 copyrightable works thus published on the MMC site.
   6624 
   6625 “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0
   6626 license published by Creative Commons Corporation, a not-for-profit
   6627 corporation with a principal place of business in San Francisco,
   6628 California, as well as future copyleft versions of that license
   6629 published by that same organization.
   6630 
   6631 “Incorporate” means to publish or republish a Document, in whole or in
   6632 part, as part of another Document.
   6633 
   6634 An MMC is “eligible for relicensing” if it is licensed under this
   6635 License, and if all works that were first published under this License
   6636 somewhere other than this MMC, and subsequently incorporated in whole or
   6637 in part into the MMC, (1) had no cover texts or invariant sections, and
   6638 (2) were thus incorporated prior to November 1, 2008.
   6639 
   6640 The operator of an MMC Site may republish an MMC contained in the site
   6641 under CC-BY-SA on the same site at any time before August 1, 2009,
   6642 provided the MMC is eligible for relicensing.
   6643 
   6644 @node ADDENDUM How to use this License for your documents,,11 RELICENSING,GNU Free Documentation License
   6645 @anchor{fdl-1 3 addendum-how-to-use-this-license-for-your-documents}@anchor{cf}
   6646 @subsection ADDENDUM: How to use this License for your documents
   6647 
   6648 
   6649 To use this License in a document you have written, include a copy of
   6650 the License in the document and put the following copyright and license
   6651 notices just after the title page:
   6652 
   6653 @example
   6654 Copyright (C)  YEAR  YOUR NAME.
   6655 Permission is granted to copy, distribute and/or modify this document
   6656 under the terms of the GNU Free Documentation License, Version 1.3
   6657 or any later version published by the Free Software Foundation;
   6658 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
   6659 A copy of the license is included in the section entitled "GNU
   6660 Free Documentation License".
   6661 @end example
   6662 
   6663 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
   6664 replace the “with … Texts.” line with this:
   6665 
   6666 @example
   6667 with the Invariant Sections being LIST THEIR TITLES, with the
   6668 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
   6669 @end example
   6670 
   6671 If you have Invariant Sections without Cover Texts, or some other
   6672 combination of the three, merge those two alternatives to suit the
   6673 situation.
   6674 
   6675 If your document contains nontrivial examples of program code, we
   6676 recommend releasing these examples in parallel under your choice of free
   6677 software license, such as the GNU General Public License, to permit
   6678 their use in free software.
   6679 @anchor{30}@w{                              }
   6680 @anchor{rest tsref-type-ErrorDetail}@w{                              }
   6681 
   6682 @c %**end of body
   6683 @bye