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-0067 | Asset Name Label Registry #298

Merged
merged 13 commits into from
Oct 25, 2022
49 changes: 49 additions & 0 deletions CIP-0067/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
CIP:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
CIP:
CIP: 67

Title: Asset Name Label Registry
Authors: Alessandro Konrad <alessandro.konrad@live.de>, Thomas Vellekoop <thomas.vellekoop@iohk.io>
Comments-URI:
Status: Draft
rphair marked this conversation as resolved.
Show resolved Hide resolved
Type: Informational
Created: 2022-07-13
Post-History:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Post-History:

License: CC-BY-4.0
---

## Abstract

This proposal defines a standard to classify Cardano native assets by the asset name.

## Motivation

As more assets are minted and different standards are used to query data for these assets, it's gettinger harder for 3rd parties to determine the asset type and how to proceed with it. This standard is similar to [CIP-0010](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0010), but focuses on the asset name of an asset.


## Specification

To classify assets the `asset_name` needs to be prefixed with an opening and closing parentheses and the label in betwen: `({Label})`.

KtorZ marked this conversation as resolved.
Show resolved Hide resolved
For example:

UTF-8 encoded: `(123)TestToken`\
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, (333) ends up taking 5 bytes of ascii which is more than coming up with a binary specification for this. I guess the advantage is that this is human readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's true, I think the compromise is worth it. With 5-6 bytes you still have 25-26 bytes free in the asset name.
I also thought about encoding it in binary, but you won't be able to ever utf-8 encode the asset name again. The only solution I have in mind here is to split the asset name in two parts if a label was detected in the asset name. Decode the label separately and the remaining asset name to make both parts human readable if applicable.

HEX encoded: `283132332954657374546F6B656E`


These are the reserved `asset_name_label` values

`asset_name_label` | description
---------------------------- | -----------------------
0 - 15 | reserved\*
Copy link
Member

Choose a reason for hiding this comment

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

What does the asterisk points to?

65536 - 131071 | reserved - private use

For the registry itself, please see [registry.json](./registry.json) in the machine-readable format. Please open your pull request against
this file.
Copy link
Member

Choose a reason for hiding this comment

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

One problem we had / have with CIP-0010 is that there's no particular "rule" that defines what can go in the registry. As editors we try to do some basic sanity check and ask people to pitch / justify a bit their project; but it would be nice / preferable if these rules were specified in the specification itself. For example:


Adding an entry to the registry

To propose an addition to the registry edit the registry.json with your details, open a pull request against the CIPs repository and give a brief description of your project and how you intend to use metadata associated with the label entry.



## References

- CIP-0010: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0010

## Copyright

This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode).
1 change: 1 addition & 0 deletions CIP-0067/registry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
62 changes: 62 additions & 0 deletions CIP-0067/registry.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-?",
Copy link
Member

Choose a reason for hiding this comment

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

"type": "array",
"title": "Asset Name Label Registry",
"description": "JSON schema for asset name label registry",
"default": [],
"examples": [
[
{
"asset_name_label": 721,
"class": "NFT",
"description": "CIP-0025 - NFT Metadata Standard"
}
]
],
"additionalItems": false,
"items": {
"$id": "#/items",
"anyOf": [
{
"$id": "#/items/anyOf/0",
"type": "object",
"title": "The first anyOf schema",
"description": "An entry in the asset name label registry",
"default": {},
"examples": [
{
"asset_name_label": 721,
"class": "NFT",
"description": "CIP-0025 - NFT Metadata Standard"
}
],
"required": ["asset_name_label", "class", "description"],
"properties": {
"asset_name_label": {
"$id": "#/items/anyOf/0/properties/asset_name_label",
"type": "integer",
"title": "The asset_name_label number",
"default": 0,
"examples": [1967]
},
"class": {
"$id": "#/items/anyOf/0/properties/class",
"type": "string",
"title": "The asset class",
KtorZ marked this conversation as resolved.
Show resolved Hide resolved
"default": "",
"examples": ["NFT", "FT"]
},
"description": {
"$id": "#/items/anyOf/0/properties/description",
"type": "string",
"title": "The asset name label description",
"default": "",
"examples": ["CIP-0025 - NFT Metadata Standard"]
}
},
"additionalProperties": true
Copy link
Member

Choose a reason for hiding this comment

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

Why allow additional properties?

}
]
}
}