summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2021-10-15 10:44:53 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2021-10-15 10:44:53 +0200
commitf708dd78c20eb54870650e63acfa519d7b819672 (patch)
tree6aec19880f1bb646a499d3ec5b385ef5e833a1b4
parent31d27c0576c74c9524a2589692ba7af073f4f729 (diff)
downloaddocs-f708dd78c20eb54870650e63acfa519d7b819672.tar.gz
docs-f708dd78c20eb54870650e63acfa519d7b819672.tar.bz2
docs-f708dd78c20eb54870650e63acfa519d7b819672.zip
refine extension of table refresh_commitments
-rw-r--r--design-documents/024-age-restriction.rst24
1 files changed, 17 insertions, 7 deletions
diff --git a/design-documents/024-age-restriction.rst b/design-documents/024-age-restriction.rst
index 061921bc..06b34c7e 100644
--- a/design-documents/024-age-restriction.rst
+++ b/design-documents/024-age-restriction.rst
@@ -168,20 +168,27 @@ The schema for the exchange is changed as follows:
BEGIN;
-- Check patch versioning is in place.
SELECT _v.register_patch('exchange-TBD', NULL, NULL);
- --
+
+ -- Support for age restriction is marked per denomination.
ALTER TABLE denominations
ADD COLUMN age_restricted BOOLEAN NOT NULL DEFAULT (false);
COMMENT ON COLUMN denominations.age_restriced
IS 'true if this denomination can be used for age restriction';
- --
+
+ -- During the melting phase of the refresh, the wallet has to present the
+ -- hash value of the age commitment (only for denominations with support
+ -- for age restriction).
ALTER TABLE refresh_commitments
- ADD COLUMN age_commitment BYTEA ARRAY;
- COMMENT ON COLUMN refresh_commitments.age_commitment
- IS 'Vector of public keys that represents a commitment to an age. MUST be NULL if in the corresponding denomination .age_restricted equals 'false', MUST NOT be NULL otherwise.`
+ ADD COLUMN age_commitment_h BYTEA CHECK (LENGTH(age_commitment_h)=64);
+ COMMENT ON COLUMN refresh_commitments.age_commitment_h
+ IS 'SHA512 hash of the age commitment of the old coin, iff the corresponding
+ denomimination has support for age restriction, NULL otherwise.';
COMMIT;
-**TODO**: can the contraint (NULL/NOT NULL) on column
-``refresh_commitments.age_commitment`` be made explicit in SQL?
+Note the constraint on ``refresh_commitments.age_commitment_h``: It can be
+NULL, but only iff the corresponding denomination (indirectly referenced via
+table ``known_coins``) has ``.age_restricted`` set to true. This constraint
+can not be expressed reliably with SQL.
Protocol changes
----------------
@@ -189,6 +196,9 @@ Protocol changes
Refresh
~~~~~~~
+During the melting phase of the refresh, the wallet has to present the hash
+value of the age commitment (for denominations with support for age restriction).
+
TODO: Extension of the cut'n-choose-protocol.