taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit 3cb152194494f989d381f4a3a1a32509d3fb20ad
parent f67600b7f2f35e30655ba998ee4b466bdabda18b
Author: Özgür Kesim <oec-taler@kesim.org>
Date:   Tue,  4 Feb 2025 12:51:01 +0100

[common] refinement of withdraw specific structs

Definitions of TALER_WithdrawRequestDetailsP,
TALER_HashPlanchetsP, TALER_AgeMask added.

Diffstat:
Mcore/api-common.rst | 132++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
Mcore/api-exchange.rst | 16----------------
2 files changed, 80 insertions(+), 68 deletions(-)

diff --git a/core/api-common.rst b/core/api-common.rst @@ -456,6 +456,24 @@ Ages // An age is an integer between 0 and 255 measured in years. type Age = number; + +.. ts:def:: AgeMask + + // Binary representation of the age groups. + // The bits set in the mask mark the edges at the beginning of a next age + // group. F.e. for the age groups + // 0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-* + // the following bits are set: + // + // 31 24 16 8 0 + // | | | | | + // oooooooo oo1oo1o1 o1o1o1o1 ooooooo1 + // + // A value of 0 means that the exchange does not support the extension for + // age-restriction. + type AgeMask = Integer; + + Versions ^^^^^^^^ @@ -1193,15 +1211,10 @@ within the `exchange's codebase <https://docs.taler.net/global-licensing.html#exchange-repo>`_. -.. _TALER_WithdrawCommitmentP: +.. _TALER_WithdrawRequestDetailsP .. sourcecode:: c - struct TALER_WithdrawCommitmentP { - - /** - * The reserve's public key - */ - struct TALER_ReservePublicKeyP reserve_pub; + struct TALER_WithdrawRequestDetailsP { /** * Amount to withdraw, excluding fees, i.e. @@ -1228,11 +1241,10 @@ within the * to κ index=1 etc: * h[0][0]…h[0][n-1]h[1][0]…h[1][n-1] … h[κ-1][0]…h[κ-1][n-1] */ - struct GNUNET_HashCode h_planchets; + struct TALER_HashPlanchetsP h_planchets; /** - * If age restriction applies, maximum age _group_ to commit to, - * 0 otherwise. + * If age restriction applies, maximum age _group_ to commit to, 0 otherwise. * Note that if age restriction applies, all denominations * for all coins MUST support age restriction. * Also note that this is not an age (in years), but the age group @@ -1247,8 +1259,64 @@ within the * If max_age_group is > 0, the mask MUST be non-zero, too. */ struct TALER_AgeMask mask; + + }; + + +.. _TALER_HashPlanchetsP +.. sourcecode:: c + + /** + * This is the running SHA512-hash over all + * `TALER_BlindedCoinHashP` values of an array of coins. + * Note that each `TALER_BlindedCoinHashP` itself + * captures the hash of the corresponding denomination's + * public key. + */ + struct TALER_HashPlanchetsP { + struct GNUNET_HashCode hash; }; + +.. _TALER_AgeMask: +.. sourcecode:: c + + /** + * Binary representation of the age groups. + * The bits set in the mask mark the edges at the beginning of a next age + * group. F.e. for the age groups + * 0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-* + * the following bits are set: + * + * 31 24 16 8 0 + * | | | | | + * oooooooo oo1oo1o1 o1o1o1o1 ooooooo1 + * + * A value of 0 means that the exchange does not support the extension for + * age-restriction. + */ + struct TALER_AgeMask { + uint32_t mask; + }; + + +.. _TALER_WithdrawCommitmentP: +.. sourcecode:: c + + struct TALER_WithdrawCommitmentP { + + /** + * The reserve's public key + */ + struct TALER_ReservePublicKeyP reserve_pub; + + /** + * The details of the withdraw request + */ + struct TALER_WithdrawRequestDetailsP details; + }; + + .. _TALER_WithdrawCommitmentHashP: .. sourcecode:: c @@ -1278,49 +1346,9 @@ within the struct GNUNET_CRYPTO_EccSignaturePurpose purpose; /** - * Amount to withdraw, excluding fees, i.e. - * the total sum of the denominations of the coins. - * Note that the reserve must have a value of at least amount+fee. - */ - struct TALER_Amount amount; - - /** - * Total fee for the withdrawal. - * Note that the reserve must have a value of at least amount+fee. + * The details of the withdraw request */ - struct TALER_Amount fee; - - /** - * This is the running SHA512-hash over all - * `TALER_BlindedCoinHashP` values of the coins. - * Note that each `TALER_BlindedCoinHashP` itself - * captures the hash of the corresponding denomination's - * public key. - * If max_age was set in the withdraw request, there will be - * n*κ many such values. The iteration MUST be first over - * all coins belonging to κ index=0, then all coins - * to κ index=1 etc: - * h[0][0]…h[0][n-1]h[1][0]…h[1][n-1] … h[κ-1][0]…h[κ-1][n-1] - */ - struct GNUNET_HashCode h_planchets; - - /** - * If age restriction applies, maximum age _group_ to commit to, - * 0 otherwise. - * Note that if age restriction applies, all denominations - * for all coins MUST support age restriction. - * Also note that this is not an age (in years), but the age group - * (an index) according to list of age groups in the configuration - * of the exchange. See TALER_get_max_group() how to calculate - * the age group to a given age (in years). - */ - uint32_t max_age_group; - - /** - * The age groups as configured for the exchange, represented as a mask. - * If max_age_group is > 0, the mask MUST be non-zero, too. - */ - struct TALER_AgeMask mask; + struct TALER_WithdrawRequestDetailsP details; }; diff --git a/core/api-exchange.rst b/core/api-exchange.rst @@ -486,22 +486,6 @@ possibly by using HTTPS. } - .. ts:def:: AgeMask - - // Binary representation of the age groups. - // The bits set in the mask mark the edges at the beginning of a next age - // group. F.e. for the age groups - // 0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-21, 21-* - // the following bits are set: - // - // 31 24 16 8 0 - // | | | | | - // oooooooo oo1oo1o1 o1o1o1o1 ooooooo1 - // - // A value of 0 means that the exchange does not support the extension for - // age-restriction. - type AgeMask = Integer; - .. ts:def:: DenomGroup type DenomGroup =