DD 024: Anonymous Age Restriction Extension for GNU Taler ######################################################### Summary ======= This document presents and discusses an extension to GNU Taler that provides anonymous age-restriction. Motivation ========== Merchants are legally obliged to perform age verification of customers when they buy certain goods and services. Current mechanisms for age verification are either ID-based or require the usage of credit/debit cards. In all cases sensitive private information is disclosed. We want to offer a better mechanism for age-restriction with GNU Taler that * ensures anonymity and unlinkability of purchases * can be set to particular age groups by parents/wardens at withdrawal * is bound to particular coins/tokens * can be verified by the merchant at purchase time * persists even after refresh The mechanism is presented as an 'extension' to GNU Taler, that is, as an optional feature that can be switched on by the exchange operator. Requirements ============ TODO * legal requirements for merchants must allow for this kind of mechanism Proposed Solution ================= We propose an extension to GNU Taler for age-restriction that can be enabled by an Exchange¹). Once enabled, coins with age restrictions can be withdrawn by parents/warden who can choose to **commit** the coins to a certain maximum age out of a predefined list of age groups. The minors/wards receive those coins and can now **attest** a required minimum age (provided that age is less or equal to the committed age of the coins) to merchants, who can **verify** the minimum age. For the rest values (change) after an transaction, the minor/ward can **derive** new age-restricted coins. The exchange can **compare** the equality of the age-restriction of the old coin with the new coin (in a zero-knowledge protocol, that gives the minor/ward a 1/κ chance to raise the minimum age for the new coin). The proposed solution maintains the guarantees of GNU Taler with respect to anonymity and unlinkability. (TODO: refer to the paper, once published) ¹) Once the feature is enabled and the age groups are defined, the exchange has to stick to that decision until the support for age restriction is disabled. We might reconsider this design decision at some point. Building Blocks ^^^^^^^^^^^^^^^ TODO: Summarize the design based on the five functions ``Commit()``, ``Attest()``, ``Verify()``, ``Derive()``, ``Compare()``. Changes in the Exchange ^^^^^^^^^^^^^^^^^^^^^^^ The necessary changes in the exchange involve * indication of support for age restriction as an extension * modification of the refresh protocol (both, commit and reveal phase) * modification of the deposit protocol Extension for age restriction ----------------------------- The exchange indicates support for age-restriction in response to ``/keys`` by registering the extension ``age_restriction.v1`` with a value type ``ExtensionAgeRestriction``: .. ts:def:: ExtensionAgeRestriction interface ExtensionAgeRestriction { // The field ``critical`` is mandatory for an extension. // Age restriction is not required to be understood by an client, so // ``critical`` will be set to ``false``. critical: false; // Age restriction specific fields. // Representation of the age groups as comma separated edges: Increasing // from left to right, the values mark the begining of an age group up // to, but not including the next value. The initial age group starts at // 0 and is not listed. Example: "8:10:12:14:16:18:21". // This field is mandatory and binding in the sense that its value is // taken into consideration when signing the denominations in // ``ExchangeKeysResponse.age_restricted_denoms``. age_groups: string; } Registering an extension is defined in :doc:`design document 006 ― Extensions <006-extensions>`. Age restricted denominations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If age-restriction is registered as an extension under the name ``age_restriction.v1``, as described above, the root-object ``ExchangeKeysResponse`` in response to ``/keys`` MUST be extended by an additional field ``age_restricted_denoms``. This is an *additional* list of denominations that must be used for during modified ``refresh`` and ``deposit`` operations (see below). The data structure for those denominations is the same as for the regular ones in ``ExchangeKeysResponse.denoms``. **However**, the following differences apply for each denomination in the list: 1. The value of ``TALER_DenominationKeyValidityPS.denom_hash`` is taken over the public key of the denomination **and** the string in ``ExtensionAgeRestriction.age_groups`` from the corresponding extension object (see above). 2. The value of ``TALER_DenominationKeyValidityPS.purpose`` is set to ``TALER_SIGNATURE_MASTER_AGE_RESTRICTED_DENOMINATION_KEY_VALIDITY``. .. ts:def:: ExchangeKeysResponse interface ExchangeKeysResponse { //... // List of denominations that support age-restriction with the age groups // given in age_groups. This is only set **iff** the extension // ``age_restriction.v1`` is registered under ``entensions`` with type // ``ExtensionAgeRestriction``. // // The data structure for each denomination is the same as for the // denominations in ExchangeKeysResponse.denoms. **However**, the // following differences apply for each denomination in the list: // // 1. The value of ``TALER_DenominationKeyValidityPS.denom_hash`` // is taken over the public key of the denomination __and__ the // string in ``ExtensionAgeRestriction.age_groups`` from the // corresponding extension object. // // 2. The value of ``TALER_DenominationKeyValidityPS.purpose`` is set to // ``TALER_SIGNATURE_MASTER_AGE_RESTRICTED_DENOMINATION_KEY_VALIDITY`` age_restricted_denoms: Denoms[]; //... } SQL changes ----------- The schema for the exchange is changed as follows: .. sourcecode:: sql -- Everything in one big transaction 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_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; 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 ---------------- 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. Deposit ~~~~~~~ TODO: Add opaque hash value of the commitments to the protocol Changes in the Merchant ^^^^^^^^^^^^^^^^^^^^^^^ TODO: Spending protocol Changes in the Wallet ^^^^^^^^^^^^^^^^^^^^^ TODO. * choosing age-restriction during withdrawal coins from denominations with support for age restriction. * Define protocol to pass denominations to child/ward. Alternatives ============ TODO. * ID-based systems * credit/debit card based systems Drawbacks ========= TODO. * age groups, once defined, are set permanently * age restricted coins are basically shared between ward and warden. Also discuss: * storage overhead * computational overhead * bandwidth overhead * legal issues? Discussion / Q&A ================ We had some very engaged discussions on the GNU Taler mailing list ``: * Money with capabilities ``_ * On age-restriction (was: online games in China) ``_ * Age-restriction is about coins, not currencies ``_ The upcoming paper on anonymous age-restriction for GNU Taler from Özgür Kesim and Christian Grothoff will be cited here, once it is published.