diff options
Diffstat (limited to 'design-documents')
-rw-r--r-- | design-documents/046-mumimo-contracts.rst | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/design-documents/046-mumimo-contracts.rst b/design-documents/046-mumimo-contracts.rst index fcb7f2b1..5f1d1d98 100644 --- a/design-documents/046-mumimo-contracts.rst +++ b/design-documents/046-mumimo-contracts.rst @@ -62,8 +62,6 @@ We want Taler to support various interesting use-cases: acquired (i.e., not brought from home or stolen from a stack of dirty items) and incentivizes return after use. -TODO: add more use-cases here! - Proposed Solution ================= @@ -190,7 +188,7 @@ The contract terms v1 will have the following structure: extra?: any; // Fee limits and wire account details by currency. - limits: { [currency:string] : CurrencyLimit }; + limits: { [currency: string]: CurrencyLimit }; } .. ts:def:: CurrencyLimit @@ -212,7 +210,7 @@ The contract terms v1 will have the following structure: // Maximum wire fee accepted by the merchant (customer share to be // divided by the ``wire_fee_amortization`` factor, and further reduced // if deposit fees are below ``max_fee``). Default if missing is zero. - max_wire_fee: Amount; + max_wire_fee?: Amount; // Over how many customer transactions does the merchant expect to // amortize wire fees on average? If the exchange's wire fee is @@ -222,7 +220,7 @@ The contract terms v1 will have the following structure: // between the ``max_fee`` and the sum of the actual deposit fees. // Optional, default value if missing is 1. 0 and negative values are // invalid and also interpreted as 1. - wire_fee_amortization: number; + wire_fee_amortization?: number; // Exchanges that the merchant accepts for this currency. exchanges: Exchange[]; @@ -271,15 +269,15 @@ The contract terms v1 will have the following structure: // Map from authority labels to meta data abou the // respective token authority. - token_types: { [authority_label: TokenAuthority }; + token_types: { [authority_label: string]: TokenAuthority }; } .. ts:def:: ContractInput type ContractInput = - | ContractInputRation - | ContractInputToken; + ContractInputRation | + ContractInputToken; .. ts:def:: ContractInputRation @@ -305,9 +303,9 @@ The contract terms v1 will have the following structure: type: "token"; - // Hash over the public key used to sign the - // type of subscription token required. - h_issuer: HashCode; + // Label of the token authority in the + // 'token_types' map on the top-level. + authority_label: string; // Number of tokens of this type required. // Defaults to one if the field is not provided. @@ -318,17 +316,17 @@ The contract terms v1 will have the following structure: .. ts:def:: ContractOutput type ContractOutput = - | ContractOutputCurrency - | ContractOutputTaxReceipt - | ContractOutputToken; + ContractOutputCoin | + ContractOutputTaxReceipt | + ContractOutputToken; -.. ts:def:: ContractOutputCurrency +.. ts:def:: ContractOutputCoin - interface ContractOutputCurrency { + interface ContractOutputCoin { - type: "currency"; + type: "coins"; - // Amount of currency that will be yielded. + // Amount of coins that will be yielded. // This excludes any applicable withdraw fees. brutto_yield: Amount; @@ -360,24 +358,21 @@ The contract terms v1 will have the following structure: // 'token_types' map on the top-level. authority_label: string; - // Must a wallet understand this token type to - // process contracts that consume or yield it? - critical: boolean; + // Number of tokens to be yelded. + // Defaults to one if the field is not provided. + number?: Integer; - // Information about the class of token that will - // be yielded. - details: OutputTokenClass; } -.. ts:def:: OutputTokenClass +.. ts:def:: TokenClass - type OutputTokenClass = - | OutputTokenClassSubscription - | OutputTokenClassDiscount + type TokenClass = + TokenClassSubscription + | TokenClassDiscount -.. ts:def:: OutputTokenClassSubscription +.. ts:def:: TokenClassSubscription - interface OutputTokenClassSubscription { + interface TokenClassSubscription { class: "subscription"; @@ -396,9 +391,9 @@ The contract terms v1 will have the following structure: }; -.. ts:def:: OutputTokenClassDiscount +.. ts:def:: TokenClassDiscount - interface OutputTokenClassDiscount { + interface TokenClassDiscount { class: "discount"; @@ -433,6 +428,13 @@ The contract terms v1 will have the following structure: // When will tokens signed by this key expire? token_expiration: Timestamp; + // Class-specific information of the token + details: TokenClass; + + // Must a wallet understand this token type to + // process contracts that consume or yield it? + critical: boolean; + // Number of tokens issued according to ASS authority // FIXME: this is still rather speculative in the design... ass?: Integer; @@ -452,8 +454,8 @@ The contract terms v1 will have the following structure: .. ts:def:: TokenSignerPublicKey type TokenSignerPublicKey = - | DenomGroupRsa - | DenomGroupCs; + DenomGroupRsa | + DenomGroupCs; TODO: may want to do a deep copy and rename DenomGroup* to TokenSignerPublicKey* here. |