aboutsummaryrefslogtreecommitdiff
path: root/src/mint/mint.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-28 14:55:25 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-28 14:55:25 +0100
commit49d4f24f8d031a9301676196bd6a17ea3e54cb62 (patch)
tree3bb4e1a73fff39eaf68839bba723be63f3ace6ad /src/mint/mint.h
parentea3fac606311d1c14362d387960a4913182b629e (diff)
misc cleanup, moving TALER_MINT_config_load to libtalerutil
Diffstat (limited to 'src/mint/mint.h')
-rw-r--r--src/mint/mint.h189
1 files changed, 97 insertions, 92 deletions
diff --git a/src/mint/mint.h b/src/mint/mint.h
index 05e966e1c..0a0e00d04 100644
--- a/src/mint/mint.h
+++ b/src/mint/mint.h
@@ -35,6 +35,11 @@
#define DIR_SIGNKEYS "signkeys"
#define DIR_DENOMKEYS "denomkeys"
+/**
+ * For now, we just do EUR. Should become configurable
+ * in the future!
+ */
+#define MINT_CURRENCY "EUR"
/**
* On disk format used for a mint signing key.
@@ -63,7 +68,9 @@ struct TALER_MINT_DenomKeyIssuePriv
/**
- * Public information about a coin.
+ * Public information about a coin (including the public key
+ * of the coin, the denomination key and the signature with
+ * the denomination key).
*/
struct TALER_CoinPublicInfo
{
@@ -119,6 +126,92 @@ struct CollectableBlindcoin
/**
+ * Specification for a /deposit operation.
+ */
+struct Deposit
+{
+ /**
+ * Information about the coin that is being deposited.
+ */
+ struct TALER_CoinPublicInfo coin;
+
+ /**
+ * ECDSA signature affirming that the customer intends
+ * this coin to be deposited at the merchant identified
+ * by @e h_wire in relation to the contract identified
+ * by @e h_contract.
+ */
+ struct GNUNET_CRYPTO_EcdsaSignature csig;
+
+ /**
+ * Public key of the merchant. Enables later identification
+ * of the merchant in case of a need to rollback transactions.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey merchant_pub;
+
+ /**
+ * Hash over the contract between merchant and customer
+ * (remains unknown to the Mint).
+ */
+ struct GNUNET_HashCode h_contract;
+
+ /**
+ * Hash of the (canonical) representation of @e wire, used
+ * to check the signature on the request. Generated by
+ * the mint from the detailed wire data provided by the
+ * merchant.
+ */
+ struct GNUNET_HashCode h_wire;
+
+ /**
+ * Detailed wire information for executing the transaction.
+ */
+ const json_t *wire;
+
+ /**
+ * Merchant-generated transaction ID to detect duplicate
+ * transactions.
+ */
+ uint64_t transaction_id;
+
+ /**
+ * Fraction of the coin's remaining value to be deposited.
+ * The coin is identified by @e coin_pub.
+ */
+ struct TALER_Amount amount;
+
+ /**
+ * Type of the deposit (also purpose of the signature). Either
+ * #TALER_SIGNATURE_DEPOSIT or #TALER_SIGNATURE_INCREMENTAL_DEPOSIT.
+ */
+ uint32_t purpose; // FIXME: bad type, use ENUM!
+
+
+};
+
+
+
+/**
+ * FIXME
+ */
+struct KnownCoin
+{
+ struct TALER_CoinPublicInfo public_info;
+
+ /**
+ * Refreshing session, only valid if
+ * is_refreshed==1.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey refresh_session_pub;
+
+ struct TALER_Amount expended_balance;
+
+ int is_refreshed;
+
+};
+
+
+/**
* Global information for a refreshing session.
*/
struct RefreshSession
@@ -168,6 +261,9 @@ struct RefreshSession
};
+
+
+
/**
* For each (old) coin being melted, we have a `struct
* RefreshCommitLink` that allows the user to find the shared secret
@@ -214,89 +310,8 @@ struct RefreshCommitCoin
};
-/**
- * FIXME
- */
-struct KnownCoin
-{
- struct TALER_CoinPublicInfo public_info;
-
- /**
- * Refreshing session, only valid if
- * is_refreshed==1.
- */
- struct GNUNET_CRYPTO_EddsaPublicKey refresh_session_pub;
-
- struct TALER_Amount expended_balance;
- int is_refreshed;
-};
-
-
-/**
- * Specification for a /deposit operation.
- */
-struct Deposit
-{
- /**
- * Information about the coin that is being deposited.
- */
- struct TALER_CoinPublicInfo coin;
-
- /**
- * EdDSA signature affirming that the customer intends
- * this coin to be deposited at the merchant identified
- * by @e h_wire in relation to the contract identified
- * by @e h_contract.
- */
- struct GNUNET_CRYPTO_EddsaSignature csig;
-
- /**
- * Public key of the merchant. Enables later identification
- * of the merchant in case of a need to rollback transactions.
- */
- struct GNUNET_CRYPTO_EddsaPublicKey merchant_pub;
-
- /**
- * Hash over the contract between merchant and customer
- * (remains unknown to the Mint).
- */
- struct GNUNET_HashCode h_contract;
-
- /**
- * Hash of the (canonical) representation of @e wire, used
- * to check the signature on the request. Generated by
- * the mint from the detailed wire data provided by the
- * merchant.
- */
- struct GNUNET_HashCode h_wire;
-
- /**
- * Detailed wire information for executing the transaction.
- */
- const json_t *wire;
-
- /**
- * Merchant-generated transaction ID to detect duplicate
- * transactions.
- */
- uint64_t transaction_id;
-
- /**
- * Fraction of the coin's remaining value to be deposited.
- * The coin is identified by @e coin_pub.
- */
- struct TALER_AmountNBO amount;
-
- /**
- * Type of the deposit (also purpose of the signature). Either
- * #TALER_SIGNATURE_DEPOSIT or #TALER_SIGNATURE_INCREMENTAL_DEPOSIT.
- */
- uint32_t purpose; // FIXME: bad type, use ENUM!
-
-
-};
/**
@@ -412,16 +427,6 @@ TALER_MINT_read_denom_key (const char *filename,
struct TALER_MINT_DenomKeyIssuePriv *dki);
-/**
- * Load the configuration for the mint in the given
- * directory.
- *
- * @param mint_base_dir the mint's base directory
- * @return the mint configuratin, or NULL on error
- */
-struct GNUNET_CONFIGURATION_Handle *
-TALER_MINT_config_load (const char *mint_base_dir);
-
int
TALER_TALER_DB_extract_amount (PGresult *result,