post-batch-issue-CHARITY_ID.rst (6370B)
1 .. http:POST:: /batch-issue/$CHARITY_ID 2 3 Send in a `IssueReceiptsRequest` and ask the Donau to sign all it's contained BUDIs. 4 5 **Request:** `IssueReceiptsRequest` 6 7 **Response:** 8 9 :http:statuscode:`200 OK`: 10 The request was successful, and the response is a `BlindedDonationReceiptSignaturesResponse`. 11 Also returned for idempotent re-requests of an already-processed batch. 12 :http:statuscode:`400 Bad Request`: 13 The request was malformed. This can occur when the ``$CHARITY_ID`` cannot be 14 parsed, or the ``budikeypairs`` array is empty or contains malformed entries. 15 Returned with error code ``TALER_EC_GENERIC_PARAMETER_MALFORMED`` or 16 ``TALER_EC_GENERIC_JSON_INVALID``. 17 Before protocol **v2**, an exceeded per-year limit was also 18 reported with this status (see 409). 19 :http:statuscode:`403 Forbidden`: 20 The charity signature is invalid. 21 Returned with error code ``TALER_EC_DONAU_CHARITY_SIGNATURE_INVALID``. 22 :http:statuscode:`404 Not Found`: 23 The charity is unknown to the Donau, or at least one of the referenced 24 donation unit keys could not be found. 25 Returned with error code ``TALER_EC_DONAU_CHARITY_NOT_FOUND`` or 26 ``TALER_EC_DONAU_GENERIC_DONATION_UNIT_UNKNOWN``. 27 :http:statuscode:`409 Conflict`: 28 The request conflicts with the state of the Donau. Clients must 29 distinguish the cases by the error code: 30 31 * ``TALER_EC_DONAU_GENERIC_DONATION_UNIT_WRONG_YEAR``: the year specified 32 does not match the validity year for the given donation unit key. 33 * ``TALER_EC_DONAU_EXCEEDING_DONATION_LIMIT``: the total donation amount 34 exceeds what remains of the charity's per-year limit. 35 Since protocol **v2**; before, this was a 400. 36 :http:statuscode:`410 Gone`: 37 The year specified is in the past, and the Donau does 38 not permit issuing donation receipts in the past. The 39 client should pick a donation unit from the current year. 40 Returned with an error code of 41 ``TALER_EC_DONAU_GENERIC_DONATION_UNIT_EXPIRED``. 42 :http:statuscode:`425 Too Early`: 43 The year specified is in the future, and the Donau 44 does not permit issuing donation receipts in the future. 45 The client may retry the request in the specified year, 46 at that point it may succeed. Returned with an error code of 47 ``TALER_EC_DONAU_GENERIC_DONATION_UNIT_TOO_EARLY``. 48 :http:statuscode:`500 Internal Server Error`: 49 The Donau encountered an internal error, such as a database failure or 50 a signing helper problem. 51 Returned with error code ``TALER_EC_GENERIC_DB_FETCH_FAILED`` or 52 ``TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE`` 53 :http:statuscode:`503 Service unavailable`: 54 The donau is lacking the keys to create the donation statement. 55 Returned with error code 56 ``TALER_EC_DONAU_GENERIC_KEYS_MISSING``. 57 58 **Details:** 59 60 .. ts:def:: IssueReceiptsRequest 61 62 interface IssueReceiptsRequest { 63 64 // Signature by the charity approving that the 65 // Donau should sign the donation receipts below. 66 charity_sig: EddsaSignature; 67 68 // Year for which the donation receipts are expected. 69 // Also determines which keys are used to sign the 70 // blinded donation receipts. 71 year: Integer; 72 73 // Array of blinded donation receipts to sign. 74 // Must NOT be empty (if no donation receipts 75 // are desired, just leave the entire ``donau`` 76 // argument blank). 77 budikeypairs: BlindedDonationReceiptKeyPair[]; 78 } 79 80 .. ts:def:: BlindedDonationReceiptKeyPair 81 82 interface BlindedDonationReceiptKeyPair { 83 // Hash of the public key that should be used to sign 84 // the donation receipt. 85 h_donation_unit_pub: HashCode; 86 87 // Blinded value to give to the Donau to sign over. 88 blinded_udi: BlindedUniqueDonationIdentifier; 89 } 90 91 .. ts:def:: BlindedUniqueDonationIdentifier 92 93 type BlindedUniqueDonationIdentifier = RSABUDI | CSBUDI ; 94 95 .. ts:def:: RSABUDI 96 97 interface RSABUDI { 98 cipher: "RSA"; 99 rsa_blinded_identifier: string; // Crockford Base32 encoded 100 } 101 102 .. ts:def:: CSBUDI 103 104 // For donation unit signatures based on Blind Clause-Schnorr, the BUDI 105 // consists of the public nonce and two Curve25519 scalars which are two 106 // blinded challenges in the Blinded Clause-Schnorr signature scheme. 107 // See https://taler.net/papers/cs-thesis.pdf for details. 108 interface CSBUDI { 109 cipher: "CS"; 110 cs_nonce: string; // Crockford Base32 encoded 111 cs_blinded_c0: string; // Crockford Base32 encoded 112 cs_blinded_c1: string; // Crockford Base32 encoded 113 } 114 115 .. ts:def:: BUDIBlindingKeyP 116 117 // Secret for blinding/unblinding. 118 // An RSA blinding secret, which is basically 119 // a 256-bit nonce, converted to Crockford Base32. 120 type BUDIBlindingKeyP = string; 121 122 .. ts:def:: BlindedDonationReceiptSignaturesResponse 123 124 interface BlindedDonationReceiptSignaturesResponse { 125 // Total amount over which all the blind signatures are signing. 126 issued_amount: Amount; 127 128 // Array of the blind signatures. 129 blind_signatures: BlindedDonationReceiptSignature[]; 130 } 131 132 .. ts:def:: BlindedDonationReceiptSignature 133 134 type BlindedDonationReceiptSignature = 135 | RSABlindedDonationReceiptSignature 136 | CSBlindedDonationReceiptSignature; 137 138 .. ts:def:: RSABlindedDonationReceiptSignature 139 140 interface RSABlindedDonationReceiptSignature { 141 cipher: "RSA"; 142 143 // (blinded) RSA signature 144 blinded_rsa_signature: BlindedRsaSignature; 145 } 146 147 .. ts:def:: CSBlindedDonationReceiptSignature 148 149 interface CSBlindedDonationReceiptSignature { 150 cipher: "CS"; 151 152 // Signer chosen bit value, 0 or 1, used 153 // in Clause Blind Schnorr to make the 154 // ROS problem harder. 155 b: Integer; 156 157 // Blinded scalar calculated from c_b. 158 s: Cs25519Scalar; 159 } 160 161 .. ts:def:: IssueError 162 163 interface IssueError{ 164 max_per_year: Amount; 165 current_year: Amount; 166 } 167 168 .. ts:def:: DonationUnitUnknownError 169 170 interface DonationUnitUnknownError{ 171 unknown_hash_pub_donation_unit: HashCode[]; 172 donau_pub: EddsaPublicKey; 173 donau_sig: EddsaSignature; 174 } 175 176 .. ts:def:: DonationUnitExpiredMessage 177 178 interface DonationUnitExpiredMessage{ 179 h_donation_unit_pub: HashCode; 180 donau_pub: EddsaPublicKey; 181 donau_sig: EddsaSignature; 182 }