exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 6f3308c26f6c16e54c1850466e3905c9b12a692d
parent 5da0d228c1a9eac6bd892264a48640c30fb05b28
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 14 May 2025 21:19:32 +0200

-remove FIXMEs, improve comments on columns to clarify that these really are NULL when we do not have age-withdraw

Diffstat:
Msrc/exchangedb/0002-withdraw.sql | 25++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/exchangedb/0002-withdraw.sql b/src/exchangedb/0002-withdraw.sql @@ -26,16 +26,16 @@ DECLARE BEGIN PERFORM create_partitioned_table( 'CREATE TABLE %I' - '(withdraw_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- FIXME: NOT NULL?? - ',planchets_h BYTEA CONSTRAINT planchets_h_length CHECK(LENGTH(planchets_h)=64)' -- FIXME: NOT NULL?? + '(withdraw_id BIGINT GENERATED BY DEFAULT AS IDENTITY' + ',planchets_h BYTEA CONSTRAINT planchets_h_length CHECK(LENGTH(planchets_h)=64)' ',execution_date INT8 NOT NULL' ',amount_with_fee taler_amount NOT NULL' ',reserve_pub BYTEA NOT NULL CONSTRAINT reserve_pub_length CHECK(LENGTH(reserve_pub)=32)' ',reserve_sig BYTEA NOT NULL CONSTRAINT reserve_sig_length CHECK(LENGTH(reserve_sig)=64)' ',max_age SMALLINT CONSTRAINT max_age_positive CHECK(max_age>=0)' - ',noreveal_index SMALLINT CONSTRAINT noreveal_index_positive CHECK(noreveal_index>=0)' -- FIXME: NOT NULL?? - ',selected_h BYTEA CONSTRAINT selected_h_length CHECK(LENGTH(selected_h)=64)' -- FIXME: NOT NULL?? - ',blinding_seed BYTEA CONSTRAINT blinding_seed_length CHECK(LENGTH(blinding_seed)>=32)' -- FIXME: NOT NULL?? + ',noreveal_index SMALLINT CONSTRAINT noreveal_index_positive CHECK(noreveal_index>=0)' + ',selected_h BYTEA CONSTRAINT selected_h_length CHECK(LENGTH(selected_h)=64)' + ',blinding_seed BYTEA CONSTRAINT blinding_seed_length CHECK(LENGTH(blinding_seed)>=32)' ',cs_r_values BYTEA[]' ',cs_r_choices INT8' ',denom_serials INT8[] NOT NULL CONSTRAINT denom_serials_array_length CHECK(cardinality(denom_serials)=cardinality(denom_sigs))' @@ -52,13 +52,13 @@ BEGIN ,partition_suffix ); PERFORM comment_partitioned_column( - 'If the client explicitly commits to age-restricted coins, the gamma value chosen by the exchange in the cut-and-choose protocol; might be NULL.' + 'If the client explicitly commits to age-restricted coins, the gamma value chosen by the exchange in the cut-and-choose protocol; NULL if we did not use age-withdraw.' ,'noreveal_index' ,table_name ,partition_suffix ); PERFORM comment_partitioned_column( - 'The running hash over all committed blinded planchets. Needed for recoup and (when a proof of age-restriction was required)' + 'The running hash over all committed blinded planchets. Needed for recoup and (when a proof of age-restriction was required); NULL if we did not use age-withdraw.' ' in the subsequent cut-and-choose protocol.' ,'planchets_h' ,table_name @@ -71,7 +71,7 @@ BEGIN ,partition_suffix ); PERFORM comment_partitioned_column( - 'If the clients commits to age-restricted coins, the maximum age (in years) that the client explicitly commits to with this request; might be NULL.' + 'If the clients commits to age-restricted coins, the maximum age (in years) that the client explicitly commits to with this request; NULL if we did not use age-withdraw.' ,'max_age' ,table_name ,partition_suffix @@ -95,7 +95,7 @@ BEGIN ,partition_suffix ); PERFORM comment_partitioned_column( - 'In case of age restriction, the hash of the chosen (noreveal_index) blinded envelopes.' + 'In case of age restriction, the hash of the chosen (noreveal_index) blinded envelopes; NULL if we did not use age-withdraw.' ,'selected_h' ,table_name ,partition_suffix @@ -109,19 +109,19 @@ BEGIN ,partition_suffix ); PERFORM comment_partitioned_column( - 'The master seed for the blinding nonces, needed for blind CS signatures; maybe NULL' + 'The master seed for the blinding nonces, needed for blind CS signatures; NULL if we did not use age-withdraw or CS' ,'blinding_seed' ,table_name ,partition_suffix ); PERFORM comment_partitioned_column( - 'The pairs of R-values (calculated by the exchange) for the coins of cipher type Clause-Schnorr, based on the blinding_seed; maybe NULL.' + 'The pairs of R-values (calculated by the exchange) for the coins of cipher type Clause-Schnorr, based on the blinding_seed; maybe NULL if we did not use CS.' ,'cs_r_values' ,table_name ,partition_suffix ); PERFORM comment_partitioned_column( - 'The bitvector of choices made by the exchange for each of the pairs in cs_r_values; maybe NULL.' + 'The bitvector of choices made by the exchange for each of the pairs in cs_r_values; NULL if we did not use CS.' 'The vector is stored in network byte order and the lowest bit corresponds to the 0-th entry in cs_r_values (pair)' ,'cs_r_choices' ,table_name @@ -238,4 +238,3 @@ VALUES ('withdraw', 'exchange-0002', 'constrain',TRUE ,FALSE), ('withdraw', 'exchange-0002', 'foreign', TRUE ,FALSE), ('withdraw', 'exchange-0002', 'master', TRUE ,FALSE); -