From 7c08755fb7d4e4100915ce673c18afd3893f0339 Mon Sep 17 00:00:00 2001 From: Marcin Mazurek Date: Mon, 23 Oct 2023 18:07:39 +0200 Subject: [PATCH 01/25] Specify hashing algorithm for rootHash calculation --- CIP-0072/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index 709e1dd497..7c9c6fa76d 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -83,7 +83,7 @@ The on-chain dApp registration certificate MUST follow canonical JSON and be ser - *`REGISTER`*: The certificate is asserting that the dApp is registered for the first time or is providing an update. - *`DE_REGISTER`*: The certificate is asserting that the dApp is deprecated / archived. So, no further dApp's on-chain update is expected. -*`rootHash`*: The hash of the entire offchain metadata tree object. This hash is used by clients to verify the integrity of the metadata tree object. When reading a metadata tree object, the client should calculate the hash of the object and compare it with the `rootHash` property. If the two hashes don't match, the client should discard the object. The metadata tree object is a JSON object that contains the dApp's metadata. The metadata tree object is described in the next section. Please note that off-chain JSON must be converted into RFC 8765 canonical form before taking the hash! +*`rootHash`*: The blake2b-256 hash of the entire offchain metadata tree object. This hash is used by clients to verify the integrity of the metadata tree object. When reading a metadata tree object, the client should calculate the hash of the object and compare it with the `rootHash` property. If the two hashes don't match, the client should discard the object. The metadata tree object is a JSON object that contains the dApp's metadata. The metadata tree object is described in the next section. Please note that off-chain JSON must be converted into RFC 8765 canonical form before taking the hash! *`metadata`*: An array of links to the dApp's metadata. The metadata is a JSON compatible RFC 8785 object that contains the dApp's metadata. From a6e01e5b00085265ee7d9b6404afebcb0331c3dd Mon Sep 17 00:00:00 2001 From: Marcin Mazurek Date: Mon, 23 Oct 2023 18:08:00 +0200 Subject: [PATCH 02/25] Add off-chain version property --- CIP-0072/version_1_offchain.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index d1e8b306df..9693f3dbba 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -2,6 +2,11 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "type":"object", "properties": { + "version": { + "type": "integer", + "minimum": 1, + "description": "Off-chain schema version" + }, "subject": { "type":"string", "minLength": 1, @@ -25,7 +30,7 @@ "categories": { "type":"array", "items": { - "type": "string", + "type": "string", "enum":["Games", "DeFi", "Gambling", "Exchanges", "Collectibles", "Marketplaces", "Social", "Other"] }, "description": "One or more categories. Category MUST be one of the following schema definition." @@ -201,7 +206,8 @@ "link", "social", "categories", - "description" + "description", + "version" ] } \ No newline at end of file From 94e8bbb18fade952396b012d123de3033d7426b8 Mon Sep 17 00:00:00 2001 From: Marcin Mazurek Date: Mon, 23 Oct 2023 18:08:32 +0200 Subject: [PATCH 03/25] Update categories with Lace DApp Store category list --- CIP-0072/version_1_offchain.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 9693f3dbba..23881f1d09 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -31,7 +31,7 @@ "type":"array", "items": { "type": "string", - "enum":["Games", "DeFi", "Gambling", "Exchanges", "Collectibles", "Marketplaces", "Social", "Other"] + "enum": ["DeFi", "Development", "Education", "Games", "Identity", "Marketplace", "NFT", "Other", "Security"] }, "description": "One or more categories. Category MUST be one of the following schema definition." }, From e1cd6a0b603f8607a0d0790e25a491e8bb19d00c Mon Sep 17 00:00:00 2001 From: Marcin Mazurek Date: Tue, 24 Oct 2023 16:30:37 +0200 Subject: [PATCH 04/25] Add DApp screenshot and company detail fields --- CIP-0072/version_1_offchain.json | 34 +++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 23881f1d09..bd94d694e4 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -22,7 +22,7 @@ "type":"string", "description": "Website presenting a dApp.", "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" - }, + }, "logo": { "type":"string", "description": "URL to the logo or the base64 encoded image." @@ -30,11 +30,19 @@ "categories": { "type":"array", "items": { - "type": "string", + "type": "string", "enum": ["DeFi", "Development", "Education", "Games", "Identity", "Marketplace", "NFT", "Other", "Security"] }, "description": "One or more categories. Category MUST be one of the following schema definition." }, + "screenshots": { + "type": "array", + "items": { + "type": "string", + "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" + }, + "description": "Screenshots of DApp actual pages. We recommend to share screenshots from the dApp usage itself." + }, "social": { "type":"object", "properties": { @@ -57,6 +65,23 @@ "type":"string", "description": "An optional Discord link.", "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" + }, + "companyName": { + "type": "string", + "description": "Name of the company developing/maintaining the dApp", + "maxLength": 50 + }, + "companyEmail": { + "type": "string", + "description": "Email of the company developing/maintaining the dApp", + "maxLength": 150, + "format": "email" + }, + "companyWebsite": { + "type": "string", + "description": "Website of the company developing/maintaining the dApp", + "maxLength": 200, + "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" } }, "required": ["website"] @@ -148,8 +173,8 @@ "purposes":{ "type":"array", "items": { - "type": "string", - "enum":["SPEND", "MINT"] + "type": "string", + "enum":["SPEND", "MINT"] }, "description": "Purpouses of the script, SPEND or MINT (notice it can be both for some modern Cardano languages)." }, @@ -210,4 +235,3 @@ "version" ] } - \ No newline at end of file From e23c91fc894946be9f6b584cd30d5fd0b6e88c76 Mon Sep 17 00:00:00 2001 From: Marcin Mazurek Date: Wed, 25 Oct 2023 16:34:37 +0200 Subject: [PATCH 05/25] Remove duplicated/ambiguous website property --- CIP-0072/version_1_offchain.json | 34 +++++++++++++------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index bd94d694e4..106129d409 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -46,9 +46,20 @@ "social": { "type":"object", "properties": { - "website": { - "type":"string", - "description": "dApps website link.", + "companyName": { + "type": "string", + "description": "Name of the company developing/maintaining the dApp", + "maxLength": 50 + }, + "companyEmail": { + "type": "string", + "description": "Email of the company developing/maintaining the dApp", + "maxLength": 150, + "format": "email" + }, + "companyWebsite": { + "type": "string", + "description": "Website of the company developing/maintaining the dApp", "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" }, "twitter": { @@ -65,23 +76,6 @@ "type":"string", "description": "An optional Discord link.", "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" - }, - "companyName": { - "type": "string", - "description": "Name of the company developing/maintaining the dApp", - "maxLength": 50 - }, - "companyEmail": { - "type": "string", - "description": "Email of the company developing/maintaining the dApp", - "maxLength": 150, - "format": "email" - }, - "companyWebsite": { - "type": "string", - "description": "Website of the company developing/maintaining the dApp", - "maxLength": 200, - "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" } }, "required": ["website"] From 20c45cd578174cfcd0085a0de1836b6c67dcb8df Mon Sep 17 00:00:00 2001 From: Marcin Mazurek Date: Wed, 25 Oct 2023 16:40:26 +0200 Subject: [PATCH 06/25] Add some property length constraints and describe image requirements --- CIP-0072/version_1_offchain.json | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 106129d409..70550f4a24 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -16,16 +16,19 @@ }, "projectName": { "type":"string", - "description": "A project name, e.g. My dApp." + "description": "A project name, e.g. My dApp.", + "maxLength": 40 }, "link": { "type":"string", "description": "Website presenting a dApp.", - "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" + "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})", + "maxLength": 200 }, "logo": { - "type":"string", - "description": "URL to the logo or the base64 encoded image." + "type": "string", + "description": "URL to the logo. Minimum resolution: 512x512px, supported formats: PNG/JPG/SVG, maximum file size: 0.5 MB", + "maxLength": 1000 }, "categories": { "type":"array", @@ -37,11 +40,14 @@ }, "screenshots": { "type": "array", + "maxItems": 10, "items": { "type": "string", - "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" + "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})", + "maxLength": 1000, + "description": "Minimum resolution: 1920x1080px, supported formats: PNG/JPG/SVG, maximum file size: 1 MB" }, - "description": "Screenshots of DApp actual pages. We recommend to share screenshots from the dApp usage itself." + "description": "URLs to screenshots of DApp actual pages. We recommend to share screenshots from the dApp usage itself." }, "social": { "type":"object", From 0f4763977fac8434b7c823afc922e56a1d41325e Mon Sep 17 00:00:00 2001 From: Marcin Mazurek Date: Thu, 26 Oct 2023 17:01:29 +0200 Subject: [PATCH 07/25] Specify property length limit for the rest `social` props --- CIP-0072/version_1_offchain.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 70550f4a24..95a699f412 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -66,21 +66,25 @@ "companyWebsite": { "type": "string", "description": "Website of the company developing/maintaining the dApp", + "maxLength": 200, "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" }, "twitter": { "type":"string", "description": "An optional Twitter link.", + "maxLength": 200, "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" }, "github": { "type":"string", "description": "An optional Github link.", + "maxLength": 200, "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" }, "discord": { "type":"string", "description": "An optional Discord link.", + "maxLength": 200, "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" } }, @@ -91,13 +95,13 @@ "properties": { "short": { "type": "string", - "description": "Short dApp description (no less than 40 and no longer than 168 characters).", + "description": "Short dApp description.", "minLength": 40, "maxLength": 168 }, "long": { "type": "string", - "description": "An optional long dApp description (no less than 40 and no longer than 1008 characters).", + "description": "An optional long dApp description.", "minLength": 40, "maxLength": 1008 } From c0d5c6d67de7bd07933bee1cf77a4d0fd3136865 Mon Sep 17 00:00:00 2001 From: Marcin Mazurek Date: Fri, 27 Oct 2023 10:38:24 +0200 Subject: [PATCH 08/25] Fix a typo --- CIP-0072/version_1_offchain.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 95a699f412..9a17d58c44 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -88,7 +88,7 @@ "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" } }, - "required": ["website"] + "required": ["companyWebsite"] }, "description": { "type": "object", From d99faad7f2c8ad5635b2fdef295ee3dc8d9f2817 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Thu, 2 Nov 2023 10:53:57 +0100 Subject: [PATCH 09/25] Enhanced the regex for URLs to be more permissive by allowing ipfs and other protocols. Renamed twitter to x.com --- CIP-0072/version_1_offchain.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 9a17d58c44..a88eeaf9dc 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -22,7 +22,7 @@ "link": { "type":"string", "description": "Website presenting a dApp.", - "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})", + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", "maxLength": 200 }, "logo": { @@ -43,7 +43,7 @@ "maxItems": 10, "items": { "type": "string", - "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})", + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", "maxLength": 1000, "description": "Minimum resolution: 1920x1080px, supported formats: PNG/JPG/SVG, maximum file size: 1 MB" }, @@ -67,25 +67,25 @@ "type": "string", "description": "Website of the company developing/maintaining the dApp", "maxLength": 200, - "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" }, - "twitter": { + "X.com": { "type":"string", - "description": "An optional Twitter link.", + "description": "An optional X.com link.", "maxLength": 200, - "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" }, "github": { "type":"string", "description": "An optional Github link.", "maxLength": 200, - "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" }, "discord": { "type":"string", "description": "An optional Discord link.", "maxLength": 200, - "pattern": "(https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\/\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})" + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" } }, "required": ["companyWebsite"] From 32f259e964173ed8cc47fb6ef42f3b9fb2cdc07c Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Thu, 9 Nov 2023 11:59:18 +0100 Subject: [PATCH 10/25] Removed extra signature in the on-chain metadata --- CIP-0072/README.md | 14 +++--------- CIP-0072/version_1_onchain.cddl | 9 +------- CIP-0072/version_1_onchain.json | 39 +-------------------------------- 3 files changed, 5 insertions(+), 57 deletions(-) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index 7c9c6fa76d..c274d47351 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -51,7 +51,7 @@ Stores and auditors should be able to follow the chain and find when a new dApp ### **On-chain dApp Registration Certificate** -The on-chain dApp registration certificate MUST follow canonical JSON and be serialised according to RFC 8785 (https://www.rfc-editor.org/rfc/rfc8785). This stipulation is to avoid any ambigiutines in the signature calculation. +The on-chain dApp registration certificate MUST follow canonical JSON and be serialised according to RFC 8785 (https://www.rfc-editor.org/rfc/rfc8785). ```json { @@ -63,12 +63,6 @@ The on-chain dApp registration certificate MUST follow canonical JSON and be ser "type": { "action": "REGISTER", "comment": "New release adding zapping support." - }, - "signature": { - "r": "27159ce7d992c98fb04d5e9a59e43e75f77882b676fc6b2ccb8e952c2373da3e", - "s": "16b59ab1a9e349cd68d232f7652f238926dc24a2e435949ebe2e402a6557cfb4", - "algo": "Ed25519−EdDSA", - "pub": "b384b53d5fe9f499ecf088083e505f40d2a6c123bf7201608494fdb89a051b80" } } ``` @@ -87,8 +81,6 @@ The on-chain dApp registration certificate MUST follow canonical JSON and be ser *`metadata`*: An array of links to the dApp's metadata. The metadata is a JSON compatible RFC 8785 object that contains the dApp's metadata. -*`signature`*: The signature of the certificate. The publishers generate the signature is by first turning on-chain JSON into a canonical form (RFC 8765), hashing it with blake2b-256 and generating a signature of the hash. Stores / clients can verify the signature by repeating the process, they can use the public key to verify the signature of the certificate. Fields used for canonical JSON: ["subject", "rootHash", "metadata","type"]. Please note that a signature should be generated of blake2b-256 hash as a byte array, not as a hex represented string(!). - ### On-chain Schemas [On-chain CDDL for registration / de-registration (Version 1)](./version_1_onchain.cddl) @@ -205,9 +197,9 @@ Release Name is a field, which dApp developers can use on top of Release Version At the begining neither on-chain, nor off-chain JSON has been following RFC 8785 (canonical JSON) but we reached a point that, due to consistency checks, we need to take hash of both on-chain and off-chain and this forced us to stipulate that both on-chain and off-chain metadata documents need to be converted according to RFC 8785 before taking a blake2b-256 hash of them. -### On-Chain Signature Scope +### Transaction Signature Scope -On-chain part has a signature, which has a role to verify that a certain dApp owner made changes. In the initial version, a blake2b-256 signature was needed only for `rootHash` but following discussion, due to security concerns, decision has been made that the signature should attest the whole on-chain canonical JSON except signature field itself (because it would end up in an infinite recursion). +As any transaction in cardano network has a signature, which has a role to verify that a certain dApp owner made changes. ### Who Is The Owner? diff --git a/CIP-0072/version_1_onchain.cddl b/CIP-0072/version_1_onchain.cddl index f605418180..e37d17ec3c 100644 --- a/CIP-0072/version_1_onchain.cddl +++ b/CIP-0072/version_1_onchain.cddl @@ -22,11 +22,4 @@ registration = { de-registration = { action: "DE_REGISTER", ? comment: string, -} - -signature = { - r: string, - s: string, - algo: text .regexp "Ed25519-EdDSA", - pub: string, -} +} \ No newline at end of file diff --git a/CIP-0072/version_1_onchain.json b/CIP-0072/version_1_onchain.json index ef9bf510d6..f679c498d6 100644 --- a/CIP-0072/version_1_onchain.json +++ b/CIP-0072/version_1_onchain.json @@ -57,49 +57,12 @@ "required":[ "action" ] - }, - "signature":{ - "description":"Signature of the blake2b-256 hash of whole canonical (RFC 8785) JSON document (except signature property).", - "type":"object", - "properties":{ - "r":{ - "type":"string", - "description":"A hex representation of the R component of the signature.", - "minLength": 64, - "maxLength": 64, - "pattern":"^[0-9a-fA-F]{64}$" - }, - "s":{ - "type":"string", - "description":"A hex representation of the S component of the signature.", - "minLength": 64, - "maxLength": 64, - "pattern":"^[0-9a-fA-F]{64}$" - }, - "algo":{ - "const":"Ed25519-EdDSA" - }, - "pub":{ - "type":"string", - "description":"A hex representation of the public key.", - "minLength": 64, - "maxLength": 64, - "pattern":"^[0-9a-fA-F]{64}$" - } - }, - "required":[ - "r", - "s", - "algo", - "pub" - ] } }, "required":[ "subject", "rootHash", - "type", - "signature" + "type" ] } \ No newline at end of file From 9ce84443af8a2164795280e8167a86b6bb59bd3e Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Thu, 9 Nov 2023 14:16:08 +0100 Subject: [PATCH 11/25] Applied suggestions to have flexible social links --- CIP-0072/version_1_offchain.json | 51 ++++++++------------------------ 1 file changed, 13 insertions(+), 38 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index a88eeaf9dc..86b403a94c 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -50,45 +50,20 @@ "description": "URLs to screenshots of DApp actual pages. We recommend to share screenshots from the dApp usage itself." }, "social": { - "type":"object", - "properties": { - "companyName": { - "type": "string", - "description": "Name of the company developing/maintaining the dApp", - "maxLength": 50 - }, - "companyEmail": { - "type": "string", - "description": "Email of the company developing/maintaining the dApp", - "maxLength": 150, - "format": "email" - }, - "companyWebsite": { - "type": "string", - "description": "Website of the company developing/maintaining the dApp", - "maxLength": 200, - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" - }, - "X.com": { - "type":"string", - "description": "An optional X.com link.", - "maxLength": 200, - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" - }, - "github": { - "type":"string", - "description": "An optional Github link.", - "maxLength": 200, - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" - }, - "discord": { - "type":"string", - "description": "An optional Discord link.", - "maxLength": 200, - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The platform or resource identifier (GitHub, Website, X.com, etc)" + }, + "link": { + "type": "string", + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" + } } - }, - "required": ["companyWebsite"] + } }, "description": { "type": "object", From 348186b108a295d6292785582a58652ef7b55c48 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Thu, 9 Nov 2023 15:08:09 +0100 Subject: [PATCH 12/25] Logo and screenshots gives you the posibility to add base64 images and changed version to follow semver --- CIP-0072/version_1_offchain.json | 75 +++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 16 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 86b403a94c..02ffcd608b 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -3,9 +3,9 @@ "type":"object", "properties": { "version": { - "type": "integer", - "minimum": 1, - "description": "Off-chain schema version" + "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?$", + "description": "Off-chain schema version following Semantic Versioning" }, "subject": { "type":"string", @@ -26,9 +26,31 @@ "maxLength": 200 }, "logo": { - "type": "string", - "description": "URL to the logo. Minimum resolution: 512x512px, supported formats: PNG/JPG/SVG, maximum file size: 0.5 MB", - "maxLength": 1000 + "description": "Logo as a URL or encoded in base64. Minimum resolution: 512x512px, supported formats: PNG/JPG/SVG, maximum file size: 1 MB for base64.", + "anyOf": [ + { + "type": "string", + "contentEncoding": "base64", + "oneOf": [ + { + "contentMediaType": "image/png" + }, + { + "contentMediaType": "image/jpeg" + }, + { + "contentMediaType": "image/svg+xml" + } + ], + "maxLength": 1361000 + }, + { + "type": "string", + "format": "uri", + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" + } + ], + "maxLength": 1361000 }, "categories": { "type":"array", @@ -42,12 +64,32 @@ "type": "array", "maxItems": 10, "items": { - "type": "string", - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", - "maxLength": 1000, - "description": "Minimum resolution: 1920x1080px, supported formats: PNG/JPG/SVG, maximum file size: 1 MB" + "description": "Screenshots as URLs or encoded in base64. Minimum resolution for base64 images: 1920x1080px, supported formats: PNG/JPG/SVG, maximum file size: 2 MB for base64.", + "anyOf": [ + { + "type": "string", + "contentEncoding": "base64", + "oneOf": [ + { + "contentMediaType": "image/png" + }, + { + "contentMediaType": "image/jpeg" + }, + { + "contentMediaType": "image/svg+xml" + } + ], + "maxLength": 2722000 + }, + { + "type": "string", + "format": "uri", + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" + } + ] }, - "description": "URLs to screenshots of DApp actual pages. We recommend to share screenshots from the dApp usage itself." + "description": "URLs to screenshots of DApp actual pages, or base64-encoded images. We recommend to share screenshots from the dApp usage itself." }, "social": { "type": "array", @@ -93,8 +135,8 @@ "properties": { "releaseNumber": { "type": "string", - "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*))?$", - "description": "Semver compatible release number (major.minor.patch) or (major.minor.patch-some_text) e.g. 1.2.3 or 1.1.1-alpha" + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?$", + "description": "Semver compatible release number (major.minor.patch)" }, "releaseName": { "type": "string", @@ -167,9 +209,10 @@ { "type":"object", "properties":{ - "version":{ - "type":"integer", - "description":"Script version, monotonically increasing." + "version": { + "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?$", + "description": "Script version following Semantic Versioning" }, "plutusVersion":{ "type":"integer", From e45f83080955a239dc023c5a0404d71d9626b5c7 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Thu, 9 Nov 2023 15:23:07 +0100 Subject: [PATCH 13/25] Added examples using the new schema --- CIP-0072/README.md | 109 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 90 insertions(+), 19 deletions(-) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index c274d47351..f291db6264 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -103,30 +103,102 @@ The dApp Registration certificate itself doesn't enforce a particular structure This schema describes the minimum required fields for a store to be able to display and validate your dApp. You can add any other fields you want to the metadata, but we recommend that you use at least the ones described above. -### Example +### Example using links of images ```json { - "subject": "9SYAJPNN", - "projectName": "My Project", - "link": "https://myProject.app", - "logo": "https://myProject.app/logo.png", - "social": { - "github": "https://mywebsite.com", - "twitter": "https://twitter.com/my_dapp", - "website": "https://github.com/my_dapp" + "version": "1.1.0", + "subject": "fedcba9876543210", + "projectName": "Super dApp", + "link": "https://www.supersdappplatform.com", + "logo": "https://www.supersdappplatform.com/logo.png", + "categories": ["Education", "Marketplace"], + "screenshots": [ + "https://www.supersdappplatform.com/screenshot1.jpg", + "https://www.supersdappplatform.com/screenshot2.jpg" + ], + "social": [ + { + "name": "Discord", + "link": "https://discord.gg/superdapp" + }, + { + "name": "Reddit", + "link": "https://reddit.com/r/superdapp" + } + ], + "description": { + "short": "Super dApp is revolutionizing the educational marketplace with blockchain technology." }, - "categories": ["Games"], + "releases": [ + { + "releaseNumber": "1.1.0-beta", + "releaseName": "Beta Release", + "securityVulnerability": false, + "comment": "Public beta release with new features and improvements.", + "scripts": [ + { + "id": "script2", + "version": 1 + } + ] + } + ], + "scripts": [ + { + "id": "script2", + "name": "Beta Script", + "purposes": ["MINT"], + "type": "NATIVE", + "versions": [ + { + "version": "0.1.0-alpha", + "plutusVersion": 2, + "scriptHash": "def456", + "contractAddress": "addr_test1v4..." + } + ] + } + ] +} +``` + +### Example using base64 images + +```json +{ + "version": "1.0.0", + "subject": "abcdef1234567890", + "projectName": "My dApp", + "link": "https://www.exampledapp.com", + "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAA...", + "categories": ["DeFi", "Games"], + "screenshots": [ + "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...", + "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD..." + ], + "social": [ + { + "name": "GitHub", + "link": "https://github.com/exampledapp" + }, + { + "name": "Twitter", + "link": "https://twitter.com/exampledapp" + } + ], "description": { - "short": "A story rich game where choices matter. This game is very addictive to play :)" + "short": "This is a short description of the dApp, giving an overview of its features and capabilities." }, "releases": [ { "releaseNumber": "1.0.0", - "releaseName": "V1", + "releaseName": "Initial Release", + "securityVulnerability": false, + "comment": "First major release with all core features.", "scripts": [ { - "id": "PmNd6w", + "id": "script1", "version": 1 } ] @@ -134,16 +206,15 @@ This schema describes the minimum required fields for a store to be able to disp ], "scripts": [ { - "id": "PmNd6w", - "name": "marketplace", - "purposes": ["SPEND"], + "id": "script1", + "name": "Example Script", + "purposes": ["SPEND", "MINT"], "type": "PLUTUS", "versions": [ { - "version": 1, + "version": "1.0.0", "plutusVersion": 1, - "scriptHash": "711dcb4e80d7cd0ed384da5375661cb1e074e7feebd73eea236cd68192", - "contractAddress": "addr1wywukn5q6lxsa5uymffh2esuk8s8fel7a0tna63rdntgrysv0f3ms" + "scriptHash": "abc123" } ] } From 7feba6a1ab229f2536aa9070309d6a61b7effab2 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Thu, 9 Nov 2023 16:10:37 +0100 Subject: [PATCH 14/25] Follow semver for all versions --- CIP-0072/version_1_offchain.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 02ffcd608b..fba79cb73f 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -160,7 +160,8 @@ "type": "string" }, "version": { - "type": "integer" + "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?$" } }, "required": [ From bd7de75e1752baad74591d182f5fb9a28d7ef13f Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Fri, 10 Nov 2023 12:59:00 +0100 Subject: [PATCH 15/25] Removed optional links, images only via base64. Added 3 new fields --- CIP-0072/README.md | 65 ++------------------------ CIP-0072/version_1_offchain.json | 79 ++++++++++++++++---------------- 2 files changed, 44 insertions(+), 100 deletions(-) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index f291db6264..8f007c8473 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -103,67 +103,7 @@ The dApp Registration certificate itself doesn't enforce a particular structure This schema describes the minimum required fields for a store to be able to display and validate your dApp. You can add any other fields you want to the metadata, but we recommend that you use at least the ones described above. -### Example using links of images - -```json -{ - "version": "1.1.0", - "subject": "fedcba9876543210", - "projectName": "Super dApp", - "link": "https://www.supersdappplatform.com", - "logo": "https://www.supersdappplatform.com/logo.png", - "categories": ["Education", "Marketplace"], - "screenshots": [ - "https://www.supersdappplatform.com/screenshot1.jpg", - "https://www.supersdappplatform.com/screenshot2.jpg" - ], - "social": [ - { - "name": "Discord", - "link": "https://discord.gg/superdapp" - }, - { - "name": "Reddit", - "link": "https://reddit.com/r/superdapp" - } - ], - "description": { - "short": "Super dApp is revolutionizing the educational marketplace with blockchain technology." - }, - "releases": [ - { - "releaseNumber": "1.1.0-beta", - "releaseName": "Beta Release", - "securityVulnerability": false, - "comment": "Public beta release with new features and improvements.", - "scripts": [ - { - "id": "script2", - "version": 1 - } - ] - } - ], - "scripts": [ - { - "id": "script2", - "name": "Beta Script", - "purposes": ["MINT"], - "type": "NATIVE", - "versions": [ - { - "version": "0.1.0-alpha", - "plutusVersion": 2, - "scriptHash": "def456", - "contractAddress": "addr_test1v4..." - } - ] - } - ] -} -``` - -### Example using base64 images +### Example ```json { @@ -171,6 +111,9 @@ This schema describes the minimum required fields for a store to be able to disp "subject": "abcdef1234567890", "projectName": "My dApp", "link": "https://www.exampledapp.com", + "companyName": "Amazing dApp Inc.", + "companyEmail": "contact@myamazingdapp.com", + "companyWebsite": "https://www.myamazingdapp.com", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAA...", "categories": ["DeFi", "Games"], "screenshots": [ diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index fba79cb73f..de17390617 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -25,29 +25,36 @@ "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", "maxLength": 200 }, + "companyName": { + "type":"string", + "description": "Company name", + "maxLength": 100 + }, + "companyEmail": { + "type":"string", + "description": "Email of the dApp developer", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "maxLength": 200 + }, + "companyWebsite": { + "type":"string", + "description": "Website of the company behind the dApp.", + "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", + "maxLength": 200 + }, "logo": { - "description": "Logo as a URL or encoded in base64. Minimum resolution: 512x512px, supported formats: PNG/JPG/SVG, maximum file size: 1 MB for base64.", - "anyOf": [ + "description": "Logo encoded in base64. Minimum resolution: 512x512px, supported formats: PNG/JPG/SVG, maximum file size: 1 MB", + "type": "string", + "contentEncoding": "base64", + "oneOf": [ { - "type": "string", - "contentEncoding": "base64", - "oneOf": [ - { - "contentMediaType": "image/png" - }, - { - "contentMediaType": "image/jpeg" - }, - { - "contentMediaType": "image/svg+xml" - } - ], - "maxLength": 1361000 + "contentMediaType": "image/png" }, { - "type": "string", - "format": "uri", - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" + "contentMediaType": "image/jpeg" + }, + { + "contentMediaType": "image/svg+xml" } ], "maxLength": 1361000 @@ -64,30 +71,21 @@ "type": "array", "maxItems": 10, "items": { - "description": "Screenshots as URLs or encoded in base64. Minimum resolution for base64 images: 1920x1080px, supported formats: PNG/JPG/SVG, maximum file size: 2 MB for base64.", - "anyOf": [ + "description": "Screenshots encoded in base64. Minimum resolution for base64 images: 1920x1080px, supported formats: PNG/JPG/SVG, maximum file size: 2 MB for base64.", + "type": "string", + "contentEncoding": "base64", + "oneOf": [ { - "type": "string", - "contentEncoding": "base64", - "oneOf": [ - { - "contentMediaType": "image/png" - }, - { - "contentMediaType": "image/jpeg" - }, - { - "contentMediaType": "image/svg+xml" - } - ], - "maxLength": 2722000 + "contentMediaType": "image/png" }, { - "type": "string", - "format": "uri", - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" + "contentMediaType": "image/jpeg" + }, + { + "contentMediaType": "image/svg+xml" } - ] + ], + "maxLength": 2722000 }, "description": "URLs to screenshots of DApp actual pages, or base64-encoded images. We recommend to share screenshots from the dApp usage itself." }, @@ -252,6 +250,9 @@ "subject", "projectName", "link", + "companyName", + "companyEmail", + "companyWebsite", "social", "categories", "description", From 47fd34ab3e3ecdc57e4eaaaadb43005f0478ab1d Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Fri, 10 Nov 2023 16:30:13 +0100 Subject: [PATCH 16/25] Changed some descriptions and added some mandatory fields --- CIP-0072/version_1_offchain.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index de17390617..654ad396da 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -21,7 +21,7 @@ }, "link": { "type":"string", - "description": "Website presenting a dApp.", + "description": "A link a dApp or a website presenting a DApp", "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", "maxLength": 200 }, @@ -32,7 +32,7 @@ }, "companyEmail": { "type":"string", - "description": "Email of the dApp developer", + "description": "Contact email of the company behind the dApp", "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", "maxLength": 200 }, @@ -87,7 +87,7 @@ ], "maxLength": 2722000 }, - "description": "URLs to screenshots of DApp actual pages, or base64-encoded images. We recommend to share screenshots from the dApp usage itself." + "description": "Screenshots of the DApp encoded in base64. We recommend to share screenshots from the dApp usage itself." }, "social": { "type": "array", @@ -122,7 +122,7 @@ } }, "required": [ - "short" + "long" ] }, "releases": { @@ -254,6 +254,7 @@ "companyEmail", "companyWebsite", "social", + "logo", "categories", "description", "version" From 0320ebeedf779fafaf53add459229e2bae6bcda4 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Mon, 13 Nov 2023 11:04:02 +0100 Subject: [PATCH 17/25] Added screenshots as mandatory --- CIP-0072/version_1_offchain.json | 1 + 1 file changed, 1 insertion(+) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 654ad396da..6ae295b15b 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -256,6 +256,7 @@ "social", "logo", "categories", + "screenshots", "description", "version" ] From 1dfdec3c06296b375f86005e3a4991ca8afb6161 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Mon, 13 Nov 2023 11:17:19 +0100 Subject: [PATCH 18/25] Removed ftp for links --- CIP-0072/version_1_offchain.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 6ae295b15b..11745e0a83 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -22,7 +22,7 @@ "link": { "type":"string", "description": "A link a dApp or a website presenting a DApp", - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", + "pattern": "((https?|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", "maxLength": 200 }, "companyName": { @@ -39,7 +39,7 @@ "companyWebsite": { "type":"string", "description": "Website of the company behind the dApp.", - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", + "pattern": "((https?|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", "maxLength": 200 }, "logo": { @@ -100,7 +100,7 @@ }, "link": { "type": "string", - "pattern": "((https?|ftp|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" + "pattern": "((https?|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" } } } From e271e30457fbb87c022b7cdf2adce45354084012 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Mon, 13 Nov 2023 13:41:32 +0100 Subject: [PATCH 19/25] Added short description to be mandatory --- CIP-0072/version_1_offchain.json | 1 + 1 file changed, 1 insertion(+) diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1_offchain.json index 11745e0a83..6ae268495b 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1_offchain.json @@ -122,6 +122,7 @@ } }, "required": [ + "short", "long" ] }, From 60a9085d5df2280c49df97fa74337a50056f85aa Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Wed, 15 Nov 2023 09:49:51 +0100 Subject: [PATCH 20/25] Applied suggestions after review --- CIP-0072/README.md | 6 +++--- ...{version_1_offchain.json => version_1.0.0_offchain.json} | 3 ++- .../{version_1_onchain.cddl => version_1.0.0_onchain.cddl} | 0 .../{version_1_onchain.json => version_1.0.0_onchain.json} | 0 4 files changed, 5 insertions(+), 4 deletions(-) rename CIP-0072/{version_1_offchain.json => version_1.0.0_offchain.json} (99%) rename CIP-0072/{version_1_onchain.cddl => version_1.0.0_onchain.cddl} (100%) rename CIP-0072/{version_1_onchain.json => version_1.0.0_onchain.json} (100%) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index 8f007c8473..b591c5d889 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -83,11 +83,11 @@ The on-chain dApp registration certificate MUST follow canonical JSON and be ser ### On-chain Schemas -[On-chain CDDL for registration / de-registration (Version 1)](./version_1_onchain.cddl) +[On-chain CDDL for registration / de-registration (Version 1.0.0)](./version_1.0.0_onchain.cddl) which also can be expressed using JSON schema: -[dApp on-chain certificate JSON Schema (Version 1)](./version_1_onchain.json) +[dApp on-chain certificate JSON Schema (Version 1.0.0)](./version_1.0.0_onchain.json) ### Metadata Label @@ -99,7 +99,7 @@ When submitting the transaction metadata pick the following value for `transacti The dApp Registration certificate itself doesn't enforce a particular structure to the metadata you might fetch off-chain. However, we recommend that you use the following structure: -[Off-chain dApp Registration certificate schema (Version 1)](./version_1_offchain.json) +[Off-chain dApp Registration certificate schema (Version 1)](./version_1.0.0_offchain.json) This schema describes the minimum required fields for a store to be able to display and validate your dApp. You can add any other fields you want to the metadata, but we recommend that you use at least the ones described above. diff --git a/CIP-0072/version_1_offchain.json b/CIP-0072/version_1.0.0_offchain.json similarity index 99% rename from CIP-0072/version_1_offchain.json rename to CIP-0072/version_1.0.0_offchain.json index 6ae268495b..841aeefe94 100644 --- a/CIP-0072/version_1_offchain.json +++ b/CIP-0072/version_1.0.0_offchain.json @@ -100,7 +100,8 @@ }, "link": { "type": "string", - "pattern": "((https?|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])" + "pattern": "((https?|ipfs|ipns):\/\/[\\u00C0-\\u017F-a-zA-Z0-9])", + "maxLength": 200 } } } diff --git a/CIP-0072/version_1_onchain.cddl b/CIP-0072/version_1.0.0_onchain.cddl similarity index 100% rename from CIP-0072/version_1_onchain.cddl rename to CIP-0072/version_1.0.0_onchain.cddl diff --git a/CIP-0072/version_1_onchain.json b/CIP-0072/version_1.0.0_onchain.json similarity index 100% rename from CIP-0072/version_1_onchain.json rename to CIP-0072/version_1.0.0_onchain.json From d2962782c3c2d67f64f10ba798e8a24f38b420a8 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Thu, 16 Nov 2023 10:20:45 +0100 Subject: [PATCH 21/25] Bump version to 2.0.0 and removed schema topic in rationale --- CIP-0072/README.md | 11 ++++------- ....0.0_offchain.json => version_2.0.0_offchain.json} | 0 ..._1.0.0_onchain.cddl => version_2.0.0_onchain.cddl} | 1 - ..._1.0.0_onchain.json => version_2.0.0_onchain.json} | 0 4 files changed, 4 insertions(+), 8 deletions(-) rename CIP-0072/{version_1.0.0_offchain.json => version_2.0.0_offchain.json} (100%) rename CIP-0072/{version_1.0.0_onchain.cddl => version_2.0.0_onchain.cddl} (95%) rename CIP-0072/{version_1.0.0_onchain.json => version_2.0.0_onchain.json} (100%) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index b591c5d889..b25dfd5469 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -6,6 +6,7 @@ Category: Metadata Authors: - Bruno Martins - Mateusz Czeladka + - Daniel Main Implementors: ["Lace Wallet dApp Store", "DappsOnCardano dApp Store"] Discussions: - https://github.com/cardano-foundation/CIPs/pull/355 @@ -83,11 +84,11 @@ The on-chain dApp registration certificate MUST follow canonical JSON and be ser ### On-chain Schemas -[On-chain CDDL for registration / de-registration (Version 1.0.0)](./version_1.0.0_onchain.cddl) +[On-chain CDDL for registration / de-registration (Version 2.0.0)](./version_2.0.0_onchain.cddl) which also can be expressed using JSON schema: -[dApp on-chain certificate JSON Schema (Version 1.0.0)](./version_1.0.0_onchain.json) +[dApp on-chain certificate JSON Schema (Version 2.0.0)](./version_2.0.0_onchain.json) ### Metadata Label @@ -99,7 +100,7 @@ When submitting the transaction metadata pick the following value for `transacti The dApp Registration certificate itself doesn't enforce a particular structure to the metadata you might fetch off-chain. However, we recommend that you use the following structure: -[Off-chain dApp Registration certificate schema (Version 1)](./version_1.0.0_offchain.json) +[Off-chain dApp Registration certificate schema (Version 2)](./version_2.0.0_offchain.json) This schema describes the minimum required fields for a store to be able to display and validate your dApp. You can add any other fields you want to the metadata, but we recommend that you use at least the ones described above. @@ -261,10 +262,6 @@ some app that can attest validity and conformance to JSON schema - dApp Registra We made a decision to change the schema so that scripts and releases are no longer required. This could help to get initial registration from dApp developers faster and some stores simply do not require dApps to add their scripts in order to be listed. -### Schema Version - -We discussed and analyzed idea of schema version and or even whole CIP version. It turns out that CIP is already versioned by CIP-??? where ??? is version number. During this CIP being in `PROPOSED` state we reserve our right to make small changes to the schema / document, after CIP becomes active, it will require a new CIP. This is the current process, which other CIPs are also following. - ### Tags We briefly discussed tags and we will likely introduce tags in the future. An array of tags to help stores / dApp developers categories where their dApp should show. This will complement `categories` field. diff --git a/CIP-0072/version_1.0.0_offchain.json b/CIP-0072/version_2.0.0_offchain.json similarity index 100% rename from CIP-0072/version_1.0.0_offchain.json rename to CIP-0072/version_2.0.0_offchain.json diff --git a/CIP-0072/version_1.0.0_onchain.cddl b/CIP-0072/version_2.0.0_onchain.cddl similarity index 95% rename from CIP-0072/version_1.0.0_onchain.cddl rename to CIP-0072/version_2.0.0_onchain.cddl index e37d17ec3c..9219871a5a 100644 --- a/CIP-0072/version_1.0.0_onchain.cddl +++ b/CIP-0072/version_2.0.0_onchain.cddl @@ -11,7 +11,6 @@ on-chain_metadata = { rootHash: sig_256, metadata: [+ string] / [+ string / [+ string]], type: registration / de-registration, - signature: signature, } registration = { diff --git a/CIP-0072/version_1.0.0_onchain.json b/CIP-0072/version_2.0.0_onchain.json similarity index 100% rename from CIP-0072/version_1.0.0_onchain.json rename to CIP-0072/version_2.0.0_onchain.json From f2615d63037ad809b59ac8c1ca7f83f7ac4c2d4c Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Fri, 17 Nov 2023 16:46:56 +0100 Subject: [PATCH 22/25] =?UTF-8?q?There=20is=20no=20point=20defining=20a=20?= =?UTF-8?q?schema=20if=20it=20can=20be=20violated=20=F0=9F=A4=B7=E2=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CIP-0072/README.md | 2 +- CIP-0072/version_2.0.0_offchain.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index b25dfd5469..7e2737b591 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -102,7 +102,7 @@ The dApp Registration certificate itself doesn't enforce a particular structure [Off-chain dApp Registration certificate schema (Version 2)](./version_2.0.0_offchain.json) -This schema describes the minimum required fields for a store to be able to display and validate your dApp. You can add any other fields you want to the metadata, but we recommend that you use at least the ones described above. +This schema describes the minimum required fields for a store to be able to display and validate your dApp. ### Example diff --git a/CIP-0072/version_2.0.0_offchain.json b/CIP-0072/version_2.0.0_offchain.json index 841aeefe94..2870670aa0 100644 --- a/CIP-0072/version_2.0.0_offchain.json +++ b/CIP-0072/version_2.0.0_offchain.json @@ -261,5 +261,6 @@ "screenshots", "description", "version" - ] - } + ], + "additionalProperties": false +} From 8713cfe44a8233148eddc25a109b6cc68cda0807 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Fri, 17 Nov 2023 16:59:54 +0100 Subject: [PATCH 23/25] Applied suggestion, we are not signing the off-chain data anymore. --- CIP-0072/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index 7e2737b591..d3827d9c6b 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -50,9 +50,7 @@ Stores and auditors should be able to follow the chain and find when a new dApp - **`integrity`**: The dApp's off-chain metadata should match the metadata **anchored** on-chain. - **`trust`**: The dApp's certificate should be signed by a trusted entity. It's up to the store/auditor to decide which entities are trusted and they should maintain and publish their own list of trusted entities. Although this entities might be well known, it's not the responsibility of this CIP to maintain this list. These entities could be directly associated with developer/publisher or not. -### **On-chain dApp Registration Certificate** - -The on-chain dApp registration certificate MUST follow canonical JSON and be serialised according to RFC 8785 (https://www.rfc-editor.org/rfc/rfc8785). +### **On-chain dApp Registration** ```json { From 950e50ed2b2682d79662ff663176e5e858ea93ab Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Tue, 21 Nov 2023 09:46:13 +0100 Subject: [PATCH 24/25] URL settings simplified --- CIP-0072/README.md | 7 ++++-- CIP-0072/version_2.0.0_onchain.json | 39 +++++++++++------------------ 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index d3827d9c6b..9d4f7bee98 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -57,7 +57,10 @@ Stores and auditors should be able to follow the chain and find when a new dApp "subject": "b37aabd81024c043f53a069c91e51a5b52e4ea399ae17ee1fe3cb9c44db707eb", "rootHash": "7abcda7de6d883e7570118c1ccc8ee2e911f2e628a41ab0685ffee15f39bba96", "metadata": [ - "https://foundation.app/my_dapp_7abcda.json" + "https://foundation.app/my_dapp_7abcda/tart/", + "7abcda7de6d883e7570118c1ccc8ee2e91", + "e4ea399ae17ee1fe3cb9c44db707eb/", + "offchain.json" ], "type": { "action": "REGISTER", @@ -78,7 +81,7 @@ Stores and auditors should be able to follow the chain and find when a new dApp *`rootHash`*: The blake2b-256 hash of the entire offchain metadata tree object. This hash is used by clients to verify the integrity of the metadata tree object. When reading a metadata tree object, the client should calculate the hash of the object and compare it with the `rootHash` property. If the two hashes don't match, the client should discard the object. The metadata tree object is a JSON object that contains the dApp's metadata. The metadata tree object is described in the next section. Please note that off-chain JSON must be converted into RFC 8765 canonical form before taking the hash! -*`metadata`*: An array of links to the dApp's metadata. The metadata is a JSON compatible RFC 8785 object that contains the dApp's metadata. +*`metadata`*: Chunks of URLs that make up the dApp's metadata are arranged in an array to accommodate the 64-character limit per chunk, allowing for the support of longer URLs. The metadata itself is a JSON object compatible with RFC 8785, containing detailed information about the dApp ### On-chain Schemas diff --git a/CIP-0072/version_2.0.0_onchain.json b/CIP-0072/version_2.0.0_onchain.json index f679c498d6..0942715c14 100644 --- a/CIP-0072/version_2.0.0_onchain.json +++ b/CIP-0072/version_2.0.0_onchain.json @@ -7,35 +7,25 @@ "properties":{ "subject":{ "type":"string", - "minLength": 1, - "maxLength": 64, - "pattern":"^[0-9a-fA-F]{1,64}$", - "description":"Identifier of the claim subject (dApp). A UTF-8 encoded string, must be max 64 chars. Typically it is randomly generated hash by the dApp developer." + "minLength": 1, + "maxLength": 64, + "pattern":"^[0-9a-fA-F]{1,64}$", + "description":"Identifier of the claim subject (dApp). A UTF-8 encoded string, must be max 64 chars. Typically it is randomly generated hash by the dApp developer." }, "rootHash":{ "type":"string", - "minLength": 64, - "maxLength": 64, - "pattern":"^[0-9a-fA-F]{64}$", - "description":"blake2b-256 hash of the metadata describing the off-chain part of the dApp." + "minLength": 64, + "maxLength": 64, + "pattern":"^[0-9a-fA-F]{64}$", + "description":"blake2b-256 hash of the metadata describing the off-chain part of the dApp." }, "metadata": { "type": "array", - "description": "An array of valid URLs pointing to off-chain CIP-72 compatible metadata document. If an individual URL is longer than 64 characters, it must be expressed as an array of strings (where each string may contain at most 64 characters).", + "description": "Chunks of URLs that make up the dApp's metadata (pointing to off-chain CIP-72) are arranged in an array to accommodate the 64-character limit per chunk, allowing for the support of longer URLs", "items": { - "anyOf": [{ - "type": "string", - "minLength": 1, - "maxLength": 64 - }, { - "type": "array", - "items": { - "type": "string", - "minLength": 1, - "maxLength": 64 - } - }], - "examples": ["https://raw.githubusercontent.com/org/repo/offchain.json", ["https://raw.githubusercontent.com/long-org-name/", "long-repo-name/offchain.json"], "ipfs://QmbQDvKJeo2NgGcGdnUiUFibTzuKNK5Uij7jzmK8ZccmWp", ["ipfs://QmbQDvKJeo2NgGcGdnUiaAdADA", "UFibTzuKNKc0jA390alDAD5Uij7jzmK8ZccmWp"]] + "type": "string", + "minLength": 1, + "maxLength": 64 } }, "type":{ @@ -63,6 +53,7 @@ "subject", "rootHash", "type" - ] - } + ], + "additionalProperties": false +} \ No newline at end of file From b625f3462ccbc783213c200fc077fdfd26989099 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Tue, 21 Nov 2023 11:12:07 +0100 Subject: [PATCH 25/25] Fixed version to follow semver --- CIP-0072/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIP-0072/README.md b/CIP-0072/README.md index 9d4f7bee98..ad32d2d51c 100644 --- a/CIP-0072/README.md +++ b/CIP-0072/README.md @@ -144,7 +144,7 @@ This schema describes the minimum required fields for a store to be able to disp "scripts": [ { "id": "script1", - "version": 1 + "version": "1.0.0" } ] }