diff options
Diffstat (limited to 'design-documents')
-rw-r--r-- | design-documents/046-mumimo-contracts.rst | 84 |
1 files changed, 57 insertions, 27 deletions
diff --git a/design-documents/046-mumimo-contracts.rst b/design-documents/046-mumimo-contracts.rst index 2220fdb5..07b4c67d 100644 --- a/design-documents/046-mumimo-contracts.rst +++ b/design-documents/046-mumimo-contracts.rst @@ -207,9 +207,9 @@ The contract terms v1 will have the following structure: // signing the deposit confirmation. choices: ContractChoice[]; - // Map from authority labels to meta data about the - // respective token authority. - token_types: { [authority_label: string]: TokenAuthority }; + // Map from token family slugs to meta data about the + // respective token family. + token_families: { [token_family_slug: string]: TokenFamily }; // Extra data that is only interpreted by the merchant frontend. // Useful when the merchant needs to store extra information on a @@ -268,9 +268,9 @@ The contract terms v1 will have the following structure: type: "token"; - // Label of the token authority in the - // 'token_types' map on the top-level. - authority_label: string; + // Slug of the token family in the + // 'token_families' map on the top-level. + token_family_slug: string; // Number of tokens of this type required. // Defaults to one if the field is not provided. @@ -319,9 +319,9 @@ The contract terms v1 will have the following structure: type: "token"; - // Label of the token authority in the - // 'token_types' map on the top-level. - authority_label: string; + // Slug of the token family in the + // 'token_families' map on the top-level. + token_family_slug: string; // Number of tokens to be yelded. // Defaults to one if the field is not provided. @@ -375,23 +375,22 @@ The contract terms v1 will have the following structure: }; -.. ts:def:: TokenAuthority +.. ts:def:: TokenFamily - interface TokenAuthority { + interface TokenFamily { - // Human-readable description of the semantics of - // the tokens issued by this authority (for display). - summary: string; + // Human-readable name of the token family. + name: string; - // Map from IETF BCP 47 language tags to localized summaries. - summary_i18n?: { [lang_tag: string]: string }; + // Human-readable description of the semantics of + // this token family (for display). + description: string; - // Public key used to validate tokens issued - // by this token authority (merchant backend). - key: TokenSignerPublicKey; + // Map from IETF BCP 47 language tags to localized descriptions. + description_i18n?: { [lang_tag: string]: string }; - // When will tokens signed by this key expire? - token_expiration: Timestamp; + // Public keys used to validate tokens issued by this token family. + keys: TokenSignerPublicKeyGroup; // Class-specific information of the token details: TokenClass; @@ -416,14 +415,45 @@ The contract terms v1 will have the following structure: }; -.. ts:def:: TokenSignerPublicKey +.. ts:def:: TokenSignerPublicKeyGroup + + type TokenSignerPublicKeyGroup = + | TokenSignerPublicKeyGroupRsa + | TokenSignerPublicKeyGroupCs; + +.. ts:def:: TokenSignerPublicKeyGroupRsa + + interface TokenSignerPublicKeyGroupRsa extends DenomGroupCommon { + cipher: "RSA"; - type TokenSignerPublicKey = - | DenomGroupRsa - | DenomGroupCs; + public_keys: { + // RSA public key. + rsa_pub: RsaPublicKey; -TODO: may want to do a deep copy and rename -DenomGroup* to TokenSignerPublicKey* here. + // Start time of this key's validity period. + valid_after?: Timestamp; + + // End time of this key's validity period. + valid_before: Timestamp; + }[]; + } + +.. ts:def:: TokenSignerPublicKeyGroupCs + + interface TokenSignerPublicKeyGroupCs extends DenomGroupCommon { + cipher: "CS"; + + public_keys: { + // CS public key. + cs_pub: Cs25519Point; + + // Start time of this key's validity period. + valid_after?: Timestamp; + + // End time of this key's validity period. + valid_before: Timestamp; + }[]; + } Alternative Contracts |