api-common.rst (76694B)
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 * SHA-512 hash over the concatenation of: 1581 * 1. the refresh_seed of the /melt request (64 bytes), 1582 * 2. @since v45 (ignored for earlier protocol versions, see below): 1583 * the kappa * n transfer public keys of the /melt request 1584 * (32 bytes each), batch by batch: 1585 * [0][0..n), [1][0..n), ..., [kappa-1][0..n), 1586 * 3. the blinding_seed of the /melt request (32 bytes) if one 1587 * of the fresh coins is of a Clause-Schnorr denomination, 1588 * otherwise 32 zero bytes, 1589 * 4. the public key of the old coin (32 bytes), 1590 * 5. the amount with fee, as `TALER_AmountNBO`, 1591 * 6. kappa `TALER_HashPlanchetsP` (64 bytes each), one for each 1592 * batch k = 0..kappa-1, over the n `TALER_BlindedCoinHashP` 1593 * of the fresh coin candidates of the batch. 1594 * 1595 * Clients MUST include step 2 if the exchange announces protocol 1596 * v45 or later in /config and /keys, and MUST NOT include it for 1597 * exchanges of earlier protocol versions, which do not accept the 1598 * transfer public keys in the commitment (even though clients 1599 * since v32 send them in the /melt request). 1600 * 1601 * For compatibility with older clients, exchanges since v45 also 1602 * accept the commitment without step 2. A later protocol version 1603 * will stop accepting it for new melts. 1604 */ 1605 struct GNUNET_HashCode session_hash; 1606 }; 1607 1608 .. _TALER_RefreshMeltCoinAffirmationPS: 1609 .. sourcecode:: c 1610 1611 struct TALER_RefreshMeltCoinAffirmationPS { 1612 /** 1613 * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_MELT 1614 */ 1615 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1616 struct TALER_RefreshCommitmentP session_hash; 1617 struct TALER_DenominationHash h_denom_pub; 1618 struct TALER_AgeCommitmentHash h_age_commitment; 1619 struct TALER_AmountNBO amount_with_fee; 1620 struct TALER_AmountNBO melt_fee; 1621 }; 1622 1623 .. _TALER_RefreshMeltConfirmationPS: 1624 .. sourcecode:: c 1625 1626 struct TALER_RefreshMeltConfirmationPS { 1627 /** 1628 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT 1629 */ 1630 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1631 struct TALER_RefreshCommitmentP session_hash; 1632 uint16_t noreveal_index; 1633 }; 1634 1635 .. _TALER_ExchangeSigningKeyValidityPS: 1636 .. sourcecode:: c 1637 1638 struct TALER_ExchangeSigningKeyValidityPS { 1639 /** 1640 * purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY 1641 */ 1642 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1643 struct GNUNET_TIME_AbsoluteNBO start; 1644 struct GNUNET_TIME_AbsoluteNBO expire; 1645 struct GNUNET_TIME_AbsoluteNBO end; 1646 struct TALER_ExchangePublicKeyP signkey_pub; 1647 }; 1648 1649 .. _TALER_ExchangeKeySetPS: 1650 .. sourcecode:: c 1651 1652 struct TALER_ExchangeKeySetPS { 1653 /** 1654 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_KEY_SET 1655 */ 1656 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1657 struct GNUNET_TIME_AbsoluteNBO list_issue_date; 1658 struct GNUNET_HashCode hc; 1659 }; 1660 1661 .. _TALER_DenominationKeyValidityPS: 1662 .. sourcecode:: c 1663 1664 struct TALER_DenominationKeyValidityPS { 1665 /** 1666 * purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY 1667 */ 1668 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1669 struct TALER_MasterPublicKeyP master; 1670 struct GNUNET_TIME_AbsoluteNBO start; 1671 struct GNUNET_TIME_AbsoluteNBO expire_withdraw; 1672 struct GNUNET_TIME_AbsoluteNBO expire_spend; 1673 struct GNUNET_TIME_AbsoluteNBO expire_legal; 1674 struct TALER_AmountNBO value; 1675 struct TALER_AmountNBO fee_withdraw; 1676 struct TALER_AmountNBO fee_deposit; 1677 struct TALER_AmountNBO fee_refresh; 1678 struct TALER_DenominationHash denom_hash; 1679 }; 1680 1681 .. _TALER_MasterWireDetailsPS: 1682 .. sourcecode:: c 1683 1684 struct TALER_MasterWireDetailsPS { 1685 /** 1686 * purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_DETAILS 1687 */ 1688 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1689 struct TALER_FullPaytoHash h_wire_details; 1690 struct GNUNET_HashCode h_conversion_url; 1691 struct GNUNET_HashCode h_credit_restrictions; 1692 struct GNUNET_HashCode h_debit_restrictions; 1693 }; 1694 1695 .. _TALER_MasterWireFeePS: 1696 .. sourcecode:: c 1697 1698 struct TALER_MasterWireFeePS { 1699 /** 1700 * purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_FEES 1701 */ 1702 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1703 struct GNUNET_HashCode h_wire_method; 1704 struct GNUNET_TIME_AbsoluteNBO start_date; 1705 struct GNUNET_TIME_AbsoluteNBO end_date; 1706 struct TALER_AmountNBO wire_fee; 1707 struct TALER_AmountNBO closing_fee; 1708 }; 1709 1710 .. _TALER_GlobalFeesPS: 1711 .. sourcecode:: c 1712 1713 struct TALER_GlobalFeesPS { 1714 /** 1715 * purpose.purpose = TALER_SIGNATURE_MASTER_GLOBAL_FEES 1716 */ 1717 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1718 struct GNUNET_TIME_AbsoluteNBO start_date; 1719 struct GNUNET_TIME_AbsoluteNBO end_date; 1720 struct GNUNET_TIME_RelativeNBO purse_timeout; 1721 struct GNUNET_TIME_RelativeNBO kyc_timeout; 1722 struct GNUNET_TIME_RelativeNBO history_expiration; 1723 struct TALER_AmountNBO history_fee; 1724 struct TALER_AmountNBO kyc_fee; 1725 struct TALER_AmountNBO account_fee; 1726 struct TALER_AmountNBO purse_fee; 1727 uint32_t purse_account_limit; 1728 }; 1729 1730 .. _TALER_MasterDrainProfitPS: 1731 .. sourcecode:: c 1732 1733 struct TALER_MasterDrainProfitPS { 1734 /** 1735 * purpose.purpose = TALER_SIGNATURE_MASTER_DRAIN_PROFITS 1736 */ 1737 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1738 struct TALER_WireTransferIdentifierRawP wtid; 1739 struct GNUNET_TIME_AbsoluteNBO date; 1740 struct TALER_AmountNBO amount; 1741 struct GNUNET_HashCode h_section; 1742 struct TALER_FullPaytoHashP h_payto; 1743 }; 1744 1745 .. _TALER_DepositTrackPS: 1746 .. sourcecode:: c 1747 1748 struct TALER_DepositTrackPS { 1749 /** 1750 * purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION 1751 */ 1752 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1753 struct TALER_PrivateContractHash h_contract_terms; 1754 struct TALER_MerchantWireHash h_wire; 1755 union TALER_CoinSpendPublicKeyP coin_pub; 1756 }; 1757 1758 .. _TALER_WireDepositDetailP: 1759 .. sourcecode:: c 1760 1761 struct TALER_WireDepositDetailP { 1762 struct TALER_PrivateContractHash h_contract_terms; 1763 struct GNUNET_TIME_AbsoluteNBO execution_time; 1764 union TALER_CoinSpendPublicKeyP coin_pub; 1765 struct TALER_AmountNBO deposit_value; 1766 struct TALER_AmountNBO deposit_fee; 1767 }; 1768 1769 .. _TALER_WireDepositDataPS: 1770 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT: 1771 .. sourcecode:: c 1772 1773 struct TALER_WireDepositDataPS { 1774 /** 1775 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT 1776 */ 1777 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1778 struct TALER_AmountNBO total; 1779 struct TALER_AmountNBO wire_fee; 1780 struct TALER_MerchantPublicKeyP merchant_pub; 1781 struct TALER_MerchantWireHash h_wire; 1782 struct GNUNET_HashCode h_details; 1783 }; 1784 1785 .. _TALER_ExchangeKeyValidityPS: 1786 .. sourcecode:: c 1787 1788 struct TALER_ExchangeKeyValidityPS { 1789 /** 1790 * purpose.purpose = TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS 1791 */ 1792 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1793 struct GNUNET_HashCode auditor_url_hash; 1794 struct TALER_MasterPublicKeyP master; 1795 struct GNUNET_TIME_AbsoluteNBO start; 1796 struct GNUNET_TIME_AbsoluteNBO expire_withdraw; 1797 struct GNUNET_TIME_AbsoluteNBO expire_spend; 1798 struct GNUNET_TIME_AbsoluteNBO expire_legal; 1799 struct TALER_AmountNBO value; 1800 struct TALER_AmountNBO fee_withdraw; 1801 struct TALER_AmountNBO fee_deposit; 1802 struct TALER_AmountNBO fee_refresh; 1803 struct TALER_DenominationHash denom_hash; 1804 }; 1805 1806 .. _TALER_PaymentResponsePS: 1807 .. sourcecode:: c 1808 1809 struct PaymentResponsePS { 1810 /** 1811 * purpose.purpose = TALER_SIGNATURE_MERCHANT_PAYMENT_OK 1812 */ 1813 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1814 struct TALER_PrivateContractHash h_contract_terms; 1815 }; 1816 1817 .. _TALER_ContractPS: 1818 .. sourcecode:: c 1819 1820 struct TALER_ContractPS { 1821 /** 1822 * purpose.purpose = TALER_SIGNATURE_MERCHANT_CONTRACT 1823 */ 1824 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1825 struct TALER_PrivateContractHash h_contract_terms; 1826 }; 1827 1828 .. _TALER_ConfirmWirePS: 1829 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE: 1830 .. sourcecode:: c 1831 1832 struct TALER_ConfirmWirePS { 1833 /** 1834 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE 1835 */ 1836 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1837 struct TALER_MerchantWireHash h_wire; 1838 struct TALER_PrivateContractHash h_contract_terms; 1839 struct TALER_WireTransferIdentifierRawP wtid; 1840 union TALER_CoinSpendPublicKeyP coin_pub; 1841 struct GNUNET_TIME_AbsoluteNBO execution_time; 1842 struct TALER_AmountNBO coin_contribution; 1843 }; 1844 1845 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND: 1846 .. sourcecode:: c 1847 1848 struct TALER_RefundConfirmationPS { 1849 /** 1850 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND. 1851 */ 1852 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1853 struct TALER_PrivateContractHash h_contract_terms; 1854 union TALER_CoinSpendPublicKeyP coin_pub; 1855 struct TALER_MerchantPublicKeyP merchant; 1856 uint64_t rtransaction_id; 1857 struct TALER_AmountNBO refund_amount; 1858 }; 1859 1860 .. _TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION: 1861 .. sourcecode:: c 1862 1863 struct TALER_DepositTrackPS { 1864 /** 1865 * purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION. 1866 */ 1867 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1868 struct TALER_PrivateContractHash h_contract_terms; 1869 struct TALER_MerchantWireHash h_wire; 1870 struct TALER_MerchantPublicKeyP merchant; 1871 union TALER_CoinSpendPublicKeyP coin_pub; 1872 }; 1873 1874 .. _TALER_RefundRequestPS: 1875 .. sourcecode:: c 1876 1877 struct TALER_RefundRequestPS { 1878 /** 1879 * purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND 1880 */ 1881 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1882 struct TALER_PrivateContractHash h_contract_terms; 1883 union TALER_CoinSpendPublicKeyP coin_pub; 1884 uint64_t rtransaction_id; 1885 struct TALER_AmountNBO refund_amount; 1886 struct TALER_AmountNBO refund_fee; 1887 }; 1888 1889 .. _TALER_MerchantRefundConfirmationPS: 1890 .. sourcecode:: c 1891 1892 struct TALER_MerchantRefundConfirmationPS { 1893 /** 1894 * purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND_OK 1895 */ 1896 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1897 /** 1898 * Hash of the order ID (a string), hashed without the 0-termination. 1899 */ 1900 struct GNUNET_HashCode h_order_id; 1901 }; 1902 1903 1904 .. _TALER_RecoupRequestPS: 1905 .. sourcecode:: c 1906 1907 struct TALER_RecoupRequestPS { 1908 /** 1909 * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_RECOUP 1910 * or TALER_SIGNATURE_WALLET_COIN_RECOUP_REFRESH 1911 */ 1912 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1913 struct TALER_DenominationHashP h_denom_pub; 1914 union GNUNET_CRYPTO_BlindingSecretP coin_blind; 1915 }; 1916 1917 .. _TALER_RecoupWithdrawBatchConfirmationPS: 1918 .. sourcecode:: c 1919 1920 /** 1921 * Signed by the exchange in the response to /recoup-withdraw, 1922 * affirming that it credited the reserve for all recouped coins 1923 * of one request. 1924 */ 1925 struct TALER_RecoupWithdrawBatchConfirmationPS { 1926 /** 1927 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_WITHDRAW_BATCH 1928 */ 1929 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1930 struct GNUNET_TIME_TimestampNBO timestamp; 1931 struct TALER_ReservePublicKeyP reserve_pub; 1932 struct TALER_HashBlindedPlanchetsP planchets_h; 1933 struct TALER_AmountNBO total_amount; 1934 /** 1935 * SHA-512 hash over the concatenation, in the order of the 1936 * ``recoups`` array of the response, of the coin public key 1937 * (32 bytes) followed by the recouped amount (as TALER_AmountNBO) 1938 * of every recouped coin. 1939 */ 1940 struct GNUNET_HashCode h_recoups; 1941 }; 1942 1943 .. _TALER_RecoupRefreshBatchConfirmationPS: 1944 .. sourcecode:: c 1945 1946 /** 1947 * Signed by the exchange in the response to /recoup-refresh, 1948 * affirming that it credited the old coin for all recouped coins 1949 * of one request. 1950 */ 1951 struct TALER_RecoupRefreshBatchConfirmationPS { 1952 /** 1953 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH_BATCH 1954 */ 1955 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1956 struct GNUNET_TIME_TimestampNBO timestamp; 1957 struct TALER_CoinSpendPublicKeyP old_coin_pub; 1958 struct TALER_RefreshCommitmentP rc; 1959 struct TALER_AmountNBO total_amount; 1960 /** 1961 * SHA-512 hash over the concatenation, in the order of the 1962 * ``recoups`` array of the response, of the coin public key 1963 * (32 bytes) followed by the recouped amount (as TALER_AmountNBO) 1964 * of every recouped coin. 1965 */ 1966 struct GNUNET_HashCode h_recoups; 1967 }; 1968 1969 .. _TALER_RecoupRefreshConfirmationPS: 1970 .. sourcecode:: c 1971 1972 struct TALER_RecoupRefreshConfirmationPS { 1973 /** 1974 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH 1975 */ 1976 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1977 struct GNUNET_TIME_AbsoluteNBO timestamp; 1978 struct TALER_AmountNBO recoup_amount; 1979 union TALER_CoinSpendPublicKeyP coin_pub; 1980 union TALER_CoinSpendPublicKeyP old_coin_pub; 1981 }; 1982 1983 .. _TALER_RecoupConfirmationPS: 1984 .. sourcecode:: c 1985 1986 struct TALER_RecoupConfirmationPS { 1987 /** 1988 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP 1989 */ 1990 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1991 struct GNUNET_TIME_AbsoluteNBO timestamp; 1992 struct TALER_AmountNBO recoup_amount; 1993 union TALER_CoinSpendPublicKeyP coin_pub; 1994 struct TALER_ReservePublicKeyP reserve_pub; 1995 }; 1996 1997 1998 .. _TALER_DenominationUnknownAffirmationPS: 1999 .. sourcecode:: c 2000 2001 struct TALER_DenominationUnknownAffirmationPS { 2002 /** 2003 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_UNKNOWN 2004 */ 2005 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2006 struct GNUNET_TIME_AbsoluteNBO timestamp; 2007 struct TALER_DenominationHash h_denom_pub; 2008 }; 2009 2010 2011 .. _TALER_DenominationExpiredAffirmationPS: 2012 .. sourcecode:: c 2013 2014 struct TALER_DenominationExpiredAffirmationPS { 2015 /** 2016 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_GENERIC_DENOMINATIN_EXPIRED 2017 */ 2018 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2019 struct GNUNET_TIME_AbsoluteNBO timestamp; 2020 char operation[8]; 2021 struct TALER_DenominationHash h_denom_pub; 2022 }; 2023 2024 2025 .. _TALER_ReserveCloseConfirmationPS: 2026 .. sourcecode:: c 2027 2028 struct TALER_ReserveCloseConfirmationPS { 2029 /** 2030 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED 2031 */ 2032 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2033 struct GNUNET_TIME_AbsoluteNBO timestamp; 2034 struct TALER_AmountNBO closing_amount; 2035 struct TALER_ReservePublicKeyP reserve_pub; 2036 struct TALER_FullPaytoHash h_wire; 2037 }; 2038 2039 .. _TALER_CoinLinkSignaturePS: 2040 .. sourcecode:: c 2041 2042 struct TALER_CoinLinkSignaturePS { 2043 /** 2044 * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_LINK 2045 */ 2046 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2047 struct TALER_DenominationHash h_denom_pub; 2048 union TALER_CoinSpendPublicKeyP old_coin_pub; 2049 struct TALER_TransferPublicKeyP transfer_pub; 2050 struct TALER_BlindedCoinHash coin_envelope_hash; 2051 }; 2052 2053 .. _TALER_RefreshNonceSignaturePS: 2054 .. sourcecode:: c 2055 2056 struct TALER_RefreshNonceSignaturePS 2057 { 2058 /** 2059 * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_LINK 2060 */ 2061 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2062 struct TALER_PublicRefreshCoinNonceP nonce; 2063 }; 2064 2065 2066 .. _TALER_ReserveStatusRequestSignaturePS: 2067 .. sourcecode:: c 2068 2069 struct TALER_ReserveStatusRequestSignaturePS { 2070 /** 2071 * purpose.purpose = TALER_SIGNATURE_RESERVE_STATUS_REQUEST 2072 */ 2073 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2074 struct GNUNET_TIME_AbsoluteNBO request_timestamp; 2075 }; 2076 2077 2078 .. _TALER_ReserveHistoryRequestSignaturePS: 2079 .. sourcecode:: c 2080 2081 struct TALER_ReserveHistoryRequestSignaturePS { 2082 /** 2083 * purpose.purpose = TALER_SIGNATURE_RESERVE_HISTORY_REQUEST 2084 */ 2085 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2086 struct TALER_AmountNBO history_fee; 2087 struct GNUNET_TIME_AbsoluteNBO request_timestamp; 2088 }; 2089 2090 2091 .. _TALER_PurseStatusRequestSignaturePS: 2092 .. sourcecode:: c 2093 2094 struct TALER_PurseStatusRequestSignaturePS { 2095 /** 2096 * purpose.purpose = TALER_SIGNATURE_PURSE_STATUS_REQUEST 2097 */ 2098 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2099 }; 2100 2101 2102 .. _TALER_PurseStatusResponseSignaturePS: 2103 .. sourcecode:: c 2104 2105 struct TALER_PurseStatusResponseSignaturePS { 2106 /** 2107 * purpose.purpose = TALER_SIGNATURE_PURSE_STATUS_RESPONSE 2108 */ 2109 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2110 struct TALER_AmountNBO total_purse_amount; 2111 struct TALER_AmountNBO total_deposit_amount; 2112 struct TALER_AmountNBO max_deposit_fees; 2113 struct GNUNET_TIME_AbsoluteNBO purse_expiration; 2114 struct GNUNET_TIME_AbsoluteNBO status_timestamp; 2115 struct TALER_PrivateContractHash h_contract_terms; 2116 }; 2117 2118 2119 .. _TALER_ReserveCloseRequestSignaturePS: 2120 .. sourcecode:: c 2121 2122 struct TALER_ReserveCloseRequestSignaturePS { 2123 /** 2124 * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE 2125 */ 2126 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2127 }; 2128 2129 2130 .. _TALER_PurseRequestSignaturePS: 2131 .. sourcecode:: c 2132 2133 struct TALER_PurseRequestSignaturePS { 2134 /** 2135 * purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_CREATE 2136 */ 2137 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2138 struct GNUNET_TIME_AbsoluteNBO purse_expiration; 2139 struct TALER_AmountNBO merge_value_after_fees; 2140 struct TALER_PrivateContractHashP h_contract_terms; 2141 uint32_t min_age; 2142 }; 2143 2144 2145 .. _TALER_PurseDepositSignaturePS: 2146 .. sourcecode:: c 2147 2148 struct TALER_PurseDepositSignaturePS { 2149 /** 2150 * purpose.purpose = TALER_SIGNATURE_PURSE_DEPOSIT 2151 */ 2152 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2153 struct TALER_AmountNBO coin_contribution; 2154 struct TALER_DenominationHash h_denom_pub; 2155 struct TALER_AgeCommitmentHash h_age_commitment; 2156 struct TALER_PursePublicKeyP purse_pub; 2157 struct GNUNET_HashCode h_exchange_base_url; 2158 }; 2159 2160 2161 .. _TALER_ReserveOpenDepositSignaturePS: 2162 .. sourcecode:: c 2163 2164 struct TALER_PurseDepositSignaturePS { 2165 /** 2166 * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN_DEPOSIT 2167 */ 2168 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2169 struct TALER_ReserveSignatureP reserve_sig; 2170 struct TALER_AmountNBO coin_contribution; 2171 }; 2172 2173 2174 .. _TALER_PurseDepositConfirmedSignaturePS: 2175 .. sourcecode:: c 2176 2177 struct TALER_PurseDepositConfirmedSignaturePS { 2178 /** 2179 * purpose.purpose = TALER_SIGNATURE_PURSE_DEPOSIT_CONFIRMED 2180 */ 2181 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2182 struct TALER_AmountNBO total_purse_amount; 2183 struct TALER_AmountNBO total_deposit_fees; 2184 struct TALER_PursePublicKeyP purse_pub; 2185 struct GNUNET_TIME_AbsoluteNBO purse_expiration; 2186 struct TALER_PrivateContractHashP h_contract_terms; 2187 }; 2188 2189 .. _TALER_PurseMergeSignaturePS: 2190 .. sourcecode:: c 2191 2192 struct TALER_PurseMergeSignaturePS { 2193 /** 2194 * purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_MERGE 2195 */ 2196 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2197 struct GNUNET_TIME_AbsoluteNBO merge_timestamp; 2198 struct TALER_NormalizedPaytoHashP h_wire; 2199 }; 2200 2201 2202 .. _TALER_AccountMergeSignaturePS: 2203 .. sourcecode:: c 2204 2205 struct TALER_AccountMergeSignaturePS { 2206 /** 2207 * purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_MERGE 2208 */ 2209 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2210 struct TALER_ReservePublicKeyP reserve_pub; 2211 struct TALER_PursePublicKeyP purse_pub; 2212 struct TALER_AmountNBO merge_amount_after_fees; 2213 struct GNUNET_TIME_AbsoluteNBO merge_timestamp; 2214 struct GNUNET_TIME_AbsoluteNBO purse_expiration; 2215 struct TALER_PrivateContractHashP h_contract_terms; 2216 uint32_t min_age; 2217 }; 2218 2219 .. _TALER_AccountSetupRequestSignaturePS: 2220 .. sourcecode:: c 2221 2222 struct TALER_AccountSetupRequestSignaturePS { 2223 /** 2224 * purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_SETUP 2225 */ 2226 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2227 struct TALER_AmountNBO threshold; 2228 }; 2229 2230 .. _TALER_PurseMergeSuccessSignaturePS: 2231 .. sourcecode:: c 2232 2233 struct TALER_PurseMergeSuccessSignaturePS { 2234 /** 2235 * purpose.purpose = TALER_SIGNATURE_PURSE_MERGE_SUCCESS 2236 */ 2237 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2238 struct TALER_ReservePublicKeyP reserve_pub; 2239 struct TALER_PursePublicKeyP purse_pub; 2240 struct TALER_AmountNBO merge_amount_after_fees; 2241 struct GNUNET_TIME_AbsoluteNBO contract_time; 2242 struct TALER_PrivateContractHashP h_contract_terms; 2243 struct TALER_NormalizedPaytoHashP h_wire; 2244 uint32_t min_age; 2245 }; 2246 2247 2248 .. _TALER_WadDataSignaturePS: 2249 .. sourcecode:: c 2250 2251 struct TALER_WadDataSignaturePS { 2252 /** 2253 * purpose.purpose = TALER_SIGNATURE_WAD_DATA 2254 */ 2255 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2256 struct GNUNET_TIME_AbsoluteNBO wad_execution_time; 2257 struct TALER_AmountNBO total_amount; 2258 struct GNUNET_HashCode h_items; 2259 struct TALER_WadId wad_id; 2260 }; 2261 2262 .. _TALER_WadPartnerSignaturePS: 2263 .. sourcecode:: c 2264 2265 struct TALER_WadPartnerSignaturePS { 2266 /** 2267 * purpose.purpose = TALER_SIGNATURE_MASTER_PARTNER_DETAILS 2268 */ 2269 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2270 struct GNUNET_HashCode h_partner_base_url; 2271 struct TALER_MasterPublicKeyP master_public_key; 2272 struct GNUNET_TIME_AbsoluteNBO start_date; 2273 struct GNUNET_TIME_AbsoluteNBO end_date; 2274 struct TALER_AmountNBO wad_fee; 2275 struct GNUNET_TIME_RelativeNBO wad_frequency; 2276 }; 2277 2278 2279 .. _TALER_P2PFeesPS: 2280 .. sourcecode:: c 2281 2282 struct TALER_P2PFeesPS { 2283 /** 2284 * purpose.purpose = TALER_SIGNATURE_P2P_FEES 2285 */ 2286 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2287 struct GNUNET_TIME_AbsoluteNBO start_date; 2288 struct GNUNET_TIME_AbsoluteNBO end_date; 2289 struct TALER_AmountNBO kyc_fee; 2290 struct TALER_AmountNBO purse_fee; 2291 struct TALER_AmountNBO account_history_fee; 2292 struct TALER_AmountNBO account_annual_fee; 2293 struct GNUNET_TIME_RelativeNBO account_kyc_timeout; 2294 struct GNUNET_TIME_RelativeNBO purse_timeout; 2295 uint32_t purse_account_limit; 2296 }; 2297 2298 2299 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND: 2300 .. sourcecode:: c 2301 2302 struct TALER_CoinPurseRefundConfirmationPS { 2303 /** 2304 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND. 2305 */ 2306 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2307 struct TALER_PursePublicKeyP purse_pub; 2308 union TALER_CoinSpendPublicKeyP coin_pub; 2309 struct TALER_AmountNBO refunded_amount; 2310 struct TALER_AmountNBO refund_fee; 2311 }; 2312 2313 2314 .. _TALER_DenominationKeyAnnouncementPS: 2315 .. sourcecode:: c 2316 2317 struct TALER_DenominationKeyAnnouncementPS { 2318 /** 2319 * purpose.purpose = TALER_SIGNATURE_SM_DENOMINATION_KEY 2320 */ 2321 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2322 struct TALER_DenominationHash h_denom_pub; 2323 struct GNUNET_HashCode h_section_name; 2324 struct GNUNET_TIME_AbsoluteNBO anchor_time; 2325 struct GNUNET_TIME_RelativeNBO duration_withdraw; 2326 }; 2327 2328 2329 .. _TALER_SigningKeyAnnouncementPS: 2330 .. sourcecode:: c 2331 2332 struct TALER_SigningKeyAnnouncementPS { 2333 /** 2334 * purpose.purpose = TALER_SIGNATURE_SM_SIGNING_KEY . 2335 */ 2336 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2337 struct TALER_ExchangePublicKeyP exchange_pub; 2338 struct GNUNET_TIME_AbsoluteNBO anchor_time; 2339 struct GNUNET_TIME_RelativeNBO duration; 2340 }; 2341 2342 .. _TALER_MasterDenominationKeyRevocationPS: 2343 .. sourcecode:: c 2344 2345 struct TALER_MasterDenominationKeyRevocationPS { 2346 /** 2347 * purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED. 2348 */ 2349 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2350 struct TALER_DenominationHash h_denom_pub; 2351 }; 2352 2353 2354 .. _TALER_MasterSigningKeyRevocationPS: 2355 .. sourcecode:: c 2356 2357 struct TALER_MasterSigningKeyRevocationPS { 2358 /** 2359 * purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED. 2360 */ 2361 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2362 struct TALER_ExchangePublicKeyP exchange_pub; 2363 }; 2364 2365 2366 .. _TALER_MasterAddAuditorPS: 2367 .. sourcecode:: c 2368 2369 struct TALER_MasterAddAuditorPS { 2370 /** 2371 * purpose.purpose = TALER_SIGNATURE_MASTER_ADD_AUDITOR 2372 */ 2373 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2374 struct GNUNET_TIME_AbsoluteNBO start_date; 2375 struct TALER_AuditorPublicKeyP auditor_pub; 2376 struct GNUNET_HashCode h_auditor_url; 2377 }; 2378 2379 .. _TALER_MasterDelAuditorPS: 2380 .. sourcecode:: c 2381 2382 struct TALER_MasterDelAuditorPS { 2383 /** 2384 * purpose.purpose = TALER_SIGNATURE_MASTER_DEL_AUDITOR 2385 */ 2386 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2387 struct GNUNET_TIME_AbsoluteNBO end_date; 2388 struct TALER_AuditorPublicKeyP auditor_pub; 2389 }; 2390 2391 .. _TALER_MasterAddWirePS: 2392 .. sourcecode:: c 2393 2394 struct TALER_MasterAddWirePS { 2395 /** 2396 * purpose.purpose = TALER_SIGNATURE_MASTER_ADD_WIRE. 2397 */ 2398 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2399 struct GNUNET_TIME_AbsoluteNBO start_date; 2400 struct TALER_FullPaytoHash h_wire; 2401 struct GNUNET_HashCode h_conversion_url; 2402 struct GNUNET_HashCode h_credit_restrictions; 2403 struct GNUNET_HashCode h_debit_restrictions; 2404 }; 2405 2406 .. _TALER_MasterDelWirePS: 2407 .. sourcecode:: c 2408 2409 struct TALER_MasterDelWirePS { 2410 /** 2411 * purpose.purpose = TALER_SIGNATURE_MASTER_DEL_WIRE. 2412 */ 2413 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2414 struct GNUNET_TIME_AbsoluteNBO end_date; 2415 struct TALER_FullPaytoHash h_wire; 2416 }; 2417 2418 2419 .. _TALER_MasterAmlOfficerStatusPS: 2420 .. sourcecode:: c 2421 2422 struct TALER_MasterAmlOfficerStatusPS { 2423 /** 2424 * purpose.purpose = TALER_SIGNATURE_MASTER_AML_KEY 2425 */ 2426 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2427 struct GNUNET_TIME_TimestampNBO change_date; 2428 struct TALER_AmlOfficerPublicKeyP officer_pub; 2429 struct GNUNET_HashCode h_officer_name GNUNET_PACKED; 2430 uint32_t is_active GNUNET_PACKED; 2431 }; 2432 2433 .. _TALER_AmlDecisionPS: 2434 .. sourcecode:: c 2435 2436 struct TALER_AmlDecisionPS { 2437 /** 2438 * purpose.purpose =TALER_SIGNATURE_AML_DECISION. 2439 */ 2440 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2441 struct GNUNET_HashCode h_justification GNUNET_PACKED; 2442 struct GNUNET_TIME_TimestampNBO decision_time; 2443 struct TALER_AmountNBO new_threshold; 2444 struct TALER_NormalizedPaytoHashP h_payto GNUNET_PACKED; 2445 struct GNUNET_HashCode h_kyc_requirements; 2446 uint32_t new_state GNUNET_PACKED; 2447 }; 2448 2449 .. _TALER_PartnerConfigurationPS: 2450 .. sourcecode:: c 2451 2452 struct TALER_PartnerConfigurationPS { 2453 /** 2454 * purpose.purpose = TALER_SIGNATURE_MASTER_PARNTER_DETAILS 2455 */ 2456 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2457 struct TALER_MasterPublicKeyP partner_pub; 2458 struct GNUNET_TIME_TimestampNBO start_date; 2459 struct GNUNET_TIME_TimestampNBO end_date; 2460 struct GNUNET_TIME_RelativeNBO wad_frequency; 2461 struct TALER_AmountNBO wad_fee; 2462 struct GNUNET_HashCode h_url; 2463 }; 2464 2465 .. _TALER_ReserveOpenPS: 2466 .. sourcecode:: c 2467 2468 struct TALER_ReserveOpenPS { 2469 /** 2470 * Purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN 2471 */ 2472 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2473 struct TALER_AmountNBO reserve_payment; 2474 struct GNUNET_TIME_TimestampNBO request_timestamp; 2475 struct GNUNET_TIME_TimestampNBO reserve_expiration; 2476 uint32_t purse_limit; 2477 }; 2478 2479 .. _TALER_ReserveClosePS: 2480 .. sourcecode:: c 2481 2482 struct TALER_ReserveClosePS { 2483 /** 2484 * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE 2485 */ 2486 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2487 struct GNUNET_TIME_TimestampNBO request_timestamp; 2488 struct TALER_FullPaytoHashP target_account_h_payto; 2489 }; 2490 2491 .. _TALER_WalletReserveAttestRequestSignaturePS: 2492 .. sourcecode:: c 2493 2494 struct TALER_ReserveAttestRequestPS { 2495 /** 2496 * purpose.purpose = TALER_SIGNATURE_WALLET_ATTEST_REQUEST 2497 */ 2498 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2499 struct GNUNET_TIME_TimestampNBO request_timestamp; 2500 struct GNUNET_HashCode h_details; 2501 }; 2502 2503 .. _TALER_ExchangeAttestPS: 2504 .. sourcecode:: c 2505 2506 struct TALER_ExchangeAttestPS { 2507 /** 2508 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_ATTEST_DETAILS 2509 */ 2510 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2511 struct GNUNET_TIME_TimestampNBO attest_timestamp; 2512 struct GNUNET_TIME_TimestampNBO expiration_time; 2513 struct TALER_ReservePublicKeyP reserve_pub; 2514 struct GNUNET_HashCode h_attributes; 2515 }; 2516 2517 .. _TALER_ExternKycDataImportBindingPS: 2518 .. sourcecode:: c 2519 2520 struct TALER_ExternKycDataImportBindingPS { 2521 /** 2522 * purpose.purpose = TALER_SIGNATURE_EXTERN_KYC_IMPORT_BINDING 2523 */ 2524 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2525 struct GNUNET_TIME_AbsoluteNBO import_date; 2526 union GNUNET_AccountPublicKeyP account_pub; 2527 struct GNUNET_HashCode h_attributes; 2528 struct GNUNET_HashCode h_customer_payto; 2529 }; 2530 2531 2532 .. _TALER_ExternKycDataBulkBindingPS: 2533 .. sourcecode:: c 2534 2535 struct TALER_ExternKycDataBulkBindingPS { 2536 /** 2537 * purpose.purpose = TALER_SIGNATURE_EXTERN_KYC_BULK_BINDING 2538 */ 2539 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2540 struct GNUNET_HashCode h_body; 2541 struct GNUNET_HashCode h_customer_payto; 2542 }; 2543 2544 .. _TALER_PreparedTransferRegisterPS: 2545 .. sourcecode:: c 2546 2547 struct TALER_PreparedTransferRegisterPS { 2548 /** 2549 * Purpose is #TALER_SIGNATURE_WALLET_PREPARED_TRANSFER_REGISTER 2550 */ 2551 struct GNUNET_CRYPTO_SignaturePurpose purpose; 2552 struct TALER_NormalizedPayto credit_account; 2553 struct TALER_AmountNBO credit_amount; 2554 /** 2555 * 1: reserve, 2: kyc 2556 */ 2557 uint32_t type; 2558 /** 2559 * 1: one-time, 2: recurrent 2560 */ 2561 uint16_t recurrent; 2562 /** 2563 * 1: EdDSA 2564 */ 2565 uint16_t alg; 2566 union TALER_AccountPublicKeyP account_pub; 2567 }; 2568 2569 .. _TALER_PreparedTransferUnregisterPS: 2570 .. sourcecode:: c 2571 2572 struct TALER_PreparedTransferUnregisterPS { 2573 /** 2574 * Purpose is #TALER_SIGNATURE_WALLET_PREPARED_TRANSFER_UNREGISTER 2575 */ 2576 struct GNUNET_CRYPTO_SignaturePurpose purpose; 2577 struct GNUNET_TIME_TimestampNBO timestamp; 2578 };