post-batch-issue-CHARITY_ID.rst (5263B)
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, the ``budikeypairs`` array is empty or contains malformed entries, 15 or the total donation amount exceeds the charity's per-year limit. 16 Returned with error code ``TALER_EC_GENERIC_PARAMETER_MALFORMED``, 17 ``TALER_EC_GENERIC_JSON_INVALID``, or 18 ``TALER_EC_DONAU_EXCEEDING_DONATION_LIMIT``. 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:`500 Internal Server Error`: 28 The Donau encountered an internal error, such as a database failure or 29 a signing helper problem. 30 Returned with error code ``TALER_EC_GENERIC_DB_FETCH_FAILED`` or 31 ``TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE`` 32 :http:statuscode:`503 Service unavailable`: 33 The donau is lacking the keys to create the donation statement. 34 Returned with error code 35 ``TALER_EC_DONAU_GENERIC_KEYS_MISSING``. 36 37 **Details:** 38 39 .. ts:def:: IssueReceiptsRequest 40 41 interface IssueReceiptsRequest { 42 43 // Signature by the charity approving that the 44 // Donau should sign the donation receipts below. 45 charity_sig: EddsaSignature; 46 47 // Year for which the donation receipts are expected. 48 // Also determines which keys are used to sign the 49 // blinded donation receipts. 50 year: Integer; 51 52 // Array of blinded donation receipts to sign. 53 // Must NOT be empty (if no donation receipts 54 // are desired, just leave the entire ``donau`` 55 // argument blank). 56 budikeypairs: BlindedDonationReceiptKeyPair[]; 57 } 58 59 .. ts:def:: BlindedDonationReceiptKeyPair 60 61 interface BlindedDonationReceiptKeyPair { 62 // Hash of the public key that should be used to sign 63 // the donation receipt. 64 h_donation_unit_pub: HashCode; 65 66 // Blinded value to give to the Donau to sign over. 67 blinded_udi: BlindedUniqueDonationIdentifier; 68 } 69 70 .. ts:def:: BlindedUniqueDonationIdentifier 71 72 type BlindedUniqueDonationIdentifier = RSABUDI | CSBUDI ; 73 74 .. ts:def:: RSABUDI 75 76 interface RSABUDI { 77 cipher: "RSA"; 78 rsa_blinded_identifier: string; // Crockford Base32 encoded 79 } 80 81 .. ts:def:: CSBUDI 82 83 // For donation unit signatures based on Blind Clause-Schnorr, the BUDI 84 // consists of the public nonce and two Curve25519 scalars which are two 85 // blinded challenges in the Blinded Clause-Schnorr signature scheme. 86 // See https://taler.net/papers/cs-thesis.pdf for details. 87 interface CSBUDI { 88 cipher: "CS"; 89 cs_nonce: string; // Crockford Base32 encoded 90 cs_blinded_c0: string; // Crockford Base32 encoded 91 cs_blinded_c1: string; // Crockford Base32 encoded 92 } 93 94 .. ts:def:: BUDIBlindingKeyP 95 96 // Secret for blinding/unblinding. 97 // An RSA blinding secret, which is basically 98 // a 256-bit nonce, converted to Crockford Base32. 99 type BUDIBlindingKeyP = string; 100 101 .. ts:def:: BlindedDonationReceiptSignaturesResponse 102 103 interface BlindedDonationReceiptSignaturesResponse { 104 // Total amount over which all the blind signatures are signing. 105 issued_amount: Amount; 106 107 // Array of the blind signatures. 108 blind_signatures: BlindedDonationReceiptSignature[]; 109 } 110 111 .. ts:def:: BlindedDonationReceiptSignature 112 113 type BlindedDonationReceiptSignature = 114 | RSABlindedDonationReceiptSignature 115 | CSBlindedDonationReceiptSignature; 116 117 .. ts:def:: RSABlindedDonationReceiptSignature 118 119 interface RSABlindedDonationReceiptSignature { 120 cipher: "RSA"; 121 122 // (blinded) RSA signature 123 blinded_rsa_signature: BlindedRsaSignature; 124 } 125 126 .. ts:def:: CSBlindedDonationReceiptSignature 127 128 interface CSBlindedDonationReceiptSignature { 129 cipher: "CS"; 130 131 // Signer chosen bit value, 0 or 1, used 132 // in Clause Blind Schnorr to make the 133 // ROS problem harder. 134 b: Integer; 135 136 // Blinded scalar calculated from c_b. 137 s: Cs25519Scalar; 138 } 139 140 .. ts:def:: IssueError 141 142 interface IssueError{ 143 max_per_year: Amount; 144 current_year: Amount; 145 } 146 147 .. ts:def:: DonationUnitUnknownError 148 149 interface DonationUnitUnknownError{ 150 unknown_hash_pub_donation_unit: HashCode[]; 151 donau_pub: EddsaPublicKey; 152 donau_sig: EddsaSignature; 153 } 154 155 .. ts:def:: DonationUnitExpiredMessage 156 157 interface DonationUnitExpiredMessage{ 158 h_donation_unit_pub: HashCode; 159 donau_pub: EddsaPublicKey; 160 donau_sig: EddsaSignature; 161 }