Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIP-0072 | Off-chain schema versioning and schema adjustments #612

Merged
merged 25 commits into from
Nov 28, 2023

Conversation

marcin-mazurek
Copy link
Contributor

@marcin-mazurek marcin-mazurek commented Oct 23, 2023

Lace team would like to add a version property for versioning off-chain metadata following the pattern from CIP-25 as well as propose some updates to the schema based on the development done so far.

Additionally, we would like to clarify the algorithm used for root hash calculation to avoid ambiguity.

Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks straightforward... @marcin-mazurek given that this was filed as Draft (not yet ready for review), are there any planned changes before we review it? (If not you can mark it Ready for Review, or editors can.)

CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
@rphair rphair added the Category: Metadata Proposals belonging to the 'Metadata' category. label Oct 24, 2023
@marcin-mazurek
Copy link
Contributor Author

@rphair I marked it as draft to collect some preliminary feedback internally, I'm aiming to mark it as Ready for review today. I'm sorry for the confusion, next time I'm going to ask for internal review in the repository fork.

@rphair
Copy link
Collaborator

rphair commented Oct 24, 2023

thanks @marcin-mazurek, based on what you've said in #612 (comment) I would be happy to approve it as soon as all your final changes are posted & officially marked ready.

@marcin-mazurek marcin-mazurek changed the title CIP-0072 | Off-chain schema versioning, new categories CIP-0072 | Off-chain schema versioning and schema adjustments Oct 25, 2023
@marcin-mazurek marcin-mazurek marked this pull request as ready for review October 26, 2023 15:56
@marcin-mazurek
Copy link
Contributor Author

@rphair this is now ready for review

Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @marcin-mazurek, looks good from my own point of view (not working directly with dApps) & any additional technical confirmation would also be welcome so please feel free to tag them here. 😎 cc @matiwinnetou

CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
CIP-0072/version_1_offchain.json Show resolved Hide resolved
CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
"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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the benefit by limiting this, if this is offchain?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcin-mazurek I'd also like to know why this was added. From experience I know in the vast majority of cases it's a sensible limit, and also that the hard limit will make something fail at some future time. What is the actual risk for these values to have an arbitrary & potentially huge length?

@danielmain
Copy link
Contributor

@rphair I made some changes, regarding the twitter vs x.com, and I modified the regex to accept more URLs and IPFS addresses. Would you pls review it again 🙏🏻

Thank you in advance ❤️

Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @danielmain everything looks even better & thanks for attending to the URL form. This is still pending acceptance by 1 other CIP reviewer (I invited them all last week) and hopefully in the meantime @marcin-mazurek will answer your pending question #612 (comment).

Copy link
Collaborator

@Crypto2099 Crypto2099 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this should be changed prior to approval since the intent here is to clean up and enhance the off-chain metadata format.

CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
Copy link
Contributor

@danielmain danielmain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signature has been removed since every cardano transaction has it own signature. The transaction signature (or called Witness) can be used to prove the owner in case of a dApp update or deregistration.

CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
CIP-0072/version_1_offchain.json Outdated Show resolved Hide resolved
"type": "string",
"description": "The platform or resource identifier (GitHub, Website, X.com, etc)"
},
"link": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other links have max 200 chars allowed. Should we have it here too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, thank you 😉


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.
Copy link
Collaborator

@Ryun1 Ryun1 Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the rationale behind relying on transaction witnesses rather than what was originally proposed?

For me, relying on transaction signatures just adds an extra step to the verification whilst also restricting the type of keys/crypto that can be used. I also liked the property that the one registering did not have to be the one creating and submitting the Tx.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ryun1 thank u for the review

What is the rationale behind relying on transaction witnesses rather than what was originally proposed?

After evaluating the situation, my colleagues and I found it puzzling to require two signatures 🤷. I reached out to @matiwinnetou for clarification and discovered the additional signature was initially implemented because Blockfrost did not support witness signatures in transaction fetching a year ago. However, I personally believe that our decision should not be solely based on whether Blockfrost supports a feature or not. With tools like cardano-cli, cardano-wallet, Daedalus, and cardano-services that do support witness signatures, it seems more logical and efficient to make this CIP simpler by adhering to this available technology.

Just adds an extra step to the verification whilst also restricting the type of keys/crypto that can be used.

Indeed, our goal is to streamline the process. By focusing on simplification, we can avoid unnecessary steps in verification and avoid limiting the types of keys/crypto that can be used.

I also liked the property that the one registering did not have to be the one creating and submitting the Tx.

While this flexibility might seem advantageous, I view the requirement for the same key used in initial dApp registration for updates (such as domain changes or rebranding) as a beneficial feature. It adds a layer of security and consistency, ensuring that only authorized updates are made to a dApp.

CIP-0072/README.md Outdated Show resolved Hide resolved
@Ryun1
Copy link
Collaborator

Ryun1 commented Nov 13, 2023

Hey @marcin-mazurek,

These are some sizable changes and I am curious for the reasons behind these changes.
With such reasons being reflected within the Rationale section, which also needs a tidy as it is currently somewhat confusing in places such as Schema Version.

Since this is a proposed CIP, I would generally be hesitant to make such changes without incrementing the version.
I don't really know the extent of implementations and such the impact of changing this version 1.
I would consider calling this version 2, if there are any existing implementations.

@danielmain
Copy link
Contributor

danielmain commented Nov 16, 2023

These are some sizable changes and I am curious for the reasons behind these changes.

1- Simplify the dApp registration for: dApp developers and the team behind implementing the CIP
2- Clear define the minimum off-chain-metadata provided for the dApp
3- Define types and limits of each off-chain-metadata.

@danielmain
Copy link
Contributor

With such reasons being reflected within the Rationale section, which also needs a tidy as it is currently somewhat confusing in places such as Schema Version.

Removed

@danielmain
Copy link
Contributor

Since this is a proposed CIP, I would generally be hesitant to make such changes without incrementing the version.

We incremented it to 2.0.0 also in file names, is that ok?

@danielmain
Copy link
Contributor

I don't really know the extent of implementations and such the impact of changing this version 1.

Reduce effort for dApp developers when registering and reduce abiguity

@danielmain
Copy link
Contributor

I would consider calling this version 2, if there are any existing implementations.

We bumped it to 2.0.0 and as far we know there are no implementations out there yet

}
},
"required":[
"subject",
"rootHash",
"type",
"signature"
"type"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are missing the additionalProperties: false here. According to the docs by default any additional properties are allowed, which is not the case for the on-chain json. Accoring to the CIP-72 additional properties are allowed for the off-chain json, but it doesn't say the same for the on-chain one, so I guess we should restrict it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@@ -51,7 +52,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).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we removed the signature, we don't need to be canonical anymore

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed 🙂. Thank you!

@Ryun1 Ryun1 merged commit d576faf into cardano-foundation:master Nov 28, 2023
Ryun1 pushed a commit to Ryun1/CIPs that referenced this pull request Mar 6, 2024
…o-foundation#612)

* Specify hashing algorithm for rootHash calculation

* Add off-chain version property

* Update categories with Lace DApp Store category list

* Add DApp screenshot and company detail fields

* Remove duplicated/ambiguous website property

* Add some property length constraints and describe image requirements

* Specify property length limit for the rest `social` props

* Fix a typo

* Enhanced the regex for URLs to be more permissive by allowing ipfs and other protocols. Renamed twitter to x.com

* Removed extra signature in the on-chain metadata

* Applied suggestions to have flexible social links

* Logo and screenshots gives you the posibility to add base64 images and changed version to follow semver

* Added examples using the new schema

* Follow semver for all versions

* Removed optional links, images only via base64. Added 3 new fields

* Changed some descriptions and added some mandatory fields

* Added screenshots as mandatory

* Removed ftp for links

* Added short description to be mandatory

* Applied suggestions after review

* Bump version to 2.0.0 and removed schema topic in rationale

* There is no point defining a schema if it can be violated 🤷‍

* Applied suggestion, we are not signing the off-chain data anymore.

* URL settings simplified

* Fixed version to follow semver

---------

Co-authored-by: Daniel Main <daniel@funktional.dev>
Co-authored-by: Daniel Main <daniel.main.cernhoff@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Metadata Proposals belonging to the 'Metadata' category.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants