From b083097892e77f16c0a0e6e632acdf9d21884d61 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Tue, 11 Oct 2022 13:48:55 +0200 Subject: invariant re: accumulated_amount added; typo fixed --- design-documents/028-deposit-policies.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'design-documents/028-deposit-policies.rst') diff --git a/design-documents/028-deposit-policies.rst b/design-documents/028-deposit-policies.rst index 6d1a9589..bf6c5ec5 100644 --- a/design-documents/028-deposit-policies.rst +++ b/design-documents/028-deposit-policies.rst @@ -87,7 +87,7 @@ TODO: Description label=<policy_details> margin=20 policy_details [ - label="id\l|hash_code (unique)\l|deadline\l|commitment (amount)\l|accumulated_total (amount)\l|fee (amount)\l|transferable (amount)\l|fulfillment_state\l|fulfillment_id (null)\l" + label="id\l|policy_hash_code (unique)\l|deadline\l|commitment (amount)\l|accumulated_total (amount)\l|fee (amount)\l|transferable (amount)\l|fulfillment_state\l|fulfillment_id (null)\l" ] } @@ -107,7 +107,7 @@ TODO: Description The field ``policy_hash_codes`` in table ``policy_fulfillments`` is a binary blob that consists of the concatenation of the sorted -``policy_details.hash_code`` entries from all policies that are fulfilled by +``policy_details.policy_hash_code`` entries from all policies that are fulfilled by this proof. @@ -152,16 +152,20 @@ The following invariants need to be fulfilled and be checked by the auditor: ``policy_details.accumulated_total``. - The sum of amounts in ``policy_details.fee`` and - ``policy_details.transferable`` must be less or equal to the amount in + ``policy_details.transferable`` MUST be less or equal to the amount in ``policy_details.accumulated_total``. +- The amount in ``policy_details.accumulated_total`` MUST be equal to the total + sum of contributions of the individual coins of the deposits that reference + this policy. + - Each hash code encoded in ``policy_fulfillments.policy_hash_codes`` MUST refer to an existing ``policy_details.hash_code`` AND its ``.fulfillment_id`` MUST point to the same ``policy_fulfillments.id``. - Conversely: If a ``policy_details.fulfillment_id`` points to an entry in - ``policy_fulfillment``, the ``policy_details.hash_code`` MUST be present in - that entry's ``.policy_hash_codes``. + ``policy_fulfillment``, the ``policy_details.policy_hash_code`` MUST be + present in that entry's ``.policy_hash_codes``. -- cgit v1.2.3