taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

api-common.rst (76008B)


      1 ..
      2   This file is part of GNU TALER.
      3   Copyright (C) 2014, 2015, 2016 GNUnet e.V. and INRIA
      4 
      5   TALER is free software; you can redistribute it and/or modify it under the
      6   terms of the GNU Affero Public License as published by the Free Software
      7   Foundation; either version 3.0, or (at your option) any later version.
      8 
      9   TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11   A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
     12 
     13   You should have received a copy of the GNU Affero General Public License along with
     14   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 
     16   @author Christian Grothoff
     17   @author Marcello Stanisci
     18   @author Özgür Kesim
     19 
     20 .. _http-common:
     21 
     22 ==================================
     23 Conventions for Taler RESTful APIs
     24 ==================================
     25 
     26 -------------------------
     27 HTTP Request and Response
     28 -------------------------
     29 
     30 Certain response formats are common for all requests. They are documented here
     31 instead of with each individual request.  Furthermore, we note that clients may
     32 theoretically fail to receive any response.  In this case, the client should
     33 verify that the Internet connection is working properly, and then proceed to
     34 handle the error as if an internal error (500) had been returned.
     35 
     36 .. http:any:: /*
     37 
     38 
     39   **Request:**
     40 
     41   Unless specified otherwise, HTTP requests that carry a message body must
     42   have the content type ``application/json``.
     43 
     44   :reqheader Content-Type: application/json
     45 
     46   **Response:**
     47 
     48   :resheader Content-Type: application/json
     49 
     50   :http:statuscode:`200 Ok`:
     51     The request was successful.
     52   :http:statuscode:`301 Moved permanently`:
     53     The server responsible for the reserve
     54     changed, the client MUST follow the link to the new location. If possible,
     55     the client SHOULD remember the new URL for the reserve for future
     56     requests.  Only applicable if the request method is GET.
     57   :http:statuscode:`302 Found`:
     58     The server responsible for the reserve changed, the
     59     client MUST follow the link to the new location, but MUST NOT retain the
     60     new URL for future requests.  Only applicable if the request method is GET.
     61   :http:statuscode:`307 Temporary redirect`:
     62     The server responsible for the reserve changed, the
     63     client MUST follow the link to the new location, but MUST NOT retain the
     64     new URL for future requests.
     65   :http:statuscode:`308 Permanent redirect`:
     66     The server responsible for the reserve
     67     changed, the client MUST follow the link to the new location. If possible,
     68     the client SHOULD remember the new URL for the reserve for future
     69     requests.
     70   :http:statuscode:`400 Bad request`:
     71     One of the arguments to the request is missing or malformed.
     72   :http:statuscode:`415 Unsupported Media Type`:
     73     The Content-Type header was not set, or it was set to an unsupported MIME type.
     74   :http:statuscode:`500 Internal server error`:
     75     This always indicates some serious internal operational error of the exchange,
     76     such as a program bug, database problems, etc., and must not be used for
     77     client-side problems.  When facing an internal server error, clients should
     78     retry their request after some delay.  We recommend initially trying after
     79     1s, twice more at randomized times within 1 minute, then the user should be
     80     informed and another three retries should be scheduled within the next 24h.
     81     If the error persists, a report should ultimately be made to the auditor,
     82     although the auditor API for this is not yet specified.  However, as internal
     83     server errors are always reported to the exchange operator, a good operator
     84     should naturally be able to address them in a timely fashion, especially
     85     within 24h.
     86 
     87   Unless specified otherwise, all error status codes (4xx and 5xx) have a message
     88   body with an `ErrorDetail` JSON object.
     89 
     90   **Details:**
     91 
     92   .. ts:def:: ErrorDetail
     93 
     94     interface ErrorDetail {
     95 
     96       // Numeric `error code <error-codes>` unique to the condition.
     97       // The other arguments are specific to the error value reported here.
     98       code: ErrorCode;
     99 
    100       // Human-readable description of the error, i.e. "missing parameter", "commitment violation", ...
    101       // Should give a human-readable hint about the error's nature. Optional, may change without notice!
    102       hint?: string;
    103 
    104       // Optional detail about the specific input value that failed. May change without notice!
    105       detail?: string;
    106 
    107       // Name of the parameter that was bogus (if applicable).
    108       parameter?: string;
    109 
    110       // Path to the argument that was bogus (if applicable).
    111       path?: string;
    112 
    113       // Offset of the argument that was bogus (if applicable).
    114       offset?: string;
    115 
    116       // Index of the argument that was bogus (if applicable).
    117       index?: string;
    118 
    119       // Name of the object that was bogus (if applicable).
    120       object?: string;
    121 
    122       // Name of the currency that was problematic (if applicable).
    123       currency?: string;
    124 
    125       // Expected type (if applicable).
    126       type_expected?: string;
    127 
    128       // Type that was provided instead (if applicable).
    129       type_actual?: string;
    130 
    131       // Extra information that doesn't fit into the above (if applicable).
    132       extra?: Object;
    133     }
    134 
    135   .. ts:def:: ErrorCode
    136 
    137     // Numeric `error code <error-codes>` unique to the condition.
    138     // The other arguments are specific to the error value reported here.
    139     type ErrorCode = Integer;
    140 
    141 -----------------------
    142 Protocol Version Ranges
    143 -----------------------
    144 
    145 Some of the Taler services (e.g. exchange, merchant, bank integration API)
    146 expose the range of API versions they support.  Clients in turn have an API
    147 version range they support.  These version ranges are written down in the
    148 `libtool version format <https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html>`__.
    149 
    150 A protocol version is a positive, non-zero integer.  A protocol version range consists of three components:
    151 
    152 1. The ``current`` version.  This is the latest version of the protocol supported by the client or service.
    153 2. The ``revision`` number.  This value should usually not be interpreted by the client/server, but serves
    154    purely as a comment.  Each time a service/client for a protocol is updated while supporting the same
    155    set of protocol versions, the revision should be increased.
    156    In rare cases, the revision number can be used to work around unintended breakage in deployed
    157    versions of a service.  This is discouraged and should only be used in exceptional situations.
    158 3. The ``age`` number.  This non-zero integer identifies with how many previous protocol versions this
    159    implementation is compatible.  An ``age`` of 0 implies that the implementation only supports
    160    the ``current`` protocol version.  The ``age`` must be less or equal than the ``current`` protocol version.
    161 
    162 To avoid confusion with semantic versions, the protocol version range is written down in the following format:
    163 
    164 .. code:: none
    165 
    166   current[:revision[:age]]
    167 
    168 The angle brackets mark optional components. If either ``revision`` or ``age`` are omitted, they default to 0.
    169 
    170 Examples:
    171 
    172 * "1" and "1" are compatible
    173 * "1" and "2" are **incompatible**
    174 * "2:0:1" and "1:0:0" are compatible
    175 * "2:5:1" and "1:10:0" are compatible
    176 * "4:0:1" and "2:0:0" are **incompatible**
    177 * "4:0:1" and "3:0:0" are compatible
    178 
    179 .. note::
    180 
    181   `Semantic versions <https://semver.org/>`__ are not a good tool for this job, as we concisely want to express
    182   that the client/server supports the last ``n`` versions of the protocol.
    183   Semantic versions don't support this, and semantic version ranges are too complex for this.
    184 
    185 .. warning::
    186 
    187   A client doesn't have one single protocol version range.  Instead, it has
    188   a protocol version range for each type of service it talks to.
    189 
    190 .. warning::
    191 
    192   For privacy reasons, the protocol version range of a client should not be
    193   sent to the service.  Instead, the client should just use the two version ranges
    194   to decide whether it will talk to the service.
    195 
    196 .. _error-codes:
    197 
    198 -----------
    199 Error Codes
    200 -----------
    201 
    202 All error codes used in GNU Taler are defined in
    203 `GANA <https://git.gnunet.org/gana.git/tree/gnu-taler-error-codes/>`__.
    204 
    205 This centralized registry also contains generators that create enumerations
    206 and mappings from error codes to HTTP status codes and human-readable error
    207 messages for various programming languages.
    208 
    209 All error codes have numeric values below 100 or above 1000, so as to never be
    210 confused with HTTP status codes.  A value of 0 is reserved for "no error" or
    211 "success".
    212 
    213 In C, the respective enumeration is the ``enum TALER_ErrorCode``.
    214 
    215 Developers may have to re-run ``bootstrap`` and/or update their Git
    216 submodules to ensure that they have the latest GANA registry.
    217 
    218 ---------------------
    219 Common query patterns
    220 ---------------------
    221 
    222 .. _row-id-pagination:
    223 
    224 Row ID pagination
    225 ^^^^^^^^^^^^^^^^^
    226 
    227 Some endpoints paginate elements identified by an opaque numeric identifier,
    228 referred to here as *row ID*. The semantics of the row ID (including its
    229 sorting order) are determined by the server and are completely opaque to the
    230 client.
    231 
    232 The list of returned elements is determined by a row ID *offset*
    233 and a non-zero signed integer *limit*:
    234 
    235 * If *limit* is positive, return a list of up to *limit* elements (all matching
    236   the filter criteria) strictly **after** the *offset*. The elements are sorted
    237   in **ascending** order of the row ID.
    238 * If *limit* is negative, return a list of up to *-limit* elements (all matching
    239   the filter criteria) strictly **before** the *offset*. The elements are sorted
    240   in **descending** order of the row ID.
    241 
    242 If *offset* is not explicitly given, it defaults to:
    243 
    244 * A value **smaller** than all other row IDs if *limit* is **positive**.
    245 * A value **larger** than all other row IDs if *limit* is **negative**.
    246 
    247 :query limit: *Optional.*
    248   At most return the given number of results. Negative for descending by row
    249   ID, positive for ascending by row ID.
    250 :query offset: *Optional.*
    251   Starting row ID for an iteration.
    252 
    253 .. _long-polling:
    254 
    255 Long polling
    256 ^^^^^^^^^^^^
    257 
    258 Endpoints can result in an empty response (pagination) or a negative response
    259 (uncompleted operation, etc). Some endpoints allow clients to perform a form of
    260 long polling by asking the server to wait until *timeout_ms* for a non-empty or
    261 positive result.
    262 
    263 In the case of pagination, the response is sent as soon as a matching element
    264 is found and, therefore, the response MAY contain fewer than *limit* elements.
    265 
    266 A client MUST never rely on this behavior, as a response can be sent
    267 immediately or after waiting only a fraction of *timeout_ms*.
    268 
    269 :query timeout_ms: *Optional.*
    270   Timeout in milliseconds to wait for the response to be non-empty or positive.
    271 
    272 .. _encodings-ref:
    273 
    274 ----------------
    275 Common encodings
    276 ----------------
    277 
    278 This section describes how certain types of values are represented throughout the API.
    279 
    280 .. _slug:
    281 
    282 Slugs
    283 ^^^^^
    284 
    285 Many objects are identified by short, mostly human-chosen labels, such as
    286 merchant instance, order, product, template or token family identifiers.
    287 Because these labels are used as path components of HTTP endpoint URLs (like
    288 ``$INSTANCE`` or ``$ORDER_ID``), they must be usable in a URL path segment
    289 without any escaping.  We call such an identifier a *slug*.
    290 
    291 .. ts:def:: Slug
    292 
    293   // Non-empty string that can be used as-is as a single path
    294   // component of a URL.  A slug must only use ASCII alphanumeric
    295   // characters ("A-Z", "a-z", "0-9") and the five punctuation
    296   // characters "-", ".", "_", ":" and "~".  Consequently a slug
    297   // never contains a "/" and never requires percent-encoding.
    298   // The strings "." and ".." are not valid slugs, as they have a
    299   // special meaning in URL paths.
    300   // Slugs are case-sensitive.  Individual endpoints may impose
    301   // additional restrictions on the slugs they accept; those are
    302   // documented with the respective endpoint or field.
    303   type Slug = string;
    304 
    305 A slug is thus the set of RFC 3986 *unreserved* characters, plus ``:``.  The
    306 character set is deliberately narrower than what RFC 3986 permits in a path
    307 segment: it excludes ``@`` and all sub-delimiters, which are legal in a URL
    308 path but cause trouble once a slug is embedded in other syntax, such as a
    309 shell command, a query string or a filename.
    310 
    311 Note that a slug is *not* the same as an opaque identifier that merely happens
    312 to be a string: identifiers that may contain arbitrary characters (and thus
    313 require percent-encoding when put into a URL) are documented as plain
    314 ``string``.
    315 
    316 .. _weburl:
    317 
    318 Web URLs
    319 ^^^^^^^^
    320 
    321 Many fields point at another service or at a Web resource, such as the base
    322 URL of an exchange, the URL of a webhook or the fulfillment URL of an order.
    323 We call such a value a *Web URL*.
    324 
    325 .. ts:def:: WebURL
    326 
    327   // Non-empty string with an absolute URL that begins with either
    328   // "http://" or "https://" (the scheme is matched
    329   // case-insensitively).  A Web URL must only use ASCII alphanumeric
    330   // characters ("A-Z", "a-z", "0-9") and the punctuation characters
    331   // "/", ":", ";", "&", "?", "-", ".", ",", "=", "_", "~", "%", "+"
    332   // and "#".  Any other character (in particular spaces and all
    333   // non-ASCII characters) must be percent-encoded.
    334   // Individual endpoints may impose additional restrictions on the
    335   // Web URLs they accept; those are documented with the respective
    336   // endpoint or field.
    337   type WebURL = string;
    338 
    339 Fields that are documented as a *base URL* are Web URLs that additionally
    340 must end with a slash (``/``), so that the name of an endpoint can simply be
    341 appended to obtain the URL of that endpoint.
    342 
    343 Note that URIs using other schemes are *not* Web URLs.  In particular,
    344 ``payto://``-URIs (see :ref:`below <payto>`) and the ``taler://``-URIs handed
    345 to wallets have their own types or are documented as plain ``string``.
    346 
    347 .. _payto:
    348 
    349 
    350 Payto URIs:
    351 ^^^^^^^^^^^
    352 
    353 RFC 8905 defines payto://-URIs which GNU Taler uses to identify bank
    354 accounts. In GNU Taler, we primarily distinguish three types of
    355 payto://-URIs:
    356 
    357 * First, a **normalized** payto-URI uniquely identifies a bank account (or
    358   wallet) and must be able to serve as a canonical representation of such a
    359   bank account.  Thus, optional arguments such as the *receiver-name* or
    360   optional path components such as the BIC must be removed and the account
    361   must be given in a canonical form for the wire method (for example,
    362   everything in lower-case).
    363 
    364 * Second, a **full** payto-URI is not expected to have a canonical form for
    365   a bank account (there can be many full payto-URIs for the same bank
    366   account) and must include at least the *receiver-name* but possibly also
    367   other (in RFC 8905 optional) arguments to identify the recipient, as
    368   those may be needed to do a wire transfer.
    369 
    370 * On occasion, we also use full payto://-URIs that additionally specify the
    371   *amount* and wire transfer *subject* and are actually intended to trigger
    372   a wire transfer.
    373 
    374 
    375 .. _base32:
    376 
    377 Binary Data
    378 ^^^^^^^^^^^
    379 
    380 .. ts:def:: Base32
    381 
    382   type Base32 = string;
    383 
    384 Binary data is generally encoded using Crockford's variant of Base32
    385 (http://www.crockford.com/wrmg/base32.html), except that "U" is not excluded
    386 but also decodes to "V" to make OCR easy. Also, in contrast to Crockford, we
    387 do *not* allow the use of "-" and also do *not* allow the (optional) checksum
    388 from Crockford's proposal. So we really only use the alphabet, plus "u".  We
    389 will still simply use the JSON type "base32" and the term "Crockford Base32"
    390 in the text to refer to the resulting encoding.  Encoders and decoders
    391 can be found in libgnunetutil.
    392 
    393 
    394 Hash codes
    395 ^^^^^^^^^^
    396 
    397 Hash codes are strings representing base32 encoding of the respective
    398 hashed data. See `base32`_.
    399 
    400 .. ts:def:: HashCode
    401 
    402   // 64-byte hash code.
    403   type HashCode = string;
    404 
    405 .. ts:def:: ShortHashCode
    406 
    407   // 32-byte hash code.
    408   type ShortHashCode = string;
    409 
    410 .. ts:def:: AccountAccessToken
    411 
    412   // 32-byte nonce.
    413   type AccountAccessToken = string;
    414 
    415 .. ts:def:: WireSalt
    416 
    417   // 16-byte salt.
    418   type WireSalt = string;
    419 
    420 .. ts:def:: SHA256HashCode
    421 
    422    type SHA256HashCode = ShortHashCode;
    423 
    424 .. ts:def:: SHA512HashCode
    425 
    426    type SHA512HashCode = HashCode;
    427 
    428 .. ts:def:: CSNonce
    429 
    430    // 32-byte nonce value, must only be used once.
    431    type CSNonce = string;
    432 
    433 .. ts:def:: RefreshMasterSeed
    434 
    435    // 32-byte nonce value, must only be used once.
    436    type RefreshMasterSeed = string;
    437 
    438 .. ts:def:: RefreshCommitmentHash
    439 
    440     // A refresh commitment corresponding to a call to /melt
    441     // This is the Hash over:
    442     //   1. refresh_seed
    443     //   2. blinding_seed, if provided, skip otherwise
    444     //   3. denominations in order
    445     //   4. amount_with_fee
    446     //   5. κ*n blinded planchet hashes (which include denomination information),
    447     //      depths first: [0..n)[0..n)[0..n)
    448     type RefreshCommitmentHash = HashCode;
    449 
    450 .. ts:def:: BlindingMasterSeed
    451 
    452    // 32-byte nonce value, must only be used once.
    453    type BlindingMasterSeed = string;
    454 
    455 .. ts:def:: Cs25519Point
    456 
    457    // 32-byte value representing a point on Curve25519.
    458    type Cs25519Point = string;
    459 
    460 .. ts:def:: Cs25519Scalar
    461 
    462    // 32-byte value representing a scalar multiplier
    463    // for scalar operations on points on Curve25519.
    464    type Cs25519Scalar = string;
    465 
    466 
    467 Safe Integers
    468 ^^^^^^^^^^^^^
    469 
    470 For easier browser-side processing, we restrict some integers to
    471 the range that is safely representable in JavaScript.
    472 
    473 .. ts:def:: SafeUint64
    474 
    475   // Subset of numbers:  Integers in the
    476   // inclusive range 0 .. (2^53 - 1).
    477   type SafeUint64 = Integer;
    478 
    479 Large numbers
    480 ^^^^^^^^^^^^^
    481 
    482 Large numbers such as RSA blinding factors and 256 bit keys, are transmitted
    483 as other binary data in Crockford Base32 encoding.
    484 
    485 Decimal numbers
    486 ^^^^^^^^^^^^^^^
    487 
    488 ..
    489   FIXME: explain the representation with strings.
    490 
    491 .. ts:def:: DecimalNumber
    492 
    493    // Number with at most 8 fractional digits.
    494    type DecimalNumber = string;
    495 
    496 Timestamps
    497 ^^^^^^^^^^
    498 
    499 Timestamps are represented by the following structure:
    500 
    501 .. ts:def:: Timestamp
    502 
    503   interface Timestamp {
    504     // Seconds since epoch, or the special
    505     // value "never" to represent an event that will
    506     // never happen.
    507     t_s: Integer | "never";
    508   }
    509 
    510 .. ts:def:: RelativeTime
    511 
    512   interface RelativeTime {
    513     // Duration in microseconds or "forever"
    514     // to represent an infinite duration. Numeric
    515     // values are capped at 2^53 - 1 inclusive.
    516     d_us: Integer | "forever";
    517   }
    518 
    519 
    520 .. _public\ key:
    521 
    522 
    523 Integers
    524 ^^^^^^^^
    525 
    526 .. ts:def:: Integer
    527 
    528   // JavaScript numbers restricted to integers.
    529   type Integer = number;
    530 
    531 Floats
    532 ^^^^^^
    533 
    534 .. ts:def:: Float
    535 
    536   // JavaScript numbers.
    537   type Float = number;
    538 
    539 Ages
    540 ^^^^
    541 
    542 .. ts:def:: Age
    543 
    544    // An age is an integer between 0 and 255 measured in years.
    545    type Age = Integer;
    546 
    547 
    548 .. ts:def:: AgeMask
    549 
    550     // Binary representation of the age groups.
    551     // The bits set in the mask mark the edges at the beginning of a next age
    552     // group.  F.e. for the age groups
    553     //     0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-*
    554     // the following bits are set:
    555     //
    556     //   31     24        16        8         0
    557     //   |      |         |         |         |
    558     //   oooooooo  oo1oo1o1  o1o1o1o1  ooooooo1
    559     //
    560     // A value of 0 means that the exchange does not support the extension for
    561     // age-restriction.
    562     type AgeMask = Integer;
    563 
    564 .. ts:def:: AgeCommitmentHash
    565 
    566     // SHA-512 hash over the age commitment of a coin, that is over the
    567     // vector of `Edx25519PublicKey` values, one per age group.
    568     // Crockford `Base32` encoded.
    569     type AgeCommitmentHash = string;
    570 
    571 
    572 Versions
    573 ^^^^^^^^
    574 
    575 We use the type `LibtoolVersion` in the design documents to refer to a string
    576 that represents a version with the semantic as defined by
    577 `libtool <https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html>`__.
    578 
    579 .. ts:def:: LibtoolVersion
    580 
    581    // Version information in libtool version format and semantics
    582    // current[:revision[:age]], f.e. "1", "2:0" or "3:1:2".
    583    // see https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html.
    584    type LibtoolVersion = string;
    585 
    586 We use the type `SemVer` to refer to a string that represents a version with
    587 the semantic as defined by `semantic versioning <https://semver.org/>`__.
    588 
    589 .. ts:def:: SemVer
    590 
    591    // Version information in semantic versioning format and semantics,
    592    // like "X.Z.Y", see https://semver.org/.
    593    type SemVer = string;
    594 
    595 Objects
    596 ^^^^^^^
    597 
    598 .. ts:def:: Object
    599 
    600   // JavaScript objects, no further restrictions.
    601   type Object = object;
    602 
    603 
    604 Contact details
    605 ^^^^^^^^^^^^^^^
    606 
    607 .. ts:def:: EmailAddress
    608 
    609   type EmailAddress = string;
    610 
    611 .. ts:def:: PhoneNumber
    612 
    613   type PhoneNumber = string;
    614 
    615 Phone numbers should start with the ``+`` symbol and the country code.
    616 
    617 Permissions
    618 ^^^^^^^^^^^
    619 
    620 This type expresses which permissions for a subject
    621 apply on a resource.
    622 
    623 .. ts:def:: LibeufinPermission
    624 
    625   interface LibeufinPermission {
    626     subjectType: string;
    627     subjectId: string;
    628     resourceType: string;
    629     resourceId: string;
    630     permissionName: string
    631   }
    632 
    633 
    634 Fetch params
    635 ^^^^^^^^^^^^
    636 
    637 .. _fetch-params:
    638 
    639 .. ts:def:: FetchParams
    640 
    641   interface FetchParams {
    642 
    643     // Because transactions are delivered by banks in "batches",
    644     // then every batch can have different qualities.  This value
    645     // lets the request specify which type of batch ought to be
    646     // returned.  Currently, the following two type are supported:
    647     //
    648     // 'report': typically includes only non booked transactions.
    649     // 'statement': typically includes only booked transactions.
    650     level: "report" | "statement" | "all";
    651 
    652     // This type indicates the time range of the query.
    653     // It allows the following values:
    654     //
    655     // 'latest': retrieves the last transactions from the bank.
    656     //           If there are older unread transactions, those will *not*
    657     //           be downloaded.
    658     //
    659     // 'all': retrieves all the transactions from the bank,
    660     //        until the oldest.
    661     //
    662     // 'previous-days': currently *not* implemented, it will allow
    663     //                  the request to download transactions from
    664     //                  today until N days before.
    665     //
    666     // 'since-last': retrieves all the transactions since the last
    667     //               time one was downloaded.
    668     //
    669     rangeType: "latest" | "all" | "previous-days" | "since-last";
    670   };
    671 
    672 
    673 Keys
    674 ^^^^
    675 
    676 .. ts:def:: ClaimToken
    677 
    678   // 16-byte access token used to authorize access.
    679   type ClaimToken = string;
    680 
    681 .. ts:def:: EddsaPublicKey
    682 
    683    // EdDSA and ECDHE public keys always point on Curve25519
    684    // and represented  using the standard 256 bits Ed25519 compact format,
    685    // converted to Crockford `Base32`.
    686    type EddsaPublicKey = string;
    687 
    688 .. ts:def:: EddsaPrivateKey
    689 
    690    // EdDSA and ECDHE public keys always point on Curve25519
    691    // and represented  using the standard 256 bits Ed25519 compact format,
    692    // converted to Crockford `Base32`.
    693    type EddsaPrivateKey = string;
    694 
    695 .. ts:def:: Edx25519PublicKey
    696 
    697    // Edx25519 public keys are points on Curve25519 and represented using the
    698    // standard 256 bits Ed25519 compact format converted to Crockford
    699    // `Base32`.
    700    type Edx25519PublicKey = string;
    701 
    702 .. ts:def:: Edx25519PrivateKey
    703 
    704    // Edx25519 private keys are always points on Curve25519
    705    // and represented using the standard 256 bits Ed25519 compact format,
    706    // converted to Crockford `Base32`.
    707    type Edx25519PrivateKey = string;
    708 
    709 .. ts:def:: EcdhePublicKey
    710 
    711    // EdDSA and ECDHE public keys always point on Curve25519
    712    // and represented  using the standard 256 bits Ed25519 compact format,
    713    // converted to Crockford `Base32`.
    714    type EcdhePublicKey = string;
    715 
    716 .. ts:def:: CSRPublic
    717 
    718    // Point on Curve25519 represented using the standard 256 bits Ed25519 compact format,
    719    // converted to Crockford `Base32`.
    720    type CSRPublic = string;
    721 
    722 .. ts:def:: EcdhePrivateKey
    723 
    724    // EdDSA and ECDHE public keys always point on Curve25519
    725    // and represented  using the standard 256 bits Ed25519 compact format,
    726    // converted to Crockford `Base32`.
    727    type EcdhePrivateKey = string;
    728 
    729 .. ts:def:: CoinPublicKey
    730 
    731    type CoinPublicKey = EddsaPublicKey;
    732 
    733 .. ts:def:: RsaPublicKey
    734 
    735    // RSA public key converted to Crockford `Base32`.
    736    type RsaPublicKey = string;
    737 
    738 .. ts:def:: PursePublicKey
    739 
    740    type PursePublicKey = EddsaPublicKey;
    741 
    742 
    743 .. _blinded-coin:
    744 
    745 Blinded coin
    746 ^^^^^^^^^^^^
    747 
    748 .. ts:def:: CoinEnvelope
    749 
    750   // The type of a coin's blinded envelope depends on the cipher that is used
    751   // for signing with a denomination key.
    752   type CoinEnvelope = RSACoinEnvelope | CSCoinEnvelope ;
    753 
    754 .. ts:def:: RSACoinEnvelope
    755 
    756   // For denomination signatures based on RSA, the planchet is just a blinded
    757   // coin's `public EdDSA key <eddsa-coin-pub>`.
    758   interface RSACoinEnvelope {
    759     cipher: "RSA" | "RSA+age_restricted";
    760     rsa_blinded_planchet: BlindedRsaSignature;
    761   }
    762 
    763 .. ts:def:: CSCoinEnvelope
    764 
    765   // For denomination signatures based on Blind Clause-Schnorr, the planchet
    766   // consists of the public nonce and two Curve25519 scalars which are two
    767   // blinded challenges in the Blinded Clause-Schnorr signature scheme.
    768   // See https://taler.net/papers/cs-thesis.pdf for details.
    769   interface CSCoinEnvelope {
    770     cipher: "CS" | "CS+age_restricted";
    771     cs_nonce: string;      // Crockford `Base32` encoded
    772     cs_blinded_c0: string; // Crockford `Base32` encoded
    773     cs_blinded_c1: string; // Crockford `Base32` encoded
    774   }
    775 
    776 .. _unblinded-coin:
    777 
    778 Unblinded coin
    779 ^^^^^^^^^^^^^^
    780 
    781 .. ts:def:: UnblindedSignature
    782 
    783   // The type of a coin's unblinded signature depends on the cipher that was used
    784   // for signing with a denomination key.
    785   // Note that for now, only RSA is supported.
    786   type UnblindedSignature = RsaUnblindedSignature | CsUnblindedSignature;
    787 
    788 .. ts:def:: RsaUnblindedSignature
    789 
    790   interface RsaUnblindedSignature {
    791     cipher: "RSA";
    792     rsa_signature: RsaSignature;
    793   }
    794 
    795 .. ts:def:: CsUnblindedSignature
    796 
    797   // Note, this is here for the sake of completeness, but not yet supported
    798   interface CsUnblindedSignature {
    799     cipher: "CS";
    800 
    801     cs_signature_r: Cs25519Point;
    802     cs_signature_s: Cs25519Scalar;
    803   }
    804 
    805 
    806 .. _signature:
    807 
    808 Signatures
    809 ^^^^^^^^^^
    810 
    811 
    812 .. ts:def:: EddsaSignature
    813 
    814   // EdDSA signatures are transmitted as 64-bytes `base32`
    815   // binary-encoded objects with just the R and S values (base32_ binary-only).
    816   type EddsaSignature = string;
    817 
    818 .. ts:def:: Edx25519Signature
    819 
    820   // Edx25519 signatures are transmitted as 64-bytes `base32`
    821   // binary-encoded objects with just the R and S values (base32_ binary-only).
    822   type Edx25519Signature = string;
    823 
    824 .. ts:def:: RsaSignature
    825 
    826   // `base32` encoded RSA signature.
    827   type RsaSignature = string;
    828 
    829 .. ts:def:: BlindedRsaSignature
    830 
    831   // `base32` encoded RSA blinded signature.
    832   type BlindedRsaSignature = string;
    833 
    834 .. ts:def:: RsaBlindingKeySecret
    835 
    836   // `base32` encoded RSA blinding secret.
    837   type RsaBlindingKeySecret = string;
    838 
    839 .. ts:def:: DenominationBlindingKeySecret
    840 
    841   // Union, not (!) discriminated!
    842   type DenominationBlindingKeySecret =
    843     | RsaBlindingKeySecret
    844     | CsBlindingKeySecret;
    845 
    846 .. ts:def:: CsBlindingKeySecret
    847 
    848   // 32-byte secret from which the Clause-Schnorr blinding
    849   // scalars of a coin are derived, Crockford `Base32` encoded.
    850   type CsBlindingKeySecret = string;
    851 
    852 
    853 .. ts:def:: DenomCipher
    854 
    855    interface DenomCipher = {
    856      // specifier for the ciper
    857      cipher: string;
    858    }
    859 
    860 .. ts:def:: BlindedDenominationSignature
    861 
    862   type BlindedDenominationSignature = DenomCipher & (
    863     | RsaBlindedDenominationSignature
    864     | CSBlindedDenominationSignature
    865   )
    866 
    867 .. ts:def:: RsaBlindedDenominationSignature
    868 
    869   interface RsaBlindedDenominationSignature extends DenomCipher {
    870     cipher: "RSA";
    871 
    872     // (blinded) RSA signature
    873     blinded_rsa_signature: BlindedRsaSignature;
    874   }
    875 
    876 .. ts:def:: CSBlindedDenominationSignature
    877 
    878   interface CSBlindedDenominationSignature extends DenomCipher {
    879     cipher: "CS";
    880 
    881     // Signer chosen bit value, 0 or 1, used
    882     // in Clause Blind Schnorr to make the
    883     // ROS problem harder.
    884     b: Integer;
    885 
    886     // Blinded scalar calculated from c_b.
    887     s: Cs25519Scalar;
    888 
    889   }
    890 .. ts:def:: PurseContractSignature
    891 
    892    type PurseContractSignature = EddsaSignature
    893 
    894 
    895 .. _amount:
    896 
    897 Amounts
    898 ^^^^^^^
    899 
    900 Amounts of currency are always expressed in terms of a base value, a
    901 fractional value and the denomination of the currency.
    902 
    903 .. ts:def:: Amount
    904 
    905   type Amount = string;
    906 
    907 Amounts of currency are serialized as a string of the format
    908 ``<Currency>:<DecimalAmount>``.  Taler treats monetary amounts as
    909 fixed-precision numbers, with 8 decimal places.  Unlike floating point numbers,
    910 this allows accurate representation of monetary amounts.
    911 
    912 The following constraints apply for a valid amount:
    913 
    914 1. The ``<Currency>`` part must be at most 11 characters long and may only consist
    915    of ASCII letters (``a-zA-Z``).
    916 2. The integer part of ``<DecimalAmount>`` may be at most 2^52.
    917 3. The fractional part of ``<DecimalAmount>`` may contain at most 8 decimal digits.
    918 
    919 .. note::
    920 
    921   "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".
    922 
    923 An amount that is prefixed with a ``+`` or ``-`` character is also used in certain contexts.
    924 When no sign is present, the amount is assumed to be positive.
    925 
    926 .. note::
    927 
    928   In some setups, when Libeufin-Bank offers cashouts towards traditional
    929   currencies like EUR for example, the fractional part gets restricted
    930   to at most 2 digits.
    931 
    932 .. ts:def:: SignedAmount
    933 
    934   type SignedAmount = string;
    935 
    936 .. sourcecode:: c
    937 
    938   struct TALER_AmountNBO {
    939     // Non-negative integer value in the currency (in network byte order),
    940     // can be at most 2^52.
    941     // Note that "1" here would correspond to 1 EUR or 1 USD,
    942     // depending on `currency`, not 1 cent.
    943     uint64_t value;
    944 
    945     // Unsigned 32 bit fractional value (in network byte order)
    946     // to be added to ``value`` representing
    947     // an additional currency fraction, in units of one hundred millionth (1e-8)
    948     // of the base currency value.  For example, a fraction
    949     // of 50,000,000 would correspond to 50 cents.
    950     uint32_t fraction;
    951 
    952     // Name of the currency, using either a three-character ISO 4217 currency
    953     // code, or a regional currency identifier between 4 and 11 characters,
    954     // consisting of ASCII alphabetic characters ("a-zA-Z").
    955     // Should be padded to 12 bytes with 0-characters.
    956     // Currency codes are compared case-insensitively.
    957     uint8_t currency_code[12];
    958   };
    959 
    960 
    961 Images
    962 ^^^^^^
    963 
    964 .. ts:def:: ImageDataUrl
    965 
    966   // The string must be a data URL according to RFC 2397
    967   // with explicit mediatype and base64 parameters.
    968   //
    969   //     ``data:<mediatype>;base64,<data>``
    970   //
    971   // Supported mediatypes are ``image/jpeg`` and ``image/png``.
    972   // Invalid strings will be rejected by the wallet.
    973   type ImageDataUrl = string;
    974 
    975 
    976 --------------
    977 Binary Formats
    978 --------------
    979 
    980 .. note::
    981 
    982    Due to the way of handling "big" numbers by some platforms (such as
    983    JavaScript, for example), wherever the following specification mentions
    984    a 64-bit value, the actual implementations are strongly advised to rely on
    985    arithmetic up to 53 bits.
    986 
    987 .. note::
    988 
    989    Taler uses ``libgnunetutil`` for interfacing itself with the operating system,
    990    doing crypto work, and other "low level" actions, therefore it is strongly
    991    connected with the `GNUnet project <https://gnunet.org>`_.
    992 
    993 This section specifies the binary representation of messages used in Taler's
    994 protocols. The message formats are given in a C-style pseudocode notation.
    995 Padding is always specified explicitly, and numeric values are in network byte
    996 order (big endian).
    997 
    998 
    999 Time
   1000 ^^^^
   1001 
   1002 In signed messages, time is represented using 64-bit big-endian values,
   1003 denoting microseconds since the UNIX Epoch.  ``UINT64_MAX`` represents "never".
   1004 
   1005 .. sourcecode:: c
   1006 
   1007   struct GNUNET_TIME_Absolute {
   1008     uint64_t timestamp_us;
   1009   };
   1010   struct GNUNET_TIME_AbsoluteNBO {
   1011     uint64_t abs_value_us__;       // in network byte order
   1012   };
   1013 
   1014 .. sourcecode:: c
   1015 
   1016   struct GNUNET_TIME_Relative {
   1017     uint64_t timestamp_us;
   1018   };
   1019   struct GNUNET_TIME_RelativeNBO {
   1020     uint64_t rel_value_us__;       // in network byte order
   1021   };
   1022 
   1023 For certain statistics, we need to express relative time
   1024 in ways that correspond exactly to the calendar. So while
   1025 constants like ``GNUNET_TIME_UNIT_MONTH`` are defined to
   1026 mean 30 days, we cannot do this when tracking income for
   1027 a merchant over a calendar year. Thus, in this case,
   1028 we use the `StatisticBucketRange` when rounding time to
   1029 values that cannot be expressed as fixed multiples of
   1030 seconds:
   1031 
   1032 .. ts:def:: StatisticBucketRange
   1033 
   1034     type MerchantStatisticCounterByBucket =
   1035       "decade" | "year" | "quarter" | "month" | "week" | "day" | "hour" | "minute" | "second";
   1036 
   1037 .. _LegalTrouble:
   1038 
   1039 451 Responses
   1040 ^^^^^^^^^^^^^
   1041 
   1042 When KYC operations are required, various endpoints may respond with a
   1043 ``451 Unavailable for Legal Reasons`` status code and a `LegitimizationNeededResponse`
   1044 body.
   1045 
   1046 .. ts:def:: LegitimizationNeededResponse
   1047 
   1048   // Implemented in this style since exchange
   1049   // protocol **v20**.
   1050   interface LegitimizationNeededResponse {
   1051 
   1052     // Numeric `error code <error-codes>` unique to the condition.
   1053     // Should always be ``TALER_EC_EXCHANGE_GENERIC_KYC_REQUIRED``.
   1054     code: Integer;
   1055 
   1056     // Human-readable description of the error, i.e. "missing parameter",
   1057     // "commitment violation", ...  Should give a human-readable hint
   1058     // about the error's nature. Optional, may change without notice!
   1059     hint?: string;
   1060 
   1061     // Hash of the payto:// account URI for which KYC
   1062     // is required.
   1063     // The account holder can use the ``/kyc-check/$H_PAYTO``
   1064     // endpoint to check the KYC status or initiate the KYC process.
   1065     h_payto: NormalizedPaytoHash;
   1066 
   1067     // Public key associated with the account. The client must sign
   1068     // the initial request for the KYC status using the corresponding
   1069     // private key.  Will be either a reserve public key or a merchant
   1070     // (instance) public key.
   1071     //
   1072     // Absent if no public key is currently associated
   1073     // with the account and the client MUST thus first
   1074     // credit the exchange via an inbound wire transfer
   1075     // to associate a public key with the debited account.
   1076     account_pub?: EddsaPublicKey;
   1077 
   1078     // Identifies a set of measures that were triggered and that are
   1079     // now preventing this operation from proceeding.  Gives developers
   1080     // a starting point for understanding why the transaction was
   1081     // blocked and how to lift it.
   1082     // Can be zero (which means there is no requirement row),
   1083     // especially if ``bad_kyc_auth`` is set.
   1084     requirement_row: Integer;
   1085 
   1086     // True if the operation was denied because the
   1087     // KYC auth key does not match the merchant public
   1088     // key.  In this case, a KYC auth wire transfer
   1089     // with the merchant public key must be performed
   1090     // first.
   1091     // Since exchange protocol **v21**.
   1092     bad_kyc_auth?: boolean;
   1093 
   1094   }
   1095 
   1096 
   1097 Cryptographic primitives
   1098 ^^^^^^^^^^^^^^^^^^^^^^^^
   1099 
   1100 All elliptic curve operations are on Curve25519.  Public and private keys are
   1101 thus 32 bytes, and signatures 64 bytes.  For hashing, including HKDFs, Taler
   1102 uses 512-bit hash codes (64 bytes).
   1103 
   1104 .. _HashCode:
   1105 .. sourcecode:: c
   1106 
   1107    struct GNUNET_HashCode {
   1108      uint8_t hash[64];      // usually SHA-512
   1109    };
   1110 
   1111 .. sourcecode:: c
   1112 
   1113    struct TALER_DenominationHash {
   1114      struct GNUNET_HashCode hash;
   1115    };
   1116 
   1117 .. sourcecode:: c
   1118 
   1119    struct TALER_PrivateContractHash {
   1120      struct GNUNET_HashCode hash;
   1121    };
   1122 
   1123 .. sourcecode:: c
   1124 
   1125    struct TALER_ExtensionsPolicyHash {
   1126      struct GNUNET_HashCode hash;
   1127    };
   1128 
   1129 .. sourcecode:: c
   1130 
   1131    struct TALER_MerchantWireHash {
   1132      struct GNUNET_HashCode hash;
   1133    };
   1134 
   1135 .. _FullPaytoHash:
   1136 .. sourcecode:: c
   1137 
   1138    struct TALER_FullPaytoHash {
   1139      // Hash over a full payto://-URI, including receiver-name
   1140      // (and possibly BIC and other optional fields).
   1141      struct GNUNET_ShortHashCode hash;
   1142    };
   1143 
   1144 .. _NormalizedPaytoHash:
   1145 .. sourcecode:: c
   1146 
   1147    struct TALER_NormalizedPaytoHash {
   1148      // Hash over a normalized payto://-URI, including all optional
   1149      // fields and also with account-part canonicalized (so no BIC).
   1150      struct GNUNET_ShortHashCode hash;
   1151    };
   1152 
   1153 .. _BlindedCoinHash:
   1154 .. sourcecode:: c
   1155 
   1156    struct TALER_BlindedCoinHash {
   1157      // Hash over a) the hash of the denomination's public key,
   1158      // b) an enum value identifying the cipher, and
   1159      // c) cipher-dependant blinded information.
   1160      // See implementation of `TALER_coin_ev_hash`
   1161      // in libtalerexchange for details.
   1162      struct GNUNET_HashCode hash;
   1163    };
   1164 
   1165 .. sourcecode:: c
   1166 
   1167    struct TALER_CoinPubHash {
   1168      struct GNUNET_HashCode hash;
   1169    };
   1170 
   1171 .. sourcecode:: c
   1172 
   1173    struct TALER_OutputCommitmentHash {
   1174      struct GNUNET_HashCode hash;
   1175    };
   1176 
   1177 
   1178 .. _TALER_EcdhEphemeralPublicKeyP:
   1179 .. sourcecode:: c
   1180 
   1181    struct TALER_EcdhEphemeralPublicKeyP {
   1182      uint8_t ecdh_pub[32];
   1183    };
   1184 
   1185 .. _reserve-pub:
   1186 .. sourcecode:: c
   1187 
   1188    struct TALER_ReservePublicKeyP {
   1189      uint8_t eddsa_pub[32];
   1190    };
   1191 
   1192 .. _reserve-priv:
   1193 .. sourcecode:: c
   1194 
   1195    struct TALER_ReservePrivateKeyP {
   1196      uint8_t eddsa_priv[32];
   1197    };
   1198 
   1199    struct TALER_ReserveSignatureP {
   1200      uint8_t eddsa_signature[64];
   1201    };
   1202 
   1203 .. _merchant-pub:
   1204 .. sourcecode:: c
   1205 
   1206    struct TALER_MerchantPublicKeyP {
   1207      uint8_t eddsa_pub[32];
   1208    };
   1209 
   1210    struct TALER_MerchantPrivateKeyP {
   1211      uint8_t eddsa_priv[32];
   1212    };
   1213 
   1214    struct TALER_TransferPublicKeyP {
   1215      uint8_t ecdhe_pub[32];
   1216    };
   1217 
   1218    struct TALER_TransferPrivateKeyP {
   1219      uint8_t ecdhe_priv[32];
   1220    };
   1221 
   1222 
   1223 .. _AmlDecisionState:
   1224 .. sourcecode:: c
   1225 
   1226    enum TALER_AmlDecisionState {
   1227      NORMAL, PENDING, FROZEN
   1228    };
   1229 
   1230 .. _AmlOfficerPublicKeyP:
   1231 .. sourcecode:: c
   1232 
   1233    struct TALER_AmlOfficerPublicKeyP {
   1234      uint8_t eddsa_pub[32];
   1235    };
   1236 
   1237 .. _AmlOfficerPrivateKeyP:
   1238 .. sourcecode:: c
   1239 
   1240    struct TALER_AmlOfficerPrivateKeyP {
   1241      uint8_t eddsa_priv[32];
   1242    };
   1243 
   1244 .. _sign-key-pub:
   1245 .. sourcecode:: c
   1246 
   1247    struct TALER_ExchangePublicKeyP {
   1248      uint8_t eddsa_pub[32];
   1249    };
   1250 
   1251 .. _sign-key-priv:
   1252 .. sourcecode:: c
   1253 
   1254    struct TALER_ExchangePrivateKeyP {
   1255      uint8_t eddsa_priv[32];
   1256    };
   1257 
   1258 .. _eddsa-sig:
   1259 .. sourcecode:: c
   1260 
   1261    struct TALER_ExchangeSignatureP {
   1262      uint8_t eddsa_signature[64];
   1263    };
   1264 
   1265    struct TALER_MasterPublicKeyP {
   1266      uint8_t eddsa_pub[32];
   1267    };
   1268 
   1269    struct TALER_MasterPrivateKeyP {
   1270      uint8_t eddsa_priv[32];
   1271    };
   1272 
   1273     struct TALER_MasterSignatureP {
   1274      uint8_t eddsa_signature[64];
   1275    };
   1276 
   1277 .. _WireTransferIdentifierRawP:
   1278 .. sourcecode:: c
   1279 
   1280    struct WireTransferIdentifierRawP {
   1281      uint8_t raw[32];
   1282    };
   1283 
   1284 .. _UUID:
   1285 .. sourcecode:: c
   1286 
   1287    struct UUID {
   1288      uint32_t value[4];
   1289    };
   1290 
   1291 .. _WadId:
   1292 .. sourcecode:: c
   1293 
   1294    struct TALER_WadId wad_id {
   1295      uint32_t value[6];
   1296    };
   1297 
   1298 .. _eddsa-coin-pub:
   1299 .. sourcecode:: c
   1300 
   1301    union TALER_CoinSpendPublicKeyP {
   1302      uint8_t eddsa_pub[32];
   1303      uint8_t ecdhe_pub[32];
   1304    };
   1305 
   1306 .. _coin-priv:
   1307 .. sourcecode:: c
   1308 
   1309    union TALER_CoinSpendPrivateKeyP {
   1310      uint8_t eddsa_priv[32];
   1311      uint8_t ecdhe_priv[32];
   1312    };
   1313 
   1314    struct TALER_CoinSpendSignatureP {
   1315      uint8_t eddsa_signature[64];
   1316    };
   1317 
   1318    struct TALER_TransferSecretP {
   1319      uint8_t key[sizeof (struct GNUNET_HashCode)];
   1320    };
   1321 
   1322    struct TALER_EncryptedLinkSecretP {
   1323      uint8_t enc[sizeof (struct TALER_LinkSecretP)];
   1324    };
   1325 
   1326 .. _eddsa-token-pub:
   1327 .. sourcecode:: c
   1328 
   1329    union TALER_TokenPublicKeyP {
   1330      uint8_t eddsa_pub[32];
   1331      uint8_t ecdhe_pub[32];
   1332    };
   1333 
   1334 .. _account-pub:
   1335 .. sourcecode:: c
   1336 
   1337    union TALER_AccountPublicKeyP {
   1338      struct TALER_ReservePublicKeyP reserve_pub;
   1339      struct TALER_MerchantPublicKeyP merchant_pub;
   1340    };
   1341 
   1342 .. _Signatures:
   1343 
   1344 Signatures
   1345 ^^^^^^^^^^
   1346 
   1347 Any piece of signed data complies with the abstract data structure given below.
   1348 
   1349 .. sourcecode:: c
   1350 
   1351   struct Data {
   1352     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1353     type1_t payload1;
   1354     type2_t payload2;
   1355     ...
   1356   };
   1357 
   1358   /*From gnunet_crypto_lib.h*/
   1359   struct GNUNET_CRYPTO_EccSignaturePurpose {
   1360     /**
   1361      * This field equals the number of bytes being signed,
   1362      * namely 'sizeof (struct Data)'.
   1363      */
   1364     uint32_t size;
   1365     /**
   1366      * This field is used to express the context in
   1367      * which the signature is made, ensuring that a
   1368      * signature cannot be lifted from one part of the protocol
   1369      * to another. See `src/include/taler_signatures.h` within the
   1370      * exchange's codebase (git://taler.net/exchange).
   1371      */
   1372     uint32_t purpose;
   1373   };
   1374 
   1375 
   1376 The following list contains all the data structures that can be signed in
   1377 Taler. Their definition is typically found in ``src/include/taler_signatures.h``,
   1378 within the
   1379 `exchange's codebase <https://docs.taler.net/global-licensing.html#exchange-repo>`_.
   1380 
   1381 
   1382 
   1383 .. _TALER_HashPlanchetsP:
   1384 .. sourcecode:: c
   1385 
   1386   /**
   1387    * This is the running SHA512-hash over all
   1388    * `TALER_BlindedCoinHashP` values of an array of coins.
   1389    * Note that each `TALER_BlindedCoinHashP` itself
   1390    * captures the hash of the corresponding denomination's
   1391    * public key.
   1392    */
   1393   struct TALER_HashPlanchetsP {
   1394     struct GNUNET_HashCode hash;
   1395   };
   1396 
   1397 
   1398 .. _TALER_AgeMask:
   1399 .. sourcecode:: c
   1400 
   1401   /**
   1402    * Binary representation of the age groups.
   1403    * The bits set in the mask mark the edges at the beginning of a next age
   1404    * group.  F.e. for the age groups
   1405    *     0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-*
   1406    * the following bits are set:
   1407    *
   1408    *   31     24        16        8         0
   1409    *   |      |         |         |         |
   1410    *   oooooooo  oo1oo1o1  o1o1o1o1  ooooooo1
   1411    *
   1412    * A value of 0 means that the exchange does not support the extension for
   1413    * age-restriction.
   1414    */
   1415    struct TALER_AgeMask {
   1416        uint32_t mask;
   1417    };
   1418 
   1419 
   1420 
   1421 .. _TALER_WithdrawRequestPS:
   1422 .. sourcecode:: c
   1423 
   1424   /**
   1425    * Format used for to generate the signature on a request to withdraw
   1426    * coins from a reserve.
   1427    */
   1428   struct TALER_WithdrawRequestPS
   1429   {
   1430     /**
   1431      * Purpose is #TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW
   1432      */
   1433     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1434     /**
   1435      * Amount to withdraw, excluding fees, i.e.
   1436      * the total sum of the denominations of the coins.
   1437      * Note that the reserve must have a value of at least amount+fee.
   1438      */
   1439     struct TALER_Amount amount;
   1440     /**
   1441      * Total fee for the withdrawal.
   1442      * Note that the reserve must have a value of at least amount+fee.
   1443      */
   1444     struct TALER_Amount fee;
   1445     /**
   1446      * If max_age was not set in the withdraw request, this is
   1447      * the running SHA512-hash over the n `TALER_BlindedCoinHashP`
   1448      * values of the coins, in the order of the request.
   1449      * Note that each `TALER_BlindedCoinHashP` itself
   1450      * captures the hash of the corresponding denomination's
   1451      * public key.
   1452      * If max_age was set in the withdraw request, the n*κ coins
   1453      * form κ batches of n coins each, the first n coins belonging
   1454      * to κ index=0, the next n to κ index=1 etc.  For each batch
   1455      * the running SHA512-hash over its n `TALER_BlindedCoinHashP`
   1456      * values is computed, and this value is the running
   1457      * SHA512-hash over the κ batch hashes:
   1458      * H( H(h[0][0]…h[0][n-1]) … H(h[κ-1][0]…h[κ-1][n-1]) ).
   1459      *
   1460      * Note also that this value is required for /recoup-withdraw and
   1461      * -- in case of a withdraw request with required age proof --
   1462      * in the subsequent call to /reveal-withdraw
   1463      */
   1464     struct TALER_HashPlanchetsP h_planchets;
   1465     /**
   1466      * The master seed that was used in the call to /blinding-prepare blinding,
   1467      * or all zeros, if no denomination of cipher type Clause-Schnorr is used.
   1468      */
   1469      struct TALER_BlindingMasterSecretP blinding_seed;
   1470     /**
   1471      * If age restriction proof is required, the maximum age _group_
   1472      * to commit to, 0 otherwise. Note that in this case, all
   1473      * denominations for all coins MUST support age restriction.
   1474      * Also note that this is not an age (in years), but the age group
   1475      * (an index) according to list of age groups in the configuration
   1476      * of the exchange.  See TALER_get_max_group() how to calculate
   1477      * the age group to a given age (in years).
   1478      */
   1479     uint32_t max_age_group;
   1480     /**
   1481      * The age groups as configured for the exchange, represented as a mask.
   1482      * If max_age_group is > 0, the mask MUST be non-zero, too.
   1483      */
   1484     struct TALER_AgeMask mask;
   1485   };
   1486 
   1487 .. _TALER_WithdrawConfirmationPS:
   1488 
   1489 .. sourcecode:: c
   1490 
   1491   struct TALER_WithdrawConfirmationPS
   1492   {
   1493     /**
   1494      * Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_WITHDRAW.
   1495      * Signed by a `struct TALER_ExchangePrivateKeyP` using EdDSA.
   1496      */
   1497     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1498 
   1499     /**
   1500      * Commitment made in the /withdraw request.
   1501      * Also needed for the /reveal-withdraw endpoint (in case
   1502      * of required proof of age restriction) and for /recoup-withdraw
   1503      */
   1504     struct TALER_HashBlindedPlanchetsP h_planchets;
   1505 
   1506     /**
   1507      * If proof of age restriction is not required for to this
   1508      * withdrawal, (i.e. max_age was not set during the request)
   1509      * MUST be 0xFFFFFFFF.
   1510      * Otherwise (i.e. proof of age restriction required):
   1511      * index that the client will not have to reveal, in NBO,
   1512      * MUST be smaller than #TALER_CNC_KAPPA.
   1513      */
   1514     uint32_t noreveal_index;
   1515 
   1516   };
   1517 
   1518 
   1519 .. _TALER_SingleWithdrawRequestPS:
   1520 .. sourcecode:: c
   1521 
   1522   struct TALER_SingleWithdrawRequestPS {
   1523     /**
   1524      * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW
   1525      */
   1526     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1527     struct TALER_AmountNBO amount_with_fee;
   1528     struct TALER_DenominationHash h_denomination_pub;
   1529     struct TALER_BlindedCoinHash h_coin_envelope;
   1530   };
   1531 
   1532 
   1533 .. _taler_depositrequestps:
   1534 
   1535 .. sourcecode:: c
   1536 
   1537   struct TALER_DepositRequestPS {
   1538     /**
   1539      * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_DEPOSIT
   1540      */
   1541     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1542     struct TALER_PrivateContractHash h_contract_terms;
   1543     struct TALER_AgeCommitmentHash h_age_commitment;
   1544     struct TALER_ExtensionsPolicyHash h_policy;
   1545     struct TALER_MerchantWireHash h_wire;
   1546     struct TALER_DenominationHash h_denom_pub;
   1547     struct GNUNET_TIME_AbsoluteNBO timestamp;
   1548     struct GNUNET_TIME_AbsoluteNBO refund_deadline;
   1549     struct TALER_AmountNBO amount_with_fee;
   1550     struct TALER_AmountNBO deposit_fee;
   1551     struct TALER_MerchantPublicKeyP merchant;
   1552     struct GNUNET_HashCode wallet_data_hash;
   1553   };
   1554 
   1555 .. _TALER_DepositConfirmationPS:
   1556 
   1557 .. sourcecode:: c
   1558 
   1559   struct TALER_DepositConfirmationPS {
   1560     /**
   1561      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT
   1562      */
   1563     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1564     struct TALER_PrivateContractHash h_contract_terms;
   1565     struct TALER_MerchantWireHash h_wire;
   1566     struct TALER_ExtensionsPolicyHash h_policy;
   1567     struct GNUNET_TIME_AbsoluteNBO timestamp;
   1568     struct GNUNET_TIME_AbsoluteNBO refund_deadline;
   1569     struct TALER_AmountNBO amount_without_fee;
   1570     union TALER_CoinSpendPublicKeyP coin_pub;
   1571     struct TALER_MerchantPublicKeyP merchant;
   1572   };
   1573 
   1574 
   1575 .. _TALER_RefreshCommitmentP:
   1576 .. sourcecode:: c
   1577 
   1578   struct TALER_RefreshCommitmentP {
   1579     /**
   1580      * @since vDOLDPLUS
   1581      * Hash over:
   1582      *   1. master_refresh_seed
   1583      *   2. kappa * n tranfer public keys, depths first: [0..n),...,[0..n)
   1584      *   3. hash over all pairs of R-values (for CS) if present, skipped otherwise
   1585      *   4. n denomination hashes, in order
   1586      *   5. amount with fee
   1587      *   6. kappa*n planchets, depths first: [0..n),...,[0..n)
   1588      *
   1589      * @since v27
   1590      * @deprecated vDOLDPLUS
   1591      * Hash over:
   1592      *   1. refresh_seed
   1593      *   2. hash over all pairs of R-values if present, skipped otherwise
   1594      *   3. n denomination hashes, in order
   1595      *   4. amount with fee
   1596      *   5. kappa * n planchets, depths first: [0..n),...,[0..n)
   1597      */
   1598      struct GNUNET_HashCode session_hash;
   1599  };
   1600 
   1601 .. _TALER_RefreshMeltCoinAffirmationPS:
   1602 .. sourcecode:: c
   1603 
   1604   struct TALER_RefreshMeltCoinAffirmationPS {
   1605     /**
   1606      * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_MELT
   1607      */
   1608     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1609     struct TALER_RefreshCommitmentP session_hash;
   1610     struct TALER_DenominationHash h_denom_pub;
   1611     struct TALER_AgeCommitmentHash h_age_commitment;
   1612     struct TALER_AmountNBO amount_with_fee;
   1613     struct TALER_AmountNBO melt_fee;
   1614   };
   1615 
   1616 .. _TALER_RefreshMeltConfirmationPS:
   1617 .. sourcecode:: c
   1618 
   1619   struct TALER_RefreshMeltConfirmationPS {
   1620     /**
   1621      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT
   1622      */
   1623     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1624     struct TALER_RefreshCommitmentP session_hash;
   1625     uint16_t noreveal_index;
   1626   };
   1627 
   1628 .. _TALER_ExchangeSigningKeyValidityPS:
   1629 .. sourcecode:: c
   1630 
   1631   struct TALER_ExchangeSigningKeyValidityPS {
   1632     /**
   1633      * purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY
   1634      */
   1635     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1636     struct GNUNET_TIME_AbsoluteNBO start;
   1637     struct GNUNET_TIME_AbsoluteNBO expire;
   1638     struct GNUNET_TIME_AbsoluteNBO end;
   1639     struct TALER_ExchangePublicKeyP signkey_pub;
   1640   };
   1641 
   1642 .. _TALER_ExchangeKeySetPS:
   1643 .. sourcecode:: c
   1644 
   1645   struct TALER_ExchangeKeySetPS {
   1646       /**
   1647        * purpose.purpose = TALER_SIGNATURE_EXCHANGE_KEY_SET
   1648        */
   1649       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1650       struct GNUNET_TIME_AbsoluteNBO list_issue_date;
   1651       struct GNUNET_HashCode hc;
   1652   };
   1653 
   1654 .. _TALER_DenominationKeyValidityPS:
   1655 .. sourcecode:: c
   1656 
   1657   struct TALER_DenominationKeyValidityPS {
   1658     /**
   1659      * purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY
   1660      */
   1661     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1662     struct TALER_MasterPublicKeyP master;
   1663     struct GNUNET_TIME_AbsoluteNBO start;
   1664     struct GNUNET_TIME_AbsoluteNBO expire_withdraw;
   1665     struct GNUNET_TIME_AbsoluteNBO expire_spend;
   1666     struct GNUNET_TIME_AbsoluteNBO expire_legal;
   1667     struct TALER_AmountNBO value;
   1668     struct TALER_AmountNBO fee_withdraw;
   1669     struct TALER_AmountNBO fee_deposit;
   1670     struct TALER_AmountNBO fee_refresh;
   1671     struct TALER_DenominationHash denom_hash;
   1672   };
   1673 
   1674 .. _TALER_MasterWireDetailsPS:
   1675 .. sourcecode:: c
   1676 
   1677   struct TALER_MasterWireDetailsPS {
   1678     /**
   1679      * purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_DETAILS
   1680      */
   1681     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1682     struct TALER_FullPaytoHash h_wire_details;
   1683     struct GNUNET_HashCode h_conversion_url;
   1684     struct GNUNET_HashCode h_credit_restrictions;
   1685     struct GNUNET_HashCode h_debit_restrictions;
   1686   };
   1687 
   1688 .. _TALER_MasterWireFeePS:
   1689 .. sourcecode:: c
   1690 
   1691   struct TALER_MasterWireFeePS {
   1692     /**
   1693      * purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_FEES
   1694      */
   1695     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1696     struct GNUNET_HashCode h_wire_method;
   1697     struct GNUNET_TIME_AbsoluteNBO start_date;
   1698     struct GNUNET_TIME_AbsoluteNBO end_date;
   1699     struct TALER_AmountNBO wire_fee;
   1700     struct TALER_AmountNBO closing_fee;
   1701   };
   1702 
   1703 .. _TALER_GlobalFeesPS:
   1704 .. sourcecode:: c
   1705 
   1706   struct TALER_GlobalFeesPS {
   1707     /**
   1708      * purpose.purpose = TALER_SIGNATURE_MASTER_GLOBAL_FEES
   1709      */
   1710     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1711     struct GNUNET_TIME_AbsoluteNBO start_date;
   1712     struct GNUNET_TIME_AbsoluteNBO end_date;
   1713     struct GNUNET_TIME_RelativeNBO purse_timeout;
   1714     struct GNUNET_TIME_RelativeNBO kyc_timeout;
   1715     struct GNUNET_TIME_RelativeNBO history_expiration;
   1716     struct TALER_AmountNBO history_fee;
   1717     struct TALER_AmountNBO kyc_fee;
   1718     struct TALER_AmountNBO account_fee;
   1719     struct TALER_AmountNBO purse_fee;
   1720     uint32_t purse_account_limit;
   1721   };
   1722 
   1723 .. _TALER_MasterDrainProfitPS:
   1724 .. sourcecode:: c
   1725 
   1726   struct TALER_MasterDrainProfitPS {
   1727     /**
   1728      * purpose.purpose = TALER_SIGNATURE_MASTER_DRAIN_PROFITS
   1729      */
   1730     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1731     struct TALER_WireTransferIdentifierRawP wtid;
   1732     struct GNUNET_TIME_AbsoluteNBO date;
   1733     struct TALER_AmountNBO amount;
   1734     struct GNUNET_HashCode h_section;
   1735     struct TALER_FullPaytoHashP h_payto;
   1736   };
   1737 
   1738 .. _TALER_DepositTrackPS:
   1739 .. sourcecode:: c
   1740 
   1741   struct TALER_DepositTrackPS {
   1742     /**
   1743      * purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION
   1744      */
   1745     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1746     struct TALER_PrivateContractHash h_contract_terms;
   1747     struct TALER_MerchantWireHash h_wire;
   1748     union TALER_CoinSpendPublicKeyP coin_pub;
   1749   };
   1750 
   1751 .. _TALER_WireDepositDetailP:
   1752 .. sourcecode:: c
   1753 
   1754   struct TALER_WireDepositDetailP {
   1755     struct TALER_PrivateContractHash h_contract_terms;
   1756     struct GNUNET_TIME_AbsoluteNBO execution_time;
   1757     union TALER_CoinSpendPublicKeyP coin_pub;
   1758     struct TALER_AmountNBO deposit_value;
   1759     struct TALER_AmountNBO deposit_fee;
   1760   };
   1761 
   1762 .. _TALER_WireDepositDataPS:
   1763 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT:
   1764 .. sourcecode:: c
   1765 
   1766   struct TALER_WireDepositDataPS {
   1767     /**
   1768      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT
   1769      */
   1770     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1771     struct TALER_AmountNBO total;
   1772     struct TALER_AmountNBO wire_fee;
   1773     struct TALER_MerchantPublicKeyP merchant_pub;
   1774     struct TALER_MerchantWireHash h_wire;
   1775     struct GNUNET_HashCode h_details;
   1776   };
   1777 
   1778 .. _TALER_ExchangeKeyValidityPS:
   1779 .. sourcecode:: c
   1780 
   1781   struct TALER_ExchangeKeyValidityPS {
   1782     /**
   1783      * purpose.purpose = TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS
   1784      */
   1785     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1786     struct GNUNET_HashCode auditor_url_hash;
   1787     struct TALER_MasterPublicKeyP master;
   1788     struct GNUNET_TIME_AbsoluteNBO start;
   1789     struct GNUNET_TIME_AbsoluteNBO expire_withdraw;
   1790     struct GNUNET_TIME_AbsoluteNBO expire_spend;
   1791     struct GNUNET_TIME_AbsoluteNBO expire_legal;
   1792     struct TALER_AmountNBO value;
   1793     struct TALER_AmountNBO fee_withdraw;
   1794     struct TALER_AmountNBO fee_deposit;
   1795     struct TALER_AmountNBO fee_refresh;
   1796     struct TALER_DenominationHash denom_hash;
   1797   };
   1798 
   1799 .. _TALER_PaymentResponsePS:
   1800 .. sourcecode:: c
   1801 
   1802   struct PaymentResponsePS {
   1803     /**
   1804      * purpose.purpose = TALER_SIGNATURE_MERCHANT_PAYMENT_OK
   1805      */
   1806     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1807     struct TALER_PrivateContractHash h_contract_terms;
   1808   };
   1809 
   1810 .. _TALER_ContractPS:
   1811 .. sourcecode:: c
   1812 
   1813   struct TALER_ContractPS {
   1814     /**
   1815      * purpose.purpose = TALER_SIGNATURE_MERCHANT_CONTRACT
   1816      */
   1817     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1818     struct TALER_PrivateContractHash h_contract_terms;
   1819   };
   1820 
   1821 .. _TALER_ConfirmWirePS:
   1822 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE:
   1823 .. sourcecode:: c
   1824 
   1825   struct TALER_ConfirmWirePS {
   1826     /**
   1827      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE
   1828      */
   1829     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1830     struct TALER_MerchantWireHash h_wire;
   1831     struct TALER_PrivateContractHash h_contract_terms;
   1832     struct TALER_WireTransferIdentifierRawP wtid;
   1833     union TALER_CoinSpendPublicKeyP coin_pub;
   1834     struct GNUNET_TIME_AbsoluteNBO execution_time;
   1835     struct TALER_AmountNBO coin_contribution;
   1836   };
   1837 
   1838 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND:
   1839 .. sourcecode:: c
   1840 
   1841    struct TALER_RefundConfirmationPS {
   1842      /**
   1843       * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND.
   1844       */
   1845      struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1846      struct TALER_PrivateContractHash h_contract_terms;
   1847      union TALER_CoinSpendPublicKeyP coin_pub;
   1848      struct TALER_MerchantPublicKeyP merchant;
   1849      uint64_t rtransaction_id;
   1850      struct TALER_AmountNBO refund_amount;
   1851    };
   1852 
   1853 .. _TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION:
   1854 .. sourcecode:: c
   1855 
   1856     struct TALER_DepositTrackPS {
   1857       /**
   1858        * purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION.
   1859        */
   1860       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1861       struct TALER_PrivateContractHash h_contract_terms;
   1862       struct TALER_MerchantWireHash h_wire;
   1863       struct TALER_MerchantPublicKeyP merchant;
   1864       union TALER_CoinSpendPublicKeyP coin_pub;
   1865     };
   1866 
   1867 .. _TALER_RefundRequestPS:
   1868 .. sourcecode:: c
   1869 
   1870   struct TALER_RefundRequestPS {
   1871     /**
   1872      *  purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND
   1873      */
   1874     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1875     struct TALER_PrivateContractHash h_contract_terms;
   1876     union TALER_CoinSpendPublicKeyP coin_pub;
   1877     uint64_t rtransaction_id;
   1878     struct TALER_AmountNBO refund_amount;
   1879     struct TALER_AmountNBO refund_fee;
   1880   };
   1881 
   1882 .. _TALER_MerchantRefundConfirmationPS:
   1883 .. sourcecode:: c
   1884 
   1885   struct TALER_MerchantRefundConfirmationPS {
   1886     /**
   1887      *  purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND_OK
   1888      */
   1889     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1890     /**
   1891      * Hash of the order ID (a string), hashed without the 0-termination.
   1892      */
   1893     struct GNUNET_HashCode h_order_id;
   1894   };
   1895 
   1896 
   1897 .. _TALER_RecoupRequestPS:
   1898 .. sourcecode:: c
   1899 
   1900   struct TALER_RecoupRequestPS {
   1901     /**
   1902      *  purpose.purpose = TALER_SIGNATURE_WALLET_COIN_RECOUP
   1903      * or TALER_SIGNATURE_WALLET_COIN_RECOUP_REFRESH
   1904      */
   1905     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1906     struct TALER_DenominationHashP h_denom_pub;
   1907     union GNUNET_CRYPTO_BlindingSecretP coin_blind;
   1908   };
   1909 
   1910 .. _TALER_RecoupWithdrawBatchConfirmationPS:
   1911 .. sourcecode:: c
   1912 
   1913   /**
   1914    * Signed by the exchange in the response to /recoup-withdraw,
   1915    * affirming that it credited the reserve for all recouped coins
   1916    * of one request.
   1917    */
   1918   struct TALER_RecoupWithdrawBatchConfirmationPS {
   1919     /**
   1920      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_WITHDRAW_BATCH
   1921      */
   1922     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1923     struct GNUNET_TIME_TimestampNBO timestamp;
   1924     struct TALER_ReservePublicKeyP reserve_pub;
   1925     struct TALER_HashBlindedPlanchetsP planchets_h;
   1926     struct TALER_AmountNBO total_amount;
   1927     /**
   1928      * SHA-512 hash over the concatenation, in the order of the
   1929      * ``recoups`` array of the response, of the coin public key
   1930      * (32 bytes) followed by the recouped amount (as TALER_AmountNBO)
   1931      * of every recouped coin.
   1932      */
   1933     struct GNUNET_HashCode h_recoups;
   1934   };
   1935 
   1936 .. _TALER_RecoupRefreshBatchConfirmationPS:
   1937 .. sourcecode:: c
   1938 
   1939   /**
   1940    * Signed by the exchange in the response to /recoup-refresh,
   1941    * affirming that it credited the old coin for all recouped coins
   1942    * of one request.
   1943    */
   1944   struct TALER_RecoupRefreshBatchConfirmationPS {
   1945     /**
   1946      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH_BATCH
   1947      */
   1948     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1949     struct GNUNET_TIME_TimestampNBO timestamp;
   1950     struct TALER_CoinSpendPublicKeyP old_coin_pub;
   1951     struct TALER_RefreshCommitmentP rc;
   1952     struct TALER_AmountNBO total_amount;
   1953     /**
   1954      * SHA-512 hash over the concatenation, in the order of the
   1955      * ``recoups`` array of the response, of the coin public key
   1956      * (32 bytes) followed by the recouped amount (as TALER_AmountNBO)
   1957      * of every recouped coin.
   1958      */
   1959     struct GNUNET_HashCode h_recoups;
   1960   };
   1961 
   1962 .. _TALER_RecoupRefreshConfirmationPS:
   1963 .. sourcecode:: c
   1964 
   1965   struct TALER_RecoupRefreshConfirmationPS {
   1966     /**
   1967      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH
   1968      */
   1969     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1970     struct GNUNET_TIME_AbsoluteNBO timestamp;
   1971     struct TALER_AmountNBO recoup_amount;
   1972     union TALER_CoinSpendPublicKeyP coin_pub;
   1973     union TALER_CoinSpendPublicKeyP old_coin_pub;
   1974   };
   1975 
   1976 .. _TALER_RecoupConfirmationPS:
   1977 .. sourcecode:: c
   1978 
   1979   struct TALER_RecoupConfirmationPS {
   1980     /**
   1981      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP
   1982      */
   1983     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1984     struct GNUNET_TIME_AbsoluteNBO timestamp;
   1985     struct TALER_AmountNBO recoup_amount;
   1986     union TALER_CoinSpendPublicKeyP coin_pub;
   1987     struct TALER_ReservePublicKeyP reserve_pub;
   1988   };
   1989 
   1990 
   1991 .. _TALER_DenominationUnknownAffirmationPS:
   1992 .. sourcecode:: c
   1993 
   1994   struct TALER_DenominationUnknownAffirmationPS {
   1995     /**
   1996      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_UNKNOWN
   1997      */
   1998     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   1999     struct GNUNET_TIME_AbsoluteNBO timestamp;
   2000     struct TALER_DenominationHash h_denom_pub;
   2001   };
   2002 
   2003 
   2004 .. _TALER_DenominationExpiredAffirmationPS:
   2005 .. sourcecode:: c
   2006 
   2007   struct TALER_DenominationExpiredAffirmationPS {
   2008     /**
   2009      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_GENERIC_DENOMINATIN_EXPIRED
   2010      */
   2011     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2012     struct GNUNET_TIME_AbsoluteNBO timestamp;
   2013     char operation[8];
   2014     struct TALER_DenominationHash h_denom_pub;
   2015   };
   2016 
   2017 
   2018 .. _TALER_ReserveCloseConfirmationPS:
   2019 .. sourcecode:: c
   2020 
   2021   struct TALER_ReserveCloseConfirmationPS {
   2022     /**
   2023      * purpose.purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED
   2024      */
   2025     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2026     struct GNUNET_TIME_AbsoluteNBO timestamp;
   2027     struct TALER_AmountNBO closing_amount;
   2028     struct TALER_ReservePublicKeyP reserve_pub;
   2029     struct TALER_FullPaytoHash h_wire;
   2030   };
   2031 
   2032 .. _TALER_CoinLinkSignaturePS:
   2033 .. sourcecode:: c
   2034 
   2035   struct TALER_CoinLinkSignaturePS {
   2036     /**
   2037      * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_LINK
   2038      */
   2039     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2040     struct TALER_DenominationHash h_denom_pub;
   2041     union TALER_CoinSpendPublicKeyP old_coin_pub;
   2042     struct TALER_TransferPublicKeyP transfer_pub;
   2043     struct TALER_BlindedCoinHash coin_envelope_hash;
   2044   };
   2045 
   2046 .. _TALER_RefreshNonceSignaturePS:
   2047 .. sourcecode:: c
   2048 
   2049   struct TALER_RefreshNonceSignaturePS
   2050   {
   2051     /**
   2052      * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_LINK
   2053      */
   2054     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2055     struct TALER_PublicRefreshCoinNonceP nonce;
   2056   };
   2057 
   2058 
   2059 .. _TALER_ReserveStatusRequestSignaturePS:
   2060 .. sourcecode:: c
   2061 
   2062   struct TALER_ReserveStatusRequestSignaturePS {
   2063     /**
   2064      * purpose.purpose = TALER_SIGNATURE_RESERVE_STATUS_REQUEST
   2065      */
   2066     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2067     struct GNUNET_TIME_AbsoluteNBO request_timestamp;
   2068   };
   2069 
   2070 
   2071 .. _TALER_ReserveHistoryRequestSignaturePS:
   2072 .. sourcecode:: c
   2073 
   2074   struct TALER_ReserveHistoryRequestSignaturePS {
   2075     /**
   2076      * purpose.purpose = TALER_SIGNATURE_RESERVE_HISTORY_REQUEST
   2077      */
   2078     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2079     struct TALER_AmountNBO history_fee;
   2080     struct GNUNET_TIME_AbsoluteNBO request_timestamp;
   2081   };
   2082 
   2083 
   2084 .. _TALER_PurseStatusRequestSignaturePS:
   2085 .. sourcecode:: c
   2086 
   2087   struct TALER_PurseStatusRequestSignaturePS {
   2088     /**
   2089      * purpose.purpose = TALER_SIGNATURE_PURSE_STATUS_REQUEST
   2090      */
   2091     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2092   };
   2093 
   2094 
   2095 .. _TALER_PurseStatusResponseSignaturePS:
   2096 .. sourcecode:: c
   2097 
   2098   struct TALER_PurseStatusResponseSignaturePS {
   2099     /**
   2100      * purpose.purpose = TALER_SIGNATURE_PURSE_STATUS_RESPONSE
   2101      */
   2102     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2103     struct TALER_AmountNBO total_purse_amount;
   2104     struct TALER_AmountNBO total_deposit_amount;
   2105     struct TALER_AmountNBO max_deposit_fees;
   2106     struct GNUNET_TIME_AbsoluteNBO purse_expiration;
   2107     struct GNUNET_TIME_AbsoluteNBO status_timestamp;
   2108     struct TALER_PrivateContractHash h_contract_terms;
   2109   };
   2110 
   2111 
   2112 .. _TALER_ReserveCloseRequestSignaturePS:
   2113 .. sourcecode:: c
   2114 
   2115   struct TALER_ReserveCloseRequestSignaturePS {
   2116     /**
   2117      * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE
   2118      */
   2119     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2120   };
   2121 
   2122 
   2123 .. _TALER_PurseRequestSignaturePS:
   2124 .. sourcecode:: c
   2125 
   2126   struct TALER_PurseRequestSignaturePS {
   2127     /**
   2128      * purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_CREATE
   2129      */
   2130     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2131     struct GNUNET_TIME_AbsoluteNBO purse_expiration;
   2132     struct TALER_AmountNBO merge_value_after_fees;
   2133     struct TALER_PrivateContractHashP h_contract_terms;
   2134     uint32_t min_age;
   2135   };
   2136 
   2137 
   2138 .. _TALER_PurseDepositSignaturePS:
   2139 .. sourcecode:: c
   2140 
   2141   struct TALER_PurseDepositSignaturePS {
   2142     /**
   2143      * purpose.purpose = TALER_SIGNATURE_PURSE_DEPOSIT
   2144      */
   2145     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2146     struct TALER_AmountNBO coin_contribution;
   2147     struct TALER_DenominationHash h_denom_pub;
   2148     struct TALER_AgeCommitmentHash h_age_commitment;
   2149     struct TALER_PursePublicKeyP purse_pub;
   2150     struct GNUNET_HashCode h_exchange_base_url;
   2151   };
   2152 
   2153 
   2154 .. _TALER_ReserveOpenDepositSignaturePS:
   2155 .. sourcecode:: c
   2156 
   2157   struct TALER_PurseDepositSignaturePS {
   2158     /**
   2159      * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN_DEPOSIT
   2160      */
   2161     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2162     struct TALER_ReserveSignatureP reserve_sig;
   2163     struct TALER_AmountNBO coin_contribution;
   2164   };
   2165 
   2166 
   2167 .. _TALER_PurseDepositConfirmedSignaturePS:
   2168 .. sourcecode:: c
   2169 
   2170   struct TALER_PurseDepositConfirmedSignaturePS {
   2171     /**
   2172      * purpose.purpose = TALER_SIGNATURE_PURSE_DEPOSIT_CONFIRMED
   2173      */
   2174     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2175     struct TALER_AmountNBO total_purse_amount;
   2176     struct TALER_AmountNBO total_deposit_fees;
   2177     struct TALER_PursePublicKeyP purse_pub;
   2178     struct GNUNET_TIME_AbsoluteNBO purse_expiration;
   2179     struct TALER_PrivateContractHashP h_contract_terms;
   2180   };
   2181 
   2182 .. _TALER_PurseMergeSignaturePS:
   2183 .. sourcecode:: c
   2184 
   2185   struct TALER_PurseMergeSignaturePS {
   2186     /**
   2187      * purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_MERGE
   2188      */
   2189     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2190     struct GNUNET_TIME_AbsoluteNBO merge_timestamp;
   2191     struct TALER_NormalizedPaytoHashP h_wire;
   2192   };
   2193 
   2194 
   2195 .. _TALER_AccountMergeSignaturePS:
   2196 .. sourcecode:: c
   2197 
   2198   struct TALER_AccountMergeSignaturePS {
   2199     /**
   2200      * purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_MERGE
   2201      */
   2202     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2203     struct TALER_ReservePublicKeyP reserve_pub;
   2204     struct TALER_PursePublicKeyP purse_pub;
   2205     struct TALER_AmountNBO merge_amount_after_fees;
   2206     struct GNUNET_TIME_AbsoluteNBO merge_timestamp;
   2207     struct GNUNET_TIME_AbsoluteNBO purse_expiration;
   2208     struct TALER_PrivateContractHashP h_contract_terms;
   2209     uint32_t min_age;
   2210   };
   2211 
   2212 .. _TALER_AccountSetupRequestSignaturePS:
   2213 .. sourcecode:: c
   2214 
   2215   struct TALER_AccountSetupRequestSignaturePS {
   2216     /**
   2217      * purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_SETUP
   2218      */
   2219     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2220     struct TALER_AmountNBO threshold;
   2221   };
   2222 
   2223 .. _TALER_PurseMergeSuccessSignaturePS:
   2224 .. sourcecode:: c
   2225 
   2226   struct TALER_PurseMergeSuccessSignaturePS {
   2227     /**
   2228      * purpose.purpose = TALER_SIGNATURE_PURSE_MERGE_SUCCESS
   2229      */
   2230     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2231     struct TALER_ReservePublicKeyP reserve_pub;
   2232     struct TALER_PursePublicKeyP purse_pub;
   2233     struct TALER_AmountNBO merge_amount_after_fees;
   2234     struct GNUNET_TIME_AbsoluteNBO contract_time;
   2235     struct TALER_PrivateContractHashP h_contract_terms;
   2236     struct TALER_NormalizedPaytoHashP h_wire;
   2237     uint32_t min_age;
   2238   };
   2239 
   2240 
   2241 .. _TALER_WadDataSignaturePS:
   2242 .. sourcecode:: c
   2243 
   2244   struct TALER_WadDataSignaturePS {
   2245     /**
   2246      * purpose.purpose = TALER_SIGNATURE_WAD_DATA
   2247      */
   2248     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2249     struct GNUNET_TIME_AbsoluteNBO wad_execution_time;
   2250     struct TALER_AmountNBO total_amount;
   2251     struct GNUNET_HashCode h_items;
   2252     struct TALER_WadId wad_id;
   2253   };
   2254 
   2255 .. _TALER_WadPartnerSignaturePS:
   2256 .. sourcecode:: c
   2257 
   2258   struct TALER_WadPartnerSignaturePS {
   2259     /**
   2260      * purpose.purpose = TALER_SIGNATURE_MASTER_PARTNER_DETAILS
   2261      */
   2262     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2263     struct GNUNET_HashCode h_partner_base_url;
   2264     struct TALER_MasterPublicKeyP master_public_key;
   2265     struct GNUNET_TIME_AbsoluteNBO start_date;
   2266     struct GNUNET_TIME_AbsoluteNBO end_date;
   2267     struct TALER_AmountNBO wad_fee;
   2268     struct GNUNET_TIME_RelativeNBO wad_frequency;
   2269   };
   2270 
   2271 
   2272 .. _TALER_P2PFeesPS:
   2273 .. sourcecode:: c
   2274 
   2275   struct TALER_P2PFeesPS {
   2276     /**
   2277      * purpose.purpose = TALER_SIGNATURE_P2P_FEES
   2278      */
   2279     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2280     struct GNUNET_TIME_AbsoluteNBO start_date;
   2281     struct GNUNET_TIME_AbsoluteNBO end_date;
   2282     struct TALER_AmountNBO kyc_fee;
   2283     struct TALER_AmountNBO purse_fee;
   2284     struct TALER_AmountNBO account_history_fee;
   2285     struct TALER_AmountNBO account_annual_fee;
   2286     struct GNUNET_TIME_RelativeNBO account_kyc_timeout;
   2287     struct GNUNET_TIME_RelativeNBO purse_timeout;
   2288     uint32_t purse_account_limit;
   2289   };
   2290 
   2291 
   2292 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND:
   2293 .. sourcecode:: c
   2294 
   2295    struct TALER_CoinPurseRefundConfirmationPS {
   2296      /**
   2297       * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND.
   2298       */
   2299      struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2300      struct TALER_PursePublicKeyP purse_pub;
   2301      union TALER_CoinSpendPublicKeyP coin_pub;
   2302      struct TALER_AmountNBO refunded_amount;
   2303      struct TALER_AmountNBO refund_fee;
   2304    };
   2305 
   2306 
   2307 .. _TALER_DenominationKeyAnnouncementPS:
   2308 .. sourcecode:: c
   2309 
   2310    struct TALER_DenominationKeyAnnouncementPS {
   2311      /**
   2312       * purpose.purpose = TALER_SIGNATURE_SM_DENOMINATION_KEY
   2313       */
   2314       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2315       struct TALER_DenominationHash h_denom_pub;
   2316       struct GNUNET_HashCode h_section_name;
   2317       struct GNUNET_TIME_AbsoluteNBO anchor_time;
   2318       struct GNUNET_TIME_RelativeNBO duration_withdraw;
   2319     };
   2320 
   2321 
   2322 .. _TALER_SigningKeyAnnouncementPS:
   2323 .. sourcecode:: c
   2324 
   2325     struct TALER_SigningKeyAnnouncementPS {
   2326       /**
   2327        * purpose.purpose = TALER_SIGNATURE_SM_SIGNING_KEY .
   2328        */
   2329       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2330       struct TALER_ExchangePublicKeyP exchange_pub;
   2331       struct GNUNET_TIME_AbsoluteNBO anchor_time;
   2332       struct GNUNET_TIME_RelativeNBO duration;
   2333     };
   2334 
   2335 .. _TALER_MasterDenominationKeyRevocationPS:
   2336 .. sourcecode:: c
   2337 
   2338     struct TALER_MasterDenominationKeyRevocationPS {
   2339       /**
   2340        * purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED.
   2341        */
   2342       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2343       struct TALER_DenominationHash h_denom_pub;
   2344     };
   2345 
   2346 
   2347 .. _TALER_MasterSigningKeyRevocationPS:
   2348 .. sourcecode:: c
   2349 
   2350     struct TALER_MasterSigningKeyRevocationPS {
   2351       /**
   2352        * purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED.
   2353        */
   2354       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2355       struct TALER_ExchangePublicKeyP exchange_pub;
   2356     };
   2357 
   2358 
   2359 .. _TALER_MasterAddAuditorPS:
   2360 .. sourcecode:: c
   2361 
   2362     struct TALER_MasterAddAuditorPS {
   2363       /**
   2364        * purpose.purpose = TALER_SIGNATURE_MASTER_ADD_AUDITOR
   2365        */
   2366        struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2367        struct GNUNET_TIME_AbsoluteNBO start_date;
   2368        struct TALER_AuditorPublicKeyP auditor_pub;
   2369        struct GNUNET_HashCode h_auditor_url;
   2370      };
   2371 
   2372 .. _TALER_MasterDelAuditorPS:
   2373 .. sourcecode:: c
   2374 
   2375     struct TALER_MasterDelAuditorPS {
   2376       /**
   2377        * purpose.purpose = TALER_SIGNATURE_MASTER_DEL_AUDITOR
   2378        */
   2379       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2380       struct GNUNET_TIME_AbsoluteNBO end_date;
   2381       struct TALER_AuditorPublicKeyP auditor_pub;
   2382     };
   2383 
   2384 .. _TALER_MasterAddWirePS:
   2385 .. sourcecode:: c
   2386 
   2387     struct TALER_MasterAddWirePS {
   2388       /**
   2389        * purpose.purpose = TALER_SIGNATURE_MASTER_ADD_WIRE.
   2390        */
   2391       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2392       struct GNUNET_TIME_AbsoluteNBO start_date;
   2393       struct TALER_FullPaytoHash h_wire;
   2394       struct GNUNET_HashCode h_conversion_url;
   2395       struct GNUNET_HashCode h_credit_restrictions;
   2396       struct GNUNET_HashCode h_debit_restrictions;
   2397     };
   2398 
   2399 .. _TALER_MasterDelWirePS:
   2400 .. sourcecode:: c
   2401 
   2402     struct TALER_MasterDelWirePS {
   2403       /**
   2404        * purpose.purpose = TALER_SIGNATURE_MASTER_DEL_WIRE.
   2405        */
   2406       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2407       struct GNUNET_TIME_AbsoluteNBO end_date;
   2408       struct TALER_FullPaytoHash h_wire;
   2409     };
   2410 
   2411 
   2412 .. _TALER_MasterAmlOfficerStatusPS:
   2413 .. sourcecode:: c
   2414 
   2415     struct TALER_MasterAmlOfficerStatusPS {
   2416       /**
   2417        * purpose.purpose = TALER_SIGNATURE_MASTER_AML_KEY
   2418        */
   2419       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2420       struct GNUNET_TIME_TimestampNBO change_date;
   2421       struct TALER_AmlOfficerPublicKeyP officer_pub;
   2422       struct GNUNET_HashCode h_officer_name GNUNET_PACKED;
   2423       uint32_t is_active GNUNET_PACKED;
   2424     };
   2425 
   2426 .. _TALER_AmlDecisionPS:
   2427 .. sourcecode:: c
   2428 
   2429     struct TALER_AmlDecisionPS {
   2430       /**
   2431        * purpose.purpose =TALER_SIGNATURE_AML_DECISION.
   2432        */
   2433       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2434       struct GNUNET_HashCode h_justification GNUNET_PACKED;
   2435       struct GNUNET_TIME_TimestampNBO decision_time;
   2436       struct TALER_AmountNBO new_threshold;
   2437       struct TALER_NormalizedPaytoHashP h_payto GNUNET_PACKED;
   2438       struct GNUNET_HashCode h_kyc_requirements;
   2439       uint32_t new_state GNUNET_PACKED;
   2440     };
   2441 
   2442 .. _TALER_PartnerConfigurationPS:
   2443 .. sourcecode:: c
   2444 
   2445     struct TALER_PartnerConfigurationPS {
   2446       /**
   2447        * purpose.purpose = TALER_SIGNATURE_MASTER_PARNTER_DETAILS
   2448        */
   2449       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2450       struct TALER_MasterPublicKeyP partner_pub;
   2451       struct GNUNET_TIME_TimestampNBO start_date;
   2452       struct GNUNET_TIME_TimestampNBO end_date;
   2453       struct GNUNET_TIME_RelativeNBO wad_frequency;
   2454       struct TALER_AmountNBO wad_fee;
   2455       struct GNUNET_HashCode h_url;
   2456     };
   2457 
   2458 .. _TALER_ReserveOpenPS:
   2459 .. sourcecode:: c
   2460 
   2461     struct TALER_ReserveOpenPS {
   2462       /**
   2463        * Purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN
   2464        */
   2465       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2466       struct TALER_AmountNBO reserve_payment;
   2467       struct GNUNET_TIME_TimestampNBO request_timestamp;
   2468       struct GNUNET_TIME_TimestampNBO reserve_expiration;
   2469       uint32_t purse_limit;
   2470     };
   2471 
   2472 .. _TALER_ReserveClosePS:
   2473 .. sourcecode:: c
   2474 
   2475     struct TALER_ReserveClosePS {
   2476       /**
   2477        * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE
   2478        */
   2479       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2480       struct GNUNET_TIME_TimestampNBO request_timestamp;
   2481       struct TALER_FullPaytoHashP target_account_h_payto;
   2482     };
   2483 
   2484 .. _TALER_WalletReserveAttestRequestSignaturePS:
   2485 .. sourcecode:: c
   2486 
   2487     struct TALER_ReserveAttestRequestPS {
   2488       /**
   2489        * purpose.purpose = TALER_SIGNATURE_WALLET_ATTEST_REQUEST
   2490        */
   2491       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2492       struct GNUNET_TIME_TimestampNBO request_timestamp;
   2493       struct GNUNET_HashCode h_details;
   2494     };
   2495 
   2496 .. _TALER_ExchangeAttestPS:
   2497 .. sourcecode:: c
   2498 
   2499     struct TALER_ExchangeAttestPS {
   2500       /**
   2501        * purpose.purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_ATTEST_DETAILS
   2502        */
   2503       struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2504       struct GNUNET_TIME_TimestampNBO attest_timestamp;
   2505       struct GNUNET_TIME_TimestampNBO expiration_time;
   2506       struct TALER_ReservePublicKeyP reserve_pub;
   2507       struct GNUNET_HashCode h_attributes;
   2508     };
   2509 
   2510 .. _TALER_ExternKycDataImportBindingPS:
   2511 .. sourcecode:: c
   2512 
   2513   struct TALER_ExternKycDataImportBindingPS {
   2514     /**
   2515      * purpose.purpose = TALER_SIGNATURE_EXTERN_KYC_IMPORT_BINDING
   2516      */
   2517     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2518     struct GNUNET_TIME_AbsoluteNBO import_date;
   2519     union GNUNET_AccountPublicKeyP account_pub;
   2520     struct GNUNET_HashCode h_attributes;
   2521     struct GNUNET_HashCode h_customer_payto;
   2522   };
   2523 
   2524 
   2525 .. _TALER_ExternKycDataBulkBindingPS:
   2526 .. sourcecode:: c
   2527 
   2528   struct TALER_ExternKycDataBulkBindingPS {
   2529     /**
   2530      * purpose.purpose = TALER_SIGNATURE_EXTERN_KYC_BULK_BINDING
   2531      */
   2532     struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
   2533     struct GNUNET_HashCode h_body;
   2534     struct GNUNET_HashCode h_customer_payto;
   2535   };
   2536 
   2537 .. _TALER_PreparedTransferRegisterPS:
   2538 .. sourcecode:: c
   2539 
   2540   struct TALER_PreparedTransferRegisterPS {
   2541     /**
   2542     * Purpose is #TALER_SIGNATURE_WALLET_PREPARED_TRANSFER_REGISTER
   2543     */
   2544     struct GNUNET_CRYPTO_SignaturePurpose purpose;
   2545     struct TALER_NormalizedPayto credit_account;
   2546     struct TALER_AmountNBO credit_amount;
   2547     /**
   2548     * 1: reserve, 2: kyc
   2549     */
   2550     uint32_t type;
   2551     /**
   2552     * 1: one-time, 2: recurrent
   2553     */
   2554     uint16_t recurrent;
   2555     /**
   2556     * 1: EdDSA
   2557     */
   2558     uint16_t alg;
   2559     union TALER_AccountPublicKeyP account_pub;
   2560   };
   2561 
   2562 .. _TALER_PreparedTransferUnregisterPS:
   2563 .. sourcecode:: c
   2564 
   2565   struct TALER_PreparedTransferUnregisterPS {
   2566     /**
   2567     * Purpose is #TALER_SIGNATURE_WALLET_PREPARED_TRANSFER_UNREGISTER
   2568     */
   2569     struct GNUNET_CRYPTO_SignaturePurpose purpose;
   2570     struct GNUNET_TIME_TimestampNBO timestamp;
   2571   };