summaryrefslogtreecommitdiff
path: root/core/api-exchange.rst
diff options
context:
space:
mode:
Diffstat (limited to 'core/api-exchange.rst')
-rw-r--r--core/api-exchange.rst2172
1 files changed, 1106 insertions, 1066 deletions
diff --git a/core/api-exchange.rst b/core/api-exchange.rst
index 19090067..4c5be000 100644
--- a/core/api-exchange.rst
+++ b/core/api-exchange.rst
@@ -1,6 +1,6 @@
..
This file is part of GNU TALER.
- Copyright (C) 2014-2023 Taler Systems SA
+ Copyright (C) 2014-2024 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -24,6 +24,9 @@ for all details not specified in the individual requests.
The `glossary <https://docs.taler.net/glossary.html#glossary>`_
defines all specific terms used in this section.
+.. contents:: Table of Contents
+ :local:
+
.. include:: tos.rst
.. _keys:
@@ -55,7 +58,11 @@ possibly by using HTTPS.
.. http:get:: /config
- Return the protocol version and currency supported by this exchange backend, as well as the list of possible KYC requirements. This endpoint is largely for the SPA for AML officers. Merchants should use ``/keys`` which also contains the protocol version and currency.
+ Return the protocol version and currency supported by this exchange backend,
+ as well as the list of possible KYC requirements. This endpoint is largely
+ for the SPA for AML officers. Merchants should use ``/keys`` which also
+ contains the protocol version and currency.
+ This specification corresponds to ``current`` protocol being **v19**.
**Response:**
@@ -73,14 +80,50 @@ possibly by using HTTPS.
// Name of the protocol.
name: "taler-exchange";
- // Currency supported by this exchange.
+ // URN of the implementation (needed to interpret 'revision' in version).
+ // @since **v18**, may become mandatory in the future.
+ implementation?: string;
+
+ // Currency supported by this exchange, given
+ // as a currency code ("USD" or "EUR").
currency: string;
+ // How wallets should render this currency.
+ currency_specification: CurrencySpecification;
+
// Names of supported KYC requirements.
supported_kyc_requirements: string[];
}
+ .. ts:def:: CurrencySpecification
+
+ interface CurrencySpecification {
+ // Name of the currency. Like "US Dollar".
+ name: string;
+
+ // Code of the currency.
+ // Deprecated in protocol **v18** for the exchange
+ // and in protocol v6 for the merchant.
+ currency: string;
+
+ // how many digits the user may enter after the decimal_separator
+ num_fractional_input_digits: Integer;
+
+ // Number of fractional digits to render in normal font and size.
+ num_fractional_normal_digits: Integer;
+
+ // Number of fractional digits to render always, if needed by
+ // padding with zeros.
+ num_fractional_trailing_zero_digits: Integer;
+
+ // map of powers of 10 to alternative currency names / symbols, must
+ // always have an entry under "0" that defines the base name,
+ // e.g. "0 => €" or "3 => k€". For BTC, would be "0 => BTC, -3 => mBTC".
+ // Communicates the currency symbol to be used.
+ alt_unit_names: { log10 : string };
+ }
+
.. http:get:: /keys
@@ -114,11 +157,49 @@ possibly by using HTTPS.
// The exchange's currency or asset unit.
currency: string;
+ // How wallets should render this currency.
+ currency_specification: CurrencySpecification;
+
+ // Absolute cost offset for the STEFAN curve used
+ // to (over) approximate fees payable by amount.
+ stefan_abs: Amount;
+
+ // Factor to multiply the logarithm of the amount
+ // with to (over) approximate fees payable by amount.
+ // Note that the total to be paid is first to be
+ // divided by the smallest denomination to obtain
+ // the value that the logarithm is to be taken of.
+ stefan_log: Amount;
+
+ // Linear cost factor for the STEFAN curve used
+ // to (over) approximate fees payable by amount.
+ //
+ // Note that this is a scalar, as it is multiplied
+ // with the actual amount.
+ stefan_lin: Float;
+
// Type of the asset. "fiat", "crypto", "regional"
// or "stock". Wallets should adjust their UI/UX
// based on this value.
asset_type: string;
+ // Array of wire accounts operated by the exchange for
+ // incoming wire transfers.
+ accounts: WireAccount[];
+
+ // Object mapping names of wire methods (i.e. "iban" or "x-taler-bank")
+ // to wire fees.
+ wire_fees: { method : AggregateTransferFee[] };
+
+ // List of exchanges that this exchange is partnering
+ // with to enable wallet-to-wallet transfers.
+ wads: ExchangePartner[];
+
+ // Set to true if this exchange allows the use
+ // of reserves for rewards.
+ // @deprecated in protocol **v18**.
+ rewards_allowed: false;
+
// EdDSA master public key of the exchange, used to sign entries
// in ``denoms`` and ``signkeys``.
master_public_key: EddsaPublicKey;
@@ -133,18 +214,20 @@ possibly by using HTTPS.
// Currency must match ``currency``.
wallet_balance_limit_without_kyc?: Amount[];
- // Denominations offered by this exchange.
- // DEPRECATED: Will eventually be replaced by the
- // differently structured "denominations" field.
- denoms: Denom[];
-
// Denominations offered by this exchange
denominations: DenomGroup[];
- // Compact EdDSA `signature` (binary-only) over the XOR of all
- // .hash fields (in binary) in the list "denominations".
- // Signature of `TALER_ExchangeKeySetPS`
- denominations_sig: EddsaSignature;
+ // Compact EdDSA `signature` (binary-only) over the
+ // contatentation of all of the master_sigs (in reverse
+ // chronological order by group) in the arrays under
+ // "denominations". Signature of `TALER_ExchangeKeySetPS`
+ exchange_sig: EddsaSignature;
+
+ // Public EdDSA key of the exchange that was used to generate the signature.
+ // Should match one of the exchange's signing keys from ``signkeys``. It is given
+ // explicitly as the client might otherwise be confused by clock skew as to
+ // which signing key was used for the ``exchange_sig``.
+ exchange_pub: EddsaPublicKey;
// Denominations for which the exchange currently offers/requests recoup.
recoup: Recoup[];
@@ -170,24 +253,90 @@ possibly by using HTTPS.
// The signature has purpose TALER_SIGNATURE_MASTER_EXTENSIONS.
extensions_sig?: EddsaSignature;
- // Compact EdDSA `signature` (binary-only) over the SHA-512 hash of the
- // concatenation of all SHA-512 hashes of the RSA denomination public keys
- // in ``denoms`` in the same order as they were in ``denoms``. Note that for
- // hashing, the binary format of the RSA public keys is used, and not their
- // `base32 encoding <base32>`. Wallets cannot do much with this signature by itself;
- // it is only useful when multiple clients need to establish that the exchange
- // is sabotaging end-user anonymity by giving disjoint denomination keys to
- // different users. If an exchange were to do this, this signature allows the
- // clients to demonstrate to the public that the exchange is dishonest.
- // Signature of `TALER_ExchangeKeySetPS`
- // DEPRICATED: Will eventually replaced by "denominations_sig"
- eddsa_sig: EddsaSignature;
+ }
+
+ The specification for the account object is:
+
+ .. ts:def:: WireAccount
+
+ interface WireAccount {
+ // ``payto://`` URI identifying the account and wire method
+ payto_uri: string;
+
+ // URI to convert amounts from or to the currency used by
+ // this wire account of the exchange. Missing if no
+ // conversion is applicable.
+ conversion_url?: string;
+
+ // Restrictions that apply to bank accounts that would send
+ // funds to the exchange (crediting this exchange bank account).
+ // Optional, empty array for unrestricted.
+ credit_restrictions: AccountRestriction[];
+
+ // Restrictions that apply to bank accounts that would receive
+ // funds from the exchange (debiting this exchange bank account).
+ // Optional, empty array for unrestricted.
+ debit_restrictions: AccountRestriction[];
+
+ // Signature using the exchange's offline key over
+ // a `TALER_MasterWireDetailsPS`
+ // with purpose ``TALER_SIGNATURE_MASTER_WIRE_DETAILS``.
+ master_sig: EddsaSignature;
+
+ // Display label wallets should use to show this
+ // bank account.
+ // Since protocol **v19**.
+ bank_label?: string;
+
+ // *Signed* integer with the display priority for
+ // this bank account. Optional, 0 if missing.
+ // Since protocol **v19**.
+ priority?: Integer;
+
+ }
+
+ .. ts:def:: AccountRestriction
+
+ type AccountRestriction =
+ | RegexAccountRestriction
+ | DenyAllAccountRestriction
+
+ .. ts:def:: DenyAllAccountRestriction
+
+ // Account restriction that disables this type of
+ // account for the indicated operation categorically.
+ interface DenyAllAccountRestriction {
+
+ type: "deny";
+ }
+
+ .. ts:def:: RegexAccountRestriction
+
+ // Accounts interacting with this type of account
+ // restriction must have a payto://-URI matching
+ // the given regex.
+ interface RegexAccountRestriction {
+
+ type: "regex";
+
+ // Regular expression that the payto://-URI of the
+ // partner account must follow. The regular expression
+ // should follow posix-egrep, but without support for character
+ // classes, GNU extensions, back-references or intervals. See
+ // https://www.gnu.org/software/findutils/manual/html_node/find_html/posix_002degrep-regular-expression-syntax.html
+ // for a description of the posix-egrep syntax. Applications
+ // may support regexes with additional features, but exchanges
+ // must not use such regexes.
+ payto_regex: string;
+
+ // Hint for a human to understand the restriction
+ // (that is hopefully easier to comprehend than the regex itself).
+ human_hint: string;
+
+ // Map from IETF BCP 47 language tags to localized
+ // human hints.
+ human_hint_i18n?: { [lang_tag: string]: string };
- // Public EdDSA key of the exchange that was used to generate the signature.
- // Should match one of the exchange's signing keys from ``/keys``. It is given
- // explicitly as the client might otherwise be confused by clock skew as to
- // which signing key was used.
- eddsa_pub: EddsaPublicKey;
}
.. ts:def:: GlobalFees
@@ -237,7 +386,6 @@ possibly by using HTTPS.
}
-
.. ts:def:: AgeMask
// Binary representation of the age groups.
@@ -323,10 +471,6 @@ possibly by using HTTPS.
// Fee charged by the exchange for refunding a coin of this denomination.
fee_refund: Amount;
- // XOR of all the SHA-512 hash values of the denominations' public keys
- // in this group. Note that for hashing, the binary format of the
- // public keys is used, and not their base32 encoding.
- hash: HashCode;
}
.. ts:def:: DenomCommon
@@ -338,51 +482,27 @@ possibly by using HTTPS.
// When does the denomination key become valid?
stamp_start: Timestamp;
- // When is it no longer possible to deposit coins
+ // When is it no longer possible to withdraw coins
// of this denomination?
stamp_expire_withdraw: Timestamp;
- // Timestamp indicating by when legal disputes relating to these coins must
- // be settled, as the exchange will afterwards destroy its evidence relating to
- // transactions involving this coin.
- stamp_expire_legal: Timestamp;
- }
-
- .. ts:def:: Denom
-
- interface Denom {
- // How much are coins of this denomination worth?
- value: Amount;
-
- // When does the denomination key become valid?
- stamp_start: Timestamp;
-
// When is it no longer possible to deposit coins
// of this denomination?
- stamp_expire_withdraw: Timestamp;
+ stamp_expire_deposit: Timestamp;
// Timestamp indicating by when legal disputes relating to these coins must
// be settled, as the exchange will afterwards destroy its evidence relating to
// transactions involving this coin.
stamp_expire_legal: Timestamp;
- // Public key for the denomination.
- denom_pub: DenominationKey;
-
- // Fee charged by the exchange for withdrawing a coin of this denomination.
- fee_withdraw: Amount;
-
- // Fee charged by the exchange for depositing a coin of this denomination.
- fee_deposit: Amount;
-
- // Fee charged by the exchange for refreshing a coin of this denomination.
- fee_refresh: Amount;
-
- // Fee charged by the exchange for refunding a coin of this denomination.
- fee_refund: Amount;
-
- // Signature of `TALER_DenominationKeyValidityPS`.
- master_sig: EddsaSignature;
+ // Set to 'true' if the exchange somehow "lost"
+ // the private key. The denomination was not
+ // necessarily revoked, but still cannot be used
+ // to withdraw coins at this time (theoretically,
+ // the private key could be recovered in the
+ // future; coins signed with the private key
+ // remain valid).
+ lost?: boolean;
}
.. ts:def:: DenominationKey
@@ -506,53 +626,6 @@ possibly by using HTTPS.
Both the individual denominations *and* the denomination list is signed,
allowing customers to prove that they received an inconsistent list.
-.. _wire-req:
-
-.. http:get:: /wire
-
- Returns a list of payment methods supported by the exchange. The idea is that wallets may use this information to instruct users on how to perform wire transfers to top up their wallets.
-
- **Response:**
-
- :http:statuscode:`200 OK`:
- The exchange responds with a `WireResponse` object. This request should virtually always be successful.
-
- **Details:**
-
- .. ts:def:: WireResponse
-
- interface WireResponse {
-
- // Master public key of the exchange, must match the key returned in ``/keys``.
- master_public_key: EddsaPublicKey;
-
- // Array of wire accounts operated by the exchange for
- // incoming wire transfers.
- accounts: WireAccount[];
-
- // Object mapping names of wire methods (i.e. "iban" or "x-taler-bank")
- // to wire fees.
- fees: { method : AggregateTransferFee };
-
- // List of exchanges that this exchange is partnering
- // with to enable wallet-to-wallet transfers.
- wads: ExchangePartner[];
- }
-
- The specification for the account object is:
-
- .. ts:def:: WireAccount
-
- interface WireAccount {
- // ``payto://`` URI identifying the account and wire method
- payto_uri: string;
-
- // Signature using the exchange's offline key over
- // a `TALER_MasterWireDetailsPS`
- // with purpose ``TALER_SIGNATURE_MASTER_WIRE_DETAILS``.
- master_sig: EddsaSignature;
- }
-
Aggregate wire transfer fees representing the fees the exchange
charges per wire transfer to a merchant must be specified as an
array in all wire transfer response objects under ``fees``. The
@@ -567,9 +640,6 @@ possibly by using HTTPS.
// Per transfer closing fee.
closing_fee: Amount;
- // Per exchange-to-exchange transfer (wad) fee.
- wad_fee: Amount;
-
// What date (inclusive) does this fee go into effect?
// The different fees must cover the full time period in which
// any of the denomination keys are valid without overlap.
@@ -594,6 +664,9 @@ possibly by using HTTPS.
// Public master key of the partner exchange.
partner_master_pub: EddsaPublicKey;
+ // Per exchange-to-exchange transfer (wad) fee.
+ wad_fee: Amount;
+
// Exchange-to-exchange wad (wire) transfer frequency.
wad_frequency: RelativeTime;
@@ -678,8 +751,8 @@ Management operations authorized by master key
// transactions involving this coin.
stamp_expire_legal: Timestamp;
- // Public (RSA) key for the denomination.
- denom_pub: RsaPublicKey;
+ // Public key for the denomination.
+ denom_pub: DenominationKey;
// Fee charged by the exchange for withdrawing a coin of this denomination.
fee_withdraw: Amount;
@@ -760,7 +833,7 @@ Management operations authorized by master key
interface DenomSignature {
- // Hash of the public (RSA) key of the denomination.
+ // Hash of the public key of the denomination.
h_denom_pub: HashCode;
// Signature over `TALER_DenominationKeyValidityPS`.
@@ -1040,6 +1113,16 @@ Management operations authorized by master key
// become active immediately! Used ONLY to detect replay attacks.
validity_start: Timestamp;
+ // Display label wallets should use to show this
+ // bank account.
+ // Since protocol **v19**.
+ bank_label?: string;
+
+ // *Signed* integer with the display priority for
+ // this bank account.
+ // Since protocol **v19**.
+ priority?: Integer;
+
}
.. http:post:: /management/wire/disable
@@ -1335,6 +1418,7 @@ and freeze or unfreeze accounts suspected of money laundering.
// What was the justification given?
justification: string;
+ // FIXME: review!
// What is the new AML state.
new_state: Integer;
@@ -1355,6 +1439,7 @@ and freeze or unfreeze accounts suspected of money laundering.
// Name of the configuration section that specifies the provider
// which was used to collect the KYC details
+ // FIXME: review!
provider_section: string;
// The collected KYC data. NULL if the attribute data could not
@@ -1414,8 +1499,7 @@ and freeze or unfreeze accounts suspected of money laundering.
// Numerical values are defined in `AmlDecisionState`.
new_state: Integer;
- // Signature by the AML officer over a
- // `TALER_MasterAmlOfficerStatusPS`.
+ // Signature by the AML officer over a `TALER_AmlDecisionPS`.
// Must have purpose ``TALER_SIGNATURE_MASTER_AML_KEY``.
officer_sig: EddsaSignature;
@@ -1500,6 +1584,7 @@ This part of the API is for the use by auditors interacting with the exchange.
}
+.. _exchange-withdrawal:
----------
Withdrawal
@@ -1524,7 +1609,7 @@ exchange.
.. http:get:: /reserves/$RESERVE_PUB
- Request information about a reserve.
+ Request summary information about a reserve.
**Request:**
@@ -1555,417 +1640,6 @@ exchange.
}
-.. http:post:: /reserves/$RESERVE_PUB/status
-
- Request information about a reserve or an account.
-
- **Request:**
-
- The request body must be a `ReserveStatusRequest` object.
-
- **Response:**
-
- :http:statuscode:`200 OK`:
- The exchange responds with a `ReserveStatus` object; the reserve was known to the exchange.
- :http:statuscode:`403 Forbidden`:
- The *TALER_SIGNATURE_RESERVE_STATUS_REQUEST* signature is invalid.
- This response comes with a standard `ErrorDetail` response. Alternatively, the provided timestamp is not close to the current time.
- :http:statuscode:`404 Not found`:
- The reserve key does not belong to a reserve known to the exchange.
-
- **Details:**
-
- .. ts:def:: ReserveStatusRequest
-
- interface ReserveStatusRequest {
- // Signature of purpose
- // ``TALER_SIGNATURE_RESERVE_STATUS_REQUEST`` over
- // a `TALER_ReserveStatusRequestSignaturePS`.
- reserve_sig: EddsaSignature;
-
- // Time when the client made the request.
- // Timestamp must be reasonably close to the time of
- // the exchange, otherwise the exchange may reject
- // the request.
- request_timestamp: Timestamp;
- }
-
- .. ts:def:: ReserveStatus
-
- interface ReserveStatus {
- // Balance left in the reserve.
- balance: Amount;
-
- // If set, gives the maximum age group that the client is required to set
- // during withdrawal.
- maximum_age_group: number;
-
- // Transaction history for this reserve.
- // May be partial (!).
- history: TransactionHistoryItem[];
- }
-
- Objects in the transaction history have the following format:
-
- .. ts:def:: TransactionHistoryItem
-
- // Union discriminated by the "type" field.
- type TransactionHistoryItem =
- | AccountSetupTransaction
- | ReserveHistoryTransaction
- | ReserveWithdrawTransaction
- | ReserveAgeWithdrawTransaction
- | ReserveCreditTransaction
- | ReserveClosingTransaction
- | ReserveOpenRequestTransaction
- | ReserveCloseRequestTransaction
- | PurseMergeTransaction;
-
- .. ts:def:: AccountSetupTransaction
-
- interface AccountSetupTransaction {
- type: "SETUP";
-
- // KYC fee agreed to by the reserve owner.
- kyc_fee: Amount;
-
- // Time when the KYC was triggered.
- kyc_timestamp: Timestamp;
-
- // Hash of the wire details of the account.
- // Note that this hash is unsalted and potentially
- // private (as it could be inverted), hence access
- // to this endpoint must be authorized using the
- // private key of the reserve.
- h_wire: HashCode;
-
- // Signature created with the reserve's private key.
- // Must be of purpose ``TALER_SIGNATURE_ACCOUNT_SETUP_REQUEST`` over
- // a ``TALER_AccountSetupRequestSignaturePS``.
- reserve_sig: EddsaSignature;
-
- }
-
- .. ts:def:: ReserveHistoryTransaction
-
- interface ReserveHistoryTransaction {
- type: "HISTORY";
-
- // Fee agreed to by the reserve owner.
- amount: Amount;
-
- // Time when the request was made.
- request_timestamp: Timestamp;
-
- // Signature created with the reserve's private key.
- // Must be of purpose ``TALER_SIGNATURE_RESERVE_HISTORY_REQUEST`` over
- // a `TALER_ReserveHistoryRequestSignaturePS`.
- reserve_sig: EddsaSignature;
-
- }
-
- .. ts:def:: ReserveWithdrawTransaction
-
- interface ReserveWithdrawTransaction {
- type: "WITHDRAW";
-
- // Amount withdrawn.
- amount: Amount;
-
- // Hash of the denomination public key of the coin.
- h_denom_pub: HashCode;
-
- // Hash of the blinded coin to be signed.
- h_coin_envelope: HashCode;
-
- // Signature over a `TALER_WithdrawRequestPS`
- // with purpose ``TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW``
- // created with the reserve's private key.
- reserve_sig: EddsaSignature;
-
- // Fee that is charged for withdraw.
- withdraw_fee: Amount;
- }
-
- .. ts:def:: ReserveAgeWithdrawTransaction
-
- interface ReserveAgeWithdrawTransaction {
- type: "AGEWITHDRAW";
-
- // Total Amount withdrawn.
- amount: Amount;
-
- // Commitment of all ``n*kappa`` blinded coins.
- h_commitment: HashCode;
-
- // Signature over a `TALER_AgeWithdrawRequestPS`
- // with purpose ``TALER_SIGNATURE_WALLET_RESERVE_AGE_WITHDRAW``
- // created with the reserve's private key.
- reserve_sig: EddsaSignature;
-
- // Fee that is charged for withdraw.
- withdraw_fee: Amount;
- }
-
-
- .. ts:def:: ReserveCreditTransaction
-
- interface ReserveCreditTransaction {
- type: "CREDIT";
-
- // Amount deposited.
- amount: Amount;
-
- // Sender account ``payto://`` URL.
- sender_account_url: string;
-
- // Opaque identifier internal to the exchange that
- // uniquely identifies the wire transfer that credited the reserve.
- wire_reference: Integer;
-
- // Timestamp of the incoming wire transfer.
- timestamp: Timestamp;
- }
-
-
- .. ts:def:: ReserveClosingTransaction
-
- interface ReserveClosingTransaction {
- type: "CLOSING";
-
- // Closing balance.
- amount: Amount;
-
- // Closing fee charged by the exchange.
- closing_fee: Amount;
-
- // Wire transfer subject.
- wtid: Base32;
-
- // ``payto://`` URI of the wire account into which the funds were returned to.
- receiver_account_details: string;
-
- // This is a signature over a
- // struct `TALER_ReserveCloseConfirmationPS` with purpose
- // ``TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED``.
- exchange_sig: EddsaSignature;
-
- // Public key used to create 'exchange_sig'.
- exchange_pub: EddsaPublicKey;
-
- // Time when the reserve was closed.
- timestamp: Timestamp;
- }
-
-
- .. ts:def:: ReserveOpenRequestTransaction
-
- interface ReserveOpenRequestTransaction {
- type: "OPEN";
-
- // Open fee paid from the reserve.
- open_fee: Amount;
-
- // This is a signature over
- // a struct `TALER_ReserveOpenPS` with purpose
- // ``TALER_SIGNATURE_WALLET_RESERVE_OPEN``.
- reserve_sig: EddsaSignature;
-
- // Timestamp of the open request.
- request_timestamp: Timestamp;
-
- // Requested expiration.
- requested_expiration: Timestamp;
-
- // Requested number of free open purses.
- requested_min_purses: Integer;
-
- }
-
- .. ts:def:: ReserveCloseRequestTransaction
-
- interface ReserveCloseRequestTransaction {
- type: "CLOSE";
-
- // This is a signature over
- // a struct `TALER_ReserveClosePS` with purpose
- // ``TALER_SIGNATURE_WALLET_RESERVE_CLOSE``.
- reserve_sig: EddsaSignature;
-
- // Target account ``payto://``, optional.
- h_payto?: PaytoHash;
-
- // Timestamp of the close request.
- request_timestamp: Timestamp;
- }
-
- .. ts:def:: ReserveCreditTransaction
-
- interface ReserveCreditTransaction {
- type: "CREDIT";
-
- // Amount deposited.
- amount: Amount;
-
- // Sender account ``payto://`` URL.
- sender_account_url: string;
-
- // Opaque identifier internal to the exchange that
- // uniquely identifies the wire transfer that credited the reserve.
- wire_reference: Integer;
-
- // Timestamp of the incoming wire transfer.
- timestamp: Timestamp;
- }
-
- .. ts:def:: PurseMergeTransaction
-
- interface PurseMergeTransaction {
- type: "MERGE";
-
- // SHA-512 hash of the contact of the purse.
- h_contract_terms: HashCode;
-
- // EdDSA public key used to approve merges of this purse.
- merge_pub: EddsaPublicKey;
-
- // Minimum age required for all coins deposited into the purse.
- min_age: Integer;
-
- // Number that identifies who created the purse
- // and how it was paid for.
- flags: Integer;
-
- // Purse public key.
- purse_pub: EddsaPublicKey;
-
- // EdDSA signature of the account/reserve affirming the merge
- // over a `TALER_AccountMergeSignaturePS`.
- // Must be of purpose ``TALER_SIGNATURE_ACCOUNT_MERGE``
- reserve_sig: EddsaSignature;
-
- // Client-side timestamp of when the merge request was made.
- merge_timestamp: Timestamp;
-
- // Indicative time by which the purse should expire
- // if it has not been merged into an account. At this
- // point, all of the deposits made should be
- // auto-refunded.
- purse_expiration: Timestamp;
-
- // Purse fee the reserve owner paid for the purse creation.
- purse_fee: Amount;
-
- // Total amount merged into the reserve.
- // (excludes fees).
- amount: Amount;
-
- // True if the purse was actually merged.
- // If false, only the purse_fee has an impact
- // on the reserve balance!
- merged: boolean;
- }
-
-
-.. http:post:: /reserves/$RESERVE_PUB/history
-
- Request information about the full history of
- a reserve or an account.
-
- **Request:**
-
- The request body must be a `ReserveHistoryRequest` object.
-
- **Response:**
-
- :http:statuscode:`200 OK`:
- The exchange responds with a `ReserveStatus` object; the reserve was known to the exchange.
- :http:statuscode:`403 Forbidden`:
- The *TALER_SIGNATURE_RESERVE_HISTORY_REQUEST* is invalid.
- This response comes with a standard `ErrorDetail` response. Alternatively, the provided timestamp is not close to the current time.
- :http:statuscode:`404 Not found`:
- The reserve key does not belong to a reserve known to the exchange.
- :http:statuscode:`412 Precondition failed`:
- The balance in the reserve is insufficient to pay for the history request.
- This response comes with a standard `ErrorDetail` response.
-
- **Details:**
-
- .. ts:def:: ReserveHistoryRequest
-
- interface ReserveHistoryRequest {
- // Signature of type
- // ``TALER_SIGNATURE_RESERVE_HISTORY_REQUEST``
- // over a `TALER_ReserveHistoryRequestSignaturePS`.
- reserve_sig: EddsaSignature;
-
- // Time when the client made the request.
- // Timestamp must be reasonably close to the time of
- // the exchange, otherwise the exchange may reject
- // the request.
- request_timestamp: Timestamp;
- }
-
-
-.. _delete-reserve:
-
-.. http:DELETE:: /reserves/$RESERVE_PUB
-
- Forcefully closes a reserve.
- The request header must contain an *Account-Request-Signature*.
- Note: this endpoint is not currently implemented!
-
- **Request:**
-
- *Account-Request-Signature*: The client must provide Base-32 encoded EdDSA signature made with ``$ACCOUNT_PRIV``, affirming its authorization to delete the account. The purpose used MUST be ``TALER_SIGNATURE_RESERVE_CLOSE``.
-
- :query force=BOOLEAN: *Optional.* If set to 'true' specified, the exchange
- will delete the account even if there is a balance remaining.
-
- **Response:**
-
- :http:statuscode:`200 OK`:
- The operation succeeded, the exchange provides details
- about the account deletion.
- The response will include a `ReserveClosedResponse` object.
- :http:statuscode:`403 Forbidden`:
- The *Account-Request-Signature* is invalid.
- This response comes with a standard `ErrorDetail` response.
- :http:statuscode:`404 Not found`:
- The account is unknown to the exchange.
- :http:statuscode:`409 Conflict`:
- The account is still has digital cash in it, the associated
- wire method is ``void`` and the *force* option was not provided.
- This response comes with a standard `ErrorDetail` response.
-
- **Details:**
-
- .. ts:def:: ReserveClosedResponse
-
- interface ReserveClosedResponse {
-
- // Final balance of the account.
- closing_amount: Amount;
-
- // Current time of the exchange, used as part of
- // what the exchange signs over.
- close_time: Timestamp;
-
- // Hash of the wire account into which the remaining
- // balance will be transferred. Note: may be the
- // hash over ``payto://void/`, in which case the
- // balance is forfeit to the profit of the exchange.
- h_wire: HashCode;
-
- // This is a signature over a
- // struct ``TALER_AccountDeleteConfirmationPS`` with purpose
- // ``TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED``.
- exchange_sig: EddsaSignature;
-
- }
-
-
-
Withdraw
~~~~~~~~
@@ -2011,7 +1685,7 @@ Withdraw
.. ts:def:: WithdrawPrepareResponse
- type WithdrawPrepareResponse
+ type WithdrawPrepareResponse =
| ExchangeWithdrawValue;
.. ts:def:: ExchangeWithdrawValue
@@ -2039,28 +1713,31 @@ Withdraw
}
-.. http:post:: /reserves/$RESERVE_PUB/withdraw
+Batch Withdraw
+~~~~~~~~~~~~~~
+
+.. http:post:: /reserves/$RESERVE_PUB/batch-withdraw
- Withdraw a coin of the specified denomination. Note that the client should
- commit all of the request details, including the private key of the coin and
- the blinding factor, to disk *before* issuing this request, so that it can
+ Withdraw multiple coins from the same reserve. Note that the client should
+ commit all of the request details, including the private key of the coins and
+ the blinding factors, to disk *before* issuing this request, so that it can
recover the information if necessary in case of transient failures, like
power outage, network outage, etc.
- **Request:** The request body must be a `WithdrawRequest` object.
+ **Request:** The request body must be a `BatchWithdrawRequest` object.
**Response:**
:http:statuscode:`200 OK`:
- The request was successful, and the response is a `WithdrawResponse`. Note that repeating exactly the same request
- will again yield the same response, so if the network goes down during the
- transaction or before the client can commit the coin signature to disk, the
- coin is not lost.
+ The request was successful, and the response is a `BatchWithdrawResponse`.
+ Note that repeating exactly the same request will again yield the same
+ response, so if the network goes down during the transaction or before the
+ client can commit the coin signature to disk, the coin is not lost.
:http:statuscode:`403 Forbidden`:
- The signature is invalid.
+ A signature is invalid.
This response comes with a standard `ErrorDetail` response.
:http:statuscode:`404 Not found`:
- The denomination key or the reserve are not known to the exchange. If the
+ A denomination key or the reserve are not known to the exchange. If the
denomination key is unknown, this suggests a bug in the wallet as the
wallet should have used current denomination keys from ``/keys``.
In this case, the response will be a `DenominationUnknownMessage`.
@@ -2070,14 +1747,19 @@ Withdraw
In this case, the wallet should repeat the exact same request later again
using exactly the same blinded coin.
:http:statuscode:`409 Conflict`:
- The balance of the reserve is not sufficient to withdraw a coin of the indicated denomination.
- The response is `WithdrawError` object.
+ One of the following reasons occured:
+
+ 1. The balance of the reserve is not sufficient to withdraw the coins of the
+ indicated denominations. The response is `WithdrawError` object.
+
+ 2. The reserve has a birthday set and requires a request to ``/age-withdraw`` instead.
+ The response comes with a standard `ErrorDetail` response with error-code ``TALER_EC_EXCHANGE_RESERVES_AGE_RESTRICTION_REQUIRED`` and an additional field ``maximum_allowed_age`` for the maximum age (in years) that the client can commit to in the call to ``/age-withdraw``
:http:statuscode:`410 Gone`:
- The requested denomination key is not yet or no longer valid.
- It either before the validity start, past the expiration or was revoked. The response is a
- `DenominationExpiredMessage`. Clients must evaluate
- the error code provided to understand which of the
- cases this is and handle it accordingly.
+ A requested denomination key is not yet or no longer valid.
+ It either before the validity start, past the expiration or was revoked.
+ The response is a `DenominationExpiredMessage`. Clients must evaluate the
+ error code provided to understand which of the cases this is and handle it
+ accordingly.
:http:statuscode:`451 Unavailable for Legal Reasons`:
This reserve has received funds from a purse or the amount withdrawn
exceeds another legal threshold and thus the reserve must
@@ -2100,41 +1782,18 @@ Withdraw
**Details:**
- .. ts:def:: DenominationExpiredMessage
-
- interface DenominationExpiredMessage {
-
- // Taler error code. Note that beyond
- // expiration this message format is also
- // used if the key is not yet valid, or
- // has been revoked.
- code: number;
-
- // Signature by the exchange over a
- // `TALER_DenominationExpiredAffirmationPS`.
- // Must have purpose ``TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_EXPIRED``.
- exchange_sig: EddsaSignature;
-
- // Public key of the exchange used to create
- // the 'exchange_sig.
- exchange_pub: EddsaPublicKey;
-
- // Hash of the denomination public key that is unknown.
- h_denom_pub: HashCode;
+ .. ts:def:: BatchWithdrawRequest
- // When was the signature created.
- timestamp: Timestamp;
+ interface BatchWithdrawRequest {
+ // Array of requests for the individual coins to withdraw.
+ planchets: WithdrawRequest[];
- // What kind of operation was requested that now
- // failed?
- oper: string;
}
-
.. ts:def:: WithdrawRequest
interface WithdrawRequest {
- // Hash of a denomination public key (RSA), specifying the type of coin the client
+ // Hash of a denomination public key, specifying the type of coin the client
// would like the exchange to create.
denom_pub_hash: HashCode;
@@ -2149,6 +1808,16 @@ Withdraw
}
+
+ .. ts:def:: BatchWithdrawResponse
+
+ interface BatchWithdrawResponse {
+ // Array of blinded signatures, in the same order as was
+ // given in the request.
+ ev_sigs: WithdrawResponse[];
+
+ }
+
.. ts:def:: WithdrawResponse
interface WithdrawResponse {
@@ -2228,91 +1897,39 @@ Withdraw
history: TransactionHistoryItem[]
}
+ .. ts:def:: DenominationExpiredMessage
+ interface DenominationExpiredMessage {
+ // Taler error code. Note that beyond
+ // expiration this message format is also
+ // used if the key is not yet valid, or
+ // has been revoked.
+ code: number;
-Batch Withdraw
-~~~~~~~~~~~~~~
-
-
-.. http:post:: /reserves/$RESERVE_PUB/batch-withdraw
-
- Withdraw multiple coins from the same reserve. Note that the client should
- commit all of the request details, including the private key of the coins and
- the blinding factors, to disk *before* issuing this request, so that it can
- recover the information if necessary in case of transient failures, like
- power outage, network outage, etc.
-
- **Request:** The request body must be a `BatchWithdrawRequest` object.
-
- **Response:**
-
- :http:statuscode:`200 OK`:
- The request was successful, and the response is a `BatchWithdrawResponse`.
- Note that repeating exactly the same request will again yield the same
- response, so if the network goes down during the transaction or before the
- client can commit the coin signature to disk, the coin is not lost.
- :http:statuscode:`403 Forbidden`:
- A signature is invalid.
- This response comes with a standard `ErrorDetail` response.
- :http:statuscode:`404 Not found`:
- A denomination key or the reserve are not known to the exchange. If the
- denomination key is unknown, this suggests a bug in the wallet as the
- wallet should have used current denomination keys from ``/keys``.
- In this case, the response will be a `DenominationUnknownMessage`.
- If the reserve is unknown, the wallet should not report a hard error yet, but
- instead simply wait for up to a day, as the wire transaction might simply
- not yet have completed and might be known to the exchange in the near future.
- In this case, the wallet should repeat the exact same request later again
- using exactly the same blinded coin.
- :http:statuscode:`409 Conflict`:
- The balance of the reserve is not sufficient to withdraw the coins of the
- indicated denominations. The response is `WithdrawError` object.
- :http:statuscode:`410 Gone`:
- A requested denomination key is not yet or no longer valid.
- It either before the validity start, past the expiration or was revoked.
- The response is a `DenominationExpiredMessage`. Clients must evaluate the
- error code provided to understand which of the cases this is and handle it
- accordingly.
- :http:statuscode:`451 Unavailable for Legal Reasons`:
- This reserve has received funds from a purse or the amount withdrawn
- exceeds another legal threshold and thus the reserve must
- be upgraded to an account (with KYC) before the withdraw can
- complete. Note that this response does NOT affirm that the
- withdraw will ultimately complete with the requested amount.
- The user should be redirected to the provided location to perform
- the required KYC checks to open the account before withdrawing.
- Afterwards, the request should be repeated.
- The response will be an `KycNeededRedirect` object.
-
- Implementation note: internally, we need to
- distinguish between upgrading the reserve to an
- account (due to P2P payment) and identifying the
- owner of the origin bank account (due to exceeding
- the withdraw amount threshold), as we need to create
- a different payto://-URI for the KYC check depending
- on the case.
-
+ // Signature by the exchange over a
+ // `TALER_DenominationExpiredAffirmationPS`.
+ // Must have purpose ``TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_EXPIRED``.
+ exchange_sig: EddsaSignature;
- **Details:**
+ // Public key of the exchange used to create
+ // the 'exchange_sig.
+ exchange_pub: EddsaPublicKey;
- .. ts:def:: BatchWithdrawRequest
+ // Hash of the denomination public key that is unknown.
+ h_denom_pub: HashCode;
- interface BatchWithdrawRequest {
- // Array of requests for the individual coins to withdraw.
- planchets: WithdrawRequest[];
+ // When was the signature created.
+ timestamp: Timestamp;
+ // What kind of operation was requested that now
+ // failed?
+ oper: string;
}
- .. ts:def:: BatchWithdrawResponse
- interface BatchWithdrawResponse {
- // Array of blinded signatures, in the same order as was
- // given in the request.
- ev_sigs: WithdrawResponse[];
- }
Withdraw with Age Restriction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2326,7 +1943,7 @@ coins along with their age commitments to proof that they were appropriate.
If so, the exchange will blindly sign ``n`` undisclosed coins from the request.
-.. http:POST:: /reserves/$RESERVE_PUB/age-withdraw
+.. http:post:: /reserves/$RESERVE_PUB/age-withdraw
Withdraw multiple coins *with age restriction* from the same reserve.
Note that the client should commit all of the request details, including the
@@ -2347,8 +1964,13 @@ If so, the exchange will blindly sign ``n`` undisclosed coins from the request.
A signature is invalid.
This response comes with a standard `ErrorDetail` response.
:http:statuscode:`409 Conflict`:
- The balance of the reserve is not sufficient to withdraw the coins of the
+ One of two reasons occured:
+
+ 1. The balance of the reserve is not sufficient to withdraw the coins of the
given amount. The response is a `WithdrawError` object.
+
+ 2. The provided value for ``max_age`` is higher than the allowed value according to the reserve's birthday.
+ The response comes with a standard `ErrorDetail` response with error-code ``TALER_EC_EXCHANGE_AGE_WITHDRAW_MAXIMUM_AGE_TOO_LARGE`` and an additional field ``maximum_allowed_age`` for the maximum age (in years) that the client can commit to in a call to ``/age-withdraw``
:http:statuscode:`410 Gone`:
A requested denomination key is not yet or no longer valid.
It either before the validity start, past the expiration or was revoked.
@@ -2369,20 +1991,21 @@ If so, the exchange will blindly sign ``n`` undisclosed coins from the request.
.. ts:def:: AgeWithdrawRequest
interface AgeWithdrawRequest {
- // Commitment to the coins with age restriction. This is the SHA512
- // hash value $ACH over all n*kappa `BlindedCoinHash` values of all
- // coins and their age commitments. It is alter used as part of the URL
- // in the subsequent call to /age-withdraw/$ACH/reveal.
- h_commitment : HashCode;
-
- // The total amount that the client wants to withdraw from the reserve
- // and must be at most the balance of the reserve. The balance of the
- // reserve will be immediatley reduced by that amount.
- // In the subsequent call to /age-withdraw/$ACH/reveal, the client has to
- // provide the list of denominations (with support for age restriction)
- // that the coins shall be signed with. The sum of the values of those
- // denominations MUST equal this amount.
- amount: Amount;
+ // Array of ``n`` hash codes of denomination public keys to order.
+ // These denominations MUST support age restriction as defined in the
+ // output to /keys.
+ // The sum of all denomination's values and fees MUST be at most the
+ // balance of the reserve. The balance of the reserve will be
+ // immediatley reduced by that amount.
+ denoms_h: HashCode[];
+
+ // ``n`` arrays of ``kappa`` entries with blinded coin envelopes. Each
+ // (toplevel) entry represents ``kappa`` canditates for a particular
+ // coin. The exchange will respond with an index ``gamma``, which is
+ // the index that shall remain undisclosed during the reveal phase.
+ // The SHA512 hash $ACH over the blinded coin envelopes is the commitment
+ // that is later used as the key to the reveal-URL.
+ blinded_coins_evs: CoinEnvelope[][];
// The maximum age to commit to. MUST be the same as the maximum
// age in the reserve.
@@ -2401,7 +2024,7 @@ If so, the exchange will blindly sign ``n`` undisclosed coins from the request.
// have to disclose
noreveal_index: Integer;
- // Signature of `TALER_AgeWithdrawRequestPS` whereby
+ // Signature of `TALER_AgeWithdrawConfirmationPS` whereby
// the exchange confirms the ``noreveal_index``.
exchange_sig: EddsaSignature;
@@ -2414,7 +2037,7 @@ If so, the exchange will blindly sign ``n`` undisclosed coins from the request.
-.. http:POST:: /age-withdraw/$ACH/reveal
+.. http:post:: /age-withdraw/$ACH/reveal
The client has previously committed to multiple coins with age restriction
in a call to ``/reserve/$RESERVE_PUB/age-withdraw`` and got a
@@ -2430,7 +2053,7 @@ If so, the exchange will blindly sign ``n`` undisclosed coins from the request.
**Response:**
:http:statuscode:`200 OK`:
- The request was successful, and the response is a `RevealResponse`.
+ The request was successful, and the response is a `AgeWithdrawRevealResponse`.
Note that repeating exactly the same request will again yield the same
response, so if the network goes down during the transaction or before the
client can commit the coin signature to disk, the coin is not lost.
@@ -2440,71 +2063,52 @@ If so, the exchange will blindly sign ``n`` undisclosed coins from the request.
The reveal operation failed and the response is an `WithdrawError` object.
The error codes indicate one of two cases:
- 1. An age commitment for one of the coins did not fulfill the required
- maximum age requirement of the corresponding reserve. Error code:
+ 1. An age commitment for at least one of the coins did not fulfill the
+ required maximum age requirement of the corresponding reserve.
+ Error code:
``TALER_EC_EXCHANGE_GENERIC_COIN_AGE_REQUIREMENT_FAILURE``.
- 2. The sum of all denominations in the request is not equal to the amount
- that was given in the previous commitment via the call to
- /reserves/$RESERVE_PUB/age-withdraw. Error code:
- ``TALER_EC_EXCHANGE_GENERIC_MISMATCH_OF_AMOUNT_AND_DENOMINATIONS``.
+ 2. The computation of the hash of the commitment with provided input does
+ result in the value $ACH.
+ Error code:
+ ``TALER_EC_EXCHANGE_AGE_WITHDRAW_REVEAL_INVALID_HASH``
.. ts:def:: AgeWithdrawRevealRequest
interface AgeWithdrawRevealRequest {
- // The public key of the reserve that was used for the initial commitment
- // request. Needed for optimized database lookup.
- reserve_pub: EddsaPublicKey;
-
- // Array of ``n`` hash codes of denomination public keys to order.
- // These denominations MUST support age restriction as defined in the
- // output to /keys.
- // The sum of all denomination's values MUST equal the original amount
- // of the previous commitment.
- denoms_h: HashCode[];
-
- // Array of ``n`` entries with blinded coins, which are the non-desclosed
- // coins in the previous commitment. They match the respective entries
- // in ``denoms_h``.
- coin_evs: CoinEnvelope[];
-
- // Array of ``n`` of ``(kappa - 1)`` disclosed coin secrets, from
- // which the coins' private key ``coin_priv``, blinding ``beta`` and nonce
- // ``nonce`` (for Clause-Schnorr) itself are derived as usually in wallet
- // core.
- // (TODO: description of the derivation process of the coin's private
- // key, blinding and nonce).
- //
- // Given a coin's secret, the age commitment for the coin MUST be
- // derived from this private key as follows:
- //
- // Let m ∈ {1,...,M} be the maximum age group as defined in the reserve
- // that the wallet can commit to.
- //
- // For age group $AG ∈ {1,...m}, set
- // seed = HDKF(coin_secret, "age-commitment", $AG)
- // p[$AG] = Edx25519_generate_private(seed)
- // and calculate the corresponding Edx25519PublicKey as
- // q[$AG] = Edx25519_public_from_private(p[$AG])
+ // Array of ``n`` of ``(kappa - 1)`` disclosed coin master secrets, from
+ // which the coins' private key, blinding, nonce (for Clause-Schnorr) and
+ // age-restriction is calculated.
//
- // For age groups $AG ∈ {m,...,M}, set
- // f[$AG] = HDKF(coin_secret, "age-factor", $AG)
- // and calculate the corresponding Edx25519PublicKey as
- // q[$AG] = Edx25519_derive_public(`PublishedAgeRestrictionBaseKey`, f[$AG])
- //
- // Given each coin's private key and age commitment (``q[]``), the
- // exchange will calculate each coin's blinded hash value und use all
- // those (disclosed) blinded hashes together with the non-disclosed
- // envelopes ``coin_evs`` during the verification of the original
- // age-withdraw-commitment.
+ // Given each coin's private key and age commitment, the exchange will
+ // calculate each coin's blinded hash value und use all those (disclosed)
+ // blinded hashes together with the non-disclosed envelopes ``coin_evs``
+ // during the verification of the original age-withdraw-commitment.
disclosed_coin_secrets: AgeRestrictedCoinSecret[][];
-
}
.. ts:def:: AgeRestrictedCoinSecret
- // The Master key material for the derivation of age restricted private
- // coins, blinding factors and age restrictions
+ // The Master key material from which the coins' private key ``coin_priv``,
+ // blinding ``beta`` and nonce ``nonce`` (for Clause-Schnorr) itself are
+ // derived as usually in wallet-core. Given a coin's master key material,
+ // the age commitment for the coin MUST be derived from this private key as
+ // follows:
+ //
+ // Let m ∈ {1,...,M} be the maximum age group as defined in the reserve
+ // that the wallet can commit to.
+ //
+ // For age group $AG ∈ {1,...m}, set
+ // seed = HDKF(coin_secret, "age-commitment", $AG)
+ // p[$AG] = Edx25519_generate_private(seed)
+ // and calculate the corresponding Edx25519PublicKey as
+ // q[$AG] = Edx25519_public_from_private(p[$AG])
+ //
+ // For age groups $AG ∈ {m,...,M}, set
+ // f[$AG] = HDKF(coin_secret, "age-factor", $AG)
+ // and calculate the corresponding Edx25519PublicKey as
+ // q[$AG] = Edx25519_derive_public(`PublishedAgeRestrictionBaseKey`, f[$AG])
+ //
type AgeRestrictedCoinSecret = string;
.. ts:def:: PublishedAgeRestrictionBaseKey
@@ -2515,354 +2119,420 @@ If so, the exchange will blindly sign ``n`` undisclosed coins from the request.
// derived all public keys to age groups higher than their allowed maximum
// from this particular value.
const PublishedAgeRestrictionBaseKey =
- new Edx25519PublicKey("DZJRF6HXN520505XDAWM8NMH36QV9J3VH77265WQ09EBQ76QSKCG");
+ new Edx25519PublicKey("CH0VKFDZ2GWRWHQBBGEK9MWV5YDQVJ0RXEE0KYT3NMB69F0R96TG");
+ .. ts:def:: AgeWithdrawRevealResponse
+ interface AgeWithdrawRevealResponse {
+ // List of the exchange's blinded RSA signatures on the new coins.
+ ev_sigs : BlindedDenominationSignature[];
+ }
-.. _deposit-par:
--------
-Deposit
--------
+.. _reserve-history:
-Deposit operations are requested f.e. by a merchant during a transaction or a
-bidder during an auction.
+---------------
+Reserve History
+---------------
-For the deposit operation during purchase, the merchant has to obtain the
-deposit permission for a coin from their customer who owns the coin. When
-depositing a coin, the merchant is credited an amount specified in the deposit
-permission, possibly a fraction of the total coin's value, minus the deposit
-fee as specified by the coin's denomination.
+.. http:get:: /reserves/$RESERVE_PUB/history
-For auctions, a bidder performs an deposit operation and provides all relevant
-information for the auction policy (such as timeout and public key as bidder)
-and can use the ``exchange_sig`` field from the `DepositSuccess` message as a
-proof to the seller for the escrow of sufficient fund.
+ Request information about the full history of
+ a reserve or an account.
+ **Request:**
-.. _deposit:
+ The GET request should come with the following HTTP headers:
-.. http:POST:: /coins/$COIN_PUB/deposit
+ *If-None-Match*: The client MAY provide an ``If-None-Match`` header with an
+ Etag. In that case, the server MUST additionally respond with an ``304``
+ status code in case the reserve history matches the provided Etag.
- Deposit the given coin and ask the exchange to transfer the given :ref:`amount`
- to the merchant's bank account. This API is used by the merchant to redeem
- the digital coins.
+ *Taler-Reserve-History-Signature*: The client MUST provide Base-32 encoded
+ EdDSA signature over a TALER_SIGNATURE_RESERVE_HISTORY_REQUEST made with
+ the respective ``$RESERVE_PRIV``, affirming desire to download the current
+ reserve transaction history.
- The base URL for ``/coins/``-requests may differ from the main base URL of the
- exchange. The exchange MUST return a 307 or 308 redirection to the correct
- base URL if this is the case.
-
- **Request:**
-
- The request body must be a `DepositRequest` object.
+ :query start=OFFSET: *Optional.* Only return reserve history entries with
+ offsets above the given OFFSET. Allows clients to not
+ retrieve history entries they already have.
**Response:**
:http:statuscode:`200 OK`:
- The operation succeeded, the exchange confirms that no double-spending took
- place. The response will include a `DepositSuccess` object.
+ The exchange responds with a `ReserveHistory` object; the reserve was known to the exchange.
+ :http:statuscode:`204 No content`:
+ The reserve history is known, but at this point from the given starting point it is empty. Can only happen if OFFSET was positive.
+ :http:statuscode:`304 Not modified`:
+ The reserve history matches the one identified by the "If-none-match" HTTP header of the request.
:http:statuscode:`403 Forbidden`:
- One of the signatures is invalid.
+ The *TALER_SIGNATURE_RESERVE_HISTORY_REQUEST* is invalid.
This response comes with a standard `ErrorDetail` response.
:http:statuscode:`404 Not found`:
- Either the denomination key is not recognized (expired or invalid),
- or the wire type is not recognized.
- If the denomination key is unknown, the response will be
- a `DenominationUnknownMessage`.
- :http:statuscode:`409 Conflict`:
- The deposit operation has either failed because the coin has insufficient
- residual value, or because the same public key of the coin has been
- previously used with a different denomination. Which case it is
- can be decided by looking at the error code
- (``TALER_EC_EXCHANGE_GENERIC_INSUFFICIENT_FUNDS`` or
- ``TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY``).
- The fields of the response are the same in both cases.
- The request should not be repeated again with this coin.
- In this case, the response is a `DepositDoubleSpendError`.
- :http:statuscode:`410 Gone`:
- The requested denomination key is not yet or no longer valid.
- It either before the validity start, past the expiration or was revoked. The response is a
- `DenominationExpiredMessage`. Clients must evaluate
- the error code provided to understand which of the
- cases this is and handle it accordingly.
+ The reserve key does not belong to a reserve known to the exchange.
**Details:**
- .. ts:def:: DepositRequest
+ .. ts:def:: ReserveHistory
- interface DepositRequest {
- // Amount to be deposited, can be a fraction of the
- // coin's total value.
- contribution: Amount;
+ interface ReserveHistory {
+ // Balance left in the reserve.
+ balance: Amount;
- // The merchant's account details.
- // In case of an auction policy, it refers to the seller.
- merchant_payto_uri: string;
+ // If set, gives the maximum age group that the client is required to set
+ // during withdrawal.
+ maximum_age_group: number;
- // The salt is used to hide the ``payto_uri`` from customers
- // when computing the ``h_wire`` of the merchant.
- wire_salt: WireSalt;
+ // Transaction history for this reserve.
+ // May be partial (!).
+ history: TransactionHistoryItem[];
+ }
- // SHA-512 hash of the contract of the merchant with the customer. Further
- // details are never disclosed to the exchange.
- h_contract_terms: HashCode;
+ Objects in the transaction history have the following format:
- // Hash of denomination RSA key with which the coin is signed.
- denom_pub_hash: HashCode;
+ .. ts:def:: TransactionHistoryItem
- // IFF the corresponding denomination has support for
- // age restriction enabled, this field MUST contain the SHA256
- // value of the age commitment that MUST have been provided during the
- // purchase.
- age_commitment_hash?: AgeCommitmentHash;
+ // Union discriminated by the "type" field.
+ type TransactionHistoryItem =
+ | AccountSetupTransaction
+ | ReserveWithdrawTransaction
+ | ReserveAgeWithdrawTransaction
+ | ReserveCreditTransaction
+ | ReserveClosingTransaction
+ | ReserveOpenRequestTransaction
+ | ReserveCloseRequestTransaction
+ | PurseMergeTransaction;
- // Exchange's unblinded RSA signature of the coin.
- ub_sig: DenominationSignature;
+ .. ts:def:: AccountSetupTransaction
- // Timestamp when the contract was finalized.
- timestamp: Timestamp;
+ interface AccountSetupTransaction {
+ type: "SETUP";
- // Indicative time by which the exchange undertakes to transfer the funds to
- // the merchant, in case of successful payment. A wire transfer deadline of 'never'
- // is not allowed.
- wire_transfer_deadline: Timestamp;
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
- // EdDSA `public key of the merchant <merchant-pub>`, so that the client can identify the
- // merchant for refund requests.
- //
- // THIS FIELD WILL BE DEPRICATED, once the refund mechanism becomes a
- // policy via extension.
- merchant_pub: EddsaPublicKey;
+ // KYC fee agreed to by the reserve owner.
+ kyc_fee: Amount;
- // Date until which the merchant can issue a refund to the customer via the
- // exchange, to be omitted if refunds are not allowed.
- //
- // THIS FIELD WILL BE DEPRICATED, once the refund mechanism becomes a
- // policy via extension.
- refund_deadline?: Timestamp;
+ // Time when the KYC was triggered.
+ kyc_timestamp: Timestamp;
- // CAVEAT: THIS IS WORK IN PROGRESS
- // (Optional) policy for the deposit.
- // This might be a refund, auction or escrow policy.
- //
- // Note that support for policies is an optional feature of the exchange.
- // Optional features are so called "extensions" in Taler. The exchange
- // provides the list of supported extensions, including policies, in the
- // `ExtensionsManifestsResponse` response to the ``/keys`` endpoint.
- policy?: DepositPolicy;
+ // Hash of the wire details of the account.
+ // Note that this hash is unsalted and potentially
+ // private (as it could be inverted), hence access
+ // to this endpoint must be authorized using the
+ // private key of the reserve.
+ h_wire: HashCode;
+
+ // Signature created with the reserve's private key.
+ // Must be of purpose ``TALER_SIGNATURE_ACCOUNT_SETUP_REQUEST`` over
+ // a ``TALER_AccountSetupRequestSignaturePS``.
+ reserve_sig: EddsaSignature;
- // Signature over `TALER_DepositRequestPS`, made by the customer with the
- // `coin's private key <coin-priv>`.
- coin_sig: EddsaSignature;
}
- .. ts:def:: DenominationSignature
+ .. ts:def:: ReserveWithdrawTransaction
- type DenominationSignature =
- | RsaDenominationSignature
- | CSDenominationSignature;
+ interface ReserveWithdrawTransaction {
+ type: "WITHDRAW";
- .. ts:def:: RsaDenominationSignature
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
- interface RsaDenominationSignature {
- cipher: "RSA";
+ // Amount withdrawn.
+ amount: Amount;
- // RSA signature
- rsa_signature: RsaSignature;
- }
+ // Hash of the denomination public key of the coin.
+ h_denom_pub: HashCode;
- .. ts:def:: CSDenominationSignature
+ // Hash of the blinded coin to be signed.
+ h_coin_envelope: HashCode;
- interface CSDenominationSignature {
- type: "CS";
+ // Signature over a `TALER_WithdrawRequestPS`
+ // with purpose ``TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW``
+ // created with the reserve's private key.
+ reserve_sig: EddsaSignature;
- // R value component of the signature.
- cs_signature_r: Cs25519Point;
+ // Fee that is charged for withdraw.
+ withdraw_fee: Amount;
+ }
- // s value component of the signature.
- cs_signature_s: Cs25519Scalar:
+ .. ts:def:: ReserveAgeWithdrawTransaction
- }
+ interface ReserveAgeWithdrawTransaction {
+ type: "AGEWITHDRAW";
- .. ts:def:: DepositPolicy
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
- type DepositPolicy =
- | PolicyMerchantRefund
- | PolicyBrandtVickreyAuction
- | PolicyEscrowedPayment;
+ // Total Amount withdrawn.
+ amount: Amount;
- .. ts:def:: PolicyMerchantRefund
+ // Commitment of all ``n*kappa`` blinded coins.
+ h_commitment: HashCode;
- // CAVEAT: THIS IS STILL WORK IN PROGRESS.
- // This policy is optional and might not be supported by the exchange.
- // If it does, the exchange MUST show support for this policy in the
- // ``extensions`` field in the response to ``/keys``.
- interface PolicyMerchantRefund {
- type: "merchant_refund";
+ // Signature over a `TALER_AgeWithdrawRequestPS`
+ // with purpose ``TALER_SIGNATURE_WALLET_RESERVE_AGE_WITHDRAW``
+ // created with the reserve's private key.
+ reserve_sig: EddsaSignature;
- // EdDSA `public key of the merchant <merchant-pub>`, so that the client
- // can identify the merchant for refund requests.
- merchant_pub: EddsaPublicKey;
+ // Fee that is charged for withdraw.
+ withdraw_fee: Amount;
+ }
- // Date until which the merchant can issue a refund to the customer via
- // the ``/extensions/policy_refund``-endpoint of the exchange.
- deadline: Timestamp;
+
+ .. ts:def:: ReserveCreditTransaction
+
+ interface ReserveCreditTransaction {
+ type: "CREDIT";
+
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
+ // Amount deposited.
+ amount: Amount;
+
+ // Sender account ``payto://`` URL.
+ sender_account_url: string;
+
+ // Opaque identifier internal to the exchange that
+ // uniquely identifies the wire transfer that credited the reserve.
+ wire_reference: Integer;
+
+ // Timestamp of the incoming wire transfer.
+ timestamp: Timestamp;
}
- .. ts:def:: PolicyBrandtVickreyAuction
- // CAVEAT: THIS IS STILL WORK IN PROGRESS.
- // This policy is optional and might not be supported by the exchange.
- // If it does, the exchange MUST show support for this policy in the
- // ``extensions`` field in the response to ``/keys``.
- interface PolicyBrandtVickreyAuction {
- type: "brandt_vickrey_auction";
+ .. ts:def:: ReserveClosingTransaction
- // Public key of this bidder.
- //
- // The bidder uses this key to sign the auction information and
- // the messages it sends to the seller during the auction.
- bidder_pub: EddsaPublicKey;
+ interface ReserveClosingTransaction {
+ type: "CLOSING";
- // Hash of the auction terms
- //
- // The hash should be taken over a normalized JSON object of type
- // `BrandtVickreyAuction`.
- h_auction: HashCode;
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
- // The amount that this bidder commits to for this auction
- //
- // This amount can be larger than the contribution of a single coin.
- // The bidder can increase funding of this auction policy by using
- // sufficiently many coins during the deposit operation (single or batch)
- // with the same policy.
- commitment: Amount;
+ // Closing balance.
+ amount: Amount;
- // Date until the auction must have been successfully executed and
- // a valid transcript provided to the
- // ``/extensions/policy_brandt_vickrey_auction``-endpoint of the
- // exchange.
- //
- // [If the auction has not been executed by then] OR [has been executed
- // before then, but this bidder did not win], the coin's value doesn't
- // change and the owner can refresh the coin.
- //
- // If this bidder won the auction, the winning price/amount from the
- // outcome will be substracted from the coin and transfered to the
- // merchant's ``payout_uri`` from the deposit request (minus a potential
- // auction fee). For any remaining value, the bidder can refresh the
- // coin to retrieve change.
- deadline: Timestamp;
+ // Closing fee charged by the exchange.
+ closing_fee: Amount;
+
+ // Wire transfer subject.
+ wtid: Base32;
+
+ // ``payto://`` URI of the wire account into which the funds were returned to.
+ receiver_account_details: string;
+
+ // This is a signature over a
+ // struct `TALER_ReserveCloseConfirmationPS` with purpose
+ // ``TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED``.
+ exchange_sig: EddsaSignature;
+
+ // Public key used to create 'exchange_sig'.
+ exchange_pub: EddsaPublicKey;
+
+ // Time when the reserve was closed.
+ timestamp: Timestamp;
}
- .. ts:def:: BrandtVickreyAuction
- // CAVEAT: THIS IS STILL WORK IN PROGRESS.
- // This structure defines an auction of Brandt-Vickory kind.
- // It is used for the `PolicyBrandtVickreyAuction`.
- interface BrandtVickreyAuction {
- // Start date of the auction
- time_start: Timestamp;
+ .. ts:def:: ReserveOpenRequestTransaction
- // Maximum duration per round. There are four rounds in an auction of
- // Brandt-Vickrey kind.
- time_round: RelativeTime;
+ interface ReserveOpenRequestTransaction {
+ type: "OPEN";
- // This integer m refers to the (m+1)-type of the Brandt-Vickrey-auction.
- // - Type 0 refers to an auction with one highest-price winner,
- // - Type 1 refers to an auction with one winner, paying the second
- // highest price,
- // - Type 2 refers to an auction with two winners, paying
- // the third-highest price,
- // - etc.
- auction_type: number;
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
- // The vector of prices for the Brandt-Vickrey auction. The values MUST
- // be in strictly increasing order.
- prices: Amount[];
+ // Open fee paid from the reserve.
+ open_fee: Amount;
- // The type of outcome of the auction.
- // In case the auction is declared public, each bidder can calculate the
- // winning price. This field is not relevant for the replay of a
- // transcript, as the transcript must be provided by the seller who sees
- // the winner(s) and winning price of the auction.
- outcome_public: boolean;
+ // This is a signature over
+ // a struct `TALER_ReserveOpenPS` with purpose
+ // ``TALER_SIGNATURE_WALLET_RESERVE_OPEN``.
+ reserve_sig: EddsaSignature;
- // The public key of the seller.
- pubkey: EddsaPublicKey;
+ // Timestamp of the open request.
+ request_timestamp: Timestamp;
+
+ // Requested expiration.
+ requested_expiration: Timestamp;
+
+ // Requested number of free open purses.
+ requested_min_purses: Integer;
- // The seller's account details.
- payto_uri: string;
}
+ .. ts:def:: ReserveCloseRequestTransaction
- .. ts:def:: PolicyEscrowedPayment
+ interface ReserveCloseRequestTransaction {
+ type: "CLOSE";
- // CAVEAT: THIS IS STILL WORK IN PROGRESS
- // This policy is optional and might not be supported by the exchange.
- // If it does, the exchange MUST show support for this policy in the
- // ``extensions`` field in the response to ``/keys``.
- interface PolicyEscrowedPayment {
- type: "escrowed_payment";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
- // Public key of this trustor, the owner of the coins.
- //
- // To claim the deposit, the merchant must provide the valid signature
- // of the ``h_contract_terms`` field from the deposit, signed by _this_
- // key, to the ``/extensions/policy_escrow``-endpoint of the exchange,
- // after the date specified in ``not_before`` and before the date
- // specified in ``not_after``.
- trustor_pub: EddsaPublicKey;
+ // This is a signature over
+ // a struct `TALER_ReserveClosePS` with purpose
+ // ``TALER_SIGNATURE_WALLET_RESERVE_CLOSE``.
+ reserve_sig: EddsaSignature;
- // Latest date by which the deposit must be claimed. If the deposit
- // has not been claimed by that date, the deposited coins can be
- // refreshed by the (still) owner.
- deadline: Timestamp;
+ // Target account ``payto://``, optional.
+ h_payto?: PaytoHash;
+
+ // Timestamp of the close request.
+ request_timestamp: Timestamp;
}
+ .. ts:def:: ReserveCreditTransaction
- The deposit operation succeeds if the coin is valid for making a deposit and
- has enough residual value that has not already been deposited or melted.
+ interface ReserveCreditTransaction {
+ type: "CREDIT";
- .. ts:def:: DepositSuccess
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
- interface DepositSuccess {
- // Optional base URL of the exchange for looking up wire transfers
- // associated with this transaction. If not given,
- // the base URL is the same as the one used for this request.
- // Can be used if the base URL for ``/transactions/`` differs from that
- // for ``/coins/``, i.e. for load balancing. Clients SHOULD
- // respect the ``transaction_base_url`` if provided. Any HTTP server
- // belonging to an exchange MUST generate a 307 or 308 redirection
- // to the correct base URL should a client uses the wrong base
- // URL, or if the base URL has changed since the deposit.
- transaction_base_url?: string;
+ // Amount deposited.
+ amount: Amount;
- // Timestamp when the deposit was received by the exchange.
- exchange_timestamp: Timestamp;
+ // Sender account ``payto://`` URL.
+ sender_account_url: string;
- // The EdDSA signature of `TALER_DepositConfirmationPS` using a current
- // `signing key of the exchange <sign-key-priv>` affirming the successful
- // deposit and that the exchange will transfer the funds after the refund
- // deadline, or as soon as possible if the refund deadline is zero.
- exchange_sig: EddsaSignature;
+ // Opaque identifier internal to the exchange that
+ // uniquely identifies the wire transfer that credited the reserve.
+ wire_reference: Integer;
- // `Public EdDSA key of the exchange <sign-key-pub>` that was used to
- // generate the signature.
- // Should match one of the exchange's signing keys from ``/keys``. It is given
- // explicitly as the client might otherwise be confused by clock skew as to
- // which signing key was used.
- exchange_pub: EddsaPublicKey;
+ // Timestamp of the incoming wire transfer.
+ timestamp: Timestamp;
}
- .. ts:def:: DepositDoubleSpendError
+ .. ts:def:: PurseMergeTransaction
- interface DepositDoubleSpendError {
- // The string constant "insufficient funds".
- hint: string;
+ interface PurseMergeTransaction {
+ type: "MERGE";
- // Transaction history for the coin that is
- // being double-spended.
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
+ // SHA-512 hash of the contact of the purse.
+ h_contract_terms: HashCode;
+
+ // EdDSA public key used to approve merges of this purse.
+ merge_pub: EddsaPublicKey;
+
+ // Minimum age required for all coins deposited into the purse.
+ min_age: Integer;
+
+ // Number that identifies who created the purse
+ // and how it was paid for.
+ flags: Integer;
+
+ // Purse public key.
+ purse_pub: EddsaPublicKey;
+
+ // EdDSA signature of the account/reserve affirming the merge
+ // over a `TALER_AccountMergeSignaturePS`.
+ // Must be of purpose ``TALER_SIGNATURE_ACCOUNT_MERGE``
+ reserve_sig: EddsaSignature;
+
+ // Client-side timestamp of when the merge request was made.
+ merge_timestamp: Timestamp;
+
+ // Indicative time by which the purse should expire
+ // if it has not been merged into an account. At this
+ // point, all of the deposits made should be
+ // auto-refunded.
+ purse_expiration: Timestamp;
+
+ // Purse fee the reserve owner paid for the purse creation.
+ purse_fee: Amount;
+
+ // Total amount merged into the reserve.
+ // (excludes fees).
+ amount: Amount;
+
+ // True if the purse was actually merged.
+ // If false, only the purse_fee has an impact
+ // on the reserve balance!
+ merged: boolean;
+ }
+
+
+.. _coin-history:
+
+------------
+Coin History
+------------
+
+.. http:get:: /coins/$COIN_PUB/history
+
+ Obtain the transaction history of a coin. Used only in special cases, like
+ when the exchange claims a double-spending error and the wallet does not
+ believe it. Usually, the wallet knows the transaction history of each coin
+ and thus has no need to inquire.
+
+ **Request:**
+
+ The GET request should come with the following HTTP headers:
+
+ *If-None-Match*: The client MAY provide an ``If-None-Match`` header with an
+ Etag. In that case, the server MUST additionally respond with an ``304``
+ status code in case the coin history matches the provided Etag.
+
+ *Taler-Coin-History-Signature*: The client MUST provide Base-32 encoded
+ EdDSA signature over a TALER_SIGNATURE_COIN_HISTORY_REQUEST made with
+ the respective ``$RESERVE_PRIV``, affirming desire to download the current
+ coin transaction history.
+
+ :query start=OFFSET: *Optional.* Only return coin history entries with
+ offsets above the given OFFSET. Allows clients to not
+ retrieve history entries they already have.
+
+
+ **Response:**
+
+ :http:statuscode:`200 OK`:
+ The operation succeeded, the exchange confirms that no double-spending took
+ place. The response will include a `CoinHistoryResponse` object.
+ :http:statuscode:`204 No content`:
+ The reserve history is known, but at this point from the given starting point it is empty. Can only happen if OFFSET was positive.
+ :http:statuscode:`304 Not modified`:
+ The coin history has not changed since the previous query (detected via Etag
+ in "If-none-match" header).
+ :http:statuscode:`403 Forbidden`:
+ The *TALER_SIGNATURE_COIN_HISTORY_REQUEST* is invalid.
+ This response comes with a standard `ErrorDetail` response.
+ :http:statuscode:`404 Not found`:
+ The coin public key is not (yet) known to the exchange.
+
+ .. ts:def:: CoinHistoryResponse
+
+ interface CoinHistoryResponse {
+ // Current balance of the coin.
+ balance: Amount;
+
+ // Hash of the coin's denomination.
+ h_denom_pub: HashCode;
+
+ // Transaction history for the coin.
history: CoinSpendHistoryItem[];
}
@@ -2880,12 +2550,16 @@ proof to the seller for the escrow of sufficient fund.
| CoinPurseRefundTransaction
| CoinReserveOpenDepositTransaction;
-
.. ts:def:: CoinDepositTransaction
interface CoinDepositTransaction {
type: "DEPOSIT";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
// The total amount of the coin's value absorbed (or restored in the
// case of a refund) by this transaction.
// The amount given includes
@@ -2929,6 +2603,11 @@ proof to the seller for the escrow of sufficient fund.
interface CoinMeltTransaction {
type: "MELT";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
// The total amount of the coin's value absorbed by this transaction.
// Note that for melt this means the amount given includes
// the melt fee. The current coin value can thus be computed by
@@ -2958,6 +2637,11 @@ proof to the seller for the escrow of sufficient fund.
interface CoinRefundTransaction {
type: "REFUND";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
// The total amount of the coin's value restored
// by this transaction.
// The amount given excludes the transaction fee.
@@ -2988,6 +2672,11 @@ proof to the seller for the escrow of sufficient fund.
interface CoinRecoupTransaction {
type: "RECOUP";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
// The total amount of the coin's value absorbed
// by this transaction.
// The current coin value can thus be computed by
@@ -3029,6 +2718,11 @@ proof to the seller for the escrow of sufficient fund.
interface CoinOldCoinRecoupTransaction {
type: "OLD-COIN-RECOUP";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
// The total amount of the coin's value restored
// by this transaction.
// The current coin value can thus be computed by
@@ -3053,6 +2747,11 @@ proof to the seller for the escrow of sufficient fund.
interface CoinRecoupRefreshTransaction {
type: "RECOUP-REFRESH";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
// The total amount of the coin's value absorbed
// by this transaction.
// The current coin value can thus be computed by
@@ -3095,6 +2794,11 @@ proof to the seller for the escrow of sufficient fund.
interface CoinPurseDepositTransaction {
type: "PURSE-DEPOSIT";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
// The total amount of the coin's value absorbed
// by this transaction.
// Note that this means the amount given includes
@@ -3129,6 +2833,11 @@ proof to the seller for the escrow of sufficient fund.
interface CoinPurseRefundTransaction {
type: "PURSE-REFUND";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
// The total amount of the coin's value restored
// by this transaction.
// The amount given excludes the refund fee.
@@ -3158,6 +2867,11 @@ proof to the seller for the escrow of sufficient fund.
interface CoinReserveOpenDepositTransaction {
type: "RESERVE-OPEN-DEPOSIT";
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
// The total amount of the coin's value absorbed
// by this transaction.
// Note that this means the amount given includes
@@ -3175,7 +2889,30 @@ proof to the seller for the escrow of sufficient fund.
}
-.. http:POST:: /batch-deposit
+.. _deposit-par:
+
+-------
+Deposit
+-------
+
+Deposit operations are requested f.e. by a merchant during a transaction or a
+bidder during an auction.
+
+For the deposit operation during purchase, the merchant has to obtain the
+deposit permission for a coin from their customer who owns the coin. When
+depositing a coin, the merchant is credited an amount specified in the deposit
+permission, possibly a fraction of the total coin's value, minus the deposit
+fee as specified by the coin's denomination.
+
+For auctions, a bidder performs an deposit operation and provides all relevant
+information for the auction policy (such as timeout and public key as bidder)
+and can use the ``exchange_sig`` field from the `DepositSuccess` message as a
+proof to the seller for the escrow of sufficient fund.
+
+
+.. _deposit:
+
+.. http:post:: /batch-deposit
Deposit multiple coins and ask the exchange to transfer the given :ref:`amount`
into the merchant's bank account. This API is used by the merchant to redeem
@@ -3189,7 +2926,7 @@ proof to the seller for the escrow of sufficient fund.
:http:statuscode:`200 OK`:
The operation succeeded, the exchange confirms that no double-spending took
- place. The response will include a `BatchDepositSuccess` object.
+ place. The response will include a `DepositSuccess` object.
:http:statuscode:`403 Forbidden`:
One of the signatures is invalid.
This response comes with a standard `ErrorDetail` response.
@@ -3201,15 +2938,17 @@ proof to the seller for the escrow of sufficient fund.
:http:statuscode:`409 Conflict`:
The deposit operation has either failed because a coin has insufficient
residual value, or because the same public key of a coin has been
- previously used with a different denomination. Which case it is
- can be decided by looking at the error code
- (``TALER_EC_EXCHANGE_GENERIC_INSUFFICIENT_FUNDS`` or
- ``TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY``).
- The fields of the response are the same in both cases.
- The request should not be repeated again with this coin.
- In this case, the response is a `DepositDoubleSpendError` with
- an additional ``coin_pub`` field specifying the public key of the
- coin that was double-spent.
+ previously used with a different denomination.
+ Which case it is can be decided by looking at the error code:
+
+ 1. ``TALER_EC_EXCHANGE_DEPOSIT_CONFLICTING_CONTRACT`` (same coin used in different ways),
+ 2. ``TALER_EC_EXCHANGE_GENERIC_INSUFFICIENT_FUNDS`` (balance insufficient),
+ 3. ``TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY`` (same coin public key, but different denomination).
+ 4. ``TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH`` (same coin public key, but different age commitment).
+
+ The request should not be repeated again with this coin. Instead, the client
+ can get from the exchange via the ``/coin/$COIN_PUB/history`` endpoint the record
+ of the transactions known for this coin's public key.
:http:statuscode:`410 Gone`:
The requested denomination key is not yet or no longer valid.
It either before the validity start, past the expiration or was revoked. The response is a
@@ -3283,12 +3022,176 @@ proof to the seller for the escrow of sufficient fund.
coin_sig: EddsaSignature;
}
+ .. ts:def:: DenominationSignature
+
+ type DenominationSignature =
+ | RsaDenominationSignature
+ | CSDenominationSignature;
+
+ .. ts:def:: RsaDenominationSignature
+
+ interface RsaDenominationSignature {
+ cipher: "RSA";
+
+ // RSA signature
+ rsa_signature: RsaSignature;
+ }
+
+ .. ts:def:: CSDenominationSignature
+
+ interface CSDenominationSignature {
+ type: "CS";
+
+ // R value component of the signature.
+ cs_signature_r: Cs25519Point;
+
+ // s value component of the signature.
+ cs_signature_s: Cs25519Scalar:
+
+ }
+
+ .. ts:def:: DepositPolicy
+
+ type DepositPolicy =
+ | PolicyMerchantRefund
+ | PolicyBrandtVickreyAuction
+ | PolicyEscrowedPayment;
+
+ .. ts:def:: PolicyMerchantRefund
+
+ // CAVEAT: THIS IS STILL WORK IN PROGRESS.
+ // This policy is optional and might not be supported by the exchange.
+ // If it does, the exchange MUST show support for this policy in the
+ // ``extensions`` field in the response to ``/keys``.
+ interface PolicyMerchantRefund {
+ type: "merchant_refund";
+
+ // EdDSA `public key of the merchant <merchant-pub>`, so that the client
+ // can identify the merchant for refund requests.
+ merchant_pub: EddsaPublicKey;
+
+ // Date until which the merchant can issue a refund to the customer via
+ // the ``/extensions/policy_refund``-endpoint of the exchange.
+ deadline: Timestamp;
+ }
+
+ .. ts:def:: PolicyBrandtVickreyAuction
+
+ // CAVEAT: THIS IS STILL WORK IN PROGRESS.
+ // This policy is optional and might not be supported by the exchange.
+ // If it does, the exchange MUST show support for this policy in the
+ // ``extensions`` field in the response to ``/keys``.
+ interface PolicyBrandtVickreyAuction {
+ type: "brandt_vickrey_auction";
+
+ // Public key of this bidder.
+ //
+ // The bidder uses this key to sign the auction information and
+ // the messages it sends to the seller during the auction.
+ bidder_pub: EddsaPublicKey;
+
+ // Hash of the auction terms
+ //
+ // The hash should be taken over a normalized JSON object of type
+ // `BrandtVickreyAuction`.
+ h_auction: HashCode;
+
+ // The amount that this bidder commits to for this auction
+ //
+ // This amount can be larger than the contribution of a single coin.
+ // The bidder can increase funding of this auction policy by using
+ // sufficiently many coins during the deposit operation (single or batch)
+ // with the same policy.
+ commitment: Amount;
+
+ // Date until the auction must have been successfully executed and
+ // a valid transcript provided to the
+ // ``/extensions/policy_brandt_vickrey_auction``-endpoint of the
+ // exchange.
+ //
+ // [If the auction has not been executed by then] OR [has been executed
+ // before then, but this bidder did not win], the coin's value doesn't
+ // change and the owner can refresh the coin.
+ //
+ // If this bidder won the auction, the winning price/amount from the
+ // outcome will be substracted from the coin and transfered to the
+ // merchant's ``payout_uri`` from the deposit request (minus a potential
+ // auction fee). For any remaining value, the bidder can refresh the
+ // coin to retrieve change.
+ deadline: Timestamp;
+ }
+
+ .. ts:def:: BrandtVickreyAuction
+
+ // CAVEAT: THIS IS STILL WORK IN PROGRESS.
+ // This structure defines an auction of Brandt-Vickory kind.
+ // It is used for the `PolicyBrandtVickreyAuction`.
+ interface BrandtVickreyAuction {
+ // Start date of the auction
+ time_start: Timestamp;
+
+ // Maximum duration per round. There are four rounds in an auction of
+ // Brandt-Vickrey kind.
+ time_round: RelativeTime;
+
+ // This integer m refers to the (m+1)-type of the Brandt-Vickrey-auction.
+ // - Type 0 refers to an auction with one highest-price winner,
+ // - Type 1 refers to an auction with one winner, paying the second
+ // highest price,
+ // - Type 2 refers to an auction with two winners, paying
+ // the third-highest price,
+ // - etc.
+ auction_type: number;
+
+ // The vector of prices for the Brandt-Vickrey auction. The values MUST
+ // be in strictly increasing order.
+ prices: Amount[];
+
+ // The type of outcome of the auction.
+ // In case the auction is declared public, each bidder can calculate the
+ // winning price. This field is not relevant for the replay of a
+ // transcript, as the transcript must be provided by the seller who sees
+ // the winner(s) and winning price of the auction.
+ outcome_public: boolean;
+
+ // The public key of the seller.
+ pubkey: EddsaPublicKey;
+
+ // The seller's account details.
+ payto_uri: string;
+ }
+
+
+ .. ts:def:: PolicyEscrowedPayment
+
+ // CAVEAT: THIS IS STILL WORK IN PROGRESS
+ // This policy is optional and might not be supported by the exchange.
+ // If it does, the exchange MUST show support for this policy in the
+ // ``extensions`` field in the response to ``/keys``.
+ interface PolicyEscrowedPayment {
+ type: "escrowed_payment";
+
+ // Public key of this trustor, the owner of the coins.
+ //
+ // To claim the deposit, the merchant must provide the valid signature
+ // of the ``h_contract_terms`` field from the deposit, signed by _this_
+ // key, to the ``/extensions/policy_escrow``-endpoint of the exchange,
+ // after the date specified in ``not_before`` and before the date
+ // specified in ``not_after``.
+ trustor_pub: EddsaPublicKey;
+
+ // Latest date by which the deposit must be claimed. If the deposit
+ // has not been claimed by that date, the deposited coins can be
+ // refreshed by the (still) owner.
+ deadline: Timestamp;
+ }
+
The deposit operation succeeds if the coin is valid for making a deposit and
has enough residual value that has not already been deposited or melted.
- .. ts:def:: BatchDepositSuccess
+ .. ts:def:: DepositSuccess
- interface BatchDepositSuccess {
+ interface DepositSuccess {
// Optional base URL of the exchange for looking up wire transfers
// associated with this transaction. If not given,
// the base URL is the same as the one used for this request.
@@ -3310,15 +3213,7 @@ proof to the seller for the escrow of sufficient fund.
// which signing key was used.
exchange_pub: EddsaPublicKey;
- // Array of deposit confirmation signatures from the exchange
- // Entries must be in the same order the coins were given
- // in the batch deposit request.
- exchange_sigs: DepositConfirmationSignature[];
- }
-
- .. ts:def:: DepositConfirmationSignature
-
- interface DepositConfirmationSignature {
+ // Deposit confirmation signature from the exchange.
// The EdDSA signature of `TALER_DepositConfirmationPS` using a current
// `signing key of the exchange <sign-key-priv>` affirming the successful
// deposit and that the exchange will transfer the funds after the refund
@@ -3326,6 +3221,27 @@ proof to the seller for the escrow of sufficient fund.
exchange_sig: EddsaSignature;
}
+ .. ts:def:: DepositDoubleSpendError
+
+ interface DepositDoubleSpendError {
+
+ // Must be TALER_EC_EXCHANGE_GENERIC_INSUFFICIENT_FUNDS
+ code: Integer;
+
+ // A string explaining that the user tried to
+ // double-spend.
+ hint: string;
+
+ // EdDSA public key of a coin being double-spent.
+ coin_pub: EddsaPublicKey;
+
+ // Transaction history for the coin that is
+ // being double-spended.
+ // DEPRECATED! Will be removed soon. Use
+ // GET /coins/$COIN_PUB to get the history!
+ history: CoinSpendHistoryItem[];
+ }
+
----------
Refreshing
@@ -3469,7 +3385,7 @@ the API during normal operation.
// Melt commitment. Hash over the various coins to be withdrawn.
// See also ``TALER_refresh_get_commitment()``.
- rc: TALER_RefreshCommitmentP;
+ rc: HashCode;
// Master seed for the Clause-schnorr R-value
// creation. Must match the /csr-melt request.
@@ -3616,10 +3532,7 @@ the API during normal operation.
.. ts:def:: RevealResponse
- interface RevealResponse {
- // List of the exchange's blinded RSA signatures on the new coins.
- ev_sigs : Array<{ ev_sig: BlindedDenominationSignature }>;
- }
+ type RevealResponse = BatchWithdrawResponse;
.. ts:def:: RevealConflictResponse
@@ -3965,12 +3878,21 @@ typically also view the balance.)
// Coin's public key, both ECDHE and EdDSA.
coin_pub: CoinPublicKey;
- // The total amount the original deposit was worth.
+ // The total amount the original deposit was worth,
+ // including fees and after applicable refunds.
deposit_value: Amount;
- // Applicable fees for the deposit.
+ // Applicable fees for the deposit, possibly
+ // reduced or waived due to refunds.
deposit_fee: Amount;
+ // Refunds that were applied to the value of
+ // this coin. Optional.
+ // Since protocol **v19**. Before, refunds were
+ // incorrectly still included in the
+ // ``deposit_value`` (!).
+ refund_total?: Amount;
+
}
.. http:get:: /deposits/$H_WIRE/$MERCHANT_PUB/$H_CONTRACT_TERMS/$COIN_PUB
@@ -3982,7 +3904,13 @@ typically also view the balance.)
**Request:**
- :query merchant_sig: EdDSA signature of the merchant made with purpose ``TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION`` over a ``TALER_DepositTrackPS``, affirming that it is really the merchant who requires obtaining the wire transfer identifier.
+ :query merchant_sig: EdDSA signature of the merchant made with purpose
+ ``TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION`` over a
+ ``TALER_DepositTrackPS``, affirming that it is really the merchant who
+ requires obtaining the wire transfer identifier.
+ :query timeout_ms=NUMBER: *Optional.* If specified, the exchange will wait
+ up to ``NUMBER`` milliseconds for completion of a deposit operation before
+ sending the HTTP response.
**Response:**
@@ -4062,7 +3990,7 @@ typically also view the balance.)
Refunds
-------
-.. http:POST:: /coins/$COIN_PUB/refund
+.. http:post:: /coins/$COIN_PUB/refund
Undo deposit of the given coin, restoring its value.
@@ -4161,8 +4089,8 @@ Refunds
Wallet-to-wallet transfers
--------------------------
-.. http:GET:: /purses/$PURSE_PUB/merge
-.. http:GET:: /purses/$PURSE_PUB/deposit
+.. http:get:: /purses/$PURSE_PUB/merge
+.. http:get:: /purses/$PURSE_PUB/deposit
Obtain information about a purse. Depending on the suffix,
the long-polling (if any) will wait for either a merge or
@@ -4237,7 +4165,7 @@ Wallet-to-wallet transfers
-.. http:POST:: /purses/$PURSE_PUB/create
+.. http:post:: /purses/$PURSE_PUB/create
Create a purse by depositing money into it. First step of a PUSH payment.
@@ -4503,7 +4431,7 @@ Wallet-to-wallet transfers
was already decided.
-.. http:POST:: /purses/$PURSE_PUB/merge
+.. http:post:: /purses/$PURSE_PUB/merge
Merge purse with account, adding the value of the purse into
the account. Endpoint to be used by the receiver of a PUSH payment.
@@ -4609,7 +4537,7 @@ Wallet-to-wallet transfers
-.. http:POST:: /reserves/$RESERVE_PUB/purse
+.. http:post:: /reserves/$RESERVE_PUB/purse
Create purse for an account. First step of a PULL payment.
@@ -4711,7 +4639,7 @@ Wallet-to-wallet transfers
}
-.. http:POST:: /purses/$PURSE_PUB/deposit
+.. http:post:: /purses/$PURSE_PUB/deposit
Deposit money into a purse. Used by the buyer for a PULL payment.
@@ -4847,7 +4775,7 @@ These endpoints are used to manage exchange-to-exchange payments in support of
wallet-to-wallet payments. Only another exchange should access this endpoint.
-.. http:GET:: /wads/$WAD_ID
+.. http:get:: /wads/$WAD_ID
Obtain information about a wad.
@@ -4935,9 +4863,18 @@ wallet-to-wallet payments. Only another exchange should access this endpoint.
KYC status updates
------------------
-.. http:POST:: /kyc-wallet
+This section describes endpoints used to set up, complete and
+inquire about KYC operations performed by an exchange for
+regulatory compliance.
+
+.. http:post:: /kyc-wallet
Setup KYC identification for a wallet. Returns the KYC UUID.
+ This endpoint is used by compliant Taler wallets when they
+ are about to hit the balance threshold and thus need to have
+ the customer provide their personal details to the exchange.
+ The wallet is identified by its long-lived reserve public key
+ (which is used for P2P payments, not for withdrawals).
**Request:**
@@ -4992,17 +4929,20 @@ KYC status updates
}
-.. http:GET:: /kyc-check/$REQUIREMENT_ROW/$H_PAYTO/$USERTYPE
+.. http:get:: /kyc-check/$REQUIREMENT_ROW/$H_PAYTO/$USERTYPE
+
+ Checks the KYC status of a particular payment target and possibly begins the
+ KYC process. This endpoint is used by wallets or merchants that have been
+ told about a KYC requirement and now want to check if the KYC requirement
+ has been fulfilled. Long-polling may be used to instantly observe a change
+ in the KYC requirement status.
- Check or update KYC status of a particular payment target.
- Returns the current KYC status of the account and, if
- negative, returns the URL where the KYC process can be
- initiated. The ``$REQUIREMENT_ROW`` must have been
- returned previously from an exchange API endpoint that
- determined that KYC was needed. The ``$H_PATYO`` must be
- the hash of the payto:// URI of the payment target.
- The ``$USERTYPE`` states whether the entity to perform
- the KYC is an "individual" or "business".
+ Returns the current KYC status of the requirement process and, if negative,
+ returns the URL where the KYC process can be initiated. The
+ ``$REQUIREMENT_ROW`` must have been returned previously from an exchange API
+ endpoint that determined that KYC was needed. The ``$H_PATYO`` must be the
+ hash of the "payto://" URI of the payment target. The ``$USERTYPE`` states
+ whether the entity to perform the KYC is an "individual" or a "business".
**Request:**
@@ -5021,12 +4961,13 @@ KYC status updates
The response will be an `AccountKycStatus` object.
:http:statuscode:`202 Accepted`:
The user should be redirected to the provided location to perform
- the required KYC checks to open the account. Afterwards, the
- ``/kyc-check/`` request should be repeated.
+ the required KYC checks to satisfy the legal requirements. Afterwards, the
+ ``/kyc-check/`` request should be repeated to check whether the
+ user has completed the process.
The response will be an `AccountKycRedirect` object.
:http:statuscode:`204 No content`:
The exchange is not configured to perform KYC and thus
- generally all accounts are simply considered legitimate.
+ the legal requirements are already satisfied.
:http:statuscode:`402 Payment Required`:
The client must pay the KYC fee for the KYC process.
**This is currently not implemented, see #7365.**
@@ -5034,6 +4975,13 @@ KYC status updates
The provided hash does not match the payment target.
:http:statuscode:`404 Not found`:
The payment target is unknown.
+ :http:statuscode:`451 Unavailable for Legal Reasons`:
+ The transaction cannot be completed due to AML rules.
+ Thus, the operation is currently not stuck on KYC, but
+ on exchange staff performing their AML review. The user
+ should be told to wait and/or contact the exchange operator
+ if the situation persists.
+ The response will be a `AccountAmlBlocked` object.
**Details:**
@@ -5057,6 +5005,12 @@ KYC status updates
// public key used to create the signature.
exchange_pub: EddsaPublicKey;
+
+ // Current AML state for the target account. Non-zero
+ // values indicate that the transfer is blocked due to
+ // AML enforcement.
+ aml_status: Integer;
+
}
.. ts:def:: AccountKycRedirect
@@ -5067,6 +5021,22 @@ KYC status updates
// proceed with the KYC process.
kyc_url: string;
+ // Current AML state for the target account. Non-zero
+ // values indicate that the transfer is blocked due to
+ // AML enforcement.
+ aml_status: Integer;
+
+ }
+
+ .. ts:def:: AccountAmlBlocked
+
+ interface AccountAmlBlocked {
+
+ // Current AML state for the target account. Non-zero
+ // values indicate that the transfer is blocked due to
+ // AML enforcement.
+ aml_status: Integer;
+
}
.. ts:def:: KycDetails
@@ -5079,12 +5049,20 @@ KYC status updates
}
-.. http:GET:: /kyc-proof/$PROVIDER_SECTION?state=$H_PAYTO
+.. http:get:: /kyc-proof/$PROVIDER_SECTION?state=$H_PAYTO
- Update KYC status of a particular payment target. Provides
+ Endpoint accessed from the user's browser at the *end* of a
+ KYC process, possibly providing the exchange with additional
+ credentials to obtain the results of the KYC process.
+ Specifically, the URL arguments should provide
information to the exchange that allows it to verify that the
user has completed the KYC process. The details depend on
- the logic, which is selected by the $PROVIDER_SECTION.
+ the logic, which is selected by the "$PROVIDER_SECTION".
+
+ While this is a GET (and thus safe, and idempotent), the operation
+ may actually trigger significant changes in the exchange's state.
+ In particular, it may update the KYC status of a particular
+ payment target.
**Request:**
@@ -5093,16 +5071,20 @@ KYC status updates
If the KYC plugin logic is OAuth 2.0, the query parameters are:
- :query code=CODE : OAuth 2.0 code argument.
+ :query code=CODE: OAuth 2.0 code argument.
:query state=STATE: OAuth 2.0 state argument with the H_PAYTO.
- .. note::
+ .. note::
- Depending on the OAuth variant used, additional
- query parameters may need to be passed here.
+ Depending on the OAuth variant used, additional
+ query parameters may need to be passed here.
**Response:**
+ Given that the response is returned to a user using a browser and **not** to
+ a Taler wallet, the response format is in human-readable HTML and not in
+ machine-readable JSON.
+
:http:statuscode:`302 Found`:
The KYC operation succeeded and the
payment target is now authorized to transact.
@@ -5120,16 +5102,16 @@ KYC status updates
service within a reasonable time period.
-.. http:GET:: /kyc-webhook/$PROVIDER_SECTION/*
-.. http:POST:: /kyc-webhook/$PROVIDER_SECTION/*
-.. http:GET:: /kyc-webhook/$LOGIC/*
-.. http:POST:: /kyc-webhook/$LOGIC/*
+.. http:get:: /kyc-webhook/$PROVIDER_SECTION/*
+.. http:post:: /kyc-webhook/$PROVIDER_SECTION/*
+.. http:get:: /kyc-webhook/$LOGIC/*
+.. http:post:: /kyc-webhook/$LOGIC/*
- Update KYC status of a particular payment target. Provides
- information to the KYC logic of the exchange that allows
- it to verify that the user has completed the KYC process.
- May be a GET or a POST request, depending on $LOGIC or
- $PROVIDER_SECTION.
+ All of the above endpoints can be used to update KYC status of a particular
+ payment target. They provide information to the KYC logic of the exchange
+ that allows it to verify that the user has completed the KYC process. May
+ be a GET or a POST request, depending on the specific "$LOGIC" and/or the
+ "$PROVIDER_SECTION".
**Request:**
@@ -5139,7 +5121,7 @@ KYC status updates
**Response:**
:http:statuscode:`204 No content`:
- The webhook succeeded.
+ The operation succeeded.
:http:statuscode:`404 Not found`:
The specified logic is unknown.
@@ -5149,12 +5131,12 @@ Reserve control
---------------
This section describes the reserve control API which can be used to (1)
-prevent a reserve from expiring (which is useful if the reserve is used for
-tipping), to (2) pay an annual fee to allow a number of purses to be created
-for the respective reserve without paying a purse fee each time, to (3) obtain
-KYC information associated with a reserve to prove the identity of the person
-sending an invoice to the payer, and to (4) close a reserve before it would
-naturally expire and possibly (5) wire the funds to a designated account.
+prevent a reserve from expiring, to (2) pay an annual fee to allow a number of
+purses to be created for the respective reserve without paying a purse fee
+each time, to (3) obtain KYC information associated with a reserve to prove
+the identity of the person sending an invoice to the payer, and to (4) close a
+reserve before it would naturally expire and possibly (5) wire the funds to a
+designated account.
.. note::
@@ -5162,7 +5144,7 @@ naturally expire and possibly (5) wire the funds to a designated account.
.. http:post:: /reserves/$RESERVE_PUB/open
- Request keeping a reserve open for tipping or invoicing.
+ Request keeping a reserve open for invoicing.
**Request:**
@@ -5447,3 +5429,61 @@ naturally expire and possibly (5) wire the funds to a designated account.
wire_amount: Amount;
}
+
+
+.. _delete-reserve:
+
+.. http:DELETE:: /reserves/$RESERVE_PUB
+
+ Forcefully closes a reserve.
+ The request header must contain an *Account-Request-Signature*.
+ Note: this endpoint is not currently implemented!
+
+ **Request:**
+
+ *Account-Request-Signature*: The client must provide Base-32 encoded EdDSA signature made with ``$ACCOUNT_PRIV``, affirming its authorization to delete the account. The purpose used MUST be ``TALER_SIGNATURE_RESERVE_CLOSE``.
+
+ :query force=BOOLEAN: *Optional.* If set to 'true' specified, the exchange
+ will delete the account even if there is a balance remaining.
+
+ **Response:**
+
+ :http:statuscode:`200 OK`:
+ The operation succeeded, the exchange provides details
+ about the account deletion.
+ The response will include a `ReserveDeletedResponse` object.
+ :http:statuscode:`403 Forbidden`:
+ The *Account-Request-Signature* is invalid.
+ This response comes with a standard `ErrorDetail` response.
+ :http:statuscode:`404 Not found`:
+ The account is unknown to the exchange.
+ :http:statuscode:`409 Conflict`:
+ The account is still has digital cash in it, the associated
+ wire method is ``void`` and the *force* option was not provided.
+ This response comes with a standard `ErrorDetail` response.
+
+ **Details:**
+
+ .. ts:def:: ReserveDeletedResponse
+
+ interface ReserveDeletedResponse {
+
+ // Final balance of the account.
+ closing_amount: Amount;
+
+ // Current time of the exchange, used as part of
+ // what the exchange signs over.
+ close_time: Timestamp;
+
+ // Hash of the wire account into which the remaining
+ // balance will be transferred. Note: may be the
+ // hash over ``payto://void/`, in which case the
+ // balance is forfeit to the profit of the exchange.
+ h_wire: HashCode;
+
+ // This is a signature over a
+ // struct ``TALER_AccountDeleteConfirmationPS`` with purpose
+ // ``TALER_SIGNATURE_EXCHANGE_RESERVE_DELETED``.
+ exchange_sig: EddsaSignature;
+
+ }