summaryrefslogtreecommitdiff
path: root/src/include/taler_signatures.h
blob: 0137ff65e3c59fa22ebc2aa714ea1355e51ff45c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
/*
  This file is part of TALER
  Copyright (C) 2014-2022 Taler Systems SA

  TALER is free software; you can redistribute it and/or modify it under the
  terms of the GNU General Public License as published by the Free Software
  Foundation; either version 3, or (at your option) any later version.

  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with
  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
*/
/**
 * @file taler_signatures.h
 * @brief message formats and signature constants used to define
 *        the binary formats of signatures in Taler
 * @author Florian Dold
 * @author Benedikt Mueller
 *
 * This file should define the constants and C structs that one needs
 * to know to implement Taler clients (wallets or merchants or
 * auditor) that need to produce or verify Taler signatures.
 */
#ifndef TALER_SIGNATURES_H
#define TALER_SIGNATURES_H

#include <gnunet/gnunet_util_lib.h>
#include "taler_amount_lib.h"
#include "taler_crypto_lib.h"

/*********************************************/
/* Exchange offline signatures (with master key) */
/*********************************************/

/**
 * The given revocation key was revoked and must no longer be used.
 */
#define TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED 1020

/**
 * Add payto URI to the list of our wire methods.
 */
#define TALER_SIGNATURE_MASTER_ADD_WIRE 1021

/**
 * Signature over global set of fees charged by the
 * exchange.
 */
#define TALER_SIGNATURE_MASTER_GLOBAL_FEES 1022

/**
 * Remove payto URI from the list of our wire methods.
 */
#define TALER_SIGNATURE_MASTER_DEL_WIRE 1023

/**
 * Purpose for signing public keys signed by the exchange master key.
 */
#define TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY 1024

/**
 * Purpose for denomination keys signed by the exchange master key.
 */
#define TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY 1025

/**
 * Add an auditor to the list of our auditors.
 */
#define TALER_SIGNATURE_MASTER_ADD_AUDITOR 1026

/**
 * Remove an auditor from the list of our auditors.
 */
#define TALER_SIGNATURE_MASTER_DEL_AUDITOR 1027

/**
 * Fees charged per (aggregate) wire transfer to the merchant.
 */
#define TALER_SIGNATURE_MASTER_WIRE_FEES 1028

/**
 * The given revocation key was revoked and must no longer be used.
 */
#define TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED 1029

/**
 * Signature where the Exchange confirms its IBAN details in
 * the /wire response.
 */
#define TALER_SIGNATURE_MASTER_WIRE_DETAILS 1030

/**
 * Set the configuration of an extension (age-restriction or peer2peer)
 */
#define TALER_SIGNATURE_MASTER_EXTENSION 1031

/**
 * Signature affirming a partner configuration for wads.
 */
#define TALER_SIGNATURE_MASTER_PARTNER_DETAILS 1032

/*********************************************/
/* Exchange online signatures (with signing key) */
/*********************************************/

/**
 * Purpose for the state of a reserve, signed by the exchange's signing
 * key.
 */
#define TALER_SIGNATURE_EXCHANGE_RESERVE_STATUS 1032

/**
 * Signature where the Exchange confirms a deposit request.
 */
#define TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT 1033

/**
 * Signature where the exchange (current signing key) confirms the
 * no-reveal index for cut-and-choose and the validity of the melted
 * coins.
 */
#define TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT 1034

/**
 * Signature where the Exchange confirms the full /keys response set.
 */
#define TALER_SIGNATURE_EXCHANGE_KEY_SET 1035

/**
 * Signature where the Exchange confirms the /track/transaction response.
 */
#define TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE 1036

/**
 * Signature where the Exchange confirms the /wire/deposit response.
 */
#define TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT 1037

/**
 * Signature where the Exchange confirms a refund request.
 */
#define TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND 1038

/**
 * Signature where the Exchange confirms a recoup.
 */
#define TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP 1039

/**
 * Signature where the Exchange confirms it closed a reserve.
 */
#define TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED 1040

/**
 * Signature where the Exchange confirms a recoup-refresh operation.
 */
#define TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH 1041

/**
 * Signature where the Exchange confirms that it does not know a denomination (hash).
 */
#define TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_UNKNOWN 1042

/**
 * Signature where the Exchange confirms that it does not consider a denomination valid for the given operation
 * at this time.
 */
#define TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_EXPIRED 1043

/**
 * Signature by which an exchange affirms that an account
 * successfully passed the KYC checks.
 */
#define TALER_SIGNATURE_EXCHANGE_ACCOUNT_SETUP_SUCCESS 1044

/**
 * Signature by which the exchange affirms that a purse
 * was created with a certain amount deposited into it.
 */
#define TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_CREATION 1045


/**
 * Signature by which the exchange affirms that a purse
 * was merged into a reserve with a certain amount in it.
 */
#define TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_MERGED 1046

/**********************/
/* Auditor signatures */
/**********************/

/**
 * Signature where the auditor confirms that he is
 * aware of certain denomination keys from the exchange.
 */
#define TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS 1064


/***********************/
/* Merchant signatures */
/***********************/

/**
 * Signature where the merchant confirms a contract (to the customer).
 */
#define TALER_SIGNATURE_MERCHANT_CONTRACT 1101

/**
 * Signature where the merchant confirms a refund (of a coin).
 */
#define TALER_SIGNATURE_MERCHANT_REFUND 1102

/**
 * Signature where the merchant confirms that he needs the wire
 * transfer identifier for a deposit operation.
 */
#define TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION 1103

/**
 * Signature where the merchant confirms that the payment was
 * successful
 */
#define TALER_SIGNATURE_MERCHANT_PAYMENT_OK 1104

/**
 * Signature where the merchant confirms its own (salted)
 * wire details (not yet really used).
 */
#define TALER_SIGNATURE_MERCHANT_WIRE_DETAILS 1107


/*********************/
/* Wallet signatures */
/*********************/

/**
 * Signature where the reserve key confirms a withdraw request.
 */
#define TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW 1200

/**
 * Signature made by the wallet of a user to confirm a deposit of a coin.
 */
#define TALER_SIGNATURE_WALLET_COIN_DEPOSIT 1201

/**
 * Signature using a coin key confirming the melting of a coin.
 */
#define TALER_SIGNATURE_WALLET_COIN_MELT 1202

/**
 * Signature using a coin key requesting recoup.
 */
#define TALER_SIGNATURE_WALLET_COIN_RECOUP 1203

/**
 * Signature using a coin key authenticating link data.
 */
#define TALER_SIGNATURE_WALLET_COIN_LINK 1204

/**
 * Signature using a reserve key by which a wallet
 * requests a payment target UUID for itself.
 * Signs over just a purpose (no body), as the
 * signature only serves to demonstrate that the request
 * comes from the wallet controlling the private key,
 * and not some third party.
 */
#define TALER_SIGNATURE_WALLET_ACCOUNT_SETUP 1205

/**
 * Signature using a coin key requesting recoup-refresh.
 */
#define TALER_SIGNATURE_WALLET_COIN_RECOUP_REFRESH 1206

/**
 * Signature using a age restriction key for attestation of a particular
 * age/age-group.
 */
#define TALER_SIGNATURE_WALLET_AGE_ATTESTATION 1207

/**
 * Request full reserve history and pay for it.
 */
#define TALER_SIGNATURE_WALLET_RESERVE_HISTORY 1208

/**
 * Request detailed account status (for free).
 */
#define TALER_SIGNATURE_WALLET_RESERVE_STATUS 1209

/**
 * Request purse creation (without reserve).
 */
#define TALER_SIGNATURE_WALLET_PURSE_CREATE 1210

/**
 * Request coin to be deposited into a purse.
 */
#define TALER_SIGNATURE_WALLET_PURSE_DEPOSIT 1211

/**
 * Request purse status.
 */
#define TALER_SIGNATURE_WALLET_PURSE_STATUS 1212

/**
 * Request purse to be merged with a reserve (by purse).
 */
#define TALER_SIGNATURE_WALLET_PURSE_MERGE 1213

/**
 * Request purse to be merged with a reserve (by account).
 */
#define TALER_SIGNATURE_WALLET_ACCOUNT_MERGE 1214

/**
 * Request account to be closed.
 */
#define TALER_SIGNATURE_WALLET_RESERVE_CLOSE 1215

/**
 * Associates encrypted contract with a purse.
 */
#define TALER_SIGNATURE_WALLET_PURSE_ECONTRACT 1216

/******************************/
/* Security module signatures */
/******************************/

/**
 * Signature on a denomination key announcement.
 */
#define TALER_SIGNATURE_SM_RSA_DENOMINATION_KEY 1250

/**
 * Signature on an exchange message signing key announcement.
 */
#define TALER_SIGNATURE_SM_SIGNING_KEY 1251

/**
 * Signature on a denomination key announcement.
 */
#define TALER_SIGNATURE_SM_CS_DENOMINATION_KEY 1252

/*******************/
/* Test signatures */
/*******************/

/**
 * EdDSA test signature.
 */
#define TALER_SIGNATURE_CLIENT_TEST_EDDSA 1302

/**
 * EdDSA test signature.
 */
#define TALER_SIGNATURE_EXCHANGE_TEST_EDDSA 1303


/************************/
/* Anastasis signatures */
/************************/

/**
 * EdDSA signature for a policy upload.
 */
#define TALER_SIGNATURE_ANASTASIS_POLICY_UPLOAD 1400


/*******************/
/* Sync signatures */
/*******************/


/**
 * EdDSA signature for a backup upload.
 */
#define TALER_SIGNATURE_SYNC_BACKUP_UPLOAD 1450


GNUNET_NETWORK_STRUCT_BEGIN


/**
 * @brief Format used to generate the signature on a request to obtain
 * the wire transfer identifier associated with a deposit.
 */
struct TALER_DepositTrackPS
{
  /**
   * Purpose must be #TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION.
   */
  struct GNUNET_CRYPTO_EccSignaturePurpose purpose;

  /**
   * Hash over the proposal data of the contract for which this deposit is made.
   */
  struct TALER_PrivateContractHashP h_contract_terms GNUNET_PACKED;

  /**
   * Hash over the wiring information of the merchant.
   */
  struct TALER_MerchantWireHashP h_wire GNUNET_PACKED;

  /**
   * The Merchant's public key.  The deposit inquiry request is to be
   * signed by the corresponding private key (using EdDSA).
   */
  struct TALER_MerchantPublicKeyP merchant;

  /**
   * The coin's public key.  This is the value that must have been
   * signed (blindly) by the Exchange.
   */
  struct TALER_CoinSpendPublicKeyP coin_pub;

};


GNUNET_NETWORK_STRUCT_END

#endif