diff options
Diffstat (limited to 'core/api-common.rst')
-rw-r--r-- | core/api-common.rst | 779 |
1 files changed, 655 insertions, 124 deletions
diff --git a/core/api-common.rst b/core/api-common.rst index 7ee4769f..521b2fc0 100644 --- a/core/api-common.rst +++ b/core/api-common.rst @@ -18,10 +18,14 @@ .. _http-common: -================================= -Common Taler HTTP API Conventions -================================= +.. _foo_bar: +================================== +Conventions for Taler RESTful APIs +================================== + +.. contents:: Table of Contents + :local: ------------------------- HTTP Request and Response @@ -69,6 +73,8 @@ handle the error as if an internal error (500) had been returned. requests. :http:statuscode:`400 Bad request`: One of the arguments to the request is missing or malformed. + :http:statuscode:`415 Unsupported Media Type`: + The Content-Type header was not set, or it was set to an unsupported MIME type. :http:statuscode:`500 Internal server error`: This always indicates some serious internal operational error of the exchange, such as a program bug, database problems, etc., and must not be used for @@ -117,7 +123,7 @@ handle the error as if an internal error (500) had been returned. // Name of the object that was bogus (if applicable). object?: string; - // Name of the currency than was problematic (if applicable). + // Name of the currency that was problematic (if applicable). currency?: string; // Expected type (if applicable). @@ -125,6 +131,9 @@ handle the error as if an internal error (500) had been returned. // Type that was provided instead (if applicable). type_actual?: string; + + // Extra information that doesn't fit into the above (if applicable). + extra?: Object; } ----------------------- @@ -183,6 +192,29 @@ Examples: to decide whether it will talk to the service. +.. _error-codes: + +----------- +Error Codes +----------- + +All error codes used in GNU Taler are defined in +`GANA <https://git.gnunet.org/gana.git/tree/gnu-taler-error-codes/>`__. + +This centralized registry also contains generators that create enumerations +and mappings from error codes to HTTP status codes and human-readable error +messages for various programming languages. + +All error codes have numeric values below 100 or above 1000, so as to never be +confused with HTTP status codes. A value of 0 is reserved for "no error" or +"success". + +In C, the respective enumeration is the ``enum TALER_ErrorCode``. + +Developers may have to re-run ``bootstrap`` and/or update their Git +submodules to ensure that they have the lastest GANA registry. + + .. _encodings-ref: ---------------- @@ -209,6 +241,7 @@ resulting encoding. Hash codes ^^^^^^^^^^ + Hash codes are strings representing base32 encoding of the respective hashed data. See `base32`_. @@ -222,6 +255,40 @@ hashed data. See `base32`_. // 32-byte hash code. type ShortHashCode = string; +.. ts:def:: WireSalt + + // 16-byte salt. + type WireSalt = string; + +.. ts:def:: SHA256HashCode + + type SHA256HashCode = ShortHashCode; + +.. ts:def:: SHA512HashCode + + type SHA512HashCode = HashCode; + +.. ts:def:: CSNonce + + // 32-byte nonce value, must only be used once. + type CSNonce = string; + +.. ts:def:: RefreshMasterSeed + + // 32-byte nonce value, must only be used once. + type RefreshMasterSeed = string; + +.. ts:def:: Cs25519Point + + // 32-byte value representing a point on Curve25519. + type Cs25519Point = string; + +.. ts:def:: Cs25519Scalar + + // 32-byte value representing a scalar multiplier + // for scalar operations on points on Curve25519. + type Cs25519Scalar = string; + Safe Integers ^^^^^^^^^^^^^ @@ -241,6 +308,17 @@ Large numbers Large numbers such as RSA blinding factors and 256 bit keys, are transmitted as other binary data in Crockford Base32 encoding. +Decimal numbers +^^^^^^^^^^^^^^^ + +.. + FIXME: explain the representation with strings. + +.. ts:def:: DecimalNumber + + // Number with at most 8 fractional digits. + type DecimalNumber = string; + Timestamps ^^^^^^^^^^ @@ -249,18 +327,19 @@ Timestamps are represented by the following structure: .. ts:def:: Timestamp interface Timestamp { - // Milliseconds since epoch, or the special + // Seconds since epoch, or the special // value "never" to represent an event that will // never happen. - t_ms: number | "never"; + t_s: number | "never"; } .. ts:def:: RelativeTime - interface Duration { - // Duration in milliseconds or "forever" - // to represent an infinite duration. - d_ms: number | "forever"; + interface RelativeTime { + // Duration in microseconds or "forever" + // to represent an infinite duration. Numeric + // values are capped at 2^53 - 1 inclusive. + d_us: number | "forever"; } @@ -275,6 +354,45 @@ Integers // JavaScript numbers restricted to integers. type Integer = number; +Floats +^^^^^^ + +.. ts:def:: Float + + // JavaScript numbers. + type Float = number; + +Ages +^^^^ + +.. ts:def:: Age + + // An age is an integer between 0 and 255 measured in years. + type Age = number; + +Versions +^^^^^^^^ + +We use the type ``LibtoolVersion`` in the design documents to refer to a string +that represents a version with the semantic as defined by +`libtool <https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html>`__. + +.. ts:def:: LibtoolVersion + + // Version information in libtool version format and semantics + // current[:revision[:age]], f.e. "1", "2:0" or "3:1:2". + // see https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html. + type LibtoolVersion = string; + +We use the type ``SemVer`` to refer to a string that represents a version with +the semantic as defined by `semantic versioning <https://semver.org/>`__. + +.. ts:def:: SemVer + + // Version information in semantic versioning format and semantics, + // like "X.Z.Y", see https://semver.org/. + type SemVer = string; + Objects ^^^^^^^ @@ -283,6 +401,76 @@ Objects // JavaScript objects, no further restrictions. type Object = object; + +Contact details +^^^^^^^^^^^^^^^ + +.. ts:def:: EmailAddress + + type EmailAddress = string; + +.. ts:def:: PhoneNumber + + type PhoneNumber = string; + +Phone numbers should start with the ``+`` symbol and the country code. + +Permissions +^^^^^^^^^^^ + +This type epresses which permissions for a subject +apply on a resource. + +.. ts:def:: LibeufinPermission + + interface LibeufinPermission { + subjectType: string; + subjectId: string; + resourceType: string; + resourceId: string; + permissionName: string + } + + +Fetch params +^^^^^^^^^^^^ + +.. _fetch-params: + +.. ts:def:: FetchParams + + interface FetchParams { + + // Because transactions are delivered by banks in "batches", + // then every batch can have different qualities. This value + // lets the request specify which type of batch ought to be + // returned. Currently, the following two type are supported: + // + // 'report': typically includes only non booked transactions. + // 'statement': typically includes only booked transactions. + level: "report" | "statement" | "all"; + + // This type indicates the time range of the query. + // It allows the following values: + // + // 'latest': retrieves the last transactions from the bank. + // If there are older unread transactions, those will *not* + // be downloaded. + // + // 'all': retrieves all the transactions from the bank, + // until the oldest. + // + // 'previous-days': currently *not* implemented, it will allow + // the request to download transactions from + // today until N days before. + // + // 'since-last': retrieves all the transactions since the last + // time one was downloaded. + // + rangeType: "latest" | "all" | "previous-days" | "since-last"; + }; + + Keys ^^^^ @@ -305,6 +493,20 @@ Keys // converted to Crockford `Base32`. type EddsaPrivateKey = string; +.. ts:def:: Edx25519PublicKey + + // Edx25519 public keys are points on Curve25519 and represented using the + // standard 256 bits Ed25519 compact format converted to Crockford + // `Base32`. + type Edx25519PublicKey = string; + +.. ts:def:: Edx25519PrivateKey + + // Edx25519 private keys are always points on Curve25519 + // and represented using the standard 256 bits Ed25519 compact format, + // converted to Crockford `Base32`. + type Edx25519PrivateKey = string; + .. ts:def:: EcdhePublicKey // EdDSA and ECDHE public keys always point on Curve25519 @@ -312,6 +514,12 @@ Keys // converted to Crockford `Base32`. type EcdhePublicKey = string; +.. ts:def:: CsRPublic + + // Point on Curve25519 represented using the standard 256 bits Ed25519 compact format, + // converted to Crockford `Base32`. + type CsRPublic = string; + .. ts:def:: EcdhePrivateKey // EdDSA and ECDHE public keys always point on Curve25519 @@ -335,8 +543,31 @@ Blinded coin .. ts:def:: CoinEnvelope - // Blinded coin's `public EdDSA key <eddsa-coin-pub>`, `base32` encoded. - type CoinEnvelope = string; + // The type of a coin's blinded envelope depends on the cipher that is used + // for signing with a denomination key. + type CoinEnvelope = RSACoinEnvelope | CSCoinEnvelope ; + +.. ts:def:: RSACoinEnvelope + + // For denomination signatures based on RSA, the planchet is just a blinded + // coin's `public EdDSA key <eddsa-coin-pub>`. + interface RSACoinEnvelope { + cipher: "RSA" | "RSA+age_restricted"; + rsa_blinded_planchet: BlindedRsaSignature; + } + +.. ts:def:: CSCoinEnvelope + + // For denomination signatures based on Blind Clause-Schnorr, the planchet + // consists of the public nonce and two Curve25519 scalars which are two + // blinded challenges in the Blinded Clause-Schnorr signature scheme. + // See https://taler.net/papers/cs-thesis.pdf for details. + interface CSCoinEnvelope { + cipher: "CS" | "CS+age_restricted"; + cs_nonce: string; // Crockford `Base32` encoded + cs_blinded_c0: string; // Crockford `Base32` encoded + cs_blinded_c1: string; // Crockford `Base32` encoded + } .. ts:def:: DenominationBlindingKeyP @@ -346,6 +577,25 @@ Blinded coin type DenominationBlindingKeyP = string; +. _unblinded-coin: + +Unblinded coin +^^^^^^^^^^^^^^ + +.. ts:def:: UnblindedSignature + + // The type of a coin's unblinded signature depends on the cipher that was used + // for signing with a denomination key. + // Note that for now, only RSA is supported. + type UnblindedSignature = RsaUnblindedSignature; + +.. ts:def:: RsaUnblindedSignature + + interface RsaUnblindedSignature { + cipher: "RSA"; + rsa_signature: RsaSignature; + } + .. _signature: @@ -359,6 +609,12 @@ Signatures // binary-encoded objects with just the R and S values (base32_ binary-only). type EddsaSignature = string; +.. ts:def:: Edx25519Signature + + // Edx25519 signatures are transmitted as 64-bytes `base32` + // binary-encoded objects with just the R and S values (base32_ binary-only). + type Edx25519Signature = string; + .. ts:def:: RsaSignature // `base32` encoded RSA signature. @@ -374,6 +630,13 @@ Signatures // `base32` encoded RSA blinding secret. type RsaBlindingKeySecret = string; +.. ts:def:: DenominationBlindingKeySecret + + // Union, not (!) discriminated! + // (Note: CS Blinding Key secret is yet to be defined&added here). + type DenominationBlindingKeySecret = + | RsaBlindingKeySecret; + .. _amount: Amounts @@ -402,6 +665,12 @@ The following constrains apply for a valid amount: An amount that is prefixed with a ``+`` or ``-`` character is also used in certain contexts. When no sign is present, the amount is assumed to be positive. +.. note:: + + In some setups, when Libeufin-Bank offers cashouts towards traditional + currencies like EUR for example, the fractional part gets restricted + to at most 2 digits. + .. ts:def:: SignedAmount type SignedAmount = string; @@ -496,12 +765,65 @@ All elliptic curve operations are on Curve25519. Public and private keys are thus 32 bytes, and signatures 64 bytes. For hashing, including HKDFs, Taler uses 512-bit hash codes (64 bytes). +.. _HashCode: .. sourcecode:: c struct GNUNET_HashCode { uint8_t hash[64]; // usually SHA-512 }; +.. sourcecode:: c + + struct TALER_DenominationHash { + struct GNUNET_HashCode hash; + }; + +.. sourcecode:: c + + struct TALER_PrivateContractHash { + struct GNUNET_HashCode hash; + }; + +.. sourcecode:: c + + struct TALER_ExtensionsPolicyHash { + struct GNUNET_HashCode hash; + }; + +.. sourcecode:: c + + struct TALER_MerchantWireHash { + struct GNUNET_HashCode hash; + }; + +.. _PaytoHash: +.. sourcecode:: c + + struct TALER_PaytoHash { + struct GNUNET_ShortHashCode hash; + }; + +.. _BlindedCoinHash: +.. sourcecode:: c + + struct TALER_BlindedCoinHash { + struct GNUNET_HashCode hash; + }; + +.. sourcecode:: c + + struct TALER_CoinPubHash { + struct GNUNET_HashCode hash; + }; + +.. sourcecode:: c + + struct TALER_OutputCommitmentHash { + struct GNUNET_HashCode hash; + }; + + + .. _TALER_EcdhEphemeralPublicKeyP: .. sourcecode:: c @@ -546,6 +868,28 @@ uses 512-bit hash codes (64 bytes). uint8_t ecdhe_priv[32]; }; + +.. _AmlDecisionState: +.. sourcecode:: c + + enum TALER_AmlDecisionState { + NORMAL, PENDING, FROZEN + }; + +.. _AmlOfficerPublicKeyP: +.. sourcecode:: c + + struct TALER_AmlOfficerPublicKeyP { + uint8_t eddsa_pub[32]; + }; + +.. _AmlOfficerPrivateKeyP: +.. sourcecode:: c + + struct TALER_AmlOfficerPrivateKeyP { + uint8_t eddsa_priv[32]; + }; + .. _sign-key-pub: .. sourcecode:: c @@ -630,10 +974,19 @@ uses 512-bit hash codes (64 bytes). uint8_t enc[sizeof (struct TALER_LinkSecretP)]; }; +.. _eddsa-token-pub: +.. sourcecode:: c + + union TALER_TokenPublicKeyP { + uint8_t eddsa_pub[32]; + uint8_t ecdhe_pub[32]; + }; + .. _Signatures: Signatures ^^^^^^^^^^ + Any piece of signed data, complies to the abstract data structure given below. .. sourcecode:: c @@ -648,9 +1001,11 @@ Any piece of signed data, complies to the abstract data structure given below. /*From gnunet_crypto_lib.h*/ struct GNUNET_CRYPTO_EccSignaturePurpose { /** - - The following constraints apply for a valid amount: - + * This field equals the number of bytes being signed, + * namely 'sizeof (struct Data)'. + */ + uint32_t size; + /** * This field is used to express the context in * which the signature is made, ensuring that a * signature cannot be lifted from one part of the protocol @@ -658,11 +1013,6 @@ Any piece of signed data, complies to the abstract data structure given below. * exchange's codebase (git://taler.net/exchange). */ uint32_t purpose; - /** - * This field equals the number of bytes being signed, - * namely 'sizeof (struct Data)'. - */ - uint32_t size; }; @@ -682,11 +1032,44 @@ within the struct TALER_ReservePublicKeyP reserve_pub; struct TALER_AmountNBO amount_with_fee; struct TALER_AmountNBO withdraw_fee; - struct GNUNET_HashCode h_denomination_pub; - struct GNUNET_HashCode h_coin_envelope; + struct TALER_DenominationHash h_denomination_pub; + struct TALER_BlindedCoinHash h_coin_envelope; + }; + +.. _TALER_AgeWithdrawRequestPS: +.. sourcecode:: c + + struct TALER_AgeWithdrawRequestPS { + /** + * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_AGE_WITHDRAW + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct TALER_ReservePublicKeyP reserve_pub; + /** + * This is the running SHA512-hash over n*kappa + * `struct TALER_BlindedCoinHash` values + */ + struct GNUNET_HashCode h_commitment; + struct TALER_AgeMask mask; + uint8_t max_age_group; }; -.. _TALER_DepositRequestPS: +.. _TALER_AgeWithdrawConfirmationPS: + +.. sourcecode:: c + + struct TALER_AgeWithdrawConfirmationPS { + /** + * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_AGE_WITHDRAW + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct GNUNET_HashCode h_commitment; + uint32_t noreveal_index; + }; + + +.. _taler_depositrequestps: + .. sourcecode:: c struct TALER_DepositRequestPS { @@ -694,27 +1077,35 @@ within the * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_DEPOSIT */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_contract_terms; - struct GNUNET_HashCode h_wire; - struct GNUNET_HashCode h_denom_pub; + struct TALER_PrivateContractHash h_contract_terms; + struct TALER_AgeCommitmentHash h_age_commitment; + struct TALER_ExtensionsPolicyHash h_policy; + struct TALER_MerchantWireHash h_wire; + struct TALER_DenominationHash h_denom_pub; struct GNUNET_TIME_AbsoluteNBO timestamp; struct GNUNET_TIME_AbsoluteNBO refund_deadline; struct TALER_AmountNBO amount_with_fee; struct TALER_AmountNBO deposit_fee; struct TALER_MerchantPublicKeyP merchant; - union TALER_CoinSpendPublicKeyP coin_pub; + struct GNUNET_HashCode wallet_data_hash; + /* @since protocol **vSUBSCRIBE** */ + struct TALER_OutputCommitmentHash h_outputs; + /* @since protocol **vSUBSCRIBE** */ + uint16_t choice_index; }; .. _TALER_DepositConfirmationPS: + .. sourcecode:: c struct TALER_DepositConfirmationPS { /** - * purpose.purpose = TALER_SIGNATURE_WALLET_CONFIRM_DEPOSIT + * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_contract_terms; - struct GNUNET_HashCode h_wire; + struct TALER_PrivateContractHash h_contract_terms; + struct TALER_MerchantWireHash h_wire; + struct TALER_ExtensionsPolicyHash h_policy; struct GNUNET_TIME_AbsoluteNBO timestamp; struct GNUNET_TIME_AbsoluteNBO refund_deadline; struct TALER_AmountNBO amount_without_fee; @@ -730,11 +1121,11 @@ within the * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_MELT */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode session_hash; - struct GNUNET_HashCode h_denom_pub; + struct TALER_RefreshCommitmentP session_hash; + struct TALER_DenominationHash h_denom_pub; + struct TALER_AgeCommitmentHash h_age_commitment; struct TALER_AmountNBO amount_with_fee; struct TALER_AmountNBO melt_fee; - union TALER_CoinSpendPublicKeyP coin_pub; }; .. _TALER_RefreshMeltConfirmationPS: @@ -745,7 +1136,7 @@ within the * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode session_hash; + struct TALER_RefreshCommitmentP session_hash; uint16_t noreveal_index; }; @@ -757,7 +1148,6 @@ within the * purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct TALER_MasterPublicKeyP master_public_key; struct GNUNET_TIME_AbsoluteNBO start; struct GNUNET_TIME_AbsoluteNBO expire; struct GNUNET_TIME_AbsoluteNBO end; @@ -793,7 +1183,7 @@ within the struct TALER_AmountNBO fee_withdraw; struct TALER_AmountNBO fee_deposit; struct TALER_AmountNBO fee_refresh; - struct GNUNET_HashCode denom_hash; + struct TALER_DenominationHash denom_hash; }; .. _TALER_MasterWireDetailsPS: @@ -804,7 +1194,10 @@ within the * purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_DETAILS */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_wire_details; + struct TALER_PaytoHash h_wire_details; + struct GNUNET_HashCode h_conversion_url; + struct GNUNET_HashCode h_credit_restrictions; + struct GNUNET_HashCode h_debit_restrictions; }; .. _TALER_MasterWireFeePS: @@ -822,6 +1215,41 @@ within the struct TALER_AmountNBO closing_fee; }; +.. _TALER_GlobalFeesPS: +.. sourcecode:: c + + struct TALER_GlobalFeesPS { + /** + * purpose.purpose = TALER_SIGNATURE_MASTER_GLOBAL_FEES + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct GNUNET_TIME_AbsoluteNBO start_date; + struct GNUNET_TIME_AbsoluteNBO end_date; + struct GNUNET_TIME_RelativeNBO purse_timeout; + struct GNUNET_TIME_RelativeNBO kyc_timeout; + struct GNUNET_TIME_RelativeNBO history_expiration; + struct TALER_AmountNBO history_fee; + struct TALER_AmountNBO kyc_fee; + struct TALER_AmountNBO account_fee; + struct TALER_AmountNBO purse_fee; + uint32_t purse_account_limit; + }; + +.. _TALER_MasterDrainProfitPS: +.. sourcecode:: c + + struct TALER_MasterDrainProfitPS { + /** + * purpose.purpose = TALER_SIGNATURE_MASTER_DRAIN_PROFITS + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct TALER_WireTransferIdentifierRawP wtid; + struct GNUNET_TIME_AbsoluteNBO date; + struct TALER_AmountNBO amount; + struct GNUNET_HashCode h_section; + struct TALER_PaytoHashP h_payto; + }; + .. _TALER_DepositTrackPS: .. sourcecode:: c @@ -830,19 +1258,18 @@ within the * purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_contract_terms; - struct GNUNET_HashCode h_wire; - struct TALER_MerchantPublicKeyP merchant; - struct TALER_CoinSpendPublicKeyP coin_pub; + struct TALER_PrivateContractHash h_contract_terms; + struct TALER_MerchantWireHash h_wire; + union TALER_CoinSpendPublicKeyP coin_pub; }; .. _TALER_WireDepositDetailP: .. sourcecode:: c struct TALER_WireDepositDetailP { - struct GNUNET_HashCode h_contract_terms; + struct TALER_PrivateContractHash h_contract_terms; struct GNUNET_TIME_AbsoluteNBO execution_time; - struct TALER_CoinSpendPublicKeyP coin_pub; + union TALER_CoinSpendPublicKeyP coin_pub; struct TALER_AmountNBO deposit_value; struct TALER_AmountNBO deposit_fee; }; @@ -859,7 +1286,7 @@ within the struct TALER_AmountNBO total; struct TALER_AmountNBO wire_fee; struct TALER_MerchantPublicKeyP merchant_pub; - struct GNUNET_HashCode h_wire; + struct TALER_MerchantWireHash h_wire; struct GNUNET_HashCode h_details; }; @@ -881,7 +1308,7 @@ within the struct TALER_AmountNBO fee_withdraw; struct TALER_AmountNBO fee_deposit; struct TALER_AmountNBO fee_refresh; - struct GNUNET_HashCode denom_hash; + struct TALER_DenominationHash denom_hash; }; .. _TALER_PaymentResponsePS: @@ -892,7 +1319,7 @@ within the * purpose.purpose = TALER_SIGNATURE_MERCHANT_PAYMENT_OK */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_contract_terms; + struct TALER_PrivateContractHash h_contract_terms; }; .. _TALER_ContractPS: @@ -903,10 +1330,7 @@ within the * purpose.purpose = TALER_SIGNATURE_MERCHANT_CONTRACT */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct TALER_AmountNBO total_amount; - struct TALER_AmountNBO max_fee; - struct GNUNET_HashCode h_contract_terms; - struct TALER_MerchantPublicKeyP merchant_pub; + struct TALER_PrivateContractHash h_contract_terms; }; .. _TALER_ConfirmWirePS: @@ -918,10 +1342,10 @@ within the * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_wire; - struct GNUNET_HashCode h_contract_terms; + struct TALER_MerchantWireHash h_wire; + struct TALER_PrivateContractHash h_contract_terms; struct TALER_WireTransferIdentifierRawP wtid; - struct TALER_CoinSpendPublicKeyP coin_pub; + union TALER_CoinSpendPublicKeyP coin_pub; struct GNUNET_TIME_AbsoluteNBO execution_time; struct TALER_AmountNBO coin_contribution; }; @@ -934,8 +1358,8 @@ within the * purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND. */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_contract_terms; - struct TALER_CoinSpendPublicKeyP coin_pub; + struct TALER_PrivateContractHash h_contract_terms; + union TALER_CoinSpendPublicKeyP coin_pub; struct TALER_MerchantPublicKeyP merchant; uint64_t rtransaction_id; struct TALER_AmountNBO refund_amount; @@ -949,10 +1373,10 @@ within the * purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION. */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_contract_terms; - struct GNUNET_HashCode h_wire; + struct TALER_PrivateContractHash h_contract_terms; + struct TALER_MerchantWireHash h_wire; struct TALER_MerchantPublicKeyP merchant; - struct TALER_CoinSpendPublicKeyP coin_pub; + union TALER_CoinSpendPublicKeyP coin_pub; }; .. _TALER_RefundRequestPS: @@ -963,9 +1387,8 @@ within the * purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_contract_terms; - struct TALER_CoinSpendPublicKeyP coin_pub; - struct TALER_MerchantPublicKeyP merchant; + struct TALER_PrivateContractHash h_contract_terms; + union TALER_CoinSpendPublicKeyP coin_pub; uint64_t rtransaction_id; struct TALER_AmountNBO refund_amount; struct TALER_AmountNBO refund_fee; @@ -992,10 +1415,10 @@ within the struct TALER_RecoupRequestPS { /** * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_RECOUP + * or TALER_SIGNATURE_WALLET_COIN_RECOUP_REFRESH */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct TALER_CoinSpendPublicKeyP coin_pub; - struct GNUNET_HashCode h_denom_pub; + struct TALER_DenominationHash h_denom_pub; struct TALER_DenominationBlindingKeyP coin_blind; }; @@ -1009,8 +1432,8 @@ within the struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_TIME_AbsoluteNBO timestamp; struct TALER_AmountNBO recoup_amount; - struct TALER_CoinSpendPublicKeyP coin_pub; - struct TALER_CoinSpendPublicKeyP old_coin_pub; + union TALER_CoinSpendPublicKeyP coin_pub; + union TALER_CoinSpendPublicKeyP old_coin_pub; }; .. _TALER_RecoupConfirmationPS: @@ -1023,7 +1446,7 @@ within the struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_TIME_AbsoluteNBO timestamp; struct TALER_AmountNBO recoup_amount; - struct TALER_CoinSpendPublicKeyP coin_pub; + union TALER_CoinSpendPublicKeyP coin_pub; struct TALER_ReservePublicKeyP reserve_pub; }; @@ -1037,7 +1460,7 @@ within the */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_TIME_AbsoluteNBO timestamp; - struct GNUNET_HashCode h_denom_pub; + struct TALER_DenominationHash h_denom_pub; }; @@ -1051,7 +1474,7 @@ within the struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_TIME_AbsoluteNBO timestamp; char operation[8]; - struct GNUNET_HashCode h_denom_pub; + struct TALER_DenominationHash h_denom_pub; }; @@ -1066,7 +1489,7 @@ within the struct GNUNET_TIME_AbsoluteNBO timestamp; struct TALER_AmountNBO closing_amount; struct TALER_ReservePublicKeyP reserve_pub; - struct GNUNET_HashCode h_wire; + struct TALER_PaytoHash h_wire; }; .. _TALER_CoinLinkSignaturePS: @@ -1077,15 +1500,13 @@ within the * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_LINK */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_denom_pub; - struct TALER_CoinSpendPublicKeyP old_coin_pub; + struct TALER_DenominationHash h_denom_pub; + union TALER_CoinSpendPublicKeyP old_coin_pub; struct TALER_TransferPublicKeyP transfer_pub; - struct GNUNET_HashCode coin_envelope_hash; + struct TALER_BlindedCoinHash coin_envelope_hash; }; - - .. _TALER_ReserveStatusRequestSignaturePS: .. sourcecode:: c @@ -1135,7 +1556,7 @@ within the struct TALER_AmountNBO max_deposit_fees; struct GNUNET_TIME_AbsoluteNBO purse_expiration; struct GNUNET_TIME_AbsoluteNBO status_timestamp; - struct GNUNET_HashCode h_contract_terms; + struct TALER_PrivateContractHash h_contract_terms; }; @@ -1144,7 +1565,7 @@ within the struct TALER_ReserveCloseRequestSignaturePS { /** - * purpose.purpose = TALER_SIGNATURE_RESERVE_CLOSE + * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; }; @@ -1162,12 +1583,13 @@ within the struct TALER_PurseRequestSignaturePS { /** - * purpose.purpose = TALER_SIGNATURE_PURSE_REQUEST + * purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_CREATE */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_TIME_AbsoluteNBO purse_expiration; struct TALER_AmountNBO merge_value_after_fees; - struct GNUNET_HashCode h_contract_terms; + struct TALER_PrivateContractHashP h_contract_terms; + uint32_t min_age; }; @@ -1180,9 +1602,23 @@ within the */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct TALER_AmountNBO coin_contribution; - struct GNUNET_TIME_AbsoluteNBO purse_expiration; - struct TALER_PursePublicKey purse_pub; - struct GNUNET_HashCode h_contract_terms; + struct TALER_DenominationHash h_denom_pub; + struct TALER_AgeCommitmentHash h_age_commitment; + struct TALER_PursePublicKeyP purse_pub; + struct GNUNET_HashCode h_exchange_base_url; + }; + + +.. _TALER_ReserveOpenDepositSignaturePS: +.. sourcecode:: c + + struct TALER_PurseDepositSignaturePS { + /** + * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN_DEPOSIT + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct TALER_ReserveSignatureP reserve_sig; + struct TALER_AmountNBO coin_contribution; }; @@ -1196,9 +1632,9 @@ within the struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct TALER_AmountNBO total_purse_amount; struct TALER_AmountNBO total_deposit_fees; - struct TALER_PursePublicKey purse_pub; + struct TALER_PursePublicKeyP purse_pub; struct GNUNET_TIME_AbsoluteNBO purse_expiration; - struct GNUNET_HashCode h_contract_terms; + struct TALER_PrivateContractHashP h_contract_terms; }; .. _TALER_PurseMergeSignaturePS: @@ -1206,15 +1642,11 @@ within the struct TALER_PurseMergeSignaturePS { /** - * purpose.purpose = TALER_SIGNATURE_PURSE_MERGE + * purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_MERGE */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct TALER_ReservePublicKey reserve_pub; struct GNUNET_TIME_AbsoluteNBO merge_timestamp; - struct GNUNET_TIME_AbsoluteNBO purse_expiration; - struct TALER_AmountNBO merge_value_after_fees; - struct GNUNET_HashCode h_contract_terms; - struct GNUNET_HashCode h_wire; + struct TALER_PaytoHashP h_wire; }; @@ -1223,59 +1655,58 @@ within the struct TALER_AccountMergeSignaturePS { /** - * purpose.purpose = TALER_SIGNATURE_ACCOUNT_MERGE + * purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_MERGE */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct TALER_PursePublicKey purse_pub; + struct TALER_ReservePublicKeyP reserve_pub; + struct TALER_PursePublicKeyP purse_pub; + struct TALER_AmountNBO merge_amount_after_fees; struct GNUNET_TIME_AbsoluteNBO merge_timestamp; struct GNUNET_TIME_AbsoluteNBO purse_expiration; - struct TALER_AmountNBO merge_value_after_fees; - struct GNUNET_HashCode h_contract_terms; - struct GNUNET_HashCode h_wire; + struct TALER_PrivateContractHashP h_contract_terms; + uint32_t min_age; }; - -.. _TALER_PurseMergeSuccessSignaturePS: +.. _TALER_AccountSetupRequestSignaturePS: .. sourcecode:: c - struct TALER_PurseMergeSuccessSignaturePS { + struct TALER_AccountSetupRequestSignaturePS { /** - * purpose.purpose = TALER_SIGNATURE_PURSE_MERGE_SUCCESS + * purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_SETUP */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct TALER_ReservePublicKey reserve_pub; - struct TALER_PursePublicKey purse_pub; - struct TALER_AmountNBO merge_amount_after_fees; - struct GNUNET_TIME_AbsoluteNBO contract_time; - struct GNUNET_HashCode h_contract_terms; - struct GNUNET_HashCode h_wire; + struct TALER_AmountNBO threshold; }; - -.. _TALER_AccountSetupRequestSignaturePS: +.. _TALER_AccountSetupSuccessSignaturePS: .. sourcecode:: c - struct TALER_AccountSetupRequestSignaturePS { + struct TALER_AccountSetupSuccessSignaturePS { /** - * purpose.purpose = TALER_SIGNATURE_ACCOUNT_SETUP_REQUEST + * purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_SETUP_SUCCESS */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_TIME_AbsoluteNBO kyc_timestamp; - struct TALER_AmountNBO kyc_fee; - struct GNUNET_HashCode h_wire; + struct TALER_PaytoHash h_payto; + struct GNUNET_HashCode h_kyc; + struct GNUNET_TIME_AbsoluteNBO timestamp; }; -.. _TALER_AccountSetupSuccessSignaturePS: +.. _TALER_PurseMergeSuccessSignaturePS: .. sourcecode:: c - struct TALER_AccountSetupRequestSignaturePS { + struct TALER_PurseMergeSuccessSignaturePS { /** - * purpose.purpose = TALER_SIGNATURE_ACCOUNT_SETUP_SUCCESS + * purpose.purpose = TALER_SIGNATURE_PURSE_MERGE_SUCCESS */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct TALER_ReservePublicKey reserve_pub; - struct GNUNET_TIME_AbsoluteNBO now; + struct TALER_ReservePublicKeyP reserve_pub; + struct TALER_PursePublicKeyP purse_pub; + struct TALER_AmountNBO merge_amount_after_fees; + struct GNUNET_TIME_AbsoluteNBO contract_time; + struct TALER_PrivateContractHashP h_contract_terms; + struct TALER_PaytoHashP h_wire; + uint32_t min_age; }; @@ -1339,10 +1770,8 @@ within the */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct TALER_PursePublicKey purse_pub; - struct TALER_CoinSpendPublicKeyP coin_pub; - struct TALER_MerchantPublicKeyP merchant; - struct TALER_AmountNBO remaining_amount; - struct TALER_AmountNBO purse_fee_share; + union TALER_CoinSpendPublicKeyP coin_pub; + struct TALER_AmountNBO refunded_amount; struct TALER_AmountNBO refund_fee; }; @@ -1355,7 +1784,7 @@ within the * purpose.purpose = TALER_SIGNATURE_SM_DENOMINATION_KEY */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_denom_pub; + struct TALER_DenominationHash h_denom_pub; struct GNUNET_HashCode h_section_name; struct GNUNET_TIME_AbsoluteNBO anchor_time; struct GNUNET_TIME_RelativeNBO duration_withdraw; @@ -1383,7 +1812,7 @@ within the * purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED. */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_denom_pub; + struct TALER_DenominationHash h_denom_pub; }; @@ -1433,7 +1862,10 @@ within the */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_TIME_AbsoluteNBO start_date; - struct GNUNET_HashCode h_wire GNUNET_PACKED; + struct TALER_PaytoHash h_wire; + struct GNUNET_HashCode h_conversion_url; + struct GNUNET_HashCode h_credit_restrictions; + struct GNUNET_HashCode h_debit_restrictions; }; .. _TALER_MasterDelWirePS: @@ -1445,5 +1877,104 @@ within the */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_TIME_AbsoluteNBO end_date; - struct GNUNET_HashCode h_wire GNUNET_PACKED; + struct TALER_PaytoHash h_wire; + }; + + +.. _TALER_MasterAmlOfficerStatusPS: +.. sourcecode:: c + + struct TALER_MasterAmlOfficerStatusPS { + /** + * purpose.purpose = TALER_SIGNATURE_MASTER_AML_KEY + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct GNUNET_TIME_TimestampNBO change_date; + struct TALER_AmlOfficerPublicKeyP officer_pub; + struct GNUNET_HashCode h_officer_name GNUNET_PACKED; + uint32_t is_active GNUNET_PACKED; + }; + +.. _TALER_AmlDecisionPS: +.. sourcecode:: c + + struct TALER_AmlDecisionPS { + /** + * purpose.purpose =TALER_SIGNATURE_AML_DECISION. + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct GNUNET_HashCode h_justification GNUNET_PACKED; + struct GNUNET_TIME_TimestampNBO decision_time; + struct TALER_AmountNBO new_threshold; + struct TALER_PaytoHashP h_payto GNUNET_PACKED; + struct GNUNET_HashCode h_kyc_requirements; + uint32_t new_state GNUNET_PACKED; + }; + +.. _TALER_PartnerConfigurationPS: +.. sourcecode:: c + + struct TALER_PartnerConfigurationPS { + /** + * purpose.purpose = TALER_SIGNATURE_MASTER_PARNTER_DETAILS + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct TALER_MasterPublicKeyP partner_pub; + struct GNUNET_TIME_TimestampNBO start_date; + struct GNUNET_TIME_TimestampNBO end_date; + struct GNUNET_TIME_RelativeNBO wad_frequency; + struct TALER_AmountNBO wad_fee; + struct GNUNET_HashCode h_url; + }; + +.. _TALER_ReserveOpenPS: +.. sourcecode:: c + + struct TALER_ReserveOpenPS { + /** + * Purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct TALER_AmountNBO reserve_payment; + struct GNUNET_TIME_TimestampNBO request_timestamp; + struct GNUNET_TIME_TimestampNBO reserve_expiration; + uint32_t purse_limit; + }; + +.. _TALER_ReserveClosePS: +.. sourcecode:: c + + struct TALER_ReserveClosePS { + /** + * purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct GNUNET_TIME_TimestampNBO request_timestamp; + struct TALER_PaytoHashP target_account_h_payto; + }; + +.. _TALER_WalletReserveAttestRequestSignaturePS: +.. sourcecode:: c + + struct TALER_ReserveAttestRequestPS { + /** + * purpose.purpose = TALER_SIGNATURE_WALLET_ATTEST_REQUEST + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct GNUNET_TIME_TimestampNBO request_timestamp; + struct GNUNET_HashCode h_details; + }; + +.. _TALER_ExchangeAttestPS: +.. sourcecode:: c + + struct TALER_ExchangeAttestPS { + /** + * purpose.purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_ATTEST_DETAILS + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + struct GNUNET_TIME_TimestampNBO attest_timestamp; + struct GNUNET_TIME_TimestampNBO expiration_time; + struct TALER_ReservePublicKeyP reserve_pub; + struct GNUNET_HashCode h_attributes; }; |