api-common.rst (73780B)
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 565 Versions 566 ^^^^^^^^ 567 568 We use the type `LibtoolVersion` in the design documents to refer to a string 569 that represents a version with the semantic as defined by 570 `libtool <https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html>`__. 571 572 .. ts:def:: LibtoolVersion 573 574 // Version information in libtool version format and semantics 575 // current[:revision[:age]], f.e. "1", "2:0" or "3:1:2". 576 // see https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html. 577 type LibtoolVersion = string; 578 579 We use the type `SemVer` to refer to a string that represents a version with 580 the semantic as defined by `semantic versioning <https://semver.org/>`__. 581 582 .. ts:def:: SemVer 583 584 // Version information in semantic versioning format and semantics, 585 // like "X.Z.Y", see https://semver.org/. 586 type SemVer = string; 587 588 Objects 589 ^^^^^^^ 590 591 .. ts:def:: Object 592 593 // JavaScript objects, no further restrictions. 594 type Object = object; 595 596 597 Contact details 598 ^^^^^^^^^^^^^^^ 599 600 .. ts:def:: EmailAddress 601 602 type EmailAddress = string; 603 604 .. ts:def:: PhoneNumber 605 606 type PhoneNumber = string; 607 608 Phone numbers should start with the ``+`` symbol and the country code. 609 610 Permissions 611 ^^^^^^^^^^^ 612 613 This type expresses which permissions for a subject 614 apply on a resource. 615 616 .. ts:def:: LibeufinPermission 617 618 interface LibeufinPermission { 619 subjectType: string; 620 subjectId: string; 621 resourceType: string; 622 resourceId: string; 623 permissionName: string 624 } 625 626 627 Fetch params 628 ^^^^^^^^^^^^ 629 630 .. _fetch-params: 631 632 .. ts:def:: FetchParams 633 634 interface FetchParams { 635 636 // Because transactions are delivered by banks in "batches", 637 // then every batch can have different qualities. This value 638 // lets the request specify which type of batch ought to be 639 // returned. Currently, the following two type are supported: 640 // 641 // 'report': typically includes only non booked transactions. 642 // 'statement': typically includes only booked transactions. 643 level: "report" | "statement" | "all"; 644 645 // This type indicates the time range of the query. 646 // It allows the following values: 647 // 648 // 'latest': retrieves the last transactions from the bank. 649 // If there are older unread transactions, those will *not* 650 // be downloaded. 651 // 652 // 'all': retrieves all the transactions from the bank, 653 // until the oldest. 654 // 655 // 'previous-days': currently *not* implemented, it will allow 656 // the request to download transactions from 657 // today until N days before. 658 // 659 // 'since-last': retrieves all the transactions since the last 660 // time one was downloaded. 661 // 662 rangeType: "latest" | "all" | "previous-days" | "since-last"; 663 }; 664 665 666 Keys 667 ^^^^ 668 669 .. ts:def:: ClaimToken 670 671 // 16-byte access token used to authorize access. 672 type ClaimToken = string; 673 674 .. ts:def:: EddsaPublicKey 675 676 // EdDSA and ECDHE public keys always point on Curve25519 677 // and represented using the standard 256 bits Ed25519 compact format, 678 // converted to Crockford `Base32`. 679 type EddsaPublicKey = string; 680 681 .. ts:def:: EddsaPrivateKey 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 EddsaPrivateKey = string; 687 688 .. ts:def:: Edx25519PublicKey 689 690 // Edx25519 public keys are points on Curve25519 and represented using the 691 // standard 256 bits Ed25519 compact format converted to Crockford 692 // `Base32`. 693 type Edx25519PublicKey = string; 694 695 .. ts:def:: Edx25519PrivateKey 696 697 // Edx25519 private keys are always points on Curve25519 698 // and represented using the standard 256 bits Ed25519 compact format, 699 // converted to Crockford `Base32`. 700 type Edx25519PrivateKey = string; 701 702 .. ts:def:: EcdhePublicKey 703 704 // EdDSA and ECDHE public keys always point on Curve25519 705 // and represented using the standard 256 bits Ed25519 compact format, 706 // converted to Crockford `Base32`. 707 type EcdhePublicKey = string; 708 709 .. ts:def:: CSRPublic 710 711 // Point on Curve25519 represented using the standard 256 bits Ed25519 compact format, 712 // converted to Crockford `Base32`. 713 type CSRPublic = string; 714 715 .. ts:def:: EcdhePrivateKey 716 717 // EdDSA and ECDHE public keys always point on Curve25519 718 // and represented using the standard 256 bits Ed25519 compact format, 719 // converted to Crockford `Base32`. 720 type EcdhePrivateKey = string; 721 722 .. ts:def:: CoinPublicKey 723 724 type CoinPublicKey = EddsaPublicKey; 725 726 .. ts:def:: RsaPublicKey 727 728 // RSA public key converted to Crockford `Base32`. 729 type RsaPublicKey = string; 730 731 .. ts:def:: PursePublicKey 732 733 type PursePublicKey = EddsaPublicKey; 734 735 736 .. _blinded-coin: 737 738 Blinded coin 739 ^^^^^^^^^^^^ 740 741 .. ts:def:: CoinEnvelope 742 743 // The type of a coin's blinded envelope depends on the cipher that is used 744 // for signing with a denomination key. 745 type CoinEnvelope = RSACoinEnvelope | CSCoinEnvelope ; 746 747 .. ts:def:: RSACoinEnvelope 748 749 // For denomination signatures based on RSA, the planchet is just a blinded 750 // coin's `public EdDSA key <eddsa-coin-pub>`. 751 interface RSACoinEnvelope { 752 cipher: "RSA" | "RSA+age_restricted"; 753 rsa_blinded_planchet: BlindedRsaSignature; 754 } 755 756 .. ts:def:: CSCoinEnvelope 757 758 // For denomination signatures based on Blind Clause-Schnorr, the planchet 759 // consists of the public nonce and two Curve25519 scalars which are two 760 // blinded challenges in the Blinded Clause-Schnorr signature scheme. 761 // See https://taler.net/papers/cs-thesis.pdf for details. 762 interface CSCoinEnvelope { 763 cipher: "CS" | "CS+age_restricted"; 764 cs_nonce: string; // Crockford `Base32` encoded 765 cs_blinded_c0: string; // Crockford `Base32` encoded 766 cs_blinded_c1: string; // Crockford `Base32` encoded 767 } 768 769 .. ts:def:: DenominationBlindingKeyP 770 771 // Secret for blinding/unblinding. 772 // An RSA blinding secret, which is basically 773 // a 256-bit nonce, converted to Crockford `Base32`. 774 type DenominationBlindingKeyP = string; 775 776 777 .. _unblinded-coin: 778 779 Unblinded coin 780 ^^^^^^^^^^^^^^ 781 782 .. ts:def:: UnblindedSignature 783 784 // The type of a coin's unblinded signature depends on the cipher that was used 785 // for signing with a denomination key. 786 // Note that for now, only RSA is supported. 787 type UnblindedSignature = RsaUnblindedSignature | CsUnblindedSignature; 788 789 .. ts:def:: RsaUnblindedSignature 790 791 interface RsaUnblindedSignature { 792 cipher: "RSA"; 793 rsa_signature: RsaSignature; 794 } 795 796 .. ts:def:: CsUnblindedSignature 797 798 // Note, this is here for the sake of completeness, but not yet supported 799 interface CsUnblindedSignature { 800 cipher: "CS"; 801 802 cs_signature_r: Cs25519Point; 803 cs_signature_s: Cs25519Scalar; 804 } 805 806 807 .. _signature: 808 809 Signatures 810 ^^^^^^^^^^ 811 812 813 .. ts:def:: EddsaSignature 814 815 // EdDSA signatures are transmitted as 64-bytes `base32` 816 // binary-encoded objects with just the R and S values (base32_ binary-only). 817 type EddsaSignature = string; 818 819 .. ts:def:: Edx25519Signature 820 821 // Edx25519 signatures are transmitted as 64-bytes `base32` 822 // binary-encoded objects with just the R and S values (base32_ binary-only). 823 type Edx25519Signature = string; 824 825 .. ts:def:: RsaSignature 826 827 // `base32` encoded RSA signature. 828 type RsaSignature = string; 829 830 .. ts:def:: BlindedRsaSignature 831 832 // `base32` encoded RSA blinded signature. 833 type BlindedRsaSignature = string; 834 835 .. ts:def:: RsaBlindingKeySecret 836 837 // `base32` encoded RSA blinding secret. 838 type RsaBlindingKeySecret = string; 839 840 .. ts:def:: DenominationBlindingKeySecret 841 842 // Union, not (!) discriminated! 843 // (Note: CS Blinding Key secret is yet to be defined&added here). 844 type DenominationBlindingKeySecret = 845 | RsaBlindingKeySecret; 846 847 848 .. ts:def:: DenomCipher 849 850 interface DenomCipher = { 851 // specifier for the ciper 852 cipher: string; 853 } 854 855 .. ts:def:: BlindedDenominationSignature 856 857 type BlindedDenominationSignature = DenomCipher & ( 858 | RsaBlindedDenominationSignature 859 | CSBlindedDenominationSignature 860 ) 861 862 .. ts:def:: RsaBlindedDenominationSignature 863 864 interface RsaBlindedDenominationSignature extends DenomCipher { 865 cipher: "RSA"; 866 867 // (blinded) RSA signature 868 blinded_rsa_signature: BlindedRsaSignature; 869 } 870 871 .. ts:def:: CSBlindedDenominationSignature 872 873 interface CSBlindedDenominationSignature extends DenomCipher { 874 cipher: "CS"; 875 876 // Signer chosen bit value, 0 or 1, used 877 // in Clause Blind Schnorr to make the 878 // ROS problem harder. 879 b: Integer; 880 881 // Blinded scalar calculated from c_b. 882 s: Cs25519Scalar; 883 884 } 885 .. ts:def:: PurseContractSignature 886 887 type PurseContractSignature = EddsaSignature 888 889 890 .. _amount: 891 892 Amounts 893 ^^^^^^^ 894 895 Amounts of currency are always expressed in terms of a base value, a 896 fractional value and the denomination of the currency. 897 898 .. ts:def:: Amount 899 900 type Amount = string; 901 902 Amounts of currency are serialized as a string of the format 903 ``<Currency>:<DecimalAmount>``. Taler treats monetary amounts as 904 fixed-precision numbers, with 8 decimal places. Unlike floating point numbers, 905 this allows accurate representation of monetary amounts. 906 907 The following constraints apply for a valid amount: 908 909 1. The ``<Currency>`` part must be at most 11 characters long and may only consist 910 of ASCII letters (``a-zA-Z``). 911 2. The integer part of ``<DecimalAmount>`` may be at most 2^52. 912 3. The fractional part of ``<DecimalAmount>`` may contain at most 8 decimal digits. 913 914 .. note:: 915 916 "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". 917 918 An amount that is prefixed with a ``+`` or ``-`` character is also used in certain contexts. 919 When no sign is present, the amount is assumed to be positive. 920 921 .. note:: 922 923 In some setups, when Libeufin-Bank offers cashouts towards traditional 924 currencies like EUR for example, the fractional part gets restricted 925 to at most 2 digits. 926 927 .. ts:def:: SignedAmount 928 929 type SignedAmount = string; 930 931 .. sourcecode:: c 932 933 struct TALER_AmountNBO { 934 // Non-negative integer value in the currency (in network byte order), 935 // can be at most 2^52. 936 // Note that "1" here would correspond to 1 EUR or 1 USD, 937 // depending on `currency`, not 1 cent. 938 uint64_t value; 939 940 // Unsigned 32 bit fractional value (in network byte order) 941 // to be added to ``value`` representing 942 // an additional currency fraction, in units of one hundred millionth (1e-8) 943 // of the base currency value. For example, a fraction 944 // of 50,000,000 would correspond to 50 cents. 945 uint32_t fraction; 946 947 // Name of the currency, using either a three-character ISO 4217 currency 948 // code, or a regional currency identifier between 4 and 11 characters, 949 // consisting of ASCII alphabetic characters ("a-zA-Z"). 950 // Should be padded to 12 bytes with 0-characters. 951 // Currency codes are compared case-insensitively. 952 uint8_t currency_code[12]; 953 }; 954 955 956 Images 957 ^^^^^^ 958 959 .. ts:def:: ImageDataUrl 960 961 // The string must be a data URL according to RFC 2397 962 // with explicit mediatype and base64 parameters. 963 // 964 // ``data:<mediatype>;base64,<data>`` 965 // 966 // Supported mediatypes are ``image/jpeg`` and ``image/png``. 967 // Invalid strings will be rejected by the wallet. 968 type ImageDataUrl = string; 969 970 971 -------------- 972 Binary Formats 973 -------------- 974 975 .. note:: 976 977 Due to the way of handling "big" numbers by some platforms (such as 978 JavaScript, for example), wherever the following specification mentions 979 a 64-bit value, the actual implementations are strongly advised to rely on 980 arithmetic up to 53 bits. 981 982 .. note:: 983 984 Taler uses ``libgnunetutil`` for interfacing itself with the operating system, 985 doing crypto work, and other "low level" actions, therefore it is strongly 986 connected with the `GNUnet project <https://gnunet.org>`_. 987 988 This section specifies the binary representation of messages used in Taler's 989 protocols. The message formats are given in a C-style pseudocode notation. 990 Padding is always specified explicitly, and numeric values are in network byte 991 order (big endian). 992 993 994 Time 995 ^^^^ 996 997 In signed messages, time is represented using 64-bit big-endian values, 998 denoting microseconds since the UNIX Epoch. ``UINT64_MAX`` represents "never". 999 1000 .. sourcecode:: c 1001 1002 struct GNUNET_TIME_Absolute { 1003 uint64_t timestamp_us; 1004 }; 1005 struct GNUNET_TIME_AbsoluteNBO { 1006 uint64_t abs_value_us__; // in network byte order 1007 }; 1008 1009 .. sourcecode:: c 1010 1011 struct GNUNET_TIME_Relative { 1012 uint64_t timestamp_us; 1013 }; 1014 struct GNUNET_TIME_RelativeNBO { 1015 uint64_t rel_value_us__; // in network byte order 1016 }; 1017 1018 For certain statistics, we need to express relative time 1019 in ways that correspond exactly to the calendar. So while 1020 constants like ``GNUNET_TIME_UNIT_MONTH`` are defined to 1021 mean 30 days, we cannot do this when tracking income for 1022 a merchant over a calendar year. Thus, in this case, 1023 we use the `StatisticBucketRange` when rounding time to 1024 values that cannot be expressed as fixed multiples of 1025 seconds: 1026 1027 .. ts:def:: StatisticBucketRange 1028 1029 type MerchantStatisticCounterByBucket = 1030 "decade" | "year" | "quarter" | "month" | "week" | "day" | "hour" | "minute" | "second"; 1031 1032 .. _LegalTrouble: 1033 1034 451 Responses 1035 ^^^^^^^^^^^^^ 1036 1037 When KYC operations are required, various endpoints may respond with a 1038 ``451 Unavailable for Legal Reasons`` status code and a `LegitimizationNeededResponse` 1039 body. 1040 1041 .. ts:def:: LegitimizationNeededResponse 1042 1043 // Implemented in this style since exchange 1044 // protocol **v20**. 1045 interface LegitimizationNeededResponse { 1046 1047 // Numeric `error code <error-codes>` unique to the condition. 1048 // Should always be ``TALER_EC_EXCHANGE_GENERIC_KYC_REQUIRED``. 1049 code: Integer; 1050 1051 // Human-readable description of the error, i.e. "missing parameter", 1052 // "commitment violation", ... Should give a human-readable hint 1053 // about the error's nature. Optional, may change without notice! 1054 hint?: string; 1055 1056 // Hash of the payto:// account URI for which KYC 1057 // is required. 1058 // The account holder can use the ``/kyc-check/$H_PAYTO`` 1059 // endpoint to check the KYC status or initiate the KYC process. 1060 h_payto: NormalizedPaytoHash; 1061 1062 // Public key associated with the account. The client must sign 1063 // the initial request for the KYC status using the corresponding 1064 // private key. Will be either a reserve public key or a merchant 1065 // (instance) public key. 1066 // 1067 // Absent if no public key is currently associated 1068 // with the account and the client MUST thus first 1069 // credit the exchange via an inbound wire transfer 1070 // to associate a public key with the debited account. 1071 account_pub?: EddsaPublicKey; 1072 1073 // Identifies a set of measures that were triggered and that are 1074 // now preventing this operation from proceeding. Gives developers 1075 // a starting point for understanding why the transaction was 1076 // blocked and how to lift it. 1077 // Can be zero (which means there is no requirement row), 1078 // especially if ``bad_kyc_auth`` is set. 1079 requirement_row: Integer; 1080 1081 // True if the operation was denied because the 1082 // KYC auth key does not match the merchant public 1083 // key. In this case, a KYC auth wire transfer 1084 // with the merchant public key must be performed 1085 // first. 1086 // Since exchange protocol **v21**. 1087 bad_kyc_auth?: boolean; 1088 1089 } 1090 1091 1092 Cryptographic primitives 1093 ^^^^^^^^^^^^^^^^^^^^^^^^ 1094 1095 All elliptic curve operations are on Curve25519. Public and private keys are 1096 thus 32 bytes, and signatures 64 bytes. For hashing, including HKDFs, Taler 1097 uses 512-bit hash codes (64 bytes). 1098 1099 .. _HashCode: 1100 .. sourcecode:: c 1101 1102 struct GNUNET_HashCode { 1103 uint8_t hash[64]; // usually SHA-512 1104 }; 1105 1106 .. sourcecode:: c 1107 1108 struct TALER_DenominationHash { 1109 struct GNUNET_HashCode hash; 1110 }; 1111 1112 .. sourcecode:: c 1113 1114 struct TALER_PrivateContractHash { 1115 struct GNUNET_HashCode hash; 1116 }; 1117 1118 .. sourcecode:: c 1119 1120 struct TALER_ExtensionsPolicyHash { 1121 struct GNUNET_HashCode hash; 1122 }; 1123 1124 .. sourcecode:: c 1125 1126 struct TALER_MerchantWireHash { 1127 struct GNUNET_HashCode hash; 1128 }; 1129 1130 .. _FullPaytoHash: 1131 .. sourcecode:: c 1132 1133 struct TALER_FullPaytoHash { 1134 // Hash over a full payto://-URI, including receiver-name 1135 // (and possibly BIC and other optional fields). 1136 struct GNUNET_ShortHashCode hash; 1137 }; 1138 1139 .. _NormalizedPaytoHash: 1140 .. sourcecode:: c 1141 1142 struct TALER_NormalizedPaytoHash { 1143 // Hash over a normalized payto://-URI, including all optional 1144 // fields and also with account-part canonicalized (so no BIC). 1145 struct GNUNET_ShortHashCode hash; 1146 }; 1147 1148 .. _BlindedCoinHash: 1149 .. sourcecode:: c 1150 1151 struct TALER_BlindedCoinHash { 1152 // Hash over a) the hash of the denomination's public key, 1153 // b) an enum value identifying the cipher, and 1154 // c) cipher-dependant blinded information. 1155 // See implementation of `TALER_coin_ev_hash` 1156 // in libtalerexchange for details. 1157 struct GNUNET_HashCode hash; 1158 }; 1159 1160 .. sourcecode:: c 1161 1162 struct TALER_CoinPubHash { 1163 struct GNUNET_HashCode hash; 1164 }; 1165 1166 .. sourcecode:: c 1167 1168 struct TALER_OutputCommitmentHash { 1169 struct GNUNET_HashCode hash; 1170 }; 1171 1172 1173 .. _TALER_EcdhEphemeralPublicKeyP: 1174 .. sourcecode:: c 1175 1176 struct TALER_EcdhEphemeralPublicKeyP { 1177 uint8_t ecdh_pub[32]; 1178 }; 1179 1180 .. _reserve-pub: 1181 .. sourcecode:: c 1182 1183 struct TALER_ReservePublicKeyP { 1184 uint8_t eddsa_pub[32]; 1185 }; 1186 1187 .. _reserve-priv: 1188 .. sourcecode:: c 1189 1190 struct TALER_ReservePrivateKeyP { 1191 uint8_t eddsa_priv[32]; 1192 }; 1193 1194 struct TALER_ReserveSignatureP { 1195 uint8_t eddsa_signature[64]; 1196 }; 1197 1198 .. _merchant-pub: 1199 .. sourcecode:: c 1200 1201 struct TALER_MerchantPublicKeyP { 1202 uint8_t eddsa_pub[32]; 1203 }; 1204 1205 struct TALER_MerchantPrivateKeyP { 1206 uint8_t eddsa_priv[32]; 1207 }; 1208 1209 struct TALER_TransferPublicKeyP { 1210 uint8_t ecdhe_pub[32]; 1211 }; 1212 1213 struct TALER_TransferPrivateKeyP { 1214 uint8_t ecdhe_priv[32]; 1215 }; 1216 1217 1218 .. _AmlDecisionState: 1219 .. sourcecode:: c 1220 1221 enum TALER_AmlDecisionState { 1222 NORMAL, PENDING, FROZEN 1223 }; 1224 1225 .. _AmlOfficerPublicKeyP: 1226 .. sourcecode:: c 1227 1228 struct TALER_AmlOfficerPublicKeyP { 1229 uint8_t eddsa_pub[32]; 1230 }; 1231 1232 .. _AmlOfficerPrivateKeyP: 1233 .. sourcecode:: c 1234 1235 struct TALER_AmlOfficerPrivateKeyP { 1236 uint8_t eddsa_priv[32]; 1237 }; 1238 1239 .. _sign-key-pub: 1240 .. sourcecode:: c 1241 1242 struct TALER_ExchangePublicKeyP { 1243 uint8_t eddsa_pub[32]; 1244 }; 1245 1246 .. _sign-key-priv: 1247 .. sourcecode:: c 1248 1249 struct TALER_ExchangePrivateKeyP { 1250 uint8_t eddsa_priv[32]; 1251 }; 1252 1253 .. _eddsa-sig: 1254 .. sourcecode:: c 1255 1256 struct TALER_ExchangeSignatureP { 1257 uint8_t eddsa_signature[64]; 1258 }; 1259 1260 struct TALER_MasterPublicKeyP { 1261 uint8_t eddsa_pub[32]; 1262 }; 1263 1264 struct TALER_MasterPrivateKeyP { 1265 uint8_t eddsa_priv[32]; 1266 }; 1267 1268 struct TALER_MasterSignatureP { 1269 uint8_t eddsa_signature[64]; 1270 }; 1271 1272 .. _WireTransferIdentifierRawP: 1273 .. sourcecode:: c 1274 1275 struct WireTransferIdentifierRawP { 1276 uint8_t raw[32]; 1277 }; 1278 1279 .. _UUID: 1280 .. sourcecode:: c 1281 1282 struct UUID { 1283 uint32_t value[4]; 1284 }; 1285 1286 .. _WadId: 1287 .. sourcecode:: c 1288 1289 struct TALER_WadId wad_id { 1290 uint32_t value[6]; 1291 }; 1292 1293 .. _eddsa-coin-pub: 1294 .. sourcecode:: c 1295 1296 union TALER_CoinSpendPublicKeyP { 1297 uint8_t eddsa_pub[32]; 1298 uint8_t ecdhe_pub[32]; 1299 }; 1300 1301 .. _coin-priv: 1302 .. sourcecode:: c 1303 1304 union TALER_CoinSpendPrivateKeyP { 1305 uint8_t eddsa_priv[32]; 1306 uint8_t ecdhe_priv[32]; 1307 }; 1308 1309 struct TALER_CoinSpendSignatureP { 1310 uint8_t eddsa_signature[64]; 1311 }; 1312 1313 struct TALER_TransferSecretP { 1314 uint8_t key[sizeof (struct GNUNET_HashCode)]; 1315 }; 1316 1317 struct TALER_EncryptedLinkSecretP { 1318 uint8_t enc[sizeof (struct TALER_LinkSecretP)]; 1319 }; 1320 1321 .. _eddsa-token-pub: 1322 .. sourcecode:: c 1323 1324 union TALER_TokenPublicKeyP { 1325 uint8_t eddsa_pub[32]; 1326 uint8_t ecdhe_pub[32]; 1327 }; 1328 1329 .. _account-pub: 1330 .. sourcecode:: c 1331 1332 union TALER_AccountPublicKeyP { 1333 struct TALER_ReservePublicKeyP reserve_pub; 1334 struct TALER_MerchantPublicKeyP merchant_pub; 1335 }; 1336 1337 .. _Signatures: 1338 1339 Signatures 1340 ^^^^^^^^^^ 1341 1342 Any piece of signed data complies with the abstract data structure given below. 1343 1344 .. sourcecode:: c 1345 1346 struct Data { 1347 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1348 type1_t payload1; 1349 type2_t payload2; 1350 ... 1351 }; 1352 1353 /*From gnunet_crypto_lib.h*/ 1354 struct GNUNET_CRYPTO_EccSignaturePurpose { 1355 /** 1356 * This field equals the number of bytes being signed, 1357 * namely 'sizeof (struct Data)'. 1358 */ 1359 uint32_t size; 1360 /** 1361 * This field is used to express the context in 1362 * which the signature is made, ensuring that a 1363 * signature cannot be lifted from one part of the protocol 1364 * to another. See `src/include/taler_signatures.h` within the 1365 * exchange's codebase (git://taler.net/exchange). 1366 */ 1367 uint32_t purpose; 1368 }; 1369 1370 1371 The following list contains all the data structures that can be signed in 1372 Taler. Their definition is typically found in ``src/include/taler_signatures.h``, 1373 within the 1374 `exchange's codebase <https://docs.taler.net/global-licensing.html#exchange-repo>`_. 1375 1376 1377 1378 .. _TALER_HashPlanchetsP: 1379 .. sourcecode:: c 1380 1381 /** 1382 * This is the running SHA512-hash over all 1383 * `TALER_BlindedCoinHashP` values of an array of coins. 1384 * Note that each `TALER_BlindedCoinHashP` itself 1385 * captures the hash of the corresponding denomination's 1386 * public key. 1387 */ 1388 struct TALER_HashPlanchetsP { 1389 struct GNUNET_HashCode hash; 1390 }; 1391 1392 1393 .. _TALER_AgeMask: 1394 .. sourcecode:: c 1395 1396 /** 1397 * Binary representation of the age groups. 1398 * The bits set in the mask mark the edges at the beginning of a next age 1399 * group. F.e. for the age groups 1400 * 0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-* 1401 * the following bits are set: 1402 * 1403 * 31 24 16 8 0 1404 * | | | | | 1405 * oooooooo oo1oo1o1 o1o1o1o1 ooooooo1 1406 * 1407 * A value of 0 means that the exchange does not support the extension for 1408 * age-restriction. 1409 */ 1410 struct TALER_AgeMask { 1411 uint32_t mask; 1412 }; 1413 1414 1415 1416 .. _TALER_WithdrawRequestPS: 1417 .. sourcecode:: c 1418 1419 /** 1420 * Format used for to generate the signature on a request to withdraw 1421 * coins from a reserve. 1422 */ 1423 struct TALER_WithdrawRequestPS 1424 { 1425 /** 1426 * Purpose is #TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW 1427 */ 1428 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1429 /** 1430 * Amount to withdraw, excluding fees, i.e. 1431 * the total sum of the denominations of the coins. 1432 * Note that the reserve must have a value of at least amount+fee. 1433 */ 1434 struct TALER_Amount amount; 1435 /** 1436 * Total fee for the withdrawal. 1437 * Note that the reserve must have a value of at least amount+fee. 1438 */ 1439 struct TALER_Amount fee; 1440 /** 1441 * This is the running SHA512-hash over all 1442 * `TALER_BlindedCoinHashP` values of the coins. 1443 * Note that each `TALER_BlindedCoinHashP` itself 1444 * captures the hash of the corresponding denomination's 1445 * public key. 1446 * If max_age was set in the withdraw request, there will be 1447 * n*κ many such values. The iteration MUST be first over 1448 * all coins belonging to κ index=0, then all coins 1449 * to κ index=1 etc: 1450 * h[0][0]…h[0][n-1]h[1][0]…h[1][n-1] … h[κ-1][0]…h[κ-1][n-1] 1451 * 1452 * Note also that this value is required for /recoup and 1453 * -- in case of a withdraw request with required age proof -- 1454 * in the subsequent call to /reveal-withdraw 1455 */ 1456 struct TALER_HashPlanchetsP h_planchets; 1457 /** 1458 * The master seed that was used in the call to /blinding-prepare blinding, 1459 * or all zeros, if no denomination of cipher type Clause-Schnorr is used. 1460 */ 1461 struct TALER_BlindingMasterSecretP blinding_seed; 1462 /** 1463 * If age restriction proof is required, the maximum age _group_ 1464 * to commit to, 0 otherwise. Note that in this case, all 1465 * denominations for all coins MUST support age restriction. 1466 * Also note that this is not an age (in years), but the age group 1467 * (an index) according to list of age groups in the configuration 1468 * of the exchange. See TALER_get_max_group() how to calculate 1469 * the age group to a given age (in years). 1470 */ 1471 uint32_t max_age_group; 1472 /** 1473 * The age groups as configured for the exchange, represented as a mask. 1474 * If max_age_group is > 0, the mask MUST be non-zero, too. 1475 */ 1476 struct TALER_AgeMask mask; 1477 }; 1478 1479 .. _TALER_WithdrawConfirmationPS: 1480 1481 .. sourcecode:: c 1482 1483 struct TALER_WithdrawConfirmationPS 1484 { 1485 /** 1486 * Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_WITHDRAW. 1487 * Signed by a `struct TALER_ExchangePrivateKeyP` using EdDSA. 1488 */ 1489 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1490 1491 /** 1492 * Commitment made in the /withdraw request. 1493 * Also needed for the /reveal-withdraw endpoint (in case 1494 * of required proof of age restriction) and for /recoup 1495 */ 1496 struct TALER_HashBlindedPlanchetsP h_planchets; 1497 1498 /** 1499 * If proof of age restriction is not required for to this 1500 * withdrawal, (i.e. max_age was not set during the request) 1501 * MUST be 0xFFFFFFFF. 1502 * Otherwise (i.e. proof of age restriction required): 1503 * index that the client will not have to reveal, in NBO, 1504 * MUST be smaller than #TALER_CNC_KAPPA. 1505 */ 1506 uint32_t noreveal_index; 1507 1508 }; 1509 1510 1511 .. _TALER_SingleWithdrawRequestPS: 1512 .. sourcecode:: c 1513 1514 struct TALER_SingleWithdrawRequestPS { 1515 /** 1516 * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW 1517 */ 1518 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1519 struct TALER_AmountNBO amount_with_fee; 1520 struct TALER_DenominationHash h_denomination_pub; 1521 struct TALER_BlindedCoinHash h_coin_envelope; 1522 }; 1523 1524 1525 .. _taler_depositrequestps: 1526 1527 .. sourcecode:: c 1528 1529 struct TALER_DepositRequestPS { 1530 /** 1531 * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_DEPOSIT 1532 */ 1533 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1534 struct TALER_PrivateContractHash h_contract_terms; 1535 struct TALER_AgeCommitmentHash h_age_commitment; 1536 struct TALER_ExtensionsPolicyHash h_policy; 1537 struct TALER_MerchantWireHash h_wire; 1538 struct TALER_DenominationHash h_denom_pub; 1539 struct GNUNET_TIME_AbsoluteNBO timestamp; 1540 struct GNUNET_TIME_AbsoluteNBO refund_deadline; 1541 struct TALER_AmountNBO amount_with_fee; 1542 struct TALER_AmountNBO deposit_fee; 1543 struct TALER_MerchantPublicKeyP merchant; 1544 struct GNUNET_HashCode wallet_data_hash; 1545 }; 1546 1547 .. _TALER_DepositConfirmationPS: 1548 1549 .. sourcecode:: c 1550 1551 struct TALER_DepositConfirmationPS { 1552 /** 1553 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT 1554 */ 1555 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1556 struct TALER_PrivateContractHash h_contract_terms; 1557 struct TALER_MerchantWireHash h_wire; 1558 struct TALER_ExtensionsPolicyHash h_policy; 1559 struct GNUNET_TIME_AbsoluteNBO timestamp; 1560 struct GNUNET_TIME_AbsoluteNBO refund_deadline; 1561 struct TALER_AmountNBO amount_without_fee; 1562 union TALER_CoinSpendPublicKeyP coin_pub; 1563 struct TALER_MerchantPublicKeyP merchant; 1564 }; 1565 1566 1567 .. _TALER_RefreshCommitmentP: 1568 .. sourcecode:: c 1569 1570 struct TALER_RefreshCommitmentP { 1571 /** 1572 * @since vDOLDPLUS 1573 * Hash over: 1574 * 1. master_refresh_seed 1575 * 2. kappa * n tranfer public keys, depths first: [0..n),...,[0..n) 1576 * 3. hash over all pairs of R-values (for CS) if present, skipped otherwise 1577 * 4. n denomination hashes, in order 1578 * 5. amount with fee 1579 * 6. kappa*n planchets, depths first: [0..n),...,[0..n) 1580 * 1581 * @since v27 1582 * @deprecated vDOLDPLUS 1583 * Hash over: 1584 * 1. refresh_seed 1585 * 2. hash over all pairs of R-values if present, skipped otherwise 1586 * 3. n denomination hashes, in order 1587 * 4. amount with fee 1588 * 5. kappa * n planchets, depths first: [0..n),...,[0..n) 1589 */ 1590 struct GNUNET_HashCode session_hash; 1591 }; 1592 1593 .. _TALER_RefreshMeltCoinAffirmationPS: 1594 .. sourcecode:: c 1595 1596 struct TALER_RefreshMeltCoinAffirmationPS { 1597 /** 1598 * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_MELT 1599 */ 1600 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1601 struct TALER_RefreshCommitmentP session_hash; 1602 struct TALER_DenominationHash h_denom_pub; 1603 struct TALER_AgeCommitmentHash h_age_commitment; 1604 struct TALER_AmountNBO amount_with_fee; 1605 struct TALER_AmountNBO melt_fee; 1606 }; 1607 1608 .. _TALER_RefreshMeltConfirmationPS: 1609 .. sourcecode:: c 1610 1611 struct TALER_RefreshMeltConfirmationPS { 1612 /** 1613 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT 1614 */ 1615 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1616 struct TALER_RefreshCommitmentP session_hash; 1617 uint16_t noreveal_index; 1618 }; 1619 1620 .. _TALER_ExchangeSigningKeyValidityPS: 1621 .. sourcecode:: c 1622 1623 struct TALER_ExchangeSigningKeyValidityPS { 1624 /** 1625 * purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY 1626 */ 1627 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1628 struct GNUNET_TIME_AbsoluteNBO start; 1629 struct GNUNET_TIME_AbsoluteNBO expire; 1630 struct GNUNET_TIME_AbsoluteNBO end; 1631 struct TALER_ExchangePublicKeyP signkey_pub; 1632 }; 1633 1634 .. _TALER_ExchangeKeySetPS: 1635 .. sourcecode:: c 1636 1637 struct TALER_ExchangeKeySetPS { 1638 /** 1639 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_KEY_SET 1640 */ 1641 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1642 struct GNUNET_TIME_AbsoluteNBO list_issue_date; 1643 struct GNUNET_HashCode hc; 1644 }; 1645 1646 .. _TALER_DenominationKeyValidityPS: 1647 .. sourcecode:: c 1648 1649 struct TALER_DenominationKeyValidityPS { 1650 /** 1651 * purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY 1652 */ 1653 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1654 struct TALER_MasterPublicKeyP master; 1655 struct GNUNET_TIME_AbsoluteNBO start; 1656 struct GNUNET_TIME_AbsoluteNBO expire_withdraw; 1657 struct GNUNET_TIME_AbsoluteNBO expire_spend; 1658 struct GNUNET_TIME_AbsoluteNBO expire_legal; 1659 struct TALER_AmountNBO value; 1660 struct TALER_AmountNBO fee_withdraw; 1661 struct TALER_AmountNBO fee_deposit; 1662 struct TALER_AmountNBO fee_refresh; 1663 struct TALER_DenominationHash denom_hash; 1664 }; 1665 1666 .. _TALER_MasterWireDetailsPS: 1667 .. sourcecode:: c 1668 1669 struct TALER_MasterWireDetailsPS { 1670 /** 1671 * purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_DETAILS 1672 */ 1673 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1674 struct TALER_FullPaytoHash h_wire_details; 1675 struct GNUNET_HashCode h_conversion_url; 1676 struct GNUNET_HashCode h_credit_restrictions; 1677 struct GNUNET_HashCode h_debit_restrictions; 1678 }; 1679 1680 .. _TALER_MasterWireFeePS: 1681 .. sourcecode:: c 1682 1683 struct TALER_MasterWireFeePS { 1684 /** 1685 * purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_FEES 1686 */ 1687 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1688 struct GNUNET_HashCode h_wire_method; 1689 struct GNUNET_TIME_AbsoluteNBO start_date; 1690 struct GNUNET_TIME_AbsoluteNBO end_date; 1691 struct TALER_AmountNBO wire_fee; 1692 struct TALER_AmountNBO closing_fee; 1693 }; 1694 1695 .. _TALER_GlobalFeesPS: 1696 .. sourcecode:: c 1697 1698 struct TALER_GlobalFeesPS { 1699 /** 1700 * purpose.purpose = TALER_SIGNATURE_MASTER_GLOBAL_FEES 1701 */ 1702 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1703 struct GNUNET_TIME_AbsoluteNBO start_date; 1704 struct GNUNET_TIME_AbsoluteNBO end_date; 1705 struct GNUNET_TIME_RelativeNBO purse_timeout; 1706 struct GNUNET_TIME_RelativeNBO kyc_timeout; 1707 struct GNUNET_TIME_RelativeNBO history_expiration; 1708 struct TALER_AmountNBO history_fee; 1709 struct TALER_AmountNBO kyc_fee; 1710 struct TALER_AmountNBO account_fee; 1711 struct TALER_AmountNBO purse_fee; 1712 uint32_t purse_account_limit; 1713 }; 1714 1715 .. _TALER_MasterDrainProfitPS: 1716 .. sourcecode:: c 1717 1718 struct TALER_MasterDrainProfitPS { 1719 /** 1720 * purpose.purpose = TALER_SIGNATURE_MASTER_DRAIN_PROFITS 1721 */ 1722 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1723 struct TALER_WireTransferIdentifierRawP wtid; 1724 struct GNUNET_TIME_AbsoluteNBO date; 1725 struct TALER_AmountNBO amount; 1726 struct GNUNET_HashCode h_section; 1727 struct TALER_FullPaytoHashP h_payto; 1728 }; 1729 1730 .. _TALER_DepositTrackPS: 1731 .. sourcecode:: c 1732 1733 struct TALER_DepositTrackPS { 1734 /** 1735 * purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION 1736 */ 1737 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1738 struct TALER_PrivateContractHash h_contract_terms; 1739 struct TALER_MerchantWireHash h_wire; 1740 union TALER_CoinSpendPublicKeyP coin_pub; 1741 }; 1742 1743 .. _TALER_WireDepositDetailP: 1744 .. sourcecode:: c 1745 1746 struct TALER_WireDepositDetailP { 1747 struct TALER_PrivateContractHash h_contract_terms; 1748 struct GNUNET_TIME_AbsoluteNBO execution_time; 1749 union TALER_CoinSpendPublicKeyP coin_pub; 1750 struct TALER_AmountNBO deposit_value; 1751 struct TALER_AmountNBO deposit_fee; 1752 }; 1753 1754 .. _TALER_WireDepositDataPS: 1755 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT: 1756 .. sourcecode:: c 1757 1758 struct TALER_WireDepositDataPS { 1759 /** 1760 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT 1761 */ 1762 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1763 struct TALER_AmountNBO total; 1764 struct TALER_AmountNBO wire_fee; 1765 struct TALER_MerchantPublicKeyP merchant_pub; 1766 struct TALER_MerchantWireHash h_wire; 1767 struct GNUNET_HashCode h_details; 1768 }; 1769 1770 .. _TALER_ExchangeKeyValidityPS: 1771 .. sourcecode:: c 1772 1773 struct TALER_ExchangeKeyValidityPS { 1774 /** 1775 * purpose.purpose = TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS 1776 */ 1777 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1778 struct GNUNET_HashCode auditor_url_hash; 1779 struct TALER_MasterPublicKeyP master; 1780 struct GNUNET_TIME_AbsoluteNBO start; 1781 struct GNUNET_TIME_AbsoluteNBO expire_withdraw; 1782 struct GNUNET_TIME_AbsoluteNBO expire_spend; 1783 struct GNUNET_TIME_AbsoluteNBO expire_legal; 1784 struct TALER_AmountNBO value; 1785 struct TALER_AmountNBO fee_withdraw; 1786 struct TALER_AmountNBO fee_deposit; 1787 struct TALER_AmountNBO fee_refresh; 1788 struct TALER_DenominationHash denom_hash; 1789 }; 1790 1791 .. _TALER_PaymentResponsePS: 1792 .. sourcecode:: c 1793 1794 struct PaymentResponsePS { 1795 /** 1796 * purpose.purpose = TALER_SIGNATURE_MERCHANT_PAYMENT_OK 1797 */ 1798 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1799 struct TALER_PrivateContractHash h_contract_terms; 1800 }; 1801 1802 .. _TALER_ContractPS: 1803 .. sourcecode:: c 1804 1805 struct TALER_ContractPS { 1806 /** 1807 * purpose.purpose = TALER_SIGNATURE_MERCHANT_CONTRACT 1808 */ 1809 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1810 struct TALER_PrivateContractHash h_contract_terms; 1811 }; 1812 1813 .. _TALER_ConfirmWirePS: 1814 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE: 1815 .. sourcecode:: c 1816 1817 struct TALER_ConfirmWirePS { 1818 /** 1819 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE 1820 */ 1821 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1822 struct TALER_MerchantWireHash h_wire; 1823 struct TALER_PrivateContractHash h_contract_terms; 1824 struct TALER_WireTransferIdentifierRawP wtid; 1825 union TALER_CoinSpendPublicKeyP coin_pub; 1826 struct GNUNET_TIME_AbsoluteNBO execution_time; 1827 struct TALER_AmountNBO coin_contribution; 1828 }; 1829 1830 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND: 1831 .. sourcecode:: c 1832 1833 struct TALER_RefundConfirmationPS { 1834 /** 1835 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND. 1836 */ 1837 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1838 struct TALER_PrivateContractHash h_contract_terms; 1839 union TALER_CoinSpendPublicKeyP coin_pub; 1840 struct TALER_MerchantPublicKeyP merchant; 1841 uint64_t rtransaction_id; 1842 struct TALER_AmountNBO refund_amount; 1843 }; 1844 1845 .. _TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION: 1846 .. sourcecode:: c 1847 1848 struct TALER_DepositTrackPS { 1849 /** 1850 * purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION. 1851 */ 1852 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1853 struct TALER_PrivateContractHash h_contract_terms; 1854 struct TALER_MerchantWireHash h_wire; 1855 struct TALER_MerchantPublicKeyP merchant; 1856 union TALER_CoinSpendPublicKeyP coin_pub; 1857 }; 1858 1859 .. _TALER_RefundRequestPS: 1860 .. sourcecode:: c 1861 1862 struct TALER_RefundRequestPS { 1863 /** 1864 * purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND 1865 */ 1866 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1867 struct TALER_PrivateContractHash h_contract_terms; 1868 union TALER_CoinSpendPublicKeyP coin_pub; 1869 uint64_t rtransaction_id; 1870 struct TALER_AmountNBO refund_amount; 1871 struct TALER_AmountNBO refund_fee; 1872 }; 1873 1874 .. _TALER_MerchantRefundConfirmationPS: 1875 .. sourcecode:: c 1876 1877 struct TALER_MerchantRefundConfirmationPS { 1878 /** 1879 * purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND_OK 1880 */ 1881 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1882 /** 1883 * Hash of the order ID (a string), hashed without the 0-termination. 1884 */ 1885 struct GNUNET_HashCode h_order_id; 1886 }; 1887 1888 1889 .. _TALER_RecoupRequestPS: 1890 .. sourcecode:: c 1891 1892 struct TALER_RecoupRequestPS { 1893 /** 1894 * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_RECOUP 1895 * or TALER_SIGNATURE_WALLET_COIN_RECOUP_REFRESH 1896 */ 1897 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1898 struct TALER_DenominationHash h_denom_pub; 1899 struct TALER_DenominationBlindingKeyP coin_blind; 1900 }; 1901 1902 .. _TALER_RecoupRefreshConfirmationPS: 1903 .. sourcecode:: c 1904 1905 struct TALER_RecoupRefreshConfirmationPS { 1906 /** 1907 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH 1908 */ 1909 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1910 struct GNUNET_TIME_AbsoluteNBO timestamp; 1911 struct TALER_AmountNBO recoup_amount; 1912 union TALER_CoinSpendPublicKeyP coin_pub; 1913 union TALER_CoinSpendPublicKeyP old_coin_pub; 1914 }; 1915 1916 .. _TALER_RecoupConfirmationPS: 1917 .. sourcecode:: c 1918 1919 struct TALER_RecoupConfirmationPS { 1920 /** 1921 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP 1922 */ 1923 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1924 struct GNUNET_TIME_AbsoluteNBO timestamp; 1925 struct TALER_AmountNBO recoup_amount; 1926 union TALER_CoinSpendPublicKeyP coin_pub; 1927 struct TALER_ReservePublicKeyP reserve_pub; 1928 }; 1929 1930 1931 .. _TALER_DenominationUnknownAffirmationPS: 1932 .. sourcecode:: c 1933 1934 struct TALER_DenominationUnknownAffirmationPS { 1935 /** 1936 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_UNKNOWN 1937 */ 1938 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1939 struct GNUNET_TIME_AbsoluteNBO timestamp; 1940 struct TALER_DenominationHash h_denom_pub; 1941 }; 1942 1943 1944 .. _TALER_DenominationExpiredAffirmationPS: 1945 .. sourcecode:: c 1946 1947 struct TALER_DenominationExpiredAffirmationPS { 1948 /** 1949 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_GENERIC_DENOMINATIN_EXPIRED 1950 */ 1951 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1952 struct GNUNET_TIME_AbsoluteNBO timestamp; 1953 char operation[8]; 1954 struct TALER_DenominationHash h_denom_pub; 1955 }; 1956 1957 1958 .. _TALER_ReserveCloseConfirmationPS: 1959 .. sourcecode:: c 1960 1961 struct TALER_ReserveCloseConfirmationPS { 1962 /** 1963 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED 1964 */ 1965 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1966 struct GNUNET_TIME_AbsoluteNBO timestamp; 1967 struct TALER_AmountNBO closing_amount; 1968 struct TALER_ReservePublicKeyP reserve_pub; 1969 struct TALER_FullPaytoHash h_wire; 1970 }; 1971 1972 .. _TALER_CoinLinkSignaturePS: 1973 .. sourcecode:: c 1974 1975 struct TALER_CoinLinkSignaturePS { 1976 /** 1977 * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_LINK 1978 */ 1979 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1980 struct TALER_DenominationHash h_denom_pub; 1981 union TALER_CoinSpendPublicKeyP old_coin_pub; 1982 struct TALER_TransferPublicKeyP transfer_pub; 1983 struct TALER_BlindedCoinHash coin_envelope_hash; 1984 }; 1985 1986 .. _TALER_RefreshNonceSignaturePS: 1987 .. sourcecode:: c 1988 1989 struct TALER_RefreshNonceSignaturePS 1990 { 1991 /** 1992 * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_LINK 1993 */ 1994 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 1995 struct TALER_PublicRefreshCoinNonceP nonce; 1996 }; 1997 1998 1999 .. _TALER_ReserveStatusRequestSignaturePS: 2000 .. sourcecode:: c 2001 2002 struct TALER_ReserveStatusRequestSignaturePS { 2003 /** 2004 * purpose.purpose = TALER_SIGNATURE_RESERVE_STATUS_REQUEST 2005 */ 2006 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2007 struct GNUNET_TIME_AbsoluteNBO request_timestamp; 2008 }; 2009 2010 2011 .. _TALER_ReserveHistoryRequestSignaturePS: 2012 .. sourcecode:: c 2013 2014 struct TALER_ReserveHistoryRequestSignaturePS { 2015 /** 2016 * purpose.purpose = TALER_SIGNATURE_RESERVE_HISTORY_REQUEST 2017 */ 2018 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2019 struct TALER_AmountNBO history_fee; 2020 struct GNUNET_TIME_AbsoluteNBO request_timestamp; 2021 }; 2022 2023 2024 .. _TALER_PurseStatusRequestSignaturePS: 2025 .. sourcecode:: c 2026 2027 struct TALER_PurseStatusRequestSignaturePS { 2028 /** 2029 * purpose.purpose = TALER_SIGNATURE_PURSE_STATUS_REQUEST 2030 */ 2031 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2032 }; 2033 2034 2035 .. _TALER_PurseStatusResponseSignaturePS: 2036 .. sourcecode:: c 2037 2038 struct TALER_PurseStatusResponseSignaturePS { 2039 /** 2040 * purpose.purpose = TALER_SIGNATURE_PURSE_STATUS_RESPONSE 2041 */ 2042 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2043 struct TALER_AmountNBO total_purse_amount; 2044 struct TALER_AmountNBO total_deposit_amount; 2045 struct TALER_AmountNBO max_deposit_fees; 2046 struct GNUNET_TIME_AbsoluteNBO purse_expiration; 2047 struct GNUNET_TIME_AbsoluteNBO status_timestamp; 2048 struct TALER_PrivateContractHash h_contract_terms; 2049 }; 2050 2051 2052 .. _TALER_ReserveCloseRequestSignaturePS: 2053 .. sourcecode:: c 2054 2055 struct TALER_ReserveCloseRequestSignaturePS { 2056 /** 2057 * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE 2058 */ 2059 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2060 }; 2061 2062 2063 .. _TALER_PurseRequestSignaturePS: 2064 .. sourcecode:: c 2065 2066 struct TALER_PurseRequestSignaturePS { 2067 /** 2068 * purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_CREATE 2069 */ 2070 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2071 struct GNUNET_TIME_AbsoluteNBO purse_expiration; 2072 struct TALER_AmountNBO merge_value_after_fees; 2073 struct TALER_PrivateContractHashP h_contract_terms; 2074 uint32_t min_age; 2075 }; 2076 2077 2078 .. _TALER_PurseDepositSignaturePS: 2079 .. sourcecode:: c 2080 2081 struct TALER_PurseDepositSignaturePS { 2082 /** 2083 * purpose.purpose = TALER_SIGNATURE_PURSE_DEPOSIT 2084 */ 2085 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2086 struct TALER_AmountNBO coin_contribution; 2087 struct TALER_DenominationHash h_denom_pub; 2088 struct TALER_AgeCommitmentHash h_age_commitment; 2089 struct TALER_PursePublicKeyP purse_pub; 2090 struct GNUNET_HashCode h_exchange_base_url; 2091 }; 2092 2093 2094 .. _TALER_ReserveOpenDepositSignaturePS: 2095 .. sourcecode:: c 2096 2097 struct TALER_PurseDepositSignaturePS { 2098 /** 2099 * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN_DEPOSIT 2100 */ 2101 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2102 struct TALER_ReserveSignatureP reserve_sig; 2103 struct TALER_AmountNBO coin_contribution; 2104 }; 2105 2106 2107 .. _TALER_PurseDepositConfirmedSignaturePS: 2108 .. sourcecode:: c 2109 2110 struct TALER_PurseDepositConfirmedSignaturePS { 2111 /** 2112 * purpose.purpose = TALER_SIGNATURE_PURSE_DEPOSIT_CONFIRMED 2113 */ 2114 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2115 struct TALER_AmountNBO total_purse_amount; 2116 struct TALER_AmountNBO total_deposit_fees; 2117 struct TALER_PursePublicKeyP purse_pub; 2118 struct GNUNET_TIME_AbsoluteNBO purse_expiration; 2119 struct TALER_PrivateContractHashP h_contract_terms; 2120 }; 2121 2122 .. _TALER_PurseMergeSignaturePS: 2123 .. sourcecode:: c 2124 2125 struct TALER_PurseMergeSignaturePS { 2126 /** 2127 * purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_MERGE 2128 */ 2129 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2130 struct GNUNET_TIME_AbsoluteNBO merge_timestamp; 2131 struct TALER_NormalizedPaytoHashP h_wire; 2132 }; 2133 2134 2135 .. _TALER_AccountMergeSignaturePS: 2136 .. sourcecode:: c 2137 2138 struct TALER_AccountMergeSignaturePS { 2139 /** 2140 * purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_MERGE 2141 */ 2142 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2143 struct TALER_ReservePublicKeyP reserve_pub; 2144 struct TALER_PursePublicKeyP purse_pub; 2145 struct TALER_AmountNBO merge_amount_after_fees; 2146 struct GNUNET_TIME_AbsoluteNBO merge_timestamp; 2147 struct GNUNET_TIME_AbsoluteNBO purse_expiration; 2148 struct TALER_PrivateContractHashP h_contract_terms; 2149 uint32_t min_age; 2150 }; 2151 2152 .. _TALER_AccountSetupRequestSignaturePS: 2153 .. sourcecode:: c 2154 2155 struct TALER_AccountSetupRequestSignaturePS { 2156 /** 2157 * purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_SETUP 2158 */ 2159 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2160 struct TALER_AmountNBO threshold; 2161 }; 2162 2163 .. _TALER_PurseMergeSuccessSignaturePS: 2164 .. sourcecode:: c 2165 2166 struct TALER_PurseMergeSuccessSignaturePS { 2167 /** 2168 * purpose.purpose = TALER_SIGNATURE_PURSE_MERGE_SUCCESS 2169 */ 2170 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2171 struct TALER_ReservePublicKeyP reserve_pub; 2172 struct TALER_PursePublicKeyP purse_pub; 2173 struct TALER_AmountNBO merge_amount_after_fees; 2174 struct GNUNET_TIME_AbsoluteNBO contract_time; 2175 struct TALER_PrivateContractHashP h_contract_terms; 2176 struct TALER_NormalizedPaytoHashP h_wire; 2177 uint32_t min_age; 2178 }; 2179 2180 2181 .. _TALER_WadDataSignaturePS: 2182 .. sourcecode:: c 2183 2184 struct TALER_WadDataSignaturePS { 2185 /** 2186 * purpose.purpose = TALER_SIGNATURE_WAD_DATA 2187 */ 2188 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2189 struct GNUNET_TIME_AbsoluteNBO wad_execution_time; 2190 struct TALER_AmountNBO total_amount; 2191 struct GNUNET_HashCode h_items; 2192 struct TALER_WadId wad_id; 2193 }; 2194 2195 .. _TALER_WadPartnerSignaturePS: 2196 .. sourcecode:: c 2197 2198 struct TALER_WadPartnerSignaturePS { 2199 /** 2200 * purpose.purpose = TALER_SIGNATURE_MASTER_PARTNER_DETAILS 2201 */ 2202 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2203 struct GNUNET_HashCode h_partner_base_url; 2204 struct TALER_MasterPublicKeyP master_public_key; 2205 struct GNUNET_TIME_AbsoluteNBO start_date; 2206 struct GNUNET_TIME_AbsoluteNBO end_date; 2207 struct TALER_AmountNBO wad_fee; 2208 struct GNUNET_TIME_RelativeNBO wad_frequency; 2209 }; 2210 2211 2212 .. _TALER_P2PFeesPS: 2213 .. sourcecode:: c 2214 2215 struct TALER_P2PFeesPS { 2216 /** 2217 * purpose.purpose = TALER_SIGNATURE_P2P_FEES 2218 */ 2219 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2220 struct GNUNET_TIME_AbsoluteNBO start_date; 2221 struct GNUNET_TIME_AbsoluteNBO end_date; 2222 struct TALER_AmountNBO kyc_fee; 2223 struct TALER_AmountNBO purse_fee; 2224 struct TALER_AmountNBO account_history_fee; 2225 struct TALER_AmountNBO account_annual_fee; 2226 struct GNUNET_TIME_RelativeNBO account_kyc_timeout; 2227 struct GNUNET_TIME_RelativeNBO purse_timeout; 2228 uint32_t purse_account_limit; 2229 }; 2230 2231 2232 .. _TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND: 2233 .. sourcecode:: c 2234 2235 struct TALER_CoinPurseRefundConfirmationPS { 2236 /** 2237 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND. 2238 */ 2239 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2240 struct TALER_PursePublicKeyP purse_pub; 2241 union TALER_CoinSpendPublicKeyP coin_pub; 2242 struct TALER_AmountNBO refunded_amount; 2243 struct TALER_AmountNBO refund_fee; 2244 }; 2245 2246 2247 .. _TALER_DenominationKeyAnnouncementPS: 2248 .. sourcecode:: c 2249 2250 struct TALER_DenominationKeyAnnouncementPS { 2251 /** 2252 * purpose.purpose = TALER_SIGNATURE_SM_DENOMINATION_KEY 2253 */ 2254 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2255 struct TALER_DenominationHash h_denom_pub; 2256 struct GNUNET_HashCode h_section_name; 2257 struct GNUNET_TIME_AbsoluteNBO anchor_time; 2258 struct GNUNET_TIME_RelativeNBO duration_withdraw; 2259 }; 2260 2261 2262 .. _TALER_SigningKeyAnnouncementPS: 2263 .. sourcecode:: c 2264 2265 struct TALER_SigningKeyAnnouncementPS { 2266 /** 2267 * purpose.purpose = TALER_SIGNATURE_SM_SIGNING_KEY . 2268 */ 2269 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2270 struct TALER_ExchangePublicKeyP exchange_pub; 2271 struct GNUNET_TIME_AbsoluteNBO anchor_time; 2272 struct GNUNET_TIME_RelativeNBO duration; 2273 }; 2274 2275 .. _TALER_MasterDenominationKeyRevocationPS: 2276 .. sourcecode:: c 2277 2278 struct TALER_MasterDenominationKeyRevocationPS { 2279 /** 2280 * purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED. 2281 */ 2282 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2283 struct TALER_DenominationHash h_denom_pub; 2284 }; 2285 2286 2287 .. _TALER_MasterSigningKeyRevocationPS: 2288 .. sourcecode:: c 2289 2290 struct TALER_MasterSigningKeyRevocationPS { 2291 /** 2292 * purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED. 2293 */ 2294 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2295 struct TALER_ExchangePublicKeyP exchange_pub; 2296 }; 2297 2298 2299 .. _TALER_MasterAddAuditorPS: 2300 .. sourcecode:: c 2301 2302 struct TALER_MasterAddAuditorPS { 2303 /** 2304 * purpose.purpose = TALER_SIGNATURE_MASTER_ADD_AUDITOR 2305 */ 2306 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2307 struct GNUNET_TIME_AbsoluteNBO start_date; 2308 struct TALER_AuditorPublicKeyP auditor_pub; 2309 struct GNUNET_HashCode h_auditor_url; 2310 }; 2311 2312 .. _TALER_MasterDelAuditorPS: 2313 .. sourcecode:: c 2314 2315 struct TALER_MasterDelAuditorPS { 2316 /** 2317 * purpose.purpose = TALER_SIGNATURE_MASTER_DEL_AUDITOR 2318 */ 2319 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2320 struct GNUNET_TIME_AbsoluteNBO end_date; 2321 struct TALER_AuditorPublicKeyP auditor_pub; 2322 }; 2323 2324 .. _TALER_MasterAddWirePS: 2325 .. sourcecode:: c 2326 2327 struct TALER_MasterAddWirePS { 2328 /** 2329 * purpose.purpose = TALER_SIGNATURE_MASTER_ADD_WIRE. 2330 */ 2331 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2332 struct GNUNET_TIME_AbsoluteNBO start_date; 2333 struct TALER_FullPaytoHash h_wire; 2334 struct GNUNET_HashCode h_conversion_url; 2335 struct GNUNET_HashCode h_credit_restrictions; 2336 struct GNUNET_HashCode h_debit_restrictions; 2337 }; 2338 2339 .. _TALER_MasterDelWirePS: 2340 .. sourcecode:: c 2341 2342 struct TALER_MasterDelWirePS { 2343 /** 2344 * purpose.purpose = TALER_SIGNATURE_MASTER_DEL_WIRE. 2345 */ 2346 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2347 struct GNUNET_TIME_AbsoluteNBO end_date; 2348 struct TALER_FullPaytoHash h_wire; 2349 }; 2350 2351 2352 .. _TALER_MasterAmlOfficerStatusPS: 2353 .. sourcecode:: c 2354 2355 struct TALER_MasterAmlOfficerStatusPS { 2356 /** 2357 * purpose.purpose = TALER_SIGNATURE_MASTER_AML_KEY 2358 */ 2359 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2360 struct GNUNET_TIME_TimestampNBO change_date; 2361 struct TALER_AmlOfficerPublicKeyP officer_pub; 2362 struct GNUNET_HashCode h_officer_name GNUNET_PACKED; 2363 uint32_t is_active GNUNET_PACKED; 2364 }; 2365 2366 .. _TALER_AmlDecisionPS: 2367 .. sourcecode:: c 2368 2369 struct TALER_AmlDecisionPS { 2370 /** 2371 * purpose.purpose =TALER_SIGNATURE_AML_DECISION. 2372 */ 2373 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2374 struct GNUNET_HashCode h_justification GNUNET_PACKED; 2375 struct GNUNET_TIME_TimestampNBO decision_time; 2376 struct TALER_AmountNBO new_threshold; 2377 struct TALER_NormalizedPaytoHashP h_payto GNUNET_PACKED; 2378 struct GNUNET_HashCode h_kyc_requirements; 2379 uint32_t new_state GNUNET_PACKED; 2380 }; 2381 2382 .. _TALER_PartnerConfigurationPS: 2383 .. sourcecode:: c 2384 2385 struct TALER_PartnerConfigurationPS { 2386 /** 2387 * purpose.purpose = TALER_SIGNATURE_MASTER_PARNTER_DETAILS 2388 */ 2389 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2390 struct TALER_MasterPublicKeyP partner_pub; 2391 struct GNUNET_TIME_TimestampNBO start_date; 2392 struct GNUNET_TIME_TimestampNBO end_date; 2393 struct GNUNET_TIME_RelativeNBO wad_frequency; 2394 struct TALER_AmountNBO wad_fee; 2395 struct GNUNET_HashCode h_url; 2396 }; 2397 2398 .. _TALER_ReserveOpenPS: 2399 .. sourcecode:: c 2400 2401 struct TALER_ReserveOpenPS { 2402 /** 2403 * Purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN 2404 */ 2405 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2406 struct TALER_AmountNBO reserve_payment; 2407 struct GNUNET_TIME_TimestampNBO request_timestamp; 2408 struct GNUNET_TIME_TimestampNBO reserve_expiration; 2409 uint32_t purse_limit; 2410 }; 2411 2412 .. _TALER_ReserveClosePS: 2413 .. sourcecode:: c 2414 2415 struct TALER_ReserveClosePS { 2416 /** 2417 * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE 2418 */ 2419 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2420 struct GNUNET_TIME_TimestampNBO request_timestamp; 2421 struct TALER_FullPaytoHashP target_account_h_payto; 2422 }; 2423 2424 .. _TALER_WalletReserveAttestRequestSignaturePS: 2425 .. sourcecode:: c 2426 2427 struct TALER_ReserveAttestRequestPS { 2428 /** 2429 * purpose.purpose = TALER_SIGNATURE_WALLET_ATTEST_REQUEST 2430 */ 2431 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2432 struct GNUNET_TIME_TimestampNBO request_timestamp; 2433 struct GNUNET_HashCode h_details; 2434 }; 2435 2436 .. _TALER_ExchangeAttestPS: 2437 .. sourcecode:: c 2438 2439 struct TALER_ExchangeAttestPS { 2440 /** 2441 * purpose.purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_ATTEST_DETAILS 2442 */ 2443 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2444 struct GNUNET_TIME_TimestampNBO attest_timestamp; 2445 struct GNUNET_TIME_TimestampNBO expiration_time; 2446 struct TALER_ReservePublicKeyP reserve_pub; 2447 struct GNUNET_HashCode h_attributes; 2448 }; 2449 2450 .. _TALER_ExternKycDataImportBindingPS: 2451 .. sourcecode:: c 2452 2453 struct TALER_ExternKycDataImportBindingPS { 2454 /** 2455 * purpose.purpose = TALER_SIGNATURE_EXTERN_KYC_IMPORT_BINDING 2456 */ 2457 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2458 struct GNUNET_TIME_AbsoluteNBO import_date; 2459 union GNUNET_AccountPublicKeyP account_pub; 2460 struct GNUNET_HashCode h_attributes; 2461 struct GNUNET_HashCode h_customer_payto; 2462 }; 2463 2464 2465 .. _TALER_ExternKycDataBulkBindingPS: 2466 .. sourcecode:: c 2467 2468 struct TALER_ExternKycDataBulkBindingPS { 2469 /** 2470 * purpose.purpose = TALER_SIGNATURE_EXTERN_KYC_BULK_BINDING 2471 */ 2472 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2473 struct GNUNET_HashCode h_body; 2474 struct GNUNET_HashCode h_customer_payto; 2475 }; 2476 2477 .. _TALER_PreparedTransferRegisterPS: 2478 .. sourcecode:: c 2479 2480 struct TALER_PreparedTransferRegisterPS { 2481 /** 2482 * Purpose is #TALER_SIGNATURE_WALLET_PREPARED_TRANSFER_REGISTER 2483 */ 2484 struct GNUNET_CRYPTO_SignaturePurpose purpose; 2485 struct TALER_NormalizedPayto credit_account; 2486 struct TALER_AmountNBO credit_amount; 2487 /** 2488 * 1: reserve, 2: kyc 2489 */ 2490 uint32_t type; 2491 /** 2492 * 1: one-time, 2: recurrent 2493 */ 2494 uint16_t recurrent; 2495 /** 2496 * 1: EdDSA 2497 */ 2498 uint16_t alg; 2499 union TALER_AccountPublicKeyP account_pub; 2500 }; 2501 2502 .. _TALER_PreparedTransferUnregisterPS: 2503 .. sourcecode:: c 2504 2505 struct TALER_PreparedTransferUnregisterPS { 2506 /** 2507 * Purpose is #TALER_SIGNATURE_WALLET_PREPARED_TRANSFER_UNREGISTER 2508 */ 2509 struct GNUNET_CRYPTO_SignaturePurpose purpose; 2510 struct GNUNET_TIME_TimestampNBO timestamp; 2511 };