From d2917889767cf71ae0ad8d79ebe62ccf6b9a350e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 20 Jan 2016 18:03:44 +0100 Subject: [PATCH] spelling out what information mint should sign for TALER_SIGNATURE_MINT_CONFIRM_WIRE --- src/include/taler_crypto_lib.h | 33 +++++++++++++++---- src/include/taler_signatures.h | 60 +++++++++++++++++++++++++++++++++- 2 files changed, 85 insertions(+), 8 deletions(-) diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 20cb434f1..36ca6a023 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -429,13 +429,15 @@ struct TALER_RefreshLinkDecrypted /** - * Binary information encoded in Crockford's Base32 in wire transfer - * subjects of transfers from Taler to a merchant. The actual value - * is chosen by the mint and has no particular semantics, other than - * being unique so that the mint can lookup details about the wire - * transfer when needed. + * Length of the raw value in the Taler wire transfer identifier + * (in binary representation). */ -struct TALER_WireTransferIdentifierP +#define TALER_WIRE_TRANSFER_IDENTIFIER_LEN 32 + +/** + * Raw value of a wire transfer subjects, without the checksum. + */ +struct TALER_WireTransferIdentifierRawP { /** @@ -450,7 +452,24 @@ struct TALER_WireTransferIdentifierP * encode the actual value (i.e. a 256-bit / 32-byte public key or * a hash code), and the last byte for a minimalistic checksum. */ - uint8_t raw[32]; + uint8_t raw[TALER_WIRE_TRANSFER_IDENTIFIER_LEN]; +}; + + +/** + * Binary information encoded in Crockford's Base32 in wire transfer + * subjects of transfers from Taler to a merchant. The actual value + * is chosen by the mint and has no particular semantics, other than + * being unique so that the mint can lookup details about the wire + * transfer when needed. + */ +struct TALER_WireTransferIdentifierP +{ + + /** + * Raw value. + */ + struct TALER_WireTransferIdentifierRawP raw; /** * Checksum using CRC8 over the @e raw data. diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h index ac0119831..62e602a01 100644 --- a/src/include/taler_signatures.h +++ b/src/include/taler_signatures.h @@ -880,7 +880,65 @@ struct TALER_ConfirmWirePS */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - // FIXME: add details (#3888:10056) + /** + * Hash over the wiring information of the merchant. + */ + struct GNUNET_HashCode h_wire GNUNET_PACKED; + + /** + * Hash over the contract for which this deposit is made. + */ + struct GNUNET_HashCode h_contract GNUNET_PACKED; + + /** + * Raw value (binary encoding) of the wire transfer subject. + */ + struct TALER_WireTransferIdentifierRawP raw; + + /** + * The coin's public key. This is the value that must have been + * signed (blindly) by the Mint. + */ + struct TALER_CoinSpendPublicKeyP coin_pub; + + /** + * Merchant-generated transaction ID to detect duplicate + * transactions. The merchant must communicate a merchant-unique ID + * to the customer for each transaction. Note that different coins + * that are part of the same transaction can use the same + * transaction ID. The transaction ID is useful for later disputes, + * and the merchant's contract offer (@e h_contract) with the + * customer should include the offer's term and transaction ID + * signed with a key from the merchant. + */ + uint64_t transaction_id GNUNET_PACKED; + + /** + * When did the mint execute this transfer? Note that the + * timestamp may not be exactly the same on the wire, i.e. + * because the wire has a different timezone or resolution. + */ + struct GNUNET_TIME_AbsoluteNBO execution_time; + + /** + * The contribution of @e coin_pub to the total transfer volume. + * This is the value of the deposit minus the fee. + */ + struct TALER_AmountNBO coin_contribution; + + /** + * The total amount the mint transferred in the transaction. + * Note that we may be aggregating multiple coin's @e coin_contribution + * values into a single wire transfer, so this value may be larger + * than that of @e coin_contribution. It may also be smaller, as + * @e coin_contribution may be say "1.123456" but the wire unit may + * be rounded down, i.e. to "1.12" (depending on the transfer method). + * + * Note that the mint books the deltas from rounding down as profit, + * so aggregating transfers is a good thing for the merchant (as it + * reduces rounding down expenses). + */ + struct TALER_AmountNBO total_amount; };