diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/api-common.rst | 7 | ||||
-rw-r--r-- | core/api-exchange.rst | 93 |
2 files changed, 87 insertions, 13 deletions
diff --git a/core/api-common.rst b/core/api-common.rst index 51a1faba..3c65e5c6 100644 --- a/core/api-common.rst +++ b/core/api-common.rst @@ -418,6 +418,13 @@ Signatures // `base32` encoded RSA blinding secret. type RsaBlindingKeySecret = string; +.. ts:def:: DenominationBlindingKeySecret + + // Union, not (!) discriminated! + // (Note: CS Blinding Key secret is yet to be defined&added here). + type DenominationBlindingKeySecret = + | RsaBlindingKeySecret; + .. _amount: Amounts diff --git a/core/api-exchange.rst b/core/api-exchange.rst index 1fa4b0b9..3edd5311 100644 --- a/core/api-exchange.rst +++ b/core/api-exchange.rst @@ -258,8 +258,8 @@ possibly by using HTTPS. // transactions involving this coin. stamp_expire_legal: Timestamp; - // Public (RSA) key for the denomination. - denom_pub: RsaPublicKey; + // Public key for the denomination. + denom_pub: DenominationKey; // Fee charged by the exchange for withdrawing a coin of this denomination. fee_withdraw: Amount; @@ -277,6 +277,32 @@ possibly by using HTTPS. master_sig: EddsaSignature; } + .. ts:def:: DenominationKey + + type DenominationKey = + | RsaDenominationKey + | CSDenominationKey; + + .. ts:def:: RsaDenominationKey { + cipher: "RSA"; + + // 32-bit age mask. + age_mask: Integer; + + // RSA public key + rsa_public_key: RsaPublicKey; + } + + .. ts:def:: CSDenominationKey { + cipher: "CS"; + + // 32-bit age mask. + age_mask: Integer; + + // FIXME: tbd + + } + Fees for any of the operations can be zero, but the fields must still be present. The currency of the ``fee_deposit``, ``fee_refresh`` and ``fee_refund`` must match the currency of the ``value``. Theoretically, the ``fee_withdraw`` could be in a @@ -1487,9 +1513,29 @@ exchange. .. ts:def:: WithdrawResponse interface WithdrawResponse { - // The blinded RSA signature over the 'coin_ev', affirms the coin's + // The blinded signature over the 'coin_ev', affirms the coin's // validity after unblinding. - ev_sig: BlindedRsaSignature; + ev_sig: BlindedDenominationSignature; + + } + + .. ts:def:: BlindedDenominationSignature + + type BlindedDenominationSignature = + | RsaBlindedDenominationSignature + | CSBlindedDenominationSignature; + + .. ts:def:: RsaBlindedDenominationSignature { + cipher: "RSA"; + + // (blinded) RSA signature + blinded_rsa_signature: BlindedRsaSignature; + } + + .. ts:def:: CSBlindedDenominationSignature { + type: "CS"; + + // FIXME: tbd } @@ -1659,7 +1705,7 @@ denomination. denom_pub_hash: HashCode; // Exchange's unblinded RSA signature of the coin. - ub_sig: RsaSignature; + ub_sig: DenominationSignature; // Timestamp when the contract was finalized. timestamp: Timestamp; @@ -1681,6 +1727,27 @@ denomination. coin_sig: EddsaSignature; } + .. ts:def:: DenominationSignature + + type DenominationSignature = + | RsaDenominationSignature + | CSDenominationSignature; + + .. ts:def:: RsaDenominationSignature { + cipher: "RSA"; + + // RSA signature + rsa_signature: RsaSignature; + } + + .. ts:def:: CSBDenominationSignature { + type: "CS"; + + // FIXME: tbd + + } + + The deposit operation succeeds if the coin is valid for making a deposit and has enough residual value that has not already been deposited or melted. @@ -1943,10 +2010,10 @@ denomination. exchange_pub: EddsaPublicKey; // Blinding factor of the revoked new coin. - new_coin_blinding_secret: RsaBlindingKeySecret; + new_coin_blinding_secret: DenominationBlindingKeySecret; // Blinded public key of the revoked new coin. - new_coin_ev: RsaBlindingKeySecret; + new_coin_ev: DenominationBlindingKeySecret; } .. ts:def:: CoinPurseDepositTransaction @@ -2081,7 +2148,7 @@ the API during normal operation. denom_pub_hash: HashCode; // Signature over the `coin public key <eddsa-coin-pub>` by the denomination. - denom_sig: RsaSignature; + denom_sig: DenominationSignature; // Signature by the `coin <coin-priv>` over the melt commitment. confirm_sig: EddsaSignature; @@ -2235,7 +2302,7 @@ the API during normal operation. interface RevealResponse { // List of the exchange's blinded RSA signatures on the new coins. - ev_sigs : Array<{ ev_sig: BlindedRsaSignature }>; + ev_sigs : Array<{ ev_sig: BlindedDenominationSignature }>; } @@ -2291,7 +2358,7 @@ the API during normal operation. denom_pub: RsaPublicKey; // Exchange's blinded signature over the fresh coin. - ev_sig: BlindedRsaSignature; + ev_sig: BlindedDenominationSignature; // Blinded coin. coin_ev : CoinEnvelope; @@ -2374,10 +2441,10 @@ in using this API. denom_pub_hash: HashCode; // Signature over the `coin public key <eddsa-coin-pub>` by the denomination. - denom_sig: RsaSignature; + denom_sig: DenominationSignature; // Coin's blinding factor. - coin_blind_key_secret: RsaBlindingKeySecret; + coin_blind_key_secret: DenominationBlindingKeySecret; // Signature of `TALER_RecoupRequestPS` created with // the `coin's private key <coin-priv>`. @@ -2914,7 +2981,7 @@ Wallet-to-wallet transfers denom_pub_hash: HashCode; // Exchange's unblinded RSA signature of the coin. - ub_sig: RsaSignature; + ub_sig: DenominationSignature; // Signature over `TALER_PurseDepositSignaturePS` // of purpose ``TALER_SIGNATURE_PURSE_DEPOSIT`` |