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