From e3de0a6070295f3e969fe994bdfb40310733c088 Mon Sep 17 00:00:00 2001 From: alessandrokonrad Date: Fri, 21 Oct 2022 00:15:23 +0200 Subject: [PATCH 1/5] Changed decimals from big_int to int; changed logo from PNG bytestring to URI in 333 standard --- CIP-0068/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CIP-0068/README.md b/CIP-0068/README.md index 28a670a61..23877d119 100644 --- a/CIP-0068/README.md +++ b/CIP-0068/README.md @@ -171,6 +171,8 @@ This is a low-level representation of the metadata, following closely the struct ``` ; Explanation here: https://developers.cardano.org/docs/native-tokens/token-registry/cardano-token-registry/ +; NOTE: logo is an exception and is not a PNG bytestring, but a URI, so that links and data uris with all image types are possible (see below) + metadata = { @@ -178,8 +180,8 @@ metadata = description : bounded_bytes, ; UTF-8 ? ticker: bounded_bytes, ; UTF-8 ? url: bounded_bytes, ; UTF-8 - ? logo: bounded_bytes, ; UTF-8 - ? decimals: big_int + ? logo: bounded_bytes, ; UTF-8, URI (not a PNG bytestring like in the explanation. Valid formats: ("https://...", "ipfs://...", "data:...", etc.)) + ? decimals: int } datum = #6.121([metadata, 1]) ; version 1 From 24d43c08b509980502af38444ac6d1673ca8f7b8 Mon Sep 17 00:00:00 2001 From: alessandrokonrad Date: Fri, 21 Oct 2022 00:25:12 +0200 Subject: [PATCH 2/5] style fix --- CIP-0068/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CIP-0068/README.md b/CIP-0068/README.md index 23877d119..bac2fce66 100644 --- a/CIP-0068/README.md +++ b/CIP-0068/README.md @@ -171,8 +171,7 @@ This is a low-level representation of the metadata, following closely the struct ``` ; Explanation here: https://developers.cardano.org/docs/native-tokens/token-registry/cardano-token-registry/ -; NOTE: logo is an exception and is not a PNG bytestring, but a URI, so that links and data uris with all image types are possible (see below) - +; NOTE: 'logo' is an exception and is not a PNG bytestring, but a URI, so that links and data uris with all image types are possible (see below) metadata = { From 885b8d54173303d6934ee6de010f2c82d4ff50c1 Mon Sep 17 00:00:00 2001 From: alessandrokonrad Date: Fri, 21 Oct 2022 14:23:17 +0200 Subject: [PATCH 3/5] added long_bytes; updated explanation; restricted logo to only certain media types --- CIP-0068/README.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/CIP-0068/README.md b/CIP-0068/README.md index bac2fce66..6958ce4ff 100644 --- a/CIP-0068/README.md +++ b/CIP-0068/README.md @@ -101,19 +101,21 @@ Example:\ This is a low-level representation of the metadata, following closely the structure of CIP-0025. All UTF-8 encoded keys and values need to be converted into their respective byte's representation when creating the datum on-chain. ``` +long_bytes = bounded_bytes / [ * bounded_bytes ] + files_details = { ? name : bounded_bytes, ; UTF-8 mediaType : bounded_bytes, ; UTF-8 - src : bounded_bytes ; UTF-8 + src : long_bytes ; UTF-8 } metadata = { name : bounded_bytes, ; UTF-8 - image : bounded_bytes, ; UTF-8 + image : long_bytes, ; UTF-8 ? mediaType : bounded_bytes, ; UTF-8 - ? description : bounded_bytes, ; UTF-8 + ? description : long_bytes, ; UTF-8 ? files : [* files_details] } @@ -171,17 +173,25 @@ This is a low-level representation of the metadata, following closely the struct ``` ; Explanation here: https://developers.cardano.org/docs/native-tokens/token-registry/cardano-token-registry/ -; NOTE: 'logo' is an exception and is not a PNG bytestring, but a URI, so that links and data uris with all image types are possible (see below) + +long_bytes = bounded_bytes / [ * bounded_bytes ] metadata = { name : bounded_bytes, ; UTF-8 - description : bounded_bytes, ; UTF-8 + description : long_bytes, ; UTF-8 ? ticker: bounded_bytes, ; UTF-8 - ? url: bounded_bytes, ; UTF-8 - ? logo: bounded_bytes, ; UTF-8, URI (not a PNG bytestring like in the explanation. Valid formats: ("https://...", "ipfs://...", "data:...", etc.)) + ? url: long_bytes, ; UTF-8 + ? logo: uri ? decimals: int } + +; A URI as a UTF-8 encoded bytestring. +; The URI scheme must be one of `https`, `ipfs` or `data` +; Do not encode plain file payloads as URI. +; 'logo' does not follow the explanation of the token-registry, it needs to be a valid URI and not a plain bytestring. +; Only use the following media types: `image/png`, `image/jpeg`, `image/svg+xml` +uri = long_bytes datum = #6.121([metadata, 1]) ; version 1 ``` From bf6e0712d7a905d99737137fdbbb89c75914757b Mon Sep 17 00:00:00 2001 From: alessandrokonrad Date: Fri, 21 Oct 2022 14:28:11 +0200 Subject: [PATCH 4/5] added missing comma --- CIP-0068/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIP-0068/README.md b/CIP-0068/README.md index 6958ce4ff..f9f1c6454 100644 --- a/CIP-0068/README.md +++ b/CIP-0068/README.md @@ -182,7 +182,7 @@ metadata = description : long_bytes, ; UTF-8 ? ticker: bounded_bytes, ; UTF-8 ? url: long_bytes, ; UTF-8 - ? logo: uri + ? logo: uri, ? decimals: int } From 452dca22be7f9ef78a40b80ad39869f1a4ba9e6c Mon Sep 17 00:00:00 2001 From: alessandrokonrad Date: Sun, 23 Oct 2022 15:04:35 +0200 Subject: [PATCH 5/5] revert to bounded_bytes only --- CIP-0068/README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/CIP-0068/README.md b/CIP-0068/README.md index f9f1c6454..bcee79e70 100644 --- a/CIP-0068/README.md +++ b/CIP-0068/README.md @@ -101,21 +101,19 @@ Example:\ This is a low-level representation of the metadata, following closely the structure of CIP-0025. All UTF-8 encoded keys and values need to be converted into their respective byte's representation when creating the datum on-chain. ``` -long_bytes = bounded_bytes / [ * bounded_bytes ] - files_details = { ? name : bounded_bytes, ; UTF-8 mediaType : bounded_bytes, ; UTF-8 - src : long_bytes ; UTF-8 + src : bounded_bytes ; UTF-8 } metadata = { name : bounded_bytes, ; UTF-8 - image : long_bytes, ; UTF-8 + image : bounded_bytes, ; UTF-8 ? mediaType : bounded_bytes, ; UTF-8 - ? description : long_bytes, ; UTF-8 + ? description : bounded_bytes, ; UTF-8 ? files : [* files_details] } @@ -174,14 +172,12 @@ This is a low-level representation of the metadata, following closely the struct ``` ; Explanation here: https://developers.cardano.org/docs/native-tokens/token-registry/cardano-token-registry/ -long_bytes = bounded_bytes / [ * bounded_bytes ] - metadata = { name : bounded_bytes, ; UTF-8 - description : long_bytes, ; UTF-8 + description : bounded_bytes, ; UTF-8 ? ticker: bounded_bytes, ; UTF-8 - ? url: long_bytes, ; UTF-8 + ? url: bounded_bytes, ; UTF-8 ? logo: uri, ? decimals: int } @@ -191,7 +187,7 @@ metadata = ; Do not encode plain file payloads as URI. ; 'logo' does not follow the explanation of the token-registry, it needs to be a valid URI and not a plain bytestring. ; Only use the following media types: `image/png`, `image/jpeg`, `image/svg+xml` -uri = long_bytes +uri = bounded_bytes datum = #6.121([metadata, 1]) ; version 1 ```