donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit a2bd2193af616f11b872e3eaeacc6e6044f62d62
parent 8e2c7d055926e7929b93edc80a9a1f5f77b2f853
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Wed,  4 Oct 2023 18:34:39 +0200

-misc edits on phone

Diffstat:
Msrc/donaudb/0002-donau_charities.sql | 2+-
Msrc/donaudb/0002-donau_history.sql | 2+-
Msrc/donaudb/0002-donau_receipts_issued.sql | 11+++++++----
Msrc/donaudb/0002-donau_receipts_submitted.sql | 6++++--
Msrc/donaudb/0002-donau_sign_keys.sql | 1-
Msrc/include/taler_donau_service.h | 47++++++++++++++---------------------------------
6 files changed, 27 insertions(+), 42 deletions(-)

diff --git a/src/donaudb/0002-donau_charities.sql b/src/donaudb/0002-donau_charities.sql @@ -28,4 +28,4 @@ COMMENT ON COLUMN charities.charity_pub COMMENT ON COLUMN charities.max_per_year IS 'The annual donation limit.'; COMMENT ON COLUMN charities.receipts_to_date - IS 'The current amount of donations in the current year.'; + IS 'The current amount of donations in the current year. Reset to 0 when incrementing the current_year (but remember historic values in history table when doing so).'; diff --git a/src/donaudb/0002-donau_history.sql b/src/donaudb/0002-donau_history.sql @@ -17,7 +17,7 @@ CREATE TABLE history (charity_id BIGINT KEY REFERENCES charities (charity_id) ON DELETE CASCADE ,final_amount taler_amount NOT NULL - ,year INT8 NOT NULL + ,donation_year INT8 NOT NULL ); COMMENT ON TABLE history IS 'Table containing the yearly donation amount for each charity.'; diff --git a/src/donaudb/0002-donau_receipts_issued.sql b/src/donaudb/0002-donau_receipts_issued.sql @@ -1,6 +1,6 @@ -- -- This file is part of TALER --- Copyright (C) 2014--2022 Taler Systems SA +-- Copyright (C) 2023 Taler Systems SA -- -- TALER is free software; you can redistribute it and/or modify it under the -- terms of the GNU General Public License as published by the Free Software @@ -18,9 +18,10 @@ CREATE TABLE receipts_issued (receipt_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE ,charity_sig BYTEA CHECK (LENGTH(charity_sig)=64) ,charity_id BIGINT NOT NULL REFERENCES charities (charity_id) ON DELETE CASCADE - ,receipt_hash BYTEA NOT NULL - ,donation_unit_key_id INT8 NOT NULL - ,donation_unit_sig BYTEA CHECK (LENGTH(donation_unit_sig)=64) + ,receipt_hash BYTEA NOT NULL -- H(BDID+...) + -- + amount +-- ,donation_unit_key_id INT8 NOT NULL +-- ,donation_unit_sig BYTEA CHECK (LENGTH(donation_unit_sig)=64) ); COMMENT ON TABLE receipts_issued IS 'Table containing the issued blinded donation receipts to the charity.'; @@ -28,3 +29,5 @@ COMMENT ON COLUMN receipts_issued.charity_sig IS 'Signature from the charity.'; COMMENT ON COLUMN receipts_issued.receipt_hash IS 'Hash value of the receipt received.'; + +-- Sign (total-amount, H(BDID_1 + H(p1), BDID_2 + H(p2), ...)) diff --git a/src/donaudb/0002-donau_receipts_submitted.sql b/src/donaudb/0002-donau_receipts_submitted.sql @@ -17,8 +17,10 @@ CREATE TABLE receipts_submitted (receipt_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE ,hash_tax_number BYTEA NOT NULL - ,total_amount taler_amount NOT NULL - ,year INT8 NOT NULL + ,nonce BYTEA NOT NULL UNIQUE -- LENGTH constraint + ,total_amount taler_amount NOT NULL -- or maybe better: reference to public key used to sign! => donation unit key + ,donau_sig BYTEA NOT NULL UNIQUE + ,donation_year INT8 NOT NULL ); COMMENT ON TABLE receipts_submitted IS 'Table containing information of the donation receips submitted from the donor.'; diff --git a/src/donaudb/0002-donau_sign_keys.sql b/src/donaudb/0002-donau_sign_keys.sql @@ -17,7 +17,6 @@ CREATE TABLE donau_sign_keys (esk_serial BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE ,donau_pub BYTEA PRIMARY KEY CHECK (LENGTH(donau_pub)=32) - ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64) ,valid_from INT8 NOT NULL ,expire_sign INT8 NOT NULL ,expire_legal INT8 NOT NULL diff --git a/src/include/taler_donau_service.h b/src/include/taler_donau_service.h @@ -34,7 +34,7 @@ /** - * @brief Donau's signature key + * @brief Donau's statement signing public key */ struct TALER_DONAU_SigningPublicKey { @@ -44,48 +44,34 @@ struct TALER_DONAU_SigningPublicKey struct TALER_DonauPublicKeyP key; /** - * Signature over this signing key by the donau's master signature. + * Tax year this key is valid for. */ - // struct TALER_MasterSignatureP master_sig; + unsigned int year; - /** - * Validity start time - */ - struct GNUNET_TIME_Timestamp valid_from; - - /** - * Validity expiration time (how long the donau may use it). - */ - struct GNUNET_TIME_Timestamp valid_until; - - /** - * Validity expiration time for legal disputes. - */ - struct GNUNET_TIME_Timestamp valid_legal; }; /** - * @brief Public information about a donau's BDR key + * @brief Public information about a donau's donation unit signing key */ -struct TALER_DONAU_BDRPublicKey +struct TALER_DONAU_DonationUnitPublicKey { /** * The public key */ - struct TALER_BDRPublicKey key; + struct TALER_XXX key; /** - * The hash of the public key. + * The hash of the public key. Redundant. */ struct TALER_BDRHashP h_key; - // +value (Amount)!!? + struct TALER_Amount donation_unit; /** * Year of validity */ - int year; + unsigned int year; }; @@ -114,6 +100,11 @@ struct TALER_DONAU_Keys char *version; /** + * Financial domain. + */ + char *domain; + + /** * Supported currency of the donau. */ char *currency; @@ -125,16 +116,6 @@ struct TALER_DONAU_Keys char *donau_url; /** - * Timestamp indicating the /keys generation. - */ - struct GNUNET_TIME_Timestamp list_issue_date; // needed? - - /** - * When does this keys data expire? - */ - struct GNUNET_TIME_Timestamp key_data_expiration; // needed? - - /** * Default number of fractional digits to render * amounts with. */