exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

taler-exchange-httpd_reveal-melt.h (2120B)


      1 /*
      2   This file is part of TALER
      3   Copyright (C) 2023 Taler Systems SA
      4 
      5   TALER is free software; you can redistribute it and/or modify it under the
      6   terms of the GNU Affero General Public License as published by the Free Software
      7   Foundation; either version 3, or (at your option) any later version.
      8 
      9   TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11   A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
     12 
     13   You should have received a copy of the GNU Affero General Public License along with
     14   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 */
     16 /**
     17  * @file taler-exchange-httpd_reveal-melt.h
     18  * @brief Handle /reveal-melt requests
     19  * @author Özgür Kesim
     20  */
     21 #ifndef TALER_EXCHANGE_HTTPD_REVEAL_MELT_H
     22 #define TALER_EXCHANGE_HTTPD_REVEAL_MELT_H
     23 
     24 #include <microhttpd.h>
     25 #include "taler-exchange-httpd.h"
     26 
     27 
     28 /**
     29  * Handle a "/reveal-melt" request.
     30  *
     31  * The client got a noreveal_index in response to a previous request
     32  * /melt.  It now has to reveal all n*(kappa-1) signatures (except for the
     33  * noreveal_index), signed by the old coin private key, over the coin's
     34  * specific nonce, which is derived per coin from the refresh_seed,
     35  * From that signature also all other coin-relevant data (blinding, age
     36  * restriction, nonce) are derived from.
     37  *
     38  * The exchange computes those values, potentially ensures that age restriction
     39  * is correctly applied, calculates the hash of the blinded envelopes, and -
     40  * together with the non-disclosed blinded envelopes - compares the hash of the
     41  * calculated melt commitment against the original.
     42  *
     43  * If all those checks and the used denominations turn out to be correct, the
     44  * exchange signs all blinded envelopes with their appropriate denomination
     45  * keys.
     46  *
     47  * @param rc request context
     48  * @param root uploaded JSON data
     49  * @param args not used
     50  * @return MHD result code
     51  */
     52 MHD_RESULT
     53 TEH_handler_reveal_melt (
     54   struct TEH_RequestContext *rc,
     55   const json_t *root,
     56   const char *const args[2]);
     57 
     58 #endif